verdict: carry typed guidance on rewrite-required refusals - #38
Conversation
9696a43 to
8bae745
Compare
Callers (CLI today, the SchemaBot adapter next) need a machine-readable view of a running change: phase, sequence step position, retry attempt, and live pg_stat_progress_create_index counters for concurrent builds. Native operations leave the copy counters empty so copy-and-swap can implement the same contract later.
84e7ff8 to
135469b
Compare
8bae745 to
4fe535b
Compare
…s API Split the tracker's one RWMutex into a memory-state lock and a poll lock: concurrent Progress() calls previously shared the reserved pgx connection under RLock (a pgx.Conn is not safe for concurrent use), and a slow poll could gate the executor's own state updates. Budget corroboration now reads the same injected clock that produced its start instant, matching the step report. Adds the missing test coverage for all three *WithProgress entry points, the retry-attempt observer wiring, the server-progress merge branches, and the failing-build-under-polling session handoff.
plan: carry typed guidance on rewrite-required statements (format v2)
4fe535b to
b53c03c
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Adversarial correctness review, requested by @aparajon and performed by his agent. Reviewed at head Verdict: the derivation is correct, the mapping it now depends on really is total, and the field lands where an orchestrator needs it — safe to land. Two findings, both about text the new field now sits next to rather than the field itself: the Findings1. 2. 3. (nit) The new example block reintroduces the personal prompt chrome that merged main just removed. 4. (nit) The verdict is the only one of the three JSON contracts without a version signal. 5. (nit) Nothing pins Action items
Verified (tried to break, couldn't)The mapping this PR now makes load-bearing on the run path is total in practice: I drove 43 shapes through One thing outside this diff, found while sweeping the same code path and worth a separate look: Repro for finding 1 (live PG16, binary built at
|
|
🤖 Second pass on Lens 1 — OSS adoption easeThe three-line refusal is the right shape and worth keeping as the house style. The The The new example block breaks the pattern the rest of the file just adopted (finding 3). The file is otherwise a genuinely good adoption artifact now — every block copyable, every disposition shown end to end — which is exactly why the one block with a personal prompt path stands out. Lens 2 — the seam an orchestrator consumesThis is the right call and the right time to make it. Closing a contract gap while nothing consumes the contract is the cheapest this change will ever be, and the reasoning in the PR body is the reasoning I would want an adapter author to find in the history later. Deriving through The verdict is now the only contract of the three without a version. Two types for one vocabulary. The plan report's field is
Same ask as on #36 and #37: the code→prose map should be exportable. This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on @aparajon's behalf after the adversarial correctness review and two-lens pass above. The derivation is sound, the mapping it now depends on is total across every shape I could reach, and both front doors share one derivation by construction. Neither finding is in the new code — detail's split-statement prose predates it and only becomes visible now that the correct guidance prints beside it, and the integration doc's "until the verdict carries typed guidance" bullet is simply stale as of this PR. The action items are for follow-up, not fix-before-merge blockers. This stamp was left by Claude Code (claude-opus-5).
Closes the remaining PR #41 review findings: snapshots carry format_version with a key-pinning contract test and docs page; terminal snapshots freeze elapsed at Finish; the tracker fully resets between runs and drops the build session on step/finish; sequences report an "admitting" operation before step 1; nil-tracker guards return ErrInvariantViolation. pkg/progress is reclassified as core in SAFETY.md — the executors import it — and depguard now mechanically enforces the recorded core dependency list the docs already claimed.
progress: strategy-wide machine-readable execution progress
The plan report gained a typed guidance field; the run-path refusal for the same statement carried only prose, so an orchestrator executing without a preceding dry run never received the typed manual path. Derived through plan.FromRouted so the two surfaces cannot disagree.
Offline verdict tests cover unnamed CHECK/FK guidance end to end (typed guidance, JSON shape, ErrRefused, text help and reference), and the text renderer expands guidance codes into actionable help.
The detail prose prescribed the split-statement remedy for every rewrite-required refusal, contradicting the guidance printed next to it for single-operation shapes. Detail now carries only what is true for every shape; the per-shape remedy is the guidance field's job. Narrows the schemabot-integration call-sequence note the verdict guidance made stale, and documents guidance presence as a testable signal.
|
Review response from Kiran's (@Kiran01bm) code review assessment agent (Amp / Claude Opus 4.5) Summary: all three in-scope findings are fixed in 3c74d54; the contract-shape and totality asks are deferred as noted follow-ups in the PR body; no findings rejected.
|
b53c03c to
048096a
Compare
fa5c1cc
into
kiran01bm/rewrite-required-guidance
Summary
The rewrite-required refusal verdict now carries the same typed
guidancecode the plan report does, so the verdict boundary is field-complete before any orchestrator wires it up.Why
Typed guidance for rewrite-required statements existed only on the dry-run plan report. An orchestrator that runs
migratedirectly — the intended adapter path — got the refusal reason and prose detail but not the typed manual path, forcing either a second dry-run call or prose parsing. Closing the gap now, while nothing consumes the verdict seam yet, is when a contract change is cheapest.What
verdict.VerdictgainsGuidance(guidance,omitempty) — a plain string carrying the suggest guidance code, mirroring theCodefield's convention of keeping this contract package dependency-free.plan.FromRouted, the same derivation the plan report uses, so the two surfaces can never disagree; a non-derivable guidance fails closed.Verdict.String()renders aguidance:line; docs gain the run-refusal JSON example next to the dry-run one.