minicode-ai 0.22.0 → 0.25.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/README.md +2 -2
- package/cli/commands.ts +10 -0
- package/cli/index.ts +11 -0
- package/cli/setup.ts +64 -33
- package/cli/tui.ts +29 -3
- package/docs/README.md +2 -2
- package/docs/SUMMARY.md +10 -19
- package/docs/TERMINAL_CONTRACT.md +119 -32
- package/docs/architecture.md +1 -1
- package/docs/autonomous-scheduler.md +283 -2
- package/docs/choosing-mode.md +4 -4
- package/docs/concepts.md +39 -3
- package/docs/config.md +90 -4
- package/docs/environment.md +6 -0
- package/docs/getting-started.md +58 -2
- package/docs/repl.md +1 -1
- package/docs/security.md +49 -2
- package/docs/tools.md +2 -1
- package/package.json +2 -36
- package/src/app/provider-layer.ts +1 -1
- package/src/app/session.ts +129 -20
- package/src/config.ts +102 -2
- package/src/constants.ts +32 -4
- package/src/lib/safe-open.ts +21 -12
- package/src/memory/vector.ts +0 -31
- package/src/policy/compaction.ts +27 -0
- package/src/policy/context-budget.ts +132 -0
- package/src/policy/context-escalation.ts +140 -0
- package/src/policy/context-window.ts +14 -9
- package/src/policy/context.ts +10 -1
- package/src/policy/microcompact.ts +162 -0
- package/src/policy/no-progress.ts +1 -1
- package/src/policy/permission.ts +5 -0
- package/src/policy/scrub.ts +15 -2
- package/src/policy/tool-contract.ts +11 -9
- package/src/presentation/reducer.ts +1 -0
- package/src/providers/anthropic.ts +17 -3
- package/src/providers/detect.ts +155 -13
- package/src/providers/provision.ts +92 -1
- package/src/providers/responses.ts +13 -1
- package/src/session/persistence.ts +56 -0
- package/src/task/autonomous-policy.ts +7 -0
- package/src/task/graph-validate.ts +1 -1
- package/src/task/session-authority.ts +0 -5
- package/src/task/store.ts +0 -4
- package/src/tools/ask_user.ts +14 -1
- package/src/tools/bash.ts +57 -9
- package/src/tools/context.ts +10 -0
- package/src/tools/delete_file.ts +3 -2
- package/src/tools/edit.ts +5 -4
- package/src/tools/git.ts +70 -12
- package/src/tools/glob.ts +13 -5
- package/src/tools/grep.ts +26 -10
- package/src/tools/index.ts +3 -2
- package/src/tools/lsp.ts +15 -9
- package/src/tools/move_file.ts +4 -3
- package/src/tools/patch.ts +5 -4
- package/src/tools/read_file.ts +3 -2
- package/src/tools/read_image.ts +3 -2
- package/src/tools/task.ts +1 -0
- package/src/tools/todo.ts +4 -8
- package/src/tools/write_file.ts +4 -3
- package/src/ui/approval/prompt.ts +226 -77
- package/src/ui/assistant/simple.ts +1 -1
- package/src/ui/footer.ts +41 -29
- package/src/ui/i18n/en.ts +23 -4
- package/src/ui/i18n/id.ts +25 -4
- package/src/ui/input/input.ts +2 -2
- package/src/ui/render/activity-group.ts +1 -0
- package/src/ui/render/activity-panel.ts +21 -3
- package/src/ui/render/hint.ts +28 -0
- package/src/ui/render/ledger.ts +1 -9
- package/src/ui/render/logo.ts +86 -0
- package/src/ui/render/markdown-table.ts +0 -3
- package/src/ui/render/session-summary.ts +22 -1
- package/src/ui/render/table-grid.ts +0 -3
- package/src/ui/render/theme.ts +36 -5
- package/src/ui/runtime/screen.ts +11 -3
- package/src/ui/screens/dialog.ts +45 -81
- package/src/ui/screens/form.ts +29 -33
- package/src/ui/screens/lifecycle.ts +80 -0
- package/src/ui/screens/model-manager.ts +84 -91
- package/src/ui/screens/picker.ts +36 -33
- package/src/ui/screens/provider-manager.ts +50 -59
- package/src/ui/screens/watchdog.ts +27 -0
- package/src/ui/screens/wizard.ts +3 -20
- package/src/ui/tui/app.ts +97 -11
- package/src/ui/tui/transcript.ts +55 -16
- package/vendor/minicore/src/core/compact.ts +10 -0
- package/vendor/minicore/src/core/errors.ts +11 -1
- package/vendor/minicore/src/core/executor.ts +6 -1
- package/vendor/minicore/src/core/loop.ts +92 -2
- package/vendor/minicore/src/core/session.ts +8 -0
- package/vendor/minicore/src/providers/openai-compat.ts +15 -2
- package/docs/P14_OPEN_WORK.md +0 -290
- package/docs/config-providers.md +0 -87
- package/docs/glossary.md +0 -39
- package/docs/quickstart.md +0 -60
- package/docs/security-model.md +0 -96
- package/docs/terminal.md +0 -91
package/docs/P14_OPEN_WORK.md
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
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/config-providers.md
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Config & Provider
|
|
2
|
-
|
|
3
|
-
## 15 preset gateway (termasuk Custom URL)
|
|
4
|
-
|
|
5
|
-
`Gateway >` hanya menampilkan `[0] Label` tanpa URL (minimalis, tanpa bocor endpoint).
|
|
6
|
-
|
|
7
|
-
| id | Label | Catatan |
|
|
8
|
-
|---|---|---|
|
|
9
|
-
| `openai` | OpenAI | gpt, o-series |
|
|
10
|
-
| `anthropic` | Anthropic | Claude, streaming `tool_use` |
|
|
11
|
-
| `openrouter` | OpenRouter | Gateway 75+ model |
|
|
12
|
-
| `deepseek` | DeepSeek | chat/reasoner |
|
|
13
|
-
| `opencode-zen` | OpenCode Zen | Gateway |
|
|
14
|
-
| `google` | Google Gemini | Konteks 1M, `thought_signature` pass-through |
|
|
15
|
-
| `ollama` | Ollama | Lokal, gratis, tanpa key |
|
|
16
|
-
| `qwen` | Qwen | Alibaba Qwen3-Coder (satu-satunya dengan spec OAuth terdaftar) |
|
|
17
|
-
| `groq` | Groq | Inferensi cepat |
|
|
18
|
-
| `together` | Together AI | Model terbuka |
|
|
19
|
-
| `fireworks` | Fireworks AI | — |
|
|
20
|
-
| `mistral` | Mistral AI | — |
|
|
21
|
-
| `cohere` | Cohere | — |
|
|
22
|
-
| `generic` | OpenAI-compatible umum | vLLM / LM Studio |
|
|
23
|
-
| `custom` | Custom URL | Pseudo-preset untuk baseUrl sendiri |
|
|
24
|
-
|
|
25
|
-
Alur: wizard & `/provider` (add `[0] OpenAI` … `[14] Custom URL`) → API key ter-masking → auto-detect models via `GET /models` timeout 4 dtk → provider otomatis pindah saat pilih model beda provider (tanpa restart, via `reloadProviders()` setelah `Gateway >2`).
|
|
26
|
-
|
|
27
|
-
## Dua jalur autentikasi
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
# 1. API key
|
|
31
|
-
minicode config add --baseUrl https://api.openai.com/v1 --apiKey sk-…
|
|
32
|
-
|
|
33
|
-
# 2. OAuth device-code (tanpa API key, tanpa kartu kredit) — RFC 8628
|
|
34
|
-
minicode auth list # provider yang mendukung
|
|
35
|
-
minicode auth login qwen # kode singkat → buka URL → tunggu persetujuan
|
|
36
|
-
minicode auth status # kredensial + kapan kedaluwarsa
|
|
37
|
-
minicode auth logout qwen
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Token di `~/.minicode/auth.json` (chmod 600), bukan `config.json`. Refresh otomatis margin 60 dtk. Provider OAuth yang belum login dibuang dari daftar dengan peringatan, bukan dikirim dengan header kosong.
|
|
41
|
-
|
|
42
|
-
> Kejujuran: device flow teruji lengkap ke server OAuth lokal (pending/slow_down/denied/expired/clamp), tapi endpoint/clientId provider belum semua terkonfirmasi live. `auth login chatgpt` fail-fast di non-TTY. Jangan baca token aplikasi desktop orang lain — itu pencurian kredensial.
|
|
43
|
-
|
|
44
|
-
## Keyring OS (ganti plaintext config)
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
minicode config set-key openrouter # pindah API key ke OS store, config tinggal referensi
|
|
48
|
-
minicode config delete-key openrouter # lupakan (provider nonaktif sampai di-set ulang)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Windows memakai DPAPI user-scope (hanya user ini yang bisa membuka); selain itu berkas chmod 600 dengan label jujur `plain-file` (bukan keyring). Referensi hilang/rusak = provider di-skip dengan peringatan (fail-closed, seperti OAuth). Matikan paksa via `MINICODE_KEYSTORE_DISABLE=1`.
|
|
52
|
-
|
|
53
|
-
## Model & thinking effort
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
/model [cari] → picker provider::model, bisa difilter
|
|
57
|
-
Enter → pilih model (+ picker effort bila modelnya mendukung)
|
|
58
|
-
Esc → batal total
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Effort tersimpan di `ProviderEntry.reasoningEffort`, berlaku sesi berikutnya, tampil badge `[low|medium|high]`. **Default universal = omit** (tanpa param thinking): default bawaan tiap model sudah di-tune vendornya. Knob hanya dikirim ke keluarga terbukti, dalam bahasa native-nya: OpenAI reasoning (`o1`/`o3`/`o4`, `gpt-5`/`gpt-6` → `reasoning_effort`, level tervalidasi per model — pro = high saja); Claude ≤4.5 → budget `1024/2048/4096`; Claude ≥4.6/5 → adaptive + `output_config.effort`. **Selain itu tak pernah dikirimi param thinking** (DeepSeek, Gemini, Groq, Ollama, free-tier, custom). Bila model menolak param (400/500), request diulang sekali tanpa param + diingat per sesi + dicatat `[thinking]` di stderr. Picker effort hanya muncul untuk model yang mendukung; sisanya select langsung tanpa menyentuh effort tersimpan. `detectAndSave`/`auth login` mempertahankan effort (tidak reset diam-diam). Mutasi ditulis ke file scope asal (bukan hasil merge) agar tidak duplikat/shadowing.
|
|
62
|
-
|
|
63
|
-
Model override sekali jalan:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
minicode --model providerId::modelName "prompt"
|
|
67
|
-
minicode --provider openai "prompt"
|
|
68
|
-
minicode models --match gemini
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
`MINICODE_PROVIDER_ORDER=openai,anthropic,deepseek` mengurutkan provider agnostik tanpa edit config.
|
|
72
|
-
|
|
73
|
-
## Pin eksplisit `provider::model` (kontrak)
|
|
74
|
-
|
|
75
|
-
Model berformat `providerId::modelName` = PIN: request hanya ke provider
|
|
76
|
-
itu — **tanpa fallback lintas provider dan tanpa substitusi diam-diam**.
|
|
77
|
-
Gagal = error jujur dari provider yang dipilih (limit/saldo/error server),
|
|
78
|
-
user memilih model lanjutannya sendiri via `/model`. Alasan: fallback
|
|
79
|
-
otomatis pernah melempar user dari model gratis ke model berbayar provider
|
|
80
|
-
lain (tagihan tak terduga). Model bare (tanpa `::`) tetap perilaku lama
|
|
81
|
-
(first-match + substitusi + fallback rate_limit/server/network).
|
|
82
|
-
|
|
83
|
-
## Build & router
|
|
84
|
-
|
|
85
|
-
Build provider terpusat di `src/providers/build.ts`. Router fallback untuk rate_limit/server/network (clone-error + base64 fix + retryAfter cap). Deteksi wire dari probe path `/responses` → hint `responses`; substring host hanya fallback. `max_tokens` 8192; stop `length` = peringatan eksplisit, bukan teks sunyi.
|
|
86
|
-
|
|
87
|
-
Responses API: `/v1/responses`, `previous_response_id` chaining per model, `store:false` default.
|
package/docs/glossary.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Glosarium
|
|
2
|
-
|
|
3
|
-
Istilah Minicode yang punya makna spesifik. Dokumentasi berbahasa Indonesia dengan istilah teknis English — halaman ini mengunci maknanya.
|
|
4
|
-
|
|
5
|
-
| Istilah | Makna |
|
|
6
|
-
|---|---|
|
|
7
|
-
| **MiniCore** | Kernel runtime `STATE / MODEL / ACTION / LOOP` di-vendor ke `vendor/minicore`; inti beku, zero-dep, di-resolve via `#minicore` |
|
|
8
|
-
| **Minicode** | Layer agencode di atas MiniCore: tools, agents, policy, providers, memory, sessions, CLI |
|
|
9
|
-
| **Tool** | Kemampuan yang dipilih model dalam loop ReAct; tool MCP dapat ditambahkan dinamis sebagai `serverId.toolName` |
|
|
10
|
-
| **Tool scope** | `full` atau subset read-only `explore` — flag `--tool-scope` |
|
|
11
|
-
| **WorkMode** | Cara agent bekerja: `DISCUSS`, `PLAN`, atau `BUILD` (alias produk untuk identitas internal `EXECUTE`) |
|
|
12
|
-
| **PermissionMode** | Pilihan pengawasan: `AUTO` menjalankan capability yang diotorisasi; `ASK` meminta persetujuan untuk aksi yang digate |
|
|
13
|
-
| **Tool Access Policy** | Batas capability yang tersedia, seperti read-only, allowlist, atau profil akses warisan `--allow-all` |
|
|
14
|
-
| **Gate** | Tool wajib persetujuan manusia saat TTY; non-TTY selalu tolak (mis. `git_commit`, MCP, `delegate_task`) |
|
|
15
|
-
| **Path jail** | Pembatasan akses file ke workspace (realpath + symlink; `O_NOFOLLOW` pada POSIX dan pencocokan identitas handle `dev+ino` pada semua platform); aktif bahkan `--allow-all` |
|
|
16
|
-
| **Bash-guard** | Normalisasi + blokir pola bash berbahaya sebelum eksekusi (quote-split, indirection, wrapper) |
|
|
17
|
-
| **Sandbox OS** | bubblewrap (Linux) / seatbelt (macOS) — otomatis bila tersedia |
|
|
18
|
-
| **Sandbox Docker** | Container ephemeral `--network none`, 512m, 1 CPU, `node:22-alpine` |
|
|
19
|
-
| **Checkpoint** | Snapshot per turn via shadow-git: SHA tree di `refs/minicode/…` (O(delta), HEAD/index tak tersentuh) |
|
|
20
|
-
| **Recovery journal** | `journal-<sesi>.jsonl`: `pending` → `committed`/`failed`/`unknown`; finalisasi menandai cakupan turn yang sudah durable |
|
|
21
|
-
| **Session** | Riwayat tersimpan di `.minicode/sessions.db` (SQLite WAL); kompaksi dapat mengganti bagian lama dengan ringkasan + tail |
|
|
22
|
-
| **Memory dua lapis** | `MEMORY.md` hierarki (selalu ke system prompt) + vector RAG hybrid (injeksi bila skor ≥ ambang) |
|
|
23
|
-
| **RAG hybrid** | Pencarian memory cosine 0.7 + keyword 0.3, ranking MMR (λ 0.7), dedup >0.92 |
|
|
24
|
-
| **Repo-map** | Simbol per file (regex 9 bahasa, fallback LSP) disuntik ke system prompt |
|
|
25
|
-
| **Skill** | Prompt terpaket `.minicode/skills/*.md` dengan frontmatter `name`/`description` |
|
|
26
|
-
| **Hook** | Skrip `pre/post-run` dari `~/.minicode/hooks` + `.minicode/hooks`; mati default, `MINICODE_HOOKS=1` |
|
|
27
|
-
| **Env scrub** | `sanitizeSpawnEnv` menghapus kata-kunci kredensial dari env subprocess |
|
|
28
|
-
| **Secret scrubber** | Redaksi `sk-`/`ghp_`/`AKIA`/PEM/JWT/Bearer sebelum teks ke LLM |
|
|
29
|
-
| **Ledger** | Baris ` › name target` / ` › name: …` di stderr — jejak aksi agent |
|
|
30
|
-
| **Scrollback** | Riwayat layar terminal; jalur non-interaktif minicode append-only di sana (interaktif pakai alternate screen) |
|
|
31
|
-
| **Transient** | UI muncul-sekali yang menghapus dirinya (spinner, garis status turn) — vs transkrip yang menetap |
|
|
32
|
-
| **Composition root** | `cli/index.ts` + `cli/setup.ts`: satu tempat wiring DI (provider, RAG, session, tools) |
|
|
33
|
-
| **Seam aditif** | Satu-satunya patch yang dibolehkan ke kernel beku: `compactAsync`, `initialMessages`, `cwd` |
|
|
34
|
-
| **Self-contained** | Tanpa clone repo lain — kernel di-vendor, runtime zero-dep, butuh Bun ≥ 1.1.13 |
|
|
35
|
-
|
|
36
|
-
## Lanjut
|
|
37
|
-
|
|
38
|
-
- [Konsep & Desain](concepts.md) — narasi di balik istilah.
|
|
39
|
-
- [Arsitektur](architecture.md) — bagaimana lapisan-lapisan itu tersusun.
|
package/docs/quickstart.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Quickstart 5 menit
|
|
2
|
-
|
|
3
|
-
Tujuan: dari nol sampai prompt pertama yang ter-verify, tanpa membaca seluruh manual.
|
|
4
|
-
|
|
5
|
-
## 1. Jalan pertama (1 menit)
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
minicode
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Bila belum ada provider, wizard setup muncul. Isi berurutan: pilih gateway → tempel API key (ter-masking) → auto-detect models. Wizard memakai picker (panah + filter), bukan `readline` nomor — mengetik di luar rentang tidak lagi diam-diam memilih `[0]`.
|
|
12
|
-
|
|
13
|
-
Alternatif tanpa API key:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
minicode auth login # device-code: kode singkat + URL, setujui di browser
|
|
17
|
-
minicode auth status # lihat kredensial + kapan kedaluwarsa
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## 2. Prompt pertama (2 menit)
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
minicode --work-mode BUILD "buat http server hello world di server.ts" --verbose
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Yang terjadi: model menerima system prompt berisi `# Environment` (cwd + platform) + repo-map ringkas, lalu loop ReAct `Thought → Action → Observation` sampai jawaban final atau batas (`--max-steps` default 50, `--timeout` default 1 jam).
|
|
27
|
-
|
|
28
|
-
Coba mode interaktif:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
minicode --interactive
|
|
32
|
-
# minicode › jelaskan isi src/tools/index.ts
|
|
33
|
-
# /model → picker provider::model, Enter = pilih + atur effort
|
|
34
|
-
# /status → token + biaya kumulatif sesi
|
|
35
|
-
# /exit → keluar (Esc ganda saat abort juga bisa)
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## 3. Verify otomatis (2 menit)
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
minicode --work-mode BUILD --verify "fix bugs lalu typecheck"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Sebelum agen jalan, baseline diuji dulu. Bila baseline sudah merah, catatan Health-Check ditempel ke prompt awal agar agen memperbaiki dulu. Setelah run, verify dijalankan; bila gagal, agen self-heal maks 3 siklus. Output error dibungkus fence agar tidak jadi prompt injection. Custom command via `MINICODE_VERIFY_CMD` atau `verifyCommand` di config.
|
|
45
|
-
|
|
46
|
-
## Contoh pola harian
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
minicode --ask "deploy script" # human-in-loop confirmation card
|
|
50
|
-
minicode --sandbox docker "task" # bash di container ephemeral
|
|
51
|
-
minicode --budget 0.50 "task besar" # warn 80%; pagu lewat → prompt baru ditolak + turn berjalan digugurkan
|
|
52
|
-
minicode exec "prompt" --json # headless CI: JSONL stream + summary
|
|
53
|
-
minicode "/review src/a.ts" # skill slash-command
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Berikutnya
|
|
57
|
-
|
|
58
|
-
- [CLI](cli.md) untuk semua mode + flags.
|
|
59
|
-
- [TUI](repl.md) untuk slash command dan keyboard.
|
|
60
|
-
- [Config & Provider](config-providers.md) untuk pindah gateway dan model.
|
package/docs/security-model.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
# Security Model
|
|
2
|
-
|
|
3
|
-
Model ancaman Minicode dalam satu halaman: apa yang dikontrol, apa yang dipercaya, dan apa batasnya. Tanpa kata "aman" absolut — setiap klaim di bawah menunjuk ke mekanisme yang bisa Anda baca dan uji.
|
|
4
|
-
|
|
5
|
-
## Prinsip
|
|
6
|
-
|
|
7
|
-
Minicode mengontrol **kemampuan bertingkat** (layered capability control), bukan niat model. Model boleh salah paham; yang menentukan apa yang benar-benar terjadi adalah gerbang deterministik di bawahnya: izin → jail → guard → validasi → eksekusi → bukti.
|
|
8
|
-
|
|
9
|
-
## Execution Chain
|
|
10
|
-
|
|
11
|
-
Setiap pemanggilan tool melewati rantai ini, berurutan:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
Permission → Jail → Bash Guard → Argument Validation → Executor → Journal / Recovery
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
| Tahap | Fungsi |
|
|
18
|
-
|---|---|
|
|
19
|
-
| **Permission** | Mode izin (`src/policy/permission.ts`) memutuskan allow/deny/ask per pasangan tool+args. Berlaku SEBELUM efek apa pun. |
|
|
20
|
-
| **Jail** | Path di luar workspace, symlink keluar, file sensitif (`.env`, `.git/config`), dan state milik minicode (`.minicode/*.db`, todos, jurnal, config) ditolak — **bahkan di `--allow-all`** (kecuali mode `unrestricted`, lihat §Mode dan akses di bawah). |
|
|
21
|
-
| **Bash Guard** | Perintah shell dinormalisasi dulu (buang quote/wrapper/variabel sederhana), baru diperiksa polanya. Menolak env-dump, exfiltrasi upload, interpreter inline, destruksi luas. |
|
|
22
|
-
| **Argument Validation** | Skema argumen divalidasi kernel sebelum eksekusi; argumen invalid ditolak tanpa efek. |
|
|
23
|
-
| **Executor** | Menjalankan yang lolos: read paralel, write dibatasi konkurensinya, abort-aware, output dipotong dengan penanda (tak pernah diam-diam). |
|
|
24
|
-
| **Journal / Recovery** | Tiap mutasi dicatat sebagai `pending` lalu `committed`/`failed`/`unknown`; finalisasi menandai cakupan turn durable. Resume tak pernah mengulang buta (lihat [Recovery](#recovery)). |
|
|
25
|
-
|
|
26
|
-
## Mode dan akses
|
|
27
|
-
|
|
28
|
-
Pilihan yang terlihat oleh operator dipisah menjadi tiga sumbu:
|
|
29
|
-
|
|
30
|
-
| Sumbu | Nilai | Dampak |
|
|
31
|
-
|---|---|---|
|
|
32
|
-
| **WorkMode** | `DISCUSS`, `PLAN`, `BUILD` (`EXECUTE` internal) | Membatasi ruang kerja agent. `DISCUSS` read-only; `PLAN` dapat menulis artefak rencana; `BUILD` tidak menambahkan ceiling. WorkMode hanya mempersempit akses. |
|
|
33
|
-
| **PermissionMode** | `AUTO`, `ASK` | `AUTO` menjalankan capability yang sudah diotorisasi tanpa persetujuan rutin; `ASK` meminta persetujuan untuk pemanggilan yang digate. `ask_user` ditolak di `AUTO`. |
|
|
34
|
-
| **Tool Access Policy** | kebijakan capability dan profil akses warisan | Menentukan tools yang tersedia. `readonly`, `plan`, `allowlist`, dan `allow-all` tetap menjadi identitas internal/kompatibilitas untuk batas akses, bukan mode persetujuan tambahan. |
|
|
35
|
-
|
|
36
|
-
**Profil `allow-all` tetap terbatas.** Path jail, penolakan state milik runtime, bash-guard, dan validasi argumen tetap berlaku; profil ini tidak memberi akses host tanpa batas. Detail implementasi dan opsi CLI ada di [Policy & Sandbox](policy-sandbox.md).
|
|
37
|
-
|
|
38
|
-
**Pengecualian eksplisit: `unrestricted`.** Satu-satunya mode yang melepas seluruh lapisan di atas — tanpa path jail, tanpa bash-guard, tanpa sandbox/allowlist. Diaktifkan eksplisit oleh operator lewat perintah TUI tersembunyi `/unrestric` (bukan flag CLI, sengaja tak muncul di `/help` maupun daftar `/`), berlaku **per-sesi saja** dan tak pernah persist. Gerbang keamanannya adalah kepercayaan operator kepada model — blast radius penuh (file apa pun di host, shell apa pun). Default tetap `DISCUSS`+`AUTO` dengan hard-deny aktif.
|
|
39
|
-
|
|
40
|
-
## Trust Boundaries
|
|
41
|
-
|
|
42
|
-
| Sumber | Status | Artinya |
|
|
43
|
-
|---|---|---|
|
|
44
|
-
| Prompt Anda | Niat tepercaya | Tujuan dijalankan, TETAPI setiap efek tetap lewat rantai di atas |
|
|
45
|
-
| Output model | Tak dipercaya untuk klaim | Teks/keputusan model bisa salah; bukti (hasil tool, test, HEAD) yang menentukan |
|
|
46
|
-
| Hasil tool | Data | Dibaca model sebagai fakta observasi, bukan instruksi baru |
|
|
47
|
-
| Data repository (kode, AGENTS.md, MEMORY, skill) | Data | Bisa berisi instruksi injeksi; system prompt menandainya tak-terpercaya |
|
|
48
|
-
| Server MCP | External capability | Efek di sisi server arbitrer dan tak terlihat; persetujuan mengikuti mode dan authorization; pembatalan tak membatalkan efek yang sudah terjadi |
|
|
49
|
-
| Provider / network | External | Prompt dan hasil melewati provider yang Anda pilih; tak ada telemetri/analitik dari Minicode sendiri |
|
|
50
|
-
| Child agent | Terisolasi | Memori, sinyal, budget, dan jurnal sendiri; tool scope mengikuti kebijakan delegasi dan WorkMode parent (lihat [Sub-Agents & Tasks](agents.md)) |
|
|
51
|
-
| Local config (`.minicode/config.json`) | Tak dipercaya default | Diabaikan kecuali `--allow-local-config`; repo clone-an tak bisa men-spawn server |
|
|
52
|
-
| Skills / memory tersimpan | Data | Dibaca sebagai konteks, bukan kebijakan |
|
|
53
|
-
|
|
54
|
-
## Dangerous Capabilities
|
|
55
|
-
|
|
56
|
-
Minicode **tidak menyediakan tool** untuk (terverifikasi di `src/tools/`):
|
|
57
|
-
|
|
58
|
-
- `git push`, `fetch`, `pull`, `clone` — tak ada tool git jaringan sama sekali
|
|
59
|
-
- `git reset`, `amend`, `rebase`, `checkout`, `branch -D`, `stash drop`
|
|
60
|
-
- Eksekusi remote / deploy bawaan
|
|
61
|
-
|
|
62
|
-
Catatan jujur: operasi itu tetap BISA diketik lewat `bash` (tunduk pada bash-guard + jail, BUKAN larangan). `git` via bash menjalankan konfigurasi repo apa adanya (hook/filter/driver milik repo). Tool baca `git_*` dinetralkan; `git_commit` menolak sebelum staging bila filter Git terkonfigurasi. Di repo tak-terpercaya, utamakan tool baca dan tinjau konfigurasi sebelum memakai Git manual.
|
|
63
|
-
|
|
64
|
-
## Recovery
|
|
65
|
-
|
|
66
|
-
Setiap mutasi meninggalkan bukti, bukan janji (disebut *mutation journal* di kode: `src/session/journal.ts`):
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
intent pending → committed/failed/unknown → finalisasi cakupan turn durable
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
- `committed` yang turn-nya hilang → **tidak diulang**; model diberi catatan narasi.
|
|
73
|
-
- `pending`/`failed`/`unknown` → direktif verifikasi; **dilarang redo buta**.
|
|
74
|
-
- Klaim sukses pihak ketiga (MCP) diperlakukan sebagai "kata server", wajib baca-balik bila penting.
|
|
75
|
-
|
|
76
|
-
Kejujuran yang disengaja: crash ambiguity TETAP MUNGKIN (filesystem dan database tak bisa commit atomik bersama). Yang dijamin adalah: ambiguitas selalu diperlakukan sebagai ambigu — diverifikasi dulu, tidak diasumsikan sukses maupun gagal.
|
|
77
|
-
|
|
78
|
-
## Limitations
|
|
79
|
-
|
|
80
|
-
- **Repo hooks/filter/driver:** `git` via bash mengeksekusinya (semantik stock-git); tool baca `git_*` menetralkan filter, sedangkan `git_commit` menolak bila menemukan filter terkonfigurasi.
|
|
81
|
-
- **Bash arbitrer:** guard adalah analisis statis; substitusi dinamis (`$(curl …)`) butuh sandbox OS/docker untuk isolasi nyata.
|
|
82
|
-
- **Efek eksternal MCP:** setelah terjadi, tak bisa dibatalkan dari sini.
|
|
83
|
-
- **Provider/network:** data melewati provider pilihan Anda; Minicode tak menambahkan transmisi sendiri.
|
|
84
|
-
- **Perilaku model:** pemilihan tool, klaim sukses, dan kepatuhan intent adalah sifat model — orkestrasi menjamin bukti dan batas, bukan kebijaksanaan.
|
|
85
|
-
- **Server LSP:** di-spawn dari perintah di config Anda; hanya daftarkan server yang Anda percaya.
|
|
86
|
-
- **Repo tak-terpercaya:** perlakukan seperti menjalankan `git`/`bash` manual di sana — karena memang itu yang terjadi di balik tool.
|
|
87
|
-
|
|
88
|
-
## Security Contact
|
|
89
|
-
|
|
90
|
-
Belum ada kontak keamanan privat. Laporkan masalah via [GitHub Issues](https://github.com/minilabs-id/minicode/issues) **tanpa menyertakan kredensial, token, atau data sensitif** — cukup langkah reproduksi minimal + output `minicode doctor`.
|
|
91
|
-
|
|
92
|
-
## Lanjut
|
|
93
|
-
|
|
94
|
-
- [Policy & Sandbox](policy-sandbox.md) — detail tiap mode + guard.
|
|
95
|
-
- [Keamanan](security.md) — threat model + bukti pengukuran.
|
|
96
|
-
- [Memory & Sessions](memory-sessions.md) — jurnal, checkpoint, undo.
|