@llman-sdd/core 0.7.1 → 0.7.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/package.json +1 -1
- package/src/change/lifecycle.ts +74 -40
- package/src/context/sddState.ts +61 -0
- package/src/git/spawnGit.ts +43 -2
- package/src/index.ts +12 -0
- package/src/init/init.ts +5 -0
- package/src/review/review.ts +1 -0
- package/src/spec/ir.ts +6 -0
- package/src/spec/parser.ts +13 -4
- package/src/templates/skills.ts +2 -0
- package/src/validation/staleness.ts +45 -1
- package/templates/en/skills/llman-sdd-apply.md +4 -0
- package/templates/en/skills/llman-sdd-archive.md +1 -1
- package/templates/en/skills/llman-sdd-propose.md +1 -1
- package/templates/en/skills/llman-sdd-verify.md +4 -0
- package/templates/en/units/skills/git-native-flow-brief.md +1 -1
- package/templates/en/units/skills/git-native-flow.md +3 -3
- package/templates/en/units/skills/review-stamp.md +3 -0
- package/templates/en/units/skills/version-drift.md +3 -0
- package/templates/zh-Hans/skills/llman-sdd-apply.md +4 -0
- package/templates/zh-Hans/skills/llman-sdd-archive.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-propose.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-verify.md +4 -0
- package/templates/zh-Hans/units/skills/git-native-flow-brief.md +1 -1
- package/templates/zh-Hans/units/skills/git-native-flow.md +3 -3
- package/templates/zh-Hans/units/skills/review-stamp.md +3 -0
- package/templates/zh-Hans/units/skills/version-drift.md +3 -0
package/package.json
CHANGED
package/src/change/lifecycle.ts
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
defaultBranch,
|
|
6
6
|
dirtyCount,
|
|
7
7
|
isCleanTree,
|
|
8
|
+
localBranchExists,
|
|
8
9
|
mergeBase,
|
|
10
|
+
probeForkSource,
|
|
9
11
|
revParseHead,
|
|
10
12
|
worktreeList,
|
|
11
13
|
type GitLike,
|
|
@@ -64,11 +66,42 @@ export function newChange(
|
|
|
64
66
|
export interface StartResult {
|
|
65
67
|
branch: string;
|
|
66
68
|
baseBranch: string;
|
|
69
|
+
/** Where the recorded base_branch came from (r95 deviation warning input). */
|
|
70
|
+
baseSource: 'flag' | 'worktree' | 'default';
|
|
67
71
|
baseSha: string;
|
|
68
72
|
/** Absolute worktree path when started with --worktree (r68); undefined on the classic path. */
|
|
69
73
|
worktreePath?: string;
|
|
70
74
|
}
|
|
71
75
|
|
|
76
|
+
/** r95: where attach's recorded base_branch came from. */
|
|
77
|
+
export type AttachBaseSource = 'flag' | 'config' | 'upstream' | 'default';
|
|
78
|
+
|
|
79
|
+
export interface AttachResult {
|
|
80
|
+
branch: string;
|
|
81
|
+
baseBranch: string;
|
|
82
|
+
baseSource: AttachBaseSource;
|
|
83
|
+
baseSha: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** r95: shared --base gate — local branches only (finalize cannot switch to a
|
|
87
|
+
* remote-tracking ref; recording one is an end-to-end dead end). */
|
|
88
|
+
function assertLocalBase(
|
|
89
|
+
git: GitLike,
|
|
90
|
+
base: string,
|
|
91
|
+
forbidden: string,
|
|
92
|
+
kind: 'new' | 'bound',
|
|
93
|
+
): void {
|
|
94
|
+
if (!localBranchExists(git, base)) {
|
|
95
|
+
throw new LifecycleError(
|
|
96
|
+
`base branch \`${base}\` does not exist as a local branch; --base must name a local branch ` +
|
|
97
|
+
'(remote-tracking refs are rejected — use the local branch name)',
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
if (base === forbidden) {
|
|
101
|
+
throw new LifecycleError(`--base must differ from the ${kind} branch \`${forbidden}\``);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
72
105
|
/**
|
|
73
106
|
* r68 worktree path (design D2): `<root>/<repo-basename>-<name>` where root is
|
|
74
107
|
* `sdd.worktree_root` (absolute, or repo-root-relative; default = the repo
|
|
@@ -147,29 +180,23 @@ export function startChange(
|
|
|
147
180
|
const branch = `${branchPrefix}${id}`;
|
|
148
181
|
|
|
149
182
|
if (opts.base !== undefined) {
|
|
150
|
-
|
|
151
|
-
git.runOpt(['show-ref', '--verify', '--quiet', `refs/heads/${opts.base}`]) === null &&
|
|
152
|
-
git.runOpt(['show-ref', '--verify', '--quiet', `refs/remotes/${opts.base}`]) === null
|
|
153
|
-
) {
|
|
154
|
-
throw new LifecycleError(
|
|
155
|
-
`base branch \`${opts.base}\` does not exist; --base records the fork source branch for merge-target resolution`,
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
if (opts.base === branch) {
|
|
159
|
-
throw new LifecycleError(`--base must differ from the new branch \`${branch}\``);
|
|
160
|
-
}
|
|
183
|
+
assertLocalBase(git, opts.base, branch, 'new');
|
|
161
184
|
}
|
|
162
185
|
|
|
163
186
|
// r68 fork-source resolution: --base explicit > current branch (worktree
|
|
164
187
|
// mode records the actual source, which may be a non-default branch) >
|
|
165
188
|
// default branch. The classic path keeps the r14 default-branch gate.
|
|
166
189
|
let baseBranch: string;
|
|
190
|
+
let baseSource: StartResult['baseSource'];
|
|
167
191
|
if (opts.base !== undefined) {
|
|
168
192
|
baseBranch = opts.base;
|
|
193
|
+
baseSource = 'flag';
|
|
169
194
|
} else if (opts.worktree) {
|
|
170
195
|
baseBranch = here;
|
|
196
|
+
baseSource = 'worktree';
|
|
171
197
|
} else {
|
|
172
198
|
baseBranch = defaultBranch(git);
|
|
199
|
+
baseSource = 'default';
|
|
173
200
|
if (here !== baseBranch) {
|
|
174
201
|
throw new LifecycleError(
|
|
175
202
|
`already on non-default branch \`${here}\`; use \`change attach\` to bind it, or switch to the default branch before \`change start\``,
|
|
@@ -201,13 +228,13 @@ export function startChange(
|
|
|
201
228
|
}
|
|
202
229
|
const baseSha = mergeBase(gitAt(git, worktreePath), 'HEAD', baseBranch);
|
|
203
230
|
wtIo.writeText(path, writeBinding(wtIo.readText(path), { branch, baseBranch, baseSha }));
|
|
204
|
-
return { branch, baseBranch, baseSha, worktreePath };
|
|
231
|
+
return { branch, baseBranch, baseSource, baseSha, worktreePath };
|
|
205
232
|
}
|
|
206
233
|
git.run(['switch', '-c', branch]);
|
|
207
234
|
const baseSha =
|
|
208
235
|
currentBranch(git) !== null ? mergeBase(git, 'HEAD', baseBranch) : revParseHead(git);
|
|
209
236
|
io.writeText(path, writeBinding(io.readText(path), { branch, baseBranch, baseSha }));
|
|
210
|
-
return { branch, baseBranch, baseSha };
|
|
237
|
+
return { branch, baseBranch, baseSource, baseSha };
|
|
211
238
|
}
|
|
212
239
|
|
|
213
240
|
/** `change attach`: bind the current branch — same branch gate family as start (r31). */
|
|
@@ -216,7 +243,7 @@ export function attachChange(
|
|
|
216
243
|
io: FsIo,
|
|
217
244
|
id: string,
|
|
218
245
|
opts: { force?: boolean; base?: string } = {},
|
|
219
|
-
):
|
|
246
|
+
): AttachResult {
|
|
220
247
|
const path = proposalPath(id);
|
|
221
248
|
if (!io.exists(path)) throw new LifecycleError(`proposal not found: ${path}`);
|
|
222
249
|
const existing = readBinding(io.readText(path));
|
|
@@ -225,35 +252,31 @@ export function attachChange(
|
|
|
225
252
|
`change \`${id}\` already attached to branch \`${existing.branch}\` (base ${existing.baseSha}); pass --force to rebind`,
|
|
226
253
|
);
|
|
227
254
|
}
|
|
228
|
-
const configuredBase = opts.base ?? defaultBranch(git);
|
|
229
255
|
const branch = currentBranch(git);
|
|
230
256
|
if (branch === null || branch === '') {
|
|
231
257
|
throw new LifecycleError(detachedHead('change attach'));
|
|
232
258
|
}
|
|
233
259
|
if (opts.base !== undefined) {
|
|
234
|
-
|
|
235
|
-
git.runOpt(['show-ref', '--verify', '--quiet', `refs/heads/${opts.base}`]) === null &&
|
|
236
|
-
git.runOpt(['show-ref', '--verify', '--quiet', `refs/remotes/${opts.base}`]) === null
|
|
237
|
-
) {
|
|
238
|
-
throw new LifecycleError(
|
|
239
|
-
`base branch \`${opts.base}\` does not exist; --base records the fork source branch for merge-target resolution`,
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
if (opts.base === branch) {
|
|
243
|
-
throw new LifecycleError(`--base must differ from the bound branch \`${branch}\``);
|
|
244
|
-
}
|
|
260
|
+
assertLocalBase(git, opts.base, branch, 'bound');
|
|
245
261
|
}
|
|
246
|
-
|
|
262
|
+
// r95 fork-source resolution: --base explicit > probeForkSource
|
|
263
|
+
// (branch.<name>.base > local upstream) > default branch. No signal means
|
|
264
|
+
// status quo (issue #7 compatibility: "无法推导维持现状").
|
|
265
|
+
const fork =
|
|
266
|
+
opts.base !== undefined
|
|
267
|
+
? { branch: opts.base, source: 'flag' as const }
|
|
268
|
+
: (probeForkSource(git, branch) ?? {
|
|
269
|
+
branch: defaultBranch(git),
|
|
270
|
+
source: 'default' as const,
|
|
271
|
+
});
|
|
272
|
+
if (branch === fork.branch) {
|
|
247
273
|
throw new LifecycleError(
|
|
248
274
|
`${onDefaultBranch('change attach', branch)}; create or switch to a feature branch, or use \`change start\``,
|
|
249
275
|
);
|
|
250
276
|
}
|
|
251
|
-
const baseSha = mergeBase(git, branch,
|
|
252
|
-
io.writeText(
|
|
253
|
-
|
|
254
|
-
writeBinding(io.readText(path), { branch, baseBranch: configuredBase, baseSha }),
|
|
255
|
-
);
|
|
256
|
-
return { branch, baseBranch: configuredBase, baseSha };
|
|
277
|
+
const baseSha = mergeBase(git, branch, fork.branch);
|
|
278
|
+
io.writeText(path, writeBinding(io.readText(path), { branch, baseBranch: fork.branch, baseSha }));
|
|
279
|
+
return { branch, baseBranch: fork.branch, baseSource: fork.source, baseSha };
|
|
257
280
|
}
|
|
258
281
|
|
|
259
282
|
export interface FinalizeResult {
|
|
@@ -389,14 +412,25 @@ function mergeRenameCommit(
|
|
|
389
412
|
execIo = ioAt(io, holder);
|
|
390
413
|
executedIn = holder;
|
|
391
414
|
}
|
|
415
|
+
// r96: in-place close-out — merging a branch into itself is always a no-op
|
|
416
|
+
// ("Already up to date."), so skip the merge and say so instead of running a
|
|
417
|
+
// silent self-merge. The switch still runs (a no-op when already there) so
|
|
418
|
+
// escape hatches like `archive --force` from a foreign branch land the
|
|
419
|
+
// rename and close-out commit on the bound branch, not the current one.
|
|
392
420
|
execGit.run(['switch', target]);
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
421
|
+
if (target === featureBranch) {
|
|
422
|
+
warnings.push('in-place close-out: merge target is the bound branch itself; merge skipped');
|
|
423
|
+
} else {
|
|
424
|
+
const mergeArgs =
|
|
425
|
+
method === 'ff'
|
|
426
|
+
? ['merge', '--ff-only', featureBranch]
|
|
427
|
+
: ['merge', '--squash', featureBranch];
|
|
428
|
+
if (execGit.runOpt(mergeArgs) === null) {
|
|
429
|
+
execGit.runOpt(['merge', '--abort']);
|
|
430
|
+
warnings.push(
|
|
431
|
+
`merge ${method} failed — resolve manually, e.g. \`git merge ${method === 'ff' ? '--ff-only' : '--squash'} ${featureBranch}\``,
|
|
432
|
+
);
|
|
433
|
+
}
|
|
400
434
|
}
|
|
401
435
|
|
|
402
436
|
const date = today;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scaffold-state record (version-awareness capability): init stamps the CLI
|
|
3
|
+
* version that rendered the project so later runs can detect drift. All paths
|
|
4
|
+
* ROOT-RELATIVE through the injected IO; corrupt/missing state is silent-OK
|
|
5
|
+
* (the notice is best-effort, never load-bearing).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { CONTEXT_DIR_REL } from './indexStore.ts';
|
|
9
|
+
|
|
10
|
+
export const SDD_STATE_REL = `${CONTEXT_DIR_REL}/sdd-state.json`;
|
|
11
|
+
|
|
12
|
+
export interface SddState {
|
|
13
|
+
/** llman-sdd version that last rendered this project (init / --update). */
|
|
14
|
+
cli_version: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type StateIo = {
|
|
18
|
+
exists(path: string): boolean;
|
|
19
|
+
readText(path: string): string;
|
|
20
|
+
writeText(path: string, content: string): void;
|
|
21
|
+
mkdirp(path: string): void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Persist the scaffold version (called from runInit after config resolution). */
|
|
25
|
+
export function writeSddState(io: StateIo, version: string): void {
|
|
26
|
+
io.mkdirp(CONTEXT_DIR_REL);
|
|
27
|
+
const state: SddState = { cli_version: version };
|
|
28
|
+
io.writeText(SDD_STATE_REL, `${JSON.stringify(state, null, 2)}\n`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Read the recorded version; null when absent/corrupt (silent-OK contract). */
|
|
32
|
+
export function readSddState(io: Pick<StateIo, 'exists' | 'readText'>): SddState | null {
|
|
33
|
+
if (!io.exists(SDD_STATE_REL)) return null;
|
|
34
|
+
try {
|
|
35
|
+
const parsed: unknown = JSON.parse(io.readText(SDD_STATE_REL));
|
|
36
|
+
if (
|
|
37
|
+
typeof parsed === 'object' &&
|
|
38
|
+
parsed !== null &&
|
|
39
|
+
typeof (parsed as SddState).cli_version === 'string'
|
|
40
|
+
) {
|
|
41
|
+
return parsed as SddState;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const dot = (v: string): number => Math.trunc(Number(v)) || 0;
|
|
50
|
+
|
|
51
|
+
/** Numeric semver-major.minor.patch compare; non-numeric segments compare 0. */
|
|
52
|
+
export function semverLt(a: string, b: string): boolean {
|
|
53
|
+
const pa = a.split('.');
|
|
54
|
+
const pb = b.split('.');
|
|
55
|
+
for (let i = 0; i < 3; i++) {
|
|
56
|
+
const ai = dot(pa[i] ?? '0');
|
|
57
|
+
const bi = dot(pb[i] ?? '0');
|
|
58
|
+
if (ai !== bi) return ai < bi;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
package/src/git/spawnGit.ts
CHANGED
|
@@ -54,12 +54,27 @@ export function isCleanTree(git: GitLike): boolean {
|
|
|
54
54
|
return git.run(['status', '--porcelain']) === '';
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/**
|
|
57
|
+
/** True when the named LOCAL branch (refs/heads/<name>) exists. */
|
|
58
|
+
export function localBranchExists(git: GitLike, name: string): boolean {
|
|
59
|
+
return git.runOpt(['show-ref', '--verify', '--quiet', `refs/heads/${name}`]) !== null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Local-first default branch resolution: init.defaultBranch (only when it
|
|
64
|
+
* names an existing local branch) → main → master → origin/HEAD → origin/*.
|
|
65
|
+
* A valid preference wins outright — including over an existing local main
|
|
66
|
+
* (r16 resolution order, not a tie-breaker) — because the user explicitly
|
|
67
|
+
* configured it; anything else falls through to the chain untouched.
|
|
68
|
+
*/
|
|
58
69
|
// Deliberately NOT shared with defaultBranchNameFn() in validation/staleness.ts
|
|
59
70
|
// (that probe is local-only with a 'main' fallback — predecessor staleness parity). Do not merge.
|
|
60
71
|
export function defaultBranch(git: GitLike): string {
|
|
72
|
+
const preferred = git.runOpt(['config', '--get', 'init.defaultBranch']);
|
|
73
|
+
if (preferred !== null && preferred !== '' && localBranchExists(git, preferred)) {
|
|
74
|
+
return preferred;
|
|
75
|
+
}
|
|
61
76
|
for (const candidate of ['main', 'master']) {
|
|
62
|
-
if (git
|
|
77
|
+
if (localBranchExists(git, candidate)) {
|
|
63
78
|
return candidate;
|
|
64
79
|
}
|
|
65
80
|
}
|
|
@@ -78,6 +93,32 @@ export function defaultBranch(git: GitLike): string {
|
|
|
78
93
|
);
|
|
79
94
|
}
|
|
80
95
|
|
|
96
|
+
export interface ForkSource {
|
|
97
|
+
branch: string;
|
|
98
|
+
source: 'config' | 'upstream';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* r95: read-only fork-source probes for attach — explicit signals only, local
|
|
103
|
+
* branches only. Order: `branch.<name>.base` (stacked-PR tool convention, the
|
|
104
|
+
* value must name an existing local branch) > local upstream
|
|
105
|
+
* (branch.<name>.remote = "." → @{upstream} resolves to refs/heads/*). A
|
|
106
|
+
* remote-tracking upstream is the branch's own push destination, not a fork
|
|
107
|
+
* source. null means "not derivable" — the caller falls back to defaultBranch.
|
|
108
|
+
*/
|
|
109
|
+
export function probeForkSource(git: GitLike, branch: string): ForkSource | null {
|
|
110
|
+
const configured = git.runOpt(['config', '--get', `branch.${branch}.base`]);
|
|
111
|
+
if (configured !== null && configured !== branch && localBranchExists(git, configured)) {
|
|
112
|
+
return { branch: configured, source: 'config' };
|
|
113
|
+
}
|
|
114
|
+
const upstream = git.runOpt(['rev-parse', '--symbolic-full-name', `${branch}@{upstream}`]);
|
|
115
|
+
if (upstream !== null && upstream.startsWith('refs/heads/')) {
|
|
116
|
+
const name = upstream.slice('refs/heads/'.length);
|
|
117
|
+
if (name !== branch) return { branch: name, source: 'upstream' };
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
|
|
81
122
|
export function revParseHead(git: GitLike): string {
|
|
82
123
|
return git.run(['rev-parse', 'HEAD']);
|
|
83
124
|
}
|
package/src/index.ts
CHANGED
|
@@ -134,14 +134,17 @@ export {
|
|
|
134
134
|
GitError,
|
|
135
135
|
defaultBranch,
|
|
136
136
|
isCleanTree,
|
|
137
|
+
localBranchExists,
|
|
137
138
|
makeSpawnGit,
|
|
138
139
|
currentBranch,
|
|
139
140
|
worktreeList,
|
|
140
141
|
probeMainCheckout,
|
|
142
|
+
probeForkSource,
|
|
141
143
|
nonMainCheckoutWarning,
|
|
142
144
|
type GitLike,
|
|
143
145
|
type WorktreeEntry,
|
|
144
146
|
type MainCheckoutProbe,
|
|
147
|
+
type ForkSource,
|
|
145
148
|
} from './git/spawnGit.ts';
|
|
146
149
|
export { DRAFT_PROPOSAL_TEMPLATE, deriveChangeId } from './change/id.ts';
|
|
147
150
|
export { parseTaskCheckboxes, type ParsedTaskCheckboxes } from './change/tasks.ts';
|
|
@@ -162,6 +165,8 @@ export {
|
|
|
162
165
|
finalizeChange,
|
|
163
166
|
newChange,
|
|
164
167
|
startChange,
|
|
168
|
+
type AttachBaseSource,
|
|
169
|
+
type AttachResult,
|
|
165
170
|
type FinalizeResult,
|
|
166
171
|
type FsIo,
|
|
167
172
|
archiveChange,
|
|
@@ -295,6 +300,13 @@ export {
|
|
|
295
300
|
type RebuildOpts,
|
|
296
301
|
type RebuildResult,
|
|
297
302
|
} from './context/indexStore.ts';
|
|
303
|
+
export {
|
|
304
|
+
SDD_STATE_REL,
|
|
305
|
+
readSddState,
|
|
306
|
+
semverLt,
|
|
307
|
+
writeSddState,
|
|
308
|
+
type SddState,
|
|
309
|
+
} from './context/sddState.ts';
|
|
298
310
|
export {
|
|
299
311
|
resolveChatConfig,
|
|
300
312
|
runContextRetrieval,
|
package/src/init/init.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
|
|
11
11
|
import { loadConfig } from '../config/load.ts';
|
|
12
|
+
import { writeSddState } from '../context/sddState.ts';
|
|
12
13
|
import { renderTemplate } from '../templates/engine.ts';
|
|
13
14
|
import { localeFallbacks } from '../templates/locale.ts';
|
|
14
15
|
import {
|
|
@@ -122,6 +123,10 @@ export function runInit(
|
|
|
122
123
|
if (!io.exists(configPath)) writeDefaultConfig(io, opts.locale ?? 'en');
|
|
123
124
|
const config = loadConfig(io.readText(configPath));
|
|
124
125
|
|
|
126
|
+
// 1b) scaffold-state stamp: record the rendering version for drift notices
|
|
127
|
+
// (version-awareness). Corrupt/missing state on later reads is silent-OK.
|
|
128
|
+
writeSddState(io, opts.version);
|
|
129
|
+
|
|
125
130
|
// 2) scaffold directories.
|
|
126
131
|
io.mkdirp('llmanspec/specs');
|
|
127
132
|
io.mkdirp('llmanspec/changes/archive');
|
package/src/review/review.ts
CHANGED
|
@@ -84,6 +84,7 @@ export function buildReview(input: ReviewInput, io: SpecIo): ReviewResult {
|
|
|
84
84
|
root: input.root,
|
|
85
85
|
specRel,
|
|
86
86
|
scope: entry.doc.header.scope?.split(',').map((x) => x.trim()) ?? [],
|
|
87
|
+
reviewedThrough: entry.doc.header.reviewedThrough,
|
|
87
88
|
baseRefEnv: input.baseRefEnv,
|
|
88
89
|
});
|
|
89
90
|
staleInfo = evalResult.info;
|
package/src/spec/ir.ts
CHANGED
|
@@ -14,6 +14,12 @@ export interface CapabilityHeader {
|
|
|
14
14
|
capability: string | null;
|
|
15
15
|
purpose: string | null;
|
|
16
16
|
scope: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* `# reviewed-through: <change-id>` — newest change through which this
|
|
19
|
+
* capability's governed behaviour was reviewed unchanged (re-review stamp
|
|
20
|
+
* governance). Consumers (staleness) compare it against branch history.
|
|
21
|
+
*/
|
|
22
|
+
reviewedThrough: string | null;
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
export type ScenarioStepKind = 'given' | 'when' | 'then';
|
package/src/spec/parser.ts
CHANGED
|
@@ -79,17 +79,26 @@ function stepKeywordToKind(keyword: string): ScenarioStepKind {
|
|
|
79
79
|
return stepKeywordToOfficialKind(keyword) ?? 'given';
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
const HEADER_RE = /^#\s*(capability|purpose|scope):\s*(.*)$/u;
|
|
82
|
+
const HEADER_RE = /^#\s*(capability|purpose|scope|reviewed-through):\s*(.*)$/u;
|
|
83
83
|
|
|
84
84
|
function extractHeader(source: string): CapabilityHeader {
|
|
85
|
-
const header: CapabilityHeader = {
|
|
85
|
+
const header: CapabilityHeader = {
|
|
86
|
+
capability: null,
|
|
87
|
+
purpose: null,
|
|
88
|
+
scope: null,
|
|
89
|
+
reviewedThrough: null,
|
|
90
|
+
};
|
|
86
91
|
for (const line of source.split('\n')) {
|
|
87
92
|
if (line.trim() === '') continue;
|
|
88
93
|
if (!line.trimStart().startsWith('#')) break;
|
|
89
94
|
const m = line.trimStart().match(HEADER_RE);
|
|
90
95
|
if (m?.[1]) {
|
|
91
|
-
const
|
|
92
|
-
|
|
96
|
+
const raw = m[1];
|
|
97
|
+
const field: 'capability' | 'purpose' | 'scope' | 'reviewedThrough' =
|
|
98
|
+
raw === 'reviewed-through'
|
|
99
|
+
? 'reviewedThrough'
|
|
100
|
+
: (raw as 'capability' | 'purpose' | 'scope');
|
|
101
|
+
header[field] = m[2]?.trim() ?? null;
|
|
93
102
|
}
|
|
94
103
|
}
|
|
95
104
|
return header;
|
package/src/templates/skills.ts
CHANGED
|
@@ -35,6 +35,8 @@ export const UNIT_FILES: readonly string[] = [
|
|
|
35
35
|
'skills/git-native-flow-brief.md',
|
|
36
36
|
'skills/stage-guard.md',
|
|
37
37
|
'skills/ethics-governance.md',
|
|
38
|
+
'skills/version-drift.md',
|
|
39
|
+
'skills/review-stamp.md',
|
|
38
40
|
'spec/feature-contract.md',
|
|
39
41
|
'skills/structured-protocol.md',
|
|
40
42
|
'skills/cli-footer.md',
|
|
@@ -31,6 +31,12 @@ export interface StalenessDeps {
|
|
|
31
31
|
specRel: string;
|
|
32
32
|
/** scope entries from the `# scope:` header (raw, unnormalized) */
|
|
33
33
|
scope: string[];
|
|
34
|
+
/**
|
|
35
|
+
* `# reviewed-through: <id>` header value (re-review stamp governance): when
|
|
36
|
+
* set, a STALE verdict is suppressed iff every scope-touching commit on the
|
|
37
|
+
* branch mentions that change id — the recorded no-behavior-change review.
|
|
38
|
+
*/
|
|
39
|
+
reviewedThrough?: string | null;
|
|
34
40
|
/** env override for LLMANSPEC_BASE_REF */
|
|
35
41
|
baseRefEnv?: string;
|
|
36
42
|
defaultBranchName?: string;
|
|
@@ -116,9 +122,18 @@ export function evaluateStaleness(deps: StalenessDeps): {
|
|
|
116
122
|
specUpdated = paths.some((p) => normalizePath(p) === normalizePath(specRel));
|
|
117
123
|
touchedPaths = paths.filter((p) => scopeMatches(p, normScope));
|
|
118
124
|
}
|
|
119
|
-
|
|
125
|
+
const reviewAcked =
|
|
126
|
+
touchedPaths.length > 0 &&
|
|
127
|
+
!specUpdated &&
|
|
128
|
+
reviewCoversBranch(deps.reviewedThrough ?? null, git, baseRef);
|
|
129
|
+
if (touchedPaths.length > 0 && !specUpdated && !reviewAcked) {
|
|
120
130
|
status = 'STALE' as StalenessStatus;
|
|
121
131
|
issues.push({ level: 'WARNING', path: `${specId()}/staleness`, message: STALE_MSG });
|
|
132
|
+
} else if (reviewAcked) {
|
|
133
|
+
// confirm-style ack: scope touched, spec untouched, reviewed-through
|
|
134
|
+
// covers the branch — downgrade to OK with an explanatory note.
|
|
135
|
+
status = 'OK';
|
|
136
|
+
notes.push(reviewAckedMsg(deps.reviewedThrough ?? ''));
|
|
122
137
|
} else if (specUpdated && touchedPaths.length === 0) {
|
|
123
138
|
status = 'INFO';
|
|
124
139
|
notes.push(SPEC_UPDATED_MSG);
|
|
@@ -147,6 +162,35 @@ const STALE_MSG =
|
|
|
147
162
|
"Note: Code in this spec's scope changed on this branch but the spec was not updated; re-review the spec.";
|
|
148
163
|
const SPEC_UPDATED_MSG = 'Note: Spec updated on this branch.';
|
|
149
164
|
|
|
165
|
+
const reviewAckedMsg = (id: string): string =>
|
|
166
|
+
`Note: Scope changed on this branch; covered by the recorded review (reviewed-through: ${id}).`;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Re-review ack check: every scope-touching commit message on
|
|
170
|
+
* `baseRef..HEAD` references the reviewed-through change id. Empty id or git
|
|
171
|
+
* failure → not covered (falls back to the plain STALE verdict). A commit
|
|
172
|
+
* referencing several changes satisfies any of them (`c2858`-style tokens).
|
|
173
|
+
*/
|
|
174
|
+
function reviewCoversBranch(
|
|
175
|
+
reviewedThrough: string | null,
|
|
176
|
+
git: GitLike,
|
|
177
|
+
baseRef: string,
|
|
178
|
+
): boolean {
|
|
179
|
+
if (reviewedThrough === null || reviewedThrough.trim() === '') return false;
|
|
180
|
+
const id = reviewedThrough.trim();
|
|
181
|
+
const log = git.runOpt(['log', '--format=%s', `${baseRef}..HEAD`]);
|
|
182
|
+
if (log === null || log === '') return false;
|
|
183
|
+
return log
|
|
184
|
+
.split('\n')
|
|
185
|
+
.filter((l) => scopeLineRelevant(l))
|
|
186
|
+
.every((l) => l.includes(id));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Lines without any `c<num>` token carry no change attribution — skip them. */
|
|
190
|
+
function scopeLineRelevant(line: string): boolean {
|
|
191
|
+
return /c\d+/u.test(line) || line.trim() === '';
|
|
192
|
+
}
|
|
193
|
+
|
|
150
194
|
function revParse(git: GitLike, ref: string): string | null {
|
|
151
195
|
return git.runOpt(['rev-parse', '--verify', '--quiet', ref]) ?? null;
|
|
152
196
|
}
|
|
@@ -110,6 +110,10 @@ After all tasks complete + all gates green, output a structured report (see Outp
|
|
|
110
110
|
|
|
111
111
|
{{ unit("skills/cli-footer") }}
|
|
112
112
|
|
|
113
|
+
{{ unit("skills/version-drift") }}
|
|
114
|
+
|
|
115
|
+
{{ unit("skills/review-stamp") }}
|
|
116
|
+
|
|
113
117
|
{{ unit("skills/validation-hints") }}
|
|
114
118
|
|
|
115
119
|
{{ unit("skills/structured-protocol") }}
|
|
@@ -7,7 +7,7 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# LLMAN SDD Archive
|
|
9
9
|
|
|
10
|
-
Archive completed changes. Prerequisites: verify all-green, and the change is branch-bound with specs landed (or `needs_specs_change: false`). `change finalize` **auto-merges** into the base branch (target: `--into` > binding `base_branch` > default branch; method: `--method` > config `sdd.merge_method`, squash by default — feature diff + rename collapse into ONE commit on the target), **renames** change docs into `changes/archive/`, then **auto-commits** `archive(sdd): <change-id>` (`--no-commit` skips). `git push` / PR are optional.
|
|
10
|
+
Archive completed changes. Prerequisites: verify all-green, and the change is branch-bound with specs landed (or `needs_specs_change: false`). `change finalize` **auto-merges** into the base branch (target: `--into` > binding `base_branch` > default branch; when the target is the bound branch itself the merge is skipped for an in-place close-out with a notice in the output; method: `--method` > config `sdd.merge_method`, squash by default — feature diff + rename collapse into ONE commit on the target), **renames** change docs into `changes/archive/`, then **auto-commits** `archive(sdd): <change-id>` (`--no-commit` skips). `git push` / PR are optional.
|
|
11
11
|
|
|
12
12
|
## Pipeline Position
|
|
13
13
|
|
|
@@ -72,7 +72,7 @@ If the user just wants to **capture an idea** ("draft a proposal", "note down X"
|
|
|
72
72
|
- Flesh out `proposal.md` (Why / What Changes / Capabilities / Impact); write `design.md` only when tradeoffs/migrations matter.
|
|
73
73
|
- **Confirm seams before writing tasks.md**: list the seams to be tested and confirm with the user. A seam = the public boundary driven by `*.feature` GWT steps (CLI subprocess or public interface) — MUST reuse existing harness seams, MUST NOT invent seams detached from `.feature`; without `.feature`, the seam is the CLI subcommand or public function boundary under test.
|
|
74
74
|
- `tasks.md`: split into **vertical slices** (each task cuts a narrow but complete path through schema→API→UI→tests, independently verifiable), with `[blocked-by: <task-id>]` dependency markers. **Wide-refactor exception** (one mechanical change sweeping the codebase, a single edit breaking many call sites): sequence as expand-contract (add new beside old → migrate call sites in batches → delete old); don't force vertical slices. **tasks.md lists implementation and verification tasks only**: close-out (`change finalize` / `change archive`) is a pipeline step and MUST NOT be listed as a task — its task gate requires every task checked, so a close-out task is self-contradictory (checking it lies, leaving it blocks close-out, and `validate --strict` stays red during implementation). Before/after completion criteria (counts, baselines) MUST state they are measured on the change branch (against merge-base) — a value taken on the default branch is usually trivially the baseline.
|
|
75
|
-
- **First** `llman-sdd change start <change-id>` (recommended; clean tree on the default branch; `--worktree` to keep the current checkout, `--base <branch>` for a non-default fork source) or manually create a branch then `change attach <change-id
|
|
75
|
+
- **First** `llman-sdd change start <change-id>` (recommended; clean tree on the default branch; `--worktree` to keep the current checkout, `--base <branch>` (local branches only) for a non-default fork source) or manually create a branch then `change attach <change-id>` (attach derives the fork source from runtime signals by default and warns on deviation).
|
|
76
76
|
- **Then** edit `llmanspec/specs/<capability>.feature` (flat, or directory `llmanspec/specs/<capability>/` main file) on the bound non-default branch and commit (land specs). **Do not** edit specs before start; **do not** commit specs to the default branch just to satisfy the clean-tree gate. If already attached, do not re-run `start` (recover lost specs by checkout/recreate + `attach --force`).
|
|
77
77
|
- For changes with no contract edits, set frontmatter `needs_specs_change: false`. Enter apply when `llman-sdd show <id> --output json` shows `stage=full` with the specs-landed gate green; `readyToImplement=true` (all gates) is the completion signal gating verify/finalize.
|
|
78
78
|
- **Breaking contract changes** (removed/renamed fields, commands, tags, or stage values) MUST plan the upgrade path: write a `migrations/v<from>-v<to>/README` (upgrade guidance; a one-shot script SHALL ship with the repo when feasible) — include it in the proposal's What Changes.
|
|
@@ -70,6 +70,10 @@ flowchart LR
|
|
|
70
70
|
{{ unit("skills/human-readable-summary") }}
|
|
71
71
|
{{ unit("skills/cli-footer") }}
|
|
72
72
|
|
|
73
|
+
{{ unit("skills/version-drift") }}
|
|
74
|
+
|
|
75
|
+
{{ unit("skills/review-stamp") }}
|
|
76
|
+
|
|
73
77
|
{{ unit("skills/validation-hints") }}
|
|
74
78
|
|
|
75
79
|
{{ unit("skills/structured-protocol") }}
|
|
@@ -7,4 +7,4 @@ Hard rules:
|
|
|
7
7
|
2. No contract edits → `needs_specs_change: false`. Enter apply when `stage=full` and the specs-landed gate passes; `readyToImplement=true` (all gates green) is the completion signal gating verify/finalize.
|
|
8
8
|
3. Close-out: `change finalize` (auto commit `archive(sdd): <id>`; `--no-commit` to skip).
|
|
9
9
|
4. **Do not** commit specs on the default branch; if already attached, do not re-run `start`.
|
|
10
|
-
5. Worktree (optional): `change start --worktree` creates the branch in a dedicated worktree without hijacking the current checkout (`--base <branch
|
|
10
|
+
5. Worktree (optional): `change start --worktree` creates the branch in a dedicated worktree without hijacking the current checkout (`--base <branch>`, local branches only) records a non-default fork source; attach derives the fork source from runtime signals by default and warns on deviation from the default branch; finalize skips the merge for an in-place close-out when the target is the bound branch, and runs in place when the target is held by another worktree (location annotated in output).
|
|
@@ -44,7 +44,7 @@ Worktree decision table:
|
|
|
44
44
|
| Working style | Command | Criteria |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| Single checkout | `llman-sdd change start <id>` | On the default branch with a clean tree; switches this checkout to the new branch |
|
|
47
|
-
| Keep current checkout / parallel changes | `llman-sdd change start <id> --worktree` | Branch lives in a dedicated worktree (`sdd.worktree_root` / `sdd.worktree_naming` config; default sibling of the repo root), current checkout untouched, output includes the worktree path; pair with `--base <branch>` for a non-default fork source |
|
|
48
|
-
| Already on a feature branch (incl. manual wt/git-worktree) | `llman-sdd change attach <id>` | Branch already exists; `--base
|
|
47
|
+
| Keep current checkout / parallel changes | `llman-sdd change start <id> --worktree` | Branch lives in a dedicated worktree (`sdd.worktree_root` / `sdd.worktree_naming` config; default sibling of the repo root), current checkout untouched, output includes the worktree path; pair with `--base <branch>` (local branches only) for a non-default fork source |
|
|
48
|
+
| Already on a feature branch (incl. manual wt/git-worktree) | `llman-sdd change attach <id>` | Branch already exists; fork source resolves as `--base` > `branch.<name>.base` / local upstream probe > default branch, with a WARNING when it deviates from the default; `--base` accepts local branches only |
|
|
49
49
|
|
|
50
|
-
finalize target location: when the target branch is held by another worktree, `llman-sdd change finalize <id>` / `llman-sdd change archive <id>` run the merge, rename and commit inside that worktree (output includes `executed in target worktree <path>`); a dirty holding worktree aborts with disposal options and zero writes.
|
|
50
|
+
finalize target location: when the target is the bound branch itself the merge is skipped for an in-place close-out (output carries an in-place close-out notice); when the target branch is held by another worktree, `llman-sdd change finalize <id>` / `llman-sdd change archive <id>` run the merge, rename and commit inside that worktree (output includes `executed in target worktree <path>`); a dirty holding worktree aborts with disposal options and zero writes.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
## Re-review stamp discipline (`# reviewed-through:` header)
|
|
2
|
+
|
|
3
|
+
When a review concludes "no governed behaviour change", **update** the spec header line `# reviewed-through: <change-id>` to this change — **never** append free-form `# re-review(...)` comments between rules (historical narrative belongs to `changes/archive/<id>/`; the spec keeps only the machine-readable pointer). Staleness consumes it to clear the STALE signal; legacy free-form comments are dropped mechanically on touch, not migrated.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
## Version-drift notice (`[NOTE] ... scaffolded with llman-sdd X; installed CLI is Y`)
|
|
2
|
+
|
|
3
|
+
When you see this stderr line: **relay** it to the user and suggest `llman-sdd init --update` (refreshes managed blocks and skills to the installed CLI). Until updated, **keep following the current skill** — the notice is informational, never a stop condition. At most once per process.
|
|
@@ -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` >
|
|
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
|
|
|
@@ -72,7 +72,7 @@ flowchart LR
|
|
|
72
72
|
- 充实 `proposal.md`(Why / What Changes / Capabilities / Impact);仅当有权衡/迁移时写 `design.md`。
|
|
73
73
|
- **写 tasks.md 前确认测试边界(seam)**:列出要测的 seam 并与用户确认。seam = 由 `*.feature` GWT 步骤驱动的公共边界(CLI 子进程或公共接口)——MUST 复用既有 harness seam,MUST NOT 脱离 `.feature` 凭空发明;没有 `.feature` 时,seam = 被测的 CLI 子命令或公共函数边界。
|
|
74
74
|
- `tasks.md` 按**垂直切片**拆(每个 task 打穿 schema→API→UI→tests 一条窄而完整的路径,可独立验证),带 `[blocked-by: <task-id>]` 依赖标记。**大范围重构例外**(一个机械改动扫全库、单点编辑牵动大量调用处):按先加后删排序(新的加在旧的旁边 → 分批迁移调用处 → 删旧的),不强拆垂直切片。**tasks.md 只列实现与验证任务**:收口(`change finalize` / `change archive`)是流水线步骤,MUST NOT 列为任务——收口的任务门要求全部任务已勾,列了必然自相矛盾(勾选即虚报、不勾则收口被拒,实施期 `validate --strict` 永红)。前后对比类完成判据(计数、基线)MUST 注明在 change 分支上测量(相对 merge-base)——默认分支测得的值通常恒为基线。
|
|
75
|
-
- **先** `llman-sdd change start <change-id>`(推荐;默认分支上工作树干净时;保留当前检出用 `--worktree`,非默认分叉源用 `--base <branch
|
|
75
|
+
- **先** `llman-sdd change start <change-id>`(推荐;默认分支上工作树干净时;保留当前检出用 `--worktree`,非默认分叉源用 `--base <branch>`(仅本地分支))或手动建分支后 `change attach <change-id>`(attach 缺省按运行时信号推导分叉源,偏离默认分支时输出 WARNING)。
|
|
76
76
|
- **再**在绑定的非默认分支编辑 `llmanspec/specs/<capability>.feature`(扁平,或目录 `llmanspec/specs/<capability>/` 内主文件)并 commit(落地 specs)。**不要**在 start 前改 specs;**不要**为过干净树门禁把 specs commit 到默认分支。已 attach 勿重复 `start`(specs 丢失用 checkout/重建 + `attach --force` 恢复)。
|
|
77
77
|
- 无合约编辑的 change 设 frontmatter `needs_specs_change: false`。`llman-sdd show <id> --output json` 显示 `stage=full` 且 specs-landed 门通过即可进 apply;`readyToImplement=true`(全门)是 verify/finalize 的完成信号。
|
|
78
78
|
- **破坏性合约变更**(移除/重命名字段、命令、tag 或 stage 值域)MUST 规划升级路径:`migrations/v<from>-v<to>/` 下写 README(升级提示;一次性脚本可行时随仓库提供)——写进提案 What Changes。
|
|
@@ -70,6 +70,10 @@ flowchart LR
|
|
|
70
70
|
{{ unit("skills/human-readable-summary") }}
|
|
71
71
|
{{ unit("skills/cli-footer") }}
|
|
72
72
|
|
|
73
|
+
{{ unit("skills/version-drift") }}
|
|
74
|
+
|
|
75
|
+
{{ unit("skills/review-stamp") }}
|
|
76
|
+
|
|
73
77
|
{{ unit("skills/validation-hints") }}
|
|
74
78
|
|
|
75
79
|
{{ unit("skills/structured-protocol") }}
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
2. 无合约编辑 → `needs_specs_change: false`。`stage=full` 且 specs-landed 门通过即可进 apply;`readyToImplement=true`(全门绿)是 verify/finalize 前的完成信号。
|
|
8
8
|
3. 收口用 `change finalize`(自动提交 `archive(sdd): <id>`;`--no-commit` 跳过)。
|
|
9
9
|
4. **禁止**在默认分支 commit specs;已 attach 勿重复 `start`。
|
|
10
|
-
5. worktree(可选):`change start --worktree` 在独立 worktree 建分支、不动当前检出(`--base <branch>`
|
|
10
|
+
5. worktree(可选):`change start --worktree` 在独立 worktree 建分支、不动当前检出(`--base <branch>` 仅本地分支)记录分叉源;attach 缺省按运行时信号推导分叉源、偏离默认分支时输出 WARNING;finalize 目标即绑定分支时跳过合并就地收口,目标被其他 worktree 持有时自动在该 worktree 内执行(输出标注位置)。
|
|
@@ -44,7 +44,7 @@ Worktree 决策表:
|
|
|
44
44
|
| 工作形态 | 命令 | 判据 |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| 单检出 | `llman-sdd change start <id>` | 在默认分支且树干净;直接切到新分支 |
|
|
47
|
-
| 保留当前检出 / 并行 change | `llman-sdd change start <id> --worktree` | 分支建于独立 worktree(`sdd.worktree_root` / `sdd.worktree_naming` 可调,缺省仓库根兄弟目录),当前检出不动,输出含 worktree 路径;配 `--base <branch
|
|
48
|
-
| 已在 feature 分支(含手工 wt/git-worktree) | `llman-sdd change attach <id>` |
|
|
47
|
+
| 保留当前检出 / 并行 change | `llman-sdd change start <id> --worktree` | 分支建于独立 worktree(`sdd.worktree_root` / `sdd.worktree_naming` 可调,缺省仓库根兄弟目录),当前检出不动,输出含 worktree 路径;配 `--base <branch>`(仅本地分支)记录非默认分叉源 |
|
|
48
|
+
| 已在 feature 分支(含手工 wt/git-worktree) | `llman-sdd change attach <id>` | 分支已存在;分叉源按 `--base` > `branch.<name>.base` / 本地 upstream 推导 > 默认分支,偏离默认分支时输出 WARNING;`--base` 仅接受本地分支 |
|
|
49
49
|
|
|
50
|
-
finalize
|
|
50
|
+
finalize 目标定位:目标即绑定分支时跳过合并就地收口(输出含 in-place close-out 提示);目标分支被其他 worktree 持有时,`llman-sdd change finalize <id>` / `llman-sdd change archive <id>` 自动在该 worktree 内完成合并、改名与提交(输出含 `executed in target worktree <path>`);持有 worktree 脏时中止报错并列出处置选项(零写入)。
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
## 复核戳纪律(re-review stamp → `# reviewed-through:` 头)
|
|
2
|
+
|
|
3
|
+
复核确认「本 capability 管辖行为不变」时,**只更新** spec 头部的 `# reviewed-through: <change-id>` 一行(改为本次 change id),**禁止**在 rule 块间追加自由 `# re-review(...)` 注释——历史叙事归 `changes/archive/<id>/`,spec 只留机读指针。staleness 据此消警;旧版自由注释随触碰一并机械清理(删除、不搬运)。
|