Bolt 5: 5 harness の opt-in live 適合性機構と Intent completion seal 語彙を追加する - #2234
Conversation
…e core Ports Bolt 5 (#2067) from codex/intent-autonomy onto the landed runtime: the harness-neutral intent-completion Core (credential-attested authorization, reconcile-first reservation, single-use dispatch permits, canonical claims, receipt validation, all-five completion evidence, terminal plan/accept, memory ledger, U4 completed-review seed), the LiveAuthorizationPort seam on the Loop Monitor coordinator, the build-time harness registry export, and INTENT_COMPLETION_TRANSACTION_COMMITTED as canonical audit event 90 synchronized across the registry, vocabulary, docs, and drift suites. Receipt cohorts gate live verification evidence only — the Core terminal path never imports them, so workflow completion stays receipt-free by contract. t433's completion-seal fixture now rides the registry-guarded emitter instead of a raw shard row.
…act rejections in-process
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughIntent完了フローに、5つのハーネスの検証、ライブ認可、レシート照合、完了証拠、終端トランザクション、監査記録、メモリ台帳を追加しました。監査語彙と関連テストも更新しました。 ChangesIntent完了フロー
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9f5d03e. Configure here.
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/framework/core/knowledge/amadeus-shared/audit-format.md`:
- Line 260: Update the section heading “Loop Monitor, Quality Repair, and Intent
Autonomy (4 events)” to report 5 events, leaving the event table and overall
total unchanged.
In `@packages/framework/core/tools/amadeus-intent-completion.ts`:
- Around line 70-74: In exactlyKeys, sort a copied expected array once before
the every callback, then compare each observed field against that precomputed
sorted array. Preserve the existing UTF-8 ordering and key-count validation.
- Around line 1236-1246: IntentCompletionLedgerSnapshot の schemaVersion を数値の 1
から文字列の "1" に変更し、同じモジュール内の他のスキーマ型と統一してください。あわせて
createMemoryIntentCompletionLedger の exportSnapshot が文字列 "1"
を出力するよう更新し、既存スナップショットのダイジェスト検証互換性を維持してください。
- Around line 30-33: Update terminalTransactionAuditFields to use
INTENT_COMPLETION_TRANSACTION_COMMITTED_EVENT instead of duplicating the event
name as a string literal; keep the existing exported constant and remove the
duplicate literal.
- Around line 983-985: ordered の生成で使用している `as
CommittedValidatedIntentLiveReceipt`
キャストを削除し、`classified.byHarness.get(harnessId)?.[0]`
の結果を明示的に検証してください。値が存在しない場合は明示的にエラーを送出し、`ordered` には必ず有効な
`CommittedValidatedIntentLiveReceipt` のみが入るようにしてください。
- Around line 959-969: evaluate の validationEventIdentities
が助言値にならないよう、readValidationSet の返却レシートを要求された識別子集合と検証してください。各 receipt の
validationEventIdentity が入力集合に含まれ、要求された識別子が漏れなく対応していることを順序に依存せず確認し、不一致時は
completion を失敗させてください。検証は classifyReceiptSet の呼び出し前に行い、reader
側へ責務を移す場合はその契約をコメントで明示してください。
- Around line 541-545: Update the redispatch authorization logic in the run
completion flow to use IntentLiveRunReservation.maxDispatches for the
upper-bound check instead of the hard-coded dispatchesAuthorized === 1
comparison. Preserve the existing status transitions and proof handling, and
ensure the declared maxDispatches value is actually read by the authorization
decision.
In
`@tests/integration/t434-intent-completion-five-harness-projection.integration.test.ts`:
- Line 17: Update the FILES constant in the five-harness integration test to
include amadeus-audit.ts alongside the existing registry and intent-completion
files, so each harness’s audit vocabulary and format are compared as part of the
synchronization check.
In `@tests/integration/t434-intent-completion-live-seam.integration.test.ts`:
- Around line 57-58: Update the receipt assertions in the integration test to
verify implementation_revision and package_digest against the corresponding
canonical values from HARNESS_REGISTRY, or use the ValidatedHarnessRegistry
verification API. Replace the current type-only checks while preserving the
receipt field coverage and enforcing digest binding and receipt verification.
In `@tests/unit/t427-loop-monitor-runtime.test.ts`:
- Around line 602-604: Extend the unknown-partition assertion in the
coordinator.authorizeLiveSmoke test to verify that the authorization port was
never called. After asserting the CONFLICT result, assert the unknown partition
port’s authorize invocation count is 0, using the existing port spy or mock
symbol.
In `@tests/unit/t434-intent-completion.test.ts`:
- Around line 276-369: 拡張子: AMADEUS? Update the test around
createIntentLiveRunCoordinator to cover the missing dispatch state-machine
branches: configure nativePort.reconcile to return a completed result and verify
the completed transition, and add a dispatch result with a mismatched native
idempotency key to verify rejection. Keep the existing single-use claim and
retry assertions, and use the existing coordinator symbols and error contract.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 108ac088-a331-43ec-9daf-e7a4172147a2
⛔ Files ignored due to path filters (12)
amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/code-generation/code-generation-plan.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/code-generation/code-summary.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/business-logic-model.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/business-rules.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/domain-entities.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/functional-design-questions.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/logical-components.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/nfr-design-questions.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/performance-design.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/reliability-design.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/scalability-design.mdis excluded by!amadeus/spaces/*/intents/**amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/security-design.mdis excluded by!amadeus/spaces/*/intents/**
📒 Files selected for processing (25)
docs/reference/12-state-machine.mdpackages/framework/core/knowledge/amadeus-shared/audit-format.mdpackages/framework/core/otel/event-registry.tspackages/framework/core/tools/amadeus-audit.tspackages/framework/core/tools/amadeus-harness-registry.tspackages/framework/core/tools/amadeus-intent-autonomy-runtime.tspackages/framework/core/tools/amadeus-intent-completion.tspackages/framework/core/tools/amadeus-loop-monitor-replay.tspackages/framework/core/tools/amadeus-loop-monitor-runtime.tspackages/framework/harness/registry.tstests/.coverage-patch-allowlist.jsontests/.coverage-ratchet.jsontests/.coverage-registry.jsontests/integration/event-registry-drift.test.tstests/integration/t432-intent-autonomy-runtime.integration.test.tstests/integration/t433-autonomy-review-observability.test.tstests/integration/t434-intent-completion-five-harness-projection.integration.test.tstests/integration/t434-intent-completion-live-seam.integration.test.tstests/integration/t48-audit-event-emitters.test.tstests/no-silent-drop/baseline.jsontests/no-silent-drop/exemptions.jsontests/unit/t28-audit-event-sync.test.tstests/unit/t427-loop-monitor-runtime.test.tstests/unit/t434-intent-completion.test.tstests/unit/t81.test.ts
- degradation observations bind to AUTO_DECIDED: the canonical vocabulary carries no AUTO_DECISION_DEGRADED type — degradation is decision metadata, so both election outcomes validate against the same row - evaluate() bounds the evidence by the requested validation identity set and replaces the classified-set cast with an explicit guard - maxDispatches drives the redispatch bound; the ledger snapshot joins the module-wide string "1" schema version; exactlyKeys sorts once; the unused event constant folds into the emission literal the t48 drift matcher pins - audit-format section heading counts 5 events; the five-harness projection also compares amadeus-audit.ts; the live seam pins receipt revision/digest shape and cohort-wide equality; t427 proves the authorization port is never consulted for an unknown partition; t434 drives the completed reconcile path and the forged idempotency-key rejection
…-set bounds; re-mint residual allowlist
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/framework/core/tools/amadeus-intent-completion.ts`:
- Around line 1251-1252: Update createMemoryIntentCompletionLedger to validate
snapshot.schemaVersion at runtime before restoring any state, accepting only "1"
and rejecting unknown versions even when the digest is valid. Add a test
covering a snapshot with schemaVersion "2" and a valid digest, asserting that
restoration fails.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b219fde5-11e4-4b5d-be89-93362be4a2ad
📒 Files selected for processing (7)
packages/framework/core/knowledge/amadeus-shared/audit-format.mdpackages/framework/core/tools/amadeus-intent-completion.tstests/.coverage-patch-allowlist.jsontests/integration/t434-intent-completion-five-harness-projection.integration.test.tstests/integration/t434-intent-completion-live-seam.integration.test.tstests/unit/t427-loop-monitor-runtime.test.tstests/unit/t434-intent-completion.test.ts
…s before the digest check

概要
Delivery Plan の Bolt 5 / U5
five-harness-intent-completionを実装します。現行 5 harness(Claude Code / Codex / Cursor / OpenCode / Kimi Code)の credential-attested live receipt を検証する harness-neutral な opt-in 適合性機構です。receipt cohort の完全一致は live verification evidence の条件であり、Core の Intent completion 条件ではありません — Core terminal path はこの evidence を import せず、credential / native capability が無い環境では live を理由付き skip して通常の workflow completion を妨げません(Delivery Plan の「live receipt を hard gate にしない」裁定どおり)。
Refs #2067
主な変更
amadeus-intent-completion.ts(新規): credential-attested authorization、reconcile-first reservation、single-use dispatch permit、canonical dispatch claim、native idempotency receipt 検証、all-five completion evidence、terminal plan / accept、memory ledger、U4 completed-review seed。missing / duplicate / skip / forgery / revision mismatch はすべて fail-closedamadeus-loop-monitor-runtime.ts:LiveAuthorizationPortseam とLIVE_SMOKE_AUTHORIZEDイベント(fold / replay codec 同期)amadeus-harness-registry.ts:ValidatedHarnessRegistry(digest 束縛)を消費者付きで復活、packages/framework/harness/registry.tsの build-time export を追加INTENT_COMPLETION_TRANSACTION_COMMITTEDを canonical 90 件目の audit event として registry / audit 語彙 / audit-format / 12-state-machine / drift スイート(t28 / t48 / t81 / registry-drift)へ同期。t48 は typed repository event construction を認識する第4パターンで拡張terminalLiveCompletionCapable: trueへ昇格スコープ境界
検証(いずれもローカル実測、exit code 0)
bun run typecheck/bun run lint/ complexity / source-only すべて 0bun run coverage:ci: Failed 0 / RESULT: PASSNote
Medium Risk
Large new completion/auth/receipt pipeline and a new canonical audit event, but production workflow completion is explicitly decoupled and missing credentials fail closed without forging evidence.
Overview
Adds Bolt 5 / U5 — a harness-neutral, opt-in path that validates credential-attested live receipts for the current five harnesses (Claude Code, Codex, Cursor, OpenCode, Kimi Code). A full cohort bound to the same implementation/package/registry/scenario can drive an atomic terminal plan (completion evidence, optional grant completion, workflow clear,
WORKFLOW_COMPLETED); normal Core workflow completion does not import this module or require live receipts (CORE_INTENT_COMPLETION_REQUIRES_LIVE_RECEIPTS = false).Core runtime: new
amadeus-intent-completion.ts(authorization, run coordinator with single-use dispatch permits/claims, receipt validation, cohort evaluation, terminal commit/ledger,AWAITING_HUMANwhen capabilities are missing).amadeus-loop-monitor-runtimegainsLiveAuthorizationPort/authorizeLiveSmokeandLIVE_SMOKE_AUTHORIZEDreplay support.ValidatedHarnessRegistry+packages/framework/harness/registry.tsexport; autonomy status setsterminalLiveCompletionCapable: true.Audit / drift: registers
INTENT_COMPLETION_TRANSACTION_COMMITTEDas the 90th canonical event (registry,amadeus-audit, docs, coverage). t433 seeds completion seals via the guarded emitter instead of raw shards; t48 recognizes typedeventType:emissions.Verification: unit/integration tests (t434, five-harness projection, opt-in live seam), loop-monitor live-auth tests, and intent-construction design docs under
amadeus/spaces/.../five-harness-intent-completion/.Reviewed by Cursor Bugbot for commit 9f5d03e. Configure here.
Summary by CodeRabbit
新機能
テスト