fix(test): package.json version check accepts the decision-11 npm translation

The bump wrote the npm-valid 3-digit manifest version for the first time
this release; the old assertion demanded byte-equality with the 4-digit
VERSION. Accept the translation plus the grandfathered pre-v1.67 mirror,
matching gstack-version-bump's own drift contract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-16 14:20:54 -07:00
co-authored by Claude Fable 5
parent 084e2edbb8
commit 730327e45f
+8 -2
View File
@@ -258,10 +258,16 @@ describe('gen-skill-docs', () => {
expect(violations).toEqual([]);
});
test('package.json version matches VERSION file', () => {
test('package.json version matches VERSION file (npm-valid translation)', () => {
// Decision 11 (v1.67 wave): VERSION stays the 4-digit source of truth;
// package.json carries the npm-valid 3-digit translation (npm rejects a
// fourth component). The pre-v1.67 1:1 four-digit mirror is also accepted
// (grandfathered until the next write), matching gstack-version-bump's
// own drift contract.
const pkg = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf-8'));
const version = fs.readFileSync(path.join(ROOT, 'VERSION'), 'utf-8').trim();
expect(pkg.version).toBe(version);
const npmTranslation = version.split('.').slice(0, 3).join('.');
expect([npmTranslation, version]).toContain(pkg.version);
});
test('generated files are fresh (match --dry-run)', () => {