From 00082442450f6f259d9b063d92e38a1269bb99f2 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Sat, 30 May 2026 17:06:23 -0400 Subject: [PATCH] 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 * docs: add changeset for #510 (sdk/src banner cleanup) Co-Authored-By: Claude Opus 4.8 --------- Co-authored-by: Claude Opus 4.8 --- .changeset/humble-pandas-wave.md | 5 +++ get-shit-done/bin/lib/command-aliases.cjs | 3 +- get-shit-done/bin/lib/configuration.cjs | 5 --- get-shit-done/bin/lib/decisions.cjs | 5 --- get-shit-done/bin/lib/phase-lifecycle.cjs | 5 --- get-shit-done/bin/lib/phase.cjs | 7 ++--- get-shit-done/bin/lib/plan-scan.cjs | 5 --- get-shit-done/bin/lib/project-root.cjs | 5 --- get-shit-done/bin/lib/schema-detect.cjs | 5 --- get-shit-done/bin/lib/secrets.cjs | 5 --- get-shit-done/bin/lib/state-document.cjs | 5 --- get-shit-done/bin/lib/validate.cjs | 5 --- .../bin/lib/workstream-inventory-builder.cjs | 5 --- .../bin/lib/workstream-name-policy.cjs | 5 --- scripts/generator-freshness-contract.cjs | 31 ------------------- tests/generator-freshness-contract.test.cjs | 29 ----------------- 16 files changed, 9 insertions(+), 121 deletions(-) create mode 100644 .changeset/humble-pandas-wave.md delete mode 100644 scripts/generator-freshness-contract.cjs delete mode 100644 tests/generator-freshness-contract.test.cjs diff --git a/.changeset/humble-pandas-wave.md b/.changeset/humble-pandas-wave.md new file mode 100644 index 000000000..f18caaecd --- /dev/null +++ b/.changeset/humble-pandas-wave.md @@ -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) diff --git a/get-shit-done/bin/lib/command-aliases.cjs b/get-shit-done/bin/lib/command-aliases.cjs index ac10ee2e9..61852efa7 100644 --- a/get-shit-done/bin/lib/command-aliases.cjs +++ b/get-shit-done/bin/lib/command-aliases.cjs @@ -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 = [ diff --git a/get-shit-done/bin/lib/configuration.cjs b/get-shit-done/bin/lib/configuration.cjs index 19b730e41..94eb4f619 100644 --- a/get-shit-done/bin/lib/configuration.cjs +++ b/get-shit-done/bin/lib/configuration.cjs @@ -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. */ diff --git a/get-shit-done/bin/lib/decisions.cjs b/get-shit-done/bin/lib/decisions.cjs index efb2c3f13..4ce07af84 100644 --- a/get-shit-done/bin/lib/decisions.cjs +++ b/get-shit-done/bin/lib/decisions.cjs @@ -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 blocks. * Accepts both numeric (D-42) and alphanumeric (D-INFRA-01) IDs. * Returns {id, text, category, tags, trackable} per decision. diff --git a/get-shit-done/bin/lib/phase-lifecycle.cjs b/get-shit-done/bin/lib/phase-lifecycle.cjs index 108118a6e..8edf6c892 100644 --- a/get-shit-done/bin/lib/phase-lifecycle.cjs +++ b/get-shit-done/bin/lib/phase-lifecycle.cjs @@ -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. * diff --git a/get-shit-done/bin/lib/phase.cjs b/get-shit-done/bin/lib/phase.cjs index 584fdb0e0..ff0231b50 100644 --- a/get-shit-done/bin/lib/phase.cjs +++ b/get-shit-done/bin/lib/phase.cjs @@ -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`. diff --git a/get-shit-done/bin/lib/plan-scan.cjs b/get-shit-done/bin/lib/plan-scan.cjs index b07386c35..5314dfdd5 100644 --- a/get-shit-done/bin/lib/plan-scan.cjs +++ b/get-shit-done/bin/lib/plan-scan.cjs @@ -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. */ diff --git a/get-shit-done/bin/lib/project-root.cjs b/get-shit-done/bin/lib/project-root.cjs index 4f3c45d2c..bd9757cf6 100644 --- a/get-shit-done/bin/lib/project-root.cjs +++ b/get-shit-done/bin/lib/project-root.cjs @@ -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) diff --git a/get-shit-done/bin/lib/schema-detect.cjs b/get-shit-done/bin/lib/schema-detect.cjs index b1652a6c9..b0b7ec685 100644 --- a/get-shit-done/bin/lib/schema-detect.cjs +++ b/get-shit-done/bin/lib/schema-detect.cjs @@ -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. diff --git a/get-shit-done/bin/lib/secrets.cjs b/get-shit-done/bin/lib/secrets.cjs index af6ed35c2..fe82c8b95 100644 --- a/get-shit-done/bin/lib/secrets.cjs +++ b/get-shit-done/bin/lib/secrets.cjs @@ -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. diff --git a/get-shit-done/bin/lib/state-document.cjs b/get-shit-done/bin/lib/state-document.cjs index bb813a2d7..c72b7e4ee 100644 --- a/get-shit-done/bin/lib/state-document.cjs +++ b/get-shit-done/bin/lib/state-document.cjs @@ -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. */ diff --git a/get-shit-done/bin/lib/validate.cjs b/get-shit-done/bin/lib/validate.cjs index 6bc4ac7f3..079bba363 100644 --- a/get-shit-done/bin/lib/validate.cjs +++ b/get-shit-done/bin/lib/validate.cjs @@ -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. * diff --git a/get-shit-done/bin/lib/workstream-inventory-builder.cjs b/get-shit-done/bin/lib/workstream-inventory-builder.cjs index 16b7c6733..72270dcf0 100644 --- a/get-shit-done/bin/lib/workstream-inventory-builder.cjs +++ b/get-shit-done/bin/lib/workstream-inventory-builder.cjs @@ -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. */ diff --git a/get-shit-done/bin/lib/workstream-name-policy.cjs b/get-shit-done/bin/lib/workstream-name-policy.cjs index 508157ea7..f03cca481 100644 --- a/get-shit-done/bin/lib/workstream-name-policy.cjs +++ b/get-shit-done/bin/lib/workstream-name-policy.cjs @@ -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. */ diff --git a/scripts/generator-freshness-contract.cjs b/scripts/generator-freshness-contract.cjs deleted file mode 100644 index 1564830c7..000000000 --- a/scripts/generator-freshness-contract.cjs +++ /dev/null @@ -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 }; diff --git a/tests/generator-freshness-contract.test.cjs b/tests/generator-freshness-contract.test.cjs deleted file mode 100644 index 1af36fe97..000000000 --- a/tests/generator-freshness-contract.test.cjs +++ /dev/null @@ -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 }); - }); -});