Skip to content

Bolt 5: 5 harness の opt-in live 適合性機構と Intent completion seal 語彙を追加する - #2234

Merged
j5ik2o merged 6 commits into
mainfrom
codex/intent-autonomy-u5-completion
Aug 5, 2026
Merged

Bolt 5: 5 harness の opt-in live 適合性機構と Intent completion seal 語彙を追加する#2234
j5ik2o merged 6 commits into
mainfrom
codex/intent-autonomy-u5-completion

Conversation

@j5ik2o

@j5ik2o j5ik2o commented Aug 5, 2026

Copy link
Copy Markdown
Member

概要

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-closed
  • amadeus-loop-monitor-runtime.ts: LiveAuthorizationPort seam と 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 へ昇格
  • t433 の completion seal fixture を raw shard 追記から registry-guarded emitter へ変更(Bolt 4 で残した暫定の解消)

スコープ境界

  • completion seal を書く production writer は含めない(record の U5 契約どおり — Core terminal path は evidence 非依存)
  • PR / GitHub / merge、外部 runner / supervisor、credential 管理は Core に含めない

検証(いずれもローカル実測、exit code 0)

  • bun run typecheck / bun run lint / complexity / source-only すべて 0
  • bun run coverage:ci: Failed 0 / RESULT: PASS
  • patch gate: added 795 行 / covered 770 / allowlisted 25 / uncovered 0(allowlist は公開 seam から構築不能な深部 fail-closed arm のみ、理由付き)
  • project coverage 91.905%(merge-base 比プラス)
  • no-silent-drop: PR base へ再バインド済み・check 0
  • テスト: t434 unit 7(registry 拒否・payload digest mismatch・terminal audit fields 含む)/ 5-harness projection 5 / opt-in live seam(attestation なしは設計どおり skip)/ t427 に authorizeLiveSmoke 3 arm / autonomy 全スイート green

Note

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_HUMAN when capabilities are missing). amadeus-loop-monitor-runtime gains LiveAuthorizationPort / authorizeLiveSmoke and LIVE_SMOKE_AUTHORIZED replay support. ValidatedHarnessRegistry + packages/framework/harness/registry.ts export; autonomy status sets terminalLiveCompletionCapable: true.

Audit / drift: registers INTENT_COMPLETION_TRANSACTION_COMMITTED as the 90th canonical event (registry, amadeus-audit, docs, coverage). t433 seeds completion seals via the guarded emitter instead of raw shards; t48 recognizes typed eventType: 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

  • 新機能

    • Intent完了フローで、認可・実行・証拠検証・監査コミット・台帳保存を一貫して処理できるようにしました。
    • 複数ハーネスの実行結果を検証し、不足・重複・改ざんを検出します。
    • 完了時に証拠ダイジェスト付きの監査イベントを記録します。
    • ライブスモーク実行の認可結果を監視できるようにしました。
    • 終端ライブ完了に対応しました。
  • テスト

    • 完了処理、認可、監査、台帳復元の検証を拡充しました。

j5ik2o added 2 commits August 5, 2026 09:56
…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.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c022bbd7-85e6-4d04-a640-ec6751ecb1d8

📥 Commits

Reviewing files that changed from the base of the PR and between 85e8c60 and 64f3cbe.

📒 Files selected for processing (2)
  • packages/framework/core/tools/amadeus-intent-completion.ts
  • tests/unit/t434-intent-completion.test.ts

📝 Walkthrough

Walkthrough

Intent完了フローに、5つのハーネスの検証、ライブ認可、レシート照合、完了証拠、終端トランザクション、監査記録、メモリ台帳を追加しました。監査語彙と関連テストも更新しました。

Changes

Intent完了フロー

Layer / File(s) Summary
監査・ハーネス契約
docs/reference/12-state-machine.md, packages/framework/core/knowledge/..., packages/framework/core/otel/event-registry.ts, packages/framework/core/tools/amadeus-audit.ts, packages/framework/core/tools/amadeus-harness-registry.ts, packages/framework/core/tools/amadeus-intent-autonomy-runtime.ts, packages/framework/harness/registry.ts
INTENT_COMPLETION_TRANSACTION_COMMITTED を監査語彙へ追加しました。検証済みハーネスレジストリと終端ライブ完了能力を定義しました。
ライブ実行認可
packages/framework/core/tools/amadeus-loop-monitor-*.ts
ライブスモーク認可、認可イベント、拒否結果、パーティション検証を追加しました。
ライブ完了検証と証拠評価
packages/framework/core/tools/amadeus-intent-completion.ts, tests/unit/t434-intent-completion.test.ts
ハーネス検証、レシート照合、再ディスパッチ、完了証拠評価を追加しました。欠落、重複、改ざん、リビジョン不一致を拒否します。
終端コミットと完了台帳
packages/framework/core/tools/amadeus-intent-completion.ts, tests/integration/t433-autonomy-review-observability.test.ts, tests/unit/t434-intent-completion.test.ts
終端コミット計画、受領検証、完了シール、メモリ台帳、復元、レビュー待ち結果を追加しました。
配布・統合検証
tests/integration/t434-*, tests/integration/event-registry-drift.test.ts, tests/unit/t28-audit-event-sync.test.ts, tests/unit/t81.test.ts, tests/.coverage-*, tests/no-silent-drop/*, tests/integration/t432-autonomy-runtime.integration.test.ts, tests/integration/t48-audit-event-emitters.test.ts
5つのハーネス間の共有ファイル一致、オプトインのライブ実行、監査イベント件数、拒否契約、カバレッジ基準を更新しました。

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは5つのハーネス向けopt-in live適合性機構とIntent completion seal語彙の追加を明確に示しており、主な変更内容と一致します。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/framework/core/tools/amadeus-intent-completion.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e990c4 and 9f5d03e.

⛔ Files ignored due to path filters (12)
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/code-generation/code-generation-plan.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/code-generation/code-summary.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/business-logic-model.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/business-rules.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/domain-entities.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/functional-design/functional-design-questions.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/logical-components.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/nfr-design-questions.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/performance-design.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/reliability-design.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/scalability-design.md is excluded by !amadeus/spaces/*/intents/**
  • amadeus/spaces/default/intents/260803-intent-autonomy/construction/five-harness-intent-completion/nfr-design/security-design.md is excluded by !amadeus/spaces/*/intents/**
📒 Files selected for processing (25)
  • docs/reference/12-state-machine.md
  • packages/framework/core/knowledge/amadeus-shared/audit-format.md
  • packages/framework/core/otel/event-registry.ts
  • packages/framework/core/tools/amadeus-audit.ts
  • packages/framework/core/tools/amadeus-harness-registry.ts
  • packages/framework/core/tools/amadeus-intent-autonomy-runtime.ts
  • packages/framework/core/tools/amadeus-intent-completion.ts
  • packages/framework/core/tools/amadeus-loop-monitor-replay.ts
  • packages/framework/core/tools/amadeus-loop-monitor-runtime.ts
  • packages/framework/harness/registry.ts
  • tests/.coverage-patch-allowlist.json
  • tests/.coverage-ratchet.json
  • tests/.coverage-registry.json
  • tests/integration/event-registry-drift.test.ts
  • tests/integration/t432-intent-autonomy-runtime.integration.test.ts
  • tests/integration/t433-autonomy-review-observability.test.ts
  • tests/integration/t434-intent-completion-five-harness-projection.integration.test.ts
  • tests/integration/t434-intent-completion-live-seam.integration.test.ts
  • tests/integration/t48-audit-event-emitters.test.ts
  • tests/no-silent-drop/baseline.json
  • tests/no-silent-drop/exemptions.json
  • tests/unit/t28-audit-event-sync.test.ts
  • tests/unit/t427-loop-monitor-runtime.test.ts
  • tests/unit/t434-intent-completion.test.ts
  • tests/unit/t81.test.ts

Comment thread packages/framework/core/knowledge/amadeus-shared/audit-format.md
Comment thread packages/framework/core/tools/amadeus-intent-completion.ts Outdated
Comment thread packages/framework/core/tools/amadeus-intent-completion.ts
Comment thread packages/framework/core/tools/amadeus-intent-completion.ts Outdated
Comment thread packages/framework/core/tools/amadeus-intent-completion.ts
Comment thread packages/framework/core/tools/amadeus-intent-completion.ts
Comment thread tests/integration/t434-intent-completion-live-seam.integration.test.ts Outdated
Comment thread tests/unit/t427-loop-monitor-runtime.test.ts
Comment thread tests/unit/t434-intent-completion.test.ts
j5ik2o added 3 commits August 5, 2026 10:38
- 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9f5d03e and 85e8c60.

📒 Files selected for processing (7)
  • packages/framework/core/knowledge/amadeus-shared/audit-format.md
  • packages/framework/core/tools/amadeus-intent-completion.ts
  • tests/.coverage-patch-allowlist.json
  • tests/integration/t434-intent-completion-five-harness-projection.integration.test.ts
  • tests/integration/t434-intent-completion-live-seam.integration.test.ts
  • tests/unit/t427-loop-monitor-runtime.test.ts
  • tests/unit/t434-intent-completion.test.ts

Comment thread packages/framework/core/tools/amadeus-intent-completion.ts
@j5ik2o
j5ik2o merged commit b21e7c5 into main Aug 5, 2026
15 checks passed
@j5ik2o
j5ik2o deleted the codex/intent-autonomy-u5-completion branch August 5, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant