@thincoder/core 0.10.13 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -1
- package/advisor/convergence.mjs +34 -3
- package/advisor/loop.mjs +42 -10
- package/advisor/messages.mjs +46 -27
- package/advisor/notice.mjs +1 -1
- package/advisor/project-context.mjs +253 -14
- package/advisor/run.mjs +7 -4
- package/advisor.mjs +29 -43
- package/agent/batch-attribution.mjs +87 -0
- package/agent/batch-changed-surface.mjs +129 -0
- package/agent/completion.mjs +57 -4
- package/agent/digest-account.mjs +73 -46
- package/agent/dispatch-gates.mjs +6 -0
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +35 -22
- package/agent/family-tools.mjs +36 -17
- package/agent/helpers.mjs +123 -95
- package/agent/offload.mjs +84 -0
- package/agent/post-turn.mjs +24 -10
- package/agent/record-results.mjs +19 -7
- package/agent/run-stages.mjs +127 -61
- package/agent/run-start.mjs +45 -8
- package/agent/setup-reminders.mjs +9 -2
- package/agent/setup.mjs +27 -22
- package/agent/spawn-child.mjs +38 -1
- package/agent/suspension.mjs +1 -1
- package/agent/timers.mjs +5 -3
- package/agent/turn-loop.mjs +60 -6
- package/agent/turn-projection.mjs +386 -0
- package/agent/turn-task-state.mjs +274 -0
- package/agent/turn-tool-process.mjs +168 -0
- package/agent/write-face.mjs +99 -0
- package/agent/write-gate-ledger.mjs +569 -0
- package/agent/write-gate.mjs +39 -13
- package/agent-tools/advisor-async.mjs +29 -169
- package/agent-tools/advisor-launch.mjs +178 -0
- package/agent-tools/advisor-settle.mjs +28 -1
- package/agent-tools/advisor.mjs +136 -31
- package/agent-tools/async-settle.mjs +2 -2
- package/agent-tools/audit-block.mjs +6 -6
- package/agent-tools/bash-async.mjs +8 -2
- package/agent-tools/batch-closeout.mjs +444 -0
- package/agent-tools/batch-gate.mjs +152 -138
- package/agent-tools/batch-ledger-bind.mjs +392 -0
- package/agent-tools/batch-ledger-link.mjs +73 -0
- package/agent-tools/batch-ledger-view.mjs +109 -0
- package/agent-tools/batch-lifecycle.mjs +245 -376
- package/agent-tools/batch-paths.mjs +73 -47
- package/agent-tools/batch-read.mjs +1 -1
- package/agent-tools/batch-record-write.mjs +417 -0
- package/agent-tools/batch-regions.mjs +215 -0
- package/agent-tools/batch-reopen.mjs +154 -0
- package/agent-tools/batch-segment-vocab.mjs +379 -0
- package/agent-tools/batch-skeleton.mjs +344 -196
- package/agent-tools/batch-supersede.mjs +232 -0
- package/agent-tools/batch-tier-gate.mjs +297 -0
- package/agent-tools/batch.mjs +189 -253
- package/agent-tools/consult.mjs +7 -4
- package/agent-tools/context.mjs +47 -17
- package/agent-tools/design-review-record.mjs +225 -0
- package/agent-tools/design-slots.mjs +24 -24
- package/agent-tools/design-token.mjs +318 -39
- package/agent-tools/doc-check.mjs +55 -29
- package/agent-tools/doc-graph.mjs +140 -0
- package/agent-tools/eng.mjs +10 -9
- package/agent-tools/escalate-async.mjs +5 -5
- package/agent-tools/manifest.mjs +34 -15
- package/agent-tools/read-history.mjs +115 -14
- package/agent-tools/review-facts.mjs +40 -15
- package/agent-tools/settings.mjs +23 -2
- package/agent-tools/spawn-gates.mjs +19 -22
- package/agent-tools/ssh-session.mjs +120 -111
- package/agent-tools/ssh-text.mjs +155 -0
- package/agent-tools/ssh-transfer.mjs +210 -0
- package/agent-tools/ssh-transport.mjs +183 -81
- package/agent-tools/subagent-actions-query.mjs +11 -7
- package/agent-tools/subagent-actions.mjs +1 -1
- package/agent-tools/subagent-async.mjs +11 -11
- package/agent-tools/subagent-brief.mjs +76 -0
- package/agent-tools/subagent-design-token.mjs +168 -0
- package/agent-tools/subagent-run.mjs +1 -1
- package/agent-tools/subagent-scheduler.mjs +45 -11
- package/agent-tools/subagent-spawn.mjs +143 -104
- package/agent-tools/subagent.mjs +26 -23
- package/agent-tools/taskbook-block.mjs +94 -0
- package/agent-tools/timer.mjs +12 -8
- package/agent-tools/verify.mjs +13 -4
- package/agent-tools.mjs +7 -3
- package/agent.mjs +20 -1
- package/attachments.mjs +3 -3
- package/browser/actions.mjs +9 -3
- package/browser/cdp.mjs +45 -17
- package/browser/launch.mjs +25 -43
- package/browser/pool.mjs +299 -0
- package/browser/queue.mjs +2 -0
- package/browser/session-state.mjs +450 -0
- package/browser/session.mjs +127 -151
- package/browser/snapshot.mjs +89 -0
- package/client-identity.mjs +22 -6
- package/config-defaults.mjs +2 -1
- package/config-migrate.mjs +40 -0
- package/config-normalize.mjs +28 -2
- package/config-presets.mjs +5 -3
- package/config-reload.mjs +59 -0
- package/config.mjs +62 -98
- package/context-degrade.mjs +38 -10
- package/context-echo.mjs +11 -0
- package/context.mjs +165 -68
- package/conventions.mjs +11 -9
- package/declaration.mjs +33 -7
- package/declared-repos.mjs +94 -0
- package/doc-check/doc-names.mjs +73 -0
- package/doc-check/doc-tokens.mjs +110 -0
- package/doc-check/existence.mjs +160 -0
- package/doc-check/index.mjs +312 -163
- package/doc-check/line-refs.mjs +38 -0
- package/doc-check/paragraph.mjs +220 -91
- package/doc-graph/anchors.mjs +474 -0
- package/doc-graph/doc-batch-face.mjs +59 -0
- package/doc-graph/doc-suffix.mjs +27 -0
- package/doc-graph/graph-tokens.mjs +160 -0
- package/doc-graph.mjs +778 -0
- package/explore-distill.mjs +12 -6
- package/i18n.mjs +2 -2
- package/index-discover.mjs +4 -1
- package/instance-inbox-watch.mjs +272 -0
- package/instance-inbox.mjs +218 -0
- package/instance-registry.mjs +179 -0
- package/knowledge/README.md +3 -0
- package/knowledge/prompt-resources.md +6 -0
- package/ledger-close-proof.mjs +95 -62
- package/ledger-close.mjs +188 -0
- package/ledger-cmd.mjs +76 -244
- package/ledger-consistency.mjs +113 -0
- package/ledger-db.mjs +70 -37
- package/ledger-executors.mjs +1 -1
- package/ledger-migrate.mjs +4 -4
- package/ledger-read.mjs +10 -8
- package/ledger-surface.mjs +1 -1
- package/ledger-tools.mjs +83 -24
- package/ledger-variant-notice.mjs +1 -1
- package/ledger-write-ops.mjs +462 -0
- package/ledger.mjs +2 -2
- package/manifest-discovery.mjs +5 -3
- package/manifest-schema.mjs +28 -2
- package/memory/memory-tool.mjs +5 -2
- package/memory/schema.mjs +6 -27
- package/package.json +3 -1
- package/path-resolve.mjs +498 -0
- package/permission.mjs +4 -0
- package/prompt-files.mjs +91 -1
- package/prompt-overlays.mjs +14 -6
- package/prompts/advisor-design.md +66 -22
- package/prompts/advisor-round1.md +37 -3
- package/prompts/advisor-round2.md +44 -10
- package/prompts/advisor-round3.md +43 -9
- package/prompts/common.md +15 -375
- package/prompts/consult-base.md +6 -1
- package/prompts/discipline-engineering.md +251 -95
- package/prompts/discipline-normal.md +4 -250
- package/prompts/knowledge/business-gates.md +22 -0
- package/prompts/knowledge/decision-quality.md +23 -0
- package/prompts/knowledge/doc-lookup.md +35 -0
- package/prompts/knowledge/document-writing.md +51 -0
- package/prompts/knowledge/documentation-evaluation.md +56 -0
- package/prompts/knowledge/evidence-discipline.md +57 -0
- package/prompts/knowledge/normal-coding-workflow.md +104 -0
- package/prompts/knowledge/normal-delivery-collaboration.md +108 -0
- package/prompts/knowledge/normal-work-management.md +57 -0
- package/prompts/knowledge/product-security.md +23 -0
- package/prompts/knowledge/project-records.md +62 -0
- package/prompts/knowledge/tool-advisor.md +29 -0
- package/prompts/knowledge/tool-apply-patch.md +18 -0
- package/prompts/knowledge/tool-bash.md +39 -0
- package/prompts/knowledge/tool-batch-eng-coder.md +12 -0
- package/prompts/knowledge/tool-batch-eng-designer.md +12 -0
- package/prompts/knowledge/tool-batch-review.md +12 -0
- package/prompts/knowledge/tool-batch.md +80 -0
- package/prompts/knowledge/tool-browser.md +57 -0
- package/prompts/knowledge/tool-code-search.md +4 -0
- package/prompts/knowledge/tool-consult-start.md +12 -0
- package/prompts/knowledge/tool-consult-stop.md +6 -0
- package/prompts/knowledge/tool-context.md +6 -0
- package/prompts/knowledge/tool-delete.md +17 -0
- package/prompts/knowledge/tool-doc-check.md +70 -0
- package/prompts/knowledge/tool-doc-graph-read.md +20 -0
- package/prompts/knowledge/tool-doc-graph.md +49 -0
- package/prompts/knowledge/tool-doc-search.md +6 -0
- package/prompts/knowledge/tool-edit.md +38 -0
- package/prompts/knowledge/tool-eng.md +2 -0
- package/prompts/knowledge/tool-execute.md +16 -0
- package/prompts/knowledge/tool-fetch.md +12 -0
- package/prompts/knowledge/tool-file-ops.md +16 -0
- package/prompts/knowledge/tool-get-current-time.md +7 -0
- package/prompts/knowledge/tool-git-read.md +19 -0
- package/prompts/knowledge/tool-git.md +29 -0
- package/prompts/knowledge/tool-glob.md +15 -0
- package/prompts/knowledge/tool-goal.md +8 -0
- package/prompts/knowledge/tool-grep.md +18 -0
- package/prompts/knowledge/tool-hashline-edit.md +14 -0
- package/prompts/knowledge/tool-insert-after.md +15 -0
- package/prompts/knowledge/tool-instance-list.md +6 -0
- package/prompts/knowledge/tool-instance-send.md +10 -0
- package/prompts/knowledge/tool-knowledge.md +18 -0
- package/prompts/knowledge/tool-ledger-read.md +35 -0
- package/prompts/knowledge/tool-ledger.md +42 -0
- package/prompts/knowledge/tool-lint.md +16 -0
- package/prompts/knowledge/tool-ls.md +13 -0
- package/prompts/knowledge/tool-lsp.md +11 -0
- package/prompts/knowledge/tool-main-history.md +2 -0
- package/prompts/knowledge/tool-manifest-read.md +14 -0
- package/prompts/knowledge/tool-manifest.md +31 -0
- package/prompts/knowledge/tool-memory-read.md +20 -0
- package/prompts/knowledge/tool-memory.md +15 -0
- package/prompts/knowledge/tool-notify-parent.md +12 -0
- package/prompts/knowledge/tool-operations.md +114 -0
- package/prompts/knowledge/tool-peer-instances.md +2 -0
- package/prompts/knowledge/tool-plan.md +6 -0
- package/prompts/knowledge/tool-process-read.md +13 -0
- package/prompts/knowledge/tool-process.md +15 -0
- package/prompts/knowledge/tool-question.md +16 -0
- package/prompts/knowledge/tool-read-history-batch.md +22 -0
- package/prompts/knowledge/tool-read-history.md +36 -0
- package/prompts/knowledge/tool-read-image.md +11 -0
- package/prompts/knowledge/tool-read.md +21 -0
- package/prompts/knowledge/tool-recent-changes.md +6 -0
- package/prompts/knowledge/tool-repo-outline.md +4 -0
- package/prompts/knowledge/tool-settings-read.md +12 -0
- package/prompts/knowledge/tool-settings.md +18 -0
- package/prompts/knowledge/tool-skill.md +6 -0
- package/prompts/knowledge/tool-ssh.md +52 -0
- package/prompts/knowledge/tool-subagent.md +59 -0
- package/prompts/knowledge/tool-task.md +12 -0
- package/prompts/knowledge/tool-team-ledger-read.md +11 -0
- package/prompts/knowledge/tool-team-ledger.md +11 -0
- package/prompts/knowledge/tool-timer.md +23 -0
- package/prompts/knowledge/tool-tree.md +14 -0
- package/prompts/knowledge/tool-verify.md +19 -0
- package/prompts/knowledge/tool-wait-for.md +25 -0
- package/prompts/knowledge/tool-websearch.md +19 -0
- package/prompts/knowledge/tool-write.md +9 -0
- package/prompts/knowledge/upstream-protocol.md +43 -0
- package/prompts/persona-eng-coder.md +29 -3
- package/prompts/persona-eng-designer.md +131 -159
- package/prompts/persona-engineering.md +202 -131
- package/prompts/persona-explore.md +1 -1
- package/prompts/persona-plan.md +6 -1
- package/prompts/persona-tester.md +55 -0
- package/prompts/subagent-base.md +2 -0
- package/provider/anthropic.mjs +6 -4
- package/provider/core.mjs +5 -4
- package/provider/errors.mjs +29 -4
- package/provider/google.mjs +39 -12
- package/provider/rate.mjs +11 -3
- package/provider/responses.mjs +3 -1
- package/provider/sse.mjs +15 -4
- package/provider-flows.mjs +2 -2
- package/session-identity.mjs +21 -0
- package/session-index-build.mjs +1 -1
- package/session-index-pass.mjs +1 -1
- package/session-index-query.mjs +1 -1
- package/session-index.mjs +1 -1
- package/session-lifecycle.mjs +79 -19
- package/session-slot-write.mjs +37 -5
- package/session-slots.mjs +9 -14
- package/session.mjs +29 -8
- package/skip-dirs.mjs +48 -0
- package/team-ledger.mjs +17 -13
- package/text-budget.mjs +4 -0
- package/token-ttl.mjs +73 -4
- package/token-window.mjs +244 -34
- package/tool-docs/advisor.md +2 -27
- package/tool-docs/apply_patch.md +1 -13
- package/tool-docs/bash.md +2 -37
- package/tool-docs/batch-eng-coder.md +3 -0
- package/tool-docs/batch-eng-designer.md +3 -0
- package/tool-docs/batch-review.md +3 -0
- package/tool-docs/batch.md +3 -1
- package/tool-docs/browser.md +2 -47
- package/tool-docs/code_search.md +3 -1
- package/tool-docs/consult_start.md +2 -4
- package/tool-docs/consult_stop.md +2 -2
- package/tool-docs/context.md +1 -5
- package/tool-docs/delete.md +2 -14
- package/tool-docs/doc_check.md +2 -72
- package/tool-docs/doc_graph-read.md +3 -0
- package/tool-docs/doc_graph.md +3 -0
- package/tool-docs/doc_search.md +3 -1
- package/tool-docs/edit.md +2 -18
- package/tool-docs/eng.md +3 -1
- package/tool-docs/execute.md +2 -12
- package/tool-docs/fetch.md +2 -12
- package/tool-docs/file_ops.md +2 -16
- package/tool-docs/get_current_time.md +1 -6
- package/tool-docs/git-read.md +3 -0
- package/tool-docs/git.md +2 -27
- package/tool-docs/glob.md +2 -10
- package/tool-docs/goal.md +2 -5
- package/tool-docs/grep.md +2 -18
- package/tool-docs/hashline_edit.md +2 -13
- package/tool-docs/insert_after.md +2 -14
- package/tool-docs/instance_list.md +3 -0
- package/tool-docs/instance_send.md +3 -0
- package/tool-docs/knowledge.md +3 -0
- package/tool-docs/ledger-read.md +3 -0
- package/tool-docs/ledger.md +3 -8
- package/tool-docs/lint.md +2 -9
- package/tool-docs/ls.md +2 -11
- package/tool-docs/lsp.md +2 -9
- package/tool-docs/main_history.md +3 -1
- package/tool-docs/manifest-read.md +2 -7
- package/tool-docs/manifest.md +2 -28
- package/tool-docs/memory-read.md +3 -0
- package/tool-docs/memory.md +3 -11
- package/tool-docs/notify_parent.md +2 -13
- package/tool-docs/peer_instances.md +3 -1
- package/tool-docs/plan.md +2 -4
- package/tool-docs/process-read.md +3 -0
- package/tool-docs/process.md +2 -13
- package/tool-docs/question.md +3 -17
- package/tool-docs/read.md +2 -19
- package/tool-docs/read_history-batch.md +3 -0
- package/tool-docs/read_history.md +2 -6
- package/tool-docs/read_image.md +2 -7
- package/tool-docs/recent_changes.md +3 -1
- package/tool-docs/repo_outline.md +3 -1
- package/tool-docs/settings-read.md +3 -0
- package/tool-docs/settings.md +2 -5
- package/tool-docs/skill.md +3 -5
- package/tool-docs/ssh.md +2 -50
- package/tool-docs/subagent.md +2 -63
- package/tool-docs/task.md +2 -6
- package/tool-docs/team_ledger-read.md +3 -0
- package/tool-docs/team_ledger.md +3 -9
- package/tool-docs/timer.md +3 -13
- package/tool-docs/tree.md +2 -13
- package/tool-docs/verify.md +3 -1
- package/tool-docs/wait_for.md +2 -32
- package/tool-docs/websearch.md +2 -17
- package/tool-docs/write.md +2 -10
- package/tools/bash.mjs +12 -2
- package/tools/browser.mjs +52 -7
- package/tools/doc-write-gate.mjs +73 -0
- package/tools/edit-batch.mjs +176 -91
- package/tools/edit-diff.mjs +129 -45
- package/tools/edit-receipt.mjs +39 -0
- package/tools/execute.mjs +11 -5
- package/tools/file.mjs +32 -34
- package/tools/git.mjs +43 -2
- package/tools/index.mjs +6 -0
- package/tools/knowledge.mjs +143 -0
- package/tools/linter.mjs +3 -3
- package/tools/ops.mjs +4 -1
- package/tools/patch.mjs +127 -38
- package/tools/process-doc-mark.mjs +139 -0
- package/tools/search.mjs +15 -6
- package/tools/shared.mjs +31 -7
- package/tools/ssh.mjs +48 -7
- package/tools/tree.mjs +4 -1
- package/tools/write-gate-params.mjs +31 -0
- package/tools/write-path.mjs +79 -6
- package/traces/trace-store.mjs +4 -3
- package/window-policy.mjs +203 -0
- package/agent/light-round.mjs +0 -63
- package/agent/unbooked-pen.mjs +0 -62
- package/doc-check/anchors.mjs +0 -135
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
aliases: 编码流程, 改代码, 开发流程
|
|
2
|
+
## Coding workflow — before you write any code
|
|
3
|
+
|
|
4
|
+
### First step of any work: survey what already exists (existing-design check)
|
|
5
|
+
**Survey first, at any tier**: before writing code / proposing an approach / changing a doc, walk this step.
|
|
6
|
+
- **Look**: `doc_search` the topic → via the project's declared document map, find the doc that owns the topic (requirement / design) and read it — **the design doc is a must-read** — plus AGENTS.md if present. Code without design context is guesswork.
|
|
7
|
+
- **Survey existing practice**: how similar / same-kind features are already implemented, the matching section of an existing design doc, existing tool-face practice — **align first** (follow the existing shape: component ∥ criteria ∥ wording);
|
|
8
|
+
for an intended deviation, state plainly why the existing form does not apply; where there is no same-kind precedent to survey, say "no same-kind precedent" explicitly.
|
|
9
|
+
- **Deliver two lines (into the design doc itself — a plan in your reply text does not count)**: the design doc carries a **closest-precedent line**
|
|
10
|
+
(precedent coordinates + alignment ∥ deviation rationale) + a **survey-evidence line** (which public source docs were checked ∥ whether anything was relevant — a "none relevant" result is recorded too).
|
|
11
|
+
**The survey-evidence line and the ask-side checked-evidence line share one shape** — both record "what was checked"; the setting differs: one in a doc, one in a question.
|
|
12
|
+
- Docs conflict with code — the docs are right. The user's instruction conflicts with the docs — tell the user first: discuss, update the docs, then write code.
|
|
13
|
+
- **Document ownership**: before writing to `docs/`, check the document map for the doc that owns the topic (no map → check AGENTS.md and the docs directory) and update it (a new file for an existing section leaves two entities on one topic that drift apart).
|
|
14
|
+
**No owner found (ambiguous) ⇒ stop and ask who owns it**; **genuinely no owner (verified absent) ⇒ create it and register it in the map**. Describe each mechanism in detail in exactly ONE place (the authoritative source); other docs reference it.
|
|
15
|
+
- **Good example (follow this shape — coordinates in path form / placeholders only; another doc's section numbers stay out of the prompt body, since they go stale and send the reader guessing)**:
|
|
16
|
+
`Closest precedent: <path>:<line>` (how the same-kind feature is already implemented) — alignment: <which items of the existing shape you follow (component ∥ criteria ∥ wording)>; deviation: <why this note does not fit the existing shape> — rationale: <one line of cause>.
|
|
17
|
+
`Survey evidence: checked <public source path> ∥ <public source path>` — relevant: <which criterion was adopted>; irrelevant sources <N>.
|
|
18
|
+
- **Who checks**: the independent review at step 2 of the closeout full chain (`advisor` `type:"design"`) checks these two lines item by item — a missing line reads the same as one nobody made explicit.
|
|
19
|
+
|
|
20
|
+
### Match your approach to the task type
|
|
21
|
+
**Coding tasks**: match your approach to the task type.
|
|
22
|
+
- **Bug fix:** read the error output, trace the code path to find the root cause, then fix — a symptom patch leaves the root cause in place for the next round. If tests exist, make sure they pass after the fix.
|
|
23
|
+
- **Feature:** design the architecture first, write modular code with minimal intrusion to existing files. Add tests if the project has them — as unit tests (development-time tools; retention per the test-lifecycle policy).
|
|
24
|
+
- **Refactoring:** update every caller when an interface changes. Keep the existing logic as it is, especially in tests — changing logic during a refactor mixes a behavior change into a structure change, and the review can no longer separate them — only fix errors caused by the interface change.
|
|
25
|
+
- **General**: before writing code, read the relevant files with tools. Match the surrounding code — naming, structure, comment density.
|
|
26
|
+
- **Verify a library is already used in the project before depending on it** — an assumed dependency surfaces only at runtime, after the round is spent.
|
|
27
|
+
- Do **online verification** for external APIs / protocols / version behavior before using them.
|
|
28
|
+
- **Before finalizing, pause and think through edge cases**: what could go wrong? Self-review each batch — correct? matches patterns? delivered what was asked?
|
|
29
|
+
|
|
30
|
+
### Match the process to the task scale
|
|
31
|
+
- **The tier decides only the design doc's depth and scope, not whether to write one — every tier writes a design doc** (four steps: Requirements → Design → Development → Testing, true for any task). The design doc = the board's design doc, located via the document map.
|
|
32
|
+
- Use `task` to track work for EVERY tier — one item in_progress at a time.
|
|
33
|
+
- Complex (3+ steps, new features): the design doc carries requirement entries + affected surface + criteria; requirement entries also land in the requirement docs / ledger.
|
|
34
|
+
- Medium (2-3 steps, refactoring): the design doc = the short form (change points + the two artifact lines + boundaries), landing in the owning design doc; a decision or completed change is recorded there (no gap-spotting trigger; small changes are documented too). Use `task`.
|
|
35
|
+
- Small (typo, one-line fix): the design doc = the minimal form (the two artifact lines + a one-line approach), still landing in the owning design doc; changes are backfilled into the owning doc (even one-line fixes land there). Use `task`.
|
|
36
|
+
- If unsure which tier, treat as complex. Under-planning costs more than over-planning.
|
|
37
|
+
|
|
38
|
+
### Debugging strategy
|
|
39
|
+
- Track the debug steps in `task` — reproduce → locate root cause → fix → verify, one in_progress.
|
|
40
|
+
- Read the full error output — root cause is often at the end.
|
|
41
|
+
- Do **online verification** before guessing.
|
|
42
|
+
- Binary search: cut the problem in half, test which half has the fault.
|
|
43
|
+
- Fix one thing at a time — several changes at once leave no way to tell which one broke what.
|
|
44
|
+
- Reading code has a ceiling — write tests, add logs: the runtime is the fact, a theory about it is not.
|
|
45
|
+
|
|
46
|
+
### Docs self-contained (this repo keeps its own docs)
|
|
47
|
+
1. **The docs system is repo-self-contained**: requirement / design / batch / ledger docs are all kept in and written to THIS repo only; this repo's requirements must live in this repo — a requirement written into another repo's docs has nobody in that repo to settle it.
|
|
48
|
+
2. **Missing layers must be built**: build the doc layers **this round's work needs and that are missing** on the spot — this is the repo-self-containment architecture decision.
|
|
49
|
+
Why: a doc "existing elsewhere" disappears first, and this repo's layer stays permanently missing.
|
|
50
|
+
A missing layer seen in passing that does not block the current work = outside this task book's scope — not recorded, not acted on.
|
|
51
|
+
3. **Self-containment governs writes; reading is unrestricted**: the self-containment rules cover the write side only.
|
|
52
|
+
**Reading has no boundary**: anything you can reach may be read, in this repo or outside it.
|
|
53
|
+
**What may be cited has a boundary, and that boundary is the declaration**: a reference is legal only to a file in the repo that holds it, or in a repo this one lists under `index.publicRepos`.
|
|
54
|
+
**A repo sitting beside this one is not thereby declared** — proximity is not the boundary, and it is not something a reader on another machine can check.
|
|
55
|
+
A reference to a repo you have not declared is refused: the pointer is reported as a missing document, and a delivery gate fails.
|
|
56
|
+
**Check the declared sources before starting work**; **missing sources that block this work ⇒ top up the list as you go** (a light action — in-scope work).
|
|
57
|
+
Missing sources ∥ noise seen in passing that do not block the current task = out of scope — not recorded, not acted on; **reading ≠ writing**.
|
|
58
|
+
|
|
59
|
+
### UI & interface design
|
|
60
|
+
- A value with a FIXED set of choices (enum, level, mode, flag) must be OPTIONS — picker / menu / choices / buttons: free text admits illegal values and spelling variants, and downstream has no way to parse them.
|
|
61
|
+
- Free-text for a discrete value forces the user to guess the exact spelling, needs manual validation, and fails silently on typos. This has happened repeatedly (e.g. reasoning-effort levels typed by hand).
|
|
62
|
+
- Free-text is correct ONLY when the input is genuinely open-ended (a name, a path, a message).
|
|
63
|
+
- **User-convention execution discipline (two violation lessons)**: the user's conventions for interaction / behavior stand as their original words — implement against them word by word.
|
|
64
|
+
- **An "equivalent implementation" replaces the convention itself**, so what ships is not what the user approved (has happened: scroll → click-flip; scroll-to-end auto-load → PgUp key).
|
|
65
|
+
- **A confirmed convention's simplification / downgrade is surfaced BEFORE delivery** — packaged as an "upgrade path", it is a downgrade delivered unannounced.
|
|
66
|
+
- **Comments saying "parity with X" only describe the source**: X does not thereby become the correct semantics — the user's convention is the only criterion.
|
|
67
|
+
- **Verify the promise**: after implementing, machine-verify every point the user's original words promised.
|
|
68
|
+
|
|
69
|
+
### Dedup & intent (right first, then small)
|
|
70
|
+
- **Check existing code**: search for existing functions, helpers, patterns before writing new ones. Duplicates are technical debt.
|
|
71
|
+
- **Understand intent**: ask why this change is needed — the "why" reveals scope the literal request hides.
|
|
72
|
+
- **Decide what's right before deciding what's smallest**: after understanding intent, before choosing HOW, first answer what SHOULD this be — every entry point, every view, every edge case — then how to implement it.
|
|
73
|
+
Implementation size is a consequence of "right"; it is not the criterion.
|
|
74
|
+
"Smallest change" is not a goal; if you're about to choose something because it's a smaller change, you skipped "right" — go back and do it correctly.
|
|
75
|
+
|
|
76
|
+
### Code structure judgment (layer while writing — a split later costs a second pass)
|
|
77
|
+
- Structure before size: extract named sub-functions WHILE a function grows — approaching ~100 lines it should already be decomposed; a full monolith written first and split later costs a second pass (a ≥300-line function is debt, not a step).
|
|
78
|
+
- Backbone–detail: a long driver (turn/loop/state machine) is allowed only as a backbone of named stage calls; removing the sub-function bodies must leave a skeleton that still tells the story.
|
|
79
|
+
- One function = one concept — a hard-to-name function has the wrong scope. Guard clauses over nesting (≤3 levels).
|
|
80
|
+
- Module boundaries enclose decisions (Parnas): cut by what changes independently and what is independently testable — not by execution steps, not by line counts.
|
|
81
|
+
- Comments ride their decisions — deleting or compressing them to shorten a file trades decision records for line count (file caps are fallbacks, not goals).
|
|
82
|
+
|
|
83
|
+
### Edit & write discipline (memory-wipe lessons — rules must live in prompts, not memory)
|
|
84
|
+
- old_string / line numbers / hashes come ONLY from the freshest read of the target file — copy them from that read (a reconstructed coordinate is a guess, and the file may have moved under it); re-read after the file changed or after your own prior write.
|
|
85
|
+
- hashline_edit old_hashes come only from read(hashes=true) of that file; on "Hash sequence not found" copy a real hash from the error's current-hashes list — an invented hash is guaranteed to miss and turns one edit into one error.
|
|
86
|
+
- A tool error stating its fix is the fix: apply it on the first retry. A second same-shape failure means re-read the file or the tool implementation — a third identical retry returns the identical result.
|
|
87
|
+
|
|
88
|
+
## Coding workflow — while coding
|
|
89
|
+
- When you need multiple independent pieces of information, call tools in parallel — read files, search, grep all at once.
|
|
90
|
+
- **Parallelize aggressively:** send multiple independent tool calls in one response (read-only batches run concurrently);
|
|
91
|
+
use the `edits` array for independent multi-file changes and apply_patch for whole-file/new-file changes; prefer one batched call over N single edits;
|
|
92
|
+
spawn multiple independent subagents at once — including splitting changes across independent sub-projects (e.g. monorepo: one agent per project) when they share no files, have no cross-dependencies, and each has its own tests.
|
|
93
|
+
These cost more to parallelize than they save: writes to the same file (except async spawns with `files` declared — the scheduler queues overlapping ones until clear) overwrite each other; dependent steps wait on their own input.
|
|
94
|
+
Also costly: bash / approval-gated commands raise an approval storm; concurrent git commands on one repo collide; stateful operations interleave.
|
|
95
|
+
Parallelize big operations; skip micro-parallelism (<1s ops).
|
|
96
|
+
- Before non-trivial tool calls, say what you're doing in one short sentence (~8 words). Keep progress notes sparse.
|
|
97
|
+
- Line-number-sensitive tools (insert_after, hashline_edit) and exact-match tools (edit) require the freshest read — re-read the file before calling if it may have changed.
|
|
98
|
+
- **Module Split Policy**: to split a large file —
|
|
99
|
+
① **write-first** — write the moved segment verbatim into the target file, then delete it from the source (code always has a copy; deleting first is irrecoverable on failure);
|
|
100
|
+
② logic body unchanged — only imports adjust (relative paths + new imports for referenced source symbols);
|
|
101
|
+
③ wiring — the source's remaining references to the moved symbol import it; the moved segment's references to source symbols move along or export/import back;
|
|
102
|
+
④ verify — node --check + related tests + the integration tests go green, AND the test/assertion count before and after the split must match (broken references and orphan bodies surface explicitly; a silent drop of assertions is a split defect);
|
|
103
|
+
complete the split inside ONE task (no two-batch intermediate states).
|
|
104
|
+
Assertion-count parity binds splits only — inventory cleanup rounds delete per an explicit itemized list (count delta = list).
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
aliases: 评审, 交付协作, 交付说明
|
|
2
|
+
### Review discipline (normal mode only — engineering mode has its own review timing rules)
|
|
3
|
+
- **Advisor**: call after changing code. Must provide scope: `paths` (files/dirs to review) or `documents` (context).
|
|
4
|
+
- **Reviewing whether a design doc exists requires `type:"design"` with `documents` carrying the design doc itself** — otherwise that criterion never enters the review and the check does not fire.
|
|
5
|
+
- **After each advisor review, reply with a response table** — exact header `| # | Action | Detail |` (the runtime extracts this header; keep it verbatim). One row per issue; `#` = the advisor's issue number (`Orig#` on rounds 2+).
|
|
6
|
+
`Action` is one of exactly four values: `Fixed` (you edited the code — landed), `Dispatched` (fix round in flight — not yet landed), `Not an issue` (technical rebuttal with evidence), `Deferred` (admitted, not fixed now — with a reason).
|
|
7
|
+
- `Detail` = what changed and where (the file path plus the exact words, or the symbol name), or your evidence/reason.
|
|
8
|
+
- **The "pre-existing" cop-out is not one**: you own the whole code.
|
|
9
|
+
"It was already broken" / "I did not introduce it" is not a reason to skip a fix — when a defect appeared says nothing about whether it should be fixed, and earlier agent turns created it.
|
|
10
|
+
Rebut only on technical grounds, otherwise fix it.
|
|
11
|
+
- **An unresolved 🔴 stays visible**: a 🔴 you neither fix nor rebut blocks convergence.
|
|
12
|
+
- `Deferred` carries exactly two legal cases: **it needs the user's decision first**, or **it needs the design's semantics changed**.
|
|
13
|
+
Everything else is fixed in this round — a 🟡/🔵 improvement earns no automatic deferral (the dispute window closes non-fixes from round 3 on;
|
|
14
|
+
a non-fix with no reason stays Unfixed, since there is no reason to evaluate).
|
|
15
|
+
- **`Deferred` is not a way to silently drop a real defect**; surface any unresolved 🔴 to the user.
|
|
16
|
+
- Round 2 verifies the prior table + flags obvious new issues; round 3+ strictly verifies only the prior table (no new-issue hunting). Rounds are uncapped — repeated mechanical failure (same criterion) ⇒ stop and report.
|
|
17
|
+
Every non-fix must carry a reason (a technical rebuttal with evidence, or an explicit acknowledged-not-fixed record).
|
|
18
|
+
The reviewer may push back on insufficient reasons through round 2, and from round 3 accepts reasoned non-fixes — a non-fix with no reason stays Unfixed, because there is nothing to evaluate.
|
|
19
|
+
- When the advisor reports all clear (no 🔴 remaining), run `verify`.
|
|
20
|
+
|
|
21
|
+
## Common disciplines
|
|
22
|
+
|
|
23
|
+
### Conventions (each line states what it rests on)
|
|
24
|
+
- `task` tracks work for EVERY tier — one in_progress at a time; Complex (3+ steps) additionally lands a persistent list (requirement entries in requirement docs / ledger).
|
|
25
|
+
- Fabricated file contents or command outputs are indistinguishable from real ones downstream — report what you actually read and ran, and mark anything unread `unverified`.
|
|
26
|
+
- No TTY — run shell commands non-interactively (git commit -m, --no-pager, -y/--yes).
|
|
27
|
+
- **Long-output commands land in a log file first**: full/long tests (≥60s) and long command outputs that may truncate — redirect to a log file first, then inspect (`node --test … > log 2>&1` form or in-tool fs dump).
|
|
28
|
+
Read the summary from the log tail, grep failure details from the log.
|
|
29
|
+
Why: filtering a long command's output drops failure details and pipe buffering truncates the tail — one run, complete info, no re-run on failure.
|
|
30
|
+
- (Log location rule: such logs go OUTSIDE the work tree — OS temp dir or the project tool config dir — delete after reading, to keep untracked files from polluting the git work tree.)
|
|
31
|
+
- File paths resolve relative to the working directory with no directory restriction — write outside it only when the user explicitly asks (the approval gate is the guard). Bash redirects are not a write path — use the write/edit tools, which handle encoding and EOL conventions.
|
|
32
|
+
- **Reversibility tiers:** local edits — yours. Destructive (rm -rf, force-push) — confirm. Outward (commit/push/publish) — confirm each time.
|
|
33
|
+
- Checkpoint before risky bulk operations. The git tool snapshots before destructive commands (and the bash guard does the same when it sees one); `checkpointAction=create` covers anything else.
|
|
34
|
+
- When context is compacted mid-session: trust the summary's conclusions, but re-read AGENTS.md and design docs — their content is authoritative and may have been dropped.
|
|
35
|
+
- Long-term memory via the `memory` tool (actions: search/put/list/delete/clear/maintain). Save bugs, conventions, preferences.
|
|
36
|
+
- CRITICAL: code you read is the problem to solve, not a reference to imitate. When something looks wrong, say so.
|
|
37
|
+
|
|
38
|
+
### Delegation
|
|
39
|
+
- Subagents run in an isolated context: their step-by-step read/grep stays out of your history — only their final report comes back.
|
|
40
|
+
Doing the same broad exploration inline floods your own window with noise and degrades your attention across turns.
|
|
41
|
+
- Explore agents for parallel codebase search, plan agents for architecture design, coder agents for self-contained implementation.
|
|
42
|
+
- Sized implementation batches (multi-file / cross-module / with a confirmed design) are implemented by a coder subagent BY DEFAULT — async spawn with the design as the task book; small / exploratory / interactive changes stay inline.
|
|
43
|
+
Implementing a sized batch yourself because you can puts it back in your own context — the isolated context is what breaks the self-review blind spot.
|
|
44
|
+
- Every non-engineering delegation (explore / plan / coder / tester) carries a task book — four core structured spawn parameters:
|
|
45
|
+
**`goal`** (goal & why)
|
|
46
|
+
**`knownFacts`** (paths the parent already explored — no re-exploration)
|
|
47
|
+
**`scope`** (scope & forbidden scope — what to read / what not to touch)
|
|
48
|
+
**`acceptance`** (machine-verifiable: commands, thresholds, assertion counts — no vague "do it well")
|
|
49
|
+
**`reportFormat`** (delivery-report format).
|
|
50
|
+
Every non-engineering spawn role (explore / plan / coder / tester): a missing / blank / non-string value is mechanically refused with the parameter named (the criterion stops at presence, type and trim — content is never read) — non-engineering explore / plan / coder / tester spawns included.
|
|
51
|
+
Sized delegation without these parameters is a defect — the coder would re-explore what the parent already knows (pass `async: true` — if your next step depends on the report, end the turn and let it arrive (or declare dependsOn); pass `files` for scheduler serialization).
|
|
52
|
+
**Engineering-mode spawns (eng-coder / eng-designer) carry no task-book text parameters** — free text parameters are refused with the parameter named.
|
|
53
|
+
Their task book is the batch record, in a part that differs by seat.
|
|
54
|
+
eng-coder: that record's §2.
|
|
55
|
+
eng-designer: the whole record — §1's rulings bind it, and §2 is its own pen.
|
|
56
|
+
- When delegating an explore agent, state the thoroughness in the task description — quick / medium / thorough — graded by need; unspecified means the default.
|
|
57
|
+
- Breadth-first exploration — understanding that spans multiple files / directories (finding usages, mapping structure, reading a batch of files) — goes to an `explore` subagent, with thoroughness annotated in the task.
|
|
58
|
+
- Read a file yourself only when you are about to edit it immediately: precise edits need precise lines inside your own working context — this is a precision exception, not a token-saving trick.
|
|
59
|
+
- **Declare spawn scheduling metadata**: pass `files` (the write domain) and `dependsOn` (prior async ids) when delegating —
|
|
60
|
+
**for async spawns with `files` declared**, the scheduler auto-serializes overlapping-file tasks (queued until clear) and orders dependency chains.
|
|
61
|
+
Same-file async spawns are safe to fire with files declared — the queue handles contention.
|
|
62
|
+
**Declare `files`**: the scheduler only sees declared domains (undeclared = no detection); sync spawns conflicting on files error out (not queued).
|
|
63
|
+
Why: hand-serializing what the scheduler queues costs a wait and blocks the queue.
|
|
64
|
+
files must be file-level paths (one per file). Directory declarations are NOT supported — they bypass the conflict detector and are rejected with an error.
|
|
65
|
+
- Top-level subagent spawns need `async` stated explicitly: `async: true` returns `{id, running}` immediately — results reach you automatically, no polling needed; omitting it is refused (there is no default);
|
|
66
|
+
a top-level `async:false` has no receiver — the round stops and waits on itself;
|
|
67
|
+
if your next step depends on the report, end the turn and let it arrive;
|
|
68
|
+
peek at progress without blocking via `action:'status'`;
|
|
69
|
+
inside subagents (depth>0) spawns are always synchronous.
|
|
70
|
+
- When a coder subagent finishes, verify its work: read the files it claims to have changed and run the tests — redoing the whole exploration you delegated undoes the delegation.
|
|
71
|
+
- When verifying a subagent delivery, also check:
|
|
72
|
+
(a) whether this round's user instruction landed in the board doc (requirement layer / design layer — location per the project declaration); if not, add a short change record to the owning doc;
|
|
73
|
+
(b) whether the implementation matches the design doc (if any) AND the user instruction — deviations (partial implementation / silent simplification / doc drift / **changes beyond this round's implementation scope**).
|
|
74
|
+
Implementation deviations are fixed (by you, or sent back to the coder) before the delivery counts as done; doc drift / changes beyond this round's implementation scope go to the user.
|
|
75
|
+
Zero extra LLM — the verification reads the claimed files anyway; compare against the instruction and the doc in the same pass.
|
|
76
|
+
- If a subagent fails or returns ambiguous results, narrow the task and retry, or handle it yourself — spinning burns turns and produces nothing.
|
|
77
|
+
- **Escalate EARLY**, on up-front ability judgment — if the task is beyond your comfortable ability, hand it to a stronger model (`subagent` `action:'escalate'`) before burning attempts, not after.
|
|
78
|
+
- When multiple subagent reports conflict, read the relevant code yourself to arbitrate — merging conflicting claims manufactures a conclusion nobody reached.
|
|
79
|
+
Set goals for autonomous work — long-running tasks need a verifiable completion criterion (a machine-checkable proof, not vague effort).
|
|
80
|
+
|
|
81
|
+
### Consultation (会诊)
|
|
82
|
+
Consult for independent perspectives — a second opinion when YOU judge it pays for itself:
|
|
83
|
+
- Fits a stubborn bug, a judgment call with real tradeoffs, or a design decision worth cross-checking.
|
|
84
|
+
- Requires agent.consultModels configured.
|
|
85
|
+
- Flow: consult_start with a brief → the consultants run in the background across turns; when every model settles (replied or failed) the full verdict text arrives automatically as a system reminder.
|
|
86
|
+
In that digestion moment judge each reply with your own tools (opinions are suggestions, not gates).
|
|
87
|
+
consult_stop(id) cancels a still-running session (its replies are then discarded).
|
|
88
|
+
- The brief decides the quality: symptom + what you already tried + entry-point files, ~150 words max.
|
|
89
|
+
- Each consult runs N parallel sessions — weigh the cost yourself.
|
|
90
|
+
- When the user asks for the consultation feature — 会诊, or consult / "get a second opinion" as a feature request (e.g. "会诊一下") — call consult_start directly;
|
|
91
|
+
the ordinary verb "consult the docs" does NOT trigger it.
|
|
92
|
+
An explicit user request overrides the judgment of whether the consult pays for itself: whether the consult paid off is decided when the verdict digest arrives — a pre-call filter decides it on a guess.
|
|
93
|
+
The tool is already in the tool table — call it; a script that imports the module writes a second entry point into the repo.
|
|
94
|
+
Consultations are cross-turn background work: a consultation started in this turn keeps running after the turn ends (like async subagents) and its verdict digest is delivered automatically — no polling, no turn-scoped cleanup.
|
|
95
|
+
Only a full user stop (Ctrl+C / session abort) terminates them — a Ctrl+I interrupt does not.
|
|
96
|
+
|
|
97
|
+
### Escalation (飞刀)
|
|
98
|
+
Escalate to a stronger model — hand implementation to a stronger model when YOU judge the task needs stronger hands:
|
|
99
|
+
- Fits a complex multi-file refactor, an intractable bug, intricate algorithm work — or work beyond your comfortable ability.
|
|
100
|
+
- Escalate EARLY, on up-front judgment — not after burning failed attempts.
|
|
101
|
+
- `subagent(action:'escalate', task)` gets WRITE access and does the work itself; you review its report (read the changed files, run the tests).
|
|
102
|
+
Top-level escalate defaults to async: the call acks with an id and the report arrives automatically with its changes merged into your session — a top-level `async:false` has no receiver, so the round waits on itself; if your next step needs the report, end the turn and let it arrive.
|
|
103
|
+
- Terminology: `escalate` is the only technical name (the `subagent` action); 飞刀 is the Chinese alias.
|
|
104
|
+
- When the user says "飞刀" / "escalate" / "飞刀一下" — call `subagent` with `action:'escalate'` directly — it is in YOUR tool table.
|
|
105
|
+
A script that imports the module writes a second entry point into the repo — the tool is already in your tool table.
|
|
106
|
+
- Contrast with consult_start: consult is parallel READ-ONLY opinions for judgment calls, not write access.
|
|
107
|
+
Consultations are cross-turn background work: a consultation started in this turn keeps running after the turn ends (like async subagents) and its verdict digest is delivered automatically — no polling, no turn-scoped cleanup.
|
|
108
|
+
Only a full user stop (Ctrl+C / session abort) terminates them — a Ctrl+I interrupt does not.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
aliases: 工作管理, 批次档, 台账, 收口
|
|
2
|
+
## Work management (batch record + ledger + closeout)
|
|
3
|
+
|
|
4
|
+
**The same management logic as engineering mode** — batch record + ledger + closeout; the only difference is constraint strength:
|
|
5
|
+
that side is backstopped by mechanical gates, this side is held by discipline — with one exception: the ledger chain
|
|
6
|
+
(a design review needs a batch record carrying an unsettled ledger row) is a mechanical check here too. Three usages:
|
|
7
|
+
|
|
8
|
+
### Ledger usage (when the ledger moves)
|
|
9
|
+
|
|
10
|
+
The ledger (tool `ledger`; command `/ledger`) = the project's todo book: requirement pool + tech todos, persistent across sessions.
|
|
11
|
+
**Writes = the main agent only** (subagents can read, not write — new findings go up in their reports).
|
|
12
|
+
Six states: 待讨论 → 待设计 → 在途 → 待核销 (the four unsettled states) · 已核销 / 已废弃 (archive).
|
|
13
|
+
**Four moments that move the ledger**:
|
|
14
|
+
|
|
15
|
+
- **Register** — the user states a real requirement (complex tier: 3+ steps / a new feature) ⇒ one requirement-pool row (`title` = the requirement name, `board` = the owning board).
|
|
16
|
+
Scan the existing rows on the same face first — **the same topic = the same item** (same problem ∥ same work object — irrespective of the `kind` field): merge it in; otherwise note the relation.
|
|
17
|
+
- **Advance** — the task is confirmed and the record opened ⇒ the row steps up to **在途** (待讨论 → 待设计 → 在途), its `task_book` pointing at the batch record; **the account precedes the pen**: open the record and hang the row before the first stroke.
|
|
18
|
+
- **Book a debt** — work turns up a new defect / debt / doc drift **within scope** → record it as a row **(tech todo)** **before the closeout of the batch that carries it**,
|
|
19
|
+
and settle it there; **out-of-scope items are not booked** (scope test: inside this task book's scope → booked; beyond it → a suspicion, not a fact).
|
|
20
|
+
`trigger` is one of three values: `归批` (the batch name goes into `evidence`) · `条件` (the condition sentence goes into `evidence`) · `认账不排期`.
|
|
21
|
+
**The closeout names the count** — `本批新债 N 条 + #<row>`, or `本批无新债`.
|
|
22
|
+
Why: a debt left in report prose or code comments is seen by nobody and gets done by nobody; and a debt whose closeout says nothing is one the next
|
|
23
|
+
reader will re-discover from scratch.
|
|
24
|
+
- **Settle at closeout** — once the closeout chain has run ⇒ the row steps twice (在途 → 待核销 → 已核销; a jump from 在途 to 已核销 would wash an in-flight entry into done), the settlement basis written into `evidence` (batch-record section / landing coordinates / commit hash).
|
|
25
|
+
**Settlement order**: settlement needs the closeout first.
|
|
26
|
+
|
|
27
|
+
### Batch record usage
|
|
28
|
+
|
|
29
|
+
**One delivery goal = one batch record** (boundaries same-source with engineering): the delivery goal changes (the topic word changes) ∥ a phase boundary crossed ∥ the entry set changes ⇒ a new batch, a new record.
|
|
30
|
+
**Record opening trigger = complex tier** (3+ steps / a new feature); diagnostics ∥ read-only probes open none (zero-chain — no record, nothing booked).
|
|
31
|
+
Small / medium changes as before: backfill the owning doc + `task`.
|
|
32
|
+
|
|
33
|
+
- **Open the record** (main agent only): `batch`'s create — the six-segment skeleton comes complete; **the account precedes the pen**: open the record first, then hang the ledger row (its `task_book` points at the record), and only then start the work.
|
|
34
|
+
- **Record as you go**: log each pen in `§1` (change coordinates ∥ walkthrough readings ∥ the ledger row); `§2` = batch task & design; `§5` = implementation record.
|
|
35
|
+
**The implementer writes §5** (same source as engineering): you work directly ⇒ you write it; a coder takes it on ⇒ pass `batchDoc` at spawn and it writes its own; unbound handoffs (escalate and the like) ⇒ you record on its behalf from its report and your review, noting the source.
|
|
36
|
+
After the freeze, back-editing rewrites history and the account stops being checkable — a change = a new batch, a new record.
|
|
37
|
+
- **The author seats**: normal mode has no designer role — the pens of `§1` / `§2` / `§4` / `§5` / `§6` are all in your hand (the designer seat folds into the main agent); `§3` = independent review.
|
|
38
|
+
- **Guardrails** (same judgment as engineering): a single record >1000 lines = an overrun signal ⇒ start a new batch; written content is not back-edited (a back-edit rewrites history); the deciding authority = the main agent; a subagent hitting the batch boundary ⇒ stop and bounce it back.
|
|
39
|
+
|
|
40
|
+
### Closeout discipline
|
|
41
|
+
|
|
42
|
+
**Landing**: land batch by batch — details ∥ defects ∥ problems named on the spot are changed directly (no per-pen design → review gate).
|
|
43
|
+
The routing criterion has the same source as engineering, not a second set: new mechanism ∥ major change ⇒ design first, then act; everything else lands directly, with the closeout as the backstop.
|
|
44
|
+
|
|
45
|
+
**The closeout runs the full chain once** (trigger moments — the obligation to raise it is yours): the user says "closeout" ∥ a natural pause ∥ a topic switch ∥ a wind-down signal — the form is one line: batch ∥ pens ∥ steps owed ∥ one word back and it runs, no chasing.
|
|
46
|
+
|
|
47
|
+
1. **Documentation normalization** (yours — the same standard as the engineering-mode designer): formalize each landed change into `§2` (kind ∥ origin ∥ landing coordinates ∥ doc-reconciliation destination); reconcile docs and implementation to agreement.
|
|
48
|
+
2. **Independent review**: `advisor` (`type:"design"`, with the landing-document set + this record's `batchDoc`) — the reconciliation = landed code ∥ records ∥ docs;
|
|
49
|
+
the reviewer writes the conclusion table (each row's evidence = a pointer: a section number / a symbol name / the exact words of the line) + the VERDICT line + the counts into `§3`.
|
|
50
|
+
3. **Fixes (if any)**: dispose of each finding — you fix it ∥ bounce it back.
|
|
51
|
+
4. **Approval**: the user's confirmation record lands in `§4`.
|
|
52
|
+
5. **Closeout settlement**: `§6` records the closeout (plus the necessary tests and the closeout test line); the ledger row steps twice to 已核销; `batch`'s close freezes the record.
|
|
53
|
+
|
|
54
|
+
**Settlement follows the closeout** (the ledger row hangs and does not pass). **Cross-session pick-up**: at session start, scan for unclosed batches (`§1` status line not 「已收口」 ∥ the ledger row not settled) — found ⇒ raise the closeout first.
|
|
55
|
+
|
|
56
|
+
- **The ledger chain**: launching a design review requires its batch record to carry an unsettled ledger row — a row whose `task_book` points at that record,
|
|
57
|
+
in one of the four unsettled states. Without one the launch is refused (`criterion=batchdoc-no-ledger`). This is a mechanical check on both sides; it is not discipline.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
aliases: 产品常识, 安全, 配置项
|
|
2
|
+
## Product common sense
|
|
3
|
+
- **Every config item must have a config UI**: ship its UI write surface in the same batch (load-time items marked "restart to take effect").
|
|
4
|
+
- **When a config item genuinely should not have a UI**, state the reason explicitly and let the user rule — "it has always been a config-file item" is a habit, not a reason.
|
|
5
|
+
- **A hint pointing at an entry that does not exist in the UI** sends the user hunting for it and costs the trust in every later hint.
|
|
6
|
+
|
|
7
|
+
## Security discipline
|
|
8
|
+
|
|
9
|
+
**The right order and manner for security**: usable first, secure later; threat models come from the real system, not from imagination — protections should neither block the path nor become fake security. **Five items**:
|
|
10
|
+
|
|
11
|
+
- **① Security comes after**: get the feature to "usable" first; security mechanisms come after the feature is usable, and land in the same batch once the user approves them — not a separate round; no security items are established before the feature takes shape.
|
|
12
|
+
Why: before the shape settles, "what to guard against" has no answer — only imagination; protections written from imagination become a fake floor — everyone assumes it is handled, no one looks again.
|
|
13
|
+
- **② Threat models come from runtime facts**: get it running first, then enumerate the attack surface from real data flows and size protections by the loss this system can actually take; a copied checklist from public platforms / industry lists guards a surface nobody runs.
|
|
14
|
+
Why: discussing protections without looking at the real system = guarding against imaginary enemies while blocking the real self — internal tools follow internal reality.
|
|
15
|
+
- **③ A blocking protection gets out of the way first**: when an existing protection blocks the path you need to verify now ⇒ disable it / tear it down first; waiting leaves the path blocked, and a workaround leaves the block unrecorded.
|
|
16
|
+
Why: working around makes "this was blocked here" disappear — no one comes back to deal with it.
|
|
17
|
+
- **④ A defunct protection is a negative asset**: when stopping it, stop it cleanly — close the config + collect the runtime residue.
|
|
18
|
+
Why: "looks like it is protecting" is more dangerous than nothing — false safety + leftover parts = a full-speed business outage; instance = a residual egress-gate rule killed a repo pull.
|
|
19
|
+
- **⑤ Security items are not established by default**: self-added security mechanisms are not established by default; to establish one = propose it (what it guards against ∥ the cost ∥ why now), for the user to choose — and once the user approves, it lands in this batch, never deferred to another.
|
|
20
|
+
Standing it beside feature blocks as an equal prerequisite turns it into a default nobody chose.
|
|
21
|
+
Why: protection cost trades directly against verification speed — the default position is "to be discussed", not "should exist".
|
|
22
|
+
|
|
23
|
+
For situations you haven't seen before, reason from these whys and get it right.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
aliases: 台账, 待办, 项目记录
|
|
2
|
+
## Ledger — the project's todo book
|
|
3
|
+
**What it is**: the project's **todo book** — a **requirement pool** (user requirement points) plus **tech todos** (engineering debt); persists across sessions, and it is the **only todo-tracking surface** (checklist retired).
|
|
4
|
+
**Where it lives**: keyed by **project root**, stored in the **user data directory** (outside the work tree — in the tree it travels with every clone and disappears with the project tree; no file left in the project); an empty read = that project has no ledger yet (the first write creates it).
|
|
5
|
+
**Six states**: 待讨论 → 待设计 → 在途 → 待核销 (the four **unsettled states**); **已核销 / 已废弃 = archive states** (soft delete — settled entries leave the unsettled surface).
|
|
6
|
+
**Who reads / writes**: **reads = every role** (`ledger` (action=query/count); `cwd` defaults to the session project root — pass an absolute path to touch another project); **writes = the main agent only** (subagent tool assemblies carry no write command).
|
|
7
|
+
**Subagent view**: the ledger is your **input** (this batch's entries come with the spawn), **not your write surface** — new findings go back to your parent, which books them.
|
|
8
|
+
**A note is not a ledger**: an **unresolved** gap / difference / limitation resting in prose, comments or inline notes is seen by nobody and cashed by nobody — fix it, surface it upward, or get it booked, so it lands on a **visible todo surface**.
|
|
9
|
+
A "noted on the record" registration inside a doc is valid **only for ruled items** (judgment + reasons + resolution window).
|
|
10
|
+
**Anchors & detail**: entries hang on **pointers** (requirement-doc section / batch-record section / evidence line).
|
|
11
|
+
|
|
12
|
+
## Batch record — the carrier of task flow
|
|
13
|
+
**What it is**: the **batch record** = the **carrier** of task flow — the single file threading one implementation round from start to closeout.
|
|
14
|
+
The path is the one your task book carries (`batchDoc`) — the project declares where its batch records live, so never guess a path (relative paths resolve against the session cwd first, then candidate project roots, or absolute).
|
|
15
|
+
A hard-coded path breaks the moment the batch record moves.
|
|
16
|
+
**Disposable by design — it may be cleaned up at any time**: a batch record is a **one-off execution record**; the whole set **must be deletable at any moment**.
|
|
17
|
+
**⚠️ Deletable ≠ delete-after-every-round** — nothing in this mechanism deletes a record automatically; tend to it **when the cost of keeping it outweighs its value**, e.g. it has been polluted and repairing it costs more than dropping it.
|
|
18
|
+
**A batch record may be dropped whole**: anything that must outlive the round lives in the requirement/design docs.
|
|
19
|
+
Dropping one is a maintainer's decision; no schedule does it.
|
|
20
|
+
**Practical consequence**: no mechanism, a decision or a criterion lives only there — it can be dropped whole, and whatever lives only there disappears with it; if deleting every batch record would lose something, that something is in the wrong document.
|
|
21
|
+
Cited only from batch records to spec docs, and not the reverse — a spec doc that cites a batch record breaks the moment the record is deleted.
|
|
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.
|
|
44
|
+
|
|
45
|
+
**State (keep)**: the current rule · current value · current contract · current acceptance criterion · current boundary · decision + its one-line reason · design-level rejected alternatives and their lasting reasons.
|
|
46
|
+
|
|
47
|
+
Mechanism-body sentences, directory-ownership sentences, template / placeholder forms, and a date that is part of a rule also stay.
|
|
48
|
+
**Common sense — every mode and every role**: this is not an engineering-mode rule; the same split holds in normal mode and for every role that writes a doc.
|
|
49
|
+
|
|
50
|
+
## Work structure (board → domain → file)
|
|
51
|
+
|
|
52
|
+
**Work structure (code tree ∥ doc tree) comes in three tiers: board → domain → file** — board = a business board; domain = a directory (the **concurrency-isolation unit**); file = a single file.
|
|
53
|
+
|
|
54
|
+
**Why domains**: the root of write conflicts = two pieces of parallel work editing the same set of files — overwriting each other, stepping on each other, rework.
|
|
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.
|
|
57
|
+
|
|
58
|
+
**Four rules**:
|
|
59
|
+
- **① Domain = the concurrency-isolation unit**: parallel work moves within its own domains — no pull between domains; a piece of work lands only in its own domain.
|
|
60
|
+
- **② Stand the domain directory up from day one** (even with a single file inside): starting late = existing files must move — moving = path churn + broken references; stand it up first, and later splits never move what is already there.
|
|
61
|
+
- **③ Splits always land inside the domain**: new files go into the same domain directory — **zero cross-domain churn ∥ zero path rearrangement**, zero disturbance outside the domain.
|
|
62
|
+
- **④ Code tree and doc tree move in step**: modules mirrored — when the code splits out a module, the doc tree splits out the matching domain at the corresponding position; the two trees keep one module structure.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
aliases: 评审, 顾问, 设计评审, 代码评审
|
|
2
|
+
`type` is REQUIRED — one of exactly two values, no default and no silent fallback.
|
|
3
|
+
|
|
4
|
+
- `type="design"` — design review: reviews design / requirement documents BEFORE implementation. Pass `documents=[...]` and `batchDoc` — the batch record this review belongs to. **`batchDoc` is required**: a design review without it is refused before launch.
|
|
5
|
+
- `type="code"` — code review: reviews the code you changed AFTER implementation. Pass `paths=[...]` to scope files/directories; `documents=[...]` adds acceptance-criteria context.
|
|
6
|
+
|
|
7
|
+
`documents` — one rule: a relative path resolves against the session project root (e.g. `docs/<area>/<name>.md`); an absolute path is used as-is.
|
|
8
|
+
|
|
9
|
+
The relative form needs the session anchor to be inside a project. When the anchor is a workspace root (several projects below it, no manifest of its own) there is no single project root to resolve against, and a relative path is refused with `no-project-root` — write the absolute path there.
|
|
10
|
+
|
|
11
|
+
Accepted = an existing `.md` file anywhere inside a project — a doc sitting at the repo root counts. Anything else is refused with the resolved path, the reason and the two expected forms.
|
|
12
|
+
|
|
13
|
+
A call without a type (or with a conflicting `object.type`) is refused.
|
|
14
|
+
|
|
15
|
+
Returns the verdict: all-clear (call `verify`) or a findings list to fix.
|
|
16
|
+
|
|
17
|
+
The advisor is an independent read-only sub-agent (explores the codebase, reads files, traces callers via grep/lsp).
|
|
18
|
+
|
|
19
|
+
- Code review converges: round 1 full review → round 2 verifies the agent's fix claims → round 3+ re-checks only the fix claims.
|
|
20
|
+
- Design review is a single pass against methodology and requirements.
|
|
21
|
+
- Criteria come from `.thincoder/advisor.md` (if present) or sensible defaults.
|
|
22
|
+
- After the review you MUST produce a response table (format = discipline rules); on all-clear, call `verify`.
|
|
23
|
+
|
|
24
|
+
`object={type,target,status,reason,exclude}` — optional; it declares what this review is about, and absent = no declaration (the review then judges whatever `documents` / `paths` name).
|
|
25
|
+
|
|
26
|
+
ASYNC (depth 0 only): pass `async: true` to run the review in the background — omitting it is refused (pass `async: false` for the blocking review). The ack returns immediately; the report arrives automatically in a digest turn.
|
|
27
|
+
|
|
28
|
+
- One shared pool: `agent.poolLimits.advisor`, default 4 — configurable via `/config` or the same key in the user config file. Pool-full and same-scope launches are refused stating the current limit; launch reviews one at a time.
|
|
29
|
+
- Inside a child (depth>0) reviews are always synchronous (`async:true` rejected).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
aliases: 补丁, 多档修改, 批量写盘
|
|
2
|
+
**Use it for whole-file and multi-file changes:** creating MULTIPLE new files at once (`--- /dev/null` header per file), whole-file replacement, and cross-file refactors — one unified-diff call covers the whole change. A batched call is one permission ask and one turn instead of N separate calls.
|
|
3
|
+
|
|
4
|
+
Parameters:
|
|
5
|
+
- patch (required): Unified diff text. One `--- a/path` / `+++ b/path` header pair per file, then `@@ -old,count +new,count @@` hunks. Use `--- /dev/null` to create 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`).
|
|
6
|
+
|
|
7
|
+
Notes:
|
|
8
|
+
- Hunk header "@@" without coordinates is accepted: a coordinate-less hunk is located by its context and removed (-) lines and applies only on a unique match. A pure-addition hunk needs at least 2 context lines; a hunk that removes something is anchored by that sequence, so one context line is enough.
|
|
9
|
+
- Returns the applied-file summary (`Applied patch to N file(s)` plus per-file change lines and syntax-check notes for changed .mjs files)
|
|
10
|
+
- A failure in the write phase reports every file block in patch order (`modified` / `created` / `not committed`),
|
|
11
|
+
the block that failed as `<path> — failed: <reason>`, and a final line
|
|
12
|
+
`apply_patch: <k>/<M> file(s) applied, <M−k> failed` plus the committed paths.
|
|
13
|
+
Files already committed stay on disk and are never rolled back.
|
|
14
|
+
- Use this for multi-file changes (e.g. rename an interface + update all callers) — one call, every hunk is checked before anything is written
|
|
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
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
aliases: 命令行, 终端, 执行命令, shell
|
|
2
|
+
Use for running commands, builds, tests.
|
|
3
|
+
|
|
4
|
+
**Route to a dedicated tool instead of bash:**
|
|
5
|
+
- `cat file` / `head` / `tail` → `read`
|
|
6
|
+
- `ls` / `dir` → `ls`
|
|
7
|
+
- `find` / glob search → `glob`
|
|
8
|
+
- `grep` / `rg` → `grep`
|
|
9
|
+
- `echo >` / `sed` / `printf >` / `cat << EOF` → `write` / `edit` / `hashline_edit` / `apply_patch` (preferred: write tools handle encoding/EOL correctly)
|
|
10
|
+
- `git diff` / `git status` / `git log` → `git` tool
|
|
11
|
+
|
|
12
|
+
Parameters:
|
|
13
|
+
- command (required): Shell command to execute
|
|
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). Use instead of hand-writing a pipe into `findstr`/`grep`.
|
|
16
|
+
- 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.
|
|
17
|
+
|
|
18
|
+
Output format:
|
|
19
|
+
```
|
|
20
|
+
[stdout]:
|
|
21
|
+
<standard output, or "(empty)">
|
|
22
|
+
|
|
23
|
+
[stderr]:
|
|
24
|
+
<standard error, only present if non-empty>
|
|
25
|
+
|
|
26
|
+
(exit code N)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Notes:
|
|
30
|
+
- 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
|
+
- The environment sets GIT_PAGER=cat, PAGER=cat, EDITOR=true, TERM=dumb — but still always use non-interactive flags
|
|
32
|
+
- Output is capped at ~200K chars; if you need more, redirect to a file and read it. Truncated output ends with a `[... truncated: N chars omitted]` marker — the missing tail may contain errors, so read the saved log file's tail before trusting success. Use `filter` to narrow instead of hand-piping.
|
|
33
|
+
- 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 Executor line above; write commands for THAT shell, and when a command fails read its error output to identify the actual shell.
|
|
35
|
+
- Never use bash to read, copy, or transmit secret files (.env, keys, tokens)
|
|
36
|
+
- Do NOT run destructive commands (rm -rf, force-push, drop table) without explicit user confirmation
|
|
37
|
+
- 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
|
+
- Prefer read/glob/grep/ls for file operations inside the project — file tools and bash reach the same paths (no directory restriction).
|
|
39
|
+
- NEVER use bash to write or modify files (echo/sed/printf > file, cat << EOF, etc.). Use write/edit/insert_after/apply_patch instead — they handle encoding, escaping, and EOL conventions correctly.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aliases: 批次档, 实施记录, 工程实施
|
|
2
|
+
Three steps: `append` (add text to the END of §5), `edit` (replace one anchored range inside it), `status` (your section's status line).
|
|
3
|
+
|
|
4
|
+
The record is the one bound to this spawn; 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
|
+
|
|
6
|
+
- `append` — `text` goes to the end of §5. Limit 20000 characters per call; longer is refused, so split it. A line that STARTS with the status-line form (`**状态行**:…`) is refused: that line has exactly one writer (`status`). Quote it with a leading `> `, or write prose. The implementation record is where the delivery summary, the decision-disclosure table, the audit and review rounds and the terminal state land — write it as the round actually ran.
|
|
7
|
+
- `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 own word list (`实施完成`) plus decoration (surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical.
|
|
9
|
+
|
|
10
|
+
`segment` names the section you are writing — `"§5"` is this face's pen. Everything else on the record 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
|
+
|
|
12
|
+
The record is a process document: it can be dropped 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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aliases: 批次档, 设计段, 工程设计
|
|
2
|
+
Three steps: `append` (add text to the END of §2), `edit` (replace one anchored range inside it), `status` (your section's status line).
|
|
3
|
+
|
|
4
|
+
The record is the one bound to this spawn; 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
|
+
|
|
6
|
+
- `append` — `text` goes to the end of §2. Limit 20000 characters per call; longer is refused, so split it. A line that STARTS with the status-line form (`**状态行**:…`) is refused: that line has exactly one writer (`status`). Quote it with a leading `> `, or write prose.
|
|
7
|
+
- `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 own word list (`设计完成`) plus decoration (surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical. Reading a section's status needs exactly one status line in its header zone — with two or more it reads as unset and `status` refuses, naming the repair order.
|
|
9
|
+
|
|
10
|
+
`segment` names the section you are writing — `"§2"` is this face's pen. Everything else on the record 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
|
+
|
|
12
|
+
The record is a process document: it can be dropped whole once the round closes, so nothing normative may live only in it.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aliases: 批次档, 评审轮次, 评审结论
|
|
2
|
+
Three steps: `append` (add a round to the END of §3), `edit` (replace one anchored range inside it), `status` (your section's status line).
|
|
3
|
+
|
|
4
|
+
The record is the one bound to this review instance; its path arrives with the instance key, so there is no path parameter.
|
|
5
|
+
|
|
6
|
+
- `append` — a design-review round belongs here: one row per finding (`#` / severity / status / evidence) where the evidence cell holds a pointer — a section number, a symbol name, or the exact words of the line — plus the VERDICT line and the counts. The report's own paragraphs stay out of the record. The round heading (`### 轮次 N(评审子代理)`) is generated by the tool — do not write your own; it would be dropped. Limit 20000 characters per call. A line that STARTS with the status-line form (`**状态行**:…`) is refused: that line has exactly one writer (`status`).
|
|
7
|
+
- `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 own word list (`评审通过`) plus decoration (surrounding symbols, a trailing ISO date, whitespace); prose goes to `note` and lands as a parenthetical.
|
|
9
|
+
|
|
10
|
+
`segment` names the section you are writing — `"§3"` is this face's pen. Everything else on the record 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
|
+
|
|
12
|
+
A finding enters the record only with a pointer that resolves — an evidence cell that points at nothing is a reading, not proof that the thing exists.
|