@llman-sdd/core 0.7.3 → 0.7.5

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.
Files changed (42) hide show
  1. package/package.json +1 -1
  2. package/src/archive/freeze.ts +6 -2
  3. package/src/archive/frozenCard.ts +11 -9
  4. package/src/change/frontmatter.ts +12 -0
  5. package/src/change/lifecycle.ts +3 -1
  6. package/src/context/retrieve.ts +1 -1
  7. package/src/index.ts +1 -0
  8. package/src/report/graph/deps.ts +12 -1
  9. package/src/validation/changeCheck.ts +12 -0
  10. package/templates/en/skills/llman-sdd-apply.md +1 -1
  11. package/templates/en/skills/llman-sdd-draft.md +2 -2
  12. package/templates/en/skills/llman-sdd-propose.md +3 -3
  13. package/templates/en/skills/llman-sdd-quick.md +2 -2
  14. package/templates/en/skills/llman-sdd-research.md +1 -1
  15. package/templates/en/units/skills/validation-hints.md +1 -1
  16. package/templates/en/units/workflow/archive-freeze-guidance.md +2 -2
  17. package/templates/zh-Hans/skills/llman-sdd-apply-cycle.md +7 -7
  18. package/templates/zh-Hans/skills/llman-sdd-apply.md +30 -30
  19. package/templates/zh-Hans/skills/llman-sdd-arch-review.md +10 -10
  20. package/templates/zh-Hans/skills/llman-sdd-archive.md +7 -7
  21. package/templates/zh-Hans/skills/llman-sdd-continue.md +5 -5
  22. package/templates/zh-Hans/skills/llman-sdd-draft.md +10 -10
  23. package/templates/zh-Hans/skills/llman-sdd-explore.md +10 -10
  24. package/templates/zh-Hans/skills/llman-sdd-ff.md +5 -5
  25. package/templates/zh-Hans/skills/llman-sdd-propose.md +24 -24
  26. package/templates/zh-Hans/skills/llman-sdd-quick.md +4 -4
  27. package/templates/zh-Hans/skills/llman-sdd-research.md +6 -6
  28. package/templates/zh-Hans/skills/llman-sdd-specs-compact.md +2 -2
  29. package/templates/zh-Hans/skills/llman-sdd-validate.md +1 -1
  30. package/templates/zh-Hans/skills/llman-sdd-verify.md +11 -11
  31. package/templates/zh-Hans/skills/llman-sdd-wayfinder.md +7 -7
  32. package/templates/zh-Hans/units/skills/cli-footer.md +1 -1
  33. package/templates/zh-Hans/units/skills/ethics-governance.md +5 -5
  34. package/templates/zh-Hans/units/skills/git-native-flow-brief.md +2 -2
  35. package/templates/zh-Hans/units/skills/git-native-flow.md +4 -4
  36. package/templates/zh-Hans/units/skills/human-readable-summary.md +3 -3
  37. package/templates/zh-Hans/units/skills/review-stamp.md +1 -1
  38. package/templates/zh-Hans/units/skills/stage-guard.md +4 -4
  39. package/templates/zh-Hans/units/skills/structured-protocol.md +2 -2
  40. package/templates/zh-Hans/units/skills/validation-hints.md +2 -2
  41. package/templates/zh-Hans/units/skills/version-drift.md +1 -1
  42. package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llman-sdd/core",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "Pure domain logic for llman-sdd (config, gherkin specs, validation, templates)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  import { join } from 'node:path';
10
10
 
11
11
  import { firstH1 } from '../change/collect.ts';
12
- import { extractFrontmatter } from '../change/frontmatter.ts';
12
+ import { extractFrontmatter, readFrontmatterTitle } from '../change/frontmatter.ts';
13
13
  import {
14
14
  FROZEN_CARD_EXT,
15
15
  composeFrozenCard,
@@ -102,9 +102,13 @@ export async function runFreeze(
102
102
  const proposalRel = `${ARCHIVE_DIR_REL}/${c}/proposal.md`;
103
103
  const proposal = io.exists(proposalRel) ? io.readText(proposalRel) : '';
104
104
  const frontmatter = extractFrontmatter(proposal) ?? '';
105
+ // r24: frontmatter `title` wins when non-empty; H1 is the legacy fallback.
105
106
  cards.push({
106
107
  datedId: c,
107
- source: composeFrozenCard(firstH1(proposal), frontmatter),
108
+ source: composeFrozenCard(
109
+ readFrontmatterTitle(frontmatter) || firstH1(proposal),
110
+ frontmatter,
111
+ ),
108
112
  });
109
113
  }
110
114
 
@@ -2,14 +2,16 @@
2
2
  * Frozen-change relationship-index card contract (review-freeze capability,
3
3
  * r24/r25): `freeze` replaces a dated archive dir with a flat card
4
4
  * `<YYYY-MM-DD>-<id>.yaml` whose content carries only the change's `title`
5
- * (proposal H1) and `depends_on` (proposal frontmatter) — a human/agent
6
- * readable navigation index. id and date are implied by the file name; bodies
7
- * live in the 7z cold backup. Cards are the authoritative record that a change
8
- * is in the cold backup.
5
+ * and `depends_on` — a human/agent readable navigation index. id and date are
6
+ * implied by the file name; bodies live in the 7z cold backup. Cards are the
7
+ * authoritative record that a change is in the cold backup.
9
8
  *
10
- * The card is a fenced YAML document (same `---` convention as proposal.md) so
11
- * existing frontmatter readers (`extractFrontmatter` / `parseDeps`) work
12
- * unchanged — parseDeps on a card text reads the preserved `depends_on`.
9
+ * The card is a single-document plain YAML file (no `---` fences — standard
10
+ * single-doc parsers must accept it). Reading `depends_on` from a card is
11
+ * dual-format (parseDeps in report/graph): fenced cards written by
12
+ * predecessors keep working; this writer only produces the fenced-free form.
13
+ * Title source: frontmatter `title` wins when non-empty, else the proposal H1
14
+ * (legacy archive dirs).
13
15
  *
14
16
  * Depends_on extraction is deliberately dependency-free (no `yaml` package):
15
17
  * it recognizes single-line flow `[a, b]`, block `- item` lists and multi-line
@@ -98,8 +100,8 @@ export function extractDependsOn(frontmatter: string): string {
98
100
  return 'depends_on: []';
99
101
  }
100
102
 
101
- /** Compose a relationship-index card: `title` + `depends_on` inside fences. */
103
+ /** Compose a relationship-index card: single-document YAML, `title` + `depends_on`. */
102
104
  export function composeFrozenCard(title: string, frontmatter: string): string {
103
105
  const dependsOn = extractDependsOn(frontmatter);
104
- return ['---', `title: "${escapeYamlScalar(title)}"`, dependsOn, '---'].join('\n') + '\n';
106
+ return [`title: "${escapeYamlScalar(title)}"`, dependsOn].join('\n') + '\n';
105
107
  }
@@ -43,6 +43,18 @@ export function extractFrontmatter(proposal: string): string | null {
43
43
  return splitFrontmatter(proposal).frontmatter;
44
44
  }
45
45
 
46
+ /**
47
+ * r99: frontmatter `title` value ('' when absent/empty/non-string) — the
48
+ * authoritative change title; freeze prefers it over the proposal H1.
49
+ * Internal whitespace (incl. YAML folded newlines) collapses to single
50
+ * spaces so the frozen card stays a single-line YAML scalar.
51
+ */
52
+ export function readFrontmatterTitle(frontmatter: string | null): string {
53
+ if (frontmatter === null) return '';
54
+ const title = parseDocument(frontmatter).get('title');
55
+ return typeof title === 'string' ? title.replaceAll(/\s+/gu, ' ').trim() : '';
56
+ }
57
+
46
58
  /**
47
59
  * r73: `needs_specs_change` is read from the frontmatter block only — a
48
60
  * body line with the same text must not flip the verdict. Default true.
@@ -59,7 +59,9 @@ export function newChange(
59
59
  `change proposal already exists: ./${path} (pass --force to overwrite)`,
60
60
  );
61
61
  }
62
- io.writeText(path, `---\ndepends_on: []\n---\n\n${DRAFT_PROPOSAL_TEMPLATE}`);
62
+ // r99: skeleton carries a non-empty title placeholder so a fresh draft
63
+ // passes the title gate; agents rewrite it when filling the proposal.
64
+ io.writeText(path, `---\ndepends_on: []\ntitle: TODO\n---\n\n${DRAFT_PROPOSAL_TEMPLATE}`);
63
65
  return { id, path };
64
66
  }
65
67
 
@@ -79,7 +79,7 @@ const SYSTEM_PROMPT = `You are a spec retriever. Given a task, classify which ca
79
79
  3. For requirements that look relevant, call get_spec_content(spec_id, req_ids) to read the requirement text.
80
80
  Then output ONLY this JSON (no markdown fence):
81
81
  {\\"direct\\": [{\\"id\\": \\"<spec_id>\\", \\"reason\\": \\"<one sentence why this MUST be read>\\"}], \\"related\\": [{\\"id\\": \\"<spec_id>\\", \\"reason\\": \\"<one sentence>\\"}]}
82
- - "direct" = specs whose behavior contract (any MUST/SHALL statement, command behavior) the task changes or depends on.
82
+ - "direct" = specs whose behavior contract (any requirement-semantics statement, command behavior) the task changes or depends on.
83
83
  - "related" = specs that provide useful context but whose contract won't change.
84
84
  - If the task changes behavior, the governing spec MUST be in "direct".
85
85
  - Decide based on the requirement text you read, not on the spec id alone.`;
package/src/index.ts CHANGED
@@ -128,6 +128,7 @@ export {
128
128
  readBinding,
129
129
  writeBinding,
130
130
  extractFrontmatter,
131
+ readFrontmatterTitle,
131
132
  readNeedsSpecsChange,
132
133
  } from './change/frontmatter.ts';
133
134
  export {
@@ -1,8 +1,19 @@
1
1
  /** Extract depends_on entries (flow + block styles, r30). */
2
2
  import { extractFrontmatter } from '../../change/frontmatter.ts';
3
3
 
4
+ /**
5
+ * r54 dual-format card reading: a fence-free frozen card is a plain YAML doc
6
+ * whose FIRST line opens with `title:`/`depends_on:` — feed the whole text to
7
+ * the same depends_on scan. Proposal.md bodies never open with those keys, so
8
+ * no misfire.
9
+ */
10
+ function cardYamlSource(input: string): string | null {
11
+ const firstLine = input.trimStart().split('\n')[0] ?? '';
12
+ return /^(title|depends_on):/u.test(firstLine) ? input : null;
13
+ }
14
+
4
15
  export function parseDeps(proposal: string): string[] {
5
- const fm = extractFrontmatter(proposal);
16
+ const fm = extractFrontmatter(proposal) ?? cardYamlSource(proposal);
6
17
  const deps: string[] = [];
7
18
  if (!fm) return deps;
8
19
  let inDeps = false;
@@ -2,6 +2,7 @@ import { stageFor, walkActiveChangeDirs } from '../change/collect.ts';
2
2
  import {
3
3
  extractFrontmatter,
4
4
  readBinding,
5
+ readFrontmatterTitle,
5
6
  readNeedsSpecsChange,
6
7
  specsLanded,
7
8
  } from '../change/frontmatter.ts';
@@ -256,6 +257,16 @@ export function validateChange(
256
257
  }
257
258
  }
258
259
 
260
+ // r99 title gate: active changes require a non-empty frontmatter title
261
+ // (archived proposals never reach validateChange — archive is exempt).
262
+ if (readFrontmatterTitle(fm) === '') {
263
+ push(
264
+ 'ERROR',
265
+ 'proposal.md/frontmatter.title',
266
+ "proposal.md frontmatter requires a non-empty 'title' — add `title: <one-sentence concept title>` (do not repeat the change id).",
267
+ );
268
+ }
269
+
259
270
  const binding = readBinding(text);
260
271
  // stageFor (change/collect) is the monotonic stage SSOT (r34).
261
272
  const stage = stageFor(hasDesign, hasTasks, binding !== null);
@@ -361,4 +372,5 @@ const ALLOWED_FIELDS = [
361
372
  'base_branch',
362
373
  'base_sha',
363
374
  'needs_specs_change',
375
+ 'title',
364
376
  ];
@@ -26,7 +26,7 @@ flowchart LR
26
26
 
27
27
  ## Hard Constraints
28
28
 
29
- - **Single-source-of-truth driven**: `proposal.md` / `design.md` / `tasks.md` and `llmanspec/specs/**` on the branch; every MUST/SHALL in specs must be fulfilled.
29
+ - **Single-source-of-truth driven**: `proposal.md` / `design.md` / `tasks.md` and `llmanspec/specs/**` on the branch; every behavioral-contract requirement in specs must be fulfilled.
30
30
  - **Scope-locked**: only implement the current change's scope; never fix "unrelated issues" on the side; keep changes minimal.
31
31
  - **No guessing**: unclear requirements or specs contradicting reality → STOP and report; don't assume.
32
32
  - **No legacy compatibility layers**: if the change requires new behavior, upgrade all call sites directly, unless tasks/proposal explicitly require compatibility.
@@ -26,8 +26,8 @@ flowchart LR
26
26
  - **MUST NOT ask the user for a change id**: derive it from the description via `change new --from` and announce it.
27
27
  - **MUST NOT create tasks/design/specs/attach**: only the `proposal.md` draft; full planning belongs to `llman-sdd-propose`.
28
28
  - **MUST NOT assess change scale**: that is propose's job. If the user wants to start implementing → suggest `llman-sdd-propose`.
29
- - **Scope boundary**: if the description clearly involves MUST/SHALL contract changes or multi-file impact, suggest `llman-sdd-propose` — but still create the draft first so the idea isn't lost.
30
- - **Frontmatter has a fixed schema**: `proposal.md` accepts only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" (`depends_on`, `blocks`, `branch`, `base_sha`, `needs_specs_change`, etc.); `status`/`title`/`priority`/`author` are rejected by `llman-sdd validate` as ERROR. Lifecycle stage is inferred (query via `llman-sdd show`/`list`), never stored in frontmatter. Do not re-declare frontmatter fields in the prose body (no `## Status` block); the H1 is a human-readable title, not a repeat of the change id.
29
+ - **Scope boundary**: if the description clearly involves behavioral-contract (requirement semantics) changes or multi-file impact, suggest `llman-sdd-propose` — but still create the draft first so the idea isn't lost.
30
+ - **Frontmatter has a fixed schema**: `proposal.md` accepts only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" (`depends_on`, `title`, `blocks`, `branch`, `base_sha`, `needs_specs_change`, etc.); `title` MUST be a non-empty one-sentence concept title and MUST NOT repeat the change id — missing or empty values are rejected by `llman-sdd validate` as ERROR, and so are out-of-set fields like `status`/`priority`/`author`. Lifecycle stage is inferred (query via `llman-sdd show`/`list`), never stored in frontmatter. Do not re-declare frontmatter fields in the prose body (no `## Status` block); the H1 MAY keep a human-readable title (freeze prefers the frontmatter `title`, falling back to the H1), not a repeat of the change id.
31
31
 
32
32
  ## Steps
33
33
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "llman-sdd-propose"
3
- description: "Create a proposal for MUST/SHALL behavioral contract changes (proposal/tasks → bind branch → land specs). Small changes → quick; ideas → draft."
3
+ description: "Create a proposal for behavioral-contract (requirement semantics) changes (proposal/tasks → bind branch → land specs). Small changes → quick; ideas → draft."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
@@ -36,7 +36,7 @@ flowchart LR
36
36
  {% else %}
37
37
  - **If the change already exists**: STOP. If the specs-landed gate is green, suggest `llman-sdd-apply`; otherwise finish the planning docs / binding / landing specs (edit `llmanspec/changes/<id>/`, or enable `extra_skills: [llman-sdd-continue]`).
38
38
  {% endif %}
39
- - **Frontmatter has a fixed schema**: `proposal.md` accepts only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" (`depends_on`, `blocks`, `branch`, `base_sha`, `needs_specs_change`, etc.); `status`/`title`/`priority`/`author` are rejected by `llman-sdd validate` as ERROR. Lifecycle stage is inferred (query via `llman-sdd show`/`list`), never stored in frontmatter. Do not re-declare frontmatter fields in the prose body; the H1 is a human-readable title, not a repeat of the change id.
39
+ - **Frontmatter has a fixed schema**: `proposal.md` accepts only the allowed fields in `llmanspec/AGENTS.md` "Change Proposal Frontmatter SSOT" (`depends_on`, `title`, `blocks`, `branch`, `base_sha`, `needs_specs_change`, etc.); `title` MUST be a non-empty one-sentence concept title and MUST NOT repeat the change id — missing or empty values are rejected by `llman-sdd validate` as ERROR, and so are out-of-set fields like `status`/`priority`/`author`. Lifecycle stage is inferred (query via `llman-sdd show`/`list`), never stored in frontmatter. Do not re-declare frontmatter fields in the prose body; the H1 MAY keep a human-readable title (freeze prefers the frontmatter `title`, falling back to the H1), not a repeat of the change id.
40
40
 
41
41
  ## Quick-capture routing
42
42
 
@@ -51,7 +51,7 @@ If the user just wants to **capture an idea** ("draft a proposal", "note down X"
51
51
 
52
52
  ### 1) Assess change scale
53
53
  1. Classify:
54
- - **Behavioral contract change** (modify MUST/SHALL, change external behavior) → full SDD
54
+ - **Behavioral contract change** (modify requirement semantics, change external behavior) → full SDD
55
55
  - **Implementation change** (refactor, typo, perf) → `llman-sdd-quick`
56
56
  - **Meta-spec change** (SDD templates/process) → full SDD
57
57
  - When uncertain, choose full SDD (conservative).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "llman-sdd-quick"
3
- description: "Quick path for small changes that don't touch behavioral contracts (refactor/typo/perf). If a MUST/SHALL change emerges, stop and switch to propose."
3
+ description: "Quick path for small changes that don't touch behavioral contracts (refactor/typo/perf). If a behavioral-contract (requirement semantics) change emerges, stop and switch to propose."
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
@@ -22,7 +22,7 @@ flowchart LR
22
22
  > 📍 Quick path: edit code and commit directly. If you find a contract change is needed → STOP, switch to `llman-sdd-propose`.
23
23
 
24
24
  ## Conditions (all must hold)
25
- - Does not change any MUST/SHALL-defined externally observable behavior
25
+ - Does not change any requirement-semantics-defined externally observable behavior
26
26
  - Does not cross capability boundaries; no migration/compatibility concerns; not an SDD meta-spec change
27
27
 
28
28
  ## Steps
@@ -14,7 +14,7 @@ Spin up a **background agent** to do the research while you keep working. Auxili
14
14
  1. Investigate against **primary sources** — official docs, source code, specs, first-party APIs, not secondary write-ups; trace every claim back to the source that owns it.
15
15
  2. Write findings to a single Markdown file, citing each claim's source.
16
16
  3. Save location (repo convention wins if it has one): **default** `llmanspec/changes/<current-change>/research/<topic>.md` (change docs, **not** specs). Write to `docs/research/` only when the topic spans multiple changes and will still be referenced after archiving; **never** put single-change decisions or decaying deep-dives into `docs/research/`.
17
- 4. **MUST NOT** edit `llmanspec/specs/**` in this skill. If research shows MUST/SHALL must change → suggest `llman-sdd-propose` (bind branch → land specs).
17
+ 4. **MUST NOT** edit `llmanspec/specs/**` in this skill. If research shows requirement semantics must change → suggest `llman-sdd-propose` (bind branch → land specs).
18
18
 
19
19
  ## Steps
20
20
 
@@ -10,7 +10,7 @@ Validation fixes (single-track feature-as-spec):
10
10
 
11
11
  2) Native layout (`rule must carry an @req:<req_id> tag on the rule header`):
12
12
  - One canonical style: `@req:<id>` on the `规则:` block header, nested `场景:` (Given/When/Then) as executable examples — the default preferred shape.
13
- - Only keep a `规则:` block with no nested scenario (bare rule) for requirements that cannot be expressed programmatically or are not yet converted: free-text description, no MUST/SHALL enforcement; validate reports an aggregate count, the review `pending` signal measures it, specs-compact keeps reducing it.
13
+ - Only keep a `规则:` block with no nested scenario (bare rule) for requirements that cannot be expressed programmatically or are not yet converted: free-text description, no modal-verb enforcement; validate reports an aggregate count, the review `pending` signal measures it, specs-compact keeps reducing it.
14
14
  - Legacy tags `@executable`/`@rule`/`@human`/`@manual` are gone and parse inert; when old files hit structural problems run `llman-sdd spec migrate-native`.
15
15
  - Top-level `场景:` outside any `规则:` are plain feature-level examples: no rule handle, no warning, not part of rule accounting (native Gherkin).
16
16
 
@@ -1,9 +1,9 @@
1
1
  ## Archive Cold Backup Guidance
2
- - When archived directories grow too large, use cold backup maintenance (freeze moves bodies into the 7z cold backup and replaces the dir with a flat `<YYYY-MM-DD>-<id>.yaml` index card carrying only `title` and `depends_on`):
2
+ - When archived directories grow too large, use cold backup maintenance (freeze moves bodies into the 7z cold backup and replaces the dir with a flat `<YYYY-MM-DD>-<id>.yaml` index card — single-document plain YAML carrying only `title` and `depends_on`):
3
3
  - Preview freeze candidates: `llman-sdd archive freeze --dry-run`
4
4
  - Freeze old archives: `llman-sdd archive freeze --before <YYYY-MM-DD> --keep-recent <N>`
5
5
  - List frozen entries: `llman-sdd archive freeze --list`
6
6
  - Restore when needed: `llman-sdd archive thaw --change <YYYY-MM-DD-id>` (extracts bodies back and removes the card)
7
7
  - Apply freeze/thaw only to dated archive directories (`YYYY-MM-DD-*`); keep a small recent window unfrozen.
8
- - The flat index card stays on disk: `title` (from the proposal H1) and `depends_on` (seed for graph dependency edges) are grep-able and traceable; the id and date are implied by the file name — the purpose and dependencies of a frozen change are inspectable without thawing, while bodies live in the 7z cold backup and are fetched on demand.
8
+ - The flat index card stays on disk: `title` (the frontmatter `title` when non-empty, else the proposal H1) and `depends_on` (seed for graph dependency edges) are grep-able and traceable; the id and date are implied by the file name — the purpose and dependencies of a frozen change are inspectable without thawing, while bodies live in the 7z cold backup and are fetched on demand.
9
9
  - Running outside the main checkout (a worktree not holding the default branch) prints a warning (never blocks) — continue there only intentionally.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "llman-sdd-apply-cycle"
3
- description: "单 change 端到端闭环:实施→测试→校验→verify→归档提交。仅手动触发,agent 禁止自动调用。"
3
+ description: "单 change 一轮到底:实施→测试→校验→verify→归档提交。仅手动触发,agent 不得自动调用。"
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  disable-model-invocation: true
@@ -8,7 +8,7 @@ disable-model-invocation: true
8
8
 
9
9
  # LLMAN SDD Apply Cycle
10
10
 
11
- 单 change 端到端闭环(手动)。须已绑定分支且 specs-landed 门通过(`specsLanded ∨ needsSpecsChange=false`);`readyToImplement=true`(完成信号)收拢闭环。
11
+ 单 change 一轮到底(手动)。须已绑定分支且 specs-landed 门通过(`specsLanded ∨ needsSpecsChange=false`);`readyToImplement=true`(完成信号)收拢循环。
12
12
 
13
13
  **仅手动触发**:`/skill:llman-sdd-apply-cycle <change-id>`
14
14
 
@@ -21,7 +21,7 @@ llman-sdd show <change-id> --output json --type change
21
21
  > 阶段判定用 `stage` / `readyToImplement` 字段;完整判定表见 llman-sdd-apply。
22
22
 
23
23
  - 须在绑定的非默认分支上。
24
- - specs-landed 门未过 → STOP(先落地 specs 或 `needs_specs_change: false`)。已绿但 `readyToImplement=false` → 正常:tasks 待完成,继续实施;**仅当 `readyToImplement=true` 才 finalize**。
24
+ - specs-landed 门未过 → STOP(先提交 specs 或 `needs_specs_change: false`)。已绿但 `readyToImplement=false` → 正常:tasks 待完成,继续实施;**仅当 `readyToImplement=true` 才 finalize**。
25
25
  - 进度以 `tasks.md` checkbox 为准(或 `llman-sdd list` 任务计数);实现时仍须读 `tasks.md`、proposal/design 与绑定分支上的 `llmanspec/specs/**`(唯一事实来源)。
26
26
 
27
27
  ### 1) 循环:实施 → 测试
@@ -53,15 +53,15 @@ git branch -D <feature-branch> # squash 后分支不再是 main 祖先,-d
53
53
  push / PR 仅当用户明确要求。
54
54
 
55
55
  ## 硬约束
56
- - **禁止问**「要不要继续」——除非 blocker,一路到底。
57
- - **禁止切换**其他 change,直到本 change 归档并提交。
58
- - **禁止**写 `changes/<id>/specs/`;**禁止默认 push/PR**。
56
+ - **不得问**“要不得继续”——除非 blocker,一路到底。
57
+ - **不得切换**其他 change,直到本 change 归档并提交。
58
+ - **不得**写 `changes/<id>/specs/`;**不得默认 push/PR**。
59
59
 
60
60
  ## Ethics Governance
61
61
  - `ethics.risk_level`: medium
62
62
  - `ethics.prohibited_actions`: 未绑定分支 / specs-landed 门未过就实施、未 `readyToImplement=true` 就归档、中途切换 change、写 `changes/<id>/specs/`、未校验就提交、默认 push/PR
63
63
  - `ethics.required_evidence`: `readyToImplement=true`、validate --strict 通过、tasks 全勾、finalize/archive 成功
64
- - `ethics.refusal_contract`: 自修复 8 轮仍失败 → 报告 blocker,禁止强行归档
64
+ - `ethics.refusal_contract`: 自修复 8 轮仍失败 → 报告 blocker,不得强行归档
65
65
  - `ethics.escalation_policy`: 改动 SDD 工作流 spec/模板时,归档前暂停请用户确认
66
66
 
67
67
  {{ unit("skills/cli-footer") }}
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: "llman-sdd-apply"
3
- description: "闭环实施已提案 change 的 tasks:写码→测试→失败自修复→门禁全绿。propose 完成、specs 落地后进入。"
3
+ description: "循环实施已提案 change 的 tasks:写码→测试→失败自修复→门禁全绿。propose 完成、specs 提交后进入。"
4
4
  metadata:
5
5
  version: "{{ llman_version }}"
6
6
  ---
7
7
 
8
8
  # LLMAN SDD Apply
9
9
 
10
- 在**一个闭环内**按顺序完成 `llmanspec/changes/<id>/tasks.md` 的所有任务:实现 → 补测试/验收 → 跑门禁 → 失败自修复重跑 → 全过后报告。除非明确 blocker,**不要中途问「要不要继续」**。
10
+ 按顺序在一轮内完成 `llmanspec/changes/<id>/tasks.md` 的所有任务:实现 → 补测试/验收 → 跑门禁 → 失败自修复重跑 → 全过后报告。除非明确 blocker,不得中途问“要不得继续”**。
11
11
 
12
12
  ## Pipeline 位置
13
13
 
@@ -22,20 +22,20 @@ flowchart LR
22
22
  style apply fill:#fff3cd,stroke:#ffc107,stroke-width:3px
23
23
  ```
24
24
 
25
- > 📍 进入前须 specs-landed 门通过(或 `needs_specs_change: false`);`readyToImplement=true`(全门绿)是本闭环的完成信号 → 下一步 `llman-sdd-verify`。
25
+ > 📍 进入前须 specs-landed 门通过(或 `needs_specs_change: false`);`readyToImplement=true`(全门绿)是本轮的完成信号 → 下一步 `llman-sdd-verify`。
26
26
 
27
27
  ## 硬约束
28
28
 
29
- - **唯一事实来源驱动**:`proposal.md` / `design.md` / `tasks.md` 与分支上的 `llmanspec/specs/**`;specs 的 MUST/SHALL 逐条落实。
30
- - **范围锁定**:只做当前 change 范围,禁止顺手修无关问题;改动保持最小。
31
- - **禁止猜测**:需求不明或 specs 与现实矛盾 → STOP 报告,不自行假定。
29
+ - **唯一事实来源驱动**:`proposal.md` / `design.md` / `tasks.md` 与分支上的 `llmanspec/specs/**`;specs 的行为合约条款逐条落实。
30
+ - **范围锁定**:只做当前 change 范围,不得顺手修无关问题;改动保持最小。
31
+ - **不得猜测**:需求不明或 specs 与现实矛盾 → STOP 报告,不自行假定。
32
32
  - **不留旧兼容层**:change 要求改行为就全量升级到新写法,除非 tasks/proposal 明确要兼容。
33
- - **收尾**:闭环以建议 `llman-sdd-verify` 结束;finalize/archive 归 `llman-sdd-archive`(勿在自修复循环里 finalize)。
33
+ - **收尾**:该轮以宜接 `llman-sdd-verify` 收束;finalize/archive 归 `llman-sdd-archive`(不得在自修复循环里 finalize)。
34
34
 
35
35
  ## Commit 策略
36
36
 
37
- - **change 分支上提交自由**(`change finalize` 不要求干净树):按 task/里程碑分段提交,或留脏交给 finalize 一次收尾——均为一等公民。
38
- - **默认收尾**:全部 task 过门禁且 verify 全绿后,`llman-sdd change finalize <id>` 自动提交 `archive(sdd): <change-id>`(未提交 diff + frontmatter + 改名一笔)。不要在 apply 循环内 finalize。`--no-commit` 跳过自动提交(手动/CI 历史、pre-commit hook 冲突)。
37
+ - **change 分支上提交自由**(`change finalize` 不得求干净树):按 task/里程碑分段提交,或留脏交给 finalize 一次收尾——均为一等公民。
38
+ - **默认收尾**:全部 task 过门禁且 verify 全绿后,`llman-sdd change finalize <id>` 自动提交 `archive(sdd): <change-id>`(未提交 diff + frontmatter + 改名一笔)。不得在 apply 循环内 finalize。`--no-commit` 跳过自动提交(手动/CI 历史、pre-commit hook 冲突)。
39
39
  - **blocker 中断**:因 blocker STOP 前先做**一次** WIP commit(如 `wip(sdd): <change-id> <摘要>`)保全现场再报告。
40
40
 
41
41
  ## 步骤
@@ -44,13 +44,13 @@ flowchart LR
44
44
  - 读取并遵守 `llmanspec/config.yaml`、`AGENTS.md`(若存在)。
45
45
  - `git status --porcelain`:工作区不干净且改动不属于本 change → 先 `git stash push -u -m "llman-sdd-apply autopilot backup"`。
46
46
  - `llman-sdd validate --all --strict`:失败且与本 change 无关 → 停下报告(工件不一致则无法以事实来源驱动实现)。
47
- - **检查 spec valid_scope 完整性**:`llman-sdd list --specs --json` 列出所有 spec,逐个核对 `valid_scope` 路径存在于磁盘;有缺失 → 停下并建议更新 spec(移除已删路径)。
47
+ - **检查 spec valid_scope 完整性**:`llman-sdd list --specs --json` 列出所有 spec,逐个核对 `valid_scope` 路径存在于磁盘;有缺失 → 停下并宜更新 spec(移除已删路径)。
48
48
 
49
49
  ### 1) 选定 change id 并查前置
50
- - 已提供则直接用;否则从上下文推断,不明确就跑 `llman-sdd list --json` 让用户选。始终说明「使用变更:<id>」并告知如何覆盖。
51
- - 确认在经 `llman-sdd change start <id>` 或 `change attach <id>` 绑定的非默认分支上(仅重绑用 `--force`)。分支上的 specs 即唯一事实来源——不要在 `changes/<id>/specs/` 下编写。
50
+ - 已提供则直接用;否则从上下文推断,不明确就跑 `llman-sdd list --json` 让用户选。始终说明“使用变更:<id>”并告知如何覆盖。
51
+ - 确认在经 `llman-sdd change start <id>` 或 `change attach <id>` 绑定的非默认分支上(仅重绑用 `--force`)。分支上的 specs 即唯一事实来源——不得在 `changes/<id>/specs/` 下编写。
52
52
  {{ unit("skills/stage-guard") }}
53
- - 用 `llman-sdd context --task "<proposal 目标>" --paths "<specs scope>"` 获取相关 specs。
53
+ - 用 `llman-sdd context --task "<proposal 目标>" --paths "<specs scope>"` 获取匹配 `<paths>` 的 specs。
54
54
  - context 不可用 → 先 `llman-sdd index check`:stale/缺失则 `llman-sdd index rebuild` 后重试;fresh 仍不可用(`LLMAN_SDD_INDEX_CHAT_MODEL` 未设)→ 改用 `llman-sdd list --specs` + 直读 `.feature`——勿循环 rebuild。
55
55
 
56
56
  ### 2) 通读事实来源工件
@@ -60,13 +60,13 @@ flowchart LR
60
60
  把 proposal/design 的决策整理为不可违反的硬约束清单;把 tasks.md 转成最小可执行步骤序列(保持原顺序)。
61
61
 
62
62
  ### 3) 展示状态
63
- - 进度「N/M tasks complete」+ 接下来 1–3 个未完成任务的简短概览。
63
+ - 进度“N/M tasks complete”+ 接下来 1–3 个未完成任务的简短概览。
64
64
 
65
- ### 4) 逐任务实施(闭环)
65
+ ### 4) 逐任务实施(循环)
66
66
  对每个未完成 task:
67
67
  1. **实现**:严格按 task 描述 + specs 要求,改动最小。
68
- 2. **完成后立刻勾 checkbox**:`- [ ]` → `- [x]`。**收口不是 task**:`change finalize` / `change archive` 是流水线步骤,MUST NOT 出现在 tasks.md——若已列(如「收口——finalize」),删掉(收口的任务门要求全部任务已勾)。
69
- 3. **编辑与验证串行**:验证 MUST 在编辑落盘后执行;MUST NOT 把编辑与测试/校验放进同一批并行工具调用(可能读到旧文件,产生假失败/假通过)。
68
+ 2. **完成后立刻勾 checkbox**:`- [ ]` → `- [x]`。**收口不是 task**:`change finalize` / `change archive` 是流水线步骤,不得 出现在 tasks.md——若已列(如“收口——finalize”),删掉(收口的任务门要求全部任务已勾)。
69
+ 3. **编辑与验证串行**:验证 必须 在编辑落盘后执行;不得 把编辑与测试/校验放进同一批并行工具调用(可能读到旧文件,产生假失败/假通过)。
70
70
  4. task 不明、遇 blocker、或 specs/design 与现实不一致 → STOP 报告,不自行假定。
71
71
 
72
72
  ### 5) 验证与自修复循环(每个 task 或每批 task 后跑一次)
@@ -76,37 +76,37 @@ flowchart LR
76
76
  - SDD 校验:`llman-sdd validate <id> --strict`
77
77
 
78
78
  **验证阶梯(opt-in 纪律,按成本逐级扩大)**:
79
- - L1 最小单元:`bun test tests/unit/<相关>`(<1s,直接导入),仅覆盖当前改动点。
80
- - L2 定向行为:`bun test tests/bdd -t "<场景/规则标题模式>"`——只跑相关场景的真实 CLI 链路。
79
+ - L1 最小单元:`bun test tests/unit/<改动对应目录>`(<1s,直接导入),仅覆盖当前改动点。
80
+ - L2 定向行为:`bun test tests/bdd -t "<场景/规则标题模式>"`——只跑匹配 -t 模式场景的真实 CLI 调用。
81
81
  - L3 显式全量:`llman-sdd validate --check`(配置 `specs.check_command` 时执行全量 harness;缺省 validate 不再执行 harness)。
82
82
  - L4 收口兜底:`change finalize` 预合并强制真实 harness——每次收口至少 1 次全量。
83
83
  - 自修复循环默认用 L1/L2 快速复现;只有需要全量验收时才 L3;避免无谓白付全量成本。
84
84
 
85
85
  **门禁证据**:
86
- - 缺省 `validate` 只做结构/状态门,不声明 harness 证据;harness 证据 MUST 经显式 `--check` 或收口验收取得。
87
- - 门禁结论 MUST 来自真实 harness:声称 harness 合格时 MUST 已用 `--check`(或收口);缺省结构门的通过不是通过;harness 失败 MUST 先查根因(环境变量泄漏、嵌套调用守卫、工作目录错误等),MUST NOT 以「固有/自指属性」定性后绕过。
88
- - 前后对比类判据(计数、基线)MUST 在 change 分支上测量(相对现算 merge-base);默认分支测得的值通常恒为基线,不构成证据。
89
- - 重构或批量替换类 task:MUST 对比改动前后测试用例数;门禁全绿但用例数下降视为失败。
86
+ - 缺省 `validate` 只做结构/状态门,不声明 harness 证据;harness 证据 必须 经显式 `--check` 或收口验收取得。
87
+ - 门禁结论 必须 来自真实 harness:声称 harness 合格时 必须 已用 `--check`(或收口);缺省结构门的通过不是通过;harness 失败 必须 先查根因(环境变量泄漏、嵌套调用守卫、工作目录错误等),不得 以“固有/自指属性”定性后绕过。
88
+ - 前后对比类判据(计数、基线)必须 在 change 分支上测量(相对现算 merge-base);默认分支测得的值通常恒为基线,不构成证据。
89
+ - 重构或批量替换类 task:必须 对比改动前后测试用例数;门禁全绿但用例数下降视为失败。
90
90
 
91
- **失败 → 自修复(不要问要不要继续):**
91
+ **失败 → 自修复(不得问要不得继续):**
92
92
  1. 解析失败原因(测试 / lint / 格式 / 校验)。
93
93
  2. 判定是否难定位 bug(原因不明 / 间歇 flake / 回归看不穿):
94
94
  - **不是**(明确的 lint/格式/编译/校验错误):最小修复(不扩范围),先重跑最小失败复现命令,再重跑全部门禁。
95
95
  - **是 → 升级诊断子流程**:
96
- 1. **先建一个能复现失败的命令**(快、确定、agent 可跑、能在此 bug 上变红)——驱动真实 bug 路径并断言用户症状。**MUST NOT 在没有它之前猜原因**(盯着代码空想正是要防止的失败)。
97
- 2. 运行确认变红 → 最小化复现(逐个剔除输入/调用/配置/数据,只留关键部分)。
98
- 3. 生成 **3–5 个排序假设**,每个可证伪(「若 X 是因,改 Y 会让 bug 消失」)。
96
+ 1. **先建一个能复现失败的命令**(快、确定、agent 可跑、能在此 bug 上变红)——驱动真实 bug 路径并断言用户症状。**不得 在没有它之前猜原因**(盯着代码空想正是要防止的失败)。
97
+ 2. 运行确认变红 → 最小化复现(逐个剔除输入/调用/配置/数据,只留可复现的最小输入与调用)。
98
+ 3. 生成 **3–5 个排序假设**,每个可证伪(“若 X 是因,改 Y 会让 bug 消失”)。
99
99
  4. 单变量验证(一次只改一个),找到根因后修复。
100
- 5. 没有合适 seam 写回归测试时,记录该架构缺口(交 `llman-sdd-arch-review`;未启用时写入本 change 的 `proposal.md` Further Notes 段或 `design.md`,MUST NOT 因此中断闭环)。
100
+ 5. 没有合适 seam 写回归测试时,记录该架构缺口(交 `llman-sdd-arch-review`;未启用时写入本 change 的 `proposal.md` Further Notes 段或 `design.md`,不得 因此中断循环)。
101
101
  3. 先重跑最小失败复现命令,再重跑全部门禁。
102
102
  4. 记为一轮自修复:`Round N:失败点 → 修复 → 重跑 → 通过/失败`。
103
103
 
104
104
  **自修复上限 8 轮**;超过仍不过视为 blocker:停止并输出 blocker 报告(最后一次失败命令与输出摘要、已尝试的修复)。
105
105
 
106
- **人审关卡(每批 task 门禁通过后)**:进入下一批次或输出完成报告前跑 `llman-sdd review`:退出码零 → 继续;非零 = CRITICAL → STOP 修复后重跑;MUST NOT 带 CRITICAL 进入下一批次或输出完成报告。
106
+ **人审关卡(每批 task 门禁通过后)**:进入下一批次或输出完成报告前跑 `llman-sdd review`:退出码零 → 继续;非零 = CRITICAL → STOP 修复后重跑;不得 带 CRITICAL 进入下一批次或输出完成报告。
107
107
 
108
108
  ### 6) 完成报告
109
- 所有 task 完成 + 全部门禁通过后输出结构化报告(见 Output Contract),然后建议 `llman-sdd-verify`。
109
+ 所有 task 完成 + 全部门禁通过后输出结构化报告(见 Output Contract),然后宜跑 `llman-sdd-verify`。
110
110
 
111
111
  {{ unit("skills/cli-footer") }}
112
112
 
@@ -7,15 +7,15 @@ metadata:
7
7
 
8
8
  # LLMAN SDD Architecture Review
9
9
 
10
- 扫描代码库的架构摩擦,找出**可以加深的模块**——把薄模块(接口≈实现)改造成厚模块(小接口后藏大量行为)。目标是可测性与 AI 可导航性。辅助工具,不属于主 pipeline,任意阶段可用,常在 explore 阶段触发。
10
+ 扫描代码库的架构摩擦,找出**可以加深的模块**——把薄模块(接口≈实现)改造成厚模块(小接口后藏数百行行为)。目标是可测性与 AI 可导航性。辅助工具,不属于主 pipeline,任意阶段可用,常在 explore 阶段触发。
11
11
 
12
12
  ## 设计词汇
13
13
 
14
- 描述模块形状的词;MUST NOT 替换为「component」「service」「API」「boundary」(含义更宽、不够精确):
14
+ 描述模块形状的词;不得 替换为“component”“service”“API”“boundary”(含义更宽、不够精确):
15
15
 
16
16
  - **Module(模块)** — 有接口和实现的东西(函数/类/包/跨层切片都算)。
17
17
  - **Interface(接口)** — 调用者正确使用所须知道的一切:类型签名 + 不变量、顺序约束、错误模式、性能特征。
18
- - **Depth(厚度)** — 接口背后的行为量。**厚** = 小接口后藏大量行为;**薄** = 接口几乎和实现一样复杂(调用者要懂的 ≈ 写代码要写的)。本 skill 把薄的变厚。
18
+ - **Depth(厚度)** — 接口背后的行为量。**厚** = 小接口后藏数百行行为;**薄** = 接口几乎和实现一样复杂(调用者要懂的 ≈ 写代码要写的)。本 skill 把薄的变厚。
19
19
  - **Seam(接缝)** — 不改调用处就能换实现的位置(接口栖身处)。llman 里接缝 = `*.feature` GWT 步骤驱动的公共边界。
20
20
  - **Leverage(杠杆)** — 调用者从厚度获得的好处:学一点接口就能驱动很多行为。
21
21
  - **Locality(局部性)** — 维护者从厚度获得的好处:变更/bug/知识/验证集中一处,改一次到处生效。
@@ -25,7 +25,7 @@ metadata:
25
25
  ### 1. 探索(先定范围,YAGNI)
26
26
  - 用户指定方向(模块/子系统/痛点)则直接采信,跳过推断。
27
27
  - 否则回看 `git log --oneline` 找热点(反复出现的文件/区域)。
28
- - 优先读 `<capability>.feature`(唯一事实来源)与 `design.md`(已有 ADR);MUST NOT 另建 `CONTEXT.md`。
28
+ - 优先读 `<capability>.feature`(唯一事实来源)与 `design.md`(已有 ADR);不得 另建 `CONTEXT.md`。
29
29
  - 用 Agent 工具(subagent_type=Explore)走查代码库,记录摩擦点:
30
30
  - 理解一个概念是否要在多个小模块间跳来跳去?
31
31
  - 哪里模块**薄**(接口≈实现复杂度,调用者没省事)?
@@ -40,18 +40,18 @@ metadata:
40
40
  - **Benefits** — 局部性与杠杆的改善,测试如何变好。
41
41
  - **Recommendation strength** — `Strong` / `Worth exploring` / `Speculative`。
42
42
 
43
- **删除验证**:对疑似薄的模块想象删除它——复杂度直接消失(只是透传,没价值)还是在 N 个调用点重新冒出来(其实在扛事)?「重新冒出来」才是值得保留/加厚的信号。
43
+ **删除验证**:对疑似薄的模块想象删除它——复杂度直接消失(只是透传,没价值)还是在 N 个调用点重新冒出来(其实在扛事)?“重新冒出来”才是值得保留/加厚的信号。
44
44
 
45
- **ADR 冲突**:候选与既有 `design.md` 决策矛盾时,仅在摩擦真实到值得重开才浮现,并在候选中标注(「与 design.md 的 X 决策冲突——但因…值得重开」)。
45
+ **ADR 冲突**:候选与既有 `design.md` 决策矛盾时,仅在摩擦真实到值得重开才浮现,并在候选中标注(“与 design.md 的 X 决策冲突——但因…值得重开”)。
46
46
 
47
47
  ### 3. 逐问深挖(用户选定候选后)
48
- 运行 `llman-sdd-explore` 的**逐问深挖分支**(触发词「深挖」)走清决策——约束、依赖、加深后的模块形状、接缝后放什么、哪些测试存活。
48
+ 运行 `llman-sdd-explore` 的**逐问深挖分支**(触发词“深挖”)走清决策——约束、依赖、加深后的模块形状、接缝后放什么、哪些测试存活。
49
49
 
50
- - 加深后用到了 `.feature` 里没有的概念?→ 仅在 change 已绑定分支且当前在绑定分支上时更新 `.feature`;否则 STOP,先走 `llman-sdd-propose` / `change start`,**禁止**在默认分支改 specs。
51
- - 用户以关键理由拒绝候选?→ 仅当「难逆转 + 无上下文会困惑 + 真实权衡」皆满足时,建议记入 `design.md`。
50
+ - 加深后用到了 `.feature` 里没有的概念?→ 仅在 change 已绑定分支且当前在绑定分支上时更新 `.feature`;否则 STOP,先走 `llman-sdd-propose` / `change start`,**不得**在默认分支改 specs。
51
+ - 用户以关键理由拒绝候选?→ 仅当“难逆转 + 无上下文会困惑 + 真实权衡”皆满足时宜记入 `design.md`。
52
52
 
53
53
  ## 输出
54
- 候选清单(文本;可选 HTML 报告写 OS temp dir 不落 repo)+ 用户选定后的逐问深挖决策记录(回写 proposal;合约变更须在绑定分支落地后才回写 `.feature`)。
54
+ 候选清单(文本;可选 HTML 报告写 OS temp dir 不落 repo)+ 用户选定后的逐问深挖决策记录(回写 proposal;合约变更须在绑定分支提交后才回写 `.feature`)。
55
55
 
56
56
  {{ unit("skills/cli-footer") }}
57
57
 
@@ -7,7 +7,7 @@ metadata:
7
7
 
8
8
  # LLMAN SDD 归档
9
9
 
10
- 归档已完成的变更。前置:verify 全绿,且 change 已绑定分支、specs 已落地(或 `needs_specs_change: false`)。`change finalize` **自动合并**到基准分支(目标:`--into` > 绑定 `base_branch` > 默认分支;目标即绑定分支时跳过合并就地收口,输出含 in-place close-out 提示;方式:`--method` > 配置 `sdd.merge_method`,默认 squash——feature diff + 改名收敛为目标分支单个 commit)、**改名** change 文档到 `changes/archive/`、**自动提交** `archive(sdd): <change-id>`(`--no-commit` 跳过)。`git push` / PR 仅可选。
10
+ 归档已完成的变更。前置:verify 全绿,且 change 已绑定分支、specs 已提交(或 `needs_specs_change: false`)。`change finalize` **自动合并**到基准分支(目标:`--into` > 绑定 `base_branch` > 默认分支;目标即绑定分支时跳过合并就地收口,输出含 in-place close-out 提示;方式:`--method` > 配置 `sdd.merge_method`,默认 squash——feature diff + 改名收敛为目标分支单个 commit)、**改名** change 文档到 `changes/archive/`、**自动提交** `archive(sdd): <change-id>`(`--no-commit` 跳过)。`git push` / PR 仅可选。
11
11
 
12
12
  ## Pipeline 位置
13
13
 
@@ -24,8 +24,8 @@ flowchart LR
24
24
 
25
25
  - **必须先 verify 全绿**;**须已绑定分支**(`change start` / `attach`),无绑定 STOP。
26
26
  - 每个 change 归档前必须通过 `llman-sdd validate <id> --strict`。
27
- - **不要问「要不要继续」**:批量归档一路执行到底,除非遇到无法自动解决的错误。
28
- - **收尾不默认导向 PR/push**:CLI 本地合并(默认 squash)+ 一次性收口提交。push / PR 仅在用户或项目明确要求远程审查时做——**Agent MUST NOT** 默认 push 或建 PR。
27
+ - 不得问“要不得继续”**:批量归档一路执行到底,除非遇到无法自动解决的错误。
28
+ - **收尾不默认导向 PR/push**:CLI 本地合并(默认 squash)+ 一次性收口提交。push / PR 仅在用户或项目明确要求远程审查时做——**Agent 不得** 默认 push 或建 PR。
29
29
 
30
30
  ## 步骤
31
31
 
@@ -33,11 +33,11 @@ flowchart LR
33
33
  - `git status --porcelain`:确认工作区改动属于已完成的 change;有未预期改动先处理(stash 或报告)。
34
34
 
35
35
  ### 1) 确认目标
36
- - 确定 ID(单个或批量,来自用户输入或 `llman-sdd list --json`),始终说明「归档 IDs:<id1>, <id2>, ...」,并确认每个 change 都已 verify 全绿。
36
+ - 确定 ID(单个或批量,来自用户输入或 `llman-sdd list --json`),始终说明“归档 IDs:<id1>, <id2>, ...”,并确认每个 change 都已 verify 全绿。
37
37
 
38
38
  ### 2) 逐个归档
39
- - **人审关卡(每个 id 归档前,含批量)**:跑 `llman-sdd review`(无旗标;`--capability` 只接受 spec id)。退出码零 → 继续;非零 = CRITICAL → STOP 修复后重跑;MUST NOT 带 CRITICAL 归档。
40
- - 先校验:`llman-sdd validate <id> --strict`;失败 → STOP 报告,禁止跳过强行归档。
39
+ - **人审关卡(每个 id 归档前,含批量)**:跑 `llman-sdd review`(无旗标;`--capability` 只接受 spec id)。退出码零 → 继续;非零 = CRITICAL → STOP 修复后重跑;不得 带 CRITICAL 归档。
40
+ - 先校验:`llman-sdd validate <id> --strict`;失败 → STOP 报告,不得跳过强行归档。
41
41
  - 可选预览:`llman-sdd change archive <id> --dry-run`。
42
42
  - 执行:`llman-sdd change archive <id>`;**任一失败立即停止**,报告剩余 ID。
43
43
  - **分支收尾**:
@@ -58,7 +58,7 @@ flowchart LR
58
58
  ### 4) Commit 引导
59
59
  - finalize 已自动提交;`--no-commit` 时手动:`git add -A && git commit -m "archive(sdd): <id1>, <id2>"`。
60
60
  - 可选:合并后 `git branch -D <feature>`。push / PR 仅在明确要求时做。
61
- - **破坏性合约变更**(移除/重命名 frontmatter 字段、命令、tag 或 stage 值域)MUST 提供 `migrations/v<from>-v<to>/` 升级路径(README + 一次性脚本随仓库发布)——收口前确认存在。
61
+ - **破坏性合约变更**(移除/重命名 frontmatter 字段、命令、tag 或 stage 值域)必须 提供 `migrations/v<from>-v<to>/` 升级路径(README + 一次性脚本随仓库发布)——收口前确认存在。
62
62
  - **archived `depends_on`**:archive 把 change 目录改名为 `archive/YYYY-MM-DD-<id>`;validate 把指向 archived/frozen id 的 `depends_on` 识别为 INFO(非 ERROR),**无需**手动更新其它 change 的 frontmatter。
63
63
 
64
64
  {{ unit("workflow/archive-freeze-guidance") }}
@@ -10,7 +10,7 @@ metadata:
10
10
  继续已有 change,创建下一个缺失工件。
11
11
 
12
12
  ## 步骤
13
- 1. 确定 change id:用户给了就用;否则跑 `llman-sdd list --json` 让用户选。始终说明「使用变更:<id>」。
13
+ 1. 确定 change id:用户给了就用;否则跑 `llman-sdd list --json` 让用户选。始终说明“使用变更:<id>”。
14
14
  2. 读 `llmanspec/changes/<id>/`。
15
15
  > 阶段判定:用 `llman-sdd show <id> --output json --type change` 的 `stage` / `readyToImplement`;完整判定表见 llman-sdd-apply。
16
16
  3. 按顺序确定下一个缺失工件:
@@ -18,11 +18,11 @@ metadata:
18
18
  2) `design.md`(仅有设计权衡时)
19
19
  3) `tasks.md`
20
20
  4) `llman-sdd change start <id>`(分支已存在用 `change attach <id>`)——绑定分支
21
- 5) 在**绑定分支**编辑 `llmanspec/specs/<capability>.feature`(扁平,或目录主文件)并 commit——落地 specs(无合约变更设 `needs_specs_change: false`)
21
+ 5) 在**绑定分支**编辑 `llmanspec/specs/<capability>.feature`(扁平,或目录主文件)并 commit——提交 specs(无合约变更设 `needs_specs_change: false`)
22
22
  4. 只创建**一个**缺失工件(或一次绑定分支上的 spec 编辑)。
23
- - 不写应用代码;**不要**建 `changes/<id>/specs/`;**不要**在 start/attach 前改 `llmanspec/specs/**`。
24
- 5. 工件已齐全时,按 `llman-sdd show <id> --output json` 建议下一步:
25
- - specs-landed 门未过 → 先落地 specs(或 `needs_specs_change: false`);**不要**建议 apply
23
+ - 不得写应用代码;不得**建 `changes/<id>/specs/`;不得**在 start/attach 前改 `llmanspec/specs/**`。
24
+ 5. 工件已齐全时,按 `llman-sdd show <id> --output json` 宜接的下一步:
25
+ - specs-landed 门未过 → 先提交 specs(或 `needs_specs_change: false`);不得提示可进 apply
26
26
  - specs-landed 门已绿(即使实施中期 `readyToImplement=false`、tasks 未完)→ `llman-sdd-apply`
27
27
  - verify 之后 → `llman-sdd-archive`
28
28
  - 校验:`llman-sdd validate <id> --strict`;审查:`llman-sdd change diff <id>`(只读)