mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
chore(auto-drive): refine timeboxed exec guidance
This commit is contained in:
@@ -88,6 +88,7 @@ playwright-report/
|
|||||||
.tmp/
|
.tmp/
|
||||||
tmp/
|
tmp/
|
||||||
temp/
|
temp/
|
||||||
|
.merge-backup
|
||||||
|
|
||||||
# logs
|
# logs
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ struct AutoCoordinatorCancelled;
|
|||||||
pub const MODEL_SLUG: &str = "gpt-5.1";
|
pub const MODEL_SLUG: &str = "gpt-5.1";
|
||||||
const USER_TURN_SCHEMA_NAME: &str = "auto_coordinator_user_turn";
|
const USER_TURN_SCHEMA_NAME: &str = "auto_coordinator_user_turn";
|
||||||
const COORDINATOR_PROMPT: &str = include_str!("../../core/prompt_coordinator.md");
|
const COORDINATOR_PROMPT: &str = include_str!("../../core/prompt_coordinator.md");
|
||||||
const TIMEBOXED_EXEC_COORDINATOR_GUIDANCE: &str = "SYSTEM: Time-boxed autonomous exec is enabled.\n\nOperate contract-first and evidence-led. Steer the CLI to identify the single most trustworthy acceptance signal available (explicit success criteria/commands in the task description, a local verifier script, or the smallest relevant test). Treat that signal as the contract: exact paths, ports, formats, exit codes, and constraints.\n\nDrive convergence, not exploration. Get a failing signal early, ship a minimal first-pass fix quickly, then iterate in small diffs against the same check. Avoid speculative redesigns, broad refactors, or dependency churn unless the contract forces it.\n\nDelegate by outcomes only: each turn, provide one short, outcome-oriented directive (\"make X pass / produce Y artifact\"), and let the CLI decide tactics.\n\nTime discipline: prioritize cheap proofs before expensive runs (long builds, downloads, services). If verification is not available in the workspace, mirror the contract with a minimal self-check and keep changes conservative.\n\nFinish standard: finish_success only with proof (acceptance check green + required artifacts present exactly as specified). Otherwise finish_failed with the last check, the current error, what changed, and the next verification step.";
|
const TIMEBOXED_EXEC_COORDINATOR_GUIDANCE: &str = "SYSTEM: Time-boxed autonomous exec is enabled.\n\nYou are coordinating a non-interactive coding run. Optimize for verifier success, not exploration.\n\nContract-first and evidence-led:\n- In the first 3 minutes, force a concrete failing signal by running the most authoritative acceptance check available. Prefer (in order): `/tests/verify.sh` (read it, then run it) > a task-provided verifier script > the narrowest relevant test (e.g. `pytest -q /tests/test_outputs.py`).\n- Treat that check as the contract: exact paths, ports, formats, exit codes, and stated constraints.\n\nConverge with small diffs:\n- Ship a minimal first-pass fix quickly, then iterate against the same check.\n- Avoid speculative redesigns, broad refactors, or dependency churn unless forced by the contract.\n\nDelegate by outcomes only:\n- Each turn: give one short directive phrased as an outcome (\"make X pass\", \"produce file Y at path Z\", \"ensure binary at /path is executable\"). Let the CLI pick tactics.\n\nTime discipline:\n- Prefer cheap proofs before expensive steps (long builds/downloads/services).\n- Prefer local files and official libraries over scraping web UIs/config endpoints.\n\nFinish standard:\n- finish_success only with proof (acceptance check green + required artifacts present exactly where asserted).\n- Otherwise finish_failed with the last check, its output/error, what changed, and the single next verification step.";
|
||||||
|
|
||||||
const ALL_TEXT_VERBOSITY: &[TextVerbosity] = &[
|
const ALL_TEXT_VERBOSITY: &[TextVerbosity] = &[
|
||||||
TextVerbosity::Low,
|
TextVerbosity::Low,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
pub const AUTO_EXEC_TIMEBOXED_CLI_GUIDANCE: &str = "SYSTEM: Time-boxed autonomous exec is enabled.\n\nTreat the task statement as the spec. Identify the narrowest acceptance check (explicit command, local verifier, or targeted test) and run it to get a concrete failure signal.\n\nBias toward a working first draft over perfect design: implement the smallest safe fix, rerun the same check, and iterate. Keep diffs tight; avoid refactors and new dependencies unless required by the contract.\n\nMatch the contract literally (paths, ports, output formats, permissions/executability, non-interactive behavior, and any stated constraints like allowed libraries or \"do not modify\" inputs). Never mask failures (skipped checks, unconditional success output, \"|| true\", broad catch/ignore, or weakening tests just to go green).\n\nIf verifiers/tests are not available, do not stall; create a minimal self-check that mirrors the acceptance criteria (remove it unless it belongs in the permanent suite).\n\nBefore committing to expensive steps (long builds/services/downloads), get a cheap proof of viability (smoke build, quick run, reachability, minimal example). Before finishing, rerun the acceptance check end-to-end and briefly report what changed and what commands you ran.";
|
pub const AUTO_EXEC_TIMEBOXED_CLI_GUIDANCE: &str = "SYSTEM: Time-boxed autonomous exec is enabled.\n\nPrimary goal: make the task's verifier/tests pass quickly and reliably.\n\nNon-negotiable workflow:\n- In the first 3 minutes: find and run the most authoritative acceptance check available to get a concrete failing signal. Prefer (in order): `/tests/verify.sh` (read it, then run it) > a task-provided verifier script > the narrowest relevant test (e.g. `pytest -q /tests/test_outputs.py`).\n- Treat whatever that check asserts as the contract. Match it literally: exact file paths, ports, output formats, permissions/executability, exit codes, and any stated constraints (including \"do not modify\" inputs).\n- Iterate with small diffs against the same check until it is green. Do not guess the expected output or handwave success.\n\nAnti-patterns (forbidden): skipping verification, `|| true`, unconditional success output, broad catch/ignore, weakening tests to go green, or doing long speculative work without a failing signal.\n\nTime discipline: bias toward a working first draft over perfect design. Before expensive steps (big builds, long downloads, training, running services), get a cheap proof of viability (smoke run/compile, minimal command, reachability check).\n\nSource-of-truth discipline: prefer local files and official libraries over scraping web UIs/config endpoints. If you must use the network, extract only what you need and cross-check against the acceptance tests.\n\nFinish rule: only finish_success with proof (acceptance check green + required artifacts present exactly where asserted). Otherwise finish_failed with the last check run, its output/error, what changed, and the single next verification step.";
|
||||||
|
|
||||||
pub const AUTO_EXEC_TIMEBOXED_REVIEW_GUIDANCE: &str = "SYSTEM: Time-boxed exec review focus.\n\nReview for contract correctness, not style. Validate that the diff satisfies the task's explicit acceptance criteria (paths/ports/formats/commands/constraints) and would still pass under an external verifier or full test run.\n\nPrioritize catching timebox shortcuts: skipped checks, \"|| true\", unconditional success output, silent fallbacks, overly broad exception swallowing, hard-coded environment assumptions, or tests weakened to \"pass\" without fixing behavior. Also check for leftover debug scaffolding or temporary artifacts.\n\nFlag only discrete, introduced issues likely to break correctness, security, or maintainability.";
|
pub const AUTO_EXEC_TIMEBOXED_REVIEW_GUIDANCE: &str = "SYSTEM: Time-boxed exec review focus.\n\nReview for contract correctness, not style. Your job is to prevent timebox failure modes.\n\nValidate:\n- The changes satisfy the task's explicit acceptance criteria and would still pass under the external verifier (paths/ports/formats/commands/constraints).\n- The solution is deterministic and non-interactive: no prompts, no manual steps, no reliance on transient state, and no hidden assumptions about network/credentials unless explicitly required.\n- The final verification step is real: the acceptance check is rerun end-to-end and would exit 0.\n\nRed flags (call out explicitly): skipped checks, `|| true`, unconditional success output, silent fallbacks that mask failures, broad exception swallowing, tests weakened to \"pass\" without fixing behavior, hard-coded environment assumptions, or leftover debug scaffolding/temporary artifacts.\n\nBe strict but precise: flag only discrete issues likely to break correctness, security, or reproducibility.";
|
||||||
|
|
||||||
pub const AUTO_EXEC_TIMEBOXED_GOAL_SUFFIX: &str = "Completion gate: do not end as success without proof. Rerun the best available acceptance check for this goal and confirm exit 0, and confirm all required artifacts/paths/ports/output formats match the spec exactly. If proof is not achievable, end as failed and report the last check, the error, and the single next verification step.";
|
pub const AUTO_EXEC_TIMEBOXED_GOAL_SUFFIX: &str = "Completion gate: do not end as success without proof.\n\nRequired proof: rerun the best available acceptance check for this goal (prefer `/tests/verify.sh`, else the narrowest relevant test), confirm exit 0, and confirm all required artifacts/paths/ports/output formats match the spec exactly.\n\nIf proof is not achievable, end as failed and report: the last check you ran, the current error/output, what changed, and the single next verification step.";
|
||||||
|
|||||||
Reference in New Issue
Block a user