Repository navigation
SP-1: harness protocol v0, conformance kit, harness-fake - #79
Merged
Merged
Conversation
…r reached A harness that ended failed or no_change without sending gate/request fell through to PASS. Such a run now reports SKIP, since the approval path was never exercised. pr_open without a gate request stays Fail(GateNotRequested). harness-fake gains fail_before_gate mode to prove it.
…xit within grace Once unit/halt or unit/abandon is sent, the receive deadline shrinks to min(wall clock, now + grace). A timeout from then on is InterruptNotHonored, not WallClockExceeded. EOF counts as honoured only if the interrupt's response arrived first and the process exits within grace. harness-fake gains ack_halt_linger and silent_halt_exit modes to prove both gaps.
…g; skip when none was sent With gates: [oracle], halt and abandon now run a T2 unit and send the interrupt in place of answering gate/request (GatePolicy::Hold). A harness blocked on its gate must handle it, which removes the race with a fast harness. Without an oracle gate, the T1 path is unchanged: the interrupt follows the first unit/event. Transcript records interrupt_sent, and a unit/result that arrives before any interrupt could be sent is now SKIP, not a false FAIL. harness-fake gains result_without_events mode.
The kit spawned harnesses with stderr set to null, so a harness author never saw their own diagnostics when a case failed. stderr is now inherited. harness-fake writes nothing to stderr, so test output stays pristine.
Adds a rule-to-violation table, including the T1 gate rule that is stricter than the spec, and notes that harness stderr is passed through. Also warns authors to exec their harness rather than wrap it.
…-pin the contract UnitEvent::Metric now documents that its figures are incremental since the previous metric for the unit. ProtocolSchema carries a method table giving each method's direction, kind, and params/result types. Both land in the schema as descriptions. The contract is re-blessed and re-pinned: the Rust and Node canonical digests match at 51c64132b2d3d898791f064820ffb92fdbd2b0d36f71913bd8d85e48f1df9463. committed_contract_hash_is_pinned now returns early during a bless run, so it cannot race the rewrite.
…, fix CI header harness-conformance now exits 2 on --grace-secs 0, because a zero grace fails every case. The unused serde_json dependency is removed. The ci.yml header comment names all four root-workspace crates.
…rmance kit and harness-fake
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.
Implements SP-1 of the swappable-harness design, NEXUS
docs/specs/2026-09-14-swappable-harness-design.md(§3 protocol v0; §6 items 1, 2, 7). Plan:docs/superpowers/plans/2026-09-14-harness-protocol-sp1.md.fleet-coreandfleetdare untouched.What's in it
crates/harness-protocol: wire types for a JSON-RPC 2.0, newline-delimited, stdio protocol between the control plane and a harness (initialize,unit/start,unit/event,gate/request,unit/halt|resume|abandon,unit/result). Also:51c64132…9463), whose schema carries a method table;crates/harness-conformance:harness-conformanceCLI (exit 0 / 1 / 2);harness-fake, a scripted reference harness whose misbehaviour modes prove the kit catches each violation.harness conformancejob that runs the kit againstharness-fake.Verification (at the head of this branch)
cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warnings: clean.cargo test --workspace: 22 suites, 166 passed, 0 failed, 3 ignored (pre-existing fleetd Docker ITs), 0 warnings.harness-conformance -- harness-fake:6 passed, 0 skipped, 0 failed, exit 0.How it was built
Nine tasks, each reviewed for spec compliance and quality before the next. Then a whole-branch review ("with fixes") and one fix wave:
gate_approved_t2no longer passes when the gate was never reached;Metricis documented as incremental, and the contract was re-pinned once.A scoped re-review confirmed every finding addressed.
Deliberately not in this PR
docs/contracts/. It waits for nexus#26 to merge, and must use hash51c64132….fleetd's supervisor; add a work-order override (plus a sandbox repo) before a real harness joins this CI job.deliveryevidence shape, and a possibleblockedevent.interrupt_case, to be rewritten with SP-2's monitor.After merge
Once the
harness conformancecheck has run on this PR, make it a required status check onmain(spec §6.7, the GAP-133 lesson). That is a repository-settings change, left for an explicit go-ahead.