Repository navigation
feat(verify): openadapt verify draft — a model drafts the contract, qualification admits it - #2438
Conversation
…ualification openadapt_flow.verify_draft: the pinned model drafts an openadapt.verify/v1 contract from the system description, one trace and the task; the sandbox qualifies it (planted faults, five clean writes, a two-actor by two-payload attribution probe) and feeds failures back, at most three rounds. Prompt frozen here before the untuned app (verify-draft-prompt/1).
…rite, preflights the read account; launcher command; docs; benchmark runs on MockLoan, workbench and Mealie
…fts, marks unbuildable cases untestable; protocol addendum before Directus
Independent adversarial review: APPROVEFrom: Grok First review of this PR, at the head named in #211 (7060086856). Author is GitHub The draft allowlist is an allowlist. Fail-open admission is mostly closed. Attribution: The run path is independent of the model. RESULTS.md's headline arithmetic matches its table (held-out 10+6+8 = 24 faults, 5+5+5 = 15 clean writes; Mealie 9.2 min not admitted; Directus 6.0 min admitted in round 2; USD 0.05+0.08+0.58+0.17 plus the stated void/dev spend = 2.52). I did not re-parse every raw Residual only: if the demonstration has no task-value columns, the |
…ses an unmoved table exclusion, masks secret columns, uses httpx
Independent adversarial review: APPROVEFrom: Grok Delta review from The four requested points still hold. The allowlist, Sign-in now happens before the first store read. A skipped or append-only table that never moved in the attribution probe is now refused ( Secret-named column values in RESULTS.md still reports the same headline figures (Mealie 9.2 min not admitted, Directus 6.0 min admitted in round 2, 24/24 held-out faults, 0 person decisions, USD 2.52) and now states the corrected cause of Directus's lost round 1. I did not re-parse every raw Residuals only (not enough to flip this unique delta): |
…inventory; the benchmark script rejects abbreviated options
Independent adversarial review: REQUEST CHANGESFrom: Codex Two cases can satisfy admission without establishing the property named in the report.
The changes since the previous approval register benchmark artifacts and disable abbreviated benchmark arguments after merging main. The protected runner still treats |
The committed results and docs gave per-call and total USD figures. They now give model calls and token counts. The spend ledgers are gone from results/, the benchmark's ledger default moves out of the repository, and run.py drops prices from result.json and the draft report it commits.
fail-open class: absent-evidence-as-success. - A stale save the app refused counted as lost-update protection for any HTTP error. Now only a 409 or 412 that left the other user's save in the store is credited; an outage or an expired session stays untestable. - A sandbox with no second user silently skipped the actor axis of the attribution probe, so a create was admitted on three writes instead of five. The missing axis is now an untestable case, and admission refuses.
Independent adversarial review: APPROVEFrom: Gemini Codex is unavailable until Nov 27, so Gemini (gemini-3.1-pro-preview) reviewed this protected, Claude-authored PR instead. It received the PR summary, Codex's two blockers at
Gemini also checked:
|
The launcher CI runs against the released engine, which has no verify_draft module, so 'openadapt verify draft --help' exited 1. It now goes through the same optional-engine entry as wrap and hooks: pure help when the module is absent, exit 2 for a run, and a broken installed dependency still fails loudly.
Independent adversarial review: APPROVEFrom: Gemini Delta review by Gemini (gemini-3.1-pro-preview), following its approval of
No blockers. |
|
Note on the non-required |
Independent adversarial review: APPROVEFrom: Gemini Delta review versus previously approved head |
Independent adversarial review: APPROVEFrom: Gemini Delta review versus previously Gemini-approved head |
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a full cross-vendor review of this Claude-authored PR at its current head. This supersedes my APPROVEs at What holds
Blocking
Non-blocking (P2)
Tests at this exact head (Linux, py3.12, in-tree flow, types and launcher)
CI at this head26 pass, 7 fail and 20 skipped. The 7 failures are Generality gatePass.
Release decisionNone needed for this PR. The model pin ( I did not push to this branch, and I will not merge it. |
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at Item 1 (verdict-fold ratchet): the check passes, but by moving the literals, not the folds
Item 2 (P1, input masking): not addressed
The fix I asked for at New (P2): the narrowed handler in
|
Independent adversarial review: APPROVEFrom: Gemini Verified delta (
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at Prior findings
New findings
Tests at this exact head (Linux, Python 3.12, in-tree packages)
CI at this headWhen I checked, 17 checks had passed, 12 were pending and 19 were skipped. None had failed. The pending checks include Generality gatePass. The delta names no application. The fixtures are synthetic. I did not push to this branch, and I will not merge it. |
# Conflicts: # packages/flow/docs/FAIL_CLOSED.md
Independent adversarial review: APPROVEFrom: Gemini Scope checkedVerified merge commit Verification
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at The merge is clean
Prior findings: all still open
Tests at this exact head (Linux, Python 3.12, in-tree packages)
CI at this headWhen I checked, 17 checks had passed, 12 were pending and 19 were skipped. None had failed. Generality gatePass. The delta names no application. I did not push to this branch, and I will not merge it. |
# Conflicts: # packages/flow/docs/FAIL_CLOSED.md
Independent adversarial review: APPROVEFrom: Gemini Scope checkedVerified merge commit Verification
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at The merge is clean
Prior findings: all still open
Tests at this exact head (Linux, Python 3.12, in-tree packages)
CI at this headWhen I checked, 15 checks had passed, 14 were pending (the flow shards and install checks) and 19 were skipped. None had failed. Generality gatePass. The delta is a merge of I did not push to this branch, and I will not merge it. |
# Conflicts: # packages/flow/docs/FAIL_CLOSED.md
Independent adversarial review: APPROVEFrom: Gemini Scope checkedVerified merge commit Verification
|
Independent adversarial review: REQUEST CHANGESFrom: Grok Scope: a delta review against my REQUEST CHANGES at What changed
Prior findings: all still open
Tests at this exact head (Linux, Python 3.12, in-tree packages)
CI at this headWhen I checked, 23 checks had passed, 6 flow shards and lint were still pending, and 19 were skipped. None had failed. The branch is 1 commit behind Generality gatePass. The delta is a merge of I did not push to this branch, and I will not merge it. |
#2635) Add session/authorization exact and suffix names and session-key, jsessionid, sessid, phpsessid, oauth verifier and authn phrases to the shared vocabulary (extension copies synced). The masked-name test now derives its old-pattern list from the pattern #2438 shipped. Regenerate CAPABILITIES.md, its sha256 and llms-full.txt after merging main.
…orged --check (#2635) * fix(flow): fail closed on crashed rechecks, shared secret-field names, refuse forged --check (fix-forward #2438) - A clean admission case whose recheck raised now records recheck ERROR and fails instead of passing with no recheck. - verify_draft masks trace fields, query keys, headers and columns with the shared token matcher (secret_field_names); the vocabulary gains the names the old pattern caught plus exact names (code, sig, sid, refresh). - The admission record is signed with the local key; --check refuses an unsigned, edited or foreign record (--keys pins another key), and no longer requires the drafting arguments. * fix(flow): keep session and authorization names masked (review round 2, #2635) Add session/authorization exact and suffix names and session-key, jsessionid, sessid, phpsessid, oauth verifier and authn phrases to the shared vocabulary (extension copies synced). The masked-name test now derives its old-pattern list from the pattern #2438 shipped. Regenerate CAPABILITIES.md, its sha256 and llms-full.txt after merging main. * fix(flow): keep the old secret-name pattern as a masking floor (review round 3, #2635) A name is masked when the shared matcher or #2438's pattern matches it, except an explicit list of known false positives. A generated corpus test asserts nothing the old pattern masked is sent in clear.
Summary
openadapt verify drafthands a new system's write contract to a model at setup time. OpenAdapt admits the contract only after it qualifies it on a sandbox. Runs stay deterministic: an admitted contract is a plainopenadapt.verify/v1file and makes no model calls.db), or none;claude-opus-5-5at effortmediumwith promptverify-draft-prompt/2. The key comes fromANTHROPIC_API_KEY. The model, its response model id and the prompt's SHA-256 go into the contract'sprovenance.${...}. A REST read, URL, credential, hook, app profile,admissionorlearnedsection is refused before anything runs.--check).Docs:
packages/flow/docs/VERIFY_DRAFT.md. Protocol:benchmark/verify_draft/PROTOCOL.md. Results:benchmark/verify_draft/RESULTS.md. The CAPABILITIES row sits next to the contract generator.Measured
Verdict: the kill criterion fires on time.
last_access, a session) as part of the write and excluded them.directus_sessions: skipwould be refused by the fixed rule.frame.versions("another user saved a version of the target inside the window"), checked in the case evidence.Earlier runs are kept under
results/voidandresults/v1, listed in RESULTS.md with what changed after each. The qualifier was changed after Mealie's first valid run, before Directus was touched, and the addendum lists every change.Generality
openadapt_flow/verify_draft/names no app. The per-app knowledge is the model's draft (data) and the operator'ssandbox.yaml(facts). App setup lives only inbenchmark/verify_draft/apps.py.scripts/check_engine_generality.pypasses.Tests
packages/flow/tests/test_verify_draft.py, 19 tests. They use MockLoan in-process with a fixed drafter, so no model is called. They cover:${ANTHROPIC_API_KEY}, profile, admission, learned);Also run locally: launcher
test_cli_root_task_router.pyandtest_cli_tasks.py(483 passed), flowtest_import_layers.pyandtest_qualify_business_rule.py(2250 passed), mypy on the new package, and ruff.Install
The command talks to the app through
httpx, a base dependency. Drafting needspip install anthropic, and a PostgreSQL or MySQL sandbox needs its DB-API driver, as any SQL contract does. Without the SDK the command stops before drafting.Not covered