minicode-ai 0.11.0 → 0.13.0
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/CHANGELOG.md +98 -0
- package/LICENSE +21 -21
- package/README.md +4 -4
- package/cli/args.ts +46 -0
- package/cli/commands/acp.ts +163 -10
- package/cli/commands/config.ts +33 -18
- package/cli/commands/daemon.ts +515 -0
- package/cli/commands/exec.ts +145 -53
- package/cli/commands/openwork.ts +986 -0
- package/cli/commands/sessions.ts +4 -1
- package/cli/commands/stats.ts +34 -4
- package/cli/commands.ts +217 -2
- package/cli/index.ts +146 -14
- package/cli/recovery-warning.ts +115 -0
- package/cli/router.ts +32 -1
- package/cli/setup.ts +2332 -171
- package/cli/tui.ts +113 -7
- package/docs/OUTPUT_ARCHITECTURE_AUDIT.md +489 -0
- package/docs/OUTPUT_EVENT_MODEL.md +289 -0
- package/docs/OUTPUT_IMPLEMENTATION_PLAN.md +391 -0
- package/docs/OUTPUT_PROTOCOL_SPEC.md +285 -0
- package/docs/OUTPUT_RENDERING_SPEC.md +248 -0
- package/docs/OUTPUT_UX_RULES.md +449 -0
- package/docs/PLAN_UIUX_V6.md +2 -2
- package/docs/README.md +4 -3
- package/docs/TERMINAL_CONTRACT.md +278 -66
- package/docs/architecture.md +89 -7
- package/docs/changelog.md +1 -1
- package/docs/choosing-mode.md +2 -2
- package/docs/cli.md +9 -5
- package/docs/concepts.md +1 -1
- package/docs/contributing.md +9 -2
- package/docs/environment.md +6 -2
- package/docs/exec.md +46 -5
- package/docs/memory-sessions.md +2 -0
- package/docs/policy-sandbox.md +1 -1
- package/docs/pricing-budget.md +1 -1
- package/docs/quickstart.md +2 -2
- package/docs/repl.md +6 -2
- package/docs/security-model.md +1 -1
- package/docs/security.md +1 -1
- package/docs/skills.md +2 -2
- package/docs/terminal.md +9 -5
- package/docs/tools.md +1 -1
- package/package.json +35 -5
- package/src/app/session.ts +261 -15
- package/src/app/tool-layer.ts +94 -7
- package/src/daemon/approvals.ts +361 -0
- package/src/daemon/capability.ts +145 -0
- package/src/daemon/children.ts +142 -0
- package/src/daemon/client.ts +267 -0
- package/src/daemon/control.ts +350 -0
- package/src/daemon/discovery.ts +234 -0
- package/src/daemon/feed.ts +155 -0
- package/src/daemon/framing.ts +94 -0
- package/src/daemon/host.ts +316 -0
- package/src/daemon/protocol.ts +217 -0
- package/src/daemon/resource.ts +170 -0
- package/src/daemon/sanitize.ts +57 -0
- package/src/daemon/server.ts +627 -0
- package/src/daemon/store.ts +317 -0
- package/src/daemon/subscription.ts +270 -0
- package/src/daemon/telemetry.ts +81 -0
- package/src/hooks/run.ts +12 -1
- package/src/lib/atomic-write.ts +29 -3
- package/src/lib/db-path.ts +26 -0
- package/src/lib/keystore.ts +544 -42
- package/src/lib/net.ts +43 -1
- package/src/lib/safe-open.ts +116 -1
- package/src/lib/session-id.ts +15 -0
- package/src/lsp/client.ts +123 -5
- package/src/mcp/client.ts +139 -17
- package/src/mcp/server.ts +177 -50
- package/src/mcp/transport.ts +16 -19
- package/src/memory/vector.ts +770 -55
- package/src/policy/allowlist.ts +14 -2
- package/src/policy/bash-guard.ts +105 -10
- package/src/policy/compaction.ts +82 -5
- package/src/policy/consequence-engine.ts +220 -0
- package/src/policy/context.ts +132 -0
- package/src/policy/executor.ts +187 -121
- package/src/policy/no-progress.ts +559 -0
- package/src/policy/permission.ts +4 -8
- package/src/policy/pricing.ts +17 -3
- package/src/policy/scrub.ts +69 -2
- package/src/policy/tool-contract.ts +515 -0
- package/src/policy/usage.ts +310 -24
- package/src/policy/verifier.ts +6 -3
- package/src/policy/work-mode.ts +182 -0
- package/src/presentation/adapter.ts +533 -26
- package/src/presentation/events.ts +151 -0
- package/src/presentation/model.ts +180 -27
- package/src/presentation/projection.ts +858 -0
- package/src/presentation/reducer.ts +645 -310
- package/src/presentation/store.ts +12 -7
- package/src/providers/anthropic.ts +18 -10
- package/src/providers/responses.ts +17 -7
- package/src/runtime/capability.ts +409 -0
- package/src/runtime/child-execution.ts +274 -0
- package/src/runtime/composition.ts +958 -0
- package/src/runtime/dispatch.ts +591 -0
- package/src/runtime/execution-backend.ts +632 -0
- package/src/runtime/execution-events.ts +272 -0
- package/src/runtime/execution-id.ts +230 -0
- package/src/runtime/execution-journal.ts +926 -0
- package/src/runtime/execution-kernel.ts +456 -0
- package/src/runtime/execution-registry.ts +379 -0
- package/src/runtime/process-supervision.ts +276 -0
- package/src/runtime/production-execution.ts +551 -0
- package/src/runtime/production-runtime.ts +217 -0
- package/src/runtime/recovery-safety.ts +70 -0
- package/src/runtime/recovery.ts +477 -0
- package/src/runtime/runtime-capabilities.ts +179 -0
- package/src/runtime/runtime-diagnostics.ts +141 -0
- package/src/runtime/runtime-host.ts +365 -0
- package/src/runtime/runtime-status-facts.ts +222 -0
- package/src/runtime/runtime-status-provider.ts +74 -0
- package/src/runtime/runtime-status.ts +459 -0
- package/src/runtime/runtime-task-admission.ts +101 -0
- package/src/runtime/supervisor.ts +444 -0
- package/src/session/authority.ts +168 -0
- package/src/session/checkpoint.ts +88 -1
- package/src/session/context-adapter.ts +251 -0
- package/src/session/context-assembly.ts +242 -0
- package/src/session/context-identity.ts +389 -0
- package/src/session/context-projection.ts +248 -0
- package/src/session/context-selector.ts +500 -0
- package/src/session/cross-session-adoption.ts +249 -0
- package/src/session/full-history-fold.ts +171 -0
- package/src/session/identity.ts +192 -0
- package/src/session/journal.ts +805 -102
- package/src/session/open-work-intent.ts +732 -0
- package/src/session/open-work.ts +767 -0
- package/src/session/pending-tools.ts +94 -0
- package/src/session/persistence.ts +3569 -127
- package/src/session/runtime-header.ts +208 -0
- package/src/session/shadow-git.ts +13 -5
- package/src/session/verification.ts +1623 -0
- package/src/task/assignment.ts +136 -0
- package/src/task/autonomous-adapter.ts +168 -0
- package/src/task/autonomous-context.ts +630 -0
- package/src/task/autonomous-policy.ts +490 -0
- package/src/task/continuity.ts +179 -0
- package/src/task/execution-cancellation.ts +165 -0
- package/src/task/graph-validate.ts +379 -0
- package/src/task/graph.ts +305 -0
- package/src/task/identity.ts +230 -0
- package/src/task/model.ts +417 -0
- package/src/task/production-scheduler.ts +293 -0
- package/src/task/readiness.ts +229 -0
- package/src/task/scheduler-observability.ts +387 -0
- package/src/task/scheduler.ts +1197 -0
- package/src/task/scheduling-policy.ts +165 -0
- package/src/task/session-authority.ts +148 -0
- package/src/task/session-ownership.ts +211 -0
- package/src/task/store.ts +2887 -0
- package/src/task/sync.ts +343 -0
- package/src/task/trigger.ts +260 -0
- package/src/tools/bash.ts +377 -211
- package/src/tools/code_run.ts +1 -1
- package/src/tools/delete_file.ts +1 -1
- package/src/tools/edit.ts +33 -6
- package/src/tools/evidence.ts +30 -0
- package/src/tools/git.ts +4 -4
- package/src/tools/glob.ts +12 -3
- package/src/tools/grep.ts +1 -1
- package/src/tools/lsp.ts +4 -4
- package/src/tools/mcp_call.ts +11 -4
- package/src/tools/memory.ts +153 -18
- package/src/tools/move_file.ts +1 -1
- package/src/tools/patch.ts +1 -1
- package/src/tools/read_file.ts +1 -1
- package/src/tools/read_image.ts +1 -1
- package/src/tools/submit_result.ts +1 -1
- package/src/tools/task.ts +437 -41
- package/src/tools/todo.ts +662 -35
- package/src/tools/web_fetch.ts +4 -2
- package/src/tools/web_search.ts +9 -3
- package/src/tools/write_file.ts +1 -1
- package/src/ui/assistant/simple.ts +123 -50
- package/src/ui/assistant/turn-status.ts +17 -3
- package/src/ui/contract.ts +184 -0
- package/src/ui/footer.ts +54 -18
- package/src/ui/i18n/en.ts +62 -6
- package/src/ui/i18n/id.ts +62 -6
- package/src/ui/input/prompt-engine.ts +120 -25
- package/src/ui/render/errors.ts +39 -1
- package/src/ui/render/markdown-table.ts +455 -0
- package/src/ui/render/markdown.ts +22 -1
- package/src/ui/render/table-grid.ts +184 -0
- package/src/ui/render/table.ts +15 -76
- package/src/ui/runtime/screen.ts +7 -2
- package/src/ui/runtime/statusline.ts +25 -6
- package/src/ui/tui/app.ts +598 -133
- package/src/ui/tui/transcript.ts +531 -89
- package/vendor/minicore/VENDOR.md +1 -1
- package/vendor/minicore/src/core/budget.ts +25 -25
- package/vendor/minicore/src/core/compact.ts +75 -75
- package/vendor/minicore/src/core/errors.ts +59 -59
- package/vendor/minicore/src/core/events.ts +73 -73
- package/vendor/minicore/src/core/executor.ts +139 -139
- package/vendor/minicore/src/core/history.ts +31 -31
- package/vendor/minicore/src/core/index.ts +41 -41
- package/vendor/minicore/src/core/loop.ts +355 -355
- package/vendor/minicore/src/core/permission.ts +22 -22
- package/vendor/minicore/src/core/provider.ts +39 -39
- package/vendor/minicore/src/core/recovery.ts +35 -35
- package/vendor/minicore/src/core/session.ts +327 -327
- package/vendor/minicore/src/core/snapshot.ts +146 -146
- package/vendor/minicore/src/core/tokens.ts +107 -107
- package/vendor/minicore/src/core/tool.ts +115 -115
- package/vendor/minicore/src/core/types.ts +50 -50
- package/vendor/minicore/src/providers/openai-compat.ts +417 -417
- package/AGENTS.md +0 -45
- package/PLAN.md +0 -491
- package/docs/ARCHITECTURE.html +0 -1248
- package/docs/CONTROL-PLANE-MAP.md +0 -139
- package/docs/HARNESS.md +0 -150
- package/docs/SUMMARY.md +0 -52
- package/docs/UI_RENDER_PIPELINE.md +0 -165
- package/docs/USAGE.md +0 -11
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# Output Architecture Audit
|
|
2
|
+
|
|
3
|
+
**Status:** audit selesai; Phase 1–8 remediation landed, with one ACP compatibility window. Tables and evidence marked historical describe the pre-remediation baseline.
|
|
4
|
+
**Tanggal:** 2026-09-25
|
|
5
|
+
**Produk:** MiniCode coding agent CLI
|
|
6
|
+
**Rujukan kontrak:** `docs/TERMINAL_CONTRACT.md`, `docs/UI_RENDER_PIPELINE.md`
|
|
7
|
+
|
|
8
|
+
## Scope
|
|
9
|
+
|
|
10
|
+
Audit ini mencakup output yang dihasilkan atau diturunkan oleh runtime MiniCode:
|
|
11
|
+
|
|
12
|
+
- TUI fullscreen: transkrip, composer, status bar, popup, selection, clipboard.
|
|
13
|
+
- Output linear/one-shot: model text, reasoning, tool ledger, error, receipt.
|
|
14
|
+
- `exec --json`: JSON Lines dan summary envelope.
|
|
15
|
+
- `acp`: JSON-RPC stdio minimal untuk IDE.
|
|
16
|
+
- Diagnostic, approval, spinner/status transient, setup/recovery/verify.
|
|
17
|
+
- Batas vendor: `vendor/minicore/**` dibaca sebagai evidence, tidak diubah.
|
|
18
|
+
|
|
19
|
+
Rancangan `AGENT_PRESENTATION_ARCHITECTURE_V2_1.md` diperlakukan sebagai target
|
|
20
|
+
arsitektur, bukan bukti bahwa semua fase sudah selesai. Audit ini menilai wiring
|
|
21
|
+
aktual terhadap rancangan tersebut.
|
|
22
|
+
|
|
23
|
+
## Phase 1–8 implementation update
|
|
24
|
+
|
|
25
|
+
Audit ini capturing baseline sebelum remediation. Current implementation status
|
|
26
|
+
setelah Phase 1–8:
|
|
27
|
+
|
|
28
|
+
- Phase 1: `user.message`, mapper exhaustive, `PROPOSED_EVENT_TYPES`, dan
|
|
29
|
+
`unsupportedProjection` diagnostics landed.
|
|
30
|
+
- Phase 2: semantic collections, derived summaries, bounded retention, durable
|
|
31
|
+
SQLite event log, resume rebuild, checkpoint evidence, child-session
|
|
32
|
+
persistence, producer `finding.detected`, contract restart/branch/child/delete/
|
|
33
|
+
TTL/resume, dan `eventSeq` unik landed.
|
|
34
|
+
- Phase 3–7: policy proyeksi murni, envelope machine, migrasi TUI/linear/machine,
|
|
35
|
+
persist headless, dan writer inventory landed.
|
|
36
|
+
- Phase 8: rollback flag dan raw ledger TUI dihapus. Runtime EventBus tetap
|
|
37
|
+
dipakai untuk streaming konten dan debug/trace, bukan sebagai sumber status
|
|
38
|
+
user-facing kedua.
|
|
39
|
+
- OAP-001–OAP-010 dan OAP-012–OAP-013 closed atau documenting the compatibility
|
|
40
|
+
boundary; OAP-011 tetap proposed/compatibility-only. Residual window: ACP
|
|
41
|
+
legacy `type:"tool"` when canonical lifecycle is unavailable.
|
|
42
|
+
|
|
43
|
+
## Executive verdict
|
|
44
|
+
|
|
45
|
+
Audit baseline menunjukkan MiniCode memiliki fondasi terminal yang kuat:
|
|
46
|
+
sanitasi trust boundary, perhitungan lebar kolom, ownership alternate-screen,
|
|
47
|
+
coalesce repaint, source-mapped selection, OSC52, dan test proteksi yang luas.
|
|
48
|
+
Setelah remediation Phase 1–8, status, activity, visibility, correlation, dan
|
|
49
|
+
machine lifecycle mengambil keputusan dari canonical presentation policy yang
|
|
50
|
+
di-inject pada composition root.
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Agent Runtime
|
|
54
|
+
↓ MiniCore EventBus
|
|
55
|
+
↓ streaming content transport
|
|
56
|
+
├─ TUI transcript content + canonical policy ledger
|
|
57
|
+
├─ Linear content + canonical policy writer
|
|
58
|
+
├─ exec canonical lifecycle + text delta
|
|
59
|
+
└─ ACP canonical lifecycle + text delta
|
|
60
|
+
|
|
61
|
+
PresentationAdapter
|
|
62
|
+
↓
|
|
63
|
+
DomainEvent → PresentationState (durable/replayable)
|
|
64
|
+
↓ UiPresentationEvent + PresentationPolicy
|
|
65
|
+
TUI / linear / exec / ACP
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Tidak ditemukan P0. Residual risk terbatas pada live streaming dan kompatibilitas
|
|
69
|
+
ACP legacy `type:"tool"`; keduanya tidak menentukan status user-facing canonical.
|
|
70
|
+
The historical findings below remain as evidence for the pre-remediation state;
|
|
71
|
+
the current implementation is recorded in the Phase 1–8 update above.
|
|
72
|
+
|
|
73
|
+
## Arsitektur aktual
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Provider/router
|
|
77
|
+
│ provider:text / provider:extension / usage
|
|
78
|
+
▼
|
|
79
|
+
MiniCore loop (vendor/minicore, frozen)
|
|
80
|
+
│ turn:started, step:*, execution:*, provider:*, context:*
|
|
81
|
+
▼
|
|
82
|
+
session.events (raw EventBus; raw content streaming tetap, semantic legacy
|
|
83
|
+
user-facing dihapus di Phase 8)
|
|
84
|
+
├── attachSimpleLogger() ── stdout/stderr linear (keputusan status dari policy)
|
|
85
|
+
│ └── turn-status.ts ── transient stderr (label via activityFor DI)
|
|
86
|
+
├── Transcript() ── append-only visual state TUI (ledger/summary dari policy)
|
|
87
|
+
│ └── TuiApp + screen.ts ── alternate screen
|
|
88
|
+
├── exec.ts ── envelope minicode.output.v1 → JSONL (+ text delta terpisah)
|
|
89
|
+
├── acp.ts ── lifecycle presentasi penuh + text delta tersanitasi
|
|
90
|
+
├── journal/checkpoint/trace
|
|
91
|
+
├── presentation_events (SQLite durable log)
|
|
92
|
+
└── PresentationAdapter (cli/setup.ts)
|
|
93
|
+
├── turn/tool/model/reasoning/context/checkpoint events
|
|
94
|
+
├── approval hooks + noteRunSettled + file.changed
|
|
95
|
+
└── replayable bounded PresentationState
|
|
96
|
+
├── toPresentationEvent() compatibility bridge
|
|
97
|
+
└── projection.ts policy (di-inject ke renderer sebagai PresentationPolicy)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Batas aktual yang sudah baik
|
|
101
|
+
|
|
102
|
+
- `src/ui/` tidak mengimpor `cli/`, `src/` non-UI, atau kernel; dijaga
|
|
103
|
+
`test/ui-boundary.test.ts`.
|
|
104
|
+
- `TuiApp` adalah pemilik tunggal frame TUI; `screen.ts` memiliki pairing
|
|
105
|
+
alternate-screen dan `paintRegion()`.
|
|
106
|
+
- `statusline.ts` meng arbitrasi transient painter dan menahan painter ketika
|
|
107
|
+
interactive screen aktif.
|
|
108
|
+
- Sanitasi dan geometri memakai modul bersama; teks yang tidak dipercaya tidak
|
|
109
|
+
boleh keluar sebagai control sequence mentah.
|
|
110
|
+
- Event bus mengisolasi handler yang melempar sehingga observer/UI tidak
|
|
111
|
+
menggagalkan turn (`vendor/minicore/src/core/events.ts:35-71`).
|
|
112
|
+
- TUI, linear, ACP, dan exec sudah memiliki test output serta boundary fail-closed
|
|
113
|
+
untuk machine mode.
|
|
114
|
+
|
|
115
|
+
## Historical Pipeline (pre-remediation evidence)
|
|
116
|
+
|
|
117
|
+
| Stage | Current implementation | Problem | Risk |
|
|
118
|
+
|---|---|---|---|
|
|
119
|
+
| Provider stream | `src/providers/router.ts`, `vendor/minicore/src/core/loop.ts:108-135` | Raw provider event tidak memiliki schema output bersama | Tiap consumer menafsirkan event sendiri |
|
|
120
|
+
| Kernel lifecycle | `vendor/minicore/src/core/events.ts:5-14`, `session.ts:234-249` | `turn:completed` hanya sukses; abort/timeout/failure tidak menjadi terminal event | Consumer harus merekonstruksi makna dari driver |
|
|
121
|
+
| Tool execution | `vendor/minicore/src/core/executor.ts:40-104` | Permission deny, unknown tool, dan invalid args dapat kembali tanpa `execution:*` | Denial/validation perlu dibaca dari `step.completed` |
|
|
122
|
+
| Semantic adapter | `src/presentation/adapter.ts:158-721` | Semua lifecycle harus direkonstruksi; beberapa event dideklarasikan tanpa producer | Risiko event hilang/duplikat/anomali |
|
|
123
|
+
| State/reducer | `src/presentation/{model,reducer}.ts`, wiring `cli/setup.ts:642-655` | Reducer hanya shadow; `PresentationState` belum lengkap untuk semua event | TUI/linear/ACP dapat berbeda |
|
|
124
|
+
| UI bridge | `cli/setup.ts:449-532`, `src/ui/contract.ts:144-174` | Hanya turn/tool/approval yang diproyeksikan; model/reasoning/file/test/context di-drop | Consumer tidak dapat memakai satu event stream |
|
|
125
|
+
| TUI | `src/ui/tui/{transcript,app}.ts`, `runtime/screen.ts` | Truth visual berasal dari raw bus + buffer sendiri, bukan snapshot tunggal | Status/ledger dapat berbeda dari linear |
|
|
126
|
+
| Linear/one-shot | `src/ui/assistant/simple.ts`, `turn-status.ts` | Menggabungkan state, sanitasi, collapse, policy, dan writes | Perubahan semantics berisiko duplication |
|
|
127
|
+
| Exec machine | `cli/commands/exec.ts:126-199` | Streaming raw `session.events("*")`; summary memiliki schema sendiri | Client harus memahami dua protocol |
|
|
128
|
+
| ACP machine | `cli/commands/acp.ts:278-349` | Menggabungkan raw text/tool stream dengan partial presentation lifecycle | IDE bisa melihat event lifecycle tidak lengkap |
|
|
129
|
+
| Diagnostic/policy | `cli/setup.ts`, `cli/index.ts`, `statusline.ts`, approval/popup | Banyak direct write; arbitration melindungi transient, bukan semantik | Jalur baru mudah melanggar stream contract |
|
|
130
|
+
| Durable state | `session/journal`, `persistence`, checkpoint, `turn-marker` | Data durable tidak ditulis sebagai `DomainEvent` yang dapat direplay ke model | `rebuildFromDurable()` belum wired di production |
|
|
131
|
+
|
|
132
|
+
## Event Inventory
|
|
133
|
+
|
|
134
|
+
| Event | Source | Current presentation | Desired semantic type |
|
|
135
|
+
|---|---|---|---|
|
|
136
|
+
| `turn:started` | MiniCore loop | TUI/linear/ACP turn marker; `turn.started` shadow | `task.started` dengan `sessionId`, `turnId`, visibility normal |
|
|
137
|
+
| `turn:completed` | MiniCore success | Flush transcript/answer, status, `turn.completed` shadow | `task.completed` + derived summary |
|
|
138
|
+
| `turn.failed` | `noteRunSettled()` | Error friendly dari driver; tidak selalu event live | `task.failed` dengan cause/severity/action |
|
|
139
|
+
| `turn.cancelled` | `noteRunSettled()` | Stopped/budget/timeout messages; TUI/linear/ACP bergantung driver | `task.cancelled` dengan reason user/timeout/budget |
|
|
140
|
+
| `model.delta` | `provider:text` | Stream text sanitized ke TUI/linear/ACP | `assistant.message.delta`, live-only |
|
|
141
|
+
| `model.completed` | `TurnResult.finalText` saat turn selesai | Commit transcript/answer; bridge tidak mengirim ke UI | `assistant.message.completed`, durable final |
|
|
142
|
+
| `reasoning.delta` | `provider:extension(kind=reasoning)` | Dots/stream/buffer sesuai surface | `assistant.reasoning.delta`, live-only |
|
|
143
|
+
| `reasoning.completed` | Tidak ada producer runtime saat ini | Hanya tipe dan durability; tidak tampil konsisten | `assistant.reasoning.completed`, hasil final/ref |
|
|
144
|
+
| `tool.started` | `execution:started` | Ledger/progress/status running | `tool.started` dengan identity/correlation |
|
|
145
|
+
| `tool.progress` | Tidak ada producer runtime saat ini | Hanya field `progress` bila event eksternal | `tool.progress`, live-only, optional |
|
|
146
|
+
| `tool.completed` | `execution:completed` success | Receipt/ledger/collapse | `tool.completed` dengan duration/evidence |
|
|
147
|
+
| `tool.failed` | execution result atau `step.results` | Error ringkas; klasifikasi dapat berbeda | `tool.failed` dengan cause/hint/partial state |
|
|
148
|
+
| `tool.denied` | Reconstructed dari permission result | Warning/deny; adapter diklasifikasi khusus | `tool.denied` dengan deny reason/outcome |
|
|
149
|
+
| `tool.cancelled` | Cascade saat abort/parent settle | Dibatasi/ditampilkan sebagai cancelled | `tool.cancelled` dengan cancellation reason |
|
|
150
|
+
| `approval.requested` | Permission/ask hook | Blok TUI/linear/headless deny | `approval.requested` |
|
|
151
|
+
| `approval.settled` | Permission/ask hook | Keputusan tercatat; bridge partial | `approval.settled` dengan allow/deny/cancelled |
|
|
152
|
+
| `file.changed` | `attachMutationJournal` → adapter | Receipt pada activity; bridge meng-drop event | `file.changed` sebagai evidence/receipt |
|
|
153
|
+
| `test.completed` | Tidak ada producer saat ini | Hanya tipe dan receipt join | `test.completed` sebagai evidence |
|
|
154
|
+
| `context.compacted` | MiniCore loop | Warning/entry system; bridge meng-drop | `context.compacted` sebagai system event |
|
|
155
|
+
| Diagnostic | CLI/provider/policy direct write | `[warn]`, `[recovery]`, `[verify]`, spinner | `diagnostic.raised` atau `recovery.*` dengan policy stream |
|
|
156
|
+
|
|
157
|
+
## Output Inventory
|
|
158
|
+
|
|
159
|
+
| Output | Category | Current mode | Recommended mode |
|
|
160
|
+
|---|---|---|---|
|
|
161
|
+
| TUI transcript | Human, interactive | Fullscreen frame; raw-bus-fed view | Same layout, sourced from canonical projection |
|
|
162
|
+
| TUI status/footer | Human, interactive | Clock/ANSI state in `TuiApp` | Semantic snapshot; renderer owns only layout |
|
|
163
|
+
| Linear model text | Human, append-only | Sanitized stream, collapse, markdown table | Normal/verbose projection from same state |
|
|
164
|
+
| Linear tool receipt | Human + operational evidence | Direct writer with status suffix | Derived activity node; evidence remains ref-backed |
|
|
165
|
+
| Reasoning | Human, optional | TUI/linear independently buffer/minimize | Same state, visibility policy per projection |
|
|
166
|
+
| Transient status/spinner | Human, ephemeral | `turn-status`/`statusline` direct writes | Derived projection of active task; output sink route |
|
|
167
|
+
| `exec --json` | Machine | Raw EventBus JSONL + summary | Versioned canonical JSONL + terminal summary |
|
|
168
|
+
| ACP | Machine/IDE | Text deltas + raw tool fallback + partial lifecycle | Canonical lifecycle notifications + text delta |
|
|
169
|
+
| Approval | Human or machine policy | TUI sink, inline askLine, headless deny | Approval event + surface-specific prompt/decision |
|
|
170
|
+
| Diagnostics | Human diagnostic | Direct stderr with varied prefixes | Typed diagnostic policy, never mixed with machine stdout |
|
|
171
|
+
| Clipboard | Human interaction | `/copy` + app selection OSC52 | Same; source-mapped and sanitized |
|
|
172
|
+
| Debug bus | Debug | Opt-in `bus-debug` raw event summaries | Debug projection from canonical events, redacted payload |
|
|
173
|
+
|
|
174
|
+
## Historical Findings (before remediation)
|
|
175
|
+
|
|
176
|
+
The original finding list below is preserved as audit evidence. Current disposition:
|
|
177
|
+
|
|
178
|
+
| Finding | Current disposition |
|
|
179
|
+
|---|---|
|
|
180
|
+
| OAP-001 | Closed for user-facing decisions; raw EventBus remains only for streaming content/debug. |
|
|
181
|
+
| OAP-002 | Closed at adapter/reducer seam; vendor runtime remains unchanged. |
|
|
182
|
+
| OAP-003 | Closed by exhaustive `toPresentationEvent()` bridge. |
|
|
183
|
+
| OAP-004/OAP-005 | Closed by semantic collections and evidence-derived summaries. |
|
|
184
|
+
| OAP-006 | Closed by versioned machine envelopes. |
|
|
185
|
+
| OAP-007 | Closed by production durable rebuild. |
|
|
186
|
+
| OAP-008/OAP-013 | Closed by writer inventory, boundary checks, and documentation updates. |
|
|
187
|
+
| OAP-009/OAP-010/OAP-012 | Closed by canonical policy and semantic nodes. |
|
|
188
|
+
| OAP-011 | Proposed events remain explicit; no fabricated producer. |
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### Original finding register (historical)
|
|
192
|
+
|
|
193
|
+
| ID | Severity | Location | Problem | Recommendation |
|
|
194
|
+
|---|---|---|---|---|
|
|
195
|
+
| OAP-001 | P1 | `cli/setup.ts:642-655`, `transcript.ts:161-185`, `simple.ts:417-...`, `exec.ts:126-139` | Raw bus dan shadow presentation state adalah dua sumber kebenaran | Jadikan canonical projection satu-satunya feed renderer setelah parity gate |
|
|
196
|
+
| OAP-002 | P1 | `vendor/minicore/src/core/events.ts:5-14`, `executor.ts:40-74`, `session.ts:234-249` | Failure/abort/deny tidak selalu memiliki terminal event runtime | Pertahankan adapter rekonstruksi sebagai seam, tambahkan canonical settle event |
|
|
197
|
+
| OAP-003 | P1 | `cli/setup.ts:449-532`, `src/ui/contract.ts:144-174` | Bridge membuang model/reasoning/file/test/context events | Definisikan bridge total dengan default fail-safe dan diagnostic counter |
|
|
198
|
+
| OAP-004 | P1 | `src/presentation/model.ts:74-130`, `reducer.ts:391-400` | State tidak menyimpan reasoning/system/user/plan/finding secara lengkap | Tambahkan entry collections dan user/task semantic events |
|
|
199
|
+
| OAP-005 | P1 | `src/presentation/adapter.ts:294-302` | `turnSummary.filesChanged` selalu `0`; receipt tidak masuk summary | Hitung summary dari reducer/journal-derived state, bukan konstanta adapter |
|
|
200
|
+
| OAP-006 | P1 | `cli/commands/exec.ts:126-199`, `acp.ts:278-349` | Machine output bukan canonical protocol yang sama | Tambahkan schema/version/envelope dan mapper eksplisit |
|
|
201
|
+
| OAP-007 | P1 | `reducer.ts:441-483`, `cli/setup.ts:1029-1038` | Rebuild durable adalah helper test, belum menjadi jalur production | Simpan semantic durable log atau replay adapter dari session/journal saat resume |
|
|
202
|
+
| OAP-008 | P2 | `cli/index.ts`, `cli/setup.ts`, `cli/commands.ts`, `src/ui/approval/prompt.ts`, `src/ui/runtime/*` | Direct writes tersebar; policy stream tidak terpusat | Inventory writer dan routekan diagnostic/permanent output lewat sink |
|
|
203
|
+
| OAP-009 | P2 | `simple.ts:434-546`, `transcript.ts:183-186`, `acp.ts:260-268` | Visibility/verbose/normal state dihitung terpisah per surface | Buat policy projection bersama; renderer hanya berbeda pada layout |
|
|
204
|
+
| OAP-010 | P2 | `adapter.ts:125-135`, `simple.ts:597-615`, `transcript.ts:601-633` | Klasifikasi deny/fail tetap string/`isError` di beberapa jalur | Reduced satu canonical outcome, diagnostics fallback hanya di adapter |
|
|
205
|
+
| OAP-011 | P2 | `events.ts:164-263`, `adapter.ts:549-567` | Vocabulary punya event tanpa producer/consumer konsisten | Tandai proposed/unsupported eksplisit atau tambahkan producer/adapter |
|
|
206
|
+
| OAP-012 | P2 | `cli/tui.ts:675-689`, `src/ui/tui/transcript.ts:131-186` | User message, plan, dan finding tidak punya semantic event terpisah | Tambahkan `user.message`, plan nodes, evidence/finding nodes |
|
|
207
|
+
| OAP-013 | P2 | `docs/UI_RENDER_PIPELINE.md:112-116`, `PLAN.md:158-300` | Dokumentasi masih menyatakan tidak ada event yang diabaikan dan plan lama belum direkonsiliasi | Sinkronkan docs, plan, dan test coverage map sebelum remediation |
|
|
208
|
+
|
|
209
|
+
### Detail temuan
|
|
210
|
+
|
|
211
|
+
#### OAP-001 — P1 — Dua sumber kebenaran
|
|
212
|
+
|
|
213
|
+
**Evidence:** `cli/setup.ts:369-380` menyebut adapter dan shadow reducer;
|
|
214
|
+
`cli/setup.ts:642-655` menjalankan reducer dalam mode shadow. `Transcript` masih
|
|
215
|
+
subscribe langsung ke raw bus pada `src/ui/tui/transcript.ts:161-185`;
|
|
216
|
+
`attachSimpleLogger` masih memproses raw `provider:text`, `execution:*`, dan extension
|
|
217
|
+
pada `src/ui/assistant/simple.ts:417-763`; `exec` dan `ACP` juga menerima raw `*` pada
|
|
218
|
+
`cli/commands/exec.ts:131-139` dan `cli/commands/acp.ts:290-303`.
|
|
219
|
+
|
|
220
|
+
**Problem:** Presentation state direduksi sebagai pengamat, bukan authoritative
|
|
221
|
+
model. TUI/linear dapat memiliki buffer, status, dan urutan yang berbeda dari state.
|
|
222
|
+
|
|
223
|
+
**Impact:** Perubahan semantic event belum dapat di-push ke semua consumer
|
|
224
|
+
sekaligus; parity test hanya dapat membandingkan output, tidak menjamin state yang
|
|
225
|
+
sama.
|
|
226
|
+
|
|
227
|
+
**Recommendation:** Tetapkan fase migrasi berflag: pertahankan raw bus hanya untuk
|
|
228
|
+
runtime/debug, kirim semua user-facing surface melalui projection dari
|
|
229
|
+
`PresentationState`, lalu hapus shadow setelah golden parity.
|
|
230
|
+
|
|
231
|
+
**Update Phase 3–7:** keputusan ledger/summary/elapsed/label kini dari
|
|
232
|
+
`src/presentation/projection.ts` via injeksi `PresentationPolicy`
|
|
233
|
+
(`cli/tui.ts`, `cli/setup.ts`); parity test policy-vs-legacy hijau di
|
|
234
|
+
`test/presentation-projections.test.ts` dan `test/presentation-linear-acp.test.ts`.
|
|
235
|
+
Jalur raw ledger TUI dan rollback flag dihapus di Phase 8;
|
|
236
|
+
penghapusan menunggu satu rilis hijau (Phase 8).
|
|
237
|
+
|
|
238
|
+
#### OAP-002 — P1 — Lifecycle runtime tidak lengkap
|
|
239
|
+
|
|
240
|
+
**Evidence:** vendor event union hanya sembilan tipe
|
|
241
|
+
(`vendor/minicore/src/core/events.ts:5-14`); executor mengembalikan deny/unknown/validation
|
|
242
|
+
sebelum `execution:started` (`vendor/minicore/src/core/executor.ts:40-74`); session hanya
|
|
243
|
+
menerbitkan `turn:completed` setelah `executeTurn` sukses
|
|
244
|
+
(`vendor/minicore/src/core/session.ts:234-249`).
|
|
245
|
+
|
|
246
|
+
**Problem:** Deny, invalid, abort, timeout, dan failure tidak selalu memiliki
|
|
247
|
+
terminal event yang sama. Adapter harus membaca `step.completed`, permission hook,
|
|
248
|
+
dan `noteRunSettled()` untuk menutup gap.
|
|
249
|
+
|
|
250
|
+
**Impact:** Failure bisa hilang pada surface yang tidak memasang driver settle;
|
|
251
|
+
urutan terminal bisa berbeda antara TUI, linear, dan ACP.
|
|
252
|
+
|
|
253
|
+
**Recommendation:** Jadikan canonical event vocabulary tetap memuat task/tool
|
|
254
|
+
terminal states. Tambahkan seam adapter-only terlebih dahulu; kernel tidak perlu
|
|
255
|
+
diubah. Pastikan setiap user-visible execution memiliki tepat satu status final.
|
|
256
|
+
|
|
257
|
+
#### OAP-003 — P1 — Bridge partial
|
|
258
|
+
|
|
259
|
+
**Evidence:** `toPresentationEvent()` hanya menangani turn/tool/approval pada
|
|
260
|
+
`cli/setup.ts:449-532` dan mengembalikan `null` untuk model, reasoning, file,
|
|
261
|
+
test, context, dan diagnostic. `UiPresentationEvent` di
|
|
262
|
+
`src/ui/contract.ts:144-174` juga tidak mendeklarasikan event delta.
|
|
263
|
+
|
|
264
|
+
**Problem:** State shadow dapat memproses event yang tidak pernah sampai ke
|
|
265
|
+
consumer presentasi. TUI dan linear masih mengambil event tersebut dari raw bus.
|
|
266
|
+
|
|
267
|
+
**Impact:** `verbose`, `debug`, ACP lifecycle, resume, dan golden fixture tidak
|
|
268
|
+
menguji event yang sama.
|
|
269
|
+
|
|
270
|
+
**Recommendation:** Buat mapper exhaustive dengan exhaustive check dan counter
|
|
271
|
+
`unsupportedProjection`; mapper tidak boleh diam-diam membuang event yang
|
|
272
|
+
dinilai user-relevant.
|
|
273
|
+
|
|
274
|
+
#### OAP-004 — P1 — Model presentation belum lengkap
|
|
275
|
+
|
|
276
|
+
**Evidence:** `ReasoningEntry` dan `SystemEntry` dideklarasikan pada
|
|
277
|
+
`src/presentation/model.ts:74-97`, tetapi `PresentationState` hanya menyimpan
|
|
278
|
+
`conversation`, `turns`, `activities`, `approvals`, dan `order`
|
|
279
|
+
(`src/presentation/model.ts:119-130`). Reducer hanya menambahkan order ref untuk
|
|
280
|
+
reasoning/context (`src/presentation/reducer.ts:391-400`). Tidak ada user event;
|
|
281
|
+
user prompt masuk melalui `Transcript.pushUser()` di `cli/tui.ts:675-689`.
|
|
282
|
+
|
|
283
|
+
**Problem:** Model tidak dapat menjadi transcript semantic lengkap maupun
|
|
284
|
+
merepresentasikan plans/findings secara terpisah dari activity.
|
|
285
|
+
|
|
286
|
+
**Impact:** TUI, `/copy`, resume, dan machine projection harus tetap memiliki
|
|
287
|
+
buffer/parser tambahan.
|
|
288
|
+
|
|
289
|
+
**Recommendation:** Tambahkan `user.message`, `reasoning`, `system`, `plan`,
|
|
290
|
+
`finding`, dan `result` entries dengan lifecycle serta visibility. Reducer tetap
|
|
291
|
+
murni dan tidak menyimpan payload besar.
|
|
292
|
+
|
|
293
|
+
#### OAP-005 — P1 — Summary/receipt tidak truthful
|
|
294
|
+
|
|
295
|
+
**Evidence:** `turnSummary()` di `src/presentation/adapter.ts:294-302` selalu
|
|
296
|
+
mengisi `filesChanged: 0`; `file.changed` dipanggil dari
|
|
297
|
+
`cli/setup.ts:662-673`, tetapi `turn.completed` tidak membawa hasil agregasi
|
|
298
|
+
checkpoint. TUI memakai summary yang diterima melalui bridge pada
|
|
299
|
+
`src/ui/tui/transcript.ts:635-667`.
|
|
300
|
+
|
|
301
|
+
**Problem:** Evidence file yang sudah dijournal/checkpoint tidak masuk turn summary
|
|
302
|
+
yang dipakai TUI/ACP.
|
|
303
|
+
|
|
304
|
+
**Impact:** User dan IDE dapat melihat jumlah file berubah yang salah, sedangkan
|
|
305
|
+
receipt per activity mungkin benar.
|
|
306
|
+
|
|
307
|
+
**Recommendation:** Reducer menghitung summary setelah event file/test masuk;
|
|
308
|
+
adapter hanya memberikan metadata clock, bukan angka domain.
|
|
309
|
+
|
|
310
|
+
#### OAP-006 — P1 — Machine output tidak memakai satu protocol
|
|
311
|
+
|
|
312
|
+
**Evidence:** `exec --json` streaming raw `session.events("*")` pada
|
|
313
|
+
`cli/commands/exec.ts:126-139`; ACP juga subscribe raw pada
|
|
314
|
+
`cli/commands/acp.ts:290-303`, lalu menggabungkan text delta dan partial lifecycle.
|
|
315
|
+
|
|
316
|
+
**Problem:** `exec` tidak mempunyai canonical schema/version yang sama;
|
|
317
|
+
ACP bergantung pada keberadaan `onPresentationEvent` dan fallback legacy tool event.
|
|
318
|
+
|
|
319
|
+
**Impact:** Client harus menangani event raw, semantic event, dan summary dengan
|
|
320
|
+
bentuk berbeda. Perubahan internal dapat mengubah machine contract tanpa gate.
|
|
321
|
+
|
|
322
|
+
**Recommendation:** Buat mapper `machineProjection()` dari `DomainEvent`/snapshot;
|
|
323
|
+
exec dan ACP memakai envelope yang sama, dengan ACP JSON-RPC sebagai transport
|
|
324
|
+
wrapper. Tetap lakukan scrub dan test wire contract.
|
|
325
|
+
|
|
326
|
+
**Update Phase 6:** `toMachineEnvelope()` di `src/presentation/projection.ts`
|
|
327
|
+
menghasilkan `minicode.output.v1`; `exec --json` streaming envelope + summary
|
|
328
|
+
berversi + setup-failure selalu ber-envelope; ACP memetakan lifecycle penuh
|
|
329
|
+
(file/test/diagnostic/checkpoint/plan/finding/result/context) dengan framing
|
|
330
|
+
JSON-RPC yang sama. Legacy `type:"tool"` hanya bila lifecycle absen.
|
|
331
|
+
|
|
332
|
+
#### OAP-007 — P1 — Durable rebuild belum dipakai
|
|
333
|
+
|
|
334
|
+
**Evidence:** `rebuildFromDurable()` diimplementasikan pada
|
|
335
|
+
`src/presentation/reducer.ts:441-483` dan diuji pada
|
|
336
|
+
`test/presentation-reducer.test.ts:289-323`, tetapi tidak ditemukan call production;
|
|
337
|
+
`cli/setup.ts:1029-1038` hanya persist session messages/usage.
|
|
338
|
+
|
|
339
|
+
**Problem:** Setelah restart, presentation model tidak direkonstruksi dari semantic
|
|
340
|
+
lifecycle; yang ada adalah message/session persistence dan recovery text.
|
|
341
|
+
|
|
342
|
+
**Impact:** Status interrupted, approval close, summary, dan correlation historical
|
|
343
|
+
tidak dapat diverifikasi oleh renderer yang baru.
|
|
344
|
+
|
|
345
|
+
**Recommendation:** Pilih durable event log minimal (journal/session store),
|
|
346
|
+
serialize canonical events, dan rebuild saat `createCliSession`/resume. Delta tidak
|
|
347
|
+
perlu disimpan; final state harus.
|
|
348
|
+
|
|
349
|
+
#### OAP-008 — P2 — Direct-print policy tersebar
|
|
350
|
+
|
|
351
|
+
**Evidence:** Writes permanent/transient ada di `cli/index.ts:90-505`,
|
|
352
|
+
`cli/setup.ts:208-1036`, `cli/commands.ts:196-433`, approval
|
|
353
|
+
`src/ui/approval/prompt.ts:24-149`, `turn-status.ts`, `statusline.ts`, serta
|
|
354
|
+
popup/form/input modules.
|
|
355
|
+
|
|
356
|
+
**Problem:** `statusline.ts` melindungi transient owner dan interactive screen,
|
|
357
|
+
tetapi tidak menjadi semantic router untuk semua output.
|
|
358
|
+
|
|
359
|
+
**Impact:** Jalur setup/verify/manager baru dapat menulis ke stream yang salah atau
|
|
360
|
+
mencemari alt-screen/machine stream.
|
|
361
|
+
|
|
362
|
+
**Recommendation:** Buat writer registry/sink (`humanPermanent`, `humanDiagnostic`,
|
|
363
|
+
`machine`, `tui`) di composition root. Legacy direct writes boleh selama
|
|
364
|
+
diinventory dan diberi guard, tetapi tidak boleh menjadi jalur default baru.
|
|
365
|
+
|
|
366
|
+
#### OAP-009 — P2 — Visibility policy tidak seragam
|
|
367
|
+
|
|
368
|
+
**Evidence:** `simple.ts` menentukan `verbose`/answer visibility secara lokal;
|
|
369
|
+
`Transcript` hanya memiliki mode reasoning/minimize; `ACP` selalu meminta
|
|
370
|
+
`verbose: false` pada `cli/commands/acp.ts:260-268`; TUI dan linear tidak memakai
|
|
371
|
+
satu policy snapshot.
|
|
372
|
+
|
|
373
|
+
**Problem:** “normal”, “verbose”, “debug”, dan “machine” bukan satu konsep yang
|
|
374
|
+
dihasilkan dari model yang sama.
|
|
375
|
+
|
|
376
|
+
**Impact:** Tool status/receipt dapat muncul berbeda, dan debug dapat memilih
|
|
377
|
+
field yang tidak tersedia pada machine stream.
|
|
378
|
+
|
|
379
|
+
**Recommendation:** Definisikan `PresentationPolicy`/`ProjectionMode` bersama;
|
|
380
|
+
mode hanya memilih node/verbosity, bukan mengubah status runtime.
|
|
381
|
+
|
|
382
|
+
#### OAP-010 — P2 — Klasifikasi outcome masih stringly typed di beberapa jalur
|
|
383
|
+
|
|
384
|
+
**Evidence:** `adapter.ts:125-135` memakai `classifyToolResult`, `denyReasonOf`, dan
|
|
385
|
+
regex `mapToolFailCause`; `simple.ts:597-615` dan `transcript.ts:601-633` memakai
|
|
386
|
+
`result.isError`/text untuk status terminal.
|
|
387
|
+
|
|
388
|
+
**Problem:** Satu result dapat menjadi denied di adapter tetapi failed di raw sink
|
|
389
|
+
jika bentuk/urutan event berbeda.
|
|
390
|
+
|
|
391
|
+
**Impact:** Mode yang berbeda dapat menampilkan kategori error berbeda.
|
|
392
|
+
|
|
393
|
+
**Recommendation:** Canonical outcome hanya boleh lahir di adapter/kernel seam;
|
|
394
|
+
fallback string hanya diagnostics dan harus menghasilkan anomaly counter.
|
|
395
|
+
|
|
396
|
+
#### OAP-011 — P2 — Vocabulary memiliki event tanpa producer
|
|
397
|
+
|
|
398
|
+
**Evidence:** Phase 2 kini memiliki producer untuk `reasoning.completed`,
|
|
399
|
+
`plan.updated`, `finding.detected` dari `submit_result` terstruktur,
|
|
400
|
+
`result.produced`, `diagnostic.raised`, `test.completed` dari verify terstruktur,
|
|
401
|
+
dan `checkpoint.created`; hanya `tool.progress` yang masih ditandai proposed
|
|
402
|
+
karena live-only.
|
|
403
|
+
|
|
404
|
+
**Problem:** Tipe dan durability map menjanjikan event yang belum menjadi kontrak
|
|
405
|
+
produksi.
|
|
406
|
+
|
|
407
|
+
**Impact:** Test dapat lulus untuk event buatan sementara jalur nyata tidak pernah
|
|
408
|
+
menghasilkan event tersebut.
|
|
409
|
+
|
|
410
|
+
**Recommendation:** Tandai event sebagai `proposed`, `derived`, atau `runtime`; jangan
|
|
411
|
+
jadi aggregate bersama dengan lifecycle inti.
|
|
412
|
+
|
|
413
|
+
#### OAP-012 — P2 — User, plan, dan finding belum semantic
|
|
414
|
+
|
|
415
|
+
**Evidence:** Phase 2 kini memiliki `user.message`, plan object dari
|
|
416
|
+
`todo_write`, tipe `Finding` di model, dan producer `finding.detected` dari
|
|
417
|
+
`result.findings` eksplisit pada `submit_result`.
|
|
418
|
+
|
|
419
|
+
**Problem:** Activity, future work, dan evidence finding tidak dapat dipisahkan
|
|
420
|
+
sesuai prinsip output architecture.
|
|
421
|
+
|
|
422
|
+
**Impact:** Plan dapat disalahartikan sebagai replay aktivitas; normal mode tidak
|
|
423
|
+
tahu node mana yang actionable.
|
|
424
|
+
|
|
425
|
+
**Recommendation:** Tambahkan semantic nodes terpisah: `user.message`,
|
|
426
|
+
`plan.created/updated`, `finding.detected`, `result.produced`; tool tetap activity.
|
|
427
|
+
|
|
428
|
+
#### OAP-013 — P2 — Dokumentasi dan proteksi belum sinkron dengan aktual
|
|
429
|
+
|
|
430
|
+
**Evidence:** `docs/UI_RENDER_PIPELINE.md:112-116` menyatakan tidak ada event runtime
|
|
431
|
+
yang diabaikan UI, tetapi `cli/setup.ts:530-532` meng-drop event yang tidak
|
|
432
|
+
memiliki projection; `PLAN.md:158-300` masih menandai mouse selection belum
|
|
433
|
+
implementasikan.
|
|
434
|
+
|
|
435
|
+
**Problem:** Plan/document tidak lagi menjadi sumber status yang dapat dipercaya.
|
|
436
|
+
|
|
437
|
+
**Impact:** Agent berikutnya dapat mengulangi pekerjaan atau tidak menjalankan
|
|
438
|
+
remediation yang sebenarnya sudah ada.
|
|
439
|
+
|
|
440
|
+
**Recommendation:** Update plan/artifact links dan tambahkan test contract yang
|
|
441
|
+
memeriksa event coverage, bukan hanya output string.
|
|
442
|
+
|
|
443
|
+
## Rekomendasi arsitektur
|
|
444
|
+
|
|
445
|
+
Target yang direkomendasikan:
|
|
446
|
+
|
|
447
|
+
```text
|
|
448
|
+
Agent Runtime
|
|
449
|
+
↓
|
|
450
|
+
Semantic Event Boundary
|
|
451
|
+
├─ durable semantic events
|
|
452
|
+
└─ live deltas/progress
|
|
453
|
+
↓
|
|
454
|
+
Pure Reducer → PresentationState + ContentRef
|
|
455
|
+
↓
|
|
456
|
+
Policy Projection (normal | verbose | debug | machine)
|
|
457
|
+
├─ TUI renderer
|
|
458
|
+
├─ Linear renderer
|
|
459
|
+
├─ exec JSONL projection
|
|
460
|
+
├─ ACP projection
|
|
461
|
+
└─ future web/API
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
Prinsip yang dipertahankan:
|
|
465
|
+
|
|
466
|
+
- `vendor/minicore/**` tetap frozen; seam adapter cukup untuk fase awal.
|
|
467
|
+
- `PresentationState` menyimpan status/correlation/receipt refs, bukan terminal state
|
|
468
|
+
atau payload besar.
|
|
469
|
+
- Renderer hanya memilih layout dan interaksi; tidak menginfer status dari teks.
|
|
470
|
+
- Sanitasi/depth/wrapping/ownership terminal tetap menjadi gerbang terakhir.
|
|
471
|
+
- Migrasi staged dan dapat dibalik dengan flag; tidak melakukan flag-day rewrite.
|
|
472
|
+
|
|
473
|
+
## Validation gate untuk audit ini
|
|
474
|
+
|
|
475
|
+
- [x] Pipeline runtime → raw bus → adapter → reducer → consumer ditelusuri.
|
|
476
|
+
- [x] TUI, linear, exec, ACP, approval, diagnostics, clipboard diinventaris.
|
|
477
|
+
- [x] Event vocabulary dan output mode dibandingkan dengan producer aktual.
|
|
478
|
+
- [x] Temuan memiliki severity, evidence, problem, impact, recommendation.
|
|
479
|
+
- [ ] Canonical projection dan remediation belum diimplementasikan pada artefak ini.
|
|
480
|
+
- [ ] Resume/replay production, parity test, dan golden machine fixtures masih
|
|
481
|
+
menjadi pekerjaan fase berikutnya.
|
|
482
|
+
|
|
483
|
+
## Deliverable berikutnya
|
|
484
|
+
|
|
485
|
+
- Model event: `docs/OUTPUT_EVENT_MODEL.md`
|
|
486
|
+
- Protocol/mode/stream: `docs/OUTPUT_PROTOCOL_SPEC.md`
|
|
487
|
+
- Renderer boundary: `docs/OUTPUT_RENDERING_SPEC.md`
|
|
488
|
+
- UX grammar: `docs/OUTPUT_UX_RULES.md`
|
|
489
|
+
- Migration plan: `docs/OUTPUT_IMPLEMENTATION_PLAN.md`
|