Skip to content

feat(oncall): add supervised live-provider drill - #15

Merged
LE0ST merged 16 commits into
mainfrom
project1/deepseek-adapter
Oct 28, 2026
Merged

LE0ST merged 16 commits into
mainfrom
project1/deepseek-adapter

Conversation

@LE0ST

@LE0ST LE0ST commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Related to #4.

Adds a local supervised drill that can request a remediation diff from DeepSeek, evaluate it in an isolated worker, and present it for human review before applying it to a disposable workspace. Offline mode remains provider-isolated, and automatic application to the original checkout remains disabled.

The maintainer reports one live-provider run at 2cc525107d2cf977e8c9dc9e0bf68b0f478b5a65: a diff removing the injected urgent-task regression was reviewed and approved, applied to a disposable workspace, and reported after=passed. This is a maintainer report, not an independently inspected run artifact.

The live drill was not connected to a real alert and does not demonstrate autonomous remediation or production repair. Pytest is advisory because candidate code runs in the test process. HTTP checks use a separate process inside the same container, and SQLite verification shares the candidate's user and filesystem permissions. The drill requires human supervision and no concurrent writers.

The responder suite passed 144 tests locally during implementation at 2cc5251; the live-mode tests intercepted provider transport. The published branch HEAD had no GitHub CI runs before this PR was opened. Review and PR checks remain necessary.

LE0ST added 16 commits October 26, 2026 12:07
- Add DeepSeekAgentAdapter implementing BaseAgentAdapter for DeepSeek Flash.
- Keep write-capable remediation disabled by default (TASKLANE_ALLOW_WRITE_CAPABLE_DEEPSEEK=false).
- Enforce strict single-file unified diff validation restricted to backend/main.py.
- Reject path traversal, unauthorized target files, git mode modifications, and oversized diffs.
- Provide atomic rollback to original content on patch application or test verification failure.
- Purge DEEPSEEK_API_KEY from child subprocess environments and sanitize error outputs.
- Add comprehensive offline deterministic unit tests with zero network dependencies.
…le, db verification, and pytest untrusted exits (#4)

- Detect premature exit code 0 or empty output in pytest, marking execution as untrusted.
- Validate task persistence independently directly against SQLite /tmp/tasklane.db instead of relying solely on candidate HTTP GET.
- Ensure container tracking persists until removal is verified; implement container rm retries; handle KeyboardInterrupt and exceptions with client and container cleanup.
- Prevent deadlocks in _emergency_cleanup_on_exit() by taking a session snapshot under lock and releasing it prior to cleanup; deduplicate session instances.
- Maintain automatic patch application disabled in docs and code. Issue #4 remains open.
…, container recovery, thread-safe session init, and sqlite boundary (#4)

- Document evaluation boundary limitations: in-process pytest cannot provide independent proof against adversarial stdout/exit manipulation; classified as advisory/untrusted.
- Distinguish container absence from daemon inaccessibility or persistence on host; retain pending containers in recoverable registry and support retrying cleanup.
- Ensure thread-safe session initialization via per-path event synchronization preventing partial visibility across threads.
- Define what direct SQLite reading demonstrates vs shared user UID 10001 and filesystem permissions, strictly withholding automatic patch application. Issue #4 remains open.
…nd crash recovery tracking (#4)

- Structure DeepSeekAgentAdapter repair evaluation reporting with explicit advisory status, scope, and limitation metadata rather than an unadorned tests_passed guarantee.
- Disclose lifecycle limitations of in-process registries (no survival across process crashes); add disk recovery state file, IsolatedWorkerSession.recover_orphaned_containers(), and manual recovery instructions.
- Implement model_drill.py orchestrating the 5-stage controlled local demonstration (alert/diagnosis -> model diff proposal -> explicit human review -> disposable workspace application -> before 500 / after 201 verification).
- Protect main repository root checkout and production from any automated or unapproved modifications.
- Add comprehensive offline test suite test_model_drill.py validating human review rejection, containment, and limitations disclosures.
- Update docs/oncall-drill.md with workflow and limitation details. Issue #4 remains open.
…and selective cleanup (#4)

- Separate proposal generation from human approval ticket
- Cryptographically bind approval to workspace, original file hash, and diff hash
- Run BEFORE and AFTER drill verifications strictly in isolated worker container (zero host execution)
- Overhaul container recovery to inspect ownership labels and protect living creator PIDs and active sessions
- Remove unsafe broad prefix pruning command from documentation
- Enforce explicit blocking (PermissionError) on unapproved live provider mode
- Report tests_passed as False paired with tests_passed_advisory to reflect non-authoritative boundary
@LE0ST
LE0ST marked this pull request as ready for review October 28, 2026 01:59
@LE0ST
LE0ST merged commit 6537801 into main Oct 28, 2026
4 checks passed
@LE0ST
LE0ST deleted the project1/deepseek-adapter branch October 28, 2026 04:44
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