@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,62 +1,73 @@
|
|
|
1
1
|
aliases: 台账, 待办, 项目记录
|
|
2
2
|
## Ledger — the project's todo book
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
Use the ledger as the project's only todo-tracking surface.
|
|
4
|
+
It contains the requirement pool for user requirement points and tech todos for engineering debt, and persists across sessions.
|
|
5
|
+
Store it by project root in the user data directory, outside the work tree; leave no ledger file in the project.
|
|
6
|
+
An empty read means no ledger exists yet; the first write creates it.
|
|
7
|
+
Use six states: 待讨论 → 待设计 → 在途 → 待核销 are unsettled; 已核销 and 已废弃 are archive states.
|
|
8
|
+
Every role may read with `ledger` `action=query/count`.
|
|
9
|
+
`cwd` defaults to the session project root; pass an absolute path for another project.
|
|
10
|
+
Only the main agent writes ledger rows; subagent assemblies have no write command.
|
|
11
|
+
Treat the ledger as a subagent's input, not its write surface; send new findings to the parent for booking.
|
|
12
|
+
Fix, escalate or book every unresolved gap, difference or limitation instead of leaving it only in prose, comments or inline notes.
|
|
13
|
+
Use an in-document "noted on the record" registration only for ruled items with judgment, reasons and a resolution window.
|
|
14
|
+
Anchor entries to requirement-doc sections, batch-record sections or evidence lines.
|
|
11
15
|
|
|
12
16
|
## Batch record — the carrier of task flow
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
**Mode scope**: the documentation system is the same across all modes; the difference from engineering mode = whether strong process constraints apply.
|
|
23
|
-
**Six-segment map (one segment, one author)**: §1 discussion = the main agent.
|
|
24
|
-
§2 batch task & design = eng-designer (engineering) ∥ the main agent (normal) · §3 design review findings = the review subagent (advisor).
|
|
25
|
-
§4 user approval = the main agent · §5 implementation record = eng-coder (engineering) ∥ the implementer (normal — the main agent working directly ∥ a coder taking it on).
|
|
26
|
-
§6 verification & closeout = the main agent (the parent, as seen by subagents).
|
|
27
|
-
**Writing means**: the `batch` tool — **no path parameter** (the target record is bound to you at spawn); **the segment number follows from your identity**; if the write does not land ⇒ say "§× not written" plainly in your report.
|
|
28
|
-
**The task book itself**: `batchDoc` = the batch-record path — §2 of that record for eng-coder, the whole record for eng-designer (mandatory on every eng-designer / eng-coder spawn); unreadable ⇒ refused — executing without it runs a whole round on a guessed direction, so bounce it back.
|
|
29
|
-
**This section maps the segments only**: each segment and its author — structure rules, gates and the lifecycle are not restated here.
|
|
30
|
-
**Per repo, its own record**: batch records live in their own repo — the base root resolves from the session anchor's project declaration.
|
|
31
|
-
**A cross-repo create is refused — that is the correct behavior**, because a cross-repo record cannot be created or closed and a workaround only produces an account that does not exist.
|
|
32
|
-
A task spanning several repos ⇒ **each repo gets its own record and its own batch**.
|
|
33
|
-
## Doc vs process — state goes in the state doc, process in the process doc
|
|
34
|
-
**Process lives in the process doc; state lives in the state doc** — a mixed doc makes the reader work out which value is still alive.
|
|
35
|
-
The **process doc = the batch record** — how this one round was run.
|
|
36
|
-
The **state doc = requirement docs / design docs** — what is true now, and how it is built now.
|
|
37
|
-
**A state doc** states what is true now. History lives in git; a past value left in the doc is retrieved as current guidance.
|
|
38
|
-
**Why (three layers — miss one and you get the boundary cases wrong)**:
|
|
39
|
-
① **Reader side** — a state doc's reader is always asking "what is it **now**"; hand them a run of historical values and they must work out which one is still alive = **their judgment wasted**.
|
|
40
|
-
② **Retrieval side** — a stale value gets retrieved and **read as the current way** ⇒ this is not tidiness, it is **error propagation**.
|
|
41
|
-
③ **Lifetime side** — a state doc **lives long**; what goes in **cannot be cleaned out**. A process doc **can be cleaned up whole** (a maintainer may drop an entire record without losing normative content) ⇒ process has to live there to be **cleanable at all**.
|
|
42
|
-
**The test is one question**: *would this sentence still mean something once this round is over?* Yes ⇒ it is state; keep it. No ⇒ it is process; delete it.
|
|
43
|
-
**Process (delete-eligible in a state doc)**: symptom · root cause · problem statement · reproduction · trial readings · experimental rejection details · change trail · superseded values.
|
|
17
|
+
Use one batch record to carry one implementation round from start through closeout.
|
|
18
|
+
Take its path from `batchDoc`; resolve relative paths against session cwd first, then candidate project roots, or use an absolute path.
|
|
19
|
+
Never guess or hard-code the batch-record location.
|
|
20
|
+
Treat every batch record as disposable execution history that a maintainer may delete whole.
|
|
21
|
+
Do not delete records automatically or after every round.
|
|
22
|
+
Tend to one when keeping it costs more than its value, such as when repair costs more than dropping a polluted record.
|
|
23
|
+
Keep every lasting mechanism, decision and criterion in requirement or design docs so deleting all batch records loses nothing.
|
|
24
|
+
Only batch records cite spec docs, never the reverse.
|
|
25
|
+
Use the same documentation system in all modes; engineering mode adds strong process constraints.
|
|
44
26
|
|
|
45
|
-
|
|
27
|
+
Assign one author to each segment:
|
|
28
|
+
- §1 discussion: main agent.
|
|
29
|
+
- §2 batch task and design: eng-designer in engineering mode; main agent in normal mode.
|
|
30
|
+
- §3 design review findings: review subagent (advisor).
|
|
31
|
+
- §4 user approval: main agent.
|
|
32
|
+
- §5 implementation record: eng-coder in engineering mode; the implementer in normal mode, whether main agent or coder.
|
|
33
|
+
- §6 verification and closeout: main agent, called the parent by subagents.
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
Write each segment only during its own step:
|
|
36
|
+
| Segment | Written |
|
|
37
|
+
|---|---|
|
|
38
|
+
| §1 | while discussion runs; record a ruling in its turn |
|
|
39
|
+
| §2 | at design time |
|
|
40
|
+
| §3 | at the end of each review round |
|
|
41
|
+
| §4 | when the user approves |
|
|
42
|
+
| §5 | when implementation is delivered |
|
|
43
|
+
| §6 | only at closeout; keep it empty before then |
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
Write through the `batch` tool without a path parameter.
|
|
46
|
+
The spawn binds the target record and your identity determines the segment.
|
|
47
|
+
If a write fails, state "§× not written" plainly in your report.
|
|
48
|
+
`batchDoc` is mandatory for every eng-designer and eng-coder spawn.
|
|
49
|
+
For eng-coder, §2 is the task book; for eng-designer, the whole record is.
|
|
50
|
+
Refuse and bounce back an unreadable task book.
|
|
51
|
+
Keep each repo's records in that repo, resolving the base root from the session anchor's project declaration.
|
|
52
|
+
Refuse cross-repo creation.
|
|
53
|
+
Give each repo its own record and batch when work spans repositories.
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
## Doc vs process — state goes in the state doc, process in the process doc
|
|
56
|
+
Put process in the batch record and current state in requirement and design docs.
|
|
57
|
+
State docs answer what is true and how the system is built now; keep historical values in git.
|
|
58
|
+
Use this test: if a sentence remains meaningful after the round, keep it as state; otherwise treat it as process.
|
|
59
|
+
Remove process material from state docs: symptoms, root causes, problem statements, reproductions, trial readings, experimental rejection details, change trails and superseded values.
|
|
60
|
+
Keep current rules, values, contracts, acceptance criteria, boundaries, decisions with one-line reasons, and rejected design alternatives with lasting reasons.
|
|
61
|
+
Keep mechanism bodies, directory ownership, template and placeholder forms, and dates that form part of a rule.
|
|
62
|
+
Apply this split in every mode and every doc-writing role.
|
|
53
63
|
|
|
54
|
-
|
|
55
|
-
**How to draw domains**: things that always move together ⇒ one document; things that never move together ⇒ separate.
|
|
56
|
-
Split this way, and parallel work stays in separate domains without interfering; **get the domains right, and parallel write conflicts stay low enough** — get them wrong, and the conflict only surfaces at runtime.
|
|
64
|
+
## Work structure (boards, domains and files)
|
|
57
65
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
66
|
+
Organize code and doc trees as boards, domains and files.
|
|
67
|
+
A board is a business board, a domain is a directory and concurrency-isolation unit, and a file is one file.
|
|
68
|
+
Put things that always move together in one document and separate things that do not.
|
|
69
|
+
Follow four rules:
|
|
70
|
+
- **① Domain = the concurrency-isolation unit**: keep parallel work inside its own domains and land each piece only in its domain.
|
|
71
|
+
- **② Stand the domain directory up from day one**, even with one file, so later splits do not move existing paths.
|
|
72
|
+
- **③ Keep splits inside the domain**: put new files in the same domain directory and avoid cross-domain path churn.
|
|
73
|
+
- **④ Move code and doc trees in step**: when code gains a module, create the matching doc domain at the corresponding position.
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
aliases: 补丁, 多档修改, 批量写盘
|
|
2
|
-
**Use it for whole-file and multi-file changes
|
|
2
|
+
**Use it for whole-file and multi-file changes**: creating several new files at once (`--- /dev/null` header per file), whole-file replacement, and cross-file refactors — one unified-diff call covers the whole change.
|
|
3
|
+
All-or-nothing: every hunk is checked before anything is written, one permission ask and one turn instead of N separate calls.
|
|
3
4
|
|
|
4
5
|
Parameters:
|
|
5
|
-
- patch (required):
|
|
6
|
+
- patch (required): unified diff text. One `--- a/path` / `+++ b/path` header pair per file, then `@@ -old,count +new,count @@` hunks. `--- /dev/null` creates a new file. The `+++ b/path` pair may be omitted for existing files — a lone `--- a/path` (or `--- b/path`) header followed directly by hunks applies to that path; new files still need `--- /dev/null` + `+++ b/path`.
|
|
7
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
8
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
6
9
|
|
|
7
10
|
Notes:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
- Hunks are located by their context/removed lines, not line numbers — but the context must match the file EXACTLY. Read the files first and generate the patch from actual content
|
|
16
|
-
- If a hunk's context matches multiple locations it is rejected — add more surrounding context lines
|
|
17
|
-
- Deleting files is not supported — use the delete tool
|
|
18
|
-
- For single-file edits, edit is simpler; for full rewrites, write is simpler
|
|
11
|
+
- A hunk header `@@` without coordinates is accepted: that hunk is located by its context and removed (-) lines and applies only on a unique match.
|
|
12
|
+
A pure-addition hunk needs at least 2 context lines. A hunk that removes at least one line is anchored by those removed lines,
|
|
13
|
+
so it may carry no context at all — a context line is a courtesy there, not a requirement.
|
|
14
|
+
- Hunks are located by context and removed lines, not line numbers, and the context must match the file EXACTLY: read the files first and build the patch from actual content. A context matching several locations is rejected — add surrounding lines.
|
|
15
|
+
- For one file, `edit` is simpler; to rewrite a file whole, `write` is simpler. Deleting files is not supported — use `delete`.
|
|
16
|
+
- Returns the applied-file summary (`Applied patch to N file(s)`, per-file change lines, syntax-check notes for changed .mjs files).
|
|
17
|
+
- A failure in the write phase reports every file block in patch order (`modified` / `created` / `not committed`), the failed block as `<path> — failed: <reason>`, and a final line `apply_patch: <k>/<M> file(s) applied, <M−k> failed` plus the committed paths. Files already committed stay on disk and are never rolled back.
|
|
@@ -12,8 +12,12 @@ Use for running commands, builds, tests.
|
|
|
12
12
|
Parameters:
|
|
13
13
|
- command (required): Shell command to execute
|
|
14
14
|
- timeout: Timeout in milliseconds (default 120000 for synchronous runs; background runs have no default — an explicit timeout still applies; no upper bound)
|
|
15
|
-
- filter: Optional — a regex; only output lines matching it are returned (case-insensitive).
|
|
15
|
+
- filter: Optional — a regex; only output lines matching it are returned (case-insensitive). Synchronous runs only: a background run has no result to filter, so it returns a note and you grep its log instead.
|
|
16
|
+
Use it instead of hand-writing a pipe into `findstr`/`grep`.
|
|
16
17
|
- async: Run in the background (default false) — returns an ack at once (bash#<id>, log path); the result arrives as a digest when the process exits. Depth-0 only.
|
|
18
|
+
- ledger: the in-flight ledger row this call serves — `"#N"` or `"N"`.
|
|
19
|
+
- project: the project root holding `PROJECT-MANIFEST.json` (absolute or cwd-relative).
|
|
20
|
+
`bash` has no locating parameter of its own, and `project` does not change where the command runs.
|
|
17
21
|
|
|
18
22
|
Output format:
|
|
19
23
|
```
|
|
@@ -29,11 +33,16 @@ Output format:
|
|
|
29
33
|
Notes:
|
|
30
34
|
- There is NO TTY — editors, pagers (vim, less), and interactive prompts WILL hang. Always pass non-interactive flags: `git commit -m`, `git --no-pager`, `-y`/`--yes` where applicable
|
|
31
35
|
- The environment sets GIT_PAGER=cat, PAGER=cat, EDITOR=true, TERM=dumb — but still always use non-interactive flags
|
|
32
|
-
- Output is capped
|
|
36
|
+
- Output is capped twice, in characters, by two independent limits. Each stream (stdout and stderr) keeps accumulating only while its buffer is under 2,000,000 characters; beyond that the rest of that stream is dropped with no notice.
|
|
37
|
+
The assembled result is then cut to 200,000 characters, and a cut result ends with `[... truncated: N chars omitted — redirect to a file if you need the full output]`, where N counts what this second cut removed.
|
|
38
|
+
The missing tail may contain errors, so read the saved log file's tail before trusting success.
|
|
39
|
+
Use `filter` to narrow instead of hand-piping.
|
|
40
|
+
Redirecting to a file to rescue a large output is one of the two exceptions to the NEVER rule at the end of this list: those bytes come from the command, not from you.
|
|
33
41
|
- Check `[stderr]` for error messages, warnings, and diagnostic output — it is separated from `[stdout]` so you can quickly identify problems.
|
|
34
|
-
- Shell identity: the bash tool's shell is NOT fixed — it depends on configuration and environment. The current executor is declared in the
|
|
42
|
+
- Shell identity: the bash tool's shell is NOT fixed — it depends on configuration and environment. The current executor is declared in the session head's `Shell:` item, together with the version it reports; write commands for THAT shell, and when a command fails read its error output to identify the actual shell.
|
|
35
43
|
- Never use bash to read, copy, or transmit secret files (.env, keys, tokens)
|
|
36
44
|
- Do NOT run destructive commands (rm -rf, force-push, drop table) without explicit user confirmation
|
|
37
45
|
- After commands that change files (git checkout, npm install, etc.), repo_outline and code_search may be stale — re-run them to get current results.
|
|
38
46
|
- Prefer read/glob/grep/ls for file operations inside the project — file tools and bash reach the same paths (no directory restriction).
|
|
39
|
-
- NEVER
|
|
47
|
+
- NEVER write or modify file CONTENT through bash (`echo > file`, `sed -i`, `printf >`, heredoc, …). Use write/edit/insert_after/apply_patch instead — they handle encoding, escaping, and EOL conventions correctly.
|
|
48
|
+
Two things this rule does not forbid: redirecting a command's own output to a file to rescue a large result (see the output-cap note above), and `bash mkdir`, which creates a directory and writes no content.
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
aliases: 批次档, 实施记录, 工程实施
|
|
2
|
-
Three steps: `append` (add text to the END of §5), `edit` (replace one anchored range inside it), `status` (
|
|
2
|
+
Three write steps: `append` (add text to the END of §5), `edit` (replace one anchored range inside it), `status` (§5's status line).
|
|
3
3
|
|
|
4
|
-
The record is the one bound to this spawn
|
|
4
|
+
The record is the one bound to this spawn and its path arrives with the spawn, so there is no path parameter — one record serves one concurrent spawn, and yours is the in-flight one you were given.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`read` is on this face too and writes nothing: with no `segment` it returns the record's section index, and with `segment` + `offset` one window of that section (1-based, at most 200 lines; the receipt names the next `offset`).
|
|
7
|
+
It reads the whole record, not only §5 — §1 carries the rulings and §2 the task book.
|
|
8
|
+
|
|
9
|
+
- `append` — `text` goes to the end of §5. Limit 20000 characters per call; longer is refused, so split it.
|
|
10
|
+
A line that STARTS with the status-line form (`**状态行**:…`) is refused: no channel adds such a line here,
|
|
11
|
+
and this channel may only make such lines fewer, never more.
|
|
12
|
+
Quote it with a leading `> `, or write prose.
|
|
13
|
+
The delivery summary, the decision-disclosure table, the audit and review rounds and the terminal state land here — write it as the round actually ran.
|
|
7
14
|
- `edit` — `oldText` must match exactly once, byte for byte, inside §5; `newText` replaces it (empty `newText` deletes it). Refused with nothing written: a blank `oldText`, zero hits, two or more hits (the matching lines are named), an anchor crossing the section boundary, an anchor touching the protected status line, and a replacement that would introduce a status line or leave more of them than before.
|
|
8
|
-
- `status` — `value` carries exactly ONE legal keyword of §5's
|
|
15
|
+
- `status` — `value` carries exactly ONE legal keyword of §5's word list — `进行中` (in flight) or `实施完成` (that section's done word) — plus decoration (surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical.
|
|
9
16
|
|
|
10
|
-
`segment` names the section you
|
|
17
|
+
`segment` names the section you write — `"§5"` is this face's pen. Everything else belongs to another author: §1 discussion, §2 design, §3 design review findings, §4 user approval and §6 verification are written by their own seats, and writing them is refused.
|
|
11
18
|
|
|
12
|
-
The record is a process document
|
|
19
|
+
The record is a process document, droppable whole once the round closes, so nothing normative may live only in it — a rule that must outlive the round belongs in the design document.
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
aliases: 批次档, 设计段, 工程设计
|
|
2
|
-
Three steps: `append` (add text to the END of §2), `edit` (replace one anchored range inside it), `status` (
|
|
2
|
+
Three write steps: `append` (add text to the END of §2), `edit` (replace one anchored range inside it), `status` (§2's status line).
|
|
3
3
|
|
|
4
|
-
The record is the one bound to this spawn
|
|
4
|
+
The record is the one bound to this spawn and its path arrives with the spawn, so there is no path parameter — one record serves one concurrent spawn, and yours is the in-flight one you were given.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`read` is on this face too and writes nothing: with no `segment` it returns the record's section index, and with `segment` + `offset` one window of that section (1-based, at most 200 lines; the receipt names the next `offset`).
|
|
7
|
+
It reads the whole record, not only §2 — §1 carries the rulings and §3 the previous round.
|
|
8
|
+
|
|
9
|
+
- `append` — `text` goes to the end of §2. Limit 20000 characters per call; longer is refused, so split it.
|
|
10
|
+
A line that STARTS with the status-line form (`**状态行**:…`) is refused: no channel adds such a line here,
|
|
11
|
+
and this channel may only make such lines fewer, never more.
|
|
12
|
+
Quote it with a leading `> `, or write prose.
|
|
7
13
|
- `edit` — `oldText` must match exactly once, byte for byte, inside §2; `newText` replaces it (empty `newText` deletes it). Refused with nothing written: a blank `oldText`, zero hits, two or more hits (the matching lines are named), an anchor crossing the section boundary, an anchor touching the protected status line, and a replacement that would introduce a status line or leave more of them than before.
|
|
8
|
-
- `status` — `value` carries exactly ONE legal keyword of §2's
|
|
14
|
+
- `status` — `value` carries exactly ONE legal keyword of §2's word list — `进行中` (in flight) or `设计完成` (that section's done word) — plus decoration
|
|
15
|
+
(surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical.
|
|
16
|
+
Reading a status needs exactly one status line in the header zone — with two or more it reads as unset and `status` refuses, naming the repair order.
|
|
9
17
|
|
|
10
|
-
`segment` names the section you
|
|
18
|
+
`segment` names the section you write — `"§2"` is this face's pen. Everything else belongs to another author: §1 discussion, §3 design review findings, §4 user approval, §5 implementation record and §6 verification are written by their own seats, and writing them is refused.
|
|
11
19
|
|
|
12
|
-
The record is a process document
|
|
20
|
+
The record is a process document, droppable whole once the round closes, so nothing normative may live only in it.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
aliases: 批次档, 评审轮次, 评审结论
|
|
2
|
-
Three steps: `append` (add a round to the END of §3), `edit` (replace one anchored range inside it), `status` (
|
|
2
|
+
Three write steps: `append` (add a round to the END of §3), `edit` (replace one anchored range inside it), `status` (§3's status line).
|
|
3
3
|
|
|
4
|
-
The record is the one bound to this review instance
|
|
4
|
+
The record is the one bound to this review instance and its path arrives with the instance key, so there is no path parameter.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`read` is on this face too and writes nothing: with no `segment` it returns the record's section index, and with `segment` + `offset` one window of that section (1-based, at most 200 lines; the receipt names the next `offset`).
|
|
7
|
+
It reads the whole record, not only §3 — §1 carries the rulings and §2 the task book this review judges.
|
|
8
|
+
|
|
9
|
+
- `append` — a design-review round belongs here: one row per finding (`#` / severity / status / evidence), the evidence cell holding a pointer — a section number, a symbol name, or the exact words of the line — plus the VERDICT line and the counts.
|
|
10
|
+
The report's own paragraphs stay out. The round heading (`### 轮次 N(评审子代理)`) is tool-generated; do not write your own, it would be dropped. Limit 20000 characters per call.
|
|
11
|
+
A line that STARTS with the status-line form (`**状态行**:…`) is refused: no channel adds such a line here,
|
|
12
|
+
and this channel may only make such lines fewer, never more.
|
|
7
13
|
- `edit` — `oldText` must match exactly once, byte for byte, inside §3; `newText` replaces it (empty `newText` deletes it). Refused with nothing written: a blank `oldText`, zero hits, two or more hits, an anchor crossing the section boundary, an anchor touching the protected status line, and a replacement that would introduce a status line or leave more of them than before.
|
|
8
|
-
- `status` — `value` carries exactly ONE legal keyword of §3's
|
|
14
|
+
- `status` — `value` carries exactly ONE legal keyword of §3's word list — `进行中` (in flight) or `评审通过` (that section's done word) — plus decoration (surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical.
|
|
9
15
|
|
|
10
|
-
`segment` names the section you
|
|
16
|
+
`segment` names the section you write — `"§3"` is this face's pen. Everything else belongs to another author: §1 discussion, §2 design, §4 user approval, §5 implementation record and §6 verification are written by their own seats, and writing them is refused.
|
|
11
17
|
|
|
12
|
-
A finding enters the record only with a pointer that resolves — an evidence cell
|
|
18
|
+
A finding enters the record only with a pointer that resolves — an evidence cell pointing at nothing is a reading, not proof the thing exists.
|