Repository navigation
Record a stage by running it - #10
Conversation
Telemetry knew how to hold a row and nothing was writing one. The obvious wiring — instructions telling the orchestrator to call record_stage after each dispatch — is the shape of contract that has failed five times in this codebase already: stated somewhere, enforced nowhere, found dead when the data it should have produced is missing. So CycleRecorder.stage() routes, dispatches and writes the row as one operation. There is no path through it that dispatches without recording, because the recording is not a step the caller performs. It owns the single production reroute and records both decisions. The abandoned attempt is the point: a fallback whose first attempt left no trace makes fallbacks look free, and what fallbacks cost is among the first questions this data will be asked. Friction a person must clear does not reroute, because a trust dialog teaches nothing about availability and retrying elsewhere would hide a question somebody has to answer. A calibration never reroutes. router and executors do not learn that SQLite exists, and three tests assert it: a decision engine that writes to a database cannot be tested as a decision engine. Wiring it revealed that the router could not route resolve or rereview — two of the four cycle stages, present in the plan's role table and absent from the code. Resolving findings edits code and is judged by tests, so it routes where implementation routes; a rereview routes where a review does. A test now asserts that every cycle stage can be routed at all. 305 tests.
Review summaryReviewed the accumulated diff from Findings[REV-001] · high · open · blocks:yes — Stage recording is not available to installed orchestrationPath: Problem: The new guidance makes Evidence: Impact: A standard consumer installation cannot use the new recording API, and the existing orchestration path still performs no telemetry writes. Suggestion: Ship the recorder/runtime through the supported installation path or move the recording contract into an installable/runtime component, then add an installation-level test that executes one stage and verifies a telemetry row. If this PR is intentionally only a library primitive, remove the claim that the orchestrator now drives every stage through it and defer the guidance until the integration exists. [REV-002] · high · open · blocks:yes — Human-action authentication failures incorrectly trigger fallback dispatchPath: Problem: Evidence: A scripted executor returning Impact: A run can silently switch providers and execute the task elsewhere when the selected executor needs a human login/trust action. That creates unintended work/cost and violates the calibration/operational policy described by this PR. Suggestion: Restrict production rerouting to the explicitly retryable exhausted-window capability (for example Security triageThe security audit ran because the new stage wrapper accepts task input and invokes the executor boundary. No confirmed authentication, authorization, injection, secret-exposure, or unsafe-data-handling vulnerability was introduced by this diff: the existing native adapters pass task text as an argument list to Verification
Unverified items
CIAll four reported PR checks completed successfully: two Residual risksThe new tests exercise scripted adapters and SQLite, not the actual installed-skill workflow or native provider launchers. Until the runtime packaging/integration and friction retry policy are corrected, successful CI does not demonstrate that real orchestration records stages or stops on human-required authentication. VerdictCHANGES_REQUESTED — resolve REV-001 and REV-002 before approval. |
A dispatch that hit a sign-in screen reported non-null learned availability, and the recorder used "we learned something" as the test for whether it could route around it. A login prompt therefore moved the work to the other provider and spent its window there, which is the silent switch the orchestration contract says must not happen. Evidence and permission are now separate questions. `needs_human_action` names the capabilities no retry can supply, derived from every interactive marker the native adapters can raise and asserted against them by test, so a marker added later cannot quietly become a condition the recorder thinks it may go around. Such a stage stops where it is, unrerouted and with availability untouched: a downgrade would only move the same switch to the next stage. Also narrows the recording claim. `install.sh` ships skills only, so an installed cc-orchestrator has no CycleRecorder to call; the skill said to drive every stage through it. It now says what it is and that an installation records nothing until a host wires it in.
Resolution summaryBoth findings triaged against [REV-001] · high · resolved · valid · blocks:yes — Stage recording is not available to installed orchestrationValid, and the half that mattered was the claim, not the packaging. Resolved by narrowing the claim rather than by widening the installer. The skill now says Packaging the runtime is deliberately not in this PR. Shipping [REV-002] · high · resolved · valid · blocks:yes — Human-action authentication failures incorrectly trigger fallback dispatchValid and reproduced exactly as reported: a scripted Root cause is a proxy, not a missing branch. The recorder used The two questions are now separate. Such a stage stops where it is, unrerouted and with availability untouched. Downgrading Regression tests
The quota path is unchanged and still reroutes, records both decisions and flags Verification
Sensitivity triageThe change touches authentication handling, so the security question was asked again: it moves strictly in the restrictive direction. Nothing new is executed, no input crosses a new boundary, and one path that previously ran a task on a second provider without being asked now stops. No audit finding. Residual risksUnchanged from the review, and honestly so: no live Codex, Claude or Orca dispatch has been attempted, the tests exercise scripted adapters, and the recorder has never run inside a real orchestration host — which is REV-001's packaging gap restated. Green CI demonstrates the policy, not that any installed run records anything. Status: RESOLVED — REV-001 and REV-002 closed at |
Re-review summaryRe-reviewed the complete accumulated diff from Previous finding dispositions[REV-001] · high · not_applicable · blocks:no — Stage recording is not available to installed orchestrationDisposition: obsolete because the relevant scope changed. The fix does not package [REV-002] · high · resolved · blocks:no — Human-action authentication failures incorrectly trigger fallback dispatchDisposition: corrected and verified by execution. Current reviewThe accumulated implementation, routing changes, documentation, and tests remain coherent. The fix commit is limited to the two previous findings and introduces no additional correctness, regression, data-model, architecture, operations, or test-coverage findings. Security triageSecurity triage was repeated because the change still crosses the executor/input boundary. The scoped audit found no new authentication, authorization, injection, secret-exposure, or unsafe-data-handling vulnerability. Task text continues to reach native executors as an argument list rather than through a shell, and the fix only restricts fallback behavior for human-required capabilities. Verification
Unverified items and residual riskNo live Codex, Claude, or Orca dispatch was attempted because the repository tests use scripted adapters and do not require provider credentials. The source-only recorder still requires a host integration before real installed runs produce telemetry; that limitation is now documented rather than silently presented as completed wiring. CIAll four current PR checks completed successfully: two VerdictAPPROVED — all previous blocking findings are resolved or not applicable, and no open blocking finding remains. |
Telemetry knew how to hold a row and nothing was writing one. This closes that, without touching the router's formulas or the adapters.
Recording is not a step anyone performs
The obvious wiring — instructions telling the orchestrator to call
record_stageafter each dispatch — is the shape of contract that has failed repeatedly here: stated somewhere, enforced nowhere, discovered dead when the data it should have produced is missing.So
CycleRecorder.stage()routes, dispatches and writes the row as one operation. There is no path through it that dispatches without recording.Both decisions, not just the surviving one
The recorder owns the single production reroute. When a dispatch discovers an exhausted window — the only moment that is knowable for a native executor — it updates availability, routes once more, and both rows are written:
A fallback whose first attempt left no trace makes fallbacks look free, and what fallbacks cost is among the first questions this data will be asked.
Friction a person must clear does not reroute — a trust dialog teaches nothing about availability, and retrying elsewhere would hide a question somebody has to answer. A calibration never reroutes.
Separation, asserted
routerandexecutorsdo not learn that SQLite exists. Three tests check it, including one that reads their source. A decision engine that writes to a database cannot be tested as a decision engine.What the wiring found
The router could not route
resolveorrereview— two of the four cycle stages, present in the plan's role table and absent from the code. Resolving findings edits code and is judged by tests, so it routes where implementation routes; a rereview routes where a review does. A test now asserts every cycle stage can be routed at all.Verification
Includes the full fake cycle
implement -> review CHANGES_REQUESTED -> resolve -> rereview APPROVED, opened back out of SQLite and checked stage by stage, and ten such cycles drivingfirst_pass_rateto a measured 0.6.