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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
- **Scope**: self-feature
- **Start Date**: 2026-08-04T08:24:31Z
- **State Version**: 7
- **Active Agent**: amadeus-architect-agent
- **Active Agent**: amadeus-developer-agent
- **Harness**: codex
- **Harness Version**: {"state":"unavailable","reason":"native-harness-version-not-exposed"}
- **Model**: {"state":"unavailable","reason":"native-model-not-exposed"}
- **Worktree Path**:
- **Worktree Path**: /Users/j5ik2o/Sources/j5ik2o.github.com/amadeus-dlc/amadeus/.amadeus/worktrees/bolt-kiro-tui-live-e2e
- **Bolt Refs**:
- **Practices Affirmed Timestamp**:

- **Merge-Held**: false
## Scope Configuration
- **Stages to Execute**: 0.1, 0.2, 0.3, 1.1, 1.4, 2.1, 2.3, 2.6, 2.7, 2.8, 3.1, 3.3, 3.5, 3.6
- **Stages to Skip**: 1.2 (market-research), 1.3 (feasibility), 1.5 (team-formation), 1.6 (rough-mockups), 1.7 (approval-handoff), 2.2 (practices-discovery), 2.4 (user-stories), 2.5 (refined-mockups), 3.2 (nfr-requirements), 3.4 (infrastructure-design), 3.7 (ci-pipeline), 3.8 (formal-model-check), 4.1 (deployment-pipeline), 4.2 (environment-provisioning), 4.3 (deployment-execution), 4.4 (observability-setup), 4.5 (incident-response), 4.6 (performance-validation), 4.7 (feedback-optimization)
Expand All @@ -28,8 +29,8 @@

## Execution Plan Summary
- **Total Stages**: 14
- **Completed**: 11
- **In Progress**: nfr-design
- **Completed**: 12
- **In Progress**: code-generation

## Runtime State
- **Revision Count**: 0
Expand All @@ -38,8 +39,6 @@
- **Mirror Initial Create Receipt**: completed
- **Mirror Boundary Receipts**: {"ideation":"completed","inception":"completed"}
- **Skeleton Stance**: on
- **Parked**: 2026-08-04T14:23:20Z
- **Parked At Stage**: nfr-design
## Phase Progress
<!-- Status values: Pending, Active, Verified, Skipped -->

Expand Down Expand Up @@ -80,9 +79,9 @@
Per unit: [TBD]
- [x] functional-design — EXECUTE
- [ ] nfr-requirements — SKIP
- [-] nfr-design — EXECUTE
- [x] nfr-design — EXECUTE
- [ ] infrastructure-design — SKIP
- [ ] code-generation — EXECUTE
- [-] code-generation — EXECUTE
- [ ] build-and-test — EXECUTE
- [ ] ci-pipeline — SKIP
- [ ] formal-model-check — SKIP
Expand All @@ -98,15 +97,15 @@ Per unit: [TBD]

## Current Status
- **Lifecycle Phase**: CONSTRUCTION
- **Current Stage**: nfr-design
- **Next Stage**: code-generation
- **Current Stage**: code-generation
- **Next Stage**: build-and-test
- **Status**: Running
- **Construction Autonomy Mode**: gated
- **Last Updated**: 2026-08-04T14:23:20Z
- **Last Updated**: 2026-08-04T23:52:14Z

## Session Resume Point
- **Last Completed Stage**: functional-design
- **Next Action**: Execute Nfr Design
- **Last Completed Stage**: nfr-design
- **Next Action**: Execute Code Generation
- **Pending Artifacts**: none

<!-- amadeus:mirror-state:v1:start -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"schemaVersion":2,"eventId":"80b0d669-bcc2-462d-afc7-55b9267e8535","seq":1,"timestamp":"2026-08-04T23:44:55Z","eventName":"amadeus.workflow.unparked","attributes":{"Event":"WORKFLOW_UNPARKED","Timestamp":"2026-08-04T23:44:55Z"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"9a5b3ed4-1349-410f-a847-76e2a7dbfdbe","canonical":true}
{"schemaVersion":2,"eventId":"4c54eb38-579c-4f09-b64d-3c6876c1870d","seq":2,"timestamp":"2026-08-04T23:45:13Z","eventName":"amadeus.human.turn","attributes":{"Event":"HUMAN_TURN"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"a8d70884-9c67-4f4c-af82-19d580d9f73d","canonical":true}
{"schemaVersion":2,"eventId":"efbbe720-52df-4076-bc15-043d5b7339c1","seq":3,"timestamp":"2026-08-04T23:45:19Z","eventName":"amadeus.operation.failed","attributes":{"Command":"report --result answered --user-input Resume from last checkpoint","Error":"Unknown --result \"answered\". report commits forward transitions only; accepted outcomes: approved, completed, complete, done.","Event":"ERROR_LOGGED","Tool":"amadeus-orchestrate"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"f698c999-892a-405a-a1f0-00ac23f119d8","canonical":true}
{"schemaVersion":2,"eventId":"b7b5b5c8-e8c9-4ca6-9ced-2b98609b56f4","seq":4,"timestamp":"2026-08-04T23:49:14Z","eventName":"amadeus.subagent.completed","attributes":{"Agent ID":"a4551e227c45e54e9","Agent Type":"amadeus-architecture-reviewer-agent","Event":"SUBAGENT_COMPLETED","Message":"Reviewer: amadeus-architecture-reviewer-agent\nInvocation: 4078e600-985f-4ab5-99da-30f795b1f523\nIteration: 1\nVerdict: READY\nSummary: The security-design.md artifact for the phase2-live-e2e-evidence spe"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"e879179f-3f44-4f75-baa6-b9243395590a","canonical":true}
{"schemaVersion":2,"eventId":"96f13c2a-696d-432d-9fd9-0ec16a7a72b0","seq":5,"timestamp":"2026-08-04T23:50:11Z","eventName":"amadeus.stage.awaiting.approval","attributes":{"Event":"STAGE_AWAITING_APPROVAL","Stage":"nfr-design"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"b96b8799-9550-4db0-a5b5-8962bb58c8d0","canonical":true}
{"schemaVersion":2,"eventId":"33fe906d-9bfa-4045-9203-827c000d7354","seq":6,"timestamp":"2026-08-04T23:52:11Z","eventName":"amadeus.human.turn","attributes":{"Event":"HUMAN_TURN"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"ef40cceb-0a65-4ef4-a155-c3ce9b6b9dbe","canonical":true}
{"schemaVersion":2,"eventId":"28db498c-7ce8-41ec-87e1-6db4114f2700","seq":7,"timestamp":"2026-08-04T23:52:14Z","eventName":"amadeus.gate.approved","attributes":{"Event":"GATE_APPROVED","Stage":"nfr-design","User Input":"Approve"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"af329b23-fd5c-463f-a6c7-107c1248cb86","canonical":true}
{"schemaVersion":2,"eventId":"77ecaa95-1e9a-45ce-af4d-59cf9d0d588e","seq":8,"timestamp":"2026-08-04T23:52:14Z","eventName":"amadeus.stage.completed","attributes":{"Details":"Stage Nfr Design approved by gate","Event":"STAGE_COMPLETED","Stage":"nfr-design"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"f608c56f-2ae6-45fb-b03e-6776b4794280","canonical":true}
{"schemaVersion":2,"eventId":"ae123cfa-0c2a-4a7e-a84b-1af09aab1a39","seq":9,"timestamp":"2026-08-04T23:52:14Z","eventName":"amadeus.stage.started","attributes":{"Agent":"amadeus-developer-agent","Event":"STAGE_STARTED","Stage":"code-generation"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"f43460a7-a0e8-4d07-a110-a09cf6741392","canonical":true}
{"schemaVersion":2,"eventId":"97e87717-728e-485e-90f3-d05c2e303fa4","seq":10,"timestamp":"2026-08-04T23:52:42Z","eventName":"amadeus.operation.failed","attributes":{"Command":"amadeus-bolt status","Error":"Unknown subcommand: status. Valid: start, complete, fail, abort, set-autonomy, approve-batch, dispatch-event, hold-merge, release-merge","Event":"ERROR_LOGGED","Tool":"amadeus-bolt"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"9792b1b9-4bdc-41b4-8a6e-61e647561ade","canonical":true}
{"schemaVersion":2,"eventId":"76f4d1b7-03bb-437c-91b7-98e310c959cd","seq":11,"timestamp":"2026-08-04T23:53:13Z","eventName":"amadeus.operation.failed","attributes":{"Command":"amadeus-worktree --project-dir /Users/j5ik2o/Sources/j5ik2o.github.com/amadeus-dlc/amadeus/.claude/worktrees/sub3 create --slug kiro-tui-live-e2e --base main","Error":"[slug=kiro-tui-live-e2e] Local base branch \"main\" differs from origin/main: local SHA 8a7af9aa85a6177abe224f72fd79a435f36b55c9, remote SHA 5fb23ec2aac348f0d6517a24d1f9ec109ab7b6fb. Run git fetch origin and fast-forward \"main\", or rerun with --allow-stale to intentionally use the local SHA.","Event":"ERROR_LOGGED","Tool":"amadeus-worktree"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"5052f4db-7785-4f7e-9fd9-1c3ddc8ebe5e","canonical":true}
{"schemaVersion":2,"eventId":"7fb87003-39f0-47aa-87c8-6ffa72d7c7b9","seq":12,"timestamp":"2026-08-04T23:53:19Z","eventName":"amadeus.worktree.created","attributes":{"Base branch":"main","Bolt slug":"kiro-tui-live-e2e","Branch name":"bolt-kiro-tui-live-e2e","Event":"WORKTREE_CREATED","Worktree path":"/Users/j5ik2o/Sources/j5ik2o.github.com/amadeus-dlc/amadeus/.amadeus/worktrees/bolt-kiro-tui-live-e2e"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"f323d6ae-9faa-42f7-9085-8b340969002f","canonical":true}
{"schemaVersion":2,"eventId":"31c10903-fc25-40cd-a705-a39b827c4311","seq":13,"timestamp":"2026-08-04T23:53:20Z","eventName":"amadeus.bolt.started","attributes":{"Batch number":"1","Bolt names":"kiro-tui-live-e2e","Bolt slug":"kiro-tui-live-e2e","Event":"BOLT_STARTED","Walking skeleton":"false"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"94632e0e-7c1e-48b5-a7b6-ec92088288e7","canonical":true}
{"schemaVersion":2,"eventId":"a3c4a197-7a7e-43c7-b7f0-aaab8ec4a714","seq":14,"timestamp":"2026-08-04T23:53:21Z","eventName":"amadeus.state.forked","attributes":{"Bolt slug":"kiro-tui-live-e2e","Event":"STATE_FORKED","Source state hash":"b28fee8782fc1ce940e65c48e033bea502f25c05b2b027a82dccd6f6546c8346","Target state hash":"b28fee8782fc1ce940e65c48e033bea502f25c05b2b027a82dccd6f6546c8346","Worktree path":"/Users/j5ik2o/Sources/j5ik2o.github.com/amadeus-dlc/amadeus/.amadeus/worktrees/bolt-kiro-tui-live-e2e"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"722f404a-44e5-4f94-a428-a74ac7315cb8","canonical":true}
{"schemaVersion":2,"eventId":"5305596d-d048-45cf-a5d5-f5371a345bb7","seq":15,"timestamp":"2026-08-04T23:53:21Z","eventName":"amadeus.audit.forked","attributes":{"Bolt slug":"kiro-tui-live-e2e","Event":"AUDIT_FORKED","Fork Boundary":"14","Source Audit Hash":"3011e28bb4672adaf9f5003e27e71a9ce22619869581ecb0b865d657cc597f21"},"intentId":"260804-live-e2e-phase2","space":"default","cloneId":"da10ea4c23f8","traceId":null,"spanId":null,"traceFlags":0,"idempotencyKey":"65aedc44-2ffd-4026-80e2-a08ea55c1ffa","canonical":true}
12 changes: 12 additions & 0 deletions docs/harness-engineering/live-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Live journeys never run on GitHub Actions, even if an opt-in variable is set. Ea

The `codex-exec` adapter requires `AMADEUS_CODEX_EXEC_LIVE=1`, Codex CLI 0.139.0 or newer, `dist/codex`, and an `OPENAI_API_KEY` credential lease. The `claude-print` adapter requires `AMADEUS_CLAUDE_PRINT_LIVE=1`; the `claude-tui` adapter requires `AMADEUS_TUI_LIVE=1` and tmux. The `claude-print` and `claude-tui` adapters both require Claude Code 2.1.220 or newer with their measured flags and `dist/claude`. The `claude-sdk` adapter separately requires `AMADEUS_CLAUDE_SDK_LIVE=1`, Claude Agent SDK 0.3.158 or newer, and `dist/claude`. Claude SDK and TUI authentication require a short-lived `ANTHROPIC_API_KEY` binding; Claude print may instead use a verified native keychain login. Source `HOME`, `CLAUDE_CONFIG_DIR`, and user/local settings are never forwarded in either case. The SDK adapter owns the SDK client and stream in an isolated worker group, transfers an environment credential through one length-prefixed stdin frame, and escalates abort to TERM and KILL before cleanup.

The `kiro-tui` adapter requires `AMADEUS_KIRO_TUI_LIVE=1`, tmux, Kiro CLI 2.6.0 or newer, and `dist/kiro`. Kiro keeps its authentication in an on-disk database under the user's home and re-executes its chat runtime from a per-home path, so no environment credential lease exists for it. The scratch home instead binds those two source entries by reference: the credential bytes never leave the user's home, nothing is copied into scratch, and the adapter never writes to, edits, or deletes anything under the source home. Removing the scratch tree removes the entire binding. Source `HOME`, `XDG_DATA_HOME`, `KIRO_HOME`, and ambient AWS credentials are never forwarded to the child.

Cleanup is a barrier, not another recorded outcome. A cleanup error, leak finding, or retained resource returns `cleanup-barrier-failed` and suppresses ledger append even when execution/assertion succeeded. Only the sequence `executed/asserted → cleanup-barrier-closed → ledger-appended|already-present → closure-committed` can release a PASS receipt or a supported matrix projection.

## Running a live journey
Expand Down Expand Up @@ -48,6 +50,15 @@ AMADEUS_TUI_LIVE=1 ANTHROPIC_API_KEY='…' \

The TUI runner starts Claude with project-only settings and scratch-confined `acceptEdits` permission inside a run-private `tmux -S` server and session. It waits for a painted pane, sends one prompt bound to the 128-bit run ID, verifies the exact current-run file anchor, retains only bounded pane digests, and then closes session, server, credential, and scratch resources before the ledger can be called. It never lists, attaches to, or kills a session on the default tmux server.

Run the serial Kiro TUI journey only from a clean local worktree:

```bash
AMADEUS_KIRO_TUI_LIVE=1 \
bun test --timeout 240000 tests/e2e/t-kiro-tui-kernel.serial.test.ts
```

The runner copies `dist/kiro` into a fresh Git project, sets a fresh `HOME` and `TMPDIR`, binds the source auth database and chat runtime into the scratch home, and starts `kiro-cli chat --agent kiro_default --trust-all-tools` inside a run-private `tmux -S` server and session. The built-in agent is pinned deliberately: this journey measures the TUI transport, not the shipped conductor, whose own workflow journeys live in `tests/e2e/t-tui-kiro-*`. The run-private socket is created in the system temp directory under a short run-identified name, because a socket nested inside the scratch root would exceed the platform UNIX domain socket path limit; cleanup unlinks it. It clears the trust-all confirmation picker once, waits for the painted input footer, sends one prompt bound to the 128-bit run ID, verifies the exact current-run file anchor, retains only bounded pane digests, and then closes session, server, binding, and scratch resources before the ledger can be called. It never lists, attaches to, or kills a session on the default tmux server. Authentication is probed by presence only; run `kiro-cli login` first, and expect the journey to spend real Kiro credits on one short turn.

## Ledger and matrix

Recorded runs append atomically to `tests/harness/live-e2e/runs.jsonl`. A recorded receipt contains adapter/version/SHA/time/result and bounded digests, never raw credentials, absolute source paths, prompts, or full output. A pending durability marker is not green evidence; recover the identical receipt before projecting it.
Expand All @@ -69,6 +80,7 @@ The live test updates only the ledger. Maintainers explicitly run `update`, revi
| claude-sdk | claude | agent-sdk | `AMADEUS_CLAUDE_SDK_LIVE` | hard deny | SDK-owned worker group; one-shot credential pipe; project settings only | schema, tool, state, audit | UNVERIFIED | 0.3.158 / 0.3.158 | — |
| claude-tui | claude | tui | `AMADEUS_TUI_LIVE` | hard deny | fresh project/home; project settings only; run-private tmux socket and session | file, state | UNVERIFIED | 2.1.220 / 2.1.220 | — |
| codex-exec | codex | exec | `AMADEUS_CODEX_EXEC_LIVE` | hard deny | fresh project/home; env credential lease; no source config or hooks | exit, schema, file | UNVERIFIED | 0.139.0 / 0.146.0 | — |
| kiro-tui | kiro | tui | `AMADEUS_KIRO_TUI_LIVE` | hard deny | fresh project/home; source auth bound by reference, never copied; run-private tmux socket and session | file, state | UNVERIFIED | 2.6.0 / 2.13.0 | — |
<!-- AMADEUS_LIVE_E2E_MATRIX:END -->

## Distribution change trigger
Expand Down
75 changes: 75 additions & 0 deletions tests/e2e/t-kiro-tui-kernel.serial.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Local-only Kiro CLI rendered TUI live journey. The adapter owns a fresh
// project/home and a run-private tmux socket/session. Kiro authentication is
// on disk under the user's home, so the scratch home binds it by reference —
// nothing is copied into scratch, and the source home is never written to,
// edited, or deleted by the adapter.

import { describe, expect, test } from "bun:test";
import { join } from "node:path";
import { kiroTuiLiveRequirementsSkipReason } from "../harness/kiro-tui-live.ts";
import { createKiroTuiJourney } from "../harness/live-e2e/journey.ts";
import {
defaultKiroSourceHome,
KiroHomeCredentialSource,
KiroScratchAllocator,
} from "../harness/live-e2e/kiro.ts";
import { KiroTuiAdapter } from "../harness/live-e2e/kiro-tui.ts";
import { runLiveJourney } from "../harness/live-e2e/lifecycle.ts";
import {
currentGitSha,
LIVE_E2E_LEDGER,
liveScratchLeakCheck,
} from "../harness/live-e2e/testing/live-kernel.ts";
import { REPO_ROOT } from "../harness/fixtures.ts";

const KIRO_BIN = process.env.AMADEUS_KIRO_BIN ?? "kiro-cli";
const TMUX_BIN = process.env.AMADEUS_TMUX_BIN ?? "tmux";
const KIRO_DIST = join(REPO_ROOT, "dist", "kiro");
const SOURCE_HOME = defaultKiroSourceHome(process.env);
const SKIP_REASON = kiroTuiLiveRequirementsSkipReason({
env: process.env,
kiroBin: KIRO_BIN,
tmuxBin: TMUX_BIN,
distributionDir: KIRO_DIST,
sourceHome: SOURCE_HOME,
});

describe("Kiro TUI live E2E kernel", () => {
test.skipIf(SKIP_REASON !== null)(
`records a real kiro-tui anchor journey${SKIP_REASON ? ` [SKIP: ${SKIP_REASON}]` : ""}`,
async () => {
const result = await runLiveJourney(
new KiroTuiAdapter({
kiroBin: KIRO_BIN,
tmuxBin: TMUX_BIN,
distributionDir: KIRO_DIST,
sourceHome: SOURCE_HOME,
parentEnv: process.env,
}),
createKiroTuiJourney(),
{
env: process.env,
gitSha: currentGitSha(),
now: () => new Date(),
ledgerPath: LIVE_E2E_LEDGER,
durability: "file-and-directory",
credentialSource: new KiroHomeCredentialSource({ sourceHome: SOURCE_HOME, env: process.env }),
allocator: new KiroScratchAllocator({
prefix: "amadeus-kiro-tui-live-",
distributionDir: KIRO_DIST,
}),
leakCheck: liveScratchLeakCheck,
},
);
expect(result).toMatchObject({
ok: true,
value: {
kind: "recorded",
adapterId: "kiro-tui",
outcome: { code: "AMADEUS_LIVE_E2E:PASS:SUCCESS" },
},
});
},
240_000,
);
});
Loading
Loading