* fix(#834): derive installer --help skill counts from PROFILES
The installer --help text undercounted profile skill counts: it claimed
"core — 7 main-loop skills" and "standard — ~13 skills" when the real
counts in PROFILES (bin/lib/install-profiles.cjs) are 8 and 14. The
`surface` skill was added to core after the help string was written, and
standard was never updated.
Derive the core and standard counts from PROFILES.core.length and
PROFILES.standard.length so the help text cannot drift again. Replace the
stale hardcoded "all 66 skills" (actually 67) on the full line with
drift-proof "all skills" — full is the '*' sentinel with no array length
and no cheap authoritative total in the help path.
Add regression tests that run `node bin/install.js --help` and assert the
printed core/standard counts equal the PROFILES lengths, plus a guard
that the full line carries no hardcoded numeric count.
Closes #834
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(#834): add changeset for installer --help count fix
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit e20985a15f)
This commit is contained in:
committed by
github-actions[bot]
parent
ccf2b5624e
commit
47fad118a8
5
.changeset/vivid-lemurs-munch.md
Normal file
5
.changeset/vivid-lemurs-munch.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Fixed
|
||||
pr: 847
|
||||
---
|
||||
Corrected the installer `--help` profile skill counts: `core` now shows 8 (was 7) and `standard` shows 14 (was 13), both derived from `PROFILES` so they can't drift again; the `full` line drops the stale hardcoded `66` for `all skills`. (#834)
|
||||
File diff suppressed because one or more lines are too long
@@ -84,6 +84,50 @@ describe('install-profiles: MINIMAL_SKILL_ALLOWLIST', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ─── #834: --help profile skill counts must track PROFILES ───────────────────
|
||||
|
||||
describe('install: --help profile counts match PROFILES (#834)', () => {
|
||||
function helpText() {
|
||||
return execFileSync(process.execPath, [INSTALL_SCRIPT, '--help'], {
|
||||
encoding: 'utf8',
|
||||
env: installerEnv(),
|
||||
});
|
||||
}
|
||||
|
||||
test('core line advertises PROFILES.core.length main-loop skills', () => {
|
||||
const out = helpText();
|
||||
const m = out.match(/core\s+—\s+~?(\d+)\s+main-loop skills/);
|
||||
assert.ok(m, `--help must advertise a core profile skill count; got:\n${out}`);
|
||||
assert.strictEqual(
|
||||
Number(m[1]),
|
||||
PROFILES.core.length,
|
||||
`--help core count (${m[1]}) must equal PROFILES.core.length (${PROFILES.core.length})`,
|
||||
);
|
||||
});
|
||||
|
||||
test('standard line advertises PROFILES.standard.length skills', () => {
|
||||
const out = helpText();
|
||||
const m = out.match(/standard\s+—\s+~?(\d+)\s+skills/);
|
||||
assert.ok(m, `--help must advertise a standard profile skill count; got:\n${out}`);
|
||||
assert.strictEqual(
|
||||
Number(m[1]),
|
||||
PROFILES.standard.length,
|
||||
`--help standard count (${m[1]}) must equal PROFILES.standard.length (${PROFILES.standard.length})`,
|
||||
);
|
||||
});
|
||||
|
||||
test('full line does not hardcode a drift-prone skill count', () => {
|
||||
const out = helpText();
|
||||
const m = out.match(/full\s+—\s+([^\n]*?)\s+\(default\)/);
|
||||
assert.ok(m, `--help must advertise a full profile line; got:\n${out}`);
|
||||
assert.doesNotMatch(
|
||||
m[1],
|
||||
/\d/,
|
||||
`--help full line must not hardcode a numeric skill count (drifts); got: "${m[1]}"`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('install-profiles: isMinimalMode', () => {
|
||||
test('returns true only for "minimal"', () => {
|
||||
assert.strictEqual(isMinimalMode('minimal'), true);
|
||||
|
||||
Reference in New Issue
Block a user