refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Tests for the capability trust gate — ADR-1244 Phase 4 (D5 + compatibility half of D6).
|
||||
* Covers: executable-surface disclosure, reserved-namespace reservation, strictKnownRegistries
|
||||
* policy (permissive / lockdown / host-allowlist), engines.gsd hard gate + compatVersions
|
||||
* policy (permissive / lockdown / host-allowlist), engines.msd hard gate + compatVersions
|
||||
* downgrade, the composite install verdict, and executable-set-change detection.
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
|
||||
const { cleanup } = require('./helpers.cjs');
|
||||
const trust = require('../gsd-core/bin/lib/capability-trust.cjs');
|
||||
const trust = require('../msd-core/bin/lib/capability-trust.cjs');
|
||||
|
||||
function tmpDir() {
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'cap-trust-test-'));
|
||||
@@ -124,11 +124,11 @@ test('disclose: a traversal artifact path is never resolved (reported missing)',
|
||||
// checkReservedNamespace
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
test('reserved namespace: gsd-, gsd-core-, anthropic- are reserved (case-insensitive)', () => {
|
||||
assert.strictEqual(trust.checkReservedNamespace('gsd-foo').reserved, true);
|
||||
assert.strictEqual(trust.checkReservedNamespace('gsd-core-foo').reserved, true);
|
||||
test('reserved namespace: msd-, msd-core-, anthropic- are reserved (case-insensitive)', () => {
|
||||
assert.strictEqual(trust.checkReservedNamespace('msd-foo').reserved, true);
|
||||
assert.strictEqual(trust.checkReservedNamespace('msd-core-foo').reserved, true);
|
||||
assert.strictEqual(trust.checkReservedNamespace('anthropic-foo').reserved, true);
|
||||
assert.strictEqual(trust.checkReservedNamespace('GSD-Foo').reserved, true);
|
||||
assert.strictEqual(trust.checkReservedNamespace('MSD-Foo').reserved, true);
|
||||
});
|
||||
|
||||
test('reserved namespace: ordinary ids and non-strings are not reserved', () => {
|
||||
@@ -205,20 +205,20 @@ test('source policy: a UNC network path is treated as external, not auto-allowed
|
||||
// checkEngines
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
test('engines: no engines.gsd is unconstrained', () => {
|
||||
test('engines: no engines.msd is unconstrained', () => {
|
||||
const v = trust.checkEngines({ id: 'x' }, '1.6.0');
|
||||
assert.strictEqual(v.compatible, true);
|
||||
assert.strictEqual(v.satisfiedBy, 'unconstrained');
|
||||
});
|
||||
|
||||
test('engines: satisfied range is compatible', () => {
|
||||
const v = trust.checkEngines({ engines: { gsd: '>=1.6.0' } }, '1.6.2');
|
||||
const v = trust.checkEngines({ engines: { msd: '>=1.6.0' } }, '1.6.2');
|
||||
assert.strictEqual(v.compatible, true);
|
||||
assert.strictEqual(v.satisfiedBy, 'engines');
|
||||
});
|
||||
|
||||
test('engines: unsatisfied with no compatVersions is incompatible, no downgrade', () => {
|
||||
const v = trust.checkEngines({ engines: { gsd: '>=2.0.0' } }, '1.6.0');
|
||||
const v = trust.checkEngines({ engines: { msd: '>=2.0.0' } }, '1.6.0');
|
||||
assert.strictEqual(v.compatible, false);
|
||||
assert.strictEqual(v.satisfiedBy, null);
|
||||
assert.strictEqual(v.downgradeTo, undefined);
|
||||
@@ -228,7 +228,7 @@ test('engines: unsatisfied current version falls back to newest working compatVe
|
||||
const v = trust.checkEngines(
|
||||
{
|
||||
version: '3.0.0',
|
||||
engines: { gsd: '>=2.0.0' },
|
||||
engines: { msd: '>=2.0.0' },
|
||||
compatVersions: { '1.0.0': '>=1.0.0 <1.5.0', '1.4.0': '>=1.5.0 <2.0.0', '1.2.0': '>=1.5.0 <2.0.0' },
|
||||
},
|
||||
'1.6.0',
|
||||
@@ -266,7 +266,7 @@ test('install trust: executable capability is allowed but requires consent', ()
|
||||
test('install trust: reserved namespace blocks (and suppresses consent)', () => {
|
||||
const v = trust.evaluateInstallTrust({
|
||||
parsed: gitSpec,
|
||||
manifest: { id: 'gsd-evil', version: '1.0.0', hooks: [{ event: 'E', script: 'h.js' }] },
|
||||
manifest: { id: 'msd-evil', version: '1.0.0', hooks: [{ event: 'E', script: 'h.js' }] },
|
||||
hostVersion: '1.6.0',
|
||||
});
|
||||
assert.strictEqual(v.allowed, false);
|
||||
@@ -288,7 +288,7 @@ test('install trust: blocked source contributes a block reason', () => {
|
||||
test('install trust: engines mismatch blocks with a compatVersions hint when available', () => {
|
||||
const v = trust.evaluateInstallTrust({
|
||||
parsed: gitSpec,
|
||||
manifest: { id: 'cap', version: '3.0.0', engines: { gsd: '>=2.0.0' }, compatVersions: { '1.4.0': '>=1.5.0 <2.0.0' } },
|
||||
manifest: { id: 'cap', version: '3.0.0', engines: { msd: '>=2.0.0' }, compatVersions: { '1.4.0': '>=1.5.0 <2.0.0' } },
|
||||
hostVersion: '1.6.0',
|
||||
});
|
||||
assert.strictEqual(v.allowed, false);
|
||||
@@ -331,7 +331,7 @@ test('install trust: a traversal artifact path blocks the install', () => {
|
||||
test('install trust: multiple gates accumulate multiple block reasons', () => {
|
||||
const v = trust.evaluateInstallTrust({
|
||||
parsed: evilSpec,
|
||||
manifest: { id: 'gsd-core-x', version: '3.0.0', engines: { gsd: '>=9.0.0' } },
|
||||
manifest: { id: 'msd-core-x', version: '3.0.0', engines: { msd: '>=9.0.0' } },
|
||||
strictKnownRegistries: ['github.com'],
|
||||
hostVersion: '1.6.0',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user