@llman-sdd/core 0.7.4 → 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.
- package/package.json +1 -1
- package/src/archive/freeze.ts +6 -2
- package/src/archive/frozenCard.ts +11 -9
- package/src/change/frontmatter.ts +12 -0
- package/src/change/lifecycle.ts +3 -1
- package/src/context/retrieve.ts +1 -1
- package/src/index.ts +1 -0
- package/src/report/graph/deps.ts +12 -1
- package/src/validation/changeCheck.ts +12 -0
- package/templates/en/skills/llman-sdd-apply.md +1 -1
- package/templates/en/skills/llman-sdd-draft.md +2 -2
- package/templates/en/skills/llman-sdd-propose.md +3 -3
- package/templates/en/skills/llman-sdd-quick.md +2 -2
- package/templates/en/skills/llman-sdd-research.md +1 -1
- package/templates/en/units/skills/validation-hints.md +1 -1
- package/templates/en/units/workflow/archive-freeze-guidance.md +2 -2
- package/templates/zh-Hans/skills/llman-sdd-apply.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-draft.md +2 -2
- package/templates/zh-Hans/skills/llman-sdd-propose.md +3 -3
- package/templates/zh-Hans/skills/llman-sdd-quick.md +2 -2
- package/templates/zh-Hans/skills/llman-sdd-research.md +1 -1
- package/templates/zh-Hans/units/skills/validation-hints.md +1 -1
- package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +2 -2
package/package.json
CHANGED
package/src/archive/freeze.ts
CHANGED
|
@@ -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(
|
|
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
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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
|
|
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 [
|
|
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.
|
package/src/change/lifecycle.ts
CHANGED
|
@@ -59,7 +59,9 @@ export function newChange(
|
|
|
59
59
|
`change proposal already exists: ./${path} (pass --force to overwrite)`,
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
|
|
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
|
|
package/src/context/retrieve.ts
CHANGED
|
@@ -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
|
|
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
package/src/report/graph/deps.ts
CHANGED
|
@@ -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
|
|
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
|
|
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.); `
|
|
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
|
|
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.); `
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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` (
|
|
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.
|
|
@@ -26,7 +26,7 @@ flowchart LR
|
|
|
26
26
|
|
|
27
27
|
## 硬约束
|
|
28
28
|
|
|
29
|
-
- **唯一事实来源驱动**:`proposal.md` / `design.md` / `tasks.md` 与分支上的 `llmanspec/specs/**`;specs
|
|
29
|
+
- **唯一事实来源驱动**:`proposal.md` / `design.md` / `tasks.md` 与分支上的 `llmanspec/specs/**`;specs 的行为合约条款逐条落实。
|
|
30
30
|
- **范围锁定**:只做当前 change 范围,不得顺手修无关问题;改动保持最小。
|
|
31
31
|
- **不得猜测**:需求不明或 specs 与现实矛盾 → STOP 报告,不自行假定。
|
|
32
32
|
- **不留旧兼容层**:change 要求改行为就全量升级到新写法,除非 tasks/proposal 明确要兼容。
|
|
@@ -26,8 +26,8 @@ flowchart LR
|
|
|
26
26
|
- **不得 询问 change id**:由 `change new --from` 从描述推导并告知用户。
|
|
27
27
|
- **不得 创建 tasks/design/specs/attach**:只建 `proposal.md` 草案;完整规划归 `llman-sdd-propose`。
|
|
28
28
|
- **不得 判断变更规模**:那是 propose 的职责。用户想开始实现 → 宜转 `llman-sdd-propose`。
|
|
29
|
-
-
|
|
30
|
-
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`
|
|
29
|
+
- **适用边界**:描述明显涉及行为合约(需求语义)变更或多文件改动时,宜转 `llman-sdd-propose`——但仍先建草案以免想法丢失。
|
|
30
|
+
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段(不得 `## Status` 段);H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
31
31
|
|
|
32
32
|
## 步骤
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "llman-sdd-propose"
|
|
3
|
-
description: "
|
|
3
|
+
description: "为行为合约(需求语义)变更创建提案(proposal/tasks → 绑定分支 → 提交 specs)。小改动走 quick,记想法走 draft。"
|
|
4
4
|
metadata:
|
|
5
5
|
version: "{{ llman_version }}"
|
|
6
6
|
---
|
|
@@ -36,7 +36,7 @@ flowchart LR
|
|
|
36
36
|
{% else %}
|
|
37
37
|
- **change 已存在**:STOP。specs-landed 门已绿 → 宜接 `llman-sdd-apply`;否则补规划文档 / 绑定分支 / 提交 specs(编辑 `llmanspec/changes/<id>/`,或配置 `extra_skills: [llman-sdd-continue]`)。
|
|
38
38
|
{% endif %}
|
|
39
|
-
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`
|
|
39
|
+
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段;H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
40
40
|
|
|
41
41
|
## 快速记录分流
|
|
42
42
|
|
|
@@ -51,7 +51,7 @@ flowchart LR
|
|
|
51
51
|
|
|
52
52
|
### 1) 判断变更规模
|
|
53
53
|
1. 分类:
|
|
54
|
-
-
|
|
54
|
+
- **行为合约变更**(改需求语义、改外部行为)→ 完整 SDD
|
|
55
55
|
- **实现层变更**(重构、typo、性能)→ `llman-sdd-quick`
|
|
56
56
|
- **元规范变更**(SDD 模板/流程)→ 完整 SDD
|
|
57
57
|
- 不确定选完整 SDD(保守)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "llman-sdd-quick"
|
|
3
|
-
description: "
|
|
3
|
+
description: "快速路径:不改行为合约的小改动(重构/错字/性能)。要改行为合约(需求语义)就停,转 propose。"
|
|
4
4
|
metadata:
|
|
5
5
|
version: "{{ llman_version }}"
|
|
6
6
|
---
|
|
@@ -22,7 +22,7 @@ flowchart LR
|
|
|
22
22
|
> 📍 快速路径:直接改代码 commit。发现要改合约 → STOP,转 `llman-sdd-propose`。
|
|
23
23
|
|
|
24
24
|
## 使用条件(全部满足)
|
|
25
|
-
- 不改变任何 spec
|
|
25
|
+
- 不改变任何 spec 中需求语义定义的外部可观测行为
|
|
26
26
|
- 不跨 capability;不涉及迁移/兼容性;不是 SDD 元规范变更
|
|
27
27
|
|
|
28
28
|
## 步骤
|
|
@@ -14,7 +14,7 @@ metadata:
|
|
|
14
14
|
1. 针对**一手资料**调研——官方文档、源码、spec、第一方 API,而非二手转述;每个论断追溯到拥有它的源头。
|
|
15
15
|
2. 发现写入单个 Markdown 文件,每条论断标注来源。
|
|
16
16
|
3. 存放(仓库另有约定时优先):**默认** `llmanspec/changes/<current-change>/research/<topic>.md`(change 文档,**不是** specs)。仅当主题跨多个 change、归档后仍常引用时才写 `docs/research/`;**不得**把单 change 选型/易腐深挖塞进 `docs/research/`。
|
|
17
|
-
4. **不得**本 skill 直接编辑 `llmanspec/specs
|
|
17
|
+
4. **不得**本 skill 直接编辑 `llmanspec/specs/**`。调研表明行为合约(需求语义)必须改 → 宜转 `llman-sdd-propose`(绑定分支 → 提交 specs)。
|
|
18
18
|
|
|
19
19
|
## 步骤
|
|
20
20
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
2)原生分层格式(`rule must carry an @req:<req_id> tag on the rule header`):
|
|
12
12
|
- 规范样式只有一种:`@req:<id>` 挂在 `规则:` 块头标签,块内嵌套 `场景:`(假如/当/那么)是可执行示例——默认首选。
|
|
13
|
-
- 仅当需求无法程序化表达或暂不转写时才保留无嵌套场景的 `规则:`(裸规则)
|
|
13
|
+
- 仅当需求无法程序化表达或暂不转写时才保留无嵌套场景的 `规则:`(裸规则):描述自由文本,不强制情态词;validate 以聚合计数提示,review `pending` 信号计量,specs-compact 负责压降。
|
|
14
14
|
- 历史标签 `@executable`/`@rule`/`@human`/`@manual` 不再使用、解析惰性;旧文件报结构问题时运行 `llman-sdd spec migrate-native` 迁移。
|
|
15
15
|
- 不在任何 `规则:` 内的顶层 `场景:` 是功能级示例:无规则句柄、不告警、不参与规则统计(Gherkin 原生语义)。
|
|
16
16
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## Archive 冷备引导
|
|
2
|
-
- archive 目录过大时用冷备维护(冻结 = 正文入 7z 冷备 + 以 `<YYYY-MM-DD>-<id>.yaml`
|
|
2
|
+
- archive 目录过大时用冷备维护(冻结 = 正文入 7z 冷备 + 以 `<YYYY-MM-DD>-<id>.yaml` 平铺索引卡替代目录,卡为单文档纯 YAML、仅含 title 与 depends_on):
|
|
3
3
|
- 预览冻结候选:`llman-sdd archive freeze --dry-run`
|
|
4
4
|
- 冻结旧归档:`llman-sdd archive freeze --before <YYYY-MM-DD> --keep-recent <N>`
|
|
5
5
|
- 列出已冻结条目:`llman-sdd archive freeze --list`
|
|
6
6
|
- 需要恢复时:`llman-sdd archive thaw --change <YYYY-MM-DD-id>`(正文解回目录并移除平铺卡)
|
|
7
7
|
- freeze/thaw 仅用于日期归档目录(`YYYY-MM-DD-*`);宜保留最近 2 个目录不冻结。
|
|
8
|
-
- 平铺索引卡常驻磁盘:title
|
|
8
|
+
- 平铺索引卡常驻磁盘:title(frontmatter `title` 非空时优先,否则取 proposal H1)与 depends_on(graph 依赖边种子)可 grep、可追溯;
|
|
9
9
|
id 与日期由文件名隐含——冻结 change 的用途与依赖关系无需解冻即可查阅,正文在 7z 冷备按需取用。
|
|
10
10
|
- 在非主检出(不持有默认分支的 worktree)运行时打印警告(仅提示、不阻断)——有意为之才在该处继续。
|