@llman-sdd/cli 0.7.2 → 0.7.4
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 +2 -2
- package/src/cli-shared.ts +60 -1
- package/src/commands/validate.ts +1 -0
- package/src/main.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llman-sdd/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "Spec-driven development workflow CLI (the `llman-sdd` command)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"build": "bun run ./scripts/build-binary.ts"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@llman-sdd/core": "0.7.
|
|
30
|
+
"@llman-sdd/core": "0.7.4",
|
|
31
31
|
"commander": "^15.0.0"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
package/src/cli-shared.ts
CHANGED
|
@@ -12,8 +12,10 @@ import {
|
|
|
12
12
|
loadConfig,
|
|
13
13
|
loadConfigDetail,
|
|
14
14
|
makeEmbeddedTemplateIo,
|
|
15
|
+
readSddState,
|
|
15
16
|
resolveChangeId,
|
|
16
17
|
resolveInstanceRoot,
|
|
18
|
+
semverLt,
|
|
17
19
|
type TemplateIo,
|
|
18
20
|
} from '@llman-sdd/core';
|
|
19
21
|
import type { Command } from 'commander';
|
|
@@ -32,7 +34,42 @@ export type { Command } from 'commander';
|
|
|
32
34
|
|
|
33
35
|
// Injected at binary build time by scripts/build-binary.ts; falls back to the
|
|
34
36
|
// package version when running from source.
|
|
35
|
-
|
|
37
|
+
const baseVersion = process.env.LLMAN_SDD_VERSION ?? pkg.version;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Dev-tree marker (`+dirty.N`): appended when the checkout has uncommitted
|
|
41
|
+
* changes, so `--version` / drift notices distinguish "released build" from
|
|
42
|
+
* "hacking on the library" at a glance. Best-effort — git failure keeps the
|
|
43
|
+
* plain version; cached per process.
|
|
44
|
+
*/
|
|
45
|
+
let dirtySuffix: string | null | undefined;
|
|
46
|
+
|
|
47
|
+
function computeDirtySuffix(): string {
|
|
48
|
+
try {
|
|
49
|
+
const probe = Bun.spawnSync(['git', 'status', '--porcelain'], {
|
|
50
|
+
cwd: import.meta.dir,
|
|
51
|
+
stdout: 'pipe',
|
|
52
|
+
stderr: 'ignore',
|
|
53
|
+
});
|
|
54
|
+
if (probe.exitCode !== 0) return '';
|
|
55
|
+
const lines = probe.stdout
|
|
56
|
+
.toString()
|
|
57
|
+
.split('\n')
|
|
58
|
+
.map((l) => l.trim())
|
|
59
|
+
.filter((l) => l !== '');
|
|
60
|
+
return lines.length > 0 ? `+dirty.${lines.length}` : '';
|
|
61
|
+
} catch {
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function versionDisplay(): string {
|
|
67
|
+
dirtySuffix ??= computeDirtySuffix();
|
|
68
|
+
return `${baseVersion}${dirtySuffix}`;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Package version without the dirty suffix (drift comparison baseline). */
|
|
72
|
+
export const version: string = baseVersion;
|
|
36
73
|
|
|
37
74
|
// Compiled single-file binaries have no on-disk templates and Bun <= 1.4.x has
|
|
38
75
|
// no embedding mechanism, so scripts/build-binary.ts injects the template
|
|
@@ -115,10 +152,32 @@ export function warnLegacyBddOnce(source: string): void {
|
|
|
115
152
|
warnLegacyBdd(loadConfigDetail(source).legacyBddElevated);
|
|
116
153
|
}
|
|
117
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Version-drift notice (version-awareness): when the project was scaffolded by
|
|
157
|
+
* an older llman-sdd, surface one stderr line per process so humans and agents
|
|
158
|
+
* see the update hint. Silent-OK when no/corrupt state; never load-bearing;
|
|
159
|
+
* no override flags by design (noise is bounded by once-per-process + strict
|
|
160
|
+
* older-than comparison).
|
|
161
|
+
*/
|
|
162
|
+
let versionDriftShown = false;
|
|
163
|
+
|
|
164
|
+
export function noteVersionDriftOnce(root: string = process.cwd()): void {
|
|
165
|
+
if (versionDriftShown) return;
|
|
166
|
+
versionDriftShown = true;
|
|
167
|
+
const io = makeIo(root);
|
|
168
|
+
const state = readSddState(io);
|
|
169
|
+
if (state === null) return;
|
|
170
|
+
if (!semverLt(state.cli_version, version)) return;
|
|
171
|
+
console.error(
|
|
172
|
+
`[NOTE] this project was scaffolded with llman-sdd ${state.cli_version}; installed CLI is ${version}. Skill templates/behaviour may have changed — review the changelog and run \`llman-sdd init --update\`.`,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
118
176
|
export function loadCliConfig(): ReturnType<typeof loadConfig> | null {
|
|
119
177
|
if (!existsSync('llmanspec/config.yaml')) return null;
|
|
120
178
|
const detail = loadConfigDetail(readFileSync('llmanspec/config.yaml', 'utf8'));
|
|
121
179
|
warnLegacyBdd(detail.legacyBddElevated);
|
|
180
|
+
noteVersionDriftOnce();
|
|
122
181
|
return detail.config;
|
|
123
182
|
}
|
|
124
183
|
|
package/src/commands/validate.ts
CHANGED
|
@@ -99,6 +99,7 @@ function specV1Items(
|
|
|
99
99
|
root: process.cwd(),
|
|
100
100
|
specRel,
|
|
101
101
|
scope: scopes.map(liftScope),
|
|
102
|
+
reviewedThrough: entry.doc.header.reviewedThrough,
|
|
102
103
|
baseRefEnv: process.env.LLMANSPEC_BASE_REF,
|
|
103
104
|
});
|
|
104
105
|
let issues: ChangeIssue[] = verdict.items.map((i) => ({
|
package/src/main.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
|
|
4
|
-
import { CliError,
|
|
4
|
+
import { CliError, versionDisplay } from './cli-shared.ts';
|
|
5
5
|
import { registerArchive } from './commands/archive.ts';
|
|
6
6
|
import { registerChange } from './commands/change.ts';
|
|
7
7
|
import { registerConfig } from './commands/config.ts';
|
|
@@ -27,7 +27,7 @@ const program = new Command();
|
|
|
27
27
|
program.exitOverride();
|
|
28
28
|
program.configureOutput({ outputError: () => {} });
|
|
29
29
|
|
|
30
|
-
program.name('llman-sdd').description('Spec-driven development workflow').version(
|
|
30
|
+
program.name('llman-sdd').description('Spec-driven development workflow').version(versionDisplay());
|
|
31
31
|
program.option(
|
|
32
32
|
'--max-scan-depth <n>',
|
|
33
33
|
'max depth when scanning llmanspec/changes/ for proposal.md (min 1, default 8)',
|