Repository navigation
Define the verifier Hook co-design contract #9262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+741
−2
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7c45cc6
Define verifier hook co-design contract
loopx-agent 2bc5331
Require readable verifier evidence and bind solver constraints
loopx-agent 1bf996e
Require role- and scope-bound verifier evidence
loopx-agent 185f099
Bind verified close to immutable candidate digests
loopx-agent ed4e62c
Register the canonical digest consumers in the architecture test
loopx-agent 93b57fb
Keep verifier authority reads bounded to the contract fixture
loopx-agent 1a4253e
fix(verifier_hook): treat EACCES, EPERM, EISDIR, and ENOTDIR as unava…
loopx-agent cfa7c35
fix(verifier_hook): bind authoritative acceptance_digest in VerifiedS…
loopx-agent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # RFC: Verifier Hook Co-Design (v0) | ||
|
|
||
| - **RFC status:** Accepted (upon merge) | ||
| - **Supersedes / closes:** none | ||
| - **Delivery maturity:** TypeScript interface and executable contract fixture. History working-set integration and host qualification are pending. | ||
| - **Related contracts:** [Controller and executor](controller-executor-unified-contract-v0.md), [History working sets](history-working-set-context-policy-v0.md), [Target, Yardstick and Stride](target-yardstick-stride-decisions-v0.md), [Capability portfolio](goal-scoped-capability-portfolio-v0.md) | ||
| - **Language mirror:** [中文版 — semantic mirror](verifier-hook-co-design-v0.zh-CN.md) | ||
|
|
||
| ## 1. Authority and solver view | ||
|
|
||
| Use public host hooks and session branching at four boundaries to improve independently accepted outcomes and reduce full cost. C1 remains the authority for Goal, Todo, acceptance, evidence and settlement. The solver receives a projection of the objective, cumulative acceptance and constraints, verifier profile, best verified incumbent and falsification references. Startup and recovery read the same write scope and stop conditions through the original C1 capture digest and `/goal_boundary` pointer. The controller keeps the complete decision and uses existing admission and settlement. A successful model response, a hook event and accepted work are distinct facts. | ||
|
|
||
| The Goal verifier profile identifies a version-bound external Oracle and may refer to the existing work-yardstick profile. The cheap yardstick steers exploration. The independent Oracle validates the exact candidate under current acceptance. Missing observations remain unknown. Run the verifier outside the solver's writable checkout with independent process and file permissions. Use existing controls for external actions. Attribute candidate and evaluator changes separately at settlement. Diff audit can withhold acceptance after a discrepancy. Filesystem isolation and external authorization enforce the boundary before effects. | ||
|
|
||
| Use official extension interfaces with unmodified host kernels and supported authentication for each host. Credentials stay with the client they were issued for. Adapters report observed behavior for their version and surface. Feature off leaves current execution, C1 transport and settlement unchanged. | ||
|
|
||
| ## 2. Capability negotiation and boundaries | ||
|
|
||
| No verifier hook route participates when the feature is off. When enabled, L0 uses bounded launch and stop with the same independent Oracle and settlement semantics. L1 adds observed session lineage and bounded context delivery at supported boundaries. L2 additionally requires milestone observation, isolated child work and verified return. The highest supported tier applies. Opt-in for the optional pre-tool extension requires explicit policy and an observed matching hook. It is off in ordinary solve at every tier. Capabilities and tiers grant no authority. | ||
|
|
||
| | Boundary | Behavior | Fallback | | ||
| | --- | --- | --- | | ||
| | Start or resume | At a real resume or phase change, deliver the bounded solver view or exact evidence references. Quiet turns skip recurring administrative context. | Deliver the view at bounded launch. Measure actual cache use separately from prefix equality. | | ||
| | Milestone probe | Enqueue a configured, budgeted observation outside the synchronous tool path. Feed back evidenced plateau, regression or proxy rank reversal at the next supported boundary. | Read at the next bounded turn. An unavailable probe stays unknown. | | ||
| | Compaction or subscope | Capture open constraints and falsification references before the boundary, then restore their verified projection. Verify a child branch before returning a compact result. | Keep original inputs and defer the return to the next supported boundary. | | ||
| | Stop or completion claim | Submit the exact candidate to the independent Oracle. Return a reproducible counterexample after a bounded failure. The controller owns pending or expensive evaluation. | Normal settlement withholds acceptance when the host cannot continue in place. | | ||
|
|
||
| Transitions report `completion_claim` to the Oracle, `yardstick_plateau_or_regression` to Stride, and `proxy_order_reversed` to the yardstick owner for verification or replacement. `protected_boundary_touch` retains isolation refusal or audit evidence, stops the affected attempt and re-enters under original authority. Observations cannot directly change the Todo, activate a capability, publish or spend. Regular work avoids a per-tool synchronous verifier. | ||
|
|
||
| | Host | Start / resume | Milestone | Compaction / subscope | Stop | | ||
| | --- | --- | --- | --- | --- | | ||
| | Official Codex | `SessionStart`, supported `UserPromptSubmit` context, native lineage and Turn-bound MCP probes | Selected `PostToolUse` or tool-completion observation with bounded asynchronous work | `PreCompact` / `PostCompact` observe compaction. Restore through supported start context or a bound read. Use `SubagentStart` / `SubagentStop` for lifecycle and App Server `thread/fork` for a separate branch | `Stop` blocking feedback where supported. Otherwise use controller settlement | | ||
| | DSH Cordis | Plugin observes the session and first bound turn | `session/event` with `step/end` | Observe supported session events and qualify concrete branch, restore and verified return before declaring L2 | `turn/end` through `session/event`, then controller acceptance | | ||
| | Claude Code | `SessionStart` and supported `UserPromptSubmit` | Selected `PostToolUse` | Supported `PreCompact` / `PostCompact` and `SubagentStart` / `SubagentStop`. Verify post-compact output on the installed version or restore on next start | `Stop` feedback where supported | | ||
| | Google Antigravity | `SessionStart` or next bounded `PreInvocation` | Selected `PostToolUse` or meaningful `PostInvocation` | Keep raw and recover at the next supported start | `Stop`, with independent controller acceptance | | ||
| | Generic CLI or Pi compatibility | Controller-supplied bounded start | Read at the turn boundary | Keep raw, qualify richer behavior by adapter | Outer Stop-Hook or bounded exit | | ||
|
|
||
| Official Codex and DSH are complementary reference adapters. Use official Codex for same-host strong-model comparison and consequential candidate or verifier design. Use DSH for approved high-throughput candidate screening and plugin trials. Preserve shared artifact identity and report cross-host outcomes separately from same-host comparisons. Pi remains an optional capability-based route. Optional pre-tool entries include Codex, Claude and Antigravity `PreToolUse`, and DSH `agent/pre-step` at its own granularity. A hook registration alone provides no filesystem fence. [Codex Hooks](https://learn.chatgpt.com/docs/hooks), [Codex App Server](https://learn.chatgpt.com/docs/app-server), [Claude Code Hooks](https://code.claude.com/docs/en/hooks), [Antigravity Hooks](https://antigravity.google/docs/hooks), [DSH adapter](../../../packages/dsh-loopx-plugin/src/driver.ts). | ||
|
|
||
| ## 3. VerifiedClose | ||
|
|
||
| 1. Branch from a known session and parent epoch using a public host or controller operation. Isolate the candidate workspace. Conversation branching grants no new write lease, verifier authority, credentials or cache guarantee. | ||
| 2. Capture the exact candidate for the independent Oracle. Its immutable receipt binds Goal, Todo, parent epoch, child scope, `candidate_sha`, C1 `acceptance_digest` and `verifier_version`. Use canonical `sha256:<64 lowercase hexadecimal digits>` for the candidate submitted to the Oracle and the canonical 64 lowercase hexadecimal `acceptance_digest` from the current Goal acceptance context (`outcome_context.acceptance_digest`). The recommendation checks both digest formats before reading any receipt. Branch names, tags and other identifier formats keep the raw scope. The receipt identifies available fast and slow readings, verdict, falsified hypotheses and original observations or transcript. Matching failure carries a reproducible counterexample. Missing readings stay unknown. | ||
| 3. Resolve the receipt through the trusted verifier owner. Only an exact, passed receipt with nonblank scope identifiers, no open obligations and evidenced low overlap permits a `FoldToReceipt` recommendation. The authoritative reader resolves the Oracle evidence, original source and compact result with their recorded roles and scope. Each binding must match the requested reference, its role and the exact receipt identity. An empty, mismatched or unreadable reference keeps `KeepRaw`. At the reader boundary, a filesystem lookup that reports a missing, permission-denied or wrong-kind record becomes an unavailable read. Parse and unexpected reader errors remain visible. Append the compact evidence-linked result at a supported parent boundary and preserve original evidence for independent readback. A missing, mismatched or failed receipt keeps `KeepRaw`, as does high or unknown overlap. Return an available counterexample whose role and scope match. | ||
|
|
||
| Classify overlap from the next work's evidence dependencies. High overlap means the next probe still needs intermediate candidate state, unresolved counterexamples or the raw comparison history. Low overlap means the next scope can act from the verified result and its bounded evidence references. Treat an unbound next step or an incomplete dependency read as unknown. Apply the existing reset break-even against the saved context bytes, cold prefill and any expected recovery reads. | ||
|
|
||
| The history policy owns the transitions, including `EpochReset` as the only explicit prefix rebase after its break-even and exact-source checks. Branch return alone does not start a new epoch. Use compact events as boundary observations. Restore through a model-visible hook or a bound read after invalidation. Codex compact events alone do not deliver arbitrary model context or replace the sampling compiler. Spine motivates protecting parent context through structured child work. Its in-core compiler and reported results do not qualify the hook route. Measure cache hits, full cost and outcome quality independently. [Spine](https://arxiv.org/abs/2610.37224), [History working sets](history-working-set-context-policy-v0.md). | ||
|
|
||
| ## 4. Verifier-gated domain plugins | ||
|
|
||
| The solver may stage content-addressed yardsticks, diagnostics or verification recipes. An independent trial tests held-out failures, benign cases, overhead and, for a new yardstick, rank fidelity against the Oracle. Bind the trial receipt to the exact artifact, verifier and configured scope. Trial success supports adoption through existing Goal configuration and capability portfolio ownership. It cannot activate the artifact, grant permissions or replace the Oracle. Observe post-adoption utility and use existing degrade or retire routes when cost or fidelity regresses. Keep prior revisions and negative results readable. DSH is one delivery adapter. [Capability portfolio](goal-scoped-capability-portfolio-v0.md). | ||
|
|
||
| ## 5. Acceptance | ||
|
|
||
| - The executable contract fixture covers feature off, L0/L1/L2 negotiation, explicit pre-tool opt-in, exact accepted return, refusal of foreign receipts and real missing, permission-denied and wrong-kind file reads. Run bilingual and diff-based premerge validation. | ||
| - For the first live slice, connect one verified child return to the existing history working-set reader. Cover an ordinary turn, missing or failed verification, compact or branch readback of the original receipt and exact C1 settlement replay on the same Goal/Todo. Confirm the actual Hook outputs on the installed host version and surface. | ||
| - Compare with the same host's Stop-Hook baseline at matched model, task, access and budget. Record accepted outcomes, invalid completions, elapsed time, cached and uncached tokens, verifier calls, retries, storage and human intervention. Include high and low overlap. Keep cross-host results outside causal attribution for the same-host treatment. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.