Skip to content

fix(subagent): bind experiment prerequisites and explain reruns - #267

Merged
aHappend merged 6 commits into
devfrom
fix/experiment-evidence-discipline
Oct 11, 2026
Merged

aHappend merged 6 commits into
devfrom
fix/experiment-evidence-discipline

Conversation

@aHappend

@aHappend aHappend commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Change

  • Bind declared --depends-on tasks to successful existing run receipts. Recheck them at the real launch boundary, including after resource admission and with semantic preflight disabled.
  • Preserve prior runs, prerequisite bindings and --rerun-reason in terminal records and reports. A reason string is not proof that the inputs changed.
  • Serialize final prerequisite checks and process creation with submission admission, including cross-process exclusion on Windows. Preserve STOP on rejected admission and surface failed STOP removal.
  • Add ARGUS_SKILL_EVIDENCE_POLICY=progress-first|standard|strict through the existing persisted operator settings and public configuration endpoint. Invalid values raise errors; explicit environment values take precedence.
  • Share the evidence-depth contract across Manager stage decisions, bounded/continuous Planner, Engineer and Reviewer. Development readiness is not scientific acceptance. Required independent validation, numerical thresholds and real failures remain unchanged.
  • In 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.
  • Keep the existing prompt budgets, including all three evidence policies on Windows. Preserve native Reviewer actions, requirement coverage and plan authority while removing redundant prose.
  • Fix incremental stdout/stderr scanning in the TypeScript worker while retaining byte limits, UTF-8/CRLF/EOF handling, cancellation and process cleanup.

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 dev at 60287bcc8a1b51e34cbf09dfe5404e88fa1d5180, then pushed 997e45ae4135a804233886eca3f2b52774126941.

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.md covers evidence profiles, prerequisite admission and rerun limits; docs/typescript-migration.md covers incremental buffering.

Not merged. Existing running installations do not adopt a pushed branch automatically.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread argus/tools/subagent/_direct_run.py Outdated
Comment on lines +527 to +529
prerequisites = submitted_task.get("prerequisites")
if prerequisites:
resolve_prerequisites(prerequisites, expected_runs=prerequisites)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread argus/tools/subagent/_reporting.py Outdated
Comment on lines +352 to +354
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)}")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread argus/tools/subagent/_supervised_run.py Outdated
Comment on lines +834 to +836
prerequisites = submitted_task.get("prerequisites")
if prerequisites:
resolve_prerequisites(prerequisites, expected_runs=prerequisites)
Comment thread docs/best-practices.md
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
aHappend and others added 4 commits October 10, 2026 04:10
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>
@aHappend
aHappend force-pushed the fix/experiment-evidence-discipline branch from 50014ba to dde99e2 Compare October 10, 2026 11:28
aHappend and others added 2 commits October 11, 2026 04:19
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>
@aHappend
aHappend merged commit 997e45a into dev Oct 11, 2026
6 checks passed
@aHappend
aHappend deleted the fix/experiment-evidence-discipline branch October 11, 2026 13:23
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.

2 participants