minicode-ai 0.14.6 → 0.20.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.
Files changed (142) hide show
  1. package/README.md +6 -4
  2. package/cli/args.ts +20 -8
  3. package/cli/commands/exec.ts +17 -14
  4. package/cli/commands/openwork.ts +1 -1
  5. package/cli/commands.ts +39 -23
  6. package/cli/index.ts +29 -7
  7. package/cli/model-manager.ts +1 -1
  8. package/cli/router.ts +22 -9
  9. package/cli/setup.ts +77 -35
  10. package/cli/tui.ts +179 -25
  11. package/docs/CONTROL-PLANE-MAP.md +7 -5
  12. package/docs/OUTPUT_EVENT_MODEL.md +4 -3
  13. package/docs/OUTPUT_PROTOCOL_SPEC.md +1 -1
  14. package/docs/OUTPUT_RENDERING_SPEC.md +16 -4
  15. package/docs/OUTPUT_UX_RULES.md +38 -32
  16. package/docs/P14_OPEN_WORK.md +290 -0
  17. package/docs/README.md +1 -1
  18. package/docs/SUMMARY.md +36 -22
  19. package/docs/TERMINAL_CONTRACT.md +89 -17
  20. package/docs/UI_RENDER_PIPELINE.md +47 -8
  21. package/docs/agents.md +1 -1
  22. package/docs/architecture.md +10 -8
  23. package/docs/autonomous-scheduler.md +142 -0
  24. package/docs/choosing-mode.md +4 -2
  25. package/docs/cli.md +11 -9
  26. package/docs/concepts.md +5 -5
  27. package/docs/config-providers.md +3 -3
  28. package/docs/config.md +1 -1
  29. package/docs/contributing.md +7 -9
  30. package/docs/environment.md +8 -5
  31. package/docs/getting-started.md +5 -5
  32. package/docs/mcp-lsp.md +2 -2
  33. package/docs/memory-sessions.md +3 -3
  34. package/docs/policy-sandbox.md +7 -4
  35. package/docs/pricing-budget.md +3 -3
  36. package/docs/quickstart.md +1 -1
  37. package/docs/repl.md +11 -8
  38. package/docs/security-model.md +4 -2
  39. package/docs/security.md +9 -8
  40. package/docs/skills.md +2 -2
  41. package/docs/terminal.md +10 -2
  42. package/docs/tools.md +4 -4
  43. package/docs/troubleshooting.md +3 -3
  44. package/docs/verify-benchmark.md +0 -3
  45. package/package.json +9 -18
  46. package/scripts/vendor-overlays/minicode-context.patch +1 -1
  47. package/src/app/mentions.ts +1 -1
  48. package/src/app/rag-layer.ts +11 -2
  49. package/src/app/session.ts +128 -10
  50. package/src/constants.ts +32 -1
  51. package/src/daemon/client.ts +11 -6
  52. package/src/daemon/control.ts +2 -9
  53. package/src/daemon/resource.ts +5 -4
  54. package/src/hooks/run.ts +5 -6
  55. package/src/lib/keystore.ts +11 -9
  56. package/src/lib/net.ts +8 -3
  57. package/src/lib/safe-open.ts +29 -5
  58. package/src/lib/trusted-exec.ts +4 -1
  59. package/src/lsp/client.ts +9 -10
  60. package/src/mcp/http-transport.ts +1 -1
  61. package/src/mcp/server.ts +17 -7
  62. package/src/memory/files.ts +2 -1
  63. package/src/memory/vector.ts +25 -16
  64. package/src/policy/bash-guard.ts +58 -16
  65. package/src/policy/bpe.ts +110 -0
  66. package/src/policy/compaction.ts +139 -22
  67. package/src/policy/consequence-engine.ts +3 -3
  68. package/src/policy/context-window.ts +43 -1
  69. package/src/policy/context.ts +50 -12
  70. package/src/policy/jail.ts +48 -3
  71. package/src/policy/no-progress.ts +15 -8
  72. package/src/policy/permission.ts +243 -5
  73. package/src/policy/tokenizer-registry.ts +104 -0
  74. package/src/policy/usage.ts +20 -13
  75. package/src/policy/verifier.ts +7 -4
  76. package/src/policy/work-mode.ts +9 -5
  77. package/src/presentation/adapter.ts +8 -4
  78. package/src/presentation/events.ts +2 -2
  79. package/src/presentation/label.ts +3 -3
  80. package/src/presentation/model.ts +4 -0
  81. package/src/presentation/projection.ts +10 -2
  82. package/src/presentation/store.ts +2 -2
  83. package/src/providers/anthropic.ts +13 -3
  84. package/src/providers/responses.ts +16 -6
  85. package/src/runtime/capability.ts +22 -4
  86. package/src/runtime/child-execution.ts +1 -1
  87. package/src/runtime/composition.ts +5 -5
  88. package/src/runtime/execution-journal.ts +13 -7
  89. package/src/runtime/execution-registry.ts +1 -1
  90. package/src/runtime/production-execution.ts +7 -6
  91. package/src/runtime/production-runtime.ts +2 -2
  92. package/src/runtime/runtime-capabilities.ts +1 -1
  93. package/src/runtime/runtime-status-facts.ts +1 -1
  94. package/src/runtime/runtime-task-admission.ts +2 -2
  95. package/src/sandbox/os.ts +4 -3
  96. package/src/session/checkpoint.ts +29 -4
  97. package/src/session/context-assembly.ts +8 -1
  98. package/src/session/context-identity.ts +2 -2
  99. package/src/session/context-projection.ts +36 -11
  100. package/src/session/persistence.ts +22 -11
  101. package/src/task/autonomous-context.ts +2 -3
  102. package/src/task/autonomous-policy.ts +3 -3
  103. package/src/task/model.ts +2 -2
  104. package/src/task/production-scheduler.ts +2 -2
  105. package/src/task/scheduler-observability.ts +1 -0
  106. package/src/task/scheduler.ts +3 -2
  107. package/src/task/scheduling-policy.ts +2 -1
  108. package/src/task/trigger.ts +5 -5
  109. package/src/tools/git.ts +22 -4
  110. package/src/tools/lsp.ts +10 -8
  111. package/src/tools/read_image.ts +2 -1
  112. package/src/tools/task.ts +1 -1
  113. package/src/tools/web_fetch.ts +6 -2
  114. package/src/tools/web_search.ts +2 -1
  115. package/src/ui/assistant/simple.ts +42 -33
  116. package/src/ui/contract.ts +4 -0
  117. package/src/ui/footer.ts +63 -12
  118. package/src/ui/i18n/en.ts +14 -2
  119. package/src/ui/i18n/id.ts +14 -2
  120. package/src/ui/input/prompt-engine.ts +36 -10
  121. package/src/ui/render/cells.ts +320 -0
  122. package/src/ui/render/composer-wrap.ts +73 -0
  123. package/src/ui/render/detail.ts +2 -2
  124. package/src/ui/render/diff.ts +14 -5
  125. package/src/ui/render/highlight.ts +4 -4
  126. package/src/ui/render/ledger.ts +47 -0
  127. package/src/ui/render/markdown.ts +12 -5
  128. package/src/ui/render/session-summary.ts +50 -0
  129. package/src/ui/render/table-grid.ts +134 -6
  130. package/src/ui/render/theme.ts +49 -4
  131. package/src/ui/render/width.ts +91 -4
  132. package/src/ui/render/wrap.ts +5 -3
  133. package/src/ui/runtime/screen.ts +100 -22
  134. package/src/ui/runtime/statusline.ts +26 -0
  135. package/src/ui/screens/model-manager.ts +1 -1
  136. package/src/ui/session-state.ts +27 -1
  137. package/src/ui/tui/app.ts +336 -65
  138. package/src/ui/tui/transcript.ts +335 -104
  139. package/vendor/minicore/VENDOR.md +16 -12
  140. package/vendor/minicore/src/core/events.ts +1 -0
  141. package/vendor/minicore/src/core/loop.ts +11 -1
  142. package/vendor/minicore/src/core/session.ts +39 -0
@@ -38,8 +38,8 @@ RESULT
38
38
  Tidak semua task membutuhkan semua section. Short task boleh:
39
39
 
40
40
  ```text
41
- ✓ Updated src/router.ts
42
- ✓ Tests passed
41
+ Updated src/router.ts
42
+ Tests passed
43
43
 
44
44
  Done.
45
45
  ```
@@ -66,13 +66,13 @@ AUDIT
66
66
  ### Activity
67
67
 
68
68
  ```text
69
- ✓ Analyzed 18 files
69
+ Analyzed 18 files
70
70
  ```
71
71
 
72
72
  ### Active operation
73
73
 
74
74
  ```text
75
- ◌ Analyzing source files…
75
+ › Analyzing source files…
76
76
  ```
77
77
 
78
78
  ### Warning
@@ -85,7 +85,7 @@ AUDIT
85
85
  ### Error
86
86
 
87
87
  ```text
88
- ✕ Build failed
88
+ Build failed
89
89
  TypeScript compilation failed in src/app.ts.
90
90
  → Fix the reported errors and retry.
91
91
  ```
@@ -113,20 +113,26 @@ Plan hanya future work. “Read file”, “run grep”, dan “think” adalah
113
113
  ### Completion
114
114
 
115
115
  ```text
116
- ✓ Audit complete · 18 files · 42s
116
+ Audit complete · 18 files · 42s
117
117
  ```
118
118
 
119
119
  ## 3. Status vocabulary
120
120
 
121
+ Sejak v0.17.0 ikon status (`✓`/`✗`/`⊘`/`◌`) DIHAPUS — `glyphs.check/cross/denied/circle`
122
+ mengembalikan `""` (`src/ui/render/theme.ts`) karena bising dan tak konsisten antar
123
+ terminal. Status kini disampaikan lewat WARNA + kata; operasi aktif memakai chevron
124
+ `›` (lihat `TERMINAL_CONTRACT.md` invariant #1). Contoh di dokumen ini sudah mengikuti
125
+ format tanpa ikon status.
126
+
121
127
  | Status | Glyph | Teks default | Arti |
122
128
  |---|---|---|---|
123
- | active | `◌` / `›` | `running` atau `active` | operasi masih berjalan |
124
- | completed | `✓` | `completed` | sukses terminal |
129
+ | active | `›` | `running` atau `active` | operasi masih berjalan |
130
+ | completed | — | `completed` | sukses terminal |
125
131
  | warning | `⚠` | `warning` | perlu perhatian, belum terminal failure |
126
- | failed | `✗` | `failed` | operasi/turn gagal |
127
- | denied | `⊘` | `denied` | policy/permission menolak |
128
- | cancelled | `⊘` | `cancelled` | dibatalkan user/system |
129
- | interrupted | `!` | `interrupted` | proses berhenti sebelum terminal |
132
+ | failed | — | `failed` | operasi/turn gagal |
133
+ | denied | — | `denied` | policy/permission menolak |
134
+ | cancelled | — | `cancelled` | dibatalkan user/system |
135
+ | interrupted | — | `interrupted` | proses berhenti sebelum terminal |
130
136
  | retrying | `↻` | `retrying` | recovery sedang berjalan |
131
137
  | transition | `→` | `next` | tindakan berikutnya |
132
138
  | info | `ℹ` | `info` | informasi non-actionable |
@@ -196,27 +202,27 @@ Satu baris ledger default:
196
202
  Completion:
197
203
 
198
204
  ```text
199
- ✓ read_file src/config.ts
205
+ read_file src/config.ts · completed
200
206
  ```
201
207
 
202
208
  Failure:
203
209
 
204
210
  ```text
205
- ✗ read_file src/config.ts
211
+ read_file src/config.ts · failed
206
212
  File does not exist.
207
213
  ```
208
214
 
209
215
  Denial:
210
216
 
211
217
  ```text
212
- ⊘ bash
218
+ bash · denied
213
219
  Permission denied by mode=plan.
214
220
  ```
215
221
 
216
222
  Receipt:
217
223
 
218
224
  ```text
219
- ✓ write_file src/router.ts · 1 file · 34ms
225
+ write_file src/router.ts · 1 file · 34ms
220
226
  ```
221
227
 
222
228
  ### Parallel
@@ -224,20 +230,20 @@ Receipt:
224
230
  Jangan interleave raw output. Kelompokkan:
225
231
 
226
232
  ```text
227
- ◌ Analyzing 11 source files…
233
+ › Analyzing 11 source files…
228
234
 
229
- ✓ app.ts
230
- ✓ config.ts
231
- ✓ index.ts
232
- ✓ router.ts
235
+ app.ts
236
+ config.ts
237
+ index.ts
238
+ router.ts
233
239
  …
234
- ✓ Source analysis complete · 11 files
240
+ Source analysis complete · 11 files
235
241
  ```
236
242
 
237
243
  Untuk batch besar:
238
244
 
239
245
  ```text
240
- ✓ Analyzed 11 files
246
+ Analyzed 11 files
241
247
  ```
242
248
 
243
249
  ### Retry
@@ -264,15 +270,15 @@ Processing…
264
270
  Dihindari. Gunakan:
265
271
 
266
272
  ```text
267
- ◌ Reading 18 files…
268
- ◌ Running tests…
269
- ◌ Applying migration…
273
+ › Reading 18 files…
274
+ › Running tests…
275
+ › Applying migration…
270
276
  ```
271
277
 
272
278
  Untuk long-running tool:
273
279
 
274
280
  ```text
275
- ◌ Running integration tests… (2m 14s)
281
+ › Running integration tests… (2m 14s)
276
282
  ```
277
283
 
278
284
  Progress yang tidak berubah setelah stall dapat menjadi warning/timeout sesuai policy;
@@ -284,7 +290,7 @@ linear memakai transient heartbeat, dan machine memakai duration/status field.
284
290
  Activity:
285
291
 
286
292
  ```text
287
- ✓ Read src/app.ts
293
+ Read src/app.ts · completed
288
294
  ```
289
295
 
290
296
  Finding:
@@ -332,7 +338,7 @@ Kategori minimum:
332
338
  Error example:
333
339
 
334
340
  ```text
335
- ✕ Provider request failed
341
+ Provider request failed
336
342
  Rate limit reached while running the model.
337
343
  → Retry after the provider cooldown, or choose another provider.
338
344
  ```
@@ -347,13 +353,13 @@ Cancellation harus punya state, bukan hanya hilang:
347
353
  ```text
348
354
  ↻ Cancelling…
349
355
 
350
- ✓ Task cancelled
356
+ Task cancelled
351
357
  ```
352
358
 
353
359
  Timeout:
354
360
 
355
361
  ```text
356
- ✕ Operation timed out after 15m
362
+ Operation timed out after 15m
357
363
  → Retry with a smaller scope or increase the timeout.
358
364
  ```
359
365
 
@@ -368,7 +374,7 @@ Recovery:
368
374
 
369
375
  ```text
370
376
  ↻ Provider unavailable; retrying with fallback…
371
- ✓ Recovered using fallback provider.
377
+ Recovered using fallback provider.
372
378
  ```
373
379
 
374
380
  TUI harus mencegah live stream/foreign painter menimpa state terminal. Linear harus
@@ -0,0 +1,290 @@
1
+ # Open Work — Pekerjaan Lintas Sesi
2
+
3
+ Panduan operasi untuk pekerjaan belum selesai lintas sesi (P14). Semua yang
4
+ dijelaskan di sini memakai mekanisme otoritas yang SUDAH ADA — TaskStore tetap
5
+ satu-satunya otoritas status; tidak ada TaskStore/queue/scheduler kedua.
6
+
7
+ Panduan ini menjelaskan surface Open Work yang tersedia. Batasannya meliputi
8
+ ekstraksi intent dari prosa bebas, readout TUI `/openwork`, merge dengan
9
+ lease/admission, dan merge lintas sesi tanpa adopsi eksplisit.
10
+
11
+ ## Gambaran alur
12
+
13
+ ```
14
+ minicode openwork ① TEMUKAN (read-only, lintas sesi)
15
+ minicode openwork inventory ①b AUDIT (inventaris P14.0 lintas sumber)
16
+ minicode openwork context --session S --task tN
17
+ ①c SUSUN KONTEKS (P14.5, tanpa eksekusi)
18
+ minicode --session <target> \
19
+ --adopt-task <source>/<taskId> "..." ② ADOPSI (eksplisit, otoritas ganda)
20
+ /scheduler run ③ LANJUTKAN (manual, lewat gate continuity)
21
+ (minimum satu turn) ④ KERJAKAN (claim = generasi BARU)
22
+ minicode openwork --closed ⑤ TUTUP (feedback berprovenance)
23
+ minicode openwork export --out FILE ⑤b EKSPOR (json/md, atomik)
24
+ minicode openwork merge ... ⑥ DEDUP (eksplisit + evidence)
25
+ ```
26
+
27
+ ## ① Menemukan: `minicode openwork`
28
+
29
+ Portofolio read-only seluruh task non-terminal di **workspace ini** (tasks.db
30
+ memang per-workspace — sesi proyek lain memang tidak terlihat, itu batas yang
31
+ benar, bukan bug), **ditambah** kandidat intent terstruktur dari histori
32
+ (lihat "Kandidat intent" di bawah).
33
+
34
+ ```
35
+ Open Work — 1 item(s) · 1 intent · 1 stale · 0 unknown-provenance
36
+ workspace: D:\proyek · stale after 7d · TaskStore remains the sole status authority
37
+
38
+ p14ow-source/t1 · IN_PROGRESS · PARTIAL · P2 · 2d old
39
+ title: Fix login bug
40
+ flags: STALE · FROM:p14ow-source · SIMILAR×2(UNPROVEN)
41
+ blockers: TASK_BLOCKED: API key rotated
42
+ depends on: t2 (PENDING, unsatisfied)
43
+ next: resume: rebuild context from provenance, then continue via TaskStore/Scheduler
44
+ ```
45
+
46
+ Arti bidang:
47
+
48
+ | Bidang | Makna |
49
+ |---|---|
50
+ | `status` | status kanonik TaskStore — **satu-satunya otoritas** |
51
+ | state (kolom ke-4) | state P14.1 berbasis bukti: `OPEN/PARTIAL/BLOCKED/WAITING_FOR_USER/DELEGATED/FAILED_NEEDS_FOLLOWUP/UNKNOWN`; verifikasi gagal → FAILED_NEEDS_FOLLOWUP, dependensi tak tuntas → BLOCKED |
52
+ | `P0..P3` | prioritas presentasi: BLOCKED/FAILED=P0, WAITING/DELEGATED/UNKNOWN=P1, PARTIAL=P2, OPEN=P3; item STALE dinaikkan satu tingkat — umur sinyal, bukan bukti |
53
+ | `blockers:` | blocker eksplisit (TASK_BLOCKED / DEPENDENCY / VERIFICATION); kosong = tidak ada yang diklaim |
54
+ | `depends on:` | dependensi kanonik direkonsiliasi ke status saat baca; hanya COMPLETED yang *satisfied* |
55
+ | `next:` | tindak lanjut eksplisit — selalu lewat jalur otoritas yang ada; openwork TIDAK PERNAH mengeksekusi |
56
+
57
+ Arti penanda:
58
+
59
+ | Penanda | Makna | Tindak lanjut |
60
+ |---|---|---|
61
+ | `STALE` | baris tak bergerak ≥ ambang (default 7 hari, `--stale-days <n>`) | prioritas, bukan keputusan otoritas |
62
+ | `PROVENANCE-UNKNOWN` | tidak ada baris sesi di sessions.db — asal tak bisa ditelusuri | periksa manual; jangan dianggap rusak |
63
+ | `FROM:<sesi>` | task ini DIPINDAHKAN dari sesi lain (ledger `task_transfers`) | provenance asal eksplisit |
64
+ | `SIMILAR×N(UNPROVEN)` | N task berbagi judul ternormalisasi | **bukan bukti duplikat** — lihat ⑥ |
65
+ | `DUP-GROUP×N(UNPROVEN)` | grup duplikat **lintas sesi** (task + intent) beranggota N | lihat seksi "Grup duplikat lintas sesi" |
66
+
67
+ Filter: `--session <id>`, `--status <S>`, `--state <S>`, `--priority <P0..P3>`,
68
+ `--min-age-days <n>`, `--blocked`, `--depends-on <taskId>`, `--closed`,
69
+ `--json` (satu objek JSON mesin di stdout). Exit: `0` sukses (termasuk daftar
70
+ kosong), `1` gagal runtime/lookup, `2` salah pakai (nilai enum tak dikenal
71
+ termasuk).
72
+
73
+ **Batas kejujuran:** `openwork` tidak pernah menulis apa pun — tidak
74
+ mengakuisisi lease, tidak membuat sessions.db, tidak menulis backup manifest
75
+ korup, tidak memicu scheduler. Ia indeks, bukan otoritas. (Dijaga guard
76
+ arsitektur + tes nol-mutasi, kini termasuk jalur inventaris.)
77
+
78
+ ## Kandidat intent: histori terstruktur, TANPA menebak prosa
79
+
80
+ Portofolio juga menampilkan **kandidat intent open** dari histori yang
81
+ terstruktur dan durable:
82
+
83
+ | Sumber | Kapan jadi kandidat | State |
84
+ |---|---|---|
85
+ | `plan.updated` | langkah plan `pending`/`active`/`blocked` **tanpa** task kanonik (atau baris task-nya hilang) | OPEN / PARTIAL / BLOCKED |
86
+ | `approval.requested` | belum ada `approval.settled` | WAITING_FOR_USER |
87
+ | sesi anak sub-agent | belum ada hasil terminal | DELEGATED |
88
+ | sesi anak + `turn.failed` | delegasi gagal | FAILED_NEEDS_FOLLOWUP |
89
+ | run `INTERRUPTED` | eksekusi terputus (restart/kill) | FAILED_NEEDS_FOLLOWUP |
90
+
91
+ Yang SENGAJA tidak dilakukan: memindai isi pesan bebas pengguna. Janji dari
92
+ prosa ("nanti kita perbaiki login") TIDAK PERNAH menjadi tugas — roadmap P14
93
+ melarang menganggap brainstorming sebagai task, dan menentukan kapan intent
94
+ prosa jadi komitmen adalah keputusan produk yang belum diputuskan pemilik.
95
+
96
+ Aturan kejujuran ekstraksi (dijaga tes):
97
+
98
+ 1. Langkah plan yang menunjuk task kanonik yang masih OPEN **menempel sebagai
99
+ bukti** di entri task (`plan evidence`), bukan item duplikat.
100
+ 2. Langkah plan yang mengaku `active` atas task yang SUDAH terminal tidak
101
+ dihidupkan kembali — masuk closure dengan alasan "canonical task
102
+ <status> supersedes plan claim", konflik diungkap, bukan disembunyikan.
103
+ 3. Approval yang di-**allow** bukan bukti pekerjaan selesai — tidak
104
+ menghasilkan kandidat apa pun (hanya deny yang menghasilkan DECLINED).
105
+ 4. Run `RUNNING` bukan open loop — runtime hidup adalah kondisi normal.
106
+ 5. Cakupan pencarian dibatasi binding `cwd` baris sesi; **sesi anak mewarisi
107
+ cakupan leluhur termulaiannya** (hasil sub-agent tetap terlihat); sesi
108
+ tanpa binding dilabel UNBOUND dan dikeluarkan — tidak ada yang ditebak.
109
+ 6. `plan.updated` adalah **snapshot**, bukan delta: adaptor menerbitkannya setiap
110
+ `todo_write` sukses dengan SELURUH daftar langkah. Hanya snapshot TERAKHIR
111
+ per **sesi** yang dibaca (bukan per `planId` — `planId` memuat nomor turn,
112
+ sedangkan daftar todo milik sesi). Akibatnya: versi pending/active lama tidak
113
+ muncul sebagai open loop kedua, langkah yang dihapus dari daftar tidak
114
+ dihidupkan, dan langkah yang masih terbuka tidak berganda di setiap turn.
115
+
116
+ ## Grup duplikat lintas sesi (P14.3 penuh)
117
+
118
+ Kandidat dengan judul ternormalisasi sama **lintas sesi** (termasuk task vs
119
+ langkah plan) dikelompokkan dan diungkapkan:
120
+
121
+ ```
122
+ Similar groups — 1 (UNPROVEN, never auto-merged)
123
+ "fix login bug" ×2 across 2 session(s) · DIVERGENT states
124
+ sessions: p14fs-a · p14fs-b
125
+ ```
126
+
127
+ Grup dengan state yang saling bertentangan ditandai `DIVERGENT` (jumlahnya
128
+ juga di header + `counts.conflicts`). Grup **tidak pernah** menyatukkan apa
129
+ pun: perpindahan otoritas tetap wajib adopsi eksplisit (②), merge tetap
130
+ satu-sesi (⑥). Tugas berulang yang sengaja independen boleh berbagi grup —
131
+ itu penanda untuk diperiksa, bukan vonis.
132
+
133
+ ## ①b Inventaris: `minicode openwork inventory [--json]`
134
+
135
+ Inventaris P14.0 lintas sumber, read-only: jumlah sesi (in-scope / foreign /
136
+ unbound / anak), task (total/open/terminal), event presentasi per tipe, run,
137
+ manifest checkpoint (termasuk yang **corrupt** — dilabel, tidak dibackup oleh
138
+ proyeksi), langkah plan, approval, dan hasil sub-agent. Sesi yang dikeluarkan
139
+ dicantumkan **dengan alasannya**. Event yang gagal didekode dilaporkan sebagai
140
+ "unreadable", tidak disembunyikan.
141
+
142
+ ## ①c Konteks: `minicode openwork context --session <id> --task <taskId>`
143
+
144
+ Context pack P14.5 untuk satu task: field kanonik (status/revisi/verification/
145
+ dependsOn/evidence), state + prioritas + blocker + next action, bukti langkah
146
+ plan, ketersediaan checkpoint (termasuk corrupt), provenance transfer/merge,
147
+ freshness, dan **checklist resume**. Pack ini murni baca — checklist menunjuk
148
+ jalur yang MEMAKSAK otoritas saat resume (ceiling P12, gate continuity P13.3,
149
+ claim generation TaskStore, budget/cancellation P12/P13); openwork sendiri
150
+ tidak memeriksa apalagi mengeksekusi. Exit `1` bila task tak ditemukan,
151
+ `2` bila id cacat.
152
+
153
+ ## ② Mengadopsi: `--adopt-task <source>/<taskId>`
154
+
155
+ Satu task per invokasi, HANYA saat startup sesi tujuan, sebelum turn pertama:
156
+
157
+ ```
158
+ minicode --session target --adopt-task p14ow-source/t1 "lanjutkan pekerjaan ini"
159
+ ```
160
+
161
+ Yang terjadi (satu transaksi TaskStore, dicek ulang di dalam transaksi):
162
+ inkarnasi sumber+tujuan, revisi, **kedua lease** (token sumber dan tujuan),
163
+ status non-terminal, konsistensi lineage, tabrakan id target, dan provenance
164
+ relasi. Penulis sesi sumber yang **hidup** = `REFUSED_SOURCE_BUSY` (tidak ada
165
+ takeover paksa). Lease sumber kedaluwarsa = takeover + **fence epoch** —
166
+ proses lama tidak bisa lagi renew/release/menulis/menjadwalkan sesi sumber.
167
+
168
+ Yang TIDAK terjadi: tidak menyalin task, tidak membuat generasi baru, tidak
169
+ menandai selesai, tidak menyentuh jurnal runtime/child run/approval, dan
170
+ **tidak memicu scheduler**. Task in-flight hasil adopsi tetap `IN_PROGRESS`
171
+ dengan lineage asli — apakah boleh dilanjutkan adalah keputusan gate (③),
172
+ bukan adopsi.
173
+
174
+ Rantai relasi diadopsi **berurutan** (parent/dependency dulu, lalu anak);
175
+ penolakan menamai id yang belum diadopsi. Id task tidak pernah direnumber.
176
+
177
+ ## ③ Melanjutkan: `/scheduler run` (manual, tersupervisi)
178
+
179
+ Adopsi tidak menyalakan scheduler. Lanjutan tetap lewat trigger manual yang
180
+ sudah ada (`/scheduler run` di sesi TUJUAN; butuh `--enable-scheduler` saat
181
+ memulai sesi CLI, sedangkan sesi daemon hosted mendapatkannya via
182
+ `--runtime owned`). Reconcilasi menilai task in-flight hasil
183
+ adopsi lewat **continuity gate P13.3** — kontraknya tidak berubah:
184
+
185
+ - `SAFE_TO_RETRY` (bukti resume + admission + **seluruh** scope tool otonom
186
+ read-only) → revert ke PENDING → **claim generasi BARU** → dispatch serial.
187
+ - Selain itu → `HOLD` / `REQUIRES_VERIFIER`, baris tidak disentuh, nol
188
+ dispatch. Tanpa gate = HOLD (fail-closed).
189
+
190
+ **Tidak pernah ada replay instruksi tool jurnal lama** — work item hanya
191
+ membawa `(taskId, title, instruction, sessionId)`; eksekusi baru lahir dari
192
+ claim baru. Permission ceiling P12, budget, cancellation, dan stop criteria
193
+ P13 tetap berlaku persis seperti sesi biasa.
194
+
195
+ ## ④ Menutup: lifecycle biasa
196
+
197
+ Selesaian lewat jalur kanonik yang sudah ada (verifier / `todo_write` /
198
+ operator) — P14 tidak punya jalur penutupan sendiri dan tidak pernah
199
+ menulis `COMPLETED` atas nama operator.
200
+
201
+ ## ⑤ Feedback penutupan: `minicode openwork --closed`
202
+
203
+ Closure feedback adalah **pembacaan ulang status kanonik + ledger**, bukan
204
+ kesimpulan: task yang sudah terminal dan punya provenance P14 (transfer
205
+ atau merge) muncul dengan `status`, `closed`, `FROM <sesi>`,
206
+ `duplicate-of <task>`, dan evidence operator. Duplikat yang dibuka kembali
207
+ operator otomatis muncul lagi di seksi open — status saat itulah kebenaran.
208
+
209
+ Sejak pengiriman full-scope, closure juga mencakup **artefak intent terminal**
210
+ (`kind INTENT`) dengan **label klaim** yang wajib dibaca:
211
+
212
+ | `claim` | Arti |
213
+ |---|---|
214
+ | `verified` | task kanonik terminal dengan `verification.verdict = passed` |
215
+ | `unverified` | klaim penyelesaian oleh artefak (mis. plan step `completed`) **tanpa** verifikasi — ditampilkan apa adanya, BUKAN disembunyikan, BUKAN dianggap terbukti |
216
+ | `not-applicable` | DECLINED/CANCELLED — tidak ada klaim penyelesaian untuk diverifikasi |
217
+
218
+ Termasuk: approval yang ditolak pengguna → `DECLINED` (terminal, tidak pernah
219
+ hidup lagi sebagai open loop), dan langkah plan yang mengaku `active` atas task
220
+ terminal → closure dengan alasan "canonical task `<status>` supersedes plan
221
+ claim" — konflik klaim diungkap, tidak ditelan.
222
+
223
+ ## ⑤b Ekspor: `minicode openwork export --out <path> [--format json|md] [--force]`
224
+
225
+ - `json` (default) — objek portofolio lengkap (selalu menyertakan inventaris
226
+ P14.0), indentasi 2 spasi.
227
+ - `md` — laporan manusia tersanitasi (judul/evidence bebas sekuens ANSI).
228
+ - Ditulis **atomik** (`atomicWriteText`); **menolak menimpa** berkas yang ada
229
+ kecuali `--force`; kegagalan tulis = exit `1` tanpa berkas sampah `.tmp.*`.
230
+
231
+ ## ⑥ Dedup eksplisit: `openwork merge`
232
+
233
+ ```
234
+ minicode openwork merge --session target --keep t1 --drop t2 \
235
+ --evidence "satu unit kerja yang sama: sama-sama memperbaiki login bug"
236
+ ```
237
+
238
+ Aturan (dijaga tes + guard):
239
+
240
+ 1. **Evidence WAJIB** dan direkam utuh di ledger append-only `task_merges`.
241
+ Kemiripan judul TIDAK PERNAH menjadi bukti; `SIMILAR×N(UNPROVEN)` hanyalah
242
+ penanda. Tidak ada merge otomatis dari proyeksi.
243
+ 2. Duplikat ditutup **`CANCELLED`, bukan `COMPLETED`** — menyatakan "dikerjakan
244
+ di task lain" tidak boleh meng-inferr penyelesaian.
245
+ 3. Penulisan status lewat `patchTask` (lifecycle biasa: revisi maju, ownership
246
+ in-flight dilepas) + INSERT ledger dalam **SATU transaksi** — gagal ledger =
247
+ status ikut rollback.
248
+ 4. Duplikat terminal ditolak (pekerjaan tertutup tidak dibuka untuk ditutup
249
+ lagi). Survivor terminal BOLEH (kasus klasik: pending ternyata sudah
250
+ dikerjakan task yang selesai — duplikat tetap CANCELLED).
251
+ 5. **Antar-sesi ditolak**: merge hanya satu namespace. Duplikat lintas sesi
252
+ harus diadopsi dulu (②), lalu merge di sesi tujuan.
253
+ 6. Pembalikan = penulisan lifecycle biasa (patch status kembali). Ledger
254
+ append-only tetap mencatat deklarasi — audit sejarah, status = kebenaran.
255
+
256
+ ## Peta bukti
257
+
258
+ | Klaim | Bukti |
259
+ |---|---|
260
+ | Proyeksi read-only (nol mutasi) | `test/p14-open-work.test.ts` (proyeksi nol-mutasi) |
261
+ | Nol mutasi jalur PENUH (histori + inventaris ikut diuji; tanpa backup manifest korup) | `test/p14-full-scope.test.ts` (zero-mutasi proyeksi penuh) |
262
+ | UNKNOWN/stale dilabel jujur | `test/p14-open-work.test.ts` (provenance UNKNOWN tanpa membuat sessions.db; STALE ambang disuntik) |
263
+ | Kemiripan bukan identitas | idem (SIMILAR UNPROVEN, ambiguous tetap terpisah) |
264
+ | Grup duplikat LINTAS SESI + konflik divergent, tanpa merge otomatis | `test/p14-full-scope.test.ts` (P14.3 grup lintas sesi) |
265
+ | Kontrak P14.1: state/prioritas/next action murni + fail-closed | idem (P14.1 kontrak murni) |
266
+ | Ekstraksi intent: approval allow ≠ COMPLETED; pesan bebas tak dipindai; cakupan lineage | idem (P14.2 extractIntentCandidates) |
267
+ | Klaim plan atas task terminal: tak dihidupkan, konflik diungkap, label claim verified/unverified | idem (P14.2 proyeksi histori) |
268
+ | Inventaris P14.0 lintas sumber + sesi dikeluarkan dengan alasan | idem (P14.0 inventaris) |
269
+ | Matriks forensik: restart/terputus/pembatalan/stale | idem (P14.6 matriks forensik) |
270
+ | Portofolio: blocker/dependensi/verifikasi/next action | idem (P14.4 bidang portofolio) |
271
+ | CLI: filter baru, inventory, context, export atomik + sanitasi | idem (CLI full-scope; exit 0/1/2 sesuai I28) |
272
+ | Merge aman/auditable/atomic | `test/p14-open-work.test.ts` (DECLARED/refusal/terminal/stale/atomic-rollback/pembalikan) |
273
+ | Alur ①→⑤ utuh, generasi baru, tanpa replay | idem (P14.5 alur operator) |
274
+ | Adopsi: otoritas ganda, fence, ledger transfer | `test/p14-cross-session-adoption.test.ts` (14 skenario) |
275
+ | Guard "bukan TaskStore/scheduler kedua" + proyeksi murni | `test/p2-architecture-guards.test.ts` |
276
+ | Kontrak penulis CLI (OAP-008) | `test/writer-inventory.test.ts` (deklarasi per writer) |
277
+ | Snapshot `plan.updated` dikolaps per sesi (tanpa duplikasi riwayat) | `test/p14-full-scope.test.ts` (5 tes snapshot plan) |
278
+
279
+ ## Batas scope yang TIDAK diklaim
280
+
281
+ Dokumen ini sengaja tidak menjanjikan hal-hal berikut; semuanya eksklusi
282
+ scope P14 yang disetujui pemilik 2026-10-26, bukan pekerjaan tertunda:
283
+
284
+ | Tidak ada | Alasan |
285
+ |---|---|
286
+ | Ekstraksi intent dari prosa bebas | Dilarang eksplisit oleh roadmap ("jangan anggap setiap pesan brainstorming sebagai tugas") |
287
+ | Readout TUI `/openwork` | Teks milestone hanya "tampilkan/ekspor"; permukaan TUI baru butuh kontrak terminal sendiri |
288
+ | Merge dengan lease/admission | Di luar teks milestone; merge tetap satu transaksi + ledger audit |
289
+ | Merge lintas sesi tanpa adopsi eksplisit | Model otoritas roadmap: portfolio = projection, perubahan task lewat jalur authority |
290
+ | Klaim release-ready | Closure P14 hanya untuk kontrak bukti-terstruktur; limitasi P13 tetap berlaku dan tree masih uncommitted |
package/docs/README.md CHANGED
@@ -16,7 +16,7 @@ MiniCode adalah coding agent terminal yang dibangun di atas kernel MiniCore. Jal
16
16
 
17
17
  ## Peta dokumentasi
18
18
 
19
- `SUMMARY.md` adalah daftar navigasi yang dibaca generator situs. Untuk referensi terbit, buka [Dokumentasi](/docs/). [Arsitektur](architecture.md) memuat peta struktur dan alur runtime.
19
+ `SUMMARY.md` adalah daftar navigasi; dibaca build minilabs untuk membangun indeks halaman. Versi terbit tersedia di [minilabs.id/projects/minicode/docs](https://minilabs.id/projects/minicode/docs/). [Arsitektur](architecture.md) memuat peta struktur dan alur runtime.
20
20
 
21
21
  ## Pengembangan
22
22
 
package/docs/SUMMARY.md CHANGED
@@ -1,53 +1,67 @@
1
1
  # Summary
2
2
 
3
- * [Minicode — Dokumentasi](README.md)
3
+ * [MiniCode — Dokumentasi](README.md)
4
4
 
5
5
  ## Memulai
6
6
 
7
- * [Konsep & Desain](concepts.md)
8
7
  * [Instalasi](getting-started.md)
9
8
  * [Quickstart 5 menit](quickstart.md)
9
+ * [Konsep & Desain](concepts.md)
10
+ * [Memilih Mode](choosing-mode.md)
10
11
  * [Glosarium](glossary.md)
11
12
 
12
13
  ## Menggunakan
13
14
 
14
15
  * [CLI — Mode & Flags](cli.md)
15
- * [Memilih Mode](choosing-mode.md)
16
16
  * [TUI — Slash & Keyboard](repl.md)
17
17
  * [Otomasi & CI](exec.md)
18
- * [Config — File & Lokasi Data](config.md)
19
- * [Config & Provider](config-providers.md)
20
- * [Pricing & Budget](pricing-budget.md)
21
- * [Environment Variables](environment.md)
22
18
  * [Skills & Hooks](skills.md)
19
+ * [Pricing & Budget](pricing-budget.md)
23
20
 
24
- ## Referensi
21
+ ## Kemampuan (tools & integrasi)
25
22
 
26
23
  * [Tools](tools.md)
27
24
  * [Sub-Agents & Tasks](agents.md)
28
25
  * [MCP & LSP](mcp-lsp.md)
26
+
27
+ ## Konfigurasi
28
+
29
+ * [Config — File & Lokasi Data](config.md)
30
+ * [Config & Provider](config-providers.md)
31
+ * [Environment Variables](environment.md)
32
+
33
+ ## State & Memori
34
+
29
35
  * [Memory & Sessions](memory-sessions.md)
30
36
  * [Verify & Benchmark](verify-benchmark.md)
31
37
 
32
38
  ## Keamanan
33
39
 
34
- * [Security Model](security-model.md)
35
- * [Policy & Sandbox](policy-sandbox.md)
36
- * [Keamanan](security.md)
40
+ * [Security Model](security-model.md) — ancaman & trust boundary
41
+ * [Policy & Sandbox](policy-sandbox.md) — mode, guard, sandbox
42
+ * [Keamanan](security.md) — mekanisme & bukti pengukuran
43
+
44
+ ## Bantuan
45
+
37
46
  * [Troubleshooting](troubleshooting.md)
38
47
 
39
- ## Kontribusi & Arsitektur
48
+ ## Eksperimental
49
+
50
+ * [Autonomous Scheduler](autonomous-scheduler.md)
51
+ * [Open Work — Lintas Sesi](P14_OPEN_WORK.md)
52
+
53
+ ## Kontributor & Arsitektur
40
54
 
41
- * [Arsitektur](architecture.md)
42
- * [Kontrak Terminal](terminal.md)
55
+ * [Arsitektur & Peta Repository](architecture.md)
56
+ * [Kontrak Terminal (ringkas)](terminal.md)
43
57
  * [Contributing](contributing.md)
44
58
 
45
- ## Internal & Arsitektur (untuk kontributor)
59
+ ## Spesifikasi internal (FROZEN — untuk kontributor)
46
60
 
47
- * [Terminal Contract (FROZEN) — 35 invariant, v7.7](TERMINAL_CONTRACT.md)
48
- * [Output Event Model — taksonomi dan lifecycle](OUTPUT_EVENT_MODEL.md)
49
- * [Output Protocol Spec — stream dan machine contract](OUTPUT_PROTOCOL_SPEC.md)
50
- * [Output Rendering Spec — boundary renderer](OUTPUT_RENDERING_SPEC.md)
51
- * [Output UX Rules — grammar human-facing](OUTPUT_UX_RULES.md)
52
- * [Control Plane — kontrak context/budget/compaction](CONTROL-PLANE-MAP.md)
53
- * [UI Render Pipeline — jalur stream ke terminal](UI_RENDER_PIPELINE.md)
61
+ * [Terminal Contract - 35 invariant, v7.12](TERMINAL_CONTRACT.md)
62
+ * [Output Event Model](OUTPUT_EVENT_MODEL.md)
63
+ * [Output Protocol Spec](OUTPUT_PROTOCOL_SPEC.md)
64
+ * [Output Rendering Spec](OUTPUT_RENDERING_SPEC.md)
65
+ * [Output UX Rules](OUTPUT_UX_RULES.md)
66
+ * [Control Plane Map](CONTROL-PLANE-MAP.md)
67
+ * [UI Render Pipeline](UI_RENDER_PIPELINE.md)