Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR refactors the tavern/internal/c2 package to use Composition over Inheritance. It extracts duplicate logic into small, focused service packages: validation, registration, taskctx, and transaction. This improves code readability and maintainability.


PR created automatically by Jules for task 11200402250636169771 started by @KCarretto

Extracted duplicated logic from C2 handlers into standalone services:
- `validation`: Handles request validation (e.g., Beacon requests).
- `registration`: Handles Host and Beacon upsertion logic.
- `taskctx`: Handles loading Task/Beacon/Quest/Creator context.
- `transaction`: encapsulation of transaction lifecycle management.

Handlers `ClaimTasks`, `ReportProcessList`, and `ReverseShell` have been refactored to use these services, improving maintainability and reducing code duplication.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2337    ±0 2337    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#117 2337 2337 0 0 0 0 not captured

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2337 0 0 43.8s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
eldritch: random::string_impl::tests::test_string_uniform 3 39.7s 43.8s
eldritch: random::string_impl::tests::test_string_uniform 3 39.7s 43.8s
eldritch: random::string_impl::tests::test_string_uniform 3 39.7s 43.8s
eldritch: process::info_impl::tests::test_info_default 3 2.7s 8.0s
eldritch: process::info_impl::tests::test_info_default 3 2.7s 8.0s
eldritch: process::info_impl::tests::test_info_default 3 2.7s 8.0s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 3 2.5s 7.5s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 3 2.5s 7.5s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 3 2.5s 7.5s
eldritch: pivot::ssh_copy_impl::tests::test_pivot_ssh_copy 3 3.8s 7.4s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

@KCarretto KCarretto closed this Dec 31, 2025
@KCarretto KCarretto deleted the code-cleanup-refactoring-tavern-c2-11200402250636169771 branch December 31, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant