feat(sota-harness): TRUSS-pattern shadow execution for generated capabilities (PIR WP17, ADR-319) - #870
Merged
Merged
Conversation
…eat/pir-wp17-truss-shadow
…bilities (PIR WP17, ADR-319) First-party reproduction of the TRUSS pattern (Task-Reliable and User-Safe Skill generation, arXiv:2608.17588) — the paper ships no code — as an admission gate between Darwin's proposal step and Dream Machine's evaluation step (issue #864, epic #837). - src/trussShadow.ts: static evaluation pass (redblue live-credential scan + ungranted-tool-reference detection) then shadow execution against a grant-closed, in-process tool broker; every brokered invocation is recorded in a provenance-preserving trace bound to a content-hash artifact id (ADR-318 discipline). Verdict vocabulary: clean / repair-suggested / reject. - Feeds the existing evaluation→vetoes→flywheel path as one more conjunctive PromotionVetoProvider (composable with dreamMachine and WP15's harness-risk gate); exports no promote/merge — ADR-305 separation of powers (ruflo ADR-322B), test-pinned. - Declared or shadow-OBSERVED capability expansion routes to WP9's ADR-315 constitutionalGateStub (called, not duplicated) and is blocked by default; declared expansion never shadow-executes. - Receipt seam: ShadowExecutionReceipt + ReceiptEmitter contract with an unanchored stub (canonical encoding + sha256 per ADR-312 / ruflo ADR-322C discipline; Ed25519 anchoring is follow-on wiring). - Honest scoping: this slice models the broker in-process with simulated backends; RVM-runtime shadow isolation is the fuller form. Stacked on feat/pir-wp9-shaper-loop (PR #869) for genome.ts types. Full harness suite green (35 tests); frozen-weights-check OK. Co-Authored-By: claude-flow <ruv@ruv.net> Claude-Session: https://claude.ai/code/session_012Jib2gQyJpqCoo2xYAbb4X
This was referenced Aug 20, 2026
Owner
Author
|
Adapter contract for the WP15 acceptance-test seam (agreed with WP15 across sessions; recorded here for whoever lands the adapter follow-up after this PR and #872 both merge): The future
🤖 Generated with claude-flow |
Owner
Author
|
Merged latest
PR now shows MERGEABLE. 🤖 Generated with claude-flow |
ruvnet
marked this pull request as ready for review
August 20, 2026 13:49
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.
Part of the RuV Perpetual Intelligence Runtime (PIR), Wave 2. Closes #864 (epic #837). Implements merged ADR-319.
What this is
A first-party reproduction of the TRUSS pattern (Task-Reliable and User-Safe Skill generation, arXiv:2608.17588) — the paper ships no code (evidence review §2) — as a shadow-execution admission gate for generated capabilities, sitting between Darwin's proposal step and Dream Machine's evaluation step.
crates/ruvector-sota-bench/harness/src/trussShadow.ts:@metaharness/redbluelive-credential scan over the candidate genome's text plus ungranted-tool:<name>reference detection. Critical findings deny admission: the shadow agent never runs (TRUSS: "Candidates admitted by this static gate are loaded by a shadow agent").seq, bound to the candidate's content-hashartifactId(ADR-318 discipline). The sandbox seals after the run — a leaked broker handle is inert.reject/repair-suggested(with repair hints) /clean, feeding the existing evaluation→vetoes→flywheel path as one more conjunctivePromotionVetoProvider— composable withdreamMachineVetoProvider(WP2) and WP15's harness-risk gate ([PIR][WP15] HarnessRisk-based lifecycle security benchmark gate on Darwin harness mutations (ADR-317) #862, which consumes this verdict as the shadow-execution leg of ruv's Wave-2 acceptance test).Separation of powers (ADR-305, from ruflo ADR-322B) — structural, test-pinned
{grantedTools, invoke}, frozen; caller-frozen grants are copied, never written back; the shadow executor cannot mutate active policy or the real tool set — only the brokered sandbox. All test-asserted.capabilityDeltaexpands capability routes to WP9'sconstitutionalGateStuband never shadow-executes; an undeclared expansion the shadow pass observes (ungranted invocation attempts) routes to the same gate post-run. Blocked by default in both paths — this also narrows WP9's on-record "self-declared delta" residual, since the broker now observes actual tool attempts.RVF artifact + receipt seam (ADR-319 §3)
CapabilityArtifact(sha256 of the canonical genome encoding),ShadowExecutionReceipt(artifact + verdict + trace — the "receipts" the TRUSS pattern describes), and aReceiptEmittercontract with an in-sliceunanchoredReceiptEmitter: ADR-312 / ruflo ADR-322C canonical encoding (sorted keys, non-finite and −0 rejected) + sha256 digest,anchored: false— domain-separated Ed25519 anchoring is follow-on wiring, never rounded up.Honest scoping
The broker in this slice is a modeled, in-process mediator with caller-supplied simulated backends. RVM-runtime shadow isolation (ADR-319's "RVM-backed shadow runtime") is the fuller form and is out of this slice. Per the program-wide preprint-reproduction rule, TRUSS's published figures (17.11%→52.94% effectiveness, 50.80%→100% security) describe the paper's own benchmark — promotion through this gate is conditioned on this program's own research-gate-recomputed deltas.
Verification
npm test, node --test) — 10 new tests covering: benign→clean with full trace; ungranted tool caught by broker→reject; declared expansion→constitutional stub, blocked, never executed; static credential denial; repair-suggested path; no-promotion-export assertion; sandbox-only mutation proof; veto-provider composition; artifact/receipt canonical-encoding contract.scripts/frozen-weights-check.mjsOK (trussShadow.ts lives inside the enforced mutation surface).🤖 Generated with claude-flow
https://claude.ai/code/session_012Jib2gQyJpqCoo2xYAbb4X