Repository navigation
test: drive the restore composition gate through the native CLI - #589
Merged
Merged
Conversation
cli_contract gains published_contract(repository) and owner_serves(call, exits, actions): an operation status probe of an unknown id proves that an owner serves metadata reads once it answers not_found rather than a transport failure. The live Workbench gate uses both instead of its own copies. Signed-off-by: wchwawa <wch19961116@gmail.com>
…e CLI The gate ran the A-to-B-to-C oracle through one nokv mcp process per owner epoch and judged owner loss by the sidecar's error result. Every oracle step is now its own nokv workbench <tool> process recorded in cli-transcript.jsonl and graded against docs/cli-contract.md. The restore whose owner exits at the fault barrier must fail as one stderr line of ClientFailure from nokv-client after three attempts, class outcome_unknown, next_action resubmit_same, with the exit code of that class; the evidence records that exit code in place of the sidecar's process liveness, and the exact replay still converges on the successor. Expected NotFound reads carry not_found and do_not_retry. No gate launches the sidecar any more. Signed-off-by: wchwawa <wch19961116@gmail.com>
Signed-off-by: wchwawa <wch19961116@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
The restore-composition gate, the last live gate on the deprecated
nokv mcpsidecar, now drives the 18-tool oracle throughnokv workbench <tool>processes. Its "bounded client failure after owner loss" verdict is restated as the native CLI contract: exit 6, classoutcome_unknown,next_action: resubmit_same, one stderr JSON line.Problem
scripts/workbench/restore_composition_gate.pyran the A-to-B-to-C composition oracle through onenokv mcpprocess per owner epoch and retainedmcp-transcript.jsonl. Its owner-loss verdict, as #586 showed, was a statement about the sidecar's error result (isError,ClientFailure,details.attempts == 3, "the MCP process survived the owner exit"), not about what a CLI caller observes. With the object-namespace gate (#587) and the live Workbench gate (#588) already moved, this gate was the only reason the sidecar's code still shipped as harness plumbing.Merge after #588; this PR targets main and carries the #587 and #588 commits until they merge, after which its diff is its own two commits. It is the third of three gate migrations and links no issue: a test-harness chore with no product behavior change.
Consequences
Until this gate moved,
nokv mcpcould not be deleted, and the restore-crash evidence qualified a deprecated transport rather than the primary surface.Example
Before, the gate sent
workbench_restoreover JSON-RPC to the sidecar while the feature-only crash owner exited at the dual-manifest-published boundary, and accepted anisErrorresult sayingClientFailureafter three attempts.After, the gate runs
nokv ... workbench workbench_restore '{...}'against the crash owner. The command exits 6, prints nothing to stdout, and writes one stderr line:{"status":"error","code":"ClientFailure","message":"workspace request exhausted 3 attempts: RPC transport failed: ...","retryable":true,"details":{"attempts":3,"source":"nokv-client"},"class":"outcome_unknown","next_action":"resubmit_same"}. After the successor owner reopens the same Holt directory, the same command replays withidempotent_replay: true, the same operation id, and an unchanged object inventory.Solution
A
WorkbenchClihandle replaces theMcpsession: each oracle step is its ownnokv workbench <tool>process recorded incli-transcript.jsonland graded with the shared contract grader from #587; expectedNotFoundreads carry their class and next action (not_found,do_not_retry). The owner-loss call is graded asoutcome_unknownwithresubmit_same, and the restatedvalidate_owner_loss_errorrequiresClientFailurefromnokv-clientafter exactly three attempts plus that class and next action; the evidence records the CLI exit code in place of the sidecar's process liveness. Owner readiness for each epoch is anoperation statusprobe of an unknown id answeringnot_found, shared with the live Workbench gate throughcli_contract.owner_serves. The oracle plan's tool steps now name theworkbenchCLI verb beside the existingworkspace-pathmutations. AGENTS.md, the acceptance document, and the Workbench README no longer describe any gate as a sidecar caller.Gain
No live gate launches
nokv mcp:grep -rn 'nokv mcp\|"mcp"' scripts/workbench/*.pymatches only the three regression tests that assert the token is absent from their gate. The restore-crash verdict is now a statement aboutdocs/cli-contract.md, and deleting the sidecar is a product change that can be its own PR.Tradeoffs
Two expectations are restated at the CLI level: "the MCP process survived the owner exit" becomes "the command exited with the graded failure code", and the legacy
retryableflag is recorded but no longer required, as the contract directs. Each tool call is a fresh process, so the gate no longer observes a client that stays connected across the owner handoff; that is the surface the sidecar had, not the one the product supports. The sidecar's own command, module, and historical documentation remain for a follow-up removal.Validation
python3 scripts/workbench/restore_composition_gate_test.py(26 tests, OK);live_workbench_test.py,cli_contract_gate_test.py,rpc_tls_gate_test.py,object_namespace_recovery_gate_test.py,fork_restore_recovery_gate_test.py,local_wal_recovery_gate_test.py,workbench_contract_test.py,loopx_stage2a_stack_test.py(OK);python3 -m py_compileover the changed scripts;git diff --check.python3 scripts/workbench/restore_composition_gate.py --dry-runexits 0 with plan surfacesworkbenchandworkspace-path.nokvand the feature-onlynokv-restore-crash-ownerbuilt in separate targets,--timeout 60:overall_status PASS,restore_composition PASS,partial_publication_recovery PASS; 36 CLI transcript entries; the owner-loss restore exited 6 asClientFailure/outcome_unknown/resubmit_samewithdetails.attempts 3, the crash owner exited 86 after publishing exactly two manifest objects, the replay was idempotent with a stable inventory, and the four expectedNotFoundreads exited 3 asnot_found/do_not_retry.nokv-workspacejob's--buildpath; the Phase 1 receipt step is unchanged (therestore-compositionproducer declares no transcript role).