Repository navigation
fix(subagent): bind experiment prerequisites and explain reruns - #267
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Prerequisite validation remains vulnerable to a launch race, supervised reports may omit provenance, and the PR metadata fails the documentation-category gate.
4 open findings
What changed in this PR
Adds durable prerequisite binding and rerun provenance to subagent execution.
Changes:
- Validates prerequisite receipts before and after resource admission.
- Requires rerun explanations and preserves provenance in records.
- Updates prompts, documentation, and tests.
| File | Description |
|---|---|
argus/tools/subagent/_cli.py |
Adds dependency and rerun CLI validation. |
argus/tools/subagent/_experiment_preflight.py |
Resolves and verifies prerequisite receipts. |
argus/tools/subagent/_direct_run.py |
Rechecks prerequisites before direct launch. |
argus/tools/subagent/_supervised_run.py |
Rechecks prerequisites before supervised launch. |
argus/tools/subagent/_registry.py |
Preserves provenance fields. |
argus/tools/subagent/_reporting.py |
Adds provenance to report generation. |
argus/roles/prompts/engineer.py |
Adds experiment prerequisite guidance. |
argus/roles/prompts/reviewer.py |
Adds independent-evidence guidance. |
docs/best-practices.md |
Documents prerequisites and reruns. |
tests/tools/test_subagent_prerequisites.py |
Tests validation and provenance behavior. |
tests/tools/test_subagent_durable_owner.py |
Adds durable CLI integration coverage. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| prerequisites = submitted_task.get("prerequisites") | ||
| if prerequisites: | ||
| resolve_prerequisites(prerequisites, expected_runs=prerequisites) |
There was a problem hiding this comment.
Addressed in c3ddb04: the final receipt revalidation and process creation now share the submission admission lock in both execution modes. Added lock-boundary regression coverage and real cross-process exclusion coverage for the non-POSIX lock path. Later prerequisite reruns do not cancel already-started dependents.
| for key in ("prerequisites", "previous_run_id", "rerun_reason"): | ||
| if key in task_data: | ||
| lines.append(f"- {key}: {json.dumps(task_data[key], ensure_ascii=False)}") |
There was a problem hiding this comment.
Addressed in c3ddb04: both model-authored and deterministic reports append the attempt context directly from task data. Added a regression where the model intentionally omits all provenance fields.
| prerequisites = submitted_task.get("prerequisites") | ||
| if prerequisites: | ||
| resolve_prerequisites(prerequisites, expected_runs=prerequisites) |
| shell quoting. Add `--bounded` when the objective is finite; without it the | ||
| worker keeps proposing follow-up work after the project is declared done. | ||
|
|
||
| ## Avoiding unproductive experiment reruns |
Reject failed or replaced prerequisites before command launch, require an explanation for identical resubmissions, and retain attempt context in reports. Apply evidence-independence guidance from the first review without adding a scheduler or replay policy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address independent review: hold the existing submission lock through the final prerequisite check and process creation, make its Windows fallback cross-process, and append run context deterministically to model-authored reports. Compress shared instructions within unchanged prompt budgets and rebuild the required release assets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore operator-language, plan-authority and checkpoint boundaries lost during prompt compression. Reuse the four failing regression checks and keep every evidence form within the unchanged 5700-character budget. Rebuild shipped release artifacts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace repeated prefix scans with incremental UTF-8 fragments. Retain exact byte-limit, CRLF, EOF, queue and cancellation behavior, and reproduce the original API overflow work before the fix. Preserve upstream Reviewer contracts without raising the policy budget. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
50014ba to
dde99e2
Compare
Reuse operator settings and round controls for progress-first, standard and strict evidence policies. Preserve independent acceptance and existing prompt budgets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Share the design-symptom rule, retain the fixed 5400-character Engineer budget for every policy, and migrate legacy prompt assertions to the shared contract without weakening behavior checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Change
--depends-ontasks to successful existing run receipts. Recheck them at the real launch boundary, including after resource admission and with semantic preflight disabled.--rerun-reasonin terminal records and reports. A reason string is not proof that the inputs changed.ARGUS_SKILL_EVIDENCE_POLICY=progress-first|standard|strictthrough the existing persisted operator settings and public configuration endpoint. Invalid values raise errors; explicit environment values take precedence.progress-first, reuse the existing round policy: cap enabled no-progress streak thresholds at two and enabled soft-round thresholds at three. Preserve disabled guards, explicit mission settings and individual operator overrides. Real forward progress continues through the existing guard logic; no new retry loop or evidence ledger.The evidence profiles control relevant proof depth and existing continuation behavior. They are not a full provider-stream auditing implementation and do not retrospectively accept failed executions.
Current integration
Rebased onto
devat60287bcc8a1b51e34cbf09dfe5404e88fa1d5180, then pushed997e45ae4135a804233886eca3f2b52774126941.The standard release builder regenerated the manifest and Web/TUI artifacts for
0.1.8+b3af822cd5f0d584. Artifact consistency passes.Current targeted validation: 270 passed, covering public settings persistence and rejection, all role consumers, real SkillLoop execution with native memory-backend review actions, progress/no-progress behavior, configuration precedence, and unchanged Engineer/Planner/Reviewer prompt budgets. Full CI on the preceding head exposed stale text assertions and a 14-character ordinary-Engineer budget overrun; the follow-up compresses shared rules and covers all three policies without increasing any budget. Scoped Ruff and diff checks pass. The current-head CI status is in the Checks tab.
The earlier prerequisite/Reviewer/TypeScript changes were validated on
dde99e21: 458 Python tests passed with 16 existing platform/opt-in skips, all 235 Node tests and TypeScript typecheck passed, and Linux plus Ubuntu/macOS/Windows CI passed. Those are historical results, not a claim about the new head's pending full CI.Documentation:
docs/best-practices.mdcovers evidence profiles, prerequisite admission and rerun limits;docs/typescript-migration.mdcovers incremental buffering.Not merged. Existing running installations do not adopt a pushed branch automatically.