refactor: remove stale Source: sdk/src generated-file banners from bin/lib/*.cjs (#510)
* refactor: remove stale sdk/src generated-file banners from bin/lib/*.cjs (#506) Drop the GENERATED FILE / Source: sdk/src / Regenerate: cd sdk banners from 13 hand-maintained CJS modules and delete the orphaned generator-freshness-contract script + test. Post-ADR-0174 cleanup; the referenced sdk/ generator pipeline (dir, gen:* scripts, *.generated.cjs) no longer exists. No runtime behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: add changeset for #510 (sdk/src banner cleanup) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
5
.changeset/humble-pandas-wave.md
Normal file
5
.changeset/humble-pandas-wave.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Fixed
|
||||
pr: 510
|
||||
---
|
||||
**Removed stale `Source: sdk/src/...` generated-file banners from `get-shit-done/bin/lib/*.cjs`** — 13 hand-maintained CJS modules carried `GENERATED FILE — DO NOT EDIT` / `Source: sdk/src/...` / `Regenerate: cd sdk && npm run gen:...` headers pointing at a generation pipeline retired by ADR-0174 (no `sdk/` dir, no `gen:*` scripts, no `*.generated.cjs`). The banners misrepresented the files as machine-generated and pointed readers and automated reporters at deleted sources. Also deletes orphaned generator-era infra `scripts/generator-freshness-contract.cjs` + its test. No runtime behavior change. (#510)
|
||||
@@ -1,8 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — state.*, verify.*, init.*, phase.*, phases.*, validate.*, roadmap.*, and non-family alias/subcommand metadata for CJS routing.
|
||||
* Source: sdk/src/query/command-manifest.{state,verify,init,phase,phases,validate,roadmap,non-family}.ts
|
||||
* state.*, verify.*, init.*, phase.*, phases.*, validate.*, roadmap.*, and non-family alias/subcommand metadata for CJS routing.
|
||||
*/
|
||||
|
||||
const STATE_COMMAND_ALIASES = [
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/config/index.ts
|
||||
* Regenerate: cd sdk && npm run gen:configuration
|
||||
*
|
||||
* Configuration Module — single source of truth for config loading,
|
||||
* legacy-key normalization, defaults merge, and explicit on-disk migration.
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/decisions.ts
|
||||
* Regenerate: cd sdk && npm run gen:decisions
|
||||
*
|
||||
* Shared parser for CONTEXT.md <decisions> blocks.
|
||||
* Accepts both numeric (D-42) and alphanumeric (D-INFRA-01) IDs.
|
||||
* Returns {id, text, category, tags, trackable} per decision.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/phase-lifecycle.ts
|
||||
* Regenerate: cd sdk && npm run gen:phase-lifecycle
|
||||
*
|
||||
* Phase Lifecycle Pure Helpers — pure-computation functions extracted from
|
||||
* the phase-lifecycle SDK handler.
|
||||
*
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Phase — Phase CRUD, query, and lifecycle operations
|
||||
*
|
||||
* Re-export shim note (issue #4 / ADR-3524):
|
||||
* The phase lifecycle pure-computation helpers live in phase-lifecycle.generated.cjs
|
||||
* (generated from sdk/src/query/phase-lifecycle.ts). cmdPhaseComplete uses
|
||||
* The phase lifecycle pure-computation helpers live in phase-lifecycle.cjs.
|
||||
* cmdPhaseComplete uses
|
||||
* deriveProgressFromRoadmap + clampPercent from that module to fix the
|
||||
* non-idempotent Completed Phases blind-increment bug.
|
||||
*
|
||||
@@ -20,8 +20,7 @@ const { planningDir, withPlanningLock } = require('./planning-workspace.cjs');
|
||||
const { extractFrontmatter } = require('./frontmatter.cjs');
|
||||
const { writeStateMd, readModifyWriteStateMd, stateExtractField, stateReplaceField, stateReplaceFieldWithFallback, updatePerformanceMetricsSection } = require('./state.cjs');
|
||||
const { formatGsdSlash, resolveRuntime } = require('./runtime-slash.cjs');
|
||||
// Generated pure-computation helpers for cmdPhaseComplete (issue #4 fix).
|
||||
// Source: sdk/src/query/phase-lifecycle.ts. Regenerate: node sdk/scripts/gen-phase-lifecycle.mjs
|
||||
// Pure-computation helpers for cmdPhaseComplete (issue #4 fix).
|
||||
const { deriveProgressFromRoadmap, clampPercent } = require('./phase-lifecycle.cjs');
|
||||
|
||||
// #2893 — strict canonical filter: `{padded_phase}-{NN}-PLAN.md` or `PLAN.md`.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/plan-scan.ts
|
||||
* Regenerate: cd sdk && npm run gen:plan-scan
|
||||
*
|
||||
* Plan Scan Module — detects plan and summary files in a phase directory.
|
||||
* Supports both flat (pre-#3139) and nested (post-#3139) layouts.
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/runtime/project-root.ts
|
||||
* Regenerate: cd sdk && npm run gen:project-root
|
||||
*
|
||||
* Project-Root Resolution Module — resolves a project root from a starting
|
||||
* directory by walking the ancestor chain and applying four heuristics:
|
||||
* (0) own .planning/ guard (#1362)
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/schema-detect.ts
|
||||
* Regenerate: cd sdk && npm run gen:schema-detect
|
||||
*
|
||||
* Schema Drift Detection — detects schema-relevant file changes and verifies
|
||||
* that the appropriate database push command was executed during a phase.
|
||||
* This module does not read the filesystem directly.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/secrets.ts
|
||||
* Regenerate: cd sdk && npm run gen:secrets
|
||||
*
|
||||
* Secrets handling — masking convention for API keys and other
|
||||
* credentials managed via /gsd-settings-integrations.
|
||||
* This module does not read the filesystem.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/state/index.ts
|
||||
* Regenerate: cd sdk && npm run gen:state-document
|
||||
*
|
||||
* STATE.md Document Module — pure transforms for STATE.md text.
|
||||
* This module does not read the filesystem and does not own persistence or locking.
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/query/validate.ts
|
||||
* Regenerate: cd sdk && npm run gen:validate
|
||||
*
|
||||
* Validate Helpers — pure computation helpers and regex constants extracted from
|
||||
* sdk/src/query/validate.ts. No I/O. No async. No filesystem operations.
|
||||
*
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/workstream/builder.ts
|
||||
* Regenerate: cd sdk && npm run gen:workstream-inventory-builder
|
||||
*
|
||||
* Workstream Inventory Builder — pure projection from pre-collected
|
||||
* filesystem data to typed WorkstreamInventory. No I/O. No async.
|
||||
*/
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* GENERATED FILE — DO NOT EDIT.
|
||||
*
|
||||
* Source: sdk/src/workstream-name-policy.ts
|
||||
* Regenerate: cd sdk && npm run gen:workstream-name-policy
|
||||
*
|
||||
* Canonical workstream name validation and slug normalization.
|
||||
* Used by active-workstream-store.cjs, planning-workspace.cjs, workstream.cjs.
|
||||
*/
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const GENERATOR_FRESHNESS_REASON = Object.freeze({
|
||||
FRESH: 'fresh',
|
||||
STALE: 'stale',
|
||||
MISSING_SOURCE: 'missing_source',
|
||||
MISSING_GENERATED: 'missing_generated',
|
||||
});
|
||||
|
||||
/**
|
||||
* Compare source and generated artifacts by content hash-equivalence contract.
|
||||
* @param {{source?:string, generated?:string}} input
|
||||
* @returns {{ok:boolean, reason:string}}
|
||||
*/
|
||||
function evaluateGeneratorFreshness(input) {
|
||||
const source = input?.source;
|
||||
const generated = input?.generated;
|
||||
|
||||
if (typeof source !== 'string') {
|
||||
return { ok: false, reason: GENERATOR_FRESHNESS_REASON.MISSING_SOURCE };
|
||||
}
|
||||
if (typeof generated !== 'string') {
|
||||
return { ok: false, reason: GENERATOR_FRESHNESS_REASON.MISSING_GENERATED };
|
||||
}
|
||||
if (source === generated) {
|
||||
return { ok: true, reason: GENERATOR_FRESHNESS_REASON.FRESH };
|
||||
}
|
||||
return { ok: false, reason: GENERATOR_FRESHNESS_REASON.STALE };
|
||||
}
|
||||
|
||||
module.exports = { GENERATOR_FRESHNESS_REASON, evaluateGeneratorFreshness };
|
||||
@@ -1,29 +0,0 @@
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const {
|
||||
GENERATOR_FRESHNESS_REASON,
|
||||
evaluateGeneratorFreshness,
|
||||
} = require('../scripts/generator-freshness-contract.cjs');
|
||||
|
||||
describe('generator freshness contract module', () => {
|
||||
test('fresh when source and generated match exactly', () => {
|
||||
const out = evaluateGeneratorFreshness({ source: 'abc', generated: 'abc' });
|
||||
assert.deepStrictEqual(out, { ok: true, reason: GENERATOR_FRESHNESS_REASON.FRESH });
|
||||
});
|
||||
|
||||
test('stale when source and generated differ', () => {
|
||||
const out = evaluateGeneratorFreshness({ source: 'abc', generated: 'abd' });
|
||||
assert.deepStrictEqual(out, { ok: false, reason: GENERATOR_FRESHNESS_REASON.STALE });
|
||||
});
|
||||
|
||||
test('missing_source when source omitted', () => {
|
||||
const out = evaluateGeneratorFreshness({ generated: 'abc' });
|
||||
assert.deepStrictEqual(out, { ok: false, reason: GENERATOR_FRESHNESS_REASON.MISSING_SOURCE });
|
||||
});
|
||||
|
||||
test('missing_generated when generated omitted', () => {
|
||||
const out = evaluateGeneratorFreshness({ source: 'abc' });
|
||||
assert.deepStrictEqual(out, { ok: false, reason: GENERATOR_FRESHNESS_REASON.MISSING_GENERATED });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user