Repository navigation
doctor --json: carry canonical_next_action for precise recovery (#6986) - #8376
Conversation
…states (#6986) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Local proof (in-session, before publish):
Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 24 minutes. View limit details
Comment |
…on this branch Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Em12HpuY7UcKeXeTmsjfBS
|
Generated by Claude Code |
Pull request was converted to draft
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm fixture, schema, and xtask contract are co-edited: doctor.valid.json now models a
config-fail with the DTO; schema adds$defs.canonical_next_action; xtask whitelist appendscanonical_next_action. Risk is only that doctor.valid.json'ssubject.rootandsubject.itemare environment-anchored (workspace path), which the goldens check tolerates per the schema fixtures convention. - Confirm prerequisite:
ripr test --package ripr --test doctor_json_schema doctor_json_names_the_canonical_recovery_only_when_setup_needs_oneto confirm end-to-end schema+recovery key behavior. - Confirm ripr sensor failed (exit 2) in this packet so no in-tree ripr subprocess output is evidence here; the new end-to-end test in tests/doctor_json_schema.rs and cargo-test late receipt cover it, but no local witness of
ripr doctor --jsonround-trip is available in this lane.
Refuted
- JSON stop.kind/line could disagree because two inference paths exist (one for human, one for machine).; refuted because: Both go through the same canonical_next_action_for_doctor(self, first, root) call; Control 9 recomputes and asserts DTO equality with the attached one.
Parked follow-ups
- Localized goldens drift carried in branch (dc1a2b9) is a no-op once #8351 merges; hosted CI reruns on push so manual pre-merge re-bless is not requested. Not this PR's fault, parked.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
No fix goes into this branch. Once #8418 merges I'll merge main in here so CI re-runs, and auto-merge stays armed. Generated by Claude Code |
Pull request was converted to draft
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- DoctorReport.attach_canonical_next_action resets the field unconditionally, but render_json is invoked after attachment in doctor_json(); ordering invariant is implicit, not pinned by a test that calls attach then asserts the field is Some only after the failing check is added. Future refactor that re-orders attach/render or re-attaches after clearing checks could silently drop the field without a control catching it.
Verification questions
- Confirm end-to-end test in tests/doctor_json_schema.rs requires the existing fixture_root("recovery") helper which is not declared in the visible diff hunk and a doctor_json() invoker; PASS depends on those continuing to exist and on schema validation accepting the new DTO.
- Confirm schema $defs.canonical_next_action uses additionalProperties:true, so unknown keys are tolerated - additive but invisible to schema readers; consumers must validate via per-field types not full strict schema.
- Confirm sensor evidence gap: the ripr sensor failed (exit 2), so no local subprocess witness of
ripr doctor --jsonagainst the binary exists in this lane. cargo-test is the scheduled late evidence; until it lands, the lane relies on the doc+test seam and Control 9 only. Hosted CI ripr sensor run will close it. - Confirm doctor_json_names_the_canonical_recovery_only_when_setup_needs_one never asserts 'recovery_route', 'action_class', or 'non_claim' content from the DTO, only stop.kind/check_name. Control 9 covers those, but the e2e is the public proof surface.
Refuted
- The new optional canonical_next_action could leak into non-doctor --json emitters (e.g., ripr check) and break additive invariants elsewhere.; refuted because: Field is declared on DoctorReport only and emitted via render_json inside crates/ripr/src/output/doctor.rs; ripr check's --format json uses a different producer and does not embed DoctorReport; docstring explicitly states the field is omitted for non-analysis profile and when first-command names a runnable command, and Control 9 + the schema test assert omission on those states.
- Schema version should bump to 0.5 rather than additive 0.4 since a new top-level field with required internal sub-fields is added.; refuted because: Schema is intentionally additive, no consumer breaks on unknown keys; OUTPUT_SCHEMA.md and SPEC-0242 mark it #6986 additive; fixture co-edit confirms 0.4 is the published target.
Evidence gaps
- cargo-test is scheduled-late; ripr sensor failed (exit 2) so this lane carries no ripr-subprocess witness. Local Control 9 + xtask check-output-contracts pass per PR author comment, but cross-check goldens and a real
ripr doctor --jsonround-trip are deferred to hosted CI. - Cargo-test late receipt covers Control 9 and end-to-end but local ripr subprocess witness is absent (sensor failed exit 2); hosted CI is the only witness of the real ripr doctor --json round-trip.
- Model proof intent was rejected by deterministic validation.
Requested by Steven · project thread
Before:
ripr doctorchose its human "Safe next action" recovery line from the canonical next-action decision (#8319), butripr doctor --jsoncarried no machine-readable form of that decision, so tools had to re-infer it.After:
ripr doctor --jsoncarries an optionalcanonical_next_action(stop.kind = doctor_recovery,stop.check_name= failing check) for missing root, unloadableripr.toml, or failed prerequisites. It is omitted when the state names a runnable command and for non-analysis profiles. Additive in doctor schema 0.4, no version bump. Part of #6986.How: the command adapter attaches the DTO from the same
canonical_next_action_for_doctordecision the human line uses (no rendering-side inference). Schema, OUTPUT_SCHEMA, SPEC-0242, README, fixture, verification contract and a changelog fragment updated. Control 9 test pins human line and JSONstop.check_nameagreement per recovery state, plus runnable and non-analysis negatives; an end-to-end schema test covers the real command.Generated by Claude Code