feat(contracts): carry the reset-required store as typed problem detail - #2283
Conversation
Persisted-shape refusals on retained reads and project-open tool calls now answer ApplicationProblemDetailV1::ResetRequired with the refused authority, its found and required versions, and the exact reset command, instead of flattening them into the message.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 353303feae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// A persisted store whose shape this binary does not open. It is served | ||
| /// in this typed state until the operator runs `remedy`, which deletes | ||
| /// the old data; nothing is migrated or backed up. | ||
| ResetRequired { |
There was a problem hiding this comment.
Regenerate the TypeScript SDK detail union
Adding this wire variant without updating crates/tracedecay-sdk/src/codegen.rs and regenerating sdks/typescript/src/types.ts leaves the public SDK's ApplicationProblemDetailV1 union limited to parked, stale_refresh_frontier, and lock_deadline. Responses from the new profile-retained and MCP paths therefore carry a reset_required discriminant that TypeScript declares impossible, preventing callers from narrowing the detail or accessing fields such as authority and remedy with their intended types. Update the generator and regenerate the SDK sources alongside the dashboard contracts.
AGENTS.md reference: AGENTS.md:L63-L68
Useful? React with 👍 / 👎.
Follow-up to #2263 (merged as e2e6e18). #2263 merged its first commit only, reconciled against #2267's
ProfileRootthreading. That left two things out:Master's daemon-control test module does not compile.
restore_check_accepts_a_reset_required_daemon_and_returns_its_pending_resetstill callslock_user_data_dir_test_env()and the pre-refactor(storage): thread one ProfileRoot from each process boundary #2267installed_service_status_snapshot(runner, version). On mastere02eb55236,cargo test -p tracedecay-daemon-controlfails:This PR threads the fixture's
ProfileRootthrough the test. daemon-control lib: 99 passed.Reset-required refusals carry feat(contracts): carry typed problem detail beside the message #2259's typed detail.
ApplicationProblemDetailV1::ResetRequired { authority, found_version, required_version, reason, remedy }is added, andApplicationProblem::ResetRequiredcarries it.from_detailderives kindreset_required, retrynever, legal actionreset, codeapplication.reset-required, and the message. Profile-retained reads (LCM, message search) and the project-open MCP refusal now answer with it, instead of flattening those facts into the message. Generated dashboard contracts are regenerated.Proof
typed_terminal_restart_acceptance::reset_required_serving::…now also asserts the refusal's typed detail on a physically spawned daemon, over a profile whose session store records Git correlation v5:{"kind":"reset_required","authority":"git correlation","found_version":5,"required_version":6, "reason":"git correlation profile schema 5 is incompatible with required schema 6; reset the profile", "remedy":"tracedecay wipe --all --yes"}On master the same refusal is built from a plain
SafeDiagnostic, soproblem.detailis absent and this assertion fails. With this PR,typed_terminal_restart_acceptancepasses 5 of 5.Journey (built CLI; real beta.54 release-binary profile; this branch's daemon under a fake-
systemctlmanaged service):I could not re-run
tracedecay updateend to end on this build. This host's unauthenticated GitHub API quota is exhausted (403 remaining=0), so the release check fails before the flow completes. The maintenance window's stop, start, and restore still completed against the reset-required daemon, with no restore error. #2263's journey on the same update flow exited 75 and named the reset.Suites (on
e02eb55236, cappedsystemd-runscope)census_counts_each_composed_family_and_omits_uncomposed_families, red on master (test(daemon-service): adoption census expects 34 retrieval capabilities, catalog has 41 #2246)test-transport): 331 passedworkflow::test_runnercargo fixtures run serially: 10/10)project_open_handshake3,tests::logging4,doctor::39: all passedtransport_acceptance_suite typed_terminal_restart_acceptance: 5 passed-D warningson the touched crates, with and without--features tracedecay-cli/test-transport,tracedecay/test-transport: cleancargo fmt --all -- --check: clean.pnpm run contracts:check: up to date. Dashboardtypecheck: clean