minicode-ai 0.14.2 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -178
- package/cli/args.ts +10 -18
- package/cli/commands/acp.ts +20 -27
- package/cli/commands/daemon.ts +6 -7
- package/cli/commands/exec.ts +12 -10
- package/cli/commands.ts +6 -9
- package/cli/index.ts +30 -15
- package/cli/provider-manager.ts +1 -3
- package/cli/setup.ts +167 -143
- package/cli/tui.ts +15 -23
- package/docs/CONTROL-PLANE-MAP.md +145 -0
- package/docs/OUTPUT_EVENT_MODEL.md +1 -1
- package/docs/OUTPUT_PROTOCOL_SPEC.md +2 -2
- package/docs/OUTPUT_RENDERING_SPEC.md +7 -2
- package/docs/OUTPUT_UX_RULES.md +1 -1
- package/docs/README.md +14 -102
- package/docs/SUMMARY.md +53 -0
- package/docs/TERMINAL_CONTRACT.md +84 -51
- package/docs/UI_RENDER_PIPELINE.md +204 -0
- package/docs/agents.md +5 -5
- package/docs/architecture.md +23 -12
- package/docs/choosing-mode.md +7 -7
- package/docs/cli.md +22 -29
- package/docs/concepts.md +1 -1
- package/docs/config.md +10 -5
- package/docs/contributing.md +6 -6
- package/docs/environment.md +3 -1
- package/docs/exec.md +5 -5
- package/docs/glossary.md +8 -6
- package/docs/memory-sessions.md +7 -5
- package/docs/policy-sandbox.md +16 -14
- package/docs/quickstart.md +2 -2
- package/docs/repl.md +4 -3
- package/docs/security-model.md +14 -15
- package/docs/security.md +8 -29
- package/docs/skills.md +1 -1
- package/docs/tools.md +2 -2
- package/package.json +5 -3
- package/scripts/vendor-overlays/minicode-context.patch +109 -0
- package/src/app/provider-layer.ts +13 -1
- package/src/app/session.ts +216 -13
- package/src/config.ts +30 -3
- package/src/constants.ts +2 -0
- package/src/daemon/control.ts +1 -1
- package/src/mcp/server.ts +2 -3
- package/src/policy/compaction.ts +272 -16
- package/src/policy/context-window.ts +73 -0
- package/src/policy/context.ts +55 -3
- package/src/policy/ratelimit.ts +47 -18
- package/src/policy/usage.ts +15 -8
- package/src/policy/work-mode.ts +1 -1
- package/src/providers/guards.ts +61 -4
- package/src/providers/provision.ts +12 -3
- package/src/providers/router.ts +56 -23
- package/src/session/context-projection.ts +14 -0
- package/src/session/context-selector.ts +58 -20
- package/src/session/persistence.ts +1 -1
- package/src/task/model.ts +21 -70
- package/src/tools/task.ts +7 -0
- package/src/ui/footer.ts +131 -66
- package/src/ui/i18n/en.ts +0 -11
- package/src/ui/i18n/id.ts +0 -11
- package/src/ui/input/input.ts +2 -3
- package/src/ui/input/prompt-engine.ts +2 -5
- package/src/ui/screens/model-manager.ts +3 -10
- package/src/ui/screens/picker.ts +23 -40
- package/src/ui/screens/provider-manager.ts +12 -33
- package/src/ui/screens/wizard.ts +0 -1
- package/src/ui/tui/app.ts +10 -6
- package/src/ui/tui/transcript.ts +48 -8
- package/vendor/minicore/VENDOR.md +9 -5
- package/vendor/minicore/src/core/loop.ts +47 -12
- package/vendor/minicore/src/core/provider.ts +4 -0
- package/vendor/minicore/src/core/session.ts +14 -1
- package/docs/OUTPUT_ARCHITECTURE_AUDIT.md +0 -489
- package/docs/OUTPUT_IMPLEMENTATION_PLAN.md +0 -391
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
# Output Architecture Implementation Plan
|
|
2
|
-
|
|
3
|
-
**Status:** Phase 1–8 landed; canonical presentation policy is active on all user-facing surfaces. Legacy ACP `type:"tool"` remains a compatibility window.
|
|
4
|
-
**Tanggal:** 2026-09-25
|
|
5
|
-
**Related:** `docs/OUTPUT_ARCHITECTURE_AUDIT.md`, `docs/OUTPUT_EVENT_MODEL.md`, `docs/OUTPUT_PROTOCOL_SPEC.md`, `docs/OUTPUT_RENDERING_SPEC.md`, `docs/OUTPUT_UX_RULES.md`
|
|
6
|
-
|
|
7
|
-
## 1. Keputusan
|
|
8
|
-
|
|
9
|
-
Migrasi bersifat incremental dan dapat dibalik:
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
raw runtime events
|
|
13
|
-
→ canonical semantic events
|
|
14
|
-
→ pure PresentationState
|
|
15
|
-
→ policy projection
|
|
16
|
-
→ TUI / linear / exec / ACP
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Tidak melakukan rewrite `vendor/minicore/**`, tidak mengganti terminal primitives,
|
|
20
|
-
dan tidak menghapus jalur lama sebelum parity contract serta satu rollout flag-on
|
|
21
|
-
terbukti.
|
|
22
|
-
|
|
23
|
-
## 2. Baseline saat plan dibuat
|
|
24
|
-
|
|
25
|
-
- Mouse wheel/drag app-level selection, `/copy [n]`, Esc-only abort, popup lifecycle,
|
|
26
|
-
sanitasi, width, and terminal ownership are already implemented in the working tree.
|
|
27
|
-
- Current baseline after Phase 2–8: 2587 pass, 22 skip, 0 fail; coverage 84.52% funcs /
|
|
28
|
-
85.53% lines; pack 23/23; web build/check pass.
|
|
29
|
-
- `PresentationAdapter`/reducer drive all user-facing surfaces through the
|
|
30
|
-
canonical state; raw ledger TUI and the rollback flag were removed in Phase 8.
|
|
31
|
-
- `rebuildFromDurable()` is production-wired from the durable presentation event
|
|
32
|
-
table, with child-session event persistence and interrupted-state recovery.
|
|
33
|
-
- The pack size guard is 3.5 MiB (re-baselined from 2.25 MiB with owner approval in Quality Remediation Stage 8.1, because the runtime payload itself grew past the old 2.25 MiB line — see `scripts/pack-budget.ts` for the measurement basis): six required audit artifacts add about 80 KB; the guard still rejects forbidden runtime/test content and accidental dependency inclusion.
|
|
34
|
-
- OAP-001, OAP-002, OAP-004–OAP-010, OAP-012, and OAP-013 remain carried forward;
|
|
35
|
-
Phase 2 closes the state/receipt/replay slice, not renderer migration.
|
|
36
|
-
|
|
37
|
-
## 3. Hasil Phase 1
|
|
38
|
-
|
|
39
|
-
- `user.message` sekarang durable di `DomainEvent` dan direduksi ke
|
|
40
|
-
`ConversationEntry` tanpa menggandakan turn.
|
|
41
|
-
- `toPresentationEvent()` di `cli/setup.ts` memetakan seluruh 20
|
|
42
|
-
`DomainEventType`, termasuk model/reasoning/file/test/context/progress.
|
|
43
|
-
- `PROPOSED_EVENT_TYPES` menandai `reasoning.completed`, `tool.progress`, dan
|
|
44
|
-
`test.completed` sebagai event tanpa producer; mapper tidak mengarangnya.
|
|
45
|
-
- `unsupportedProjection` diagnostics dan fixture exhaustive menjaga bridge
|
|
46
|
-
agar event baru tidak diam-diam dropped.
|
|
47
|
-
- Historical Phase 1 snapshot: 2581 pass / 22 skip / 0 fail. At that point the
|
|
48
|
-
renderer still used the raw bus and Phase 4 had not started.
|
|
49
|
-
|
|
50
|
-
## 3.1 Hasil Phase 2 core
|
|
51
|
-
|
|
52
|
-
- `PresentationState` sekarang memiliki collection conversation, reasoning, system,
|
|
53
|
-
plan, finding, result, diagnostic, serta marker eviction bounded.
|
|
54
|
-
- `deriveTurnSummary()` menghitung status tool, unique normalized paths, test
|
|
55
|
-
aggregate, checkpoint, duration dari timestamp, dan late evidence tanpa clock/IO.
|
|
56
|
-
- `file.changed`/`test.completed` yang tiba sebelum atau sesudah activity terminal
|
|
57
|
-
tetap masuk sebagai evidence; checkpoint callback sekarang memancarkan
|
|
58
|
-
`checkpoint.created` semantic event.
|
|
59
|
-
- `presentation_events` SQLite table menyimpan durable event idempotent, scrubbed,
|
|
60
|
-
dan TERMINAL/branch/TTL/delete-aware; setup memuat dan rebuild-nya sebelum
|
|
61
|
-
adapter-seq baru dibuat.
|
|
62
|
-
- Historical migration detail: before Phase 8,
|
|
63
|
-
`MINICODE_PRESENTATION_V2=0` disabled shadow projection/replay while the raw
|
|
64
|
-
content stream remained available. Child sessions also wrote their own
|
|
65
|
-
semantic event log.
|
|
66
|
-
- Regression tests: semantic collections, summary late evidence, cross-session
|
|
67
|
-
identity, bounded eviction, persistence idempotency/scrubbing, checkpoint bridge,
|
|
68
|
-
adapter provider, branch/child/delete/TTL lifecycle, dan resume rebuild.
|
|
69
|
-
- Setiap event terminal kini memakai `eventSeq` unik; basis bersama sebelumnya
|
|
70
|
-
membuat `INSERT OR IGNORE` durable melewatkan event berikutnya.
|
|
71
|
-
- Phase 2 parity landed: contract restart/child/resume/branch/delete/TTL diuji;
|
|
72
|
-
`finding.detected` terbit dari `result.findings` eksplisit pada
|
|
73
|
-
`submit_result`; `test.completed` hanya terbit dari verify output yang memiliki
|
|
74
|
-
hitungan pass/fail terstruktur.
|
|
75
|
-
|
|
76
|
-
## 3.2 Hasil Phase 3–8
|
|
77
|
-
|
|
78
|
-
- Phase 3: modul policy murni `src/presentation/projection.ts` (seleksi node per
|
|
79
|
-
mode, deskripsi activity/turn, running pin + ambang elapsed, envelope
|
|
80
|
-
`minicode.output.v1`, kategori error machine, digest divergensi) + 14 test
|
|
81
|
-
policy tabel-driven.
|
|
82
|
-
- Phase 4/5: TUI dan linear memakai keputusan policy via injeksi `cli/`
|
|
83
|
-
(`PresentationPolicy`); parity test policy-vs-legacy identik; label turn-status
|
|
84
|
-
via `activityFor`; test inventaris writer OAP-008.
|
|
85
|
-
- Phase 6: `exec --json` streaming envelope kanonik + summary berversi + setup
|
|
86
|
-
failure selalu ber-envelope; ACP lifecycle penuh + cancel terminal + persist
|
|
87
|
-
headless; sanitasi ANSI + scrub di tepi mesin.
|
|
88
|
-
- Phase 7: `persistCurrent` di jalur headless exec/ACP; resume notice tetap
|
|
89
|
-
stderr mesin-aman; ambang coverage naik ke 84/85.
|
|
90
|
-
- Phase 8: rollback flag dihapus, raw ledger TUI + `targetForFallback` dihapus
|
|
91
|
-
(3 test dimigrasi ke event presentasi); legacy `type:"tool"` ACP dipertahankan
|
|
92
|
-
satu jendela kompat; queue durable dibatasi, result generic diringkas, dan
|
|
93
|
-
buffer/render TUI dibatasi; full gate hijau.
|
|
94
|
-
|
|
95
|
-
## 4. Fase migrasi
|
|
96
|
-
|
|
97
|
-
Every phase has a rollback boundary. A phase is complete only when its tests and
|
|
98
|
-
the repository gates are green.
|
|
99
|
-
|
|
100
|
-
### Phase 0 — Baseline and contract lock
|
|
101
|
-
|
|
102
|
-
**Goal:** make the current behavior measurable before changing its source.
|
|
103
|
-
|
|
104
|
-
**Files/modules:** `test/presentation-*.test.ts`, `test/tui-*.test.ts`,
|
|
105
|
-
`test/acp.test.ts`, `test/exec-json-envelope.test.ts`, `test/pty.test.ts`,
|
|
106
|
-
`docs/TERMINAL_CONTRACT.md`.
|
|
107
|
-
|
|
108
|
-
**Dependencies:** none.
|
|
109
|
-
|
|
110
|
-
**Behavior changes:** none.
|
|
111
|
-
|
|
112
|
-
**Risks:** flaky fake TTY/ConPTY tests may hide platform-specific output drift.
|
|
113
|
-
|
|
114
|
-
**Tests/gates:** capture golden fixtures for normal/verbose/exec/ACP; run full test,
|
|
115
|
-
coverage, pack, and web check; record skip reasons explicitly.
|
|
116
|
-
|
|
117
|
-
**Migration/rollback:** documentation/test-only; revert isolated fixture commit if
|
|
118
|
-
fixture is unstable.
|
|
119
|
-
|
|
120
|
-
### Phase 1 — Canonical event boundary and exhaustive projection
|
|
121
|
-
|
|
122
|
-
**Goal:** make all semantic events explicit and stop silent bridge drops.
|
|
123
|
-
|
|
124
|
-
**Files/modules:** `src/presentation/events.ts`, `src/presentation/adapter.ts`,
|
|
125
|
-
`src/ui/contract.ts`, `cli/setup.ts`; approval hooks in
|
|
126
|
-
`src/ui/approval/prompt.ts` and policy path only as needed.
|
|
127
|
-
|
|
128
|
-
**Dependencies:** OAP-002/OAP-003 decisions; preserve raw event compatibility.
|
|
129
|
-
|
|
130
|
-
**Behavior changes:** add `user.message`, `reasoning.completed`, file/test/context/
|
|
131
|
-
diagnostic projection where a real producer exists; retain current raw event names
|
|
132
|
-
during migration. Missing producer events are marked proposed, not fabricated.
|
|
133
|
-
|
|
134
|
-
**Risks:** double-emission if adapter and existing sinks both publish terminal lines;
|
|
135
|
-
exhaustive mapper may expose existing anomalies.
|
|
136
|
-
|
|
137
|
-
**Tests/gates:** every DomainEvent has producer-or-proposed status; every event type
|
|
138
|
-
has a consumer/projection test; duplicate/late/out-of-order fixtures; no throw from
|
|
139
|
-
mapper.
|
|
140
|
-
|
|
141
|
-
**Migration/rollback:** flag and raw TUI ledger were removed in Phase 8; the
|
|
142
|
-
runtime EventBus remains only for streaming content and debug/trace transport.
|
|
143
|
-
|
|
144
|
-
### Phase 2 — Complete presentation state and truthful summaries
|
|
145
|
-
|
|
146
|
-
**Status:** landed; state/reducer is replayable and renderer authority is wired.
|
|
147
|
-
|
|
148
|
-
**Goal:** make `PresentationState` a replayable semantic model, not a partial index.
|
|
149
|
-
|
|
150
|
-
**Files/modules:** `src/presentation/model.ts`, `reducer.ts`, `store.ts`,
|
|
151
|
-
`label.ts`, `adapter.ts`, `src/tools/submit_result.ts`, journal/checkpoint
|
|
152
|
-
adapters in `cli/setup.ts`, dan child wiring di `cli/index.ts`.
|
|
153
|
-
|
|
154
|
-
**Dependencies:** Phase 1; durable store format.
|
|
155
|
-
|
|
156
|
-
**Behavior changes:** add user/conversation, reasoning, system, plan, finding, result,
|
|
157
|
-
and diagnostic collections; compute `filesChanged`, receipts, test summary, and
|
|
158
|
-
checkpoint from events/journal rather than constants.
|
|
159
|
-
|
|
160
|
-
**Risks:** increased memory and migration of `/expand`/copy semantics; payload cap must
|
|
161
|
-
remain explicit.
|
|
162
|
-
|
|
163
|
-
**Tests/gates:** replay durable == live minus deltas; state bounded; evict marker;
|
|
164
|
-
receipt counts truthful; restart test from session/journal evidence; reducer purity
|
|
165
|
-
and no clock/IO grep.
|
|
166
|
-
|
|
167
|
-
**Migration/rollback:** keep old `getPresentationSnapshot()` output as a compatibility
|
|
168
|
-
adapter until all consumers pass.
|
|
169
|
-
|
|
170
|
-
### Phase 3 — Shared projection policy
|
|
171
|
-
|
|
172
|
-
**Status:** landed (`src/presentation/projection.ts` + `test/presentation-policy.test.ts` + parity harness TUI/linear).
|
|
173
|
-
|
|
174
|
-
**Goal:** one state to normal/verbose/debug/machine projections.
|
|
175
|
-
|
|
176
|
-
**Files/modules:** new pure projection module under `src/presentation/`, label/format
|
|
177
|
-
boundaries; no import from `src/ui` into `src/presentation`.
|
|
178
|
-
|
|
179
|
-
**Dependencies:** Phase 2; i18n keys and status vocabulary.
|
|
180
|
-
|
|
181
|
-
**Behavior changes:** visual verbosity and disclosure become policy decisions; TUI
|
|
182
|
-
layout, linear wrapping, and machine JSON remain different renderers but share
|
|
183
|
-
semantic node selection.
|
|
184
|
-
|
|
185
|
-
**Risks:** normal output becoming too sparse or verbose output becoming noisy.
|
|
186
|
-
|
|
187
|
-
**Tests/gates:** table-driven node policy tests; normal/verbose/debug/machine
|
|
188
|
-
snapshots; semantic parity assertions; no renderer status parsing.
|
|
189
|
-
|
|
190
|
-
**Migration/rollback:** projection ran beside the legacy path during rollout and
|
|
191
|
-
reported divergence; Phase 8 removed the rollout seam after parity.
|
|
192
|
-
|
|
193
|
-
### Phase 4 — TUI projection (completed rollout)
|
|
194
|
-
|
|
195
|
-
**Status:** landed (policy di-inject via `cli/tui.ts`; raw TUI ledger and its rollback path were removed in Phase 8; parity tests remain as regression protection).
|
|
196
|
-
|
|
197
|
-
**Goal:** move TUI transcript/activity/selection to canonical state without breaking
|
|
198
|
-
current screen ownership.
|
|
199
|
-
|
|
200
|
-
**Files/modules:** `src/ui/tui/transcript.ts`, `src/ui/tui/app.ts`,
|
|
201
|
-
`src/ui/runtime/screen.ts` only where lifecycle wiring needs an explicit snapshot;
|
|
202
|
-
`cli/tui.ts` composition.
|
|
203
|
-
|
|
204
|
-
**Dependencies:** Phases 1–3; current selection/source-map tests; frozen terminal
|
|
205
|
-
contract.
|
|
206
|
-
|
|
207
|
-
**Behavior changes:** canonical terminal activity, summary, error, reasoning state;
|
|
208
|
-
existing transcript cap, evict marker, prompt/footer geometry, popup, wheel, drag,
|
|
209
|
-
Ctrl+C, Esc, and busy rules remain unchanged.
|
|
210
|
-
|
|
211
|
-
**Risks:** live deltas may arrive before durable model completion; selection anchors
|
|
212
|
-
can be evicted; resize may re-render different text source.
|
|
213
|
-
|
|
214
|
-
**Tests/gates:** existing TUI tests plus canonical-vs-legacy fixture; stream+resize+
|
|
215
|
-
abort+popup+selection fuzz; PTY on POSIX; transparent ConPTY skip.
|
|
216
|
-
|
|
217
|
-
**Migration/rollback:** the rollout flag was removed in Phase 8 after the parity
|
|
218
|
-
gate and release 0.12.0.
|
|
219
|
-
|
|
220
|
-
### Phase 5 — Linear/one-shot projection and writer policy
|
|
221
|
-
|
|
222
|
-
**Status:** landed (keputusan status/suffix linear dari policy; `turn-status` label via `activityFor` DI; `test/writer-inventory.test.ts` mengunci OAP-008).
|
|
223
|
-
|
|
224
|
-
**Goal:** remove semantic decisions from `simple.ts` while preserving stdout/stderr
|
|
225
|
-
behavior and copy contents.
|
|
226
|
-
|
|
227
|
-
**Files/modules:** `src/ui/assistant/simple.ts`, `turn-status.ts`,
|
|
228
|
-
`src/ui/runtime/statusline.ts`, approval/command controllers, `cli/commands.ts`.
|
|
229
|
-
|
|
230
|
-
**Dependencies:** Phase 3; stream ownership inventory; i18n/table/selection contract.
|
|
231
|
-
|
|
232
|
-
**Behavior changes:** activity, error, summary, reasoning, and table disclosure from
|
|
233
|
-
projection; writer category decides stdout/stderr/transient.
|
|
234
|
-
|
|
235
|
-
**Risks:** duplicate ledger lines, reasoning duplication, non-TTY SGR regression,
|
|
236
|
-
answer `/copy` mismatch, direct console output from builtin commands.
|
|
237
|
-
|
|
238
|
-
**Tests/gates:** normal/verbose text fixtures, `NO_COLOR`, non-TTY, split stream,
|
|
239
|
-
abort/EOF, copy equivalence, table parity, direct-writer guard.
|
|
240
|
-
|
|
241
|
-
**Migration/rollback:** the rollout flag was removed after the parity gate in
|
|
242
|
-
Phase 8; raw handlers remain only where they carry streaming content, not
|
|
243
|
-
semantic status decisions.
|
|
244
|
-
|
|
245
|
-
### Phase 6 — Exec and ACP machine projection
|
|
246
|
-
|
|
247
|
-
**Status:** landed (`exec --json` = envelope `minicode.output.v1` + summary berversi; ACP lifecycle penuh + cancel terminal + persist headless; legacy `type:"tool"` hanya bila lifecycle absen).
|
|
248
|
-
|
|
249
|
-
**Goal:** give CI/IDE consumers a stable semantic protocol.
|
|
250
|
-
|
|
251
|
-
**Files/modules:** `cli/commands/exec.ts`, `cli/commands/acp.ts`,
|
|
252
|
-
`src/ui/contract.ts`, `src/presentation/` machine mapper, `src/policy/scrub.ts` use.
|
|
253
|
-
|
|
254
|
-
**Dependencies:** Phase 1 event envelope; Phase 2 snapshots; protocol spec.
|
|
255
|
-
|
|
256
|
-
**Behavior changes:** versioned `minicode.output.v1`; canonical lifecycle in exec/ACP;
|
|
257
|
-
human semantic raw event output is debug-only while text deltas remain a transport;
|
|
258
|
-
setup failure always emits terminal machine summary; ACP cancel/shutdown guarantees
|
|
259
|
-
explicit terminal response.
|
|
260
|
-
|
|
261
|
-
**Risks:** breaking existing integrations; duplicate text/lifecycle records; scrub
|
|
262
|
-
changes alter payload shape.
|
|
263
|
-
|
|
264
|
-
**Tests/gates:** wire-level JSON/ACP fixtures, malformed input, setup failure, cancel
|
|
265
|
-
race, shutdown race, secret/control-byte scrub, no ANSI/stdout contamination, exit
|
|
266
|
-
codes 0/1/2.
|
|
267
|
-
|
|
268
|
-
**Migration/rollback:** support legacy event names for one compatibility window;
|
|
269
|
-
switch machine flag independently from TUI/linear only if contract tests allow.
|
|
270
|
-
|
|
271
|
-
### Phase 7 — Durable resume and legacy direct-writer migration
|
|
272
|
-
|
|
273
|
-
**Status:** landed (`persistCurrent` di jalur headless exec/ACP; setup-failure selalu ber-envelope; writer inventory test; resume notice tetap stderr mesin-aman).
|
|
274
|
-
|
|
275
|
-
**Goal:** make crash/restart observable through the same semantic model and centralize
|
|
276
|
-
permanent/diagnostic writer categories.
|
|
277
|
-
|
|
278
|
-
**Files/modules:** `session/persistence`, `session/journal`, `turn-marker`,
|
|
279
|
-
`checkpoint`, `cli/setup.ts`, CLI controllers, popup/form/input fallbacks.
|
|
280
|
-
|
|
281
|
-
**Dependencies:** Phase 2; chosen durable event format; no changes to kernel vendor.
|
|
282
|
-
|
|
283
|
-
**Behavior changes:** resume rebuilds state; interrupted/partial markers visible;
|
|
284
|
-
new direct writes require category/owner.
|
|
285
|
-
|
|
286
|
-
**Risks:** migration from existing session files; old sessions lack event metadata;
|
|
287
|
-
foreign stderr writer compatibility.
|
|
288
|
-
|
|
289
|
-
**Tests/gates:** crash marker + pending journal + resume; exit/signal cleanup; writer
|
|
290
|
-
inventory test; machine/non-TTY safety.
|
|
291
|
-
|
|
292
|
-
**Migration/rollback:** old session path remains fallback; disable only new writer
|
|
293
|
-
route, not persistence.
|
|
294
|
-
|
|
295
|
-
### Phase 8 — Shadow removal and cleanup
|
|
296
|
-
|
|
297
|
-
**Status:** landed — flag `MINICODE_PRESENTATION_V2` dihapus, raw ledger TUI dihapus (migrasi 3 test ke event presentasi), parity policy-vs-legacy tetap hijau; legacy `type:"tool"` ACP dipertahankan satu jendela kompat.
|
|
298
|
-
|
|
299
|
-
**Goal:** after rollout, eliminate duplicate truth and dead paths.
|
|
300
|
-
|
|
301
|
-
**Files/modules:** remove raw presentation subscriptions from user-facing surfaces,
|
|
302
|
-
retire legacy label/collapse/diagnostic classification only after usage inventory.
|
|
303
|
-
|
|
304
|
-
**Dependencies:** one release or equivalent validated rollout; all gates green.
|
|
305
|
-
|
|
306
|
-
**Behavior changes:** output remains same as canonical projection; direct diagnostic
|
|
307
|
-
fallback only for explicitly external writers.
|
|
308
|
-
|
|
309
|
-
**Risks:** hidden consumers or scripts relying on legacy raw output.
|
|
310
|
-
|
|
311
|
-
**Tests/gates:** full suite, PTY, protocol compatibility fixtures, `git diff --check`,
|
|
312
|
-
architecture/UI boundary tests, pack/web checks.
|
|
313
|
-
|
|
314
|
-
**Migration/rollback:** revert the isolated removal commit; do not combine cleanup with
|
|
315
|
-
semantic changes.
|
|
316
|
-
|
|
317
|
-
## 5. Finding-to-phase map
|
|
318
|
-
|
|
319
|
-
| Finding | Primary phase | Secondary gate |
|
|
320
|
-
|---|---:|---|
|
|
321
|
-
| OAP-001 dual truth | 1–4 | parity fixtures |
|
|
322
|
-
| OAP-002 lifecycle loss | 1 | adapter failure/cancel tests |
|
|
323
|
-
| OAP-003 partial bridge | 1 | exhaustive projection test |
|
|
324
|
-
| OAP-004 incomplete model | 2 | replay/model tests |
|
|
325
|
-
| OAP-005 summary/receipt | 2 | journal/checkpoint test |
|
|
326
|
-
| OAP-006 machine protocol | 6 | wire contract |
|
|
327
|
-
| OAP-007 durable rebuild | 7 | resume/crash test |
|
|
328
|
-
| OAP-008 direct writers | 5/7 | writer inventory |
|
|
329
|
-
| OAP-009 visibility | 3 | mode fixtures |
|
|
330
|
-
| OAP-010 classification | 1/3 | canonical outcome tests |
|
|
331
|
-
| OAP-011 unused vocabulary | 1 | producer inventory |
|
|
332
|
-
| OAP-012 user/plan/finding | 2/3 | semantic node tests |
|
|
333
|
-
| OAP-013 docs drift | 0/10 | docs link/protection test |
|
|
334
|
-
|
|
335
|
-
## 6. Validation scenarios
|
|
336
|
-
|
|
337
|
-
| # | Scenario | Required verification |
|
|
338
|
-
|---:|---|---|
|
|
339
|
-
| 1 | Simple coding task | one final message, no duplicate completion, machine summary |
|
|
340
|
-
| 2 | Multi-file edit | receipt paths, truthful file count, chronological order |
|
|
341
|
-
| 3 | Tool success | tool completed + duration + expand ref |
|
|
342
|
-
| 4 | Tool failure | failed cause/hint, no generic success |
|
|
343
|
-
| 5 | Permission denial | denied category/reason, headless explicit |
|
|
344
|
-
| 6 | Cancellation | task/tool cancelled, stream flushed/discarded once |
|
|
345
|
-
| 7 | Retry | new call + deterministic supersedes relation |
|
|
346
|
-
| 8 | Long-running task | active state, elapsed, no fake spam |
|
|
347
|
-
| 9 | Parallel analysis | grouped/aggregated, independent IDs |
|
|
348
|
-
| 10 | Large tool output | cap marker, content ref, expand behavior |
|
|
349
|
-
| 11 | Narrow terminal | 20/30/80 columns, no overflow, cursor safe |
|
|
350
|
-
| 12 | Resize | 120→30→80, transcript/source mapping stable |
|
|
351
|
-
| 13 | Ctrl+C | TUI copy-or-noop, Esc cancellation, raw cleanup |
|
|
352
|
-
| 14 | No-color/limited ANSI | status words, ASCII fallback, no meaning loss |
|
|
353
|
-
| 15 | Verbose | useful detail without internal dump |
|
|
354
|
-
| 16 | Debug | scrubbed IDs/payloads and anomaly counters |
|
|
355
|
-
| 17 | Machine-readable | versioned NDJSON/ACP, no human stream contamination |
|
|
356
|
-
|
|
357
|
-
For every scenario verify semantic correctness, hierarchy, scrollback, error clarity,
|
|
358
|
-
noise, copyability, and mode consistency.
|
|
359
|
-
|
|
360
|
-
## 7. Rollout and rollback
|
|
361
|
-
|
|
362
|
-
- The rollout is complete: policy is injected at the composition root, raw TUI
|
|
363
|
-
semantic ledger and the feature flag are removed, and streaming content remains
|
|
364
|
-
a transport concern.
|
|
365
|
-
- Before any future semantic cleanup, run the parity and writer-inventory gates;
|
|
366
|
-
do not reintroduce a second status authority.
|
|
367
|
-
- If a protocol field is consumed, preserve compatibility aliases for one window.
|
|
368
|
-
- Update `docs/TERMINAL_CONTRACT.md` only when observable terminal behavior changes;
|
|
369
|
-
update its test map in the same change.
|
|
370
|
-
- Update `docs/ARCHITECTURE.html` when structure/dependencies change.
|
|
371
|
-
|
|
372
|
-
## 8. Completion criteria
|
|
373
|
-
|
|
374
|
-
The architecture is complete only when:
|
|
375
|
-
|
|
376
|
-
- semantic events are independent from rendering;
|
|
377
|
-
- runtime state is not accidentally exposed as normal UI;
|
|
378
|
-
- normal/verbose/debug/machine projections use one model;
|
|
379
|
-
- findings, plans, activities, errors, and results are distinct;
|
|
380
|
-
- permission, cancellation, timeout, partial, and interrupted states are explicit;
|
|
381
|
-
- parallel work is aggregated;
|
|
382
|
-
- TUI scrollback, copy/paste, Windows, no-color, and resize contracts remain intact;
|
|
383
|
-
- machine output is structured and versioned;
|
|
384
|
-
- durable resume can rebuild semantic state;
|
|
385
|
-
- legacy direct-print paths are inventoried and removed only after parity;
|
|
386
|
-
- all mandatory repository gates pass.
|
|
387
|
-
|
|
388
|
-
## 9. Current next action
|
|
389
|
-
|
|
390
|
-
Phase 1–8 landed. The current follow-up is limited to documentation drift and
|
|
391
|
-
post-change validation; keep future cleanup isolated from semantic changes.
|