Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b86060a
fix(release): scope partial evidence to selected checks
drewstone Aug 15, 2026
351b6ab
fix(runtime): recover retained interaction responses
drewstone Aug 15, 2026
acdb6ef
fix(runtime): adopt corrected retained interaction bindings
drewstone Aug 15, 2026
48ee470
fix(interactions): bind replies to admitted runs
drewstone Aug 15, 2026
862ff07
feat(interactions): preserve per-turn interaction posture
drewstone Aug 15, 2026
c1e23e3
feat(tui): bridge native terminal sessions
drewstone Aug 16, 2026
f0a99b7
feat(tui): restore transcript-first footer density
drewstone Aug 16, 2026
f2b2a99
test(tui): align focused secondary surfaces
drewstone Aug 16, 2026
24e782a
fix(tui): restore separated composer metadata
drewstone Aug 16, 2026
505b119
test(tui): follow separated composer hints
drewstone Aug 16, 2026
a0af889
fix(tui): harden redaction and terminal cleanup
drewstone Aug 16, 2026
d8fb4c8
fix(tui): separate deterministic visual proof from live demo
drewstone Aug 16, 2026
5b8e569
feat(tui): suspend safely for native sessions
drewstone Aug 16, 2026
d63014d
fix(tui): preserve responsive composer and runtime context
drewstone Aug 16, 2026
23aa14f
chore(deps): migrate agent package cohort
drewstone Aug 16, 2026
e479ab4
chore(braid): migrate agent runtime dependency cohort
drewstone Aug 16, 2026
89bf378
feat(tui): open durable native interactive sessions
drewstone Aug 16, 2026
e3ed3d1
feat(runtime): add retained interactive execution adapters
drewstone Aug 16, 2026
d666640
feat(runtime): unify durable retained interactions
drewstone Aug 19, 2026
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
@@ -0,0 +1,8 @@
{"id":1,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/retained-execution-state.ts","line":15,"defect":"The retained execution key did not always include the canonical requested interaction map.","scenario":"The same run and operation are prepared with a changed plan, question, or approval set, then the process-local key reuses state for a different interaction contract.","status":"measured before patch · resolved","evidence":"src/adapters/runtime/retained-execution-state.ts:15-32; src/domain/run-interactions.ts; test/tangle-retained-lifecycle.test.ts:377-402","fix":"Derive the canonical interaction map from the retained plan capabilities when the request does not carry it.","verification":"Focused retained and interactive suites → 42/42 pass.","costIfShipped":"1 incompatible preparation can reuse the wrong interaction contract.","savedIfFixed":"1 of 1 interaction-key regression cases now rejects the mismatch.","claimLevel":"measured"}
{"id":2,"priority":"P1","severity":"HIGH","file":"src/app/production-composition.ts","line":192,"defect":"Production retained recovery did not preserve the persisted receipt, admission, session, and workspace identity across process restart.","scenario":"A process restarts after retained admission, then recovery reconstructs a weaker request and cannot attach to the exact admitted provider run.","status":"measured before patch · resolved","evidence":"src/app/production-composition.ts:192-246; src/adapters/runtime/tangle-retained-execution.ts:20-35; test/tangle-retained-restart.test.ts:62-225","fix":"Build recovery input from persisted receipt and admission data, and pass it through both retained provider adapters.","verification":"Focused retained and interactive suites → 42/42 pass; typecheck passes.","costIfShipped":"1 restart can lose exact retained-run attachment and replay.","savedIfFixed":"1 of 1 restart recovery cases now retains the saved identity.","claimLevel":"measured"}
{"id":3,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/production-backend-common.ts","line":105,"defect":"Provider execution identity used normalization and truncation that could collide for distinct opaque environment or session IDs.","scenario":"Two provider IDs share the retained readable prefix, then lookup or cleanup addresses the wrong environment.","status":"measured before patch · resolved","evidence":"src/adapters/runtime/production-backend-common.ts:105-121; src/adapters/connections/tangle-retained-control-lookup.ts:22-35; test/interactive-execution-adapters.test.ts:490-496; test/tangle-retained-lifecycle.test.ts:239-306","fix":"Preserve safe IDs and append a bounded digest for unsafe or long IDs through one shared identity helper.","verification":"Focused retained and interactive suites → 42/42 pass.","costIfShipped":"1 colliding provider identity can redirect control or cleanup.","savedIfFixed":"2 of 2 collision and length regression checks now pass.","claimLevel":"measured"}
{"id":4,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/tangle-retained-interactive-execution.ts","line":106,"defect":"Interactive cancellation and control races could forward an expired foreground signal or materialize work after a persisted cancellation.","scenario":"Cancellation overlaps start, restart recovery, or provider stop, then the adapter either aborts its own control call or creates provider work after the user requested cancellation.","status":"measured before patch · resolved","evidence":"src/adapters/runtime/tangle-retained-interactive-execution.ts:106-119,250-376,400-412; src/adapters/runtime/retained-execution.ts:203-300; test/interactive-execution-adapters.test.ts:327-471; test/retained-execution-lifecycle.test.ts:286-331","fix":"Coalesce one start promise, recheck cancellation before materialization, and strip an already-aborted foreground signal before native claim or stop.","verification":"Focused retained and interactive suites → 42/42 pass, including no-provider-after-cancel and stop-signal checks.","costIfShipped":"1 provider process or failed control call per affected cancellation race.","savedIfFixed":"4 of 4 cancellation and signal regression cases now pass.","claimLevel":"measured"}
{"id":5,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/retained-execution.ts","line":114,"defect":"Restarted retained controls did not consistently validate supplied provider session and control references against the persisted admission.","scenario":"A caller supplies a stale or foreign reference after restart, then detach, status, reconnect, or recovery can target a different process or materialize pre-dispatch work.","status":"measured before patch · resolved","evidence":"src/adapters/runtime/retained-execution.ts:114-191,406-435,565-602; src/adapters/runtime/tangle-retained-interactive-contract.ts:145-178; test/retained-execution-lifecycle.test.ts:209-272; test/interactive-execution-adapters.test.ts:190-229","fix":"Validate persisted session and exact control identity before recovery, while preserving the explicit rejected acknowledgement for persisted intent cancellation.","verification":"Focused retained and interactive suites → 42/42 pass.","costIfShipped":"1 stale control request can act on the wrong retained identity.","savedIfFixed":"3 of 3 session, control-reference, and pre-dispatch admission checks now pass.","claimLevel":"measured"}
{"id":6,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/tangle-retained-interactive-execution.ts","line":240,"defect":"Detaching a persisted partial native admission recovered and materialized a provider process.","scenario":"A process restarts after intent or environment admission but before provider start, then detach creates native work that the user asked to leave detached.","status":"measured before patch · resolved","evidence":"src/adapters/runtime/tangle-retained-interactive-execution.ts:240-274; test/interactive-execution-adapters.test.ts:379-423","fix":"Mark partial persisted admissions detached without materializing a native handle.","verification":"Focused retained and interactive suites → 42/42 pass, including the no-materialization regression.","costIfShipped":"1 unintended provider process per detached partial admission.","savedIfFixed":"1 of 1 detached-partial regression cases now avoids provider start.","claimLevel":"measured"}
{"id":7,"priority":"P1","severity":"HIGH","file":"src/adapters/runtime/tangle-retained-interactive-contract.ts","line":42,"defect":"The installed Runtime native interactive handle has no structured interaction response method, so Braid cannot safely advertise plan, question, or approval responses on that path.","scenario":"A native Tangle run exposes structured interaction actions, but the canonical response route has no provider operation and would require a second protocol or duplicate execution.","status":"measured · unresolved dependency boundary","evidence":"src/adapters/runtime/tangle-retained-interactive-contract.ts:42-53; installed @tangle-network/agent-runtime AgentInteractiveSession surface; pnpm run test:coordination → 66/67 with 1 failure; pnpm run test:contract → 195/196 with the same failure","fix":"Fail closed by removing unsupported structured interactions from native capabilities until the Runtime package adds the canonical response operation.","verification":"The local fail-closed behavior passes focused suites; the two broader suites retain the same dependency-only failure: provider cli-bridge rejects permission, question, and plan interactions.","costIfShipped":"1 native structured response request cannot complete on the current released dependency.","savedIfFixed":"1 unsupported action path is hidden instead of creating a duplicate or false control route.","claimLevel":"measured"}
{"id":8,"priority":"P2","severity":"MEDIUM","file":"src/adapters/runtime/tangle-retained-interactive-projection.ts","line":42,"defect":"Native PTY bytes are not part of Braid's durable logical event journal, so exact byte-transcript replay is not available after restart.","scenario":"A user detaches and later attaches a native session, then Braid replays synthetic observation and final envelopes but cannot replay every terminal byte from the prior attachment.","status":"measured · unresolved design boundary","evidence":"src/adapters/runtime/tangle-retained-interactive-projection.ts:42-154; src/ports/native-interactive-execution.ts:8-15; pnpm run test:virtual-terminal → 147/147 pass for the supported synthetic replay boundary","fix":"No safe local fix exists without adding a second terminal transport or changing the Runtime provider contract; retain the single native attachment path.","verification":"Virtual-terminal suite passes 147/147 and proves synthetic replay, not byte-for-byte PTY history.","costIfShipped":"1 native session lacks exact byte history after a process restart.","savedIfFixed":"No local savings claimed; a provider-level transcript contract is required.","claimLevel":"measured boundary"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"schemaVersion": 1,
"scope": "Braid current uncommitted durable-interaction and TUI architecture",
"files": 70,
"base": "e3ed3d16f178839560ae4809c8c4df2914bab32e",
"head": "e3ed3d16f178839560ae4809c8c4df2914bab32e",
"workingTree": true,
"diffSha256": "b7eb2ad86f91f334caa6e5d916d36198f3683ed351ae4ff4884c99caeba24d74",
"projectType": "Node.js ESM package",
"reviewers": [
"primary: retained lifecycle, identity, cancellation, replay, and TUI boundaries",
"independent pass attempted; no usable report returned"
],
"mode": "current working-tree adversarial review with focused local checks",
"verdict": "REQUEST_CHANGES",
"counts": {
"critical": 0,
"high": 7,
"medium": 1,
"low": 0,
"resolved": 6,
"unresolved": 2,
"dropped": 0
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Audit: Braid durable interaction and TUI architecture — e3ed3d1..e3ed3d1 — n=70 files, 8 findings

**Verdict:** REQUEST_CHANGES — one P1 dependency boundary remains · 0 CRITICAL / 1 HIGH open / 6 HIGH fixed / 1 MEDIUM open
**Worst:** #7 `src/adapters/runtime/tangle-retained-interactive-contract.ts:42` — the released Runtime cannot answer structured native interactions.
**Next:** release the canonical native response operation, then rerun coordination and contract suites.

## Scope

| Field | Value |
|---|---|
| Files | n=70 source paths reviewed: 63 tracked changes plus 7 untracked paths; 3 audit files are excluded |
| Base..head | `e3ed3d16f178839560ae4809c8c4df2914bab32e..e3ed3d16f178839560ae4809c8c4df2914bab32e` |
| Project type | Node.js ESM package |
| Review focus | durable identity, restart recovery, interaction normalization, cancellation, control races, routing, ownership, TUI behavior |
| Not inspected | Provider changes not present in this worktree; package manifests were intentionally not edited. |

## Findings — 8 total, ranked

| # | Priority | file:line | Defect | Failure scenario | Status | Evidence | Fix | Verification | Cost if shipped | Saved if fixed |
|---:|---|---|---|---|---|---|---|---|---|---|
| 1 | P1 | `src/adapters/runtime/retained-execution-state.ts:15` | Retained key omitted the canonical interaction map. | Changed plan interactions reused incompatible prepared state. | fixed | key regression test | Derive the map from plan capabilities. | focused 42/42 | 1 incompatible preparation can reuse wrong state | 1/1 regression cases pass |
| 2 | P1 | `src/app/production-composition.ts:192` | Restart recovery dropped persisted identity data. | Recovery could not attach to the exact admitted provider run. | fixed | restart test | Preserve receipt, admission, session, and workspace. | focused 42/42 | 1 restart can lose exact attachment | 1/1 restart case passes |
| 3 | P1 | `src/adapters/runtime/production-backend-common.ts:105` | Opaque provider IDs could collide after normalization. | Lookup or cleanup could address the wrong environment. | fixed | identity and long-session tests | Use bounded readable IDs with a digest. | focused 42/42 | 1 collision can redirect control | 2/2 identity checks pass |
| 4 | P1 | `src/adapters/runtime/tangle-retained-interactive-execution.ts:106` | Cancellation races used stale signals or materialized late work. | Stop overlapped start or restart recovery could fail or create work after cancel. | fixed | cancellation and stop-signal tests | Coalesce start, recheck cancel, and strip expired signals. | focused 42/42 | 1 process or failed call per race | 4/4 regression cases pass |
| 5 | P1 | `src/adapters/runtime/retained-execution.ts:114` | Restarted controls did not fully validate saved identity. | A stale reference could target another retained process. | fixed | control identity tests | Validate session and exact persisted references. | focused 42/42 | 1 stale request can target wrong identity | 3/3 checks pass |
| 6 | P1 | `src/adapters/runtime/tangle-retained-interactive-execution.ts:240` | Partial native detach materialized provider work. | Detaching an intent after restart could start a process. | fixed | no-materialization test | Detach partial admission without recovery. | focused 42/42 | 1 unintended process per case | 1/1 case passes |
| 7 | P1 | `src/adapters/runtime/tangle-retained-interactive-contract.ts:42` | Native structured responses are unsupported by the released Runtime. | Plan, question, or approval response has no canonical provider operation. | open dependency | coordination 66/67 and contract 195/196 share one installed-Runtime failure | Hide unsupported actions until the Runtime release adds the operation. | local fail-closed tests pass | 1 native structured response cannot complete | 1 false action path hidden |
| 8 | P2 | `src/adapters/runtime/tangle-retained-interactive-projection.ts:42` | Native PTY bytes are outside the durable logical journal. | Restart replay returns synthetic envelopes, not every prior terminal byte. | open design | projection source and virtual-terminal 147/147 | Requires a provider-level transcript contract; no duplicate local terminal protocol. | supported synthetic boundary passes | 1 byte transcript is unavailable after restart | none claimed locally |

No P0 defect was confirmed.
No TUI mode-specific execution path or duplicate provider execution was confirmed.

## Proof

- `pnpm run typecheck` passed.
- Biome checked 54 changed TypeScript files and passed.
- Focused retained, interactive, identity, restart, and cancellation tests passed 42/42.
- `pnpm run test:virtual-terminal` passed 147/147.
- `pnpm run boundaries` passed with zero cyclic strongly connected components.
- `pnpm run dependencies:check` passed with no high or critical vulnerability finding.
- `git diff --check` passed.
- No `package.json` or `pnpm-lock.yaml` path changed.
- No commit or push was performed.

The coordination and contract suites each retain one dependency-only failure.
The installed Runtime rejects the fixture interaction map `permission, question, plan` for provider `cli-bridge`.

## Self-gate

9/9 passed — verdict has a number; every finding has file and line; every finding has a scenario; every finding has status; every finding has evidence; every finding has a fix or explicit dependency boundary; every finding has verification; every finding has cost on both sides; no P0 claim lacks a check.
31 changes: 31 additions & 0 deletions .agent/pursuits/2026-08-19-orchestrate-braid-launch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Braid launch workflow

## Goal

Ship one durable interaction path across CLI Bridge and Tangle Sandbox.

## Structure

Three source-package tracks run in parallel.
Package publication is the only barrier because Braid must consume released artifacts.

1. Agent SDK: finish CLI Bridge discovery, replay, request forwarding, and process-restart proof.
2. Agent Runtime: merge exact retained event identity and publish it.
3. Sandbox: finish exact process control, browser attachment, and restart proof.
4. Braid: adopt the releases, remove temporary paths, and run both real recovery flows.
5. Release: capture the terminal flow, merge, publish, and verify a clean install.

## Coordination

- Four existing workers cover disjoint Agent SDK, Runtime, and Sandbox files.
- The operator owns integration, commits, package publication, and production claims.
- Each source-package change receives an independent adversarial review.
- A worker failure does not stop the other package tracks.

## Acceptance

- Pi survives Bridge process restart and resumes from a nonzero event cursor without duplicates.
- A Tangle cloud process survives client restart and rejects stale process identities.
- Questions, permissions, plans, and worker activity use canonical typed events.
- Braid contains no provider output parser or duplicate execution path.
- A clean published install reproduces both real flows and the recorded terminal UX.
7 changes: 7 additions & 0 deletions .agent/skill-runs.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@
{"skill":"/reconcile","ts":"2026-08-13T21:45:28Z","project":"braid-goal-latest-wt","target":"cordiverse/cordis as a Braid foundation","operatorPrompt":"","durationMin":null,"verdict":"REJECT","dispatchedTo":"/stop","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/autopsy","ts":"2026-08-13T21:58:28Z","project":"braid-goal-latest-wt","target":"Sandbox isolated package smoke skipped prepack","operatorPrompt":"","durationMin":null,"verdict":"FIXED_INFRA_BUG","dispatchedTo":"/verify","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/deep-clean","ts":"2026-08-15T03:11:57Z","project":"braid-goal-latest-wt","target":"Braid release branch: removed stale generated artifacts and speculative release machinery","operatorPrompt":"","durationMin":null,"verdict":"GREEN","dispatchedTo":"/converge","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/product-design-audit","ts":"2026-08-19T06:09:04Z","project":"braid-exact-interactive-20260816","target":"Braid bounded TUI route metadata, profile framing, activity header, and focused verification","operatorPrompt":"","durationMin":null,"verdict":"PASS","dispatchedTo":"/stop","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/product-design","ts":"2026-08-19T06:09:04Z","project":"braid-exact-interactive-20260816","target":"Braid bounded TUI route metadata, profile framing, and responsive proof","operatorPrompt":"","durationMin":null,"verdict":"PASS","dispatchedTo":"/product-design-audit","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/report","ts":"2026-08-19T07:02:22Z","project":"braid-exact-interactive-20260816","target":"Braid dependency on Sandbox UI","operatorPrompt":"","durationMin":null,"verdict":"PASS","dispatchedTo":"/stop","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/diagnose","ts":"2026-08-19T08:55:46Z","project":"braid-exact-interactive-20260816","target":"Braid contract/headless/PTY baseline and retained interactive failures","operatorPrompt":"","durationMin":null,"verdict":"Braid-owned failures fixed; three pinned dependency failures remain","dispatchedTo":"/verify","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/verify","ts":"2026-08-19T08:55:46Z","project":"braid-exact-interactive-20260816","target":"Braid retained/headless/native PTY verification","operatorPrompt":"","durationMin":null,"verdict":"HOLD: 761/766 full tests pass; 3 external failures remain","dispatchedTo":"upgrade the owning dependencies, then rerun contract and production native routing","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/verify","ts":"2026-08-19T08:59:19Z","project":"braid-exact-interactive-20260816","target":"Braid retained/headless/native PTY verification (final)","operatorPrompt":"","durationMin":null,"verdict":"HOLD: 762/766 full tests pass; 2 pinned dependency failures remain","dispatchedTo":"upgrade the owning dependencies, then rerun contract and production native routing","operatorOverride":null,"transcriptPath":null,"traceDir":null}
{"skill":"/critical-audit","ts":"2026-08-19T11:05:46Z","project":"braid-exact-interactive-20260816","target":"Braid durable interaction and TUI architecture n=70 files","operatorPrompt":"","durationMin":null,"verdict":"REQUEST_CHANGES","dispatchedTo":"/stop","operatorOverride":null,"transcriptPath":null,"traceDir":null}
Loading
Loading