@thincoder/core 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/advisor/compaction.mjs +7 -5
- package/advisor/history.mjs +24 -11
- package/advisor/loop.mjs +13 -8
- package/advisor/messages.mjs +72 -8
- package/advisor/run.mjs +24 -13
- package/advisor.mjs +7 -3
- package/agent/chat-call.mjs +14 -9
- package/agent/completion.mjs +28 -40
- package/agent/continue-decision.mjs +14 -8
- package/agent/digest-account.mjs +133 -59
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +2 -1
- package/agent/family-tools.mjs +12 -13
- package/agent/helpers.mjs +17 -72
- package/agent/image-heal.mjs +18 -4
- package/agent/post-turn.mjs +13 -26
- package/agent/record-results.mjs +21 -6
- package/agent/run-stages.mjs +72 -37
- package/agent/run-start.mjs +148 -113
- package/agent/setup-reminders.mjs +187 -91
- package/agent/setup.mjs +204 -138
- package/agent/spawn-child.mjs +2 -2
- package/agent/suspension.mjs +43 -15
- package/agent/timers.mjs +4 -1
- package/agent/turn-domain-text.mjs +105 -0
- package/agent/turn-loop.mjs +54 -22
- package/agent/turn-projection.mjs +127 -227
- package/agent/turn-tool-process.mjs +32 -37
- package/agent-tools/advisor-async.mjs +6 -3
- package/agent-tools/advisor-launch.mjs +5 -5
- package/agent-tools/advisor.mjs +1 -1
- package/agent-tools/async-discard.mjs +7 -2
- package/agent-tools/async-settle.mjs +18 -12
- package/agent-tools/bash-async.mjs +5 -2
- package/agent-tools/batch-closeout.mjs +12 -62
- package/agent-tools/batch-ledger-bind.mjs +19 -8
- package/agent-tools/batch-lifecycle.mjs +37 -11
- package/agent-tools/batch-read.mjs +151 -4
- package/agent-tools/batch-record-write.mjs +5 -5
- package/agent-tools/batch-segment-vocab.mjs +84 -4
- package/agent-tools/batch-skeleton.mjs +18 -14
- package/agent-tools/batch-supersede.mjs +1 -1
- package/agent-tools/batch-tier-gate.mjs +36 -119
- package/agent-tools/batch.mjs +30 -20
- package/agent-tools/browser-async.mjs +5 -2
- package/agent-tools/consult.mjs +10 -7
- package/agent-tools/context.mjs +47 -31
- package/agent-tools/digest-budget.mjs +10 -9
- package/agent-tools/eng.mjs +3 -4
- package/agent-tools/escalate-async.mjs +3 -3
- package/agent-tools/goal.mjs +5 -2
- package/agent-tools/judge-domain.mjs +347 -0
- package/agent-tools/manifest.mjs +2 -2
- package/agent-tools/parent-channel.mjs +6 -3
- package/agent-tools/plan.mjs +11 -10
- package/agent-tools/review-facts.mjs +9 -3
- package/agent-tools/skill.mjs +7 -8
- package/agent-tools/spawn-gates.mjs +5 -16
- package/agent-tools/ssh-session.mjs +6 -3
- package/agent-tools/ssh-transfer.mjs +1 -1
- package/agent-tools/subagent-actions.mjs +2 -2
- package/agent-tools/subagent-async.mjs +11 -8
- package/agent-tools/subagent-scheduler.mjs +9 -9
- package/agent-tools/subagent-spawn.mjs +2 -2
- package/agent-tools/subagent.mjs +5 -18
- package/agent-tools/task.mjs +0 -8
- package/agent.mjs +15 -15
- package/auto-think.mjs +5 -2
- package/compaction-work-state.mjs +230 -0
- package/compress-form.mjs +41 -6
- package/config-defaults.mjs +5 -2
- package/config.mjs +53 -17
- package/context-degrade.mjs +79 -48
- package/context-echo.mjs +6 -26
- package/context-push.mjs +328 -31
- package/context.mjs +203 -141
- package/conventions.mjs +1 -1
- package/declaration.mjs +95 -17
- package/escape.mjs +6 -5
- package/explore-distill.mjs +35 -8
- package/generate-title.mjs +10 -1
- package/knowledge/prompt-resources.md +5 -1
- package/ledger-tools.mjs +50 -50
- package/ledger-write-ops.mjs +43 -16
- package/memory/docs.mjs +51 -15
- package/memory/file-list.mjs +6 -0
- package/model-specs.mjs +87 -21
- package/origin-guard.mjs +190 -0
- package/package.json +1 -1
- package/prompt-files.mjs +33 -11
- package/prompt-overlays.mjs +12 -5
- package/prompts/advisor-design.md +55 -36
- package/prompts/advisor-round1.md +18 -7
- package/prompts/advisor-round2.md +18 -7
- package/prompts/advisor-round3.md +18 -7
- package/prompts/common.md +89 -51
- package/prompts/consult-base.md +2 -3
- package/prompts/discipline-engineering.md +474 -440
- package/prompts/discipline-normal.md +107 -31
- package/prompts/knowledge/business-gates.md +23 -15
- package/prompts/knowledge/decision-quality.md +16 -18
- package/prompts/knowledge/doc-lookup.md +22 -27
- package/prompts/knowledge/document-writing.md +31 -49
- package/prompts/knowledge/documentation-evaluation.md +37 -45
- package/prompts/knowledge/evidence-discipline.md +36 -55
- package/prompts/knowledge/normal-coding-workflow.md +27 -21
- package/prompts/knowledge/normal-delivery-collaboration.md +33 -17
- package/prompts/knowledge/normal-work-management.md +10 -7
- package/prompts/knowledge/product-security.md +22 -17
- package/prompts/knowledge/project-records.md +63 -52
- package/prompts/knowledge/tool-apply-patch.md +12 -13
- package/prompts/knowledge/tool-bash.md +13 -4
- package/prompts/knowledge/tool-batch-eng-coder.md +13 -6
- package/prompts/knowledge/tool-batch-eng-designer.md +14 -6
- package/prompts/knowledge/tool-batch-review.md +12 -6
- package/prompts/knowledge/tool-batch.md +76 -62
- package/prompts/knowledge/tool-browser.md +45 -34
- package/prompts/knowledge/tool-context.md +2 -2
- package/prompts/knowledge/tool-delete.md +5 -1
- package/prompts/knowledge/tool-doc-check.md +25 -24
- package/prompts/knowledge/tool-doc-graph-read.md +3 -3
- package/prompts/knowledge/tool-doc-graph.md +15 -15
- package/prompts/knowledge/tool-edit.md +26 -23
- package/prompts/knowledge/tool-execute.md +9 -4
- package/prompts/knowledge/tool-fetch.md +7 -1
- package/prompts/knowledge/tool-file-ops.md +6 -1
- package/prompts/knowledge/tool-git-read.md +3 -1
- package/prompts/knowledge/tool-git.md +1 -1
- package/prompts/knowledge/tool-glob.md +3 -1
- package/prompts/knowledge/tool-grep.md +5 -2
- package/prompts/knowledge/tool-hashline-edit.md +4 -2
- package/prompts/knowledge/tool-insert-after.md +3 -1
- package/prompts/knowledge/tool-ledger-read.md +6 -13
- package/prompts/knowledge/tool-ledger.md +14 -10
- package/prompts/knowledge/tool-ls.md +2 -0
- package/prompts/knowledge/tool-manifest.md +10 -7
- package/prompts/knowledge/tool-memory.md +15 -11
- package/prompts/knowledge/tool-operations.md +59 -71
- package/prompts/knowledge/tool-plan.md +1 -2
- package/prompts/knowledge/tool-process.md +1 -1
- package/prompts/knowledge/tool-read-history.md +6 -7
- package/prompts/knowledge/tool-read.md +1 -0
- package/prompts/knowledge/tool-settings.md +6 -7
- package/prompts/knowledge/tool-ssh.md +37 -15
- package/prompts/knowledge/tool-subagent.md +37 -39
- package/prompts/knowledge/tool-task.md +3 -1
- package/prompts/knowledge/tool-team-ledger.md +5 -1
- package/prompts/knowledge/tool-tree.md +2 -0
- package/prompts/knowledge/tool-wait-for.md +16 -16
- package/prompts/knowledge/tool-write.md +4 -1
- package/prompts/knowledge/upstream-protocol.md +39 -37
- package/prompts/persona-coder.md +1 -3
- package/prompts/persona-eng-coder.md +5 -5
- package/prompts/persona-eng-designer.md +34 -17
- package/prompts/persona-engineering.md +532 -501
- package/prompts/persona-explore.md +0 -2
- package/prompts/persona-normal.md +17 -9
- package/prompts/persona-plan.md +0 -2
- package/prompts/persona-tester.md +0 -2
- package/prompts/subagent-base.md +0 -2
- package/provider/anthropic.mjs +4 -2
- package/provider/core.mjs +5 -3
- package/provider/errors.mjs +41 -7
- package/provider/google.mjs +5 -3
- package/provider/reasoning-echo.mjs +16 -0
- package/provider/responses.mjs +4 -2
- package/provider/sse.mjs +11 -6
- package/rules.mjs +11 -10
- package/session-lifecycle.mjs +115 -81
- package/session-slot-write.mjs +1 -1
- package/session.mjs +23 -20
- package/shell-identity.mjs +129 -22
- package/skip-dirs.mjs +24 -0
- package/team-ledger.mjs +22 -22
- package/text-budget.mjs +1 -1
- package/think-off.mjs +27 -0
- package/token-ttl.mjs +1 -1
- package/token-window.mjs +278 -88
- package/tool-docs/bash.md +0 -2
- package/tool-docs/consult_start.md +2 -2
- package/tool-docs/consult_stop.md +2 -2
- package/tools/browser.mjs +8 -8
- package/tools/execute.mjs +2 -2
- package/tools/file.mjs +17 -11
- package/tools/git.mjs +12 -12
- package/tools/ops.mjs +2 -2
- package/tools/patch.mjs +1 -1
- package/tools/process-doc-mark.mjs +33 -4
- package/tools/repomap.mjs +25 -3
- package/tools/search.mjs +74 -26
- package/tools/shared.mjs +4 -3
- package/tools/ssh.mjs +5 -5
- package/tools/tree.mjs +32 -10
- package/tools/web-deepseek.mjs +1 -1
- package/tools/web.mjs +2 -2
- package/tools/write-gate-params.mjs +3 -3
- package/window-policy.mjs +118 -78
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
aliases: 文档图, 锚点图, 引用关系
|
|
2
|
-
The graph is stored as edges in the same SQLite file as the ledger (`doc_edges` beside `items`)
|
|
2
|
+
The graph is stored as edges in the same SQLite file as the ledger (`doc_edges` beside `items`) — no second store to keep in step.
|
|
3
3
|
|
|
4
|
-
Edges
|
|
4
|
+
Edges come from one `checkAnchors` pass over each document — the edges and the existence verdicts are taken from the same run, so an edge never disagrees with a pointer verdict.
|
|
5
5
|
|
|
6
6
|
Four questions, one action each:
|
|
7
7
|
- `scan` — collect the edges. It reads the repository's document layers (the `docRoot` keys the write gate uses: requirements, specs, design, modules, batches, standards — `standards` is a directory layer like the rest, its `.md` files, subdirectories included, being the standards), the RTM face (`test/RTM.md` and `test/rtm/*.md`), and the case files those RTM rows name (for `imports` edges). One explicit pass, no watcher, no background index.
|
|
8
8
|
- `forward` — the edges leaving a node: `kind → dst`, each followed by its `evidence`.
|
|
9
|
-
- `reverse` — the edges pointing at a node:
|
|
9
|
+
- `reverse` — the edges pointing at a node: the question plain text search cannot answer ("who cites this section?").
|
|
10
10
|
- `chain` — a layered walk outward from a node, one layer per edge count.
|
|
11
11
|
|
|
12
|
-
Parameters —
|
|
12
|
+
Parameters — none has a default, so a missing one is refused by name rather than answered with an empty result:
|
|
13
13
|
- `target` (required, every action): the project root.
|
|
14
14
|
- `node` (required for forward / reverse / chain): the identity form — `req:F16` · `doc:<path>` · `doc:<path>#<section>` · `case:CLI 41-1` · `symbol:editTool` · `ledger:#2236` · `board:core` · `session:<id>`.
|
|
15
15
|
- `depth` (required for chain): how many edge steps to walk. Hops are counted in edges, not nodes.
|
|
16
|
-
- `kind` (forward / reverse / chain, optional): a comma-separated subset of edge kinds — `cites`, `cites-req`, `mentions-case`, `case-file`, `cites-symbol`, `imports`.
|
|
16
|
+
- `kind` (forward / reverse / chain, optional): a comma-separated subset of edge kinds — `cites`, `cites-req`, `mentions-case`, `case-file`, `cites-symbol`, `imports`. Edges are filtered before sorting and layering, so a narrowed run is a complete run, and it is how the edges a `chain` layer cut off are read back. Omit it to read every kind, ledger projections included; the receipt's first line always prints the set in force.
|
|
17
17
|
- `scope` (`scan` only, optional): re-scan just these documents; every other document's edges stay untouched. The receipt's first field always says whether it scanned `全仓` or `范围 K 档`, so an absent scope is never a silent difference.
|
|
18
18
|
|
|
19
|
-
Use it to answer relationship questions
|
|
19
|
+
Use it to answer relationship questions a full-text search cannot: what a section is cited by, what a requirement's chain down to code looks like, and which batch record or document is the last place a rule was mentioned.
|
|
20
20
|
|
|
21
|
-
Edge kinds and what each
|
|
21
|
+
Edge kinds and what produces each:
|
|
22
22
|
- `cites` — a document path token, with or without a section indicator (`§5`), including `依据 <path>「<quotation>」` lines.
|
|
23
23
|
- `cites-req` — a requirement number (`F16`, `AC-14`) written in a document.
|
|
24
24
|
- `mentions-case` — a test-case number written with its family name (`CLI 41-1`).
|
|
25
25
|
- `case-file` — an RTM row: the row's case number paired with the case file its last cell names.
|
|
26
26
|
- `cites-symbol` — an identifier in backticks (`editTool`).
|
|
27
|
-
- `imports` — a case file's `import … from "<relative path>"`, one edge per named import.
|
|
27
|
+
- `imports` — a case file's `import … from "<relative path>"`, one edge per named import. The only case-to-code edge: a string inside an assertion is a runtime result, not a reference.
|
|
28
28
|
|
|
29
|
-
Each edge carries `evidence` in the fixed form `<referring file> @ <line> 「<the first 80 characters of that line>」` —
|
|
29
|
+
Each edge carries `evidence` in the fixed form `<referring file> @ <line> 「<the first 80 characters of that line>」` — cut from the start of the line, so a reader lands on the right line and sees which one it is.
|
|
30
30
|
|
|
31
31
|
Each edge also carries a state:
|
|
32
32
|
- `ok` — the target was checked and is on disk (document targets only).
|
|
33
|
-
- `目标不在盘` — checked, not on disk. The edge is kept rather than dropped: "this file is gone but three places still cite it" is
|
|
34
|
-
- `判不了存在性` — not checked, or not checkable: requirement numbers, case numbers, symbols, boards and sessions are never claimed to exist, and a document
|
|
33
|
+
- `目标不在盘` — checked, not on disk. The edge is kept rather than dropped: "this file is gone but three places still cite it" is what a reverse query is for. The `dst` is never replaced with a guess.
|
|
34
|
+
- `判不了存在性` — not checked, or not checkable: requirement numbers, case numbers, symbols, boards and sessions are never claimed to exist, and a document in a declared sibling repository is not on this machine either.
|
|
35
35
|
|
|
36
36
|
Reading the output:
|
|
37
37
|
- Every line is text, one edge at a time, followed by its evidence — never a picture.
|
|
@@ -39,11 +39,11 @@ Reading the output:
|
|
|
39
39
|
- Ledger rows are projected in memory, never copied into the edge table: `ledger:#N --task_book--> doc:<path>`, plus `req_doc`, `board` and `executor`. A ledger row changes; a copy would go stale.
|
|
40
40
|
- An empty answer and a degraded one read differently: "this node has no edges" is an empty answer; `本仓无需求层` on a `scan` receipt is a degradation reading, and it still reports which edge kinds the repository can produce.
|
|
41
41
|
- A `chain` layer prints at most 200 edges (`LAYER_CAP`). A wider layer prints its first 200 in sort order, then one self-describing line: `本层并列 M 条,此处印前 200 条;收窄办法 = kind=<取值>(第 n 跳)` — `M` is the layer's true width, not the printed count. A layer whose excess edges are all ledger projections says so instead: `本层无可收窄的 kind(截断部分只有投影类边)`.
|
|
42
|
-
-
|
|
42
|
+
- Re-run with the `kind` that line names to read what was cut off (per kind when one kind is still too wide). Depth truncation is a separate line, `已截断(depth = …)`, never merged with the width line. `forward` and `reverse` are not capped: for a single-node question the count itself is the answer.
|
|
43
43
|
|
|
44
|
-
Business refusals — each names the parameter or the state it is about, and none
|
|
44
|
+
Business refusals — each names the parameter or the state it is about, and none answers with an empty graph:
|
|
45
45
|
- `target` missing, or not on disk: refused by name, and no edge is written.
|
|
46
46
|
- `node` missing (forward / reverse / chain), `depth` missing or not a positive integer (`chain`): refused by name.
|
|
47
|
-
- `kind` outside the closed set: refused
|
|
47
|
+
- `kind` outside the closed set: refused with the offending value named — never treated as an empty set, never answered with "this node has no edges".
|
|
48
48
|
- the ledger database cannot be read: reported as a read failure.
|
|
49
|
-
- the repository has never been scanned (
|
|
49
|
+
- the repository has never been scanned (no `doc_edges` table yet): reported as "not scanned yet — run `scan` first", never as an empty graph.
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
aliases: 编辑, 改档, 修改文件
|
|
2
|
-
Two targeting forms
|
|
2
|
+
Two targeting forms, mutually exclusive:
|
|
3
3
|
|
|
4
|
-
① line-based: `line: N` replaces that
|
|
4
|
+
① line-based: `line: N` replaces that line, `startLine: N, endLine: M` the inclusive 1-based range. No old_string needed when you know the number. Give new_string to replace, or omit it (an empty string deletes too) to delete.
|
|
5
|
+
② content-based: old_string is the region's current content (must match exactly once); new_string is the result of that region.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
old_string matching is tolerant: exact, then a unique whitespace-only variant, then a fuzzy match on a unique window. Indentation width and quote style are normalized on both sides, so a straight-quoted copy matches a curly-quoted original.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Shared lines are kept; new_string-only lines take their position relative to them (LCS order); old_string-only lines are deleted. A replacement never leaves old lines behind.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
A unique single-line old_string with a single-line new_string replaces that line in place (line count unchanged). To add a line without removing anything, use insert_after.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
replace_all applies to content-based edits only: literal replacement of every occurrence — the diff rules do not apply.
|
|
13
|
+
replace_all applies to content-based edits only: literal replacement of every occurrence, and the diff rules do not apply.
|
|
15
14
|
|
|
16
15
|
**Routing — pick the right edit tool:**
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
- Line numbers
|
|
20
|
-
-
|
|
21
|
-
-
|
|
16
|
+
- Targeted change to one existing file → this tool, not write (safer, keeps the change targeted)
|
|
17
|
+
- Delete a line/range by number → omit new_string
|
|
18
|
+
- Line numbers fresh → `line` / `startLine` + `endLine`, no content copy needed
|
|
19
|
+
- Line numbers may have drifted, or whitespace-encoding noise → `hashline_edit` (content-hash addressing, position-independent)
|
|
20
|
+
- Add a line after a known line → insert_after
|
|
21
|
+
- Same change across several files → apply_patch
|
|
22
22
|
- Rewrite an entire file → write
|
|
23
23
|
- Rename a symbol project-wide → `lsp` or `grep` first to map every caller
|
|
24
24
|
|
|
25
|
-
**Batch
|
|
25
|
+
**Batch changes into ONE call via the `edits` array.** Each entry gets its own receipt block in call order; a failing entry is named and the rest still apply.
|
|
26
|
+
A file whose final content the write gate rejects writes nothing and all its entries fail; a file already written is never rolled back.
|
|
27
|
+
One permission ask and one turn instead of N. Per-entry shape and targeting are in the schema.
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
Write-gate parameters:
|
|
30
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
31
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
28
32
|
|
|
29
|
-
Line-number entries in one
|
|
33
|
+
Line-number entries in one array must not overlap: an overlapping pair fails on both sides, each naming the other's range, and the rest of the batch still applies. Each anchors on the numbers you last read, and the receipt stays in call order.
|
|
30
34
|
|
|
31
35
|
Notes:
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
- use the most recent read of the file as the source of old_string / line numbers / hashes — re-read after the file changed
|
|
36
|
+
- A `line` / `startLine` + `endLine` target is judged against the last write to that file. A drifted target is refused, naming the path and two ways on: re-read, or address the region without line numbers. The write point and the offset (`L<startLine>`, `±shift`) are named only when a write point was recorded and the drift can be measured; a file rewritten in full by a write since the last read, a file changed with no recorded write point to check against, and a file whose drift cannot be measured because a write in this session changed it after the recorded write point are each refused without those numbers, and the refusal says why they are unavailable.
|
|
37
|
+
- old_string matching zero times (even fuzzy) is an error; matching twice without replace_all is an error — add surrounding context to make it unique.
|
|
38
|
+
- Never fabricate old_string: copy it verbatim from a read.
|
|
39
|
+
- Use the most recent read as the source of old_string, line numbers and hashes — re-read after the file changed.
|
|
40
|
+
- Returns `Edited <path>: replaced N occurrence(s)` (delete mode: `Deleted line N of <path>` / `Deleted lines N-M of <path>`) plus git diff, syntax-check note and a context block (L..-L..).
|
|
41
|
+
- Batch form returns one block per entry — `edits[i] — failed: <reason>`, the reason verbatim and possibly over several lines — then `edit batch: 2/3 entries applied, 1 failed — 2 file(s) written: a.md, b.md`.
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
aliases: 执行脚本, 运行代码, node
|
|
2
2
|
The child is a pure node ESM environment: top-level `await` and dynamic `import()` are available, and no globals are injected.
|
|
3
3
|
|
|
4
|
-
File reads/writes/searches belong to the dedicated read/ls/glob/grep/write/edit tools
|
|
4
|
+
File reads/writes/searches belong to the dedicated read/ls/glob/grep/write/edit tools, not to execute. If a script genuinely needs fs/path, `import` the `node:` module inside the code — one explicit import line.
|
|
5
5
|
|
|
6
6
|
**Route to execute instead of bash:**
|
|
7
7
|
- `node -e "…"` → execute (inline code; top-level await + import() + console all work)
|
|
8
8
|
- `node <script.mjs>` → execute with scriptFile (runs the file in a child node process)
|
|
9
9
|
- `node --test <file>` / `node --check <file>` → execute with scriptFile + nodeArgs (timeoutMs up to 600000 — long suites fit)
|
|
10
10
|
|
|
11
|
+
Write-gate parameters:
|
|
12
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
13
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
14
|
+
`project` is asked for only where the engineering write gate applies, and only when the call passes no `workdir`.
|
|
15
|
+
|
|
11
16
|
Notes:
|
|
12
17
|
- `console.log(...)` prints to the result; objects are JSON-stringified where needed.
|
|
13
|
-
- A non-zero exit
|
|
14
|
-
- Output is capped at ~50KB;
|
|
15
|
-
- Use `write`/`edit`/`apply_patch` for source edits.
|
|
18
|
+
- A non-zero exit or thrown exception returns the stderr (error + stack) as the result.
|
|
19
|
+
- Output is capped at ~50KB; overrun appends an explicit `[output truncated]` marker — print large results in chunks, or have the script write them to a file (node:fs) and read that file back with the `read` tool.
|
|
20
|
+
- Use `write`/`edit`/`apply_patch` for source edits. `bash` still covers package-manager/CLI subprocesses (`npm test`/`npm publish`/`vsce`), servers, and interactive/TTY programs — execute covers in-process JS and `node <script>`/`node --test`/`node --check`, not arbitrary CLI or long-running programs.
|
|
16
21
|
- Irreversibility: it runs with full filesystem access and no automatic undo — script side effects are permanent; checkpoint (git) before risky bulk operations.
|
|
@@ -8,5 +8,11 @@ Parameters:
|
|
|
8
8
|
Notes:
|
|
9
9
|
- With a DeepSeek provider configured, the page is fetched through DeepSeek's servers and comes back as Markdown (`[deepseek] title + content`); otherwise it is fetched locally and HTML is reduced to readable text (scripts, styles, navigation stripped).
|
|
10
10
|
- Follows one redirect, http/https only; a redirect into an internal, private or metadata address is refused.
|
|
11
|
-
-
|
|
11
|
+
- `FETCH_TIMEOUT` (15 seconds) is the deadline of each search leg and the connect deadline of every proxied request.
|
|
12
|
+
- The Tavily and engine legs abort on it; the DeepSeek leg aborts on its own 15 seconds.
|
|
13
|
+
- The local `fetch` leg passes no signal of its own, so it has no request deadline of its own.
|
|
14
|
+
- Direct, it waits as long as the server takes.
|
|
15
|
+
- Through a proxy the CONNECT/TLS phase is capped at 15 seconds and the response-header phase at 60 (the `_headerTimeoutMs` default — raised from the shared 15 because a DeepSeek queue can exceed 15s TTFB).
|
|
16
|
+
- An `http://` target through a proxy keeps 15 seconds for its header phase.
|
|
17
|
+
- Non-HTML responses come back as-is, truncated at 200000 chars.
|
|
12
18
|
- `fetch.backend: "local"` disables the DeepSeek backend.
|
|
@@ -8,9 +8,14 @@ Parameters:
|
|
|
8
8
|
- action (required): move | copy | rename
|
|
9
9
|
- source (required): source path, relative to cwd or absolute
|
|
10
10
|
- dest (required): destination path
|
|
11
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
12
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
11
13
|
|
|
12
14
|
Notes:
|
|
13
15
|
- Paths resolve relative to cwd — no directory restriction (same boundary as bash; the approval gate is the guard).
|
|
14
|
-
- `
|
|
16
|
+
- `copy` is recursive for directories and merges into what `dest` already holds: an existing directory keeps its own entries and gains the source's, and an existing file is replaced.
|
|
17
|
+
A directory source onto an existing file is refused instead of replaced — `ERR_FS_CP_DIR_TO_NON_DIR` (Node's own `fs.cp` code; measured on win32, not yet measured on POSIX).
|
|
18
|
+
- `move` / `rename` land through the rename syscall, and the platform decides what an existing `dest` does. On Windows (measured on win32) an existing file `dest` is replaced, and an existing directory `dest` fails with `EPERM` — empty or not.
|
|
19
|
+
On POSIX the call keeps `rename(2)` semantics: a file onto a directory fails with `EISDIR`, a directory onto a non-empty directory fails with `ENOTEMPTY` / `EEXIST`, a directory onto an empty one replaces it, and a directory onto an existing file fails with `ENOTDIR`. A cross-device `move` / `rename` falls back to copy + remove.
|
|
15
20
|
- To create a directory, use `write` (creates parent dirs) or `bash mkdir`.
|
|
16
21
|
- Returns one line: `Moved` / `Copied` / `Renamed`, then the two paths exactly as you passed them separated by an arrow; or `Error: ...` (same path, missing path, unknown action).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
aliases: git, 只读, 版本库, 查看提交
|
|
2
|
-
Nothing here writes: no commit, no staging, no branch or tag changes, no push, no checkout, no snapshot restore.
|
|
2
|
+
Nothing here writes the repository: no commit, no staging, no branch or tag changes, no push, no checkout, no snapshot restore. One exception sits in `checkpoint`, described below.
|
|
3
3
|
|
|
4
4
|
The actions this tool face carries: diff / status / log / show / ls-remote / blame / checkpoint list·cat / tag list / branch list / stash list / remote list / worktree list.
|
|
5
5
|
|
|
@@ -10,6 +10,8 @@ The actions this tool face carries: diff / status / log / show / ls-remote / bla
|
|
|
10
10
|
- ls-remote: light remote-ref check — network (`remote`, optional `ref`).
|
|
11
11
|
- blame: file blame (`path` required).
|
|
12
12
|
- checkpoint: snapshots — `checkpointAction` `list` (shows file tree) or `cat` (a file from the snapshot id); `checkpointId` for `cat`.
|
|
13
|
+
`list` first clears this project's snapshot directory when HEAD is newer than the newest snapshot,
|
|
14
|
+
so a `list` can remove files while adding none; `cat` does not take that path.
|
|
13
15
|
- tag / branch / stash / remote / worktree: `tagAction` / `branchAction` / `stashAction` / `remoteAction` / `worktreeAction` `list` only.
|
|
14
16
|
|
|
15
17
|
`filter` narrows any of these outputs (case-insensitive regex); `workdir` runs git in a subdirectory (default: the discovered project repo root); `config` carries `git -c` overrides for `ls-remote`.
|
|
@@ -10,7 +10,7 @@ status / log / diff / show / add / rm / commit / push / tag / branch / checkout
|
|
|
10
10
|
- add: stage files — `path` (granular) or all changes.
|
|
11
11
|
- rm: untrack a file/dir (`git rm --cached` — kept on disk; `path` required).
|
|
12
12
|
- commit: `message` required. With `path` → `git commit --only <paths>`: commits those files' working-tree content only, atomic — other staged batches are NOT mixed in; without → add -A + full commit. New (untracked) files: `git add` them first — the tool refuses a path list with any untracked entry and names them (staging extra is safe — `--only` commits only the listed files).
|
|
13
|
-
- push / fetch / pull: sync with remote — `remote`, `ref`
|
|
13
|
+
- push / fetch / pull: sync with remote — `remote`, `ref`, `tags` for --tags. `push` takes several refs in one space-separated `ref` (so does `ls-remote`); `fetch` and `pull` take exactly one, and a space there is `Invalid ref`.
|
|
14
14
|
- tag / branch: manage via `tagAction` / `branchAction` — list / create (name, optional ref) / delete (snapshots first); branch also switch (name).
|
|
15
15
|
- checkout: switch to `ref`; with `path`, restore a file from the index (discards its working-tree changes — snapshots first).
|
|
16
16
|
- restore: restore a file from index/HEAD (`path` required; `staged` restores the staged copy — snapshots first).
|
|
@@ -7,9 +7,11 @@ Parameters:
|
|
|
7
7
|
- Exclusions: a space-separated `!` token - `**/*.js !test/**` matches .js files except those under test/.
|
|
8
8
|
- Several extension alternatives go in one `{a,b}` group (e.g. `**/*.{js,md}`); adjacent space-separated includes are not a supported form. A pattern containing a literal space is fine on its own - spaces separate patterns only when a `!` exclusion is present.
|
|
9
9
|
- `path`: directory to search in (default cwd).
|
|
10
|
+
- `includeProcessDocs`: include docs from process layers (batch records, archived material) - excluded by default; pass `true` to get them back.
|
|
10
11
|
|
|
11
12
|
Notes:
|
|
12
13
|
- Invalid glob syntax is an EXPLICIT error, never a silent no-match: unsupported extglob dialects (`?(x)` / `@(a|b)` / `+(x)`) and malformed braces (empty `{}`, unclosed `{`, nested `{a,{b,c}}`) return `glob error: ...` - use `{a,b}`, or a space-separated `!exclude`, instead.
|
|
13
|
-
- Skips node_modules
|
|
14
|
+
- Skips noise directories before matching — `node_modules`, `.git`, `dist`, `build`, `.turbo`, `coverage` are examples, not the list. The whole set is `SKIP_DIRS` in `thincoder-core/skip-dirs.mjs`, one list behind the index, the tree walk and both search tools.
|
|
14
15
|
- Results are capped at 1000 matches.
|
|
16
|
+
- Every row carries the layer label of its document, e.g. `[design] docs/core/design/TOOLS.md`; when rows from process layers are excluded (or included on request), a final line reports how many. Excluded rows spend none of the 1000-match cap.
|
|
15
17
|
- Prefer a pattern with a literal anchor (an extension or a subdirectory) over a bare wildcard.
|
|
@@ -9,10 +9,13 @@ Parameters:
|
|
|
9
9
|
- `literal`: literal string match, no regex interpretation (default false; use it for strings carrying `.` or `\`).
|
|
10
10
|
- `before`: lines of context to show before each match (like `grep -B`). Default 0.
|
|
11
11
|
- `after`: lines of context to show after each match (like `grep -A`). Default 0.
|
|
12
|
+
- `includeProcessDocs`: include docs from process layers (batch records, archived material) - excluded by default; pass `true` to get them back.
|
|
12
13
|
|
|
13
14
|
Notes:
|
|
14
|
-
- Skips node_modules
|
|
15
|
+
- Skips noise directories before matching — `node_modules`, `.git`, `dist`, `build`, `.turbo`, `coverage` are examples, not the list. The whole set is `SKIP_DIRS` in `thincoder-core/skip-dirs.mjs`, one list behind the index, the tree walk and both search tools.
|
|
15
16
|
- Results are capped at 200 matches.
|
|
16
|
-
-
|
|
17
|
+
- Every document row carries its layer label at line start, e.g. `[design] path:line: text`; a row from a process layer keeps the `[process doc: not a design basis]` prefix and then its layer.
|
|
18
|
+
- When the output would contain rows from process layers, a final line reports how many were excluded, or how many were included on request. Excluded rows spend none of the 200-match cap.
|
|
19
|
+
- Unreadable files are skipped silently, and so is anything over 10 MB. A binary file is not detected as one: it is read as UTF-8 and searched, so a match inside it can come back garbled.
|
|
17
20
|
- Use this to find usages, definitions and patterns; use `glob` to find files by name.
|
|
18
21
|
- With `before` / `after`: a matching line uses the `:` separator and a context line uses `-` (as in ripgrep), and overlapping context ranges in one file are merged and de-duplicated - you see each context line once.
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
aliases: 按行哈希, 精确改行
|
|
2
|
-
More reliable than `edit` when whitespace or encoding varies, because the addresses are line
|
|
2
|
+
More reliable than `edit` when whitespace or encoding varies, because the addresses are SHA256 hashes of the line text after UTF-8 decoding and CRLF-to-LF normalization — the same rule `read` uses with `hashes=true` — not of the raw bytes on disk.
|
|
3
3
|
|
|
4
4
|
Parameters:
|
|
5
5
|
- `path` (required): file path.
|
|
6
6
|
- `old_hashes` (required): array of the line hashes to replace (12-char hex). Read the file with `hashes=true` first to get them; a single line takes `[hash]`, a contiguous block takes `[hash1, hash2, ...]` in order.
|
|
7
7
|
- `new_content` (required): the replacement text (multi-line ok, `\n` separated).
|
|
8
|
+
- `ledger`: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
9
|
+
- `project`: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
8
10
|
|
|
9
11
|
Notes:
|
|
10
12
|
- Hashes are position-independent: they identify lines by content, not by line number, so a line-number drift after an edit does not touch them.
|
|
11
|
-
- When the hash sequence is not found, the error carries the file's
|
|
13
|
+
- When the hash sequence is not found, the error carries the current hashes of the file's first 50 lines (all of them when the file is shorter), each with its line number and the first 80 characters of that line.
|
|
12
14
|
- Prefer this over `edit` when (1) the file may have mixed whitespace or encoding, or (2) you want to edit a block of lines in one call.
|
|
13
15
|
- The replacement replaces exactly the lines the hashes identify - whatever is not in `new_content` is deleted. For a new line after a known line use `insert_after`; for a single simple string swap use `edit`.
|
|
14
16
|
- Re-read the file after it changed: hashes taken before a write are stale.
|
|
@@ -6,10 +6,12 @@ Parameters:
|
|
|
6
6
|
- `content` (required): the text to insert; it becomes its own line, placed after the target line.
|
|
7
7
|
- `after_line`: line number to insert after (1-based). Preferred when you know the exact line number from `read`.
|
|
8
8
|
- `after_regex`: a JavaScript regex finding the line to insert after. It must match exactly one line; when it matches several the tool errors and shows the matching line numbers.
|
|
9
|
+
- `ledger`: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
10
|
+
- `project`: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
9
11
|
|
|
10
12
|
Notes:
|
|
11
13
|
- Either `after_line` or `after_regex` is required; if both are given, `after_line` wins.
|
|
12
14
|
- Use this instead of `edit` when you are adding a line - a checklist item, a doc heading, a line of prose, a function, an import, or a block - rather than fabricating surrounding context to anchor an exact-string match.
|
|
13
15
|
- Returns a diff of the change.
|
|
14
|
-
- **Read-before-insert guard**: `after_line` is judged against the last write to that file
|
|
16
|
+
- **Read-before-insert guard**: `after_line` is judged against the last write to that file: a line above that write's write point is allowed, and a line at the write point itself is allowed only when that write was itself an insertion. Inside or below it the call is refused, naming the path and two ways on: re-read, or address the region without line numbers. The write point and the offset (`L<startLine>`, `±shift`) are named only when a write point was recorded and the drift can be measured; a file rewritten in full by a write since the last read, a file changed with no recorded write point to check against, and a file whose drift cannot be measured because a write in this session changed it after the recorded write point are each refused without those numbers, and the refusal says why they are unavailable.
|
|
15
17
|
- Take line numbers from the most recent `read` of that file; re-read after the file changed.
|
|
@@ -5,31 +5,24 @@ A row is one requirement point or one piece of engineering debt. The six states
|
|
|
5
5
|
|
|
6
6
|
Use it to find what work is already queued before proposing more: the open rows on your board, what is in flight for this batch record, and how old the unsettled ones are.
|
|
7
7
|
|
|
8
|
-
Adding, moving or settling a row belongs to the main agent
|
|
8
|
+
Adding, moving or settling a row belongs to the main agent; calling one directly is refused before anything is written.
|
|
9
9
|
|
|
10
10
|
The other filters:
|
|
11
|
-
|
|
12
11
|
- `kind` — requirement vs tech_todo (the field itself holds those two words).
|
|
13
12
|
- `board` — the owning board (a requirement-document name).
|
|
14
13
|
- `trigger` — the tech-todo trigger.
|
|
15
14
|
- `task_book` — the task-book pointer, i.e. the row → batch lookup.
|
|
16
15
|
|
|
17
|
-
Rows come back 10 per page, with or without filters — a filter narrows what is eligible, not how many
|
|
18
|
-
|
|
19
|
-
- Every page ends with a tail line giving the total, this page's rank range, and — when another page exists — the command for it: `ledger({action:"query"<the filters in force>, cursor:"<cursor>"})`. Run that line whole: it repeats this page's filters, and copying only the `cursor` drops them. Omit `cursor` for the first page; a malformed one is refused, never treated as page one.
|
|
16
|
+
Rows come back 10 per page, with or without filters — a filter narrows what is eligible, not how many a page carries.
|
|
17
|
+
- Every page ends with a tail line giving the total, this page's rank range and, when another page exists, the command for it: `ledger({action:"query"<the filters in force>, cursor:"<cursor>"})`. Run that line whole: it repeats this page's filters, and copying only the `cursor` drops them. Omit `cursor` for the first page; a malformed one is refused, never treated as page one.
|
|
20
18
|
- `count` is a different book: it counts the four unsettled states only, while a page's total covers all six.
|
|
21
19
|
|
|
22
20
|
Every returned row carries a reading about itself:
|
|
23
|
-
|
|
24
21
|
- `aged` — unsettled and older than 30 days.
|
|
25
22
|
- `evidenceTooLong` — the evidence text is too long to read.
|
|
26
23
|
- `taskBookOnDisk` — the row's task-book file part resolves and is on disk.
|
|
27
24
|
- `overdue` — the exit state as one word (resume_due / dangling / unlabeled / aged); first match wins.
|
|
28
25
|
|
|
29
|
-
`cwd` decides which project's ledger is read
|
|
30
|
-
|
|
31
|
-
The
|
|
32
|
-
|
|
33
|
-
A relative path resolves against the session anchor, and the project root is taken inside the anchor; outside it, no project is attached.
|
|
34
|
-
|
|
35
|
-
Rows are stored in the user data directory keyed by project root, so a query never reads another project's book by accident and the repository stays free of ledger files.
|
|
26
|
+
`cwd` decides which project's ledger is read; omit it for the session anchor. A relative path resolves against the anchor, and the project root is taken inside it — outside it no project is attached.
|
|
27
|
+
The root is the nearest ancestor directory carrying PROJECT-MANIFEST.json; a ledger file sitting on disk does not make a project.
|
|
28
|
+
The book lives in the user data directory keyed by project root, so a query never reads another project's book and the repository stays free of ledger files.
|
|
@@ -4,12 +4,16 @@ aliases: 台账, 待办, 记账
|
|
|
4
4
|
- `add`: a new entry lands in `待讨论`.
|
|
5
5
|
- `kind` = `requirement` (requirement pool) / `tech_todo` (engineering debt).
|
|
6
6
|
- `trigger` = `归批` / `条件` / `认账不排期` (optional).
|
|
7
|
-
- `resume_when` = the sentence saying when the entry resumes (optional; when given it may not be blank, and it may carry an anchor `@YYYY-MM-DD` (judged) or `@<event>` (not judged
|
|
7
|
+
- `resume_when` = the sentence saying when the entry resumes (optional; when given it may not be blank, and it may carry an anchor `@YYYY-MM-DD` (judged) or `@<event>` (not machine-judged)).
|
|
8
8
|
- **The `task_book` gate** — same on `add` and `update`, judged on what this call writes. An entry that ends up in `在途` / `待核销`, or a call that sets `trigger` = `归批`, must carry `task_book`: absent / empty / blank is refused.
|
|
9
|
-
- A call that writes `task_book` (non-empty), or that sets `trigger` = `归批`, is also held to the pointer: its file part, the text before the first `§`, must resolve
|
|
10
|
-
- A call that does not touch the pointer is not judged: a stale pointer
|
|
11
|
-
- **Reserved pointer** —
|
|
12
|
-
|
|
9
|
+
- A call that writes `task_book` (non-empty), or that sets `trigger` = `归批`, is also held to the pointer: its file part, the text before the first `§`, must resolve with that file on disk, else refused.
|
|
10
|
+
- A call that does not touch the pointer is not judged: a stale pointer from an earlier call never blocks a `status` / `evidence` / other-field update — "is the file on disk" is the `taskBookOnDisk` reading, not a gate.
|
|
11
|
+
- **Reserved pointer** — the marker `(预定)` at the tail of the value (`docs/batches/<x>.md(预定)`) registers the intent to work a record that does not exist yet;
|
|
12
|
+
that pointer passes the gate while its file is absent (`taskBookOnDisk` stays `false`, a reading not a gate).
|
|
13
|
+
It must be a project-relative path — no declared-repo prefix, no absolute path — must sit under this project's batch root,
|
|
14
|
+
and the record must not be on disk yet: any of the three failing is refused, naming the pointer and the legal form.
|
|
15
|
+
Once that record is on disk the marker is surplus and refused (drop it).
|
|
16
|
+
- `batch create` on that same path later **claims this row** instead of opening a second one: the pointer becomes the plain form, the row goes to `在途`, no new row appears. Omit `ledger` and `newDebt` there and a reserved row for the path wins before the same-face check. Two reserved rows on one path are refused, each named — picking one would silently drop the other's intent.
|
|
13
17
|
- `close --batch`: settles only the rows already at `待核销`. `待讨论` / `待设计` rows are skipped and named (move them to `在途` first to claim them), `在途` rows are skipped and named (they cannot be jumped), settled and withdrawn rows are not counted.
|
|
14
18
|
- `status` may be omitted (default `已核销`) and can only be `已核销`.
|
|
15
19
|
- `query`: equality filters (`status` / `kind` / `board` / `trigger` / `task_book`); with none given, every row is eligible. Rows come back 10 per page either way — a filter narrows which rows are eligible, not how many a page carries. Each row carries:
|
|
@@ -18,19 +22,19 @@ aliases: 台账, 待办, 记账
|
|
|
18
22
|
- `taskBookOnDisk` — the `task_book` file part resolves and that file is on disk.
|
|
19
23
|
- `overdue` — the exit state as a word: `resume_due` / `dangling` / `unlabeled` / `aged`, first match wins.
|
|
20
24
|
- The six states: `待讨论` / `待设计` / `在途` / `待核销` / `已核销` / `已废弃`.
|
|
21
|
-
- **Every page ends with a tail line
|
|
25
|
+
- **Every page ends with a tail line**: the total, this page's rank range, and — when another page exists — the command for it, `ledger({action:"query"<the filters in force>, cursor:"<cursor>"})`. **Run that line whole**: it repeats this page's filters, and copying only the `cursor` drops them, so the next page comes from the unfiltered set with no error. Omit `cursor` for the first page; a malformed one is refused, never treated as page one.
|
|
22
26
|
- `count` is a different book: it counts the four unsettled states only, while a page's total covers all six.
|
|
23
|
-
- `count`: `{ count, overdue, evidenceTooLong }
|
|
27
|
+
- `count`: `{ count, overdue, evidenceTooLong }` — rows in the four unsettled states; how many of those are in an overdue exit state; how many carry over-long evidence. `count` takes `task_book` only: every other filter (`status` / `kind` / `board` / `trigger`) is refused as an unknown parameter (`未知参数:…`), so filter after counting or use `query`.
|
|
24
28
|
- `query` / `count` are read-only and open to every role; `add` / `update` / `close` write and are main-agent only.
|
|
25
29
|
- `update`: moves an entry along the six-state table, edge by edge — `待讨论→待设计` / `待讨论→在途` / `待设计→在途` / `在途→待核销` / `在途→待讨论` / `待核销→已核销` / `待核销→在途` / `待核销→待讨论` / any unsettled state → `已废弃`. `已核销` and `已废弃` are terminal; every edge not on that list is refused.
|
|
26
30
|
- `待讨论→在途` is the ignition path: opening a batch moves its coverage rows straight to `在途`, never through `待设计` (`待设计` means design is scheduled, not that ignition happened).
|
|
27
|
-
- `待核销→在途` is the reopen or manual return path and always writes the current session as executor
|
|
31
|
+
- `待核销→在途` is the reopen or manual return path and always writes the current session as executor; an explicit old executor does not override it.
|
|
28
32
|
- `在途→待讨论` and `待核销→待讨论` return unfinished work to the waiting pool. They require this call's non-blank `evidence` as the reason, append it to the row, clear `executor` / `task_book` / `trigger`, preserve `created_at`, and return `reason` in the receipt.
|
|
29
33
|
- Give exactly one of `id` / `batch`.
|
|
30
34
|
- `status` omitted = update only the fields you passed; `resume_when` omitted = unchanged; `executor` omitted = entering `待设计` / `在途` writes this session, and leaving `在途`, returning to `待讨论`, or withdrawing clears it.
|
|
31
|
-
- `evidence` appends (old value non-empty ⇒ `old|new`, nothing around `|`; old empty ⇒ written as given). `evidenceReplace: true`
|
|
35
|
+
- `evidence` appends (old value non-empty ⇒ `old|new`, nothing around `|`; old empty ⇒ written as given). `evidenceReplace: true` with `evidence` replaces the whole text; the flag alone, or a blank new value, is refused.
|
|
32
36
|
- `update --batch`: one migration across a batch (`batch` = the batch-record pointer; the rows whose `task_book` sits on that record are handled together).
|
|
33
|
-
- With `status` ⇒ every row
|
|
37
|
+
- With `status` ⇒ every row re-judged against the migration table; without `status` ⇒ a pure field patch, `status` untouched.
|
|
34
38
|
- Receipt `{ batch, status, applied, skipped }`; each skipped row is named `{ id, from, why }` (`why` = that row's own refusal text) and the rest still land; a transaction-level failure rolls the whole batch back.
|
|
35
39
|
- A `batch` that does not resolve to a record on disk is refused.
|
|
36
40
|
- `close`: settle (`待核销 → 已核销`) — the one settling edge. `待讨论` / `待设计` / `在途` are refused, naming the current state and that state's way out. Withdrawal is allowed only from an unsettled state; both archived states reject further archival writes.
|
|
@@ -6,8 +6,10 @@ Directories listed first. Use to see what a directory contains (glob only matche
|
|
|
6
6
|
Parameters:
|
|
7
7
|
- path: Directory path (default cwd)
|
|
8
8
|
- filter: Only list entries matching this glob (e.g. '*.mjs', '*test*') — a wildcard filter, not a full listing
|
|
9
|
+
- includeProcessDocs: include docs from process layers (batch records, archived material) — excluded by default; pass `true` to get them back
|
|
9
10
|
|
|
10
11
|
Notes:
|
|
11
12
|
- Shows first 500 entries
|
|
12
13
|
- Directories are suffixed with `/` and listed before files
|
|
14
|
+
- A file row carries its layer label after the name (`TOOLS.md [design]`); directory rows carry none. When file rows from process layers are excluded (or included on request), a final line reports how many. Excluded rows spend none of the 500-entry cap.
|
|
13
15
|
- Use this for a quick overview; use glob when you have a specific file pattern in mind
|
|
@@ -2,7 +2,7 @@ aliases: 清单, 项目档案, 文档根
|
|
|
2
2
|
Subagents carry a read-only variant (action `read`); init / write stay main-agent only.
|
|
3
3
|
|
|
4
4
|
Actions:
|
|
5
|
-
- read — report the state with a stable anchor `state=ok|missing|invalid|workspace|no-project`. The ok state prints the manifest JSON plus missingKeys / errors rows (only when non-empty).
|
|
5
|
+
- read — report the state with a stable anchor `state=ok|missing|invalid|workspace|no-project`. The ok state prints the manifest JSON plus missingKeys / errors rows (only when non-empty). It never throws — a missing manifest is reported, not refused.
|
|
6
6
|
- init — create the default manifest where the project root resolves. Refused when one already exists — init never overwrites.
|
|
7
7
|
- write <key> <value> — point-edit one node: read, set, write back through the writer gate. The result must validate (a fault is refused, disk byte-for-byte unchanged); a missing manifest is refused — run init first.
|
|
8
8
|
|
|
@@ -14,18 +14,21 @@ key — dot path into the manifest: version / phase / codePaths, or a sub-key of
|
|
|
14
14
|
|
|
15
15
|
value — JSON first (null / true / 5 / ["a","b"]), else a literal string (docs/design). "null" is the explicit "no such face" for docRoot.<key>: a legal value, not a deletion.
|
|
16
16
|
|
|
17
|
-
Refusals throw `manifest <action>: refused — …`; a missing parameter throws `manifest <action>: <param> is required
|
|
17
|
+
Refusals throw `manifest <action>: refused — …`; a missing parameter throws `manifest <action>: <param> is required …`,
|
|
18
|
+
and what follows takes that parameter's own form — a dash clause for `target`, a parenthetical for `key` and `value` —
|
|
19
|
+
so match on `is required`, not on the punctuation after it.
|
|
20
|
+
Both leave the disk unchanged; the written file reaches the project-state line next turn.
|
|
18
21
|
|
|
19
22
|
read is read-only (no approval); init / write are side effects (approval gate).
|
|
20
23
|
|
|
21
24
|
Key catalog — the 15 writable nodes (3 whole keys + docRoot's 6 sub-keys + index's 6 sub-keys): what each is; when to change it; wrong ⇒ consequence.
|
|
22
25
|
- `version` — schema version (a number); change on migration; wrong ⇒ validation refuses.
|
|
23
26
|
- `phase` — `initial-dev` / `production`; change when the stage is crossed; wrong ⇒ validation refuses.
|
|
24
|
-
- `codePaths` — path segment names (segment match at any depth; **no default segment** — the key is empty until the project declares one, so a project that never declares it has no code segment and a `.md` under `src/` reads as a document); change when the layout moves; wrong ⇒ no segment is classified.
|
|
27
|
+
- `codePaths` — path segment names (segment match at any depth; **no default segment** — the key is empty until the project declares one, so a project that never declares it has no code segment, and a `.md` under `src/` reads as a document); change when the layout moves; wrong ⇒ no segment is classified.
|
|
25
28
|
- `docRoot.requirements` · `docRoot.specs` · `docRoot.design` · `docRoot.modules` · `docRoot.batches` — each doc-layer root (a string | a multi-root array | `null` = absent); change when a layer moves; wrong ⇒ validation refuses, or checks / batch landing / review roots point elsewhere.
|
|
26
|
-
- `docRoot.standards` — the standards **layer**: one directory of `.md` files (a string | a multi-directory array | `null` = no such face; default `null` —
|
|
29
|
+
- `docRoot.standards` — the standards **layer**: one directory of `.md` files (a string | a multi-directory array | `null` = no such face; default `null` — no default directory, so no default name to guess); members = every `.md` file under it, subdirectories included, in layer-root-relative path order (case-insensitive; symbolic links not followed); change it when a standards document is added or the layer moves; wrong ⇒ the reviewer reports the declaration unreadable and names the path, splitting the cause (no such directory / not a directory / no .md file), never a silent skip. A file path is not accepted (one key, one meaning).
|
|
27
30
|
- `index.codeExtensions` · `index.docExtensions` — extra code / doc extensions (unioned, add-only); change when a type is missing from the index; wrong ⇒ that type stays out.
|
|
28
31
|
- `index.excludePaths` — project-root-relative prefixes for the index; change to keep a directory out; wrong ⇒ it is still indexed, or another is wrongly excluded.
|
|
29
|
-
- `index.docCheckExcludePaths` — project-root-relative prefixes the document check leaves alone: a document under one
|
|
30
|
-
- `index.publicRepos` — public-repo paths (resolvable from this repo root) = this repo's out-edge table: a repo listed here may be **searched and cited**. Change it when wiring one in or dropping one
|
|
31
|
-
- `index.writableRepos` — external **directories** this repo may write into (directories, not repos — no `.git` / manifest is read; resolvable from this repo root) = this repo's write-rights table, one-way: the target gets no say, git permissions are the real defence. A target inside the table ⇒ the write gate takes the ledger row number from **this** project's ledger and books the change here;
|
|
32
|
+
- `index.docCheckExcludePaths` — project-root-relative prefixes the document check leaves alone: a document under one is not judged and not counted, and a manifest that cannot be read excludes nothing, so every document is judged. Not interchangeable with `index.excludePaths`, which the index reads.
|
|
33
|
+
- `index.publicRepos` — public-repo paths (resolvable from this repo root) = this repo's out-edge table: a repo listed here may be **searched and cited**. Change it when wiring one in or dropping one; not listed ⇒ that repo is outside this project's searchable corpus and is not a source this project can cite. Not interchangeable with `index.writableRepos` (reading ≠ writing).
|
|
34
|
+
- `index.writableRepos` — external **directories** this repo may write into (directories, not repos — no `.git` / manifest is read; resolvable from this repo root) = this repo's write-rights table, one-way: the target gets no say, and git permissions are the real defence. A target inside the table ⇒ the write gate takes the ledger row number from **this** project's ledger and books the change here; outside it ⇒ the gate refuses and names this table. Change it only when you mean to spend **this repo's** account on an external directory — empty means the target can only be written under its own account. Not interchangeable with `index.publicRepos` (reading ≠ writing). Wrong ⇒ that directory's writes are still refused (the refusal names `writableRepos` and the target), or a directory you did not mean to open sits in the table.
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
aliases: 记忆, 长期记忆, 存记忆
|
|
2
|
-
The action
|
|
3
|
-
- search — find knowledge saved in previous sessions; each result row carries [layer]
|
|
4
|
-
- put — save knowledge for future sessions; type = rule (coding standards) / knowledge (project facts) / decision (architecture decisions) / pattern (debugging/workflow patterns)
|
|
5
|
-
- list — inventory what memory holds; one row per entry
|
|
6
|
-
- delete
|
|
7
|
-
-
|
|
8
|
-
-
|
|
2
|
+
The action picks the operation:
|
|
3
|
+
- search — find knowledge saved in previous sessions; each result row carries [layer] plus an entry id whose prefix is the layer.
|
|
4
|
+
- put — save knowledge for future sessions; type = rule (coding standards) / knowledge (project facts) / decision (architecture decisions) / pattern (debugging / workflow patterns).
|
|
5
|
+
- list — inventory what memory holds; one row per entry as [layer] id [type] title (date); a truncated list notes the full count.
|
|
6
|
+
- delete, single: {id, layer} removes the entry shown in put / search / list output. `layer` is optional — passed, it is validated against the id prefix and a mismatch is refused (guards against deleting the wrong entry); omitted, the id prefix routes the delete.
|
|
7
|
+
- delete, batch (no id): {layer, type and/or keyword} removes every matching entry in that layer — layer plus at least one of type / keyword is required. Without confirm:true it returns the count and a preview; a layer-wide wipe without filters is refused on every layer.
|
|
8
|
+
- clear — {layer: "personal", confirm: true} wipes ALL personal entries. It is personal-only: a missing layer or a project / team layer is refused (use delete batch filters on shared layers).
|
|
9
|
+
- maintain — index self-maintenance, dry run by default: without confirm:true you get the plan and its readings and nothing is written; confirm:true executes. It takes no layer — it works on the whole store.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Write-gate parameters:
|
|
12
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
13
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
Layer = the memory tier: personal (private) / project (shared via this repo's .thincoder/memory/) / team (CLI only, git-synced). The [layer] tag, the id prefix and the layer parameter are one concept — pass a result row's [layer] as layer.
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
Team deletion is local only: a later team sync may bring the entry back while the remote still holds it.
|
|
18
|
+
|
|
19
|
+
Save bugs, conventions and preferences here — they persist across sessions. Session message history is NOT in memory — search it with read_history.
|