Repository navigation
feat: make the governed run contract executable - #10
Merged
Merged
Conversation
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.
Executive summary
Pincher now has an executable, versioned, test-proven governed-run boundary:
The implementation is deliberately one bounded deterministic provider turn. It does not claim to be a complete coding agent.
Architectural problem
The previous engine could accept an unbound intent, resolve context through concrete wrappers, call a placeholder model, and represent validation or proof as local booleans. That made the core boundary unable to prove that inference was governed or that readiness was authoritative.
This PR makes those requirements executable through typed ports, an explicit lifecycle, a versioned host contract, and deterministic fake-backed tests.
Ownership boundary
Pincher does not add a UI, transport, daemon, parallel governance store, or real provider.
Governed-run lifecycle
The v1 contract is
pincher.governed-run@1.0.0.Prepared -> ContextResolved -> Executing -> Verifying -> ReadyBlocked paths use
AwaitingApproval -> Blocked; failed paths retain typed causes; terminal outcomes can beHandedOffwithout erasing evidence.Exact pre-inference gate ordering
RunRequest.GovernedInferenceRequest.ProviderTurnonly after all preceding gates succeed.Provider output is an untrusted proposal. It cannot create approval, validation, proof, or readiness.
Readiness rule
Readyis reachable only after Decapod returns successful validation evidence and successful proof evidence, each retained by reference in the snapshot and event envelope. Local hashes, process success, provider assertions, host actions, and Pincher events cannot manufacture those facts.Public API and compatibility changes
governed_runwith strong identifier newtypes,RunRequest,RunState,RunSnapshot,RunOutcome, typed blocked/failure/remediation values, versionedRunEvent,EventSink,DecapodControlPlane,ProviderTurn, andGovernedRunEngine.InMemoryEventSinkand deterministic fake-backed integration tests.AgentEngine::execute(&str)path; it now fails closed and directs hosts to the governed contract.validatedandattestedauthority booleans from the legacy governance state.ModelConfig.api_keyfrom serialization.decapod rpc --op specs.refresh.Test matrix
cargo test: pass; 1 unit test, 19 governed-run integration tests, and 0 doctest failures.cargo test --test governed_run_contract --quiet: pass; 19 tests.cargo clippy --all-targets -- -D warnings: pass.cargo clippy -- -D warnings: pass.git diff --check: pass.cargo fmt --check: fails on pre-existing formatting drift across legacy Decapod modules and the existing workflow example; unrelated legacy formatting was not rewritten.Decapod governance evidence
bugs_01ky3bnzrzybw4pzunknowngoverned-run-contract-v1agent/unknown/bugs-01ky3bnzrzybw4pzat the isolated Decapod worktreecargo-clippy,cargo-test,decapod-validate,governed-run-contract-tests01KY3DFCMZA34J0AKMDND5NMY39a5d7d51c64c895500d86c3b1bf40b14922d860d7043ed1094c7adf5ea2475fave_7dcc26e459c7188e, 175 gates passed and 12 local/environment/governance failures remained.The remaining Decapod failures are concrete environment/control-plane blockers: the installed validator reports generated-artifact whitelist rules that are visibly present in the repository, requires container-workspace proof, and reports pre-existing plan/proof debt from another done TODO. The repository CI runs its own
decapod init --proof --forceand validation path.Follow-up issues
Explicit non-goals
No real Claude/Codex/Gemini/OpenAI/local-model adapter; no Amnion UI; no HTTP/WebSocket/MCP/gRPC/daemon transport; no tools or patch application; no autonomous multi-turn or multi-agent execution; no Pincher-owned governance persistence; no full retry/resume/replay/crash recovery; no production metrics; no direct promotion or merge behavior.
Known limitations and deviations
29874742366: pass (22 seconds), including the CIdecapod init --proof --forceanddecapod validatepath.