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:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* 1. Confidence is DERIVED from calibration sample count, never self-rated.
|
||||
* This project measured self-rated confidence and found it weak
|
||||
* (gsd-core/references/honest-verifier.md:25-29). A future edit that adds
|
||||
* (msd-core/references/honest-verifier.md:25-29). A future edit that adds
|
||||
* a "how sure are you?" input should fail here.
|
||||
* 2. The budget comparison is strictly greater-than, so an estimate landing
|
||||
* exactly on the budget is NOT a violation. Boundary fixtures at
|
||||
@@ -21,9 +21,9 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const fc = require('fast-check');
|
||||
|
||||
const { createTempProject, cleanup, runGsdTools } = require('./helpers.cjs');
|
||||
const { createTempProject, cleanup, runMsdTools } = require('./helpers.cjs');
|
||||
|
||||
const est = require('../gsd-core/bin/lib/phase-estimation.cjs');
|
||||
const est = require('../msd-core/bin/lib/phase-estimation.cjs');
|
||||
|
||||
// ─── deriveConfidence — exogenous, sample-count driven ──────────────────────
|
||||
|
||||
@@ -474,7 +474,7 @@ describe('parseCalibrationDocument', () => {
|
||||
|
||||
describe('measureTokens', () => {
|
||||
test('is the same scale prompt-budget uses', () => {
|
||||
const { estimateTokens } = require('../gsd-core/bin/lib/prompt-budget.cjs');
|
||||
const { estimateTokens } = require('../msd-core/bin/lib/prompt-budget.cjs');
|
||||
fc.assert(fc.property(fc.string({ maxLength: 400 }), (s) => {
|
||||
assert.equal(est.measureTokens(s), estimateTokens(s),
|
||||
'estimate and actuals must share one estimator or the ratio is meaningless');
|
||||
@@ -495,7 +495,7 @@ describe('workflow.smart_zone_tokens config key', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
const r = runGsdTools('query config-get workflow.smart_zone_tokens --raw', tmpDir);
|
||||
const r = runMsdTools('query config-get workflow.smart_zone_tokens --raw', tmpDir);
|
||||
assert.ok(r.success, `config-get should resolve the schema default: ${r.error}`);
|
||||
assert.equal(String(r.output).trim(), '100000');
|
||||
});
|
||||
@@ -504,14 +504,14 @@ describe('workflow.smart_zone_tokens config key', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
const set = runGsdTools('config-set workflow.smart_zone_tokens 60000', tmpDir);
|
||||
const set = runMsdTools('config-set workflow.smart_zone_tokens 60000', tmpDir);
|
||||
assert.ok(set.success, `config-set should accept the key: ${set.error}`);
|
||||
|
||||
const configPath = path.join(tmpDir, '.planning', 'config.json');
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
||||
assert.equal(config.workflow?.smart_zone_tokens, 60000, 'value must be persisted under workflow.');
|
||||
|
||||
const get = runGsdTools('query config-get workflow.smart_zone_tokens --raw', tmpDir);
|
||||
const get = runMsdTools('query config-get workflow.smart_zone_tokens --raw', tmpDir);
|
||||
assert.equal(String(get.output).trim(), '60000');
|
||||
});
|
||||
|
||||
@@ -520,7 +520,7 @@ describe('workflow.smart_zone_tokens config key', () => {
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
for (const bad of ['0', '-1', '1.5', 'abc', 'Infinity', '']) {
|
||||
const r = runGsdTools(`config-set workflow.smart_zone_tokens ${bad === '' ? '""' : bad}`, tmpDir);
|
||||
const r = runMsdTools(`config-set workflow.smart_zone_tokens ${bad === '' ? '""' : bad}`, tmpDir);
|
||||
assert.ok(!r.success, `config-set must reject ${JSON.stringify(bad)}`);
|
||||
}
|
||||
});
|
||||
@@ -533,7 +533,7 @@ describe('query estimate-check', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
const r = runGsdTools('query estimate-check --tokens 50000', tmpDir);
|
||||
const r = runMsdTools('query estimate-check --tokens 50000', tmpDir);
|
||||
assert.ok(r.success, `estimate-check should succeed: ${r.error}`);
|
||||
const out = JSON.parse(r.output);
|
||||
assert.equal(out.over_budget, false);
|
||||
@@ -544,8 +544,8 @@ describe('query estimate-check', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
runGsdTools('config-set workflow.smart_zone_tokens 40000', tmpDir);
|
||||
const r = runGsdTools('query estimate-check --tokens 90000', tmpDir);
|
||||
runMsdTools('config-set workflow.smart_zone_tokens 40000', tmpDir);
|
||||
const r = runMsdTools('query estimate-check --tokens 90000', tmpDir);
|
||||
assert.ok(r.success, `estimate-check should succeed: ${r.error}`);
|
||||
|
||||
const out = JSON.parse(r.output);
|
||||
@@ -558,11 +558,11 @@ describe('query estimate-check', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
runGsdTools('config-set workflow.smart_zone_tokens 40000', tmpDir);
|
||||
const at = JSON.parse(runGsdTools('query estimate-check --tokens 40000', tmpDir).output);
|
||||
runMsdTools('config-set workflow.smart_zone_tokens 40000', tmpDir);
|
||||
const at = JSON.parse(runMsdTools('query estimate-check --tokens 40000', tmpDir).output);
|
||||
assert.equal(at.over_budget, false);
|
||||
|
||||
const over = JSON.parse(runGsdTools('query estimate-check --tokens 40001', tmpDir).output);
|
||||
const over = JSON.parse(runMsdTools('query estimate-check --tokens 40001', tmpDir).output);
|
||||
assert.equal(over.over_budget, true);
|
||||
});
|
||||
|
||||
@@ -578,7 +578,7 @@ describe('query estimate-check', () => {
|
||||
'query estimate-check --tokens -5',
|
||||
'query estimate-check --tokens 0',
|
||||
]) {
|
||||
const r = runGsdTools(args, tmpDir);
|
||||
const r = runMsdTools(args, tmpDir);
|
||||
assert.ok(!r.success, `must reject: ${args}`);
|
||||
assert.ok(!/\bat Object\.|\bat Module\./.test(String(r.error ?? '')), 'no stack trace in failure output');
|
||||
}
|
||||
@@ -589,7 +589,7 @@ describe('query estimate-check', () => {
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
const marker = path.join(tmpDir, 'pwned.txt');
|
||||
const r = runGsdTools(`query estimate-check --tokens "1; touch ${marker}"`, tmpDir);
|
||||
const r = runMsdTools(`query estimate-check --tokens "1; touch ${marker}"`, tmpDir);
|
||||
assert.ok(!r.success, 'a command-substitution payload must be rejected as a bad number');
|
||||
assert.equal(fs.existsSync(marker), false, 'no shell interpolation of attacker-controlled values');
|
||||
});
|
||||
@@ -600,7 +600,7 @@ describe('query estimate-calibration', () => {
|
||||
const tmpDir = createTempProject();
|
||||
t.after(() => cleanup(tmpDir));
|
||||
|
||||
const r = runGsdTools('query estimate-calibration', tmpDir);
|
||||
const r = runMsdTools('query estimate-calibration', tmpDir);
|
||||
assert.ok(r.success, `estimate-calibration should succeed with no history: ${r.error}`);
|
||||
|
||||
const out = JSON.parse(r.output);
|
||||
@@ -619,7 +619,7 @@ describe('query estimate-calibration', () => {
|
||||
est.renderCalibrationDocument([sample(100, 200), sample(100, 200), sample(100, 200)]),
|
||||
);
|
||||
|
||||
const out = JSON.parse(runGsdTools('query estimate-calibration', tmpDir).output);
|
||||
const out = JSON.parse(runMsdTools('query estimate-calibration', tmpDir).output);
|
||||
assert.equal(out.applied, true);
|
||||
assert.equal(out.factor, 2);
|
||||
assert.equal(out.sample_count, 3);
|
||||
@@ -632,7 +632,7 @@ describe('query estimate-calibration', () => {
|
||||
|
||||
fs.writeFileSync(path.join(tmpDir, '.planning', 'estimation-calibration.json'), '{ not json');
|
||||
|
||||
const r = runGsdTools('query estimate-calibration', tmpDir);
|
||||
const r = runMsdTools('query estimate-calibration', tmpDir);
|
||||
assert.ok(r.success, 'a corrupt calibration file must not fail the command');
|
||||
const out = JSON.parse(r.output);
|
||||
assert.equal(out.applied, false);
|
||||
@@ -649,7 +649,7 @@ describe('query estimate-calibration', () => {
|
||||
// Drives the REAL readCalibrationSamples — an earlier version of this test
|
||||
// re-implemented the try/catch inline and would have kept passing if the
|
||||
// production guard were deleted.
|
||||
const cli = require('../gsd-core/bin/lib/estimate-cli.cjs');
|
||||
const cli = require('../msd-core/bin/lib/estimate-cli.cjs');
|
||||
|
||||
// Deterministic IO fault injection: monkeypatch the fs method and restore in
|
||||
// finally. Never chmod 0o000 — root bypasses mode bits, so the test would
|
||||
@@ -701,7 +701,7 @@ describe('estimate-check --calibrated', () => {
|
||||
|
||||
test('without the flag, a raw projection IS corrected', (t) => {
|
||||
const tmpDir = withHistory(t);
|
||||
const out = JSON.parse(runGsdTools('query estimate-check --tokens 50000', tmpDir).output);
|
||||
const out = JSON.parse(runMsdTools('query estimate-check --tokens 50000', tmpDir).output);
|
||||
assert.equal(out.calibration_factor, 2, 'fixture must produce factor 2');
|
||||
assert.equal(out.calibrated_tokens, 100000, 'a raw projection must be multiplied by the factor');
|
||||
assert.equal(out.pre_calibrated, false);
|
||||
@@ -709,7 +709,7 @@ describe('estimate-check --calibrated', () => {
|
||||
|
||||
test('with the flag, an already-calibrated figure is NOT corrected again', (t) => {
|
||||
const tmpDir = withHistory(t);
|
||||
const out = JSON.parse(runGsdTools('query estimate-check --tokens 50000 --calibrated', tmpDir).output);
|
||||
const out = JSON.parse(runMsdTools('query estimate-check --tokens 50000 --calibrated', tmpDir).output);
|
||||
assert.equal(out.calibration_factor, 2, 'the factor is still reported');
|
||||
assert.equal(out.calibrated_tokens, 50000,
|
||||
'a pre-calibrated figure must pass through untouched — re-applying squares the correction');
|
||||
@@ -718,17 +718,17 @@ describe('estimate-check --calibrated', () => {
|
||||
|
||||
test('the two modes diverge by exactly the factor', (t) => {
|
||||
const tmpDir = withHistory(t);
|
||||
const raw = JSON.parse(runGsdTools('query estimate-check --tokens 40000', tmpDir).output);
|
||||
const pre = JSON.parse(runGsdTools('query estimate-check --tokens 40000 --calibrated', tmpDir).output);
|
||||
const raw = JSON.parse(runMsdTools('query estimate-check --tokens 40000', tmpDir).output);
|
||||
const pre = JSON.parse(runMsdTools('query estimate-check --tokens 40000 --calibrated', tmpDir).output);
|
||||
assert.equal(raw.calibrated_tokens, pre.calibrated_tokens * raw.calibration_factor);
|
||||
});
|
||||
|
||||
test('the flag changes the over-budget verdict at the boundary', (t) => {
|
||||
const tmpDir = withHistory(t);
|
||||
runGsdTools('config-set workflow.smart_zone_tokens 60000', tmpDir);
|
||||
runMsdTools('config-set workflow.smart_zone_tokens 60000', tmpDir);
|
||||
// 50000 raw -> 100000 calibrated -> over 60000. Same value pre-calibrated -> under.
|
||||
const raw = JSON.parse(runGsdTools('query estimate-check --tokens 50000', tmpDir).output);
|
||||
const pre = JSON.parse(runGsdTools('query estimate-check --tokens 50000 --calibrated', tmpDir).output);
|
||||
const raw = JSON.parse(runMsdTools('query estimate-check --tokens 50000', tmpDir).output);
|
||||
const pre = JSON.parse(runMsdTools('query estimate-check --tokens 50000 --calibrated', tmpDir).output);
|
||||
assert.equal(raw.over_budget, true, 'double-applied correction reports a false over-budget');
|
||||
assert.equal(pre.over_budget, false, 'the honest figure is under budget');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user