Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# リバースエンジニアリング再スキャン — ハーネス横断live E2E

## 実行メタデータ

- 実施日時: `2026-08-03T10:20:14Z`
- Intent: `260803-harness-live-e2e`
- リポジトリ: `amadeus`(単一repo)
- スコープ: `self-feature`
- プロジェクト種別: Brownfield
- 基点commit: `a8e1ce025a918310ab7d803270bb6fc6b649c598`
- 観測commit: `52a082af7d13c537fad65b1204c9760e28b73f61`
- 距離: `46 commits`
- 差分規模: `1,593 files changed, 174,787 insertions(+), 6,561 deletions(-)`
- 焦点: [Issue #1717](https://github.com/amadeus-dlc/amadeus/issues/1717) のlive E2E共通policy/lifecycleとharness×transport adapterの段階展開。共通gate、構造化skip、scratch/cleanup、failure taxonomy、credential境界、既存surface移行、Cursor/OpenCodeのcapability spikeを対象とした。
- 基点選択: 本Intentに過去recordがないため、`re-scans/260802-plugin-projection-parity.md`のobservedを最新の記録済み祖先として採用した。共有`reverse-engineering-timestamp.md`はbase選択に使用していない。

## Git断面

- `git merge-base --is-ancestor a8e1ce025a918310ab7d803270bb6fc6b649c598 52a082af7d13c537fad65b1204c9760e28b73f61`はexit 0で、baseはobservedの祖先である。
- preflightでローカルHEADが`origin/main`より3コミット後方と判明したためfast-forwardし、検証中に追加された1コミットも再度fast-forwardした。最終observedは`origin/main`と一致する。追加4コミットはlive E2E焦点面を変更していない。
- Issue #1717の焦点となる既存drive helper 6本は区間内変更0。区間内の焦点変更は`tests/run-tests.ts`とCursor/OpenCode manifest/plugin周辺である。したがってlive契約の非対称は46コミット区間の回帰ではなく、base以前からの未統合契約である。

## Developerコードスキャン実測

### リポジトリとビルド

- Bun `1.3.13`、strict TypeScript、ESM、bundler resolutionのmonorepoである。長寿命service、HTTP server、databaseはない。
- framework正本は`packages/framework/core/`と`packages/framework/harness/`にあり、7 harnessへ投影される。
- TypeScriptはcore 216ファイル、harness固有source 32ファイル。`*.test.ts`は869本。
- `scripts/package.ts`と`scripts/promote-self.ts`が生成・self-install投影を担い、`dist:check`、`promote:self:check`、`distribution:check`がdriftを検査する。

### テスト結果

- Codex policy/helper、Kimi driver、Cursor adapterの選択4ファイルを最終observedで再実行: **58 pass / 132 assertions / 0 fail**。
- `GITHUB_ACTIONS=true`、全live flag未設定の代表5 surface: **0 pass / 7 skip / 0 fail**。
- CodexはGHAを理由にskipし、Kimi/Kiro ACP/TUI/IDEはopt-in未設定を理由にskipした。GHA hard denyの横断precedenceが存在しないことを再確認した。
- typecheckはコードエラーではなく、このworktreeに`tsc` executableがないためexit 127で未実施。成功・失敗のコード品質証拠へ丸めない。

## 実行面の棚卸し

| Surface | Live gate | Credential/config isolation | Result / failure | 判定 |
| --- | --- | --- | --- | --- |
| Codex exec | 明示flag、GHA hard deny | scratch homeへauth copy、source pointer削除 | journey固有の`rc/out` | 共通化の局所先例 |
| Claude SDK | 共通flagなし、`t19`はsuite skip | user/local settings除外、ambient env継承 | AbortController、partial result | policy/secret境界が不足 |
| Claude TUI | 主に`AMADEUS_TUI_LIVE` | project setting source、private tmux | exit 0/1/2 | retain/failureが固有 |
| Kimi print | 明示flag | scratch config、real credential dirsをsymlink | `rc/timedOut/error` | GHA denyとsecret境界が不足 |
| Kiro ACP | 明示flag | `whoami`、ambient AWS profile | cancel後throw | transport制約をadapterへ閉じる必要 |
| Kiro TUI | 明示flag | ambient profile | driver exit code | outcome正規化が必要 |
| Kiro IDE | 明示flag | generated profile、machine auth | CDP timeout/exception | artifact/credential保持分離が必要 |
| Cursor | なし | deterministic fixtureのみ | adapter mappingのassert | live transport/journey未実装 |
| OpenCode | なし | plugin fixtureのみ | presence mintのassert | live transport/journey未実装 |

## アーキテクト統合判断

### 観測した境界

共通`LivePolicy`、構造化skip reason、scratch lifecycle、timeout/failure taxonomyはobserved HEADに存在しない。各driverがpolicy、credential、spawn、cleanup、resultの一部または全部を個別所有している。journeyは構造化tool/state/auditを読む強い例とexit code/例外を直接解釈する例が混在する。

### 合成した依存方向

1. 共通policy/lifecycleは明示opt-in、GHA hard deny、gate precedence、構造化skip、scratch状態遷移、timeout/failure class、credential declarationと漏洩検査を所有する。
2. harness×transport adapterはbinary/version/auth preflight、環境allow-list、credential strategy、scratch注入、spawn/cancel/cleanup、raw result正規化を所有する。
3. journey/assertionはpromptと期待するtool/state/audit/resultを所有し、adapter固有exit codeやambient credentialへ依存しない。
4. runner/reportingはtier、並列、構造化skip/failureの集約とsanitized live run ledgerを所有する。

credential strategyはadapter所有とする。Codex auth file、Kimi credential directory、Kiro AWS/machine auth、Claude settingsは同じ仕組みとして扱えない。一方、共通層はcredentialの種類、scratch配置、retain禁止、cleanup receiptの宣言と、pointer/material双方の漏洩検査を所有する。この分離によりtransport差を保持しつつ横断的な秘密情報安全性を検証できる。

### 段階展開

1. 共通policy/lifecycleのwalking skeletonを、既存Codex precedenceとcleanup先例を使って構築する。
2. 既存live surfaceを一つずつadapter契約へ移し、各移行で既存journeyをtyped outcomeへ切り替える。
3. runnerへ構造化skip reasonとsanitized run ledgerを接続する。
4. Cursor/OpenCodeはcapability spikeで実runtimeの起動、hook観測、停止、credential隔離を証明する。
5. spikeが成立したsurfaceだけadapterと最小journeyを同じ変更単位で追加する。成立しない能力はunsupported/conditionalとして記録し、実測結果・阻害要因・推奨seam・受け入れ条件を持つ後続Issueへ接続する。dormant adapterは先行登録しない。

## 影響とリスク

- 主な変更候補は`tests/harness/`、live journey、`tests/run-tests.ts`、必要なdocs/CI receiptである。production engineの巨大moduleへlive test契約を混入させない。
- 最大のセキュリティリスクはambient credential継承、debug artifactへの秘密残留、GHAでの誤起動。probe前deny、adapter env allow-list、資格情報強制削除、共通漏洩検査で閉じる。
- 最大の設計リスクはCLI/SDK/TUI/ACP/CDPを単一汎用spawn wrapperへ押し込み、共通層を条件分岐の集積にすること。共通化はpolicy/lifecycle/result vocabularyに限定する。
- 最大の検証空白はClaude headless live journey、Cursor/OpenCode runtime journey、live green SHA/run ledger、runnerのskip reason fieldである。

## 更新した共有成果物

- `business-overview.md`: 利用者価値、共通契約、段階展開、成功境界。
- `architecture.md`: 現行非対称、共通policy/lifecycle→transport adapter→journey/assertion、credential責務、Interaction Diagrams。
- `code-structure.md`: 6 driver、journey、runner、Cursor/OpenCode、CI/docsの配置と挿入点。
- `api-documentation.md`: 現行driver APIと未実装の共通契約。
- `component-inventory.md`: surface別health、missing共通層、live ledger。
- `technology-stack.md`: 7 harness、869 tests、外部transport substrate、新規依存不要。
- `dependencies.md`: 共通層、adapter、credential、journey、runnerの依存方向。
- `code-quality-assessment.md`: 58 pass、7 skip、typecheck制約、品質リスクと検証空白。
- `reverse-engineering-timestamp.md`: observed/date/focus/per-intent linkだけを持つ共有freshness pointer。

8本文の旧`260802-registry-drift-guard`現在節は内容を変更せず履歴へ降格した。過去のfile:lineや断面判断は当時のobservedを指すため更新していない。
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-1",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "『0件で可』を全面的に支持する。c1はApplication Design成果物がBun test process内の短命local harnessでありAWS resource/network service/database/daemonを追加しないというIssue #1717固有の境界で、project.md cid:nfr-design:c1の『CLI/libraryへ常駐service向け機構を機械適用しない』既存規範の適用事例である。c2はユーザー裁定に基づくTypeScript capability registry・append-only JSONL run ledger・Markdown導出viewの正本構造で、ADR-003、components C7-C9、component-dependencyのwriter/reader表へ固定済みであり、project.md cid:requirements-analysis:c2のmachine registryとnarrative分離の具体化に留まる。projection driftとledger破損は既にcontract test、fail-closed validation、projector checkとして設計内で閉じるため別sensorは不要。c3はIssue #1717のpolicy/result/lifecycle deep moduleとharness×transport adapterの責務分離で、ADR-001/002と5成果物へ一貫して保存済みのarchitecture decisionであり、他Intentへ一律適用する行動規範へ一般化すべきでない。3件とも新規の横断practiceまたはstage sensorではない。",
"submittedAt": "2026-08-03T11:59:47Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-2",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "c1はproject memoryのno deployment infrastructure方針をIssue #1717固有のlocal live E2E test-harnessへ適用した判断であり、ADR-001に十分保持されている。c2はhuman決定をADR-003と設計成果物がtyped TypeScript registry=static capability正本、JSONL=live run正本、Markdown=derived projectionとして明示しており、横断的な行動規範ではない。c3もADR-001/002がcommon policy/result/lifecycle deep moduleとCLI・SDK・tmux・ACP・CDP transport adapterの責務境界をFR/NFRへ追跡可能に保持している。この分離を全projectへ恒久一般化すると適用範囲を過剰に広げる。既存project memoryにはmachine registryとnarrative projectionの分離規範もあり、追加sensorで決定論的に検査すべき新述語もないため、新規project/team ruleおよびsensorは0件で可と判断する。",
"submittedAt": "2026-08-03T12:00:04Z"
}
17 changes: 17 additions & 0 deletions amadeus/spaces/default/elections/260803-e-hle-ad13/election.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"electionId": "E-HLE-AD13",
"kind": "learnings-selection",
"question": "application-designのc1〜c3はIssue #1717固有のlocal test-harness境界、registry/JSONL/Markdown正本裁定、共通deep moduleとtransport adapter分離としてIntent成果物に保持し、新規project/team ruleまたはsensorは0件でよいか。",
"choices": [
{
"internalNo": 1,
"label": "0件で可",
"description": "恒久ルール・センサーを追加せず、3候補をIntent recordに保持する"
}
],
"voters": [
"subagent-1",
"subagent-2"
],
"state": "recorded"
}
27 changes: 27 additions & 0 deletions amadeus/spaces/default/elections/260803-e-hle-ad13/ledger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ballots": [
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-1",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "『0件で可』を全面的に支持する。c1はApplication Design成果物がBun test process内の短命local harnessでありAWS resource/network service/database/daemonを追加しないというIssue #1717固有の境界で、project.md cid:nfr-design:c1の『CLI/libraryへ常駐service向け機構を機械適用しない』既存規範の適用事例である。c2はユーザー裁定に基づくTypeScript capability registry・append-only JSONL run ledger・Markdown導出viewの正本構造で、ADR-003、components C7-C9、component-dependencyのwriter/reader表へ固定済みであり、project.md cid:requirements-analysis:c2のmachine registryとnarrative分離の具体化に留まる。projection driftとledger破損は既にcontract test、fail-closed validation、projector checkとして設計内で閉じるため別sensorは不要。c3はIssue #1717のpolicy/result/lifecycle deep moduleとharness×transport adapterの責務分離で、ADR-001/002と5成果物へ一貫して保存済みのarchitecture decisionであり、他Intentへ一律適用する行動規範へ一般化すべきでない。3件とも新規の横断practiceまたはstage sensorではない。",
"submittedAt": "2026-08-03T11:59:47Z"
},
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-2",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "c1はproject memoryのno deployment infrastructure方針をIssue #1717固有のlocal live E2E test-harnessへ適用した判断であり、ADR-001に十分保持されている。c2はhuman決定をADR-003と設計成果物がtyped TypeScript registry=static capability正本、JSONL=live run正本、Markdown=derived projectionとして明示しており、横断的な行動規範ではない。c3もADR-001/002がcommon policy/result/lifecycle deep moduleとCLI・SDK・tmux・ACP・CDP transport adapterの責務境界をFR/NFRへ追跡可能に保持している。この分離を全projectへ恒久一般化すると適用範囲を過剰に広げる。既存project memoryにはmachine registryとnarrative projectionの分離規範もあり、追加sensorで決定論的に検査すべき新述語もないため、新規project/team ruleおよびsensorは0件で可と判断する。",
"submittedAt": "2026-08-03T12:00:04Z"
}
],
"late": []
}
8 changes: 8 additions & 0 deletions amadeus/spaces/default/elections/260803-e-hle-ad13/record.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Election Record — E-HLE-AD13

- question: application-designのc1〜c3はIssue #1717固有のlocal test-harness境界、registry/JSONL/Markdown正本裁定、共通deep moduleとtransport adapter分離としてIntent成果物に保持し、新規project/team ruleまたはsensorは0件でよいか。

裁定: 0件で可(choice 1: 2票)
内訳: choice1=2票
票タイムライン: 配信 2026-08-03T11:59:14Z → 配信 2026-08-03T11:59:14Z → subagent-1 2026-08-03T11:59:47Z(受理 2026-08-03T12:00:08Z) → subagent-2 2026-08-03T12:00:04Z(受理 2026-08-03T12:00:46Z) → 開票 2026-08-03T12:01:04Z
GoA[E-HLE-AD13]: 1x2 2x0 3x0 4x0 5x0 6x0 7x0 8x0
48 changes: 48 additions & 0 deletions amadeus/spaces/default/elections/260803-e-hle-ad13/tally.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"result": {
"kind": "established",
"winner": {
"internalNo": 1,
"label": "0件で可"
},
"choiceCounts": [
{
"internalNo": 1,
"label": "0件で可",
"count": 2
}
],
"goa": {
"favor": 2,
"against": 0,
"abstain": 0,
"discuss": 0
}
},
"talliedAt": "2026-08-03T12:01:04Z",
"ballots": [
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-1",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "『0件で可』を全面的に支持する。c1はApplication Design成果物がBun test process内の短命local harnessでありAWS resource/network service/database/daemonを追加しないというIssue #1717固有の境界で、project.md cid:nfr-design:c1の『CLI/libraryへ常駐service向け機構を機械適用しない』既存規範の適用事例である。c2はユーザー裁定に基づくTypeScript capability registry・append-only JSONL run ledger・Markdown導出viewの正本構造で、ADR-003、components C7-C9、component-dependencyのwriter/reader表へ固定済みであり、project.md cid:requirements-analysis:c2のmachine registryとnarrative分離の具体化に留まる。projection driftとledger破損は既にcontract test、fail-closed validation、projector checkとして設計内で閉じるため別sensorは不要。c3はIssue #1717のpolicy/result/lifecycle deep moduleとharness×transport adapterの責務分離で、ADR-001/002と5成果物へ一貫して保存済みのarchitecture decisionであり、他Intentへ一律適用する行動規範へ一般化すべきでない。3件とも新規の横断practiceまたはstage sensorではない。",
"submittedAt": "2026-08-03T11:59:47Z"
},
{
"kind": "original",
"electionId": "E-HLE-AD13",
"voter": "subagent-2",
"voterKind": "subagent",
"choiceInternalNo": 1,
"goa": 1,
"reservation": null,
"rationale": "c1はproject memoryのno deployment infrastructure方針をIssue #1717固有のlocal live E2E test-harnessへ適用した判断であり、ADR-001に十分保持されている。c2はhuman決定をADR-003と設計成果物がtyped TypeScript registry=static capability正本、JSONL=live run正本、Markdown=derived projectionとして明示しており、横断的な行動規範ではない。c3もADR-001/002がcommon policy/result/lifecycle deep moduleとCLI・SDK・tmux・ACP・CDP transport adapterの責務境界をFR/NFRへ追跡可能に保持している。この分離を全projectへ恒久一般化すると適用範囲を過剰に広げる。既存project memoryにはmachine registryとnarrative projectionの分離規範もあり、追加sensorで決定論的に検査すべき新述語もないため、新規project/team ruleおよびsensorは0件で可と判断する。",
"submittedAt": "2026-08-03T12:00:04Z"
}
],
"resolutions": []
}
33 changes: 33 additions & 0 deletions amadeus/spaces/default/elections/260803-e-hle-ad13/timeline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[
{
"kind": "distributed",
"at": "2026-08-03T11:59:14Z",
"detail": "delivered via subagent: subagent-1 (reported-by-conductor)",
"voter": "subagent-1"
},
{
"kind": "distributed",
"at": "2026-08-03T11:59:14Z",
"detail": "delivered via subagent: subagent-2 (reported-by-conductor)",
"voter": "subagent-2"
},
{
"kind": "ballot",
"at": "2026-08-03T11:59:47Z",
"receivedAt": "2026-08-03T12:00:08Z",
"detail": "ballot accepted: subagent-1",
"voter": "subagent-1"
},
{
"kind": "ballot",
"at": "2026-08-03T12:00:04Z",
"receivedAt": "2026-08-03T12:00:46Z",
"detail": "ballot accepted: subagent-2",
"voter": "subagent-2"
},
{
"kind": "tallied",
"at": "2026-08-03T12:01:04Z",
"detail": "tally: established"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"electionId": "E-HLE-AD13",
"voter": "subagent-1",
"question": "application-designのc1〜c3はIssue #1717固有のlocal test-harness境界、registry/JSONL/Markdown正本裁定、共通deep moduleとtransport adapter分離としてIntent成果物に保持し、新規project/team ruleまたはsensorは0件でよいか。",
"ordered": [
{
"displayNo": 1,
"internalNo": 1,
"label": "0件で可",
"description": "恒久ルール・センサーを追加せず、3候補をIntent recordに保持する"
}
]
}
Loading
Loading