minicode-ai 0.14.1 → 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/auto-update.ts +32 -2
- 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 +40 -17
- package/cli/provider-manager.ts +1 -3
- package/cli/setup.ts +174 -145
- package/cli/tui.ts +33 -38
- package/docs/CONTROL-PLANE-MAP.md +145 -0
- package/docs/OUTPUT_EVENT_MODEL.md +1 -1
- package/docs/OUTPUT_PROTOCOL_SPEC.md +8 -2
- package/docs/OUTPUT_RENDERING_SPEC.md +35 -6
- 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 +136 -77
- 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/getting-started.md +14 -12
- package/docs/glossary.md +9 -7
- package/docs/mcp-lsp.md +1 -1
- package/docs/memory-sessions.md +7 -5
- package/docs/policy-sandbox.md +23 -15
- package/docs/quickstart.md +2 -2
- package/docs/repl.md +4 -3
- package/docs/security-model.md +16 -17
- package/docs/security.md +15 -30
- package/docs/skills.md +1 -1
- package/docs/tools.md +6 -6
- package/docs/verify-benchmark.md +16 -0
- package/package.json +5 -5
- package/scripts/vendor-overlays/minicode-context.patch +109 -0
- package/src/app/mentions.ts +4 -3
- package/src/app/provider-layer.ts +13 -1
- package/src/app/session.ts +229 -22
- package/src/app/tool-layer.ts +6 -0
- package/src/config.ts +30 -3
- package/src/constants.ts +19 -0
- package/src/daemon/control.ts +1 -1
- package/src/lib/git-hardening.ts +27 -22
- package/src/lib/safe-open.ts +73 -19
- package/src/lib/trusted-exec.ts +7 -4
- package/src/mcp/client.ts +34 -9
- package/src/mcp/server.ts +2 -3
- package/src/mcp/transport.ts +96 -42
- package/src/memory/files.ts +15 -4
- package/src/memory/vector.ts +5 -1
- package/src/policy/compaction.ts +272 -16
- package/src/policy/context-window.ts +73 -0
- package/src/policy/context.ts +76 -16
- package/src/policy/ratelimit.ts +47 -18
- package/src/policy/tool-contract.ts +4 -10
- package/src/policy/update-check.ts +83 -6
- package/src/policy/usage.ts +31 -14
- package/src/policy/work-mode.ts +1 -1
- package/src/presentation/adapter.ts +64 -2
- package/src/presentation/events.ts +6 -0
- package/src/presentation/model.ts +1 -0
- package/src/presentation/projection.ts +2 -0
- package/src/presentation/reducer.ts +1 -0
- package/src/providers/anthropic.ts +52 -19
- package/src/providers/guards.ts +158 -16
- package/src/providers/provision.ts +12 -3
- package/src/providers/responses.ts +61 -23
- package/src/providers/router.ts +56 -23
- package/src/providers/sse-bounds.ts +170 -0
- package/src/repo/repomap.ts +10 -11
- package/src/runtime/execution-backend.ts +7 -8
- package/src/sandbox/docker.ts +113 -9
- package/src/session/checkpoint.ts +9 -2
- package/src/session/context-projection.ts +14 -0
- package/src/session/context-selector.ts +58 -20
- package/src/session/persistence.ts +6 -3
- package/src/session/verification.ts +55 -16
- package/src/skills/loader.ts +16 -3
- package/src/task/model.ts +21 -70
- package/src/tools/bash.ts +6 -3
- package/src/tools/code_run.ts +6 -5
- package/src/tools/context.ts +8 -0
- package/src/tools/delete_file.ts +2 -1
- package/src/tools/edit.ts +2 -1
- package/src/tools/git.ts +128 -54
- package/src/tools/glob.ts +2 -1
- package/src/tools/grep.ts +31 -6
- package/src/tools/lsp.ts +5 -4
- package/src/tools/mcp_call.ts +3 -1
- package/src/tools/memory.ts +175 -180
- package/src/tools/move_file.ts +2 -1
- package/src/tools/patch.ts +2 -1
- package/src/tools/read_file.ts +94 -1
- package/src/tools/read_image.ts +2 -1
- package/src/tools/task.ts +9 -1
- package/src/tools/todo.ts +4 -5
- package/src/tools/web_fetch.ts +28 -12
- package/src/tools/web_search.ts +28 -9
- package/src/tools/write_file.ts +2 -1
- package/src/ui/assistant/simple.ts +72 -3
- package/src/ui/footer.ts +131 -66
- package/src/ui/i18n/en.ts +3 -11
- package/src/ui/i18n/id.ts +3 -11
- package/src/ui/input/input.ts +2 -3
- package/src/ui/input/prompt-engine.ts +2 -5
- package/src/ui/render/width.ts +107 -79
- package/src/ui/runtime/screen.ts +49 -37
- 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 +265 -211
- package/src/ui/tui/transcript.ts +87 -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/CHANGELOG.md +0 -1185
- package/docs/OUTPUT_ARCHITECTURE_AUDIT.md +0 -489
- package/docs/OUTPUT_IMPLEMENTATION_PLAN.md +0 -391
- package/docs/PLAN_UIUX_V6.md +0 -209
- package/docs/changelog.md +0 -3
|
@@ -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.
|
package/docs/PLAN_UIUX_V6.md
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
# PLAN PENYEMPURNAAN UI/UX — Minicode 0.7.0 → 0.8.0
|
|
2
|
-
|
|
3
|
-
**Status:** ✅ selesai (V6), dilanjutkan uji live multi-provider (V7). Ringkasan hasil di [CHANGELOG.md](../CHANGELOG.md).
|
|
4
|
-
|
|
5
|
-
| Metrik | Target | Hasil V6 | Hasil V7 (uji live) |
|
|
6
|
-
|---|---|---|---|
|
|
7
|
-
| REPL menerima prompt | ya | ✅ | ✅ diverifikasi dengan 2 gateway nyata |
|
|
8
|
-
| Test | seluruhnya hijau | 859 pass | **913 pass, 0 fail** |
|
|
9
|
-
| Coverage agregat | ≥65% cli/ | 79,33% / 82,15% | **80,52% funcs / 83,10% lines** |
|
|
10
|
-
| Berkas UI di 0% coverage | ≤6 | ✅ 6 | ✅ 6 |
|
|
11
|
-
| Gate coverage | naik dari 69/74 | min 77/80 | min 77/80 (aktual 80,5/83,1) |
|
|
12
|
-
| Resolve-rate terukur | — | belum diukur | **1,00** (5/5 tugas berpemeriksa objektif) |
|
|
13
|
-
|
|
14
|
-
**Empat bug tambahan yang hanya muncul dengan provider sungguhan** (V7, detail di CHANGELOG):
|
|
15
|
-
`/cost` + `--budget` selalu nol setelah turn pertama; `cli/errors.ts` punya test tapi tak dipanggil sehingga body JSON provider tumpah ke layar; model `:free` dihargai seperti varian berbayar; `exec` mengirim nilai flag sebagai bagian prompt.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
**Basis:** audit UI/UX menyeluruh — 24 temuan, diverifikasi dengan menjalankan tiap subcommand CLI, mengemudikan TUI lewat harness keystroke sintetis, dan memanggil `handleBuiltinCommand` langsung. Kondisi awal: `bun test` 637 pass / 1 fail (false positive), `tsc --noEmit` bersih, **REPL tidak bisa dipakai sama sekali**.
|
|
20
|
-
|
|
21
|
-
## Prinsip yang mengatur urutan
|
|
22
|
-
|
|
23
|
-
1. **Test dulu untuk area yang rusak, bukan sesudah.** Bug blocker (#1) lolos karena lapisan interaktif punya nol test. Menambal tanpa harness berarti bug berikutnya juga akan lolos. Fase 0 mendahului semua perbaikan.
|
|
24
|
-
2. **Satu perubahan struktural mengalahkan lima tambalan.** Kursor (#6, #11), tema (#3), warna transcript (#4) masing-masing punya satu akar. Perbaiki akarnya.
|
|
25
|
-
3. **Jangan tambah permukaan baru sebelum yang ada bekerja.** Tidak ada fitur baru di rencana ini. `--ui`/`--tui` yang menganggur (#23) dihapus, bukan diimplementasikan.
|
|
26
|
-
4. **Ukur klaim.** Setiap fase punya perintah verifikasi yang menghasilkan bukti, bukan "terlihat benar".
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Fase 0 — Harness test TUI (prasyarat, ~0,5 hari)
|
|
31
|
-
|
|
32
|
-
Tanpa ini fase 1–5 tidak bisa diverifikasi selain secara manual.
|
|
33
|
-
|
|
34
|
-
| Item | Berkas | DoD |
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| Harness fake TTY: stdin injektabel + stdout tertangkap sebagai frame | `test/helpers/tui-harness.ts` (baru) | `send("/s")` → frame terakhir bisa di-assert; `columns`/`rows` bisa diatur per test |
|
|
37
|
-
| Test `attachFullscreenMinimal` | `test/tui-fullscreen.test.ts` (baru) | 15 skenario: dropdown, filter, panah, Tab, submit, overlay, picker, streaming, tool+diff, history, perintah tak dikenal, Shift+Tab, Ctrl+O, baris panjang, Ctrl+C ×2 |
|
|
38
|
-
| Test `askLine` + `runPicker` + `runPanel` + `runProviderManager` | `test/tui-classic.test.ts` (baru) | render awal, dropdown, seleksi, submit, filter kosong, Esc dua tingkat, fallback non-TTY |
|
|
39
|
-
| Assertion anti-regresi rekursi | `test/tui-fullscreen.test.ts` | `submit` memicu `onLine` **tepat 1×**; `unhandledRejection` tetap kosong sepanjang test |
|
|
40
|
-
|
|
41
|
-
Harness sudah terbukti bekerja saat audit — pola: `Object.defineProperty(process, "stdin", …)` dengan stub `setRawMode`/`on("data")`, `process.stdout.write` diganti kolektor, frame diambil dari chunk yang memuat `\x1b[H\x1b[2J`.
|
|
42
|
-
|
|
43
|
-
**Verifikasi:** `bun test test/tui-*.test.ts` hijau; test rekursi **gagal** pada `HEAD` saat ini (membuktikan ia menangkap #1).
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Fase 1 — Blocker (~0,5 hari)
|
|
48
|
-
|
|
49
|
-
| # | Masalah | Berkas | Perbaikan |
|
|
50
|
-
|---|---|---|---|
|
|
51
|
-
| 1 | Rekursi tak berbatas spinner → REPL mati bisu pada prompt pertama | `src/tui/minimal/fullscreen.ts:263` | `startSpinner` men-set `spinnerTimer = setTimeout(tickSpinner, 150)` alih-alih memanggil `tickSpinner()` langsung |
|
|
52
|
-
| 2 | `setRawMode is not a function` di luar TTY | `src/tui/minimal/fullscreen.ts:384` | Guard `process.stdin.isTTY`; non-TTY → jalur baca baris sederhana, bukan alternate-screen |
|
|
53
|
-
| — | Kegagalan bisu di masa depan | `src/tui/minimal/fullscreen.ts` | `process.on("unhandledRejection")` di driver → tampilkan sebagai item transcript `error` + restore kursor; tidak ada lagi hang tanpa pesan |
|
|
54
|
-
|
|
55
|
-
**Verifikasi:** test fase 0 hijau; `bun cli/index.ts --interactive` manual menerima prompt dan menampilkan jawaban; `echo "x" | bun cli/index.ts --interactive` tidak melempar stack trace.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Fase 2 — Tema hidup & warna transcript (~1,5 hari)
|
|
60
|
-
|
|
61
|
-
Dua temuan ini membuat seluruh sistem tema dan seluruh formatting markdown/diff jadi kode mati.
|
|
62
|
-
|
|
63
|
-
### 2.1 `c` dari closure beku → getter (#3)
|
|
64
|
-
|
|
65
|
-
`src/tui/theme.ts:57-91`. Objek `c` mengevaluasi token tema saat import, jadi `applyTheme()` tidak berpengaruh. Diverifikasi: `applyTheme("light")` lalu `c.success("X")` tetap mengeluarkan warna dark.
|
|
66
|
-
|
|
67
|
-
- Setiap slot jadi `get success() { return trueWrap(tk("success")) }`.
|
|
68
|
-
- **Terverifikasi layak:** 181 call-site `c.<slot>(…)` di 22 berkas tidak perlu diubah, dan `const { success } = c` tetap bekerja (mengambil snapshot saat destructuring — tak ada pola begitu di repo).
|
|
69
|
-
- `c.red`…`c.brightCyan` (#3, bagian kedua) dipetakan ke token tema, bukan hex hardcoded. Ini yang membuat `mono` benar-benar monokrom — jalur aksesibilitas.
|
|
70
|
-
- Cache per-tema (`Map<ThemeName, Wrappers>`) supaya getter tidak mengalokasi closure per panggilan pada jalur render panas.
|
|
71
|
-
|
|
72
|
-
**DoD:** `applyTheme("light")` mengubah keluaran `c.success`; `applyTheme("mono")` menghasilkan nol sekuens warna selain bold; `NO_COLOR=1` tetap menang atas semua tema.
|
|
73
|
-
|
|
74
|
-
### 2.2 Transcript berhenti membuang ANSI (#4)
|
|
75
|
-
|
|
76
|
-
`src/tui/minimal/fullscreen.ts:301`. `push()` men-`strip()` semua isi, jadi diff card kehilangan hijau/merah dan `decorateMarkdown` di baris 309/311 sia-sia.
|
|
77
|
-
|
|
78
|
-
- `push` menerima baris yang sudah berwarna; truncation memakai lebar **visible** (`stripAnsi` untuk mengukur, potong tanpa memutus sekuens di tengah).
|
|
79
|
-
- Item `tool` yang berisi diff card dan item `agent` hasil `decorateMarkdown` diteruskan utuh.
|
|
80
|
-
- Helper `truncAnsi(s, w)` baru — memotong berdasarkan lebar tampak dan menutup sekuens terbuka dengan `\x1b[0m`.
|
|
81
|
-
|
|
82
|
-
**DoD:** test meng-assert frame memuat sekuens hijau untuk baris `+` dan merah untuk `-`; markdown `**tebal**` menghasilkan `\x1b[1m` di frame; baris 200 karakter pada terminal 80 kolom tidak meninggalkan sekuens ANSI terpotong.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Fase 3 — Cost & budget di REPL (~0,5 hari)
|
|
87
|
-
|
|
88
|
-
`fullscreen.ts:110` menunggu `provider:extension { kind:"usage", data.cost }` yang **tidak pernah dikirim provider mana pun** — `openai-compat.ts:92` dan `anthropic.ts:137` hanya mengirim token. Cost dihitung di `usage.get()` yang tidak pernah dibaca TUI. `--budget` di-`void` (#5, `fullscreen-driver.ts:197`).
|
|
89
|
-
|
|
90
|
-
| Item | Berkas |
|
|
91
|
-
|---|---|
|
|
92
|
-
| `FullscreenMinimalOpts` menerima `usage(): Usage` alih-alih menebak dari event | `src/tui/minimal/fullscreen.ts:35` |
|
|
93
|
-
| Header/footer membaca `usage().cost` pada tiap render | `src/tui/minimal/fullscreen.ts:324, 375` |
|
|
94
|
-
| Peringatan 80% + hentikan saat lewat batas, sejajar jalur one-shot (`cli/index.ts:220-235`) | `cli/fullscreen-driver.ts` |
|
|
95
|
-
| Indikator budget di header: `$0.0123 / $5.00` | `src/tui/minimal/fullscreen.ts` |
|
|
96
|
-
|
|
97
|
-
**DoD:** test dengan fake usage collector meng-assert cost muncul di frame setelah `turn:completed`; melewati batas menghasilkan item transcript peringatan dan menolak submit berikutnya.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Fase 4 — Kursor & editing baris (~1 hari)
|
|
102
|
-
|
|
103
|
-
`prompt-engine.ts:147` mengembalikan `none` untuk `left`/`right`; `PromptState` tidak punya posisi kursor. Diverifikasi: `abcdef` + panah kiri ×3 + `X` → `abcdefX`. `_` di footer adalah kursor palsu yang menyesatkan.
|
|
104
|
-
|
|
105
|
-
| Item | Berkas |
|
|
106
|
-
|---|---|
|
|
107
|
-
| `PromptState` + `cursor: number` (indeks code-point, bukan UTF-16 unit) | `cli/prompt-engine.ts:5` |
|
|
108
|
-
| `char`/`backspace` menyisip/hapus **di posisi kursor**, bukan hanya di ujung | `cli/prompt-engine.ts:65-92` |
|
|
109
|
-
| `left`/`right` bergerak; `home`/`end`/`ctrl-a`/`ctrl-e` ditambahkan ke `PromptKey` + `decodeKey` (`ESC[H`, `ESC[F`, `ESC[1~`, `ESC[4~`) | `cli/prompt-engine.ts:26, 201` |
|
|
110
|
-
| `ctrl-w`/`ctrl-u` menghormati kursor (hapus kata sebelum kursor / ke awal baris) | `cli/prompt-engine.ts:129-146` |
|
|
111
|
-
| Renderer memposisikan kursor sungguhan (`ESC[<n>G`) dan berhenti mencetak `_` | `src/tui/minimal/fullscreen.ts:367`, `cli/input.ts:111` |
|
|
112
|
-
| Tab menghormati seleksi, bukan selalu item pertama (#11) — `pickFirst` → `pickSelected ?? pickFirst` | `cli/prompt-engine.ts:109` |
|
|
113
|
-
| Horizontal scroll `scrollableLine` mengikuti kursor, bukan hanya ujung | `cli/input.ts:103` |
|
|
114
|
-
|
|
115
|
-
Aman untuk emoji: `backspace` sudah code-point aware (`prompt-engine.ts:80`); logika yang sama diterapkan untuk gerakan kursor. Test emoji yang ada (`prompt-engine.test.ts:219`) harus tetap hijau.
|
|
116
|
-
|
|
117
|
-
**DoD:** `abcdef` + kiri×3 + `X` → `abcXdef`; Home/End berfungsi; kursor terminal tampak di posisi logis; 2000 fuzz `test/fuzz-prompt.test.ts` hijau dengan key baru dimasukkan ke generator.
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Fase 5 — Overlay, picker, mouse (~1 hari)
|
|
122
|
-
|
|
123
|
-
| # | Masalah | Berkas | Perbaikan |
|
|
124
|
-
|---|---|---|---|
|
|
125
|
-
| 7 | Overlay meluber melewati tinggi terminal dan tidak bisa di-scroll — 30 baris dirender penuh di terminal 20 baris, header terguling keluar | `fullscreen.ts:287, 344` | Slice ke `overlayLines`, state `overlayScroll`, panah/PgUp/PgDn, indikator `n/total`. Pinjam logika `cli/panel.ts:64-82` yang sudah benar |
|
|
126
|
-
| 8 | Byte mouse bocor jadi teks (`teks` → `teks 00` saat diklik) | `screen.ts:30`, `prompt-engine.ts:225` | Decoder mengenali `ESC[M`+3 byte serta SGR `ESC[<…M/m`; klik dibuang, wheel dinormalisasi menjadi scroll transkrip, dan mouse tracking hanya aktif selama TUI |
|
|
127
|
-
| 9 | `/resume` di TUI hanya mencetak instruksi manual | `fullscreen-driver.ts:114` | Respawn dengan `--resume <id>` seperti jalur klasik (`commands.ts:326`) |
|
|
128
|
-
| 9b | Tiap slash command menembak `onPicker` → `onOverlay` → `onLine` berurutan | `fullscreen.ts:218-241` | Satu tabel dispatch: `builtin(picker) | builtin(overlay) | skill | prompt`, diputuskan sebelum eksekusi, bukan dengan mencoba tiga jalur |
|
|
129
|
-
| 10 | Panah atas menggabungkan history ke teks yang ada (`halo` → `halo audit dong…`) | `cli/input.ts:198` | Ganti baris, jangan gabungkan — sejajar dengan perilaku shell dan dengan jalur fullscreen |
|
|
130
|
-
|
|
131
|
-
**DoD:** overlay 50 baris di terminal 20 baris bisa di-scroll penuh dan header tetap tampak; klik mouse tidak mengubah isi baris; `/resume` benar-benar melanjutkan sesi.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Fase 6 — Konsistensi CLI (~1 hari)
|
|
136
|
-
|
|
137
|
-
| # | Item | Berkas |
|
|
138
|
-
|---|---|---|
|
|
139
|
-
| 12 | `--version` / `-v` — saat ini dikirim ke LLM sebagai prompt. Versi dibaca dari `package.json`, bukan hardcode di dua tempat | `cli/index.ts:66`, hapus literal di `:72` |
|
|
140
|
-
| 13 | `config`, `config mcp`, `config lsp`, `mcp` tanpa argumen mencetak HELP global 45 baris dan exit 0 → help kontekstual per subcommand + exit 1, mengikuti pola `auth`/`pricing` yang sudah rapi | `cli/commands/config.ts:185,253,257`, `cli/commands/mcp.ts` |
|
|
141
|
-
| 14 | `stats --json` mengabaikan flag | `cli/commands/stats.ts:20` |
|
|
142
|
-
| 15 | `renderTable`: `width` adalah minimum, bukan maksimum → kolom melebar dan header tidak lagi berbaris (nyata di `config list` dengan ID 23 karakter) | `src/tui/table.ts:20` — `width` jadi batas keras, isi lebih panjang dipotong dengan `…` |
|
|
143
|
-
| 16 | Alignment `providers` rusak untuk ID panjang | `cli/commands/providers.ts:69` — pakai `renderTable` alih-alih `padEnd(16)` manual |
|
|
144
|
-
| 17 | Bahasa campur: `providers`/`config`/`skills`/`sessions` Inggris, `auth`/`pricing`/TUI Indonesia, dalam satu sesi user melihat keduanya | seluruh `cli/` — **pilih Indonesia** (mayoritas permukaan interaktif sudah Indonesia); pesan `usage:` tetap Inggris karena konvensi CLI |
|
|
145
|
-
| 18 | Notice `[sandbox]` muncul di stderr untuk **setiap** perintah di Windows, termasuk yang tak menjalankan tool | `cli/index.ts:138` — tampilkan hanya bila sesi berpotensi menjalankan bash |
|
|
146
|
-
| 22 | `/help` tidak menyebut Ctrl+O, Ctrl+R, Shift+Tab, Ctrl+U, Ctrl+W, Esc, `\` continuation | `cli/commands.ts:60` — bagian "Keyboard" |
|
|
147
|
-
|
|
148
|
-
**DoD:** `minicode --version` mencetak versi dari `package.json`; setiap subcommand tanpa argumen memberi help sendiri dengan exit 1; `config list` dengan ID 30 karakter tetap sejajar; satu bahasa di seluruh keluaran.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Fase 7 — Kebersihan (~0,5 hari)
|
|
153
|
-
|
|
154
|
-
| # | Item | Berkas |
|
|
155
|
-
|---|---|---|
|
|
156
|
-
| 19 | `stripAnsi` terduplikasi; `ANSI_PATTERN` tidak menangkap private-mode (`ESC[?25l`, `ESC[?2026h` lolos utuh — masuk ke teks overlay via `captureOutput`) | `src/tui/theme.ts:122` perluas pola; `src/tui/wrap.ts:6` re-export |
|
|
157
|
-
| 20 | Justify menjustifikasi baris terakhir paragraf → "sungai" spasi (`dengan lebar tertentu`) | `src/tui/wrap.ts:62` — baris terakhir rata kiri; `MINICODE_JUSTIFY=0` untuk mematikan |
|
|
158
|
-
| 21 | `/thinking` punya dua state (`process.env` dan `showThinking.ref`) dan **nol konsumen** — melapor sukses tanpa efek | satu state di `showThinking`, dibaca `simple.ts:60` dan `fullscreen.ts` untuk event `reasoning` |
|
|
159
|
-
| 23 | `--ui auto|full|classic` diparse, diteruskan, tidak pernah dibaca; `--tui` juga tidak berpengaruh | hapus `--ui` dari `cli/args.ts:24` dan `cli/index.ts:146`; `--tui` didokumentasikan sebagai default REPL atau dihapus dari HELP |
|
|
160
|
-
| 24 | `import-convention.test.ts` false positive (mendeteksi berkas test-nya sendiri) | `test/import-convention.test.ts:43` — kecualikan berkas yang memuat pola sebagai literal |
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Urutan & ketergantungan
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
Fase 0 (harness)
|
|
168
|
-
└─> Fase 1 (blocker) ← tanpa ini tak ada yang bisa diuji manual
|
|
169
|
-
├─> Fase 2 (tema+warna)
|
|
170
|
-
├─> Fase 3 (cost)
|
|
171
|
-
├─> Fase 4 (kursor) ← paling besar, paling terisolasi
|
|
172
|
-
└─> Fase 5 (overlay)
|
|
173
|
-
Fase 6, 7 (CLI, kebersihan) ← paralel, tak bergantung TUI
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Fase 6 dan 7 bisa dikerjakan siapa pun kapan pun. Fase 2–5 sebaiknya berurutan karena semuanya menyentuh `fullscreen.ts`.
|
|
177
|
-
|
|
178
|
-
**Total: ~6,5 hari.** Fase 0+1 (~1 hari) sudah memulihkan produk dari "tidak bisa dipakai" menjadi "bisa dipakai".
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## KPI
|
|
183
|
-
|
|
184
|
-
| Metrik | Sebelum | Target |
|
|
185
|
-
|---|---|---|
|
|
186
|
-
| REPL menerima prompt | **tidak** | ya |
|
|
187
|
-
| Test lapisan interaktif | 0 berkas | `fullscreen.ts`, `input.ts`, `picker.ts`, `panel.ts`, `provider-manager.ts` ≥70% lines |
|
|
188
|
-
| Coverage `cli/` | 49% lines | ≥65% |
|
|
189
|
-
| Berkas UI di 0% coverage | 19 | ≤6 (jalur yang butuh proses nyata: `index.ts`, `setup.ts`, `exec.ts`, `auth.ts`, `wizard.ts`, `screen.ts`) |
|
|
190
|
-
| `applyTheme` mengubah warna | tidak | 4 preset, terverifikasi per slot |
|
|
191
|
-
| Warna diff/markdown di TUI | dibuang | dipertahankan |
|
|
192
|
-
| Cost tampil di REPL | tidak | ya, + peringatan budget |
|
|
193
|
-
| Editing di tengah baris | tidak | kursor penuh + Home/End |
|
|
194
|
-
| Overlay > tinggi terminal | meluber | scroll + indikator |
|
|
195
|
-
| `bun test` | 637 pass / 1 fail | seluruhnya hijau |
|
|
196
|
-
|
|
197
|
-
**Perintah verifikasi:** `bun test`, `bun x tsc --noEmit`, `bun run lint`, `bun test --coverage`, `bun run gate:coverage`, ditambah manual `minicode --interactive` pada terminal 60×20 dan 120×40.
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Yang sengaja tidak dikerjakan
|
|
202
|
-
|
|
203
|
-
Agar cakupan jelas dan tidak melebar:
|
|
204
|
-
|
|
205
|
-
- **Tidak ada framework TUI baru.** Pure ANSI tetap. Ink/blessed akan membuang seluruh `fullscreen.ts` demi masalah yang perbaikannya berukuran satu baris sampai satu fungsi.
|
|
206
|
-
- **Tidak ada wrap/scroll transcript virtual.** `RING_MAX 60` dan `tail.slice(-bodyH)` memadai; sisa PLAN_UIUX soal virtual scroll ditunda sampai ada keluhan nyata.
|
|
207
|
-
- **Tidak ada mouse click-to-copy** (PLAN_UIUX P3). Mouse wheel dipakai untuk scroll transkrip; klik mouse tetap diabaikan agar tidak merusak input.
|
|
208
|
-
- **Tidak ada tema baru.** Empat preset yang ada dibuat bekerja lebih dulu.
|
|
209
|
-
- **Repo-map, OAuth live, resolve-rate, publish npm** tetap di daftar tertunda PLAN_V5 — bukan UI/UX.
|
package/docs/changelog.md
DELETED