minicode-ai 0.14.1 → 0.14.2
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 +1 -1
- package/cli/auto-update.ts +32 -2
- package/cli/index.ts +10 -2
- package/cli/setup.ts +8 -3
- package/cli/tui.ts +18 -15
- package/docs/OUTPUT_PROTOCOL_SPEC.md +6 -0
- package/docs/OUTPUT_RENDERING_SPEC.md +28 -4
- package/docs/README.md +2 -2
- package/docs/TERMINAL_CONTRACT.md +52 -26
- package/docs/getting-started.md +14 -12
- package/docs/glossary.md +1 -1
- package/docs/mcp-lsp.md +1 -1
- package/docs/policy-sandbox.md +7 -1
- package/docs/security-model.md +2 -2
- package/docs/security.md +7 -1
- package/docs/tools.md +4 -4
- package/docs/verify-benchmark.md +16 -0
- package/package.json +1 -3
- package/src/app/mentions.ts +4 -3
- package/src/app/session.ts +13 -9
- package/src/app/tool-layer.ts +6 -0
- package/src/constants.ts +17 -0
- package/src/lib/git-hardening.ts +27 -22
- package/src/lib/safe-open.ts +73 -19
- package/src/lib/trusted-exec.ts +7 -4
- package/src/mcp/client.ts +34 -9
- package/src/mcp/transport.ts +96 -42
- package/src/memory/files.ts +15 -4
- package/src/memory/vector.ts +5 -1
- package/src/policy/context.ts +21 -13
- package/src/policy/tool-contract.ts +4 -10
- package/src/policy/update-check.ts +83 -6
- package/src/policy/usage.ts +17 -7
- package/src/presentation/adapter.ts +64 -2
- package/src/presentation/events.ts +6 -0
- package/src/presentation/model.ts +1 -0
- package/src/presentation/projection.ts +2 -0
- package/src/presentation/reducer.ts +1 -0
- package/src/providers/anthropic.ts +52 -19
- package/src/providers/guards.ts +98 -13
- package/src/providers/responses.ts +61 -23
- package/src/providers/sse-bounds.ts +170 -0
- package/src/repo/repomap.ts +10 -11
- package/src/runtime/execution-backend.ts +7 -8
- package/src/sandbox/docker.ts +113 -9
- package/src/session/checkpoint.ts +9 -2
- package/src/session/persistence.ts +5 -2
- package/src/session/verification.ts +55 -16
- package/src/skills/loader.ts +16 -3
- package/src/tools/bash.ts +6 -3
- package/src/tools/code_run.ts +6 -5
- package/src/tools/context.ts +8 -0
- package/src/tools/delete_file.ts +2 -1
- package/src/tools/edit.ts +2 -1
- package/src/tools/git.ts +128 -54
- package/src/tools/glob.ts +2 -1
- package/src/tools/grep.ts +31 -6
- package/src/tools/lsp.ts +5 -4
- package/src/tools/mcp_call.ts +3 -1
- package/src/tools/memory.ts +175 -180
- package/src/tools/move_file.ts +2 -1
- package/src/tools/patch.ts +2 -1
- package/src/tools/read_file.ts +94 -1
- package/src/tools/read_image.ts +2 -1
- package/src/tools/task.ts +2 -1
- package/src/tools/todo.ts +4 -5
- package/src/tools/web_fetch.ts +28 -12
- package/src/tools/web_search.ts +28 -9
- package/src/tools/write_file.ts +2 -1
- package/src/ui/assistant/simple.ts +72 -3
- package/src/ui/i18n/en.ts +3 -0
- package/src/ui/i18n/id.ts +3 -0
- package/src/ui/render/width.ts +107 -79
- package/src/ui/runtime/screen.ts +49 -37
- package/src/ui/tui/app.ts +255 -205
- package/src/ui/tui/transcript.ts +39 -0
- package/CHANGELOG.md +0 -1185
- package/docs/PLAN_UIUX_V6.md +0 -209
- package/docs/changelog.md +0 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Coding agent built on **MiniCore** (kernel di-vendor ke `vendor/minicore`, seam
|
|
|
4
4
|
|
|
5
5
|
MiniCore = kernel runtime `STATE/MODEL/ACTION/LOOP` (inti di-freeze; satu-satunya patch = seam additif backward-compatible). Minicode = layer agencode: tools FS/bash/git/memory/todo/MCP/LSP, sub-agents, skills, hooks ask, CLI shell-first pure ANSI (output linier di scrollback, tanpa Ink/React), memory hybrid RAG, sessions sqlite, repo-map, verifier.
|
|
6
6
|
|
|
7
|
-
> Angka yang bisa dihitung mesin (jumlah test, tool, coverage) **tidak ditulis di sini** — jalankan `bun test`, `bun run gate:coverage`, atau lihat CI. Riwayat perubahan per versi ada di [
|
|
7
|
+
> Angka yang bisa dihitung mesin (jumlah test, tool, coverage) **tidak ditulis di sini** — jalankan `bun test`, `bun run gate:coverage`, atau lihat CI. Riwayat perubahan per versi ada di [GitHub Releases](https://github.com/startupmini/minicode/releases).
|
|
8
8
|
|
|
9
9
|
📖 **Mulai dari [docs/](docs/)** — [Instalasi](docs/getting-started.md), [Quickstart](docs/quickstart.md), [Memilih Mode](docs/choosing-mode.md) · [docs/ARCHITECTURE.html](docs/ARCHITECTURE.html) untuk peta struktur repo.
|
|
10
10
|
|
package/cli/auto-update.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
isInstalledCopy,
|
|
12
12
|
shouldAutoUpdate,
|
|
13
13
|
UPDATE_GUARD_ENV,
|
|
14
|
+
verifyInstalledVersion,
|
|
14
15
|
} from "../src/policy/update-check.ts"
|
|
15
16
|
import { c } from "../src/ui/render/theme.ts"
|
|
16
17
|
|
|
@@ -44,7 +45,7 @@ export function waitChildExit(child: ChildProcess): Promise<number | null> {
|
|
|
44
45
|
export async function maybeAutoUpdate(
|
|
45
46
|
version: string,
|
|
46
47
|
signal?: AbortSignal,
|
|
47
|
-
opts?: { onLongOp?: () => void },
|
|
48
|
+
opts?: { onLongOp?: () => void; getInstalledVersion?: () => string },
|
|
48
49
|
): Promise<void> {
|
|
49
50
|
let decision: ReturnType<typeof shouldAutoUpdate>
|
|
50
51
|
try {
|
|
@@ -77,7 +78,7 @@ export async function maybeAutoUpdate(
|
|
|
77
78
|
process.stderr.write(c.dim("Menginstall pembaruan otomatis…\n"))
|
|
78
79
|
let ok = false
|
|
79
80
|
try {
|
|
80
|
-
ok = installUpdate()
|
|
81
|
+
ok = installUpdate(latest)
|
|
81
82
|
} catch {
|
|
82
83
|
ok = false
|
|
83
84
|
}
|
|
@@ -89,6 +90,35 @@ export async function maybeAutoUpdate(
|
|
|
89
90
|
)
|
|
90
91
|
return
|
|
91
92
|
}
|
|
93
|
+
const installedMatches = (expected: string): boolean => {
|
|
94
|
+
if (!opts?.getInstalledVersion) return true
|
|
95
|
+
return verifyInstalledVersion(expected, opts.getInstalledVersion)
|
|
96
|
+
}
|
|
97
|
+
if (!installedMatches(latest)) {
|
|
98
|
+
process.stderr.write(
|
|
99
|
+
c.yellow(
|
|
100
|
+
`Versi terpasang tidak cocok dengan target ${latest}; mencoba memulihkan ${version}…\n`,
|
|
101
|
+
),
|
|
102
|
+
)
|
|
103
|
+
let restored = false
|
|
104
|
+
try {
|
|
105
|
+
restored = installUpdate(version) && installedMatches(version)
|
|
106
|
+
} catch {
|
|
107
|
+
restored = false
|
|
108
|
+
}
|
|
109
|
+
if (restored) {
|
|
110
|
+
process.stderr.write(
|
|
111
|
+
c.yellow(`Auto-update dibatalkan; versi ${version} berhasil dipulihkan.\n`),
|
|
112
|
+
)
|
|
113
|
+
return
|
|
114
|
+
}
|
|
115
|
+
process.stderr.write(
|
|
116
|
+
c.error(
|
|
117
|
+
`Auto-update tidak dapat memverifikasi atau memulihkan instalasi. Keluar; pulihkan dengan: npm install -g minicode-ai@${version}\n`,
|
|
118
|
+
),
|
|
119
|
+
)
|
|
120
|
+
process.exit(1)
|
|
121
|
+
}
|
|
92
122
|
// Restart ke kode baru dengan argv identik; guard env cegah loop bila
|
|
93
123
|
// versi ter-install ternyata masih dilaporkan lebih tua.
|
|
94
124
|
process.stderr.write(c.dim(`Restart ke versi ${latest}…\n`))
|
package/cli/index.ts
CHANGED
|
@@ -473,7 +473,10 @@ if (enterRepl) {
|
|
|
473
473
|
// matikan spinner agar tak menulis ke stderr yang sama dengan anak selama
|
|
474
474
|
// berjam-jam (stdio inherit) — itu yang terlihat sebagai hang/flicker.
|
|
475
475
|
// Idempoten: aman dipanggil dua kali (sebelum install, sebelum restart).
|
|
476
|
-
await maybeAutoUpdate(readVersion(), ctrl.signal, {
|
|
476
|
+
await maybeAutoUpdate(readVersion(), ctrl.signal, {
|
|
477
|
+
onLongOp: () => spin.stop(),
|
|
478
|
+
getInstalledVersion: readVersion,
|
|
479
|
+
})
|
|
477
480
|
} catch {}
|
|
478
481
|
clearTimeout(to)
|
|
479
482
|
spin.stop()
|
|
@@ -579,7 +582,12 @@ if (enterRepl) {
|
|
|
579
582
|
// Satu-satunya tampilan interaktif = TUI fullscreen (REPL linier dihapus).
|
|
580
583
|
// One-shot/exec tak tersentuh (cabang else di bawah).
|
|
581
584
|
const { runTui } = await import("./tui.ts")
|
|
582
|
-
|
|
585
|
+
try {
|
|
586
|
+
await runTui(ctx)
|
|
587
|
+
} catch (error) {
|
|
588
|
+
process.stderr.write(`[error] ${formatError(error)}\n`)
|
|
589
|
+
process.exitCode = 1
|
|
590
|
+
}
|
|
583
591
|
} else {
|
|
584
592
|
// P12 S2.2 (F-DISCUSS-4) + P0.2: one-shot linear memakai `ctx.workMode`
|
|
585
593
|
// efektif (termasuk hasil pulihan `--resume`).
|
package/cli/setup.ts
CHANGED
|
@@ -2195,6 +2195,10 @@ export async function createCliSession(opts: CliSessionOptions): Promise<CliSess
|
|
|
2195
2195
|
? e.result.usage.turns
|
|
2196
2196
|
: session.state.turnCount
|
|
2197
2197
|
const desc = `turn ${turn}`
|
|
2198
|
+
if (pre.mode === "unavailable") {
|
|
2199
|
+
warnLine(`checkpoint unavailable: ${pre.reason}; undo/redo will not cover turn ${turn}`)
|
|
2200
|
+
return
|
|
2201
|
+
}
|
|
2198
2202
|
if (pre.mode === "git") {
|
|
2199
2203
|
const after = await snapshotTree(cwd ?? ".", sessionId, `post-${turn}`)
|
|
2200
2204
|
const checkpoint = await recordCheckpointFromTrees(
|
|
@@ -2754,8 +2758,7 @@ export async function createCliSession(opts: CliSessionOptions): Promise<CliSess
|
|
|
2754
2758
|
const stopCtxWindow = watchContextWindowLimit({
|
|
2755
2759
|
bus: session.events,
|
|
2756
2760
|
windowTokens: contextWindowTokens ?? 0,
|
|
2757
|
-
|
|
2758
|
-
getOutputTokens: () => usage.get().outputTokens,
|
|
2761
|
+
getRequestTokens: () => usage.currentRequestTokens(),
|
|
2759
2762
|
onOver: (allowed, actual) => {
|
|
2760
2763
|
const windowTokens = contextWindowTokens ?? 0
|
|
2761
2764
|
// F-CTX-1 + P1.4: meter occupancy konteks (bukan output cutoff).
|
|
@@ -3099,7 +3102,9 @@ export async function createCliSession(opts: CliSessionOptions): Promise<CliSess
|
|
|
3099
3102
|
)
|
|
3100
3103
|
return
|
|
3101
3104
|
}
|
|
3102
|
-
//
|
|
3105
|
+
// Histori adalah bukti durable untuk turn ini. Error selain epoch harus
|
|
3106
|
+
// naik ke pemanggil agar one-shot tidak mengaku berhasil saat pesan hilang.
|
|
3107
|
+
throw e
|
|
3103
3108
|
}
|
|
3104
3109
|
}
|
|
3105
3110
|
|
package/cli/tui.ts
CHANGED
|
@@ -693,21 +693,24 @@ export async function runTui(ctx: CliSession): Promise<void> {
|
|
|
693
693
|
// Approval sebagai warga TUI: blok pertanyaan + keputusan tercatat di
|
|
694
694
|
// transkrip dan terlihat sebelum menjawab (tanpa sink = tulis langsung).
|
|
695
695
|
const { setApprovalSink } = await import("../src/ui/tui/transcript.ts")
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
696
|
+
try {
|
|
697
|
+
setApprovalSink({
|
|
698
|
+
pushBlock: (lines) => transcript.pushInfo(lines),
|
|
699
|
+
repaint: () => app.repaint(),
|
|
700
|
+
suspend: () => app.suspend(),
|
|
701
|
+
resume: () => app.resume(),
|
|
702
|
+
})
|
|
703
|
+
const res = await app.run()
|
|
704
|
+
if (!res.started) {
|
|
705
|
+
// Kegagalan startup adalah diagnostik, bukan keluaran program. App
|
|
706
|
+
// sudah menolak membuka layar dan tidak ada fallback linear yang sah.
|
|
707
|
+
process.stderr.write(`${t("tui.noTty")}\n`)
|
|
708
|
+
process.exitCode = 1
|
|
709
|
+
return
|
|
710
|
+
}
|
|
711
|
+
} finally {
|
|
712
|
+
setApprovalSink(null)
|
|
713
|
+
transcript.dispose()
|
|
708
714
|
await close()
|
|
709
|
-
return
|
|
710
715
|
}
|
|
711
|
-
transcript.dispose()
|
|
712
|
-
await close()
|
|
713
716
|
}
|
|
@@ -56,6 +56,12 @@ secara default dan tidak boleh dianggap machine contract.
|
|
|
56
56
|
| SGR | boleh bila color gate | tidak perlu; `NO_COLOR` menang |
|
|
57
57
|
| raw OSC/CSI dari untrusted text | Forbidden | Forbidden |
|
|
58
58
|
|
|
59
|
+
Saat `--interactive` gagal membuka fullscreen (pipe/non-TTY atau terminal tidak
|
|
60
|
+
mampu), CLI menulis diagnostik ke stderr dan keluar nonzero tanpa fallback linear
|
|
61
|
+
dan tanpa byte UI pada stdout. Saat TUI aktif, stdout dimiliki `App` untuk frame;
|
|
62
|
+
diagnostik yang tidak transient masuk transcript/system node atau jalur diagnostic
|
|
63
|
+
yang memang diizinkan kontrak. Output machine tetap terpisah dari kedua jalur UI.
|
|
64
|
+
|
|
59
65
|
`App` adalah pemilik tunggal frame TUI. Foreign writer ke stdout tidak boleh aktif
|
|
60
66
|
saat `TuiApp` memegang layar; diagnostic stderr yang tidak transient harus masuk ke
|
|
61
67
|
transcript atau competing-ownership guard.
|
|
@@ -204,7 +204,16 @@ arbitrator untuk transient, tetapi bukan pengganti semantic routing.
|
|
|
204
204
|
|
|
205
205
|
## 9. Geometry, text, dan fallback
|
|
206
206
|
|
|
207
|
-
- `displayWidth()` menghitung terminal
|
|
207
|
+
- `displayWidth()` menghitung kolom terminal per grapheme dengan
|
|
208
|
+
`Intl.Segmenter("und", { granularity: "grapheme" })`. Karakter CJK/fullwidth
|
|
209
|
+
dihitung dua kolom; combining marks tidak menambah kolom. Cluster emoji yang
|
|
210
|
+
ditampilkan sebagai emoji (Emoji_Presentation/VS16), skin-tone, ZWJ, regional
|
|
211
|
+
indicator, dan keycap dihitung dua kolom sebagai satu unit. Kebijakan ini
|
|
212
|
+
mengikuti perilaku terminal umum; MiniCode tidak mengukur lebar glyph per
|
|
213
|
+
terminal, sehingga font/terminal yang menyimpang dapat tetap berbeda.
|
|
214
|
+
- Wrapping, truncation/chunking, transcript selection, kursor prompt, dan
|
|
215
|
+
geometri frame memakai helper lebar bersama. `truncateToWidth()` dan
|
|
216
|
+
`chunkByWidth()` tidak memecah grapheme.
|
|
208
217
|
- Sanitasi control bytes dilakukan sebelum output; SGR boleh hanya bila color gate.
|
|
209
218
|
- Resize dibaca saat paint, bukan saat event.
|
|
210
219
|
- `NO_COLOR`/legacy Windows memakai glyph ASCII atau status word.
|
|
@@ -212,7 +221,22 @@ arbitrator untuk transient, tetapi bukan pengganti semantic routing.
|
|
|
212
221
|
- TTY table boleh aligned; machine/non-TTY tidak boleh berubah makna.
|
|
213
222
|
- Copy/paste tidak bergantung pada warna.
|
|
214
223
|
|
|
215
|
-
## 10.
|
|
224
|
+
## 10. Visual system dan accessibility
|
|
225
|
+
|
|
226
|
+
`src/ui/render/theme.ts` menyediakan token semantik (`success`, `error`,
|
|
227
|
+
`warning`, `info`, `accent`, `muted`, `faint`) dengan getter runtime. Token
|
|
228
|
+
warna hanya menegaskan status dan hierarki; status penting juga memakai kata
|
|
229
|
+
atau glyph sehingga tetap dapat dibaca pada `NO_COLOR`/mono. Fallback ASCII
|
|
230
|
+
dikendalikan oleh `MINICODE_ASCII` dan capability UTF-8 Windows.
|
|
231
|
+
|
|
232
|
+
Interaksi tetap keyboard-first: PgUp/PgDn dan Home/End untuk transkrip, Esc
|
|
233
|
+
untuk membatalkan/menutup selection, Ctrl+D untuk keluar, dan popup menahan
|
|
234
|
+
fokus sampai ditutup. Tidak ada mode screen-reader terpisah karena kontrak
|
|
235
|
+
fullscreen terminal dibekukan. Navigasi keyboard dan jalur mono memiliki test;
|
|
236
|
+
screen-reader announcement, kontras fisik, dan manual assistive-technology UAT
|
|
237
|
+
belum diverifikasi. Tampilan antar terminal tetap dapat berbeda.
|
|
238
|
+
|
|
239
|
+
## 11. Parity matrix
|
|
216
240
|
|
|
217
241
|
| Semantic | TUI | Linear | Exec | ACP |
|
|
218
242
|
|---|---|---|---|---|
|
|
@@ -227,7 +251,7 @@ arbitrator untuk transient, tetapi bukan pengganti semantic routing.
|
|
|
227
251
|
Parity diuji pada semantic object sebelum snapshot string. Test output tetap diperlukan
|
|
228
252
|
untuk regressions visual dan protocol.
|
|
229
253
|
|
|
230
|
-
##
|
|
254
|
+
## 12. Migration seams
|
|
231
255
|
|
|
232
256
|
1. `PresentationAdapter` dapat tetap emit raw-compatible events.
|
|
233
257
|
2. `ProjectionBridge` aktif untuk semua surface; flag `MINICODE_PRESENTATION_V2` dihapus di Phase 8.
|
|
@@ -238,7 +262,7 @@ untuk regressions visual dan protocol.
|
|
|
238
262
|
removed from user-facing TUI. Raw EventBus remains for streaming content and
|
|
239
263
|
diagnostics/trace only.
|
|
240
264
|
|
|
241
|
-
##
|
|
265
|
+
## 13. Definition of done renderer
|
|
242
266
|
|
|
243
267
|
- Tidak ada renderer yang meng-status-kan teks.
|
|
244
268
|
- TUI/linear/exec/ACP menghasilkan semantic fields yang sama.
|
package/docs/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Beberapa hal penting yang perlu Anda tahu:
|
|
|
34
34
|
- **Tidak ada data yang dikirim tanpa sepengetahuan Anda.** Konfigurasi Anda tersimpan di komputer Anda sendiri. Token akses disimpan dengan aman dan tidak disebarkan.
|
|
35
35
|
- **Kegagalan dilaporkan apa adanya.** Jika ada masalah, Minicode akan memberitahu secara langsung, tanpa disamarkan.
|
|
36
36
|
- **Informasi kuantitatif tidak ditulis secara permanen di sini.** Jika Anda ingin tahu jumlah test, cakupan, atau jumlah alat yang tersedia, jalankan perintah `bun test`, `bun run gate:coverage`, atau lihat hasil di layanan continuous integration (CI). Informasi seperti ini bisa berubah sewaktu-waktu.
|
|
37
|
-
- **Riwayat perubahan** tercatat di
|
|
37
|
+
- **Riwayat perubahan** tercatat di [GitHub Releases](https://github.com/startupmini/minicode/releases); changelog lengkap tersedia pada repository.
|
|
38
38
|
|
|
39
39
|
## Mulai dalam 5 menit
|
|
40
40
|
|
|
@@ -100,7 +100,7 @@ Habis itu, baca sesuai kebutuhan lewat tabel Navigasi di bawah — tak perlu ber
|
|
|
100
100
|
| Kontrak internal kontributor: terminal FROZEN, control-plane, pipeline render | [Internal & Arsitektur](TERMINAL_CONTRACT.md) (grup di sidebar) |
|
|
101
101
|
| Audit dan target arsitektur output/presentation | [Output Architecture Audit](OUTPUT_ARCHITECTURE_AUDIT.md) |
|
|
102
102
|
| Ikut kontribusi, gate, batas lapisan | [Contributing](contributing.md) |
|
|
103
|
-
| Perubahan per versi | [Changelog](
|
|
103
|
+
| Perubahan per versi | [Changelog](https://github.com/startupmini/minicode/releases) |
|
|
104
104
|
| Arsip panduan monolit lama (baca hanya bila perlu) | `USAGE.md` (file pendamping, status legacy) |
|
|
105
105
|
|
|
106
106
|
## Konvensi dokumen ini
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# Kontrak Terminal MiniCode (TUI fullscreen — v7.
|
|
1
|
+
# Kontrak Terminal MiniCode (TUI fullscreen — v7.5, 2026-11-06)
|
|
2
|
+
|
|
3
|
+
Perubahan v7.5: kepemilikan frame stdout interaktif diperjelas; cleanup `TuiApp.run()`
|
|
4
|
+
berpasangan melalui `finally`; gap proteksi teardown, startup, spacer, layar kecil,
|
|
5
|
+
dan writer ownership ditutup dengan test app/subprocess/PTY.
|
|
2
6
|
|
|
3
7
|
Perubahan v7.4 (P12 S2.2 WorkMode): invarian baru I35 — WorkMode (lapis
|
|
4
8
|
intent `DISCUSS`/`PLAN`/`EXECUTE`) sebagai dimensi TERPISAH dari permission
|
|
@@ -61,7 +65,7 @@ proteksi").
|
|
|
61
65
|
|
|
62
66
|
| Stream | Isi | Catatan |
|
|
63
67
|
|---|---|---|
|
|
64
|
-
| stdout |
|
|
68
|
+
| stdout | Permanent output pada non-interaktif; frame TUI saat sesi interaktif | `App` satu-satunya pemilik frame interaktif; machine output tetap murni |
|
|
65
69
|
| stderr | Human-facing progress/diagnostic: ledger tool (`› …` hijau/merah), reasoning (verbose), warning, error | Boleh transient rendering bila stderr TTY |
|
|
66
70
|
| keduanya | Warna hanya bila stream TTY (`stdout.isTTY`); `NO_COLOR` menang; TERM/COLORTERM env TIDAK menyalakan warna pada pipe/redirect | Lihat `src/ui/render/theme.ts` `colorLevel()` |
|
|
67
71
|
|
|
@@ -82,9 +86,11 @@ Non-TTY (pipe/redirect/CI/file): **0 cursor control, 0 alternate screen,
|
|
|
82
86
|
|
|
83
87
|
## Ownership
|
|
84
88
|
|
|
85
|
-
- `App` pemilik tunggal layar (alt-screen enter saat start, exit saat quit
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
- `App` pemilik tunggal layar (alt-screen enter saat start, exit saat quit).
|
|
90
|
+
`TuiApp.run()` melepas listener/timer/subscription, memulihkan raw mode, dan
|
|
91
|
+
menutup layar lewat `finally` idempoten pada jalur sukses maupun exception.
|
|
92
|
+
Hook `process.on("exit")` hanya jaring best-effort terakhir, bukan pengganti
|
|
93
|
+
cleanup lifecycle. Turn berjalan = indikator spark pada status bar.
|
|
88
94
|
- **Sinyal fatal** (I31): saat sesi TUI hidup, `App.run()` memasang
|
|
89
95
|
`process.on("SIGTERM")`/`process.on("SIGHUP")` (handler terpisah karena Bun
|
|
90
96
|
tak menyampaikan nama sinyal — satu handler bersama tak bisa membedakan)
|
|
@@ -227,6 +233,14 @@ Non-TTY (pipe/redirect/CI/file): **0 cursor control, 0 alternate screen,
|
|
|
227
233
|
tetap pada ledger tool, status tool final memakai glyph + kata
|
|
228
234
|
(`completed`/`failed`/`denied`/`cancelled`/`interrupted`), retry dan grup
|
|
229
235
|
anak mengikuti model, serta ringkasan turn masuk sebagai system entry.
|
|
236
|
+
**Retry provider:** setiap `model.delta`/`reasoning.delta` live membawa
|
|
237
|
+
`attemptId`. Bila attempt gagal setelah mengirim konten, TUI membuang
|
|
238
|
+
ekor attempt yang belum di-commit dan menambah diagnostic invalidasi.
|
|
239
|
+
Sink linear/pipe bersifat append-only: byte yang sudah ditulis tetap ada,
|
|
240
|
+
sehingga sink wajib menulis marker invalidasi sebelum output attempt
|
|
241
|
+
berikutnya. Konten attempt gagal dikeluarkan dari `/copy`, reasoning
|
|
242
|
+
durable, dan jawaban akhir; usage provider tetap dihitung karena request
|
|
243
|
+
tersebut sudah terjadi.
|
|
230
244
|
**Grup anak (F-AGENT-1):** tool anak yang punya identitas run
|
|
231
245
|
(`childSessionId`/`runId` — dari `ChildSessionLink`) tampil sebagai baris
|
|
232
246
|
run sendiri, diindented `↳ <marker> <tool> <target> <status>` dengan
|
|
@@ -445,7 +459,7 @@ panjang).
|
|
|
445
459
|
> **benar-benar di-assert** oleh test yang disebut. Kehadiran nama file test
|
|
446
460
|
> bukan bukti klaim. Baris yang hanya "nominal" (test ada, tapi assertion-nya
|
|
447
461
|
> tak menyentuh perilaku yang diklaim) dipindah ke bagian
|
|
448
|
-
> [Gap proteksi](#
|
|
462
|
+
> [Gap proteksi](#peta-proteksi-dan-gap-tersisa) di bawah — jangan
|
|
449
463
|
> dipoles dengan mengganti kata-kata.
|
|
450
464
|
|
|
451
465
|
- `test/tui-app.test.ts` — I1/I13/I14/I17-I20 (boot/exit pairing, transcript
|
|
@@ -531,15 +545,19 @@ panjang).
|
|
|
531
545
|
resume > default EXECUTE; nilai invalid → EXECUTE + peringatan; `--verify`
|
|
532
546
|
ditolak fail-closed pada DISCUSS/PLAN; ACP `workMode` + fallback env; daemon
|
|
533
547
|
`workMode` parity).
|
|
534
|
-
- `test/tui-app.test.ts`, `test/tui-popup.test.ts` — I13/I17 (composer
|
|
535
|
-
editing/busy, dots clock, timer, cursor, resize, popup
|
|
536
|
-
|
|
537
|
-
|
|
548
|
+
- `test/tui-app.test.ts`, `test/tui-popup.test.ts` — I13/I14/I17 (composer
|
|
549
|
+
editing/busy, dots clock, timer, cursor, resize, popup; teardown saat initial,
|
|
550
|
+
frame, event/timer, dan resize repaint gagal; abort/scroll saat layar menciut;
|
|
551
|
+
spacer composer-footer).
|
|
538
552
|
- `test/markdown-table.test.ts` — I8/I11 (pipe-table parser, streaming
|
|
539
553
|
parity, ANSI/CJK width, TTY/non-TTY, TUI resize, machine-output policy).
|
|
540
554
|
- `test/terminal-contract.test.ts` — I2/I3/I7/I8/I9 (split stdout/stderr,
|
|
541
555
|
kepemilikan layar tunggal, ledger satu baris per tool, streaming tanpa
|
|
542
556
|
duplikasi, foreign writer boleh mentah).
|
|
557
|
+
- `test/provider-retry-output.test.ts`, `test/tui-transcript.test.ts`, dan
|
|
558
|
+
`test/presentation-events.test.ts` — invalidasi attempt provider gagal;
|
|
559
|
+
TUI/transkrip/history/`/copy` tidak menggabungkan teks gagal dengan jawaban
|
|
560
|
+
final, sementara sink linear memberi marker dan usage tetap tercatat.
|
|
543
561
|
- `test/transient-arbitration.test.ts` — I3/I9/I27 (hold layar interaktif:
|
|
544
562
|
picker/askLine, nesting, delayMs).
|
|
545
563
|
- `test/statusline-bun-guard.test.ts` — I4 (painter Bun/Windows: painter
|
|
@@ -563,7 +581,12 @@ panjang).
|
|
|
563
581
|
- `test/repl-linear.test.ts`, `test/footer-chrome.test.ts`,
|
|
564
582
|
`test/info-window.test.ts` — DIHAPUS bersama REPL/chrome/jendela.
|
|
565
583
|
- `test/cli-commands.test.ts` — /status cetak, /sessions popup.
|
|
566
|
-
- `test/screen.test.ts` — I16 (pairing + paintRegion
|
|
584
|
+
- `test/screen.test.ts` — I16 (pairing + paintRegion; open/paint writer failure
|
|
585
|
+
mencoba memulihkan alt-screen dan reset region).
|
|
586
|
+
- `test/screen-buffer.test.ts` — parser grid ANSI/CUP dengan pengukuran grapheme
|
|
587
|
+
yang sama dengan renderer (termasuk emoji ZWJ dua kolom).
|
|
588
|
+
- `test/tui-startup-failure.test.ts` — UI-COMPAT-01 (CLI subprocess non-TTY:
|
|
589
|
+
diagnostik stderr, stdout kosong, exit 1, provider tidak dipanggil).
|
|
567
590
|
- `test/dialog.test.ts` — I11/I16/I20 (geometri, backdrop, box).
|
|
568
591
|
- `test/tui-overlay.test.ts` — I11/I16 (popup region + gate layar).
|
|
569
592
|
- `test/ui-boundary.test.ts` — I1/I3 (src/ui tak impor keluar).
|
|
@@ -579,8 +602,9 @@ panjang).
|
|
|
579
602
|
wizard, form error).
|
|
580
603
|
- `test/sanitize.test.ts` — I2 (C1/bidi/tag dibuang, ZWJ dipertahankan;
|
|
581
604
|
NO_COLOR menang di cleanUntrusted).
|
|
582
|
-
- `test/width.test.ts` — I2/I7 (
|
|
583
|
-
|
|
605
|
+
- `test/width.test.ts` — I2/I7 + UI-RENDER-01 (VS16, skin tone, ZWJ, regional
|
|
606
|
+
indicator, keycap, combining mark; truncate/chunk tidak memecah grapheme;
|
|
607
|
+
tab 8 kolom; hanya-SGR + auto-reset; chunk(0) kosong).
|
|
584
608
|
- `test/exit-codes.test.ts` — I28 (0/1/2 di semua handler; lookup tetap 1;
|
|
585
609
|
hermetic subprocess).
|
|
586
610
|
- `test/exec-json-envelope.test.ts` — I28 (summary ok:false di stdout saat
|
|
@@ -608,12 +632,13 @@ panjang).
|
|
|
608
632
|
ESC[5;2~; hint abort pertama), I13 (MINICODE_MOTION=0: spark statis,
|
|
609
633
|
env dibaca saat dipakai), I25 (kursor CUP parkir di dalam blok ?2026 yang
|
|
610
634
|
sama), I21 (konstanta idle form 80+10 dtk + teks peringatan).
|
|
611
|
-
- `test/pty.test.ts` — I13/I17/I31/I28 via BYTE STREAM NYATA
|
|
612
|
-
`test/helpers/pty-harness.ts`, CLI di pseudo-terminal
|
|
613
|
-
provider fake hermetic): boot → ?1049h + timer idle,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
635
|
+
- `test/pty.test.ts` — I13/I17/I31/I28 + UI-RENDER-01 via BYTE STREAM NYATA
|
|
636
|
+
(harness PTY `test/helpers/pty-harness.ts`, CLI di pseudo-terminal
|
|
637
|
+
sesungguhan + provider fake hermetic): boot → ?1049h + timer idle, terminal
|
|
638
|
+
terlalu kecil menolak alt-screen, turn penuh, teks Unicode kompleks pada
|
|
639
|
+
frame produksi, drag-selection mouse SGR → Ctrl+C → OSC52 (koordinat mouse
|
|
640
|
+
dihitung dari LAYAR NYATA, bukan hardcoded), resize → repaint, SIGTERM →
|
|
641
|
+
restore + exit 143 (POSIX). *Klausa "exec --json bersih tanpa ANSI" di test ini berjalan
|
|
617
642
|
sebagai proses biasa tanpa PTY (lihat komentar di berkasnya) — jadi ia
|
|
618
643
|
bukan bukti byte stream; bukti envelope ada di `test/exec-json-envelope.test.ts`.*
|
|
619
644
|
Platform tak mampu (ConPTY rusak) = SKIP beralasan, bukan hijau palsu.
|
|
@@ -629,18 +654,19 @@ panjang).
|
|
|
629
654
|
skip senyap. Parser SGR dan selection SGR tetap terverifikasi terpisah di
|
|
630
655
|
`test/prompt-engine.test.ts` dan `test/tui-app.test.ts` (fake TTY).
|
|
631
656
|
|
|
632
|
-
###
|
|
657
|
+
### Peta proteksi dan gap tersisa
|
|
633
658
|
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
kata-kata di sini TIDAK menutup gap.
|
|
659
|
+
Baris berstatus "ditutup" menunjukkan bukti yang tersedia saat ini. Gap tersisa
|
|
660
|
+
tetap UNVERIFIED; keberadaan implementasi saja bukan bukti UAT.
|
|
637
661
|
|
|
638
662
|
| Klaim | Status implementasi | Yang hilang |
|
|
639
663
|
|---|---|---|
|
|
640
|
-
| I14 — "berlaku juga saat layar MENCIUT: abort+scroll selalu lolos" | Terimplementasi (`src/ui/tui/app.ts`:
|
|
641
|
-
| I13/I17 — "satu baris kosong memisahkan composer dari footer" | Terimplementasi (`src/ui/tui/app.ts` merender satu spacer per frame) |
|
|
664
|
+
| I14 — "berlaku juga saat layar MENCIUT: abort+scroll selalu lolos" | Terimplementasi (`src/ui/tui/app.ts`: PgUp/PgDn dan Esc diintercept sebelum `tooSmall()`) | Ditutup: `test/tui-app.test.ts` membuktikan scroll posisi baca bertahan saat layar dipulihkan dan Esc memanggil abort; `Ctrl+D` tetap jalan keluar terakhir. |
|
|
665
|
+
| I13/I17 — "satu baris kosong memisahkan composer dari footer" | Terimplementasi (`src/ui/tui/app.ts` merender satu spacer per frame) | Ditutup: `test/tui-app.test.ts` meng-assert baris spacer dalam frame penuh 14 baris. |
|
|
642
666
|
| I20 — lebar kotak popup tetap per permukaan | Terimplementasi | `test/tui-app.test.ts` menandai salah satu test-nya sebagai `(I20)`, padahal test itu milik I13 (status bar). Lebar popup diverifikasi di `test/tui-geometry.test.ts` + `test/dialog.test.ts`; label di `tui-app` menyesatkan. |
|
|
643
667
|
| I5 — tak ada popup yatim / input bocor setelah success/failure/cancel/SIGINT/session end | Tak terverifikasi | `test/turn-status.test.ts` dan `test/statusline-bun-guard.test.ts` tidak meng-assert apa pun soal popup yatim atau kebocoran input. |
|
|
644
668
|
| I26 pada jalur presentasi | i18n ada dan dijaga terpisah | `test/presentation-projections.test.ts` mengunci locale `en` di setiap test dan tak pernah menguji locale `id`; klaim i18n dijaga `test/i18n.test.ts` + `test/i18n-hardcode.test.ts`. |
|
|
645
669
|
| I2/I6/I28 pada proyeksi linear/ACP | Alur linear/ACP ada | `test/presentation-linear-acp.test.ts` tak meng-assert split stdout/stderr, absence cursor-control, maupun exit code secara langsung. |
|
|
646
|
-
| I3 —
|
|
670
|
+
| I3 — kepemilikan frame tunggal selama alternate-screen | `App` merender frame ke stdout; `simple` quiet dan transient stderr ditahan selama layar dimiliki TUI | Ditutup untuk jalur yang diuji: `test/terminal-contract.test.ts` memastikan printer linear quiet tetap tidak menulis, `test/pty.test.ts` mengamati frame produksi, dan `test/writer-inventory.test.ts` mengunci daftar writer. Suite PTY berjalan pada CI Linux; Windows ConPTY tidak menjalankan seluruh kasus PTY. |
|
|
671
|
+
| UI-COMPAT-01 — startup TUI gagal | Non-TTY/terminal tak mampu menolak fullscreen tanpa fallback linear; diagnostik stderr dan exit 1 | Ditutup: `test/tui-startup-failure.test.ts` menguji CLI produksi via subprocess; `test/pty.test.ts` menguji terminal di bawah minimum tanpa `?1049h`. Exit code PTY hanya diklaim jika platform mengembalikan angka. |
|
|
672
|
+
| UI-RENDER-02 — exception render melewati teardown | `TuiApp.run()` melakukan cleanup idempoten di `finally`; write frame melempar ke owner | Ditutup untuk initial paint, writer frame, dan event repaint: `test/tui-app.test.ts` + `test/screen.test.ts` memverifikasi alt-screen, raw mode, listener, subscription, timer dan sync-update. Sinyal POSIX diperiksa terpisah; Windows melewati test sinyal POSIX. |
|
package/docs/getting-started.md
CHANGED
|
@@ -63,22 +63,24 @@ Docker **tidak** dipakai otomatis meski tersedia — menarik image tanpa diminta
|
|
|
63
63
|
## Update & uninstall
|
|
64
64
|
|
|
65
65
|
Membuka `minicode` interaktif (TTY) selalu cek versi terbaru ke registry:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
versi SemVer tepat yang ditemukan diverifikasi dahulu lewat instalasi sementara
|
|
67
|
+
dan `npm audit signatures` (signature registry + provenance). Skrip instalasi
|
|
68
|
+
paket dimatikan; hanya graph tanpa dependency runtime yang diterima. Setelah
|
|
69
|
+
itu versi yang sama dipasang dari registry resmi, versi di package terpasang
|
|
70
|
+
dibaca ulang, lalu minicode restart sendiri. Ketidakcocokan mencoba memulihkan
|
|
71
|
+
versi sebelumnya; bila pemulihan gagal, proses berhenti agar tidak berjalan
|
|
72
|
+
dengan instalasi campuran. Berlaku hanya untuk salinan ter-install (checkout
|
|
73
|
+
source tidak disentuh). Npm lama, paket tanpa bukti signature/provenance,
|
|
74
|
+
offline, atau install gagal menahan auto-update dan memberi instruksi manual.
|
|
70
75
|
One-shot, `exec`, pipe, dan CI hanya menampilkan notifikasi (tanpa install).
|
|
71
76
|
|
|
72
|
-
>
|
|
73
|
-
>
|
|
74
|
-
>
|
|
75
|
-
>
|
|
76
|
-
> TLS registry + rilis hanya dari CI repo ini; yang butuh jaminan lebih,
|
|
77
|
-
> matikan auto-update (`MINICODE_AUTO_UPDATE=0`) dan update manual setelah
|
|
78
|
-
> memeriksa rilis di GitHub.
|
|
77
|
+
> Verifikasi memakai kemampuan npm, bukan verifier Sigstore yang dibundel
|
|
78
|
+
> MiniCode. Gagal-verifikasi selalu menghentikan update otomatis. Pemilik tetap
|
|
79
|
+
> dapat mematikan jalur ini (`MINICODE_AUTO_UPDATE=0`) dan mengelola update
|
|
80
|
+
> manual sesuai kebijakan organisasinya.
|
|
79
81
|
|
|
80
82
|
```bash
|
|
81
|
-
npm
|
|
83
|
+
npm install -g minicode-ai@<versi> # manual, gunakan versi yang sudah ditinjau
|
|
82
84
|
minicode sync # refresh model baru dari semua provider
|
|
83
85
|
minicode pricing sync # refresh cache harga (3.162 model, ~213 KB)
|
|
84
86
|
```
|
package/docs/glossary.md
CHANGED
|
@@ -10,7 +10,7 @@ Istilah Minicode yang punya makna spesifik. Dokumentasi berbahasa Indonesia deng
|
|
|
10
10
|
| **Tool scope** | `full` (semua 37) atau `explore` (subset read-only 12 tool) — flag `--tool-scope` |
|
|
11
11
|
| **Permission mode** | Keputusan siapa yang memutuskan aksi: `auto / readonly / plan / allowlist / ask / allow-all` |
|
|
12
12
|
| **Gate** | Tool wajib persetujuan manusia saat TTY; non-TTY selalu tolak (mis. `git_commit`, MCP, `delegate_task`) |
|
|
13
|
-
| **Path jail** | Pembatasan akses file ke workspace (realpath + symlink
|
|
13
|
+
| **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` |
|
|
14
14
|
| **Bash-guard** | Normalisasi + blokir pola bash berbahaya sebelum eksekusi (quote-split, indirection, wrapper) |
|
|
15
15
|
| **Sandbox OS** | bubblewrap (Linux) / seatbelt (macOS) — otomatis bila tersedia |
|
|
16
16
|
| **Sandbox Docker** | Container ephemeral `--network none`, 512m, 1 CPU, `node:22-alpine` |
|
package/docs/mcp-lsp.md
CHANGED
|
@@ -30,7 +30,7 @@ Keamanan HTTP: host privat ditolak kecuali `--allow-private` (penjaga sama denga
|
|
|
30
30
|
|
|
31
31
|
Izin: semua MCP bertitik selalu di-gate — `auto` minta konfirmasi sekali per tool (`[a] Always` persist ke allowlist); `readonly`/`plan`/`allowlist` menolak. Tanpa wildcard auto-allow (proteksi supply-chain).
|
|
32
32
|
|
|
33
|
-
Model kepercayaan: permission hanya kontrol *pemanggilan*. Capability di balik server (filesystem, network, proses, API) tak bisa diketahui statis — anggap setiap `mcp_call` external capability arbitrer. Pembatalan
|
|
33
|
+
Model kepercayaan: permission hanya kontrol *pemanggilan*. Capability di balik server (filesystem, network, proses, API) tak bisa diketahui statis — anggap setiap `mcp_call` external capability arbitrer. Pembatalan menghentikan penungguan lokal, tetapi tidak membuktikan bahwa server berhenti atau membatalkan efek yang sudah diterima. Jika koneksi terputus setelah request dikirim, tool mengembalikan error `outcome unknown`; periksa state remote sebelum mencoba lagi.
|
|
34
34
|
|
|
35
35
|
Ekspos balik (stdio saja — tanpa mode HTTP, jadi tak ada permukaan jaringan):
|
|
36
36
|
|
package/docs/policy-sandbox.md
CHANGED
|
@@ -61,11 +61,17 @@ Fuzz membangkitkan varian dari transformasi yang shell anggap setara (quote-spli
|
|
|
61
61
|
| `--sandbox docker` | Container ephemeral (`--network none`, 512m, 1 CPU, `node:22-alpine`) |
|
|
62
62
|
| `--sandbox docker` tapi daemon mati | TOLAK sebelum jalan (fail-closed) + cara opt-in fallback eksplisit; tidak pura-pura terisolasi |
|
|
63
63
|
|
|
64
|
+
Container mendapat nama acak per-run. Saat batas waktu habis atau tool dibatalkan,
|
|
65
|
+
runner meminta daemon menjalankan `docker rm --force` dengan timeout cleanup
|
|
66
|
+
5 detik sebelum menghentikan penunggu CLI. Output membedakan cleanup yang
|
|
67
|
+
dikonfirmasi daemon dari yang tidak terkonfirmasi. Ini tidak membatalkan efek
|
|
68
|
+
workspace yang sudah terjadi sebelum container dihentikan.
|
|
69
|
+
|
|
64
70
|
`MINICODE_SANDBOX_STRICT=1` = tak pernah fallback host (redundan dengan default fail-closed untuk request eksplisit, tetap dihormati). `MINICODE_SANDBOX_ALLOW_FALLBACK=1` = satu-satunya jalan fallback host yang sadar bila backend tak tersedia. `MINICODE_SANDBOX_IMAGE` ganti image (default `node:22-alpine` hanya bawa node). `code_run` selalu lewat sandbox runner dan menolak bila backend tak tersedia.
|
|
65
71
|
|
|
66
72
|
## Lapisan lain
|
|
67
73
|
|
|
68
|
-
- **Path jail** realpath-based + symlink `realpath` di permission layer; `.env`/`.git/config`/`node_modules`/hive Windows deny; `.minicode/` terkunci penuh untuk tool tulis berdasarkan target NYATA (realpath best-effort `isOwnedStateReal` — junction/symlink internal ke `.minicode/` ikut ditahan; kecuali restore `.trash/` + skrip `hooks/`); bash-guard menahan PEMBUATAN link yang operannya sensitif/owned-state
|
|
74
|
+
- **Path jail** realpath-based + symlink `realpath` di permission layer; `.env`/`.git/config`/`node_modules`/hive Windows deny; `.minicode/` terkunci penuh untuk tool tulis berdasarkan target NYATA (realpath best-effort `isOwnedStateReal` — junction/symlink internal ke `.minicode/` ikut ditahan; kecuali restore `.trash/` + skrip `hooks/`); bash-guard menahan PEMBUATAN link yang operannya sensitif/owned-state. Untuk pembacaan, `safeOpenRead` memeriksa boundary ulang setelah stat dan mencocokkan `dev+ino` dari handle yang terbuka; `O_NOFOLLOW` juga dipakai pada POSIX. Stress test symlink tetap skip bila host tidak memberi privilege membuat symlink.
|
|
69
75
|
- **Env scrub** `sanitizeSpawnEnv`: strip kata-kunci kredensial dari merge final; `GITHUB_WORKSPACE`/`REDIS_HOST`/`AWS_REGION` tetap ada, `GITHUB_TOKEN`/`AWS_SECRET_ACCESS_KEY`/`DATABASE_URL` tetap di-strip.
|
|
70
76
|
- **web_fetch/web_search**: redirect manual 5 hop + DNS pinning 30 dtk + body 2 MB.
|
|
71
77
|
- **Secret scrubber**: `sk-`, `ghp_`, `AKIA`, PEM, JWT, Bearer, `api_key=...` di-redact sebelum ke LLM (read_file/bash/grep) — tanpa whitelist kata.
|
package/docs/security-model.md
CHANGED
|
@@ -58,7 +58,7 @@ Minicode **tidak menyediakan tool** untuk (terverifikasi di `src/tools/`):
|
|
|
58
58
|
- `git reset`, `amend`, `rebase`, `checkout`, `branch -D`, `stash drop`
|
|
59
59
|
- Eksekusi remote / deploy bawaan
|
|
60
60
|
|
|
61
|
-
Catatan jujur: operasi itu tetap BISA diketik lewat `bash` (tunduk pada bash-guard + jail, BUKAN larangan).
|
|
61
|
+
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.
|
|
62
62
|
|
|
63
63
|
## Recovery
|
|
64
64
|
|
|
@@ -76,7 +76,7 @@ Kejujuran yang disengaja: crash ambiguity TETAP MUNGKIN (filesystem dan database
|
|
|
76
76
|
|
|
77
77
|
## Limitations
|
|
78
78
|
|
|
79
|
-
- **Repo hooks/filter/driver:** `git` via bash mengeksekusinya (semantik stock-git); tool `git_*`
|
|
79
|
+
- **Repo hooks/filter/driver:** `git` via bash mengeksekusinya (semantik stock-git); tool baca `git_*` menetralkan filter, sedangkan `git_commit` menolak bila menemukan filter terkonfigurasi.
|
|
80
80
|
- **Bash arbitrer:** guard adalah analisis statis; substitusi dinamis (`$(curl …)`) butuh sandbox OS/docker untuk isolasi nyata.
|
|
81
81
|
- **Efek eksternal MCP:** setelah terjadi, tak bisa dibatalkan dari sini.
|
|
82
82
|
- **Provider/network:** data melewati provider pilihan Anda; Minicode tak menambahkan transmisi sendiri.
|
package/docs/security.md
CHANGED
|
@@ -37,10 +37,16 @@
|
|
|
37
37
|
| `for /f %i in (.env) do @echo %i` (pembaca bawaan cmd.exe) | `for` adalah loop, bukan utilitas → tidak ada di `READERS`, sehingga target berkasnya tak diperiksa sama sekali | ditolak: set berkas `for /f … in (…)` diekstrak (`forFileSets`) dan diperiksa seperti argumen pembaca (temuan F3) |
|
|
38
38
|
|
|
39
39
|
2. **Allowlist** (`--allowlist`, dan default bila tanpa sandbox OS): hanya bentuk read/build — `git status/diff/log/branch/show`, `bun test/run/x tsc`, `npm run/exec`, `npx`, `ls dir cat type head tail wc grep rg find which echo pwd`. Tulis via shell ditahan; pakai `write_file`/`edit` yang ter-jail. `npm exec`/`npx`/`bun run`/`bun x` tak boleh ekspansi shell/redirection. `git --no-index/--exec-path/--upload-pack/--receive-pack`, transport `ext::`, dan `GIT_EXTERNAL_DIFF`/`GIT_CONFIG_*` inline ditolak guard (git sebagai pelarian jail).
|
|
40
|
-
3. **Path jail** realpath-based + symlink check
|
|
40
|
+
3. **Path jail** realpath-based + symlink check; pembaca membuka target canonical, memakai `O_NOFOLLOW` pada POSIX, lalu mencocokkan `dev+ino` antara stat sebelum open dan handle setelah open (termasuk Windows). `.env`/`.git/config`/`node_modules`/hive Windows (`system32\config\sam|system|security|software`, `ntds.dit`) deny; berlaku bahkan `--allow-all`.
|
|
41
41
|
4. **Env scrub** `sanitizeSpawnEnv`: strip kata-kunci kredensial dari merge final. `GITHUB_WORKSPACE`/`GITHUB_REF`/`GOOGLE_CHROME_PATH`/`REDIS_HOST`/`AWS_REGION` **tetap ada** (pernah terhapus dan memecahkan build CI), sementara `GITHUB_TOKEN`/`AWS_SECRET_ACCESS_KEY`/`DATABASE_URL` di-strip. Bila non-rahasia ikut hilang, itu bug — laporkan nama variabelnya.
|
|
42
42
|
5. **web_fetch/web_search**: redirect manual ≤5 hop + DNS pinning 30 dtk + body cap 2 MB. Host privat ditolak (sama untuk MCP HTTP).
|
|
43
43
|
|
|
44
|
+
`grep` memakai ripgrep bila tersedia. Biner di-resolve dari PATH absolut yang
|
|
45
|
+
tepercaya, environment child disanitasi, dan config eksternal dinonaktifkan
|
|
46
|
+
(`--no-config`, tanpa `RIPGREP_CONFIG_PATH`). Config ripgrep mendukung
|
|
47
|
+
preprocessor yang mengeksekusi program per berkas; karena itu tool pencarian
|
|
48
|
+
tidak mewarisi konfigurasi tersebut.
|
|
49
|
+
|
|
44
50
|
## Prompt injection
|
|
45
51
|
|
|
46
52
|
- Output verify dibungkus fence agar instruksi di error build tidak diikuti model.
|
package/docs/tools.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Referensi lengkap tool Minicode: filesystem, search, exec, git, web, memory, plan, agents, MCP, LSP.
|
|
4
4
|
|
|
5
|
-
Pilih tool ini ketika: **file** untuk baca/tulis presisi (bukan `cat` via bash); **search** untuk menemukan kode (bukan `grep` via bash); **bash** untuk perintah yang memang butuh shell; **git tool** untuk status/diff/log/commit (bukan `git` mentah —
|
|
5
|
+
Pilih tool ini ketika: **file** untuk baca/tulis presisi (bukan `cat` via bash); **search** untuk menemukan kode (bukan `grep` via bash); **bash** untuk perintah yang memang butuh shell; **git tool** untuk status/diff/log/commit (bukan `git` mentah — operasi baca dinetralkan dan commit menolak custom filter repo); **web** untuk sumber publik; **memory** untuk fakta lintas sesi (bukan tempelan prompt); **delegate** untuk penelahan paralel yang hasilnya diverifikasi parent.
|
|
6
6
|
|
|
7
7
|
Daftar pasti kapan pun:
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ bun -e "import {allTools} from './src/tools/index.ts'; console.log(allTools.map(
|
|
|
23
23
|
| `apply_patch` | Blok SEARCH/REPLACE multi-hunk ala Aider | Satu call banyak patch |
|
|
24
24
|
| `move_file` | Pindah/rename atomik | Dest yang ada dibackup ke trash dulu (catat path). Dijail di permission layer juga |
|
|
25
25
|
| `delete_file` | Soft-delete ke `.minicode/.trash/` | Undo via `move_file`. Cap 100 terbaru, gitignored. Shared helper `src/lib/trash.ts` |
|
|
26
|
-
| `read_image` | Gambar → konteks model | Base64 utuh + lapor `(bytes mime, tokens)` via `estimateImageTokens`. Cap file-size 2 MB.
|
|
26
|
+
| `read_image` | Gambar → konteks model | Base64 utuh + lapor `(bytes mime, tokens)` via `estimateImageTokens`. Cap file-size 2 MB. Pembukaan memeriksa target canonical, boundary ulang, identitas handle `dev+ino`, dan hardlink (`safeOpenRead`) |
|
|
27
27
|
|
|
28
28
|
Contoh paging:
|
|
29
29
|
|
|
@@ -66,7 +66,7 @@ Batas `BASH_BACKGROUND_MAX_JOBS`; semua job mati saat CLI keluar.
|
|
|
66
66
|
| `git_status` | `status --porcelain + diff --stat + log -10` | cwd jail |
|
|
67
67
|
| `git_diff` | `diff` unstaged atau `--staged` | — |
|
|
68
68
|
| `git_log` | `log --oneline -n` | — |
|
|
69
|
-
| `git_commit` | Commit saja | **Di-gate** seperti `delegate_task` (TTY = minta sekali, non-TTY = tolak; `readonly/plan/allowlist` = tolak). Sub-agent tidak mendapatkannya. Yang sengaja tidak ada: push/amend/reset/rebase/checkout/branch -D/stash drop. Pesan via `-m` tunggal agar `$()`/backtick tidak dieksekusi; `git add -- <paths>` agar file `-weird.txt` tidak jadi flag |
|
|
69
|
+
| `git_commit` | Commit saja | **Di-gate** seperti `delegate_task` (TTY = minta sekali, non-TTY = tolak; `readonly/plan/allowlist` = tolak). Menolak sebelum staging jika config Git efektif memuat custom filter; tinjau filter terpercaya lalu lakukan commit manual. Sub-agent tidak mendapatkannya. Yang sengaja tidak ada: push/amend/reset/rebase/checkout/branch -D/stash drop. Pesan via `-m` tunggal agar `$()`/backtick tidak dieksekusi; `git add -- <paths>` agar file `-weird.txt` tidak jadi flag |
|
|
70
70
|
|
|
71
71
|
## Web
|
|
72
72
|
|
|
@@ -97,7 +97,7 @@ Batas `BASH_BACKGROUND_MAX_JOBS`; semua job mati saat CLI keluar.
|
|
|
97
97
|
| Tool | Spec | Catatan |
|
|
98
98
|
|---|---|---|
|
|
99
99
|
| `mcp_list` | `tools/list` + `resources/list` + `prompts/list` | Read-only, tidak di-gate. Panggil dulu |
|
|
100
|
-
| `mcp_call` | `tools/call` | Di-gate. 1 approval = 1 call. Jalan di luar policy minicode |
|
|
100
|
+
| `mcp_call` | `tools/call` | Di-gate. 1 approval = 1 call. Jalan di luar policy minicode. Abort/timeout setelah request dikirim dilaporkan sebagai `outcome unknown`; periksa state server sebelum retry |
|
|
101
101
|
| `mcp_read` | `resources/read` | Di-gate **meski read-only** (konten pihak ketiga = jalur prompt-injection). Biner diganti penanda ukuran |
|
|
102
102
|
| `mcp_prompt` | `prompts/get` | Di-gate, server merender argumen |
|
|
103
103
|
|
package/docs/verify-benchmark.md
CHANGED
|
@@ -29,6 +29,22 @@ bun run gate:eval --results bench/live.json --min-rate 0.8 --max-median-tokens 8
|
|
|
29
29
|
bun bench/eval-gate.ts --results bench/results.json --min-rate 1 --max-median-tokens 5000 --observe-tokens # observasi: token tak menggagalkan (2–3 run pertama sebelum ambang dikunci)
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
CI menjalankan `test/eval-gate.test.ts` untuk menguji evaluator secara
|
|
33
|
+
deterministik tanpa provider, lalu menjalankan CLI `gate:eval` terhadap output
|
|
34
|
+
`bench:smoke` dan memastikan hasil palsu ditolak. `bench:smoke` hanya menguji
|
|
35
|
+
wiring harness; hanya hasil yang secara eksplisit berlabel `fake: false` dapat
|
|
36
|
+
dinilai, sehingga hasil fake atau artefak lama tanpa asal provider dinyatakan
|
|
37
|
+
bukan bukti kualitas. Evaluasi
|
|
38
|
+
kualitas live tetap harus memakai hasil provider nyata yang tersimpan, serta
|
|
39
|
+
anggaran/provider yang dipilih operator. CI PR dan publish tidak menjalankan
|
|
40
|
+
provider berbayar atau memakai rahasia model; evaluasi live tetap manual karena
|
|
41
|
+
hasil, model, dan anggaran harus dipilih operator secara eksplisit.
|
|
42
|
+
|
|
43
|
+
Skor deterministik menggunakan total langkah aktual seluruh run dibanding
|
|
44
|
+
total batas langkah yang disediakan. Nilai ini berasal dari `usage.steps` saat
|
|
45
|
+
run selesai, atau event `step:started` jika run berakhir dengan error; batas
|
|
46
|
+
konfigurasi tidak lagi dipakai sebagai pengganti langkah aktual.
|
|
47
|
+
|
|
32
48
|
Metrik: resolve rate, steps, token, cost, durasi, memoryHits + delta vs run sebelumnya. Hasil `bench/results.json` (`--out` untuk path lain). Tiap run gagal membawa kelas (`VERIFY_FAIL`/`MAX_STEPS`/`NO_PROGRESS`/`ABORT`) + distribusi global di akhir run; kartu metodologi + log observasi di `bench/HARNESS-CARD.md`.
|
|
33
49
|
|
|
34
50
|
Setiap run memakai `MINICODE_HOME` hermetic sendiri (DB/memory/sesi global tak bocor antar run dan tak menyentuh `~/.minicode` operator). Task boleh membawa `seedMemory`: fakta yang di-seed ke memory run itu — task `follow-convention` hanya lolos bila agen membaca fakta tersebut, sehingga `bun bench/runner.ts --memory on` vs `--memory off` mengukur nilai memory secara diferensial (bukan klaim).
|