@thincoder/core 0.11.1 → 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 +64 -2
- package/advisor/compaction.mjs +7 -5
- package/advisor/convergence.mjs +34 -3
- package/advisor/history.mjs +24 -11
- package/advisor/loop.mjs +49 -12
- package/advisor/messages.mjs +114 -33
- package/advisor/project-context.mjs +171 -42
- package/advisor/run.mjs +24 -10
- package/advisor.mjs +36 -46
- package/agent/batch-attribution.mjs +87 -0
- package/agent/batch-changed-surface.mjs +129 -0
- package/agent/chat-call.mjs +14 -9
- package/agent/completion.mjs +70 -41
- package/agent/continue-decision.mjs +14 -8
- package/agent/digest-account.mjs +133 -59
- package/agent/dispatch-gates.mjs +6 -0
- package/agent/dispatch-run.mjs +1 -1
- package/agent/dispatch.mjs +10 -4
- package/agent/family-tools.mjs +37 -23
- package/agent/helpers.mjs +139 -73
- package/agent/image-heal.mjs +18 -4
- package/agent/offload.mjs +25 -29
- package/agent/post-turn.mjs +36 -35
- package/agent/record-results.mjs +39 -7
- package/agent/run-stages.mjs +132 -52
- package/agent/run-start.mjs +150 -78
- package/agent/setup-reminders.mjs +194 -91
- package/agent/setup.mjs +219 -140
- package/agent/spawn-child.mjs +40 -3
- package/agent/suspension.mjs +43 -15
- package/agent/timers.mjs +9 -4
- package/agent/turn-domain-text.mjs +105 -0
- package/agent/turn-loop.mjs +84 -27
- package/agent/turn-projection.mjs +286 -0
- package/agent/turn-task-state.mjs +274 -0
- package/agent/turn-tool-process.mjs +163 -0
- package/agent/write-gate-ledger.mjs +569 -0
- package/agent/write-gate.mjs +29 -352
- package/agent-tools/advisor-async.mjs +35 -172
- package/agent-tools/advisor-launch.mjs +178 -0
- package/agent-tools/advisor-settle.mjs +28 -1
- package/agent-tools/advisor.mjs +37 -48
- package/agent-tools/async-discard.mjs +7 -2
- package/agent-tools/async-settle.mjs +18 -12
- package/agent-tools/audit-block.mjs +6 -6
- package/agent-tools/bash-async.mjs +5 -2
- package/agent-tools/batch-closeout.mjs +223 -35
- package/agent-tools/batch-gate.mjs +142 -342
- package/agent-tools/batch-ledger-bind.mjs +240 -20
- package/agent-tools/batch-ledger-view.mjs +109 -0
- package/agent-tools/batch-lifecycle.mjs +197 -48
- package/agent-tools/batch-paths.mjs +29 -8
- package/agent-tools/batch-read.mjs +151 -4
- package/agent-tools/batch-record-write.mjs +417 -0
- package/agent-tools/batch-regions.mjs +215 -0
- package/agent-tools/batch-reopen.mjs +23 -11
- package/agent-tools/batch-segment-vocab.mjs +459 -0
- package/agent-tools/batch-skeleton.mjs +196 -239
- package/agent-tools/batch-supersede.mjs +232 -0
- package/agent-tools/batch-tier-gate.mjs +214 -0
- package/agent-tools/batch.mjs +192 -439
- package/agent-tools/browser-async.mjs +5 -2
- package/agent-tools/consult.mjs +17 -11
- package/agent-tools/context.mjs +76 -33
- package/agent-tools/design-review-record.mjs +225 -0
- package/agent-tools/design-slots.mjs +1 -1
- package/agent-tools/design-token.mjs +279 -81
- package/agent-tools/digest-budget.mjs +10 -9
- package/agent-tools/doc-check.mjs +43 -33
- package/agent-tools/doc-graph.mjs +140 -0
- package/agent-tools/eng.mjs +12 -12
- package/agent-tools/escalate-async.mjs +5 -5
- package/agent-tools/goal.mjs +5 -2
- package/agent-tools/judge-domain.mjs +347 -0
- package/agent-tools/manifest.mjs +34 -18
- package/agent-tools/parent-channel.mjs +6 -3
- package/agent-tools/plan.mjs +11 -10
- package/agent-tools/read-history.mjs +112 -11
- package/agent-tools/review-facts.mjs +19 -6
- package/agent-tools/settings.mjs +23 -2
- package/agent-tools/skill.mjs +7 -8
- package/agent-tools/spawn-gates.mjs +14 -24
- package/agent-tools/ssh-session.mjs +8 -5
- package/agent-tools/ssh-text.mjs +155 -0
- package/agent-tools/ssh-transfer.mjs +1 -1
- package/agent-tools/ssh-transport.mjs +19 -148
- package/agent-tools/subagent-actions-query.mjs +10 -6
- package/agent-tools/subagent-actions.mjs +2 -2
- package/agent-tools/subagent-async.mjs +19 -17
- 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 +13 -13
- package/agent-tools/subagent-spawn.mjs +92 -112
- package/agent-tools/subagent.mjs +16 -28
- package/agent-tools/task.mjs +0 -8
- 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 +26 -7
- package/attachments.mjs +3 -3
- package/auto-think.mjs +5 -2
- 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 +1 -1
- package/compaction-work-state.mjs +230 -0
- package/compress-form.mjs +41 -6
- package/config-defaults.mjs +7 -3
- package/config-migrate.mjs +40 -0
- package/config-normalize.mjs +28 -2
- package/config-reload.mjs +59 -0
- package/config.mjs +110 -110
- package/context-degrade.mjs +93 -34
- package/context-echo.mjs +6 -15
- package/context-push.mjs +328 -31
- package/context.mjs +298 -170
- package/conventions.mjs +11 -9
- package/declaration.mjs +126 -22
- 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 +309 -213
- package/doc-check/line-refs.mjs +27 -101
- package/doc-check/paragraph.mjs +218 -102
- 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/escape.mjs +6 -5
- package/explore-distill.mjs +41 -8
- package/generate-title.mjs +10 -1
- package/i18n.mjs +1 -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 +10 -0
- package/ledger-close-proof.mjs +100 -49
- package/ledger-close.mjs +188 -0
- package/ledger-cmd.mjs +47 -91
- package/ledger-consistency.mjs +113 -0
- package/ledger-db.mjs +47 -15
- package/ledger-executors.mjs +1 -1
- package/ledger-tools.mjs +121 -62
- package/ledger-write-ops.mjs +162 -46
- package/ledger.mjs +1 -1
- package/manifest-discovery.mjs +3 -1
- package/manifest-schema.mjs +27 -5
- package/memory/docs.mjs +51 -15
- package/memory/file-list.mjs +6 -0
- package/memory/schema.mjs +2 -2
- package/model-specs.mjs +87 -21
- package/origin-guard.mjs +190 -0
- package/package.json +3 -1
- package/path-resolve.mjs +338 -57
- package/prompt-files.mjs +114 -2
- package/prompt-overlays.mjs +21 -11
- package/prompts/advisor-design.md +96 -36
- package/prompts/advisor-round1.md +48 -4
- package/prompts/advisor-round2.md +54 -10
- package/prompts/advisor-round3.md +53 -9
- package/prompts/common.md +99 -434
- package/prompts/consult-base.md +7 -4
- package/prompts/discipline-engineering.md +504 -295
- package/prompts/discipline-normal.md +106 -281
- package/prompts/knowledge/business-gates.md +30 -0
- package/prompts/knowledge/decision-quality.md +21 -0
- package/prompts/knowledge/doc-lookup.md +30 -0
- package/prompts/knowledge/document-writing.md +33 -0
- package/prompts/knowledge/documentation-evaluation.md +48 -0
- package/prompts/knowledge/evidence-discipline.md +38 -0
- package/prompts/knowledge/normal-coding-workflow.md +110 -0
- package/prompts/knowledge/normal-delivery-collaboration.md +124 -0
- package/prompts/knowledge/normal-work-management.md +60 -0
- package/prompts/knowledge/product-security.md +28 -0
- package/prompts/knowledge/project-records.md +73 -0
- package/prompts/knowledge/tool-advisor.md +29 -0
- package/prompts/knowledge/tool-apply-patch.md +17 -0
- package/prompts/knowledge/tool-bash.md +48 -0
- package/prompts/knowledge/tool-batch-eng-coder.md +19 -0
- package/prompts/knowledge/tool-batch-eng-designer.md +20 -0
- package/prompts/knowledge/tool-batch-review.md +18 -0
- package/prompts/knowledge/tool-batch.md +94 -0
- package/prompts/knowledge/tool-browser.md +68 -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 +21 -0
- package/prompts/knowledge/tool-doc-check.md +71 -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 +41 -0
- package/prompts/knowledge/tool-eng.md +2 -0
- package/prompts/knowledge/tool-execute.md +21 -0
- package/prompts/knowledge/tool-fetch.md +18 -0
- package/prompts/knowledge/tool-file-ops.md +21 -0
- package/prompts/knowledge/tool-get-current-time.md +7 -0
- package/prompts/knowledge/tool-git-read.md +21 -0
- package/prompts/knowledge/tool-git.md +29 -0
- package/prompts/knowledge/tool-glob.md +17 -0
- package/prompts/knowledge/tool-goal.md +8 -0
- package/prompts/knowledge/tool-grep.md +21 -0
- package/prompts/knowledge/tool-hashline-edit.md +16 -0
- package/prompts/knowledge/tool-insert-after.md +17 -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 +28 -0
- package/prompts/knowledge/tool-ledger.md +46 -0
- package/prompts/knowledge/tool-lint.md +16 -0
- package/prompts/knowledge/tool-ls.md +15 -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 +34 -0
- package/prompts/knowledge/tool-memory-read.md +20 -0
- package/prompts/knowledge/tool-memory.md +19 -0
- package/prompts/knowledge/tool-notify-parent.md +12 -0
- package/prompts/knowledge/tool-operations.md +102 -0
- package/prompts/knowledge/tool-peer-instances.md +2 -0
- package/prompts/knowledge/tool-plan.md +5 -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 +35 -0
- package/prompts/knowledge/tool-read-image.md +11 -0
- package/prompts/knowledge/tool-read.md +22 -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 +17 -0
- package/prompts/knowledge/tool-skill.md +6 -0
- package/prompts/knowledge/tool-ssh.md +74 -0
- package/prompts/knowledge/tool-subagent.md +57 -0
- package/prompts/knowledge/tool-task.md +14 -0
- package/prompts/knowledge/tool-team-ledger-read.md +11 -0
- package/prompts/knowledge/tool-team-ledger.md +15 -0
- package/prompts/knowledge/tool-timer.md +23 -0
- package/prompts/knowledge/tool-tree.md +16 -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 +12 -0
- package/prompts/knowledge/upstream-protocol.md +45 -0
- package/prompts/persona-coder.md +1 -3
- package/prompts/persona-eng-coder.md +24 -6
- package/prompts/persona-eng-designer.md +150 -171
- package/prompts/persona-engineering.md +531 -442
- package/prompts/persona-explore.md +1 -3
- package/prompts/persona-normal.md +17 -9
- package/prompts/persona-plan.md +5 -3
- package/prompts/persona-tester.md +0 -2
- package/prompts/subagent-base.md +2 -2
- package/provider/anthropic.mjs +10 -6
- package/provider/core.mjs +8 -5
- package/provider/errors.mjs +63 -4
- package/provider/google.mjs +29 -10
- package/provider/reasoning-echo.mjs +16 -0
- package/provider/responses.mjs +7 -3
- package/provider/sse.mjs +11 -6
- package/provider-flows.mjs +2 -2
- package/rules.mjs +11 -10
- 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 +131 -42
- package/session-slot-write.mjs +38 -6
- package/session.mjs +30 -11
- package/shell-identity.mjs +129 -22
- package/skip-dirs.mjs +26 -2
- package/team-ledger.mjs +34 -30
- package/text-budget.mjs +1 -1
- package/think-off.mjs +27 -0
- package/token-ttl.mjs +74 -5
- package/token-window.mjs +371 -47
- package/tool-docs/advisor.md +2 -27
- package/tool-docs/apply_patch.md +1 -15
- package/tool-docs/bash.md +2 -43
- 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 +2 -84
- package/tool-docs/browser.md +2 -49
- package/tool-docs/code_search.md +2 -2
- package/tool-docs/consult_start.md +2 -8
- package/tool-docs/consult_stop.md +2 -4
- package/tool-docs/context.md +1 -5
- package/tool-docs/delete.md +2 -17
- package/tool-docs/doc_check.md +2 -107
- package/tool-docs/doc_graph-read.md +3 -0
- package/tool-docs/doc_graph.md +3 -0
- package/tool-docs/doc_search.md +2 -4
- package/tool-docs/edit.md +1 -38
- package/tool-docs/eng.md +3 -1
- package/tool-docs/execute.md +2 -18
- package/tool-docs/fetch.md +2 -14
- package/tool-docs/file_ops.md +2 -18
- package/tool-docs/get_current_time.md +1 -6
- package/tool-docs/git-read.md +3 -0
- package/tool-docs/git.md +2 -35
- package/tool-docs/glob.md +2 -10
- package/tool-docs/goal.md +1 -6
- package/tool-docs/grep.md +2 -18
- package/tool-docs/hashline_edit.md +2 -15
- package/tool-docs/insert_after.md +2 -16
- 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 -10
- 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 -8
- package/tool-docs/manifest.md +2 -35
- package/tool-docs/memory-read.md +3 -0
- package/tool-docs/memory.md +2 -20
- package/tool-docs/notify_parent.md +2 -13
- package/tool-docs/peer_instances.md +3 -1
- package/tool-docs/plan.md +1 -5
- 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 -18
- package/tool-docs/read_image.md +2 -9
- package/tool-docs/recent_changes.md +2 -2
- package/tool-docs/repo_outline.md +2 -2
- package/tool-docs/settings-read.md +3 -0
- package/tool-docs/settings.md +1 -12
- package/tool-docs/skill.md +2 -6
- package/tool-docs/ssh.md +1 -62
- package/tool-docs/subagent.md +2 -100
- package/tool-docs/task.md +1 -7
- package/tool-docs/team_ledger-read.md +3 -0
- package/tool-docs/team_ledger.md +3 -9
- package/tool-docs/timer.md +2 -19
- package/tool-docs/tree.md +2 -13
- package/tool-docs/verify.md +2 -12
- package/tool-docs/wait_for.md +2 -32
- package/tool-docs/websearch.md +2 -19
- package/tool-docs/write.md +2 -12
- package/tools/browser.mjs +54 -9
- package/tools/doc-write-gate.mjs +73 -0
- package/tools/edit-batch.mjs +170 -92
- package/tools/edit-diff.mjs +78 -62
- package/tools/edit-receipt.mjs +39 -0
- package/tools/execute.mjs +3 -3
- package/tools/file.mjs +28 -14
- package/tools/git.mjs +36 -21
- package/tools/index.mjs +6 -0
- package/tools/knowledge.mjs +143 -0
- package/tools/linter.mjs +3 -3
- package/tools/ops.mjs +5 -3
- package/tools/patch.mjs +124 -44
- package/tools/process-doc-mark.mjs +33 -4
- package/tools/repomap.mjs +25 -3
- package/tools/search.mjs +74 -26
- package/tools/shared.mjs +29 -27
- 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 +31 -0
- package/tools/write-path.mjs +16 -4
- package/window-policy.mjs +243 -0
- package/doc-check/anchors.mjs +0 -235
|
@@ -1,320 +1,145 @@
|
|
|
1
|
-
|
|
1
|
+
{{knowledge:normal-coding-workflow}}
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
{{knowledge:normal-work-management}}
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
**Survey first, at any tier**: before writing code / proposing an approach / changing a doc, walk this step.
|
|
7
|
-
- **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.
|
|
8
|
-
- **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);
|
|
9
|
-
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.
|
|
10
|
-
- **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**
|
|
11
|
-
(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).
|
|
12
|
-
**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.
|
|
13
|
-
- 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.
|
|
14
|
-
- **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).
|
|
15
|
-
**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.
|
|
16
|
-
- **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)**:
|
|
17
|
-
`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>.
|
|
18
|
-
`Survey evidence: checked <public source path> ∥ <public source path>` — relevant: <which criterion was adopted>; irrelevant sources <N>.
|
|
19
|
-
- **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.
|
|
5
|
+
## Task list (a session whose tool table carries `task`)
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
**Coding tasks**: match your approach to the task type.
|
|
23
|
-
- **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.
|
|
24
|
-
- **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).
|
|
25
|
-
- **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.
|
|
26
|
-
- **General**: before writing code, read the relevant files with tools. Match the surrounding code — naming, structure, comment density.
|
|
27
|
-
- **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.
|
|
28
|
-
- Do **online verification** for external APIs / protocols / version behavior before using them.
|
|
29
|
-
- **Before finalizing, pause and think through edge cases**: what could go wrong? Self-review each batch — correct? matches patterns? delivered what was asked?
|
|
7
|
+
`task` is the running checklist for a delivery that runs past one step; a batch record and the ledger, where they exist, stay the tracking authority. Two moments bind it:
|
|
30
8
|
|
|
31
|
-
|
|
32
|
-
- **
|
|
33
|
-
- Use `task` to track work for EVERY tier — one item in_progress at a time.
|
|
34
|
-
- Complex (3+ steps, new features): the design doc carries requirement entries + affected surface + criteria; requirement entries also land in the requirement docs / ledger.
|
|
35
|
-
- 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`.
|
|
36
|
-
- 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`.
|
|
37
|
-
- If unsure which tier, treat as complex. Under-planning costs more than over-planning.
|
|
9
|
+
- **Open it where the steps are fixed** — at the confirmation gate of a session that has one, otherwise when you state the steps you will take; the list and those steps are one set. A single-step delivery runs without one.
|
|
10
|
+
- **Close it at delivery** — the final reply leaves no `pending` and no `in_progress` item: every item is `done`, or gone. A list you did not keep current is dropped here, not carried.
|
|
38
11
|
|
|
39
|
-
|
|
40
|
-
- Track the debug steps in `task` — reproduce → locate root cause → fix → verify, one in_progress.
|
|
41
|
-
- Read the full error output — root cause is often at the end.
|
|
42
|
-
- Do **online verification** before guessing.
|
|
43
|
-
- Binary search: cut the problem in half, test which half has the fault.
|
|
44
|
-
- Fix one thing at a time — several changes at once leave no way to tell which one broke what.
|
|
45
|
-
- Reading code has a ceiling — write tests, add logs: the runtime is the fact, a theory about it is not.
|
|
12
|
+
Between those two the list is yours: nothing forces a status flip, and the list never holds two `in_progress` items at once. A list whose statuses were not kept is one to drop, not to defend.
|
|
46
13
|
|
|
47
|
-
|
|
48
|
-
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.
|
|
49
|
-
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.
|
|
50
|
-
Why: a doc "existing elsewhere" disappears first, and this repo's layer stays permanently missing.
|
|
51
|
-
A missing layer seen in passing that does not block the current work = outside this task book's scope — not recorded, not acted on.
|
|
52
|
-
3. **Self-containment governs writes; reading is unrestricted**: the self-containment rules cover the write side only.
|
|
53
|
-
**Content under the working directory is searchable, readable and citable by default** — **sources beyond the working directory are read per the declaration** (project manifest `index.publicRepos`).
|
|
54
|
-
**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).
|
|
55
|
-
Missing sources ∥ noise seen in passing that do not block the current task = out of scope — not recorded, not acted on; **reading ≠ writing**.
|
|
14
|
+
A stale checklist on the user's screen reads as work still in flight — a claim about the delivery that nobody made.
|
|
56
15
|
|
|
57
|
-
|
|
58
|
-
- 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.
|
|
59
|
-
- 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).
|
|
60
|
-
- Free-text is correct ONLY when the input is genuinely open-ended (a name, a path, a message).
|
|
61
|
-
- **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.
|
|
62
|
-
- **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).
|
|
63
|
-
- **A confirmed convention's simplification / downgrade is surfaced BEFORE delivery** — packaged as an "upgrade path", it is a downgrade delivered unannounced.
|
|
64
|
-
- **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.
|
|
65
|
-
- **Verify the promise**: after implementing, machine-verify every point the user's original words promised.
|
|
16
|
+
## Changing a rule also changes its checks
|
|
66
17
|
|
|
67
|
-
|
|
68
|
-
- **Check existing code**: search for existing functions, helpers, patterns before writing new ones. Duplicates are technical debt.
|
|
69
|
-
- **Understand intent**: ask why this change is needed — the "why" reveals scope the literal request hides.
|
|
70
|
-
- **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.
|
|
71
|
-
Implementation size is a consequence of "right"; it is not the criterion.
|
|
72
|
-
"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.
|
|
18
|
+
Sync the design doc, the running text and the affected tests in the same batch; leave the obligation in exactly one section, whose heading names it, with no copy elsewhere.
|
|
73
19
|
|
|
74
|
-
|
|
75
|
-
- 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).
|
|
76
|
-
- 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.
|
|
77
|
-
- One function = one concept — a hard-to-name function has the wrong scope. Guard clauses over nesting (≤3 levels).
|
|
78
|
-
- Module boundaries enclose decisions (Parnas): cut by what changes independently and what is independently testable — not by execution steps, not by line counts.
|
|
79
|
-
- Comments ride their decisions — deleting or compressing them to shorten a file trades decision records for line count (file caps are fallbacks, not goals).
|
|
80
|
-
|
|
81
|
-
### Edit & write discipline (memory-wipe lessons — rules must live in prompts, not memory)
|
|
82
|
-
- 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.
|
|
83
|
-
- 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.
|
|
84
|
-
- 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.
|
|
85
|
-
|
|
86
|
-
## Coding workflow — while coding
|
|
87
|
-
- When you need multiple independent pieces of information, call tools in parallel — read files, search, grep all at once.
|
|
88
|
-
- **Parallelize aggressively:** send multiple independent tool calls in one response (read-only batches run concurrently);
|
|
89
|
-
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;
|
|
90
|
-
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.
|
|
91
|
-
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.
|
|
92
|
-
Also costly: bash / approval-gated commands raise an approval storm; concurrent git commands on one repo collide; stateful operations interleave.
|
|
93
|
-
Parallelize big operations; skip micro-parallelism (<1s ops).
|
|
94
|
-
- Before non-trivial tool calls, say what you're doing in one short sentence (~8 words). Keep progress notes sparse.
|
|
95
|
-
- 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.
|
|
96
|
-
- **Module Split Policy**: to split a large file —
|
|
97
|
-
① **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);
|
|
98
|
-
② logic body unchanged — only imports adjust (relative paths + new imports for referenced source symbols);
|
|
99
|
-
③ 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;
|
|
100
|
-
④ 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);
|
|
101
|
-
complete the split inside ONE task (no two-batch intermediate states).
|
|
102
|
-
Assertion-count parity binds splits only — inventory cleanup rounds delete per an explicit itemized list (count delta = list).
|
|
103
|
-
|
|
104
|
-
## Work management (batch record + ledger + closeout)
|
|
105
|
-
|
|
106
|
-
**The same management logic as engineering mode** — batch record + ledger + closeout; the only difference is constraint strength:
|
|
107
|
-
that side is backstopped by mechanical gates, this side is held by discipline — with one exception: the ledger chain
|
|
108
|
-
(a design review needs a batch record carrying an unsettled ledger row) is a mechanical check here too. Three usages:
|
|
109
|
-
|
|
110
|
-
### Ledger usage (when the ledger moves)
|
|
111
|
-
|
|
112
|
-
The ledger (tool `ledger`; command `/ledger`) = the project's todo book: requirement pool + tech todos, persistent across sessions.
|
|
113
|
-
**Writes = the main agent only** (subagents can read, not write — new findings go up in their reports).
|
|
114
|
-
Six states: 待讨论 → 待设计 → 在途 → 待核销 (the four unsettled states) · 已核销 / 已废弃 (archive).
|
|
115
|
-
**Four moments that move the ledger**:
|
|
116
|
-
|
|
117
|
-
- **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).
|
|
118
|
-
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.
|
|
119
|
-
- **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.
|
|
120
|
-
- **Book a debt** — work turns up a new defect / debt / doc drift **within scope** ⇒ book it (tech todo) **the same day**; **out-of-scope items are not booked** (scope test: inside this task book's scope ⇒ booked; beyond it ⇒ a suspicion, not a fact).
|
|
121
|
-
`trigger` is one of three values: `归批` (the batch name goes into `evidence`) · `条件` (the condition sentence goes into `evidence`) · `认账不排期`.
|
|
122
|
-
Why: a debt left in report prose or code comments is seen by nobody and gets done by nobody.
|
|
123
|
-
- **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).
|
|
124
|
-
**Settlement order**: settlement needs the closeout first.
|
|
125
|
-
|
|
126
|
-
### Batch record usage
|
|
127
|
-
|
|
128
|
-
**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.
|
|
129
|
-
**Record opening trigger = complex tier** (3+ steps / a new feature); diagnostics ∥ read-only probes open none (zero-chain — no record, nothing booked).
|
|
130
|
-
Small / medium changes as before: backfill the owning doc + `task`.
|
|
131
|
-
|
|
132
|
-
- **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.
|
|
133
|
-
- **Record as you go**: log each pen in `§1` (change coordinates ∥ walkthrough readings ∥ the ledger row); `§2` = batch task & design; `§5` = implementation record.
|
|
134
|
-
**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.
|
|
135
|
-
After the freeze, back-editing rewrites history and the account stops being checkable — a change = a new batch, a new record.
|
|
136
|
-
- **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.
|
|
137
|
-
- **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.
|
|
138
|
-
|
|
139
|
-
### Closeout discipline
|
|
140
|
-
|
|
141
|
-
**Landing**: land batch by batch — details ∥ defects ∥ problems named on the spot are changed directly (no per-pen design → review gate).
|
|
142
|
-
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.
|
|
143
|
-
|
|
144
|
-
**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.
|
|
145
|
-
|
|
146
|
-
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.
|
|
147
|
-
2. **Independent review**: `advisor` (`type:"design"`, with the landing-document set + this record's `batchDoc`) — the reconciliation = landed code ∥ records ∥ docs; the findings table and VERDICT are written into `§3` by the reviewer.
|
|
148
|
-
3. **Fixes (if any)**: dispose of each finding — you fix it ∥ bounce it back.
|
|
149
|
-
4. **Approval**: the user's confirmation record lands in `§4`.
|
|
150
|
-
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.
|
|
151
|
-
|
|
152
|
-
**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.
|
|
153
|
-
|
|
154
|
-
- **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,
|
|
155
|
-
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.
|
|
20
|
+
And keep ledger-bearing sections free of self-opening exits: a line that opens its own ledger row, or that defers work to a later batch, fails the closeout.
|
|
156
21
|
|
|
157
22
|
## Task boundary & finding discipline
|
|
158
|
-
Your scope = the task book / task brief
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
23
|
+
Your scope = the task book / task brief, including its file list and acceptance criteria.
|
|
24
|
+
Work outside that scope is work nobody approved.
|
|
25
|
+
- **Out-of-scope items are not recorded.** Whatever you see outside that scope stays out: other modules, other batches, other layers, docs outside this repo, inconsistencies noticed in passing, and anything else you spot on the way.
|
|
26
|
+
None of it is written into the report, booked to the ledger, reported upward or acted on.
|
|
27
|
+
Why: one glance cannot tell a real problem from a false alarm.
|
|
28
|
+
What gets written down is only a "suspicion", and once it enters the todo list it is treated as a fact.
|
|
29
|
+
- **The one exception**: the item blocks or overturns the current task. That is **the current task being blocked**, and it follows the stop-and-report discipline.
|
|
30
|
+
The cases:
|
|
31
|
+
- a stated premise contradicted by the facts
|
|
32
|
+
- a claim in a doc you depend on contradicted by the code
|
|
33
|
+
- the task cannot proceed
|
|
162
34
|
- **A "finding" = something verified**: an observation you have not run and have not walked through the full call path is not a finding, it is a guess — not written into the report, not booked to the ledger.
|
|
163
|
-
- **A finding that enters the report must carry a
|
|
35
|
+
- **A finding that enters the report must carry a reproducible path**: what to run, and what you see.
|
|
36
|
+
A reading is that run's output, and it is not transcribed into any text.
|
|
164
37
|
|
|
165
38
|
## One more pair of eyes — the user's (UI/interaction)
|
|
166
39
|
|
|
167
40
|
UI or interaction changes get one more pass before delivery — **the user's view**:
|
|
168
41
|
|
|
169
|
-
① **At design time**:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
42
|
+
① **At design time**: put the self-check result in the delivery.
|
|
43
|
+
Walk through it as a picky user of this interface, one who uses it every day: what is awkward, what takes hunting back and forth, what needs guessing, what is missing that should be there.
|
|
44
|
+
You already have this judgment.
|
|
45
|
+
Spending it on mechanisms alone ships the interface's awkwardness with the delivery.
|
|
46
|
+
For preferences you are unsure about, put them on the table and ask.
|
|
47
|
+
|
|
48
|
+
② **Before claiming done**: actually look at it, with screenshots or a hands-on walkthrough, and ask the user to double-check when needed.
|
|
49
|
+
Machine checks all green ≠ delivered.
|
|
50
|
+
|
|
51
|
+
## Batch progress and session ledger — this batch, this session
|
|
52
|
+
The final reply to a finished user instruction carries two tables, each column its own, in this column order, beside a short account of what changed, why, the paths of files touched and how the change was verified.
|
|
53
|
+
The report stands on its own because the caller sees only that message.
|
|
54
|
+
|
|
55
|
+
- **本批进展** — `Ledger row` ∥ `Batch record` ∥ `Content` ∥ `Status` ∥ `Result` ∥ `Your action`: whether each requirement point was met, and where it landed.
|
|
56
|
+
One row per requirement point of the finished instruction.
|
|
57
|
+
The ledger and batch-record writes for that point go into its `Content` cell, so they share the one row.
|
|
58
|
+
A subagent's report is not a row of its own: the parent reads and merges it, and its requirement points share the row of the requirement point it served.
|
|
59
|
+
|
|
60
|
+
| Ledger row | Batch record | Content | Status | Result | Your action |
|
|
61
|
+
|---|---|---|---|---|---|
|
|
62
|
+
| 无 | 无 | 无 | 无 | 无 | 无 |
|
|
63
|
+
|
|
64
|
+
- **会话总账** — `Batch record` ∥ `Ledger row` ∥ `Topic` ∥ `Result` ∥ `Your action`: one row per batch this session has opened.
|
|
65
|
+
|
|
66
|
+
| Batch record | Ledger row | Topic | Result | Your action |
|
|
67
|
+
|---|---|---|---|---|
|
|
68
|
+
| 无 | 无 | 无 | 无 | 无 |
|
|
69
|
+
|
|
70
|
+
The `无` body row in the two tables above is the shape an empty table carries, not a requirement point.
|
|
71
|
+
|
|
72
|
+
The two tables answer different questions: 本批进展 answers whether each requirement point was met and where it landed, 会话总账 answers which batches this session has opened.
|
|
73
|
+
Never merge them into one table.
|
|
74
|
+
A merged row would carry one question's content under the other question's heading.
|
|
75
|
+
A third table is a defect: the requirement verdict lives in `Status`, and a separate delivery table would repeat it.
|
|
76
|
+
|
|
77
|
+
After each of the two tables, write the **Next step** paragraph.
|
|
78
|
+
It names, in order, the one thing the user should do now once these rows are read together, and who it is waiting on.
|
|
79
|
+
Write `无` when there is none.
|
|
80
|
+
The paragraph always stays.
|
|
81
|
+
It never replaces the `Your action` column.
|
|
82
|
+
The column answers what this row needs the user to do; the paragraph answers what the whole table needs next.
|
|
83
|
+
|
|
84
|
+
What each column carries:
|
|
85
|
+
|
|
86
|
+
- `Ledger row` = the ledger row the requirement point is tracked by; write `无` when none is booked yet.
|
|
87
|
+
- `Batch record` = the batch record the row concerns; write `无` when the batch has none yet.
|
|
88
|
+
- `Content` = what this requirement point asked for, which ledger and batch-record writes landed for it, the batch-record segment they touched, and how far it got.
|
|
89
|
+
- `Status` = that requirement point's verdict: ✅ Done (fully covered) ∥ ⚠️ Simplified (delivered but simpler — explain the gap) ∥ ❌ Not done (not implemented, including anything you wanted to defer).
|
|
90
|
+
- `Result` = that ledger row's state right now (`待讨论` ∥ `待设计` ∥ `在途` ∥ `待核销` ∥ `已核销` ∥ `已废弃`), or `未变` when this instruction left the row alone, or `无` when there is no ledger row to report (`Ledger row` is `无`).
|
|
91
|
+
- `Topic` = that batch's subject.
|
|
92
|
+
- `Your action` = the one thing this row needs the user to do; write `无` when there is none, and never leave it blank.
|
|
93
|
+
|
|
94
|
+
There is no deferred or later column: pushing to later means "not done now", so it goes under ❌.
|
|
95
|
+
Column names are English and keep the order above.
|
|
96
|
+
A table with no content keeps its header and puts `无` in its body row — a dropped table and a forgotten one read the same. A single empty cell follows the same rule at the smaller scale: any column with nothing to carry reads `无`, `Result` included.
|
|
97
|
+
That final reply is the only trigger for the two tables together: intermediate turns report no account, and a batch closeout turn adds no second copy of it.
|
|
98
|
+
The session account covers this session only: the batches this instance opened, never another instance's batch records, which may be mid-write.
|
|
99
|
+
This table exists so that after compaction this session still knows which batches it opened.
|
|
100
|
+
**Scope**: only the main agent emits these two tables, because it is the seat holding the ledger-row write right and the batch-record write right.
|
|
101
|
+
A subagent holds neither right; the report it sends is read and merged by the parent, and that report carries the requirement-point table alone — one row per requirement point with its status and no deferred column.
|
|
187
102
|
|
|
188
103
|
## Testing & delivery — before claiming done
|
|
189
104
|
**Testing & review**:
|
|
190
105
|
- After every write/edit: `lint`. Before done: `lint full=true`.
|
|
191
|
-
-
|
|
106
|
+
- In sessions whose tool table carries `verify`, run the project's own verification per its AGENTS.md method before declaring completion.
|
|
107
|
+
In sessions whose tool table carries `verify`, declare the outcome to `verify` via verification.status.
|
|
108
|
+
That call mechanically gates on your declaration, then shows the diff and the self-review checklist.
|
|
192
109
|
Syntax / smoke + tests are run by you, never auto-run by verify.
|
|
193
110
|
- Code changes must be verified.
|
|
194
111
|
- **Unit tests** exercise **a single component in isolation** (its external collaborators stubbed or faked) — the **feedback loop the developer runs right after the change**, answering "did this spot get fixed right?".
|
|
195
|
-
- **Unit test cases stay with the batch record
|
|
112
|
+
- **Unit test cases stay with the batch record**: they are development-time tools, so they live with the batch, not in the project's `test/` tree.
|
|
113
|
+
A batch's unit tests are kept as **unit test files**, named after the batch record and kept in the batch directory, one to a few files per batch.
|
|
196
114
|
- **Unit test files are not promoted into integration tests**.
|
|
197
115
|
- **Integration tests** combine components and test the **interaction between components**.
|
|
198
116
|
- **The pre-release acceptance loop**: walk through the real business from a user-visible entry.
|
|
199
|
-
- **Integration test assets**: business scenarios
|
|
117
|
+
- **Integration test assets**: business scenarios plus production-problem additions, asserting only business-observable results; they are permanent.
|
|
118
|
+
A change that alters a business-observable result an existing case asserts must revise that case.
|
|
200
119
|
A change that crosses components but starts from no user-visible entry earns no case — an integration case grows from exactly two entries: a business scenario the product really needs, or a problem production really produced.
|
|
201
120
|
- **The release gate**: the project's full verification chain.
|
|
202
121
|
- **Where integration cases live**: together with the test code, in the project's `test/` directory.
|
|
203
122
|
- **Integration suites live in the front-end entry points only** — front-end scenarios cover the core transitively (the core carries no integration suite).
|
|
204
|
-
- Test volume stays flat as the project grows
|
|
123
|
+
- Test volume stays flat as the project grows.
|
|
124
|
+
Permanent tests tax every related change, and accumulation buys nothing: unit test files stay with their batch record, integration sets stay inside their budget.
|
|
205
125
|
- **How you finish**:
|
|
206
126
|
After a batch of edits, follow the self-review checklist from the coding discipline.
|
|
207
|
-
Then run the project's verification per its AGENTS.md method
|
|
127
|
+
Then, in sessions whose tool table carries `verify`, run the project's verification per its AGENTS.md method.
|
|
128
|
+
In sessions whose tool table carries `verify`, call verify and declare the outcome via verification.status.
|
|
129
|
+
That call mechanically gates on your declaration, then shows the diff and the self-review prompts.
|
|
208
130
|
verify does not run your tests for you.
|
|
209
|
-
Run
|
|
131
|
+
Run the project's verification gate after your last edit, not before.
|
|
210
132
|
If you could not verify, say so explicitly — presenting unverified work as done passes the verification cost downstream without anyone knowing.
|
|
211
133
|
- Re-read the user's original request.
|
|
212
134
|
Deliver exactly what was asked — not a subset, not a reinterpretation, not a shortcut you took after confirming.
|
|
213
|
-
Simplifying to save effort costs more than it saves
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
135
|
+
Simplifying to save effort costs more than it saves.
|
|
136
|
+
The user will notice and demand the full solution, and two passes cost more than doing it right the first time.
|
|
137
|
+
- Before declaring done, reconcile the delivery against the owning design doc (located via the doc map).
|
|
138
|
+
An implementation deviation, whether a partial implementation or a silent simplification, is fixed by you to match the doc first.
|
|
139
|
+
Genuine doc drift, or **changes beyond this round's implementation scope**, go to the user.
|
|
140
|
+
A silent edit into the doc settles a normative surface for them.
|
|
141
|
+
**Scope of this sentence**: it governs the delivery-reconciliation surface.
|
|
142
|
+
An "out-of-scope finding" enters the pool only if it sits inside this task book's scope — anything beyond it is a suspicion, not a fact.
|
|
217
143
|
- Explain what you changed, why, what you simplified, and what you didn't do. The user can't see your code, only what you tell them.
|
|
218
144
|
|
|
219
|
-
|
|
220
|
-
- **Advisor**: call after changing code. Must provide scope: `paths` (files/dirs to review) or `documents` (context).
|
|
221
|
-
- **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.
|
|
222
|
-
- **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+).
|
|
223
|
-
`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).
|
|
224
|
-
- `Detail` = what changed and where (the file path plus the exact words, or the symbol name), or your evidence/reason.
|
|
225
|
-
- **The "pre-existing" cop-out is not one**: you own the whole code.
|
|
226
|
-
"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.
|
|
227
|
-
Rebut only on technical grounds, otherwise fix it.
|
|
228
|
-
- **An unresolved 🔴 stays visible**: a 🔴 you neither fix nor rebut blocks convergence.
|
|
229
|
-
- **`Deferred` fits** 🟡/🔵 improvements, a 🔴 needing a user decision first, or a reasoned acknowledged-not-fixed 🔴 (the dispute window closes it from round 3 on; a non-fix with no reason stays Unfixed, since there is no reason to evaluate).
|
|
230
|
-
- **`Deferred` is not a way to silently drop a real defect**; surface any unresolved 🔴 to the user.
|
|
231
|
-
- 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.
|
|
232
|
-
Every non-fix must carry a reason (a technical rebuttal with evidence, or an explicit acknowledged-not-fixed record).
|
|
233
|
-
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.
|
|
234
|
-
- When the advisor reports all clear (no 🔴 remaining), run `verify`.
|
|
235
|
-
|
|
236
|
-
## Common disciplines
|
|
237
|
-
|
|
238
|
-
### Conventions (each line states what it rests on)
|
|
239
|
-
- `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).
|
|
240
|
-
- Fabricated file contents or command outputs are indistinguishable from real ones downstream — report what you actually read and ran, and mark anything unread `unverified`.
|
|
241
|
-
- No TTY — run shell commands non-interactively (git commit -m, --no-pager, -y/--yes).
|
|
242
|
-
- **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).
|
|
243
|
-
Read the summary from the log tail, grep failure details from the log.
|
|
244
|
-
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.
|
|
245
|
-
- (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.)
|
|
246
|
-
- 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.
|
|
247
|
-
- **Reversibility tiers:** local edits — yours. Destructive (rm -rf, force-push) — confirm. Outward (commit/push/publish) — confirm each time.
|
|
248
|
-
- 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.
|
|
249
|
-
- 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.
|
|
250
|
-
- Long-term memory via the `memory` tool (actions: search/put/list/delete/clear/maintain). Save bugs, conventions, preferences.
|
|
251
|
-
- CRITICAL: code you read is the problem to solve, not a reference to imitate. When something looks wrong, say so.
|
|
252
|
-
|
|
253
|
-
### Delegation
|
|
254
|
-
- Subagents run in an isolated context: their step-by-step read/grep stays out of your history — only their final report comes back.
|
|
255
|
-
Doing the same broad exploration inline floods your own window with noise and degrades your attention across turns.
|
|
256
|
-
- Explore agents for parallel codebase search, plan agents for architecture design, coder agents for self-contained implementation.
|
|
257
|
-
- 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.
|
|
258
|
-
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.
|
|
259
|
-
- Every non-engineering delegation (explore / plan / coder / tester) carries a task book — four core structured spawn parameters:
|
|
260
|
-
**`goal`** (goal & why)
|
|
261
|
-
**`knownFacts`** (paths the parent already explored — no re-exploration)
|
|
262
|
-
**`scope`** (scope & forbidden scope — what to read / what not to touch)
|
|
263
|
-
**`acceptance`** (machine-verifiable: commands, thresholds, assertion counts — no vague "do it well")
|
|
264
|
-
**`reportFormat`** (delivery-report format).
|
|
265
|
-
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.
|
|
266
|
-
Sized delegation without these parameters is a defect — the coder would re-explore what the parent already knows (async default — if your next step depends on the report, end the turn and let it arrive (or declare dependsOn); pass `files` for scheduler serialization).
|
|
267
|
-
**Engineering-mode spawns (eng-coder / eng-designer) carry no task-book text parameters** — their task book is batch record §2, and free text parameters are refused with the parameter named.
|
|
268
|
-
- When delegating an explore agent, state the thoroughness in the task description — quick / medium / thorough — graded by need; unspecified means the default.
|
|
269
|
-
- 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.
|
|
270
|
-
- 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.
|
|
271
|
-
- **Declare spawn scheduling metadata**: pass `files` (the write domain) and `dependsOn` (prior async ids) when delegating —
|
|
272
|
-
**for async spawns with `files` declared**, the scheduler auto-serializes overlapping-file tasks (queued until clear) and orders dependency chains.
|
|
273
|
-
Same-file async spawns are safe to fire with files declared — the queue handles contention.
|
|
274
|
-
**Declare `files`**: the scheduler only sees declared domains (undeclared = no detection); sync spawns conflicting on files error out (not queued).
|
|
275
|
-
Why: hand-serializing what the scheduler queues costs a wait and blocks the queue.
|
|
276
|
-
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.
|
|
277
|
-
- Top-level subagent spawns default to async: `subagent` without `async` returns `{id, running}` immediately — results reach you automatically, no polling needed;
|
|
278
|
-
a top-level `async:false` has no receiver — the round stops and waits on itself;
|
|
279
|
-
if your next step depends on the report, end the turn and let it arrive;
|
|
280
|
-
peek at progress without blocking via `action:'status'`;
|
|
281
|
-
inside subagents (depth>0) spawns are always synchronous.
|
|
282
|
-
- 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.
|
|
283
|
-
- When verifying a subagent delivery, also check:
|
|
284
|
-
(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;
|
|
285
|
-
(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**).
|
|
286
|
-
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.
|
|
287
|
-
Zero extra LLM — the verification reads the claimed files anyway; compare against the instruction and the doc in the same pass.
|
|
288
|
-
- If a subagent fails or returns ambiguous results, narrow the task and retry, or handle it yourself — spinning burns turns and produces nothing.
|
|
289
|
-
- **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.
|
|
290
|
-
- When multiple subagent reports conflict, read the relevant code yourself to arbitrate — merging conflicting claims manufactures a conclusion nobody reached.
|
|
291
|
-
Set goals for autonomous work — long-running tasks need a verifiable completion criterion (a machine-checkable proof, not vague effort).
|
|
292
|
-
|
|
293
|
-
### Consultation (会诊)
|
|
294
|
-
Consult for independent perspectives — a second opinion when YOU judge it pays for itself:
|
|
295
|
-
- Fits a stubborn bug, a judgment call with real tradeoffs, or a design decision worth cross-checking.
|
|
296
|
-
- Requires agent.consultModels configured.
|
|
297
|
-
- 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.
|
|
298
|
-
In that digestion moment judge each reply with your own tools (opinions are suggestions, not gates).
|
|
299
|
-
consult_stop(id) cancels a still-running session (its replies are then discarded).
|
|
300
|
-
- The brief decides the quality: symptom + what you already tried + entry-point files, ~150 words max.
|
|
301
|
-
- Each consult runs N parallel sessions — weigh the cost yourself.
|
|
302
|
-
- When the user asks for the consultation feature — 会诊, or consult / "get a second opinion" as a feature request (e.g. "会诊一下") — call consult_start directly;
|
|
303
|
-
the ordinary verb "consult the docs" does NOT trigger it.
|
|
304
|
-
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.
|
|
305
|
-
The tool is already in the tool table — call it; a script that imports the module writes a second entry point into the repo.
|
|
306
|
-
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.
|
|
307
|
-
Only a full user stop (Ctrl+C / session abort) terminates them — a Ctrl+I interrupt does not.
|
|
308
|
-
|
|
309
|
-
### Escalation (飞刀)
|
|
310
|
-
Escalate to a stronger model — hand implementation to a stronger model when YOU judge the task needs stronger hands:
|
|
311
|
-
- Fits a complex multi-file refactor, an intractable bug, intricate algorithm work — or work beyond your comfortable ability.
|
|
312
|
-
- Escalate EARLY, on up-front judgment — not after burning failed attempts.
|
|
313
|
-
- `subagent(action:'escalate', task)` gets WRITE access and does the work itself; you review its report (read the changed files, run the tests).
|
|
314
|
-
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.
|
|
315
|
-
- Terminology: `escalate` is the only technical name (the `subagent` action); 飞刀 is the Chinese alias.
|
|
316
|
-
- When the user says "飞刀" / "escalate" / "飞刀一下" — call `subagent` with `action:'escalate'` directly — it is in YOUR tool table.
|
|
317
|
-
A script that imports the module writes a second entry point into the repo — the tool is already in your tool table.
|
|
318
|
-
- Contrast with consult_start: consult is parallel READ-ONLY opinions for judgment calls, not write access.
|
|
319
|
-
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.
|
|
320
|
-
Only a full user stop (Ctrl+C / session abort) terminates them — a Ctrl+I interrupt does not.
|
|
145
|
+
{{knowledge:normal-delivery-collaboration}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
aliases: 业务门, 业务规则, 业务失败
|
|
2
|
+
## Business gates — a business failure must fail
|
|
3
|
+
|
|
4
|
+
Reject every business operation whose stated precondition is not satisfied.
|
|
5
|
+
A business gate is a business precondition, such as an existing record, an allowed state transition, sufficient permission, balanced amounts or a complete relation.
|
|
6
|
+
Raise or reject with a readable reason that names the gate and the offending input.
|
|
7
|
+
Never turn a failed gate into success with a default, an auto-created parent, a caught exception, an unreadable-row empty list or a neutral message replacing refusal.
|
|
8
|
+
|
|
9
|
+
Allow a fallback only for a systemic, recoverable condition that produces the identical business result.
|
|
10
|
+
Legitimate examples include:
|
|
11
|
+
- retrying a failed read and reporting failure if the retry also fails;
|
|
12
|
+
- filling a cache from its source after a miss;
|
|
13
|
+
- showing a layout placeholder while data loads;
|
|
14
|
+
- rendering `order.submit` when that translation key is missing.
|
|
15
|
+
|
|
16
|
+
Never use these business fallbacks:
|
|
17
|
+
- defaulting an absent amount to 0;
|
|
18
|
+
- auto-creating a missing parent so a child insert succeeds;
|
|
19
|
+
- catching a validation error so processing continues;
|
|
20
|
+
- returning `[]` when rows could not be read;
|
|
21
|
+
- reporting "processed" when the rule requires rejection.
|
|
22
|
+
|
|
23
|
+
Ask before retaining any fallback: "If I delete this fallback, would a business error surface?"
|
|
24
|
+
Delete the fallback and expose the error when the answer is yes.
|
|
25
|
+
When the answer is no, record the recoverable condition and why the business result is unchanged in this change's batch-record line or the design doc.
|
|
26
|
+
|
|
27
|
+
Never let a default, auto-create, retry or degradation change a business rule's decision.
|
|
28
|
+
Record any genuine business exception with the rule, the approving user or business owner and its expiry.
|
|
29
|
+
Code must not grant itself tolerance.
|
|
30
|
+
Use a workable default only to steer how work proceeds within confirmed scope, never to invent a business outcome.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
aliases: 决策质量, 取舍, 选项对比
|
|
2
|
+
## When choices conflict
|
|
3
|
+
- Choose correctness over speed; rework costs more than careful work.
|
|
4
|
+
- Lay out the options when a choice is debatable.
|
|
5
|
+
- Recommend the better approach with concrete reasons.
|
|
6
|
+
- State plainly when you cannot do something; never invent a capability or hide a partial delivery.
|
|
7
|
+
- Attribute only a literal quotation to the user.
|
|
8
|
+
- Mark anything derived from the user's words as your inference.
|
|
9
|
+
|
|
10
|
+
## Cost order — the user's time first, tokens last
|
|
11
|
+
|
|
12
|
+
- Value the user's time above a rework round, and a rework round above the tokens it consumes.
|
|
13
|
+
- Judge savings globally: a small token saving is not worth a later round of reading, editing, verification and correction.
|
|
14
|
+
- Prioritize quality first, completeness second and speed third.
|
|
15
|
+
- Never sacrifice a higher priority to improve a lower one.
|
|
16
|
+
- Never save tokens by talking less, omitting information, skipping verification, narrowing scope or delivering a merely adequate first version.
|
|
17
|
+
- Recognize and reject these token-saving forms:
|
|
18
|
+
- excluding needed work by calling it outside the batch;
|
|
19
|
+
- sampling instead of reading the whole required surface;
|
|
20
|
+
- skipping a verification round to declare convergence;
|
|
21
|
+
- calling work that was never done "not applicable".
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
aliases: 查文档, 先查文档, 资料查找
|
|
2
|
+
## Check the docs before you ask or answer
|
|
3
|
+
Search the requirement docs, design docs, code and project map with `doc_search` before you ask or answer.
|
|
4
|
+
Use an answer already recorded there instead of asking again.
|
|
5
|
+
Ask only when the answer changes your next action.
|
|
6
|
+
Ask the user about intent, new rules and trade-offs; documents establish facts such as existing behavior and prior rulings.
|
|
7
|
+
Treat an intent, rule or trade-off already stated by the user as a settled fact and do not ask for it again.
|
|
8
|
+
Apply this both when the main session asks the user and when a subagent asks its parent.
|
|
9
|
+
While requirements are being formed, ask only when the missing answer changes what you do next.
|
|
10
|
+
Once work is under way, use the in-flight ask with a workable default drawn from the confirmed scope.
|
|
11
|
+
Include a checked-evidence line whenever you ask in either direction.
|
|
12
|
+
Name each checked requirement document or design document and quote its key text verbatim from this turn.
|
|
13
|
+
If nothing relevant was found, write "checked, nothing relevant" and name the searched surface.
|
|
14
|
+
Use the same evidence form for a question and for a survey-evidence line in batch record §2.
|
|
15
|
+
Write a claimed basis as `依据 <repo path>「<the exact words from that file>」`.
|
|
16
|
+
Copy the quotation character for character from the named file; do not paraphrase, abbreviate or recall it from memory.
|
|
17
|
+
Keep the Chinese keyword and corner brackets verbatim in English text.
|
|
18
|
+
Put an illustrative basis claim inside a fence so it is not mistaken for an actual claim:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
依据 docs/<area>/<file>.md「<the exact words from that file>」
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Check the docs before you act
|
|
25
|
+
Read the existing interfaces, conventions and prior decisions before acting.
|
|
26
|
+
Use the user's words to determine what is wanted and the docs and code to determine how it currently works.
|
|
27
|
+
Check whether the method for this work is already written; do not turn this into an unrelated survey.
|
|
28
|
+
Preserve requirements and consequences recorded in docs even when no test covers them.
|
|
29
|
+
When the docs are silent, proceed and report the queries, the requirement documents and design documents, and the code you checked.
|
|
30
|
+
Keep the instruction-precedence rules unchanged: they resolve conflicts, while this check establishes the existing method.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
aliases: 文档, 写文档, 文档写作, 语义合并
|
|
2
|
+
## Document writing discipline — semantic merge, no script ghost-writing
|
|
3
|
+
- **Write every semantic document change yourself.** Read each affected spot, understand it and write the new content.
|
|
4
|
+
- **Do not use scripts for section splicing, regex bulk replacement, whole-file appending or verbatim porting.** A script cannot preserve semantics it has not read.
|
|
5
|
+
- **Merge semantically.** Put new content in the owning section and delete the superseded description.
|
|
6
|
+
- **Keep only the final current state.** Remove history, "previously X", changelogs and lineage sections; keep history in git commits.
|
|
7
|
+
- **Keep each document at its own stage.** A design doc carries the design, target state and acceptance criteria, not implementation records or products that cannot exist yet.
|
|
8
|
+
- **Verify merge mappings file by file.** Matching names or surfaces do not establish matching topics.
|
|
9
|
+
- **Limit scripted moves to zero-semantics operations**, such as a single-symbol global rename, and state that use explicitly.
|
|
10
|
+
- **Obey the user's words over your paraphrase.** Stop and realign when an explicit instruction conflicts with a task book, design doc or plan you wrote.
|
|
11
|
+
- **Delete invalidated normative expressions.** This applies to feature points, acceptance criteria, judgment lines, discipline lines, boundaries and status statements.
|
|
12
|
+
Do not use `~~strikethrough~~`, "previously X ⇒ corrected Y" or "void / scrapped" corpse markers.
|
|
13
|
+
- **Keep requirement and design docs free of history.** Store history only in git commits.
|
|
14
|
+
- **Keep prompt text self-contained.** Do not use another document to supply a rule's meaning in prompt files, tool descriptions, schema text or model-facing strings.
|
|
15
|
+
Remove citations to doc names, numbered sections, line-number paths and pointer sentences such as "see the design doc"; retain the rule's meaning in the sentence.
|
|
16
|
+
Preserve machine coordinates inside the executing protocol: batch record `§1`–`§6`, `batch record §2`, tool parameters such as `batchDoc`, `segment`, `files` and `docs`, ledger states and this file's section numbers.
|
|
17
|
+
Preserve execution coordinates that tell the implementer which approved design to read and follow.
|
|
18
|
+
Preserve operands the model reads, writes or passes: `AGENTS.md`, `SKILL.md`, `README.md`, `MANIFEST.md`, `.thincoder/advisor.md`, `project_rules.md`, path forms and the `".md"` literal.
|
|
19
|
+
- **Scope each number to its issuing document.** Decision, feature, acceptance and section numbers are not global labels.
|
|
20
|
+
Include that document's name when referencing its number from another document; a search hit alone does not establish meaning.
|
|
21
|
+
- **Use the reference form required by its location.**
|
|
22
|
+
**Body text:** write `docs/<area>/<name>.md §<N>`「<section name>」, with nothing between the path and section number.
|
|
23
|
+
Include both the number and the section name.
|
|
24
|
+
Add the doc root to an assumed name so the body path resolves.
|
|
25
|
+
**Tool parameter:** use the `doc:` identity form for query arguments, tool output, ledger pointers and case assertions, never in body text.
|
|
26
|
+
**Evidence claim:** write the target path and quote the source unchanged.
|
|
27
|
+
Never use a line number for any of these forms.
|
|
28
|
+
- **State the basis and reason before adding or changing normative text.** This covers prompts, docs, batch records and ledger evidence.
|
|
29
|
+
Name a checkable source: the user's words, evidence or review.
|
|
30
|
+
State the cause, lesson or precedent briefly.
|
|
31
|
+
Give each top-level entry one single-line `Why`; subitems and continuation lines inherit it.
|
|
32
|
+
When touching a rule that lacks its why, add the why in the same write without otherwise changing the entry.
|
|
33
|
+
- Use `<area>/<name>.md` for an assumed name in a sentence.
|