@tekyzinc/gsd-t 3.13.11 → 3.13.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [3.13.12] - 2026-04-17
6
+
7
+ ### Fixed — Project-local `bin/gsd-t.js` crash on missing `debug-ledger.js` + self-heal sweep
8
+
9
+ A bee-poc relaunch after the v3.13.11 fix still crashed with `MODULE_NOT_FOUND: Cannot find module './debug-ledger.js'` — but the crash came from `bin/gsd-t.js` itself, not from the v3.13.11 supervisor code. Root cause: an older version of `copyBinToolsToProject` copied `bin/gsd-t.js` into registered projects as part of a now-deprecated whitelist. The current `PROJECT_BIN_TOOLS` whitelist (10 `.cjs` files) does not include `gsd-t.js` or its sibling `debug-ledger.js`, so `update-all` stopped maintaining both — but the stale copy persisted in project `bin/` directories, and `bin/gsd-t.js` had a hard require on `./debug-ledger.js` at the top of the file. Any invocation of the stale project-local copy crashed before the first line of real work. bee-poc had the 130 KB stale `bin/gsd-t.js` from this lineage.
10
+
11
+ **Layer 1 — defensive require** (`bin/gsd-t.js:23`):
12
+ The top-level `require('./debug-ledger.js')` is now wrapped in `try/catch` and falls back to a no-op stub exporting every function the real module exports (`readLedger`, `appendEntry`, `getLedgerStats`, `clearLedger`, `compactLedger`, `generateAntiRepetitionPreamble`). Projects with stale copies no longer crash; they degrade to debug-ledger-disabled behavior until `update-all` sweeps the stray away.
13
+
14
+ **Layer 2 — deprecated-stray sweep** (`copyBinToolsToProject`):
15
+ New `DEPRECATED_BIN_STRAYS = ["gsd-t.js"]` list is swept after the normal copy loop. For each entry: if the project has the stray AND its bytes match the source copy in this package, delete it (proves it's an installer artifact, not a user file that happens to share the name). User-owned files with different content are left untouched. Log line: `{project} — cleaned up N stray bin file(s)`. On the next `gsd-t update-all` after v3.13.12 installs, every project that picked up a stale `bin/gsd-t.js` self-heals; subsequent invocations fall through to the global install.
16
+
17
+ **Files**:
18
+ - `bin/gsd-t.js` — defensive require with full no-op stub; `DEPRECATED_BIN_STRAYS` list; post-copy sweep loop; `copyBinToolsToProject` returns `true` when either a copy happened or a stray was cleaned.
19
+ - `test/bin-gsd-t-resilience.test.js` — 3 new tests: (a) loading `bin/gsd-t.js --help` without `debug-ledger.js` does not emit `MODULE_NOT_FOUND`; (b) byte-matching stray is deleted; (c) user-owned file (byte-divergent) is preserved.
20
+
21
+ **Tests**: 1238/1238 pass (was 1235; +3 new assertions). E2E: N/A (no playwright.config.*).
22
+
23
+ **Impact**: installed projects that inherited a stale `bin/gsd-t.js` from older `update-all` passes will self-heal on the next `gsd-t update-all` after installing v3.13.12. bee-poc's 130 KB stale copy is removed on its next pass, after which any invocation path that had been hitting the project-local copy falls through to the global install — no more divergent vendoring.
24
+
5
25
  ## [3.13.11] - 2026-04-17
6
26
 
7
27
  ### Fixed — Unattended supervisor reliability triple-fix (bee-poc 15-min hang fallout)
package/bin/gsd-t.js CHANGED
@@ -20,7 +20,19 @@ const path = require("path");
20
20
  const os = require("os");
21
21
  const readline = require("readline");
22
22
  const { execFileSync, spawn: cpSpawn } = require("child_process");
23
- const debugLedger = require(path.join(__dirname, "debug-ledger.js"));
23
+ let debugLedger;
24
+ try {
25
+ debugLedger = require(path.join(__dirname, "debug-ledger.js"));
26
+ } catch (_) {
27
+ debugLedger = {
28
+ readLedger: () => [],
29
+ appendEntry: () => {},
30
+ getLedgerStats: () => ({ entryCount: 0, sizeBytes: 0, needsCompaction: false, failedHypotheses: [], passCount: 0, failCount: 0 }),
31
+ clearLedger: () => {},
32
+ compactLedger: () => {},
33
+ generateAntiRepetitionPreamble: () => "",
34
+ };
35
+ }
24
36
 
25
37
  // ─── Configuration ───────────────────────────────────────────────────────────
26
38
 
@@ -2100,6 +2112,14 @@ const PROJECT_BIN_TOOLS = [
2100
2112
  "handoff-lock.cjs", "headless-auto-spawn.cjs",
2101
2113
  ];
2102
2114
 
2115
+ // Files that older versions of this installer copied into project bin/ but
2116
+ // are no longer part of PROJECT_BIN_TOOLS. On each update-all pass, sweep the
2117
+ // project's bin/ and remove any stray file that still byte-matches the source
2118
+ // copy in this package — that proves it's an old installer artifact, not a
2119
+ // user's own file sharing the same name. User-owned files (byte-divergent)
2120
+ // are left alone.
2121
+ const DEPRECATED_BIN_STRAYS = ["gsd-t.js"];
2122
+
2103
2123
  function copyBinToolsToProject(projectDir, projectName) {
2104
2124
  const projectBinDir = path.join(projectDir, "bin");
2105
2125
  if (!fs.existsSync(projectBinDir)) {
@@ -2134,11 +2154,31 @@ function copyBinToolsToProject(projectDir, projectName) {
2134
2154
  }
2135
2155
  }
2136
2156
  }
2157
+ let cleaned = 0;
2158
+ for (const stray of DEPRECATED_BIN_STRAYS) {
2159
+ const strayPath = path.join(projectBinDir, stray);
2160
+ const srcPath = path.join(PKG_ROOT, "bin", stray);
2161
+ if (!fs.existsSync(strayPath)) continue;
2162
+ if (!fs.existsSync(srcPath)) continue;
2163
+ try {
2164
+ const strayContent = fs.readFileSync(strayPath, "utf8");
2165
+ const srcContent = fs.readFileSync(srcPath, "utf8");
2166
+ if (strayContent === srcContent) {
2167
+ fs.unlinkSync(strayPath);
2168
+ cleaned++;
2169
+ }
2170
+ } catch {
2171
+ // leave the file alone on any read error
2172
+ }
2173
+ }
2174
+ if (cleaned > 0) {
2175
+ info(`${projectName} — cleaned up ${cleaned} stray bin file(s)`);
2176
+ }
2137
2177
  if (copied > 0) {
2138
2178
  info(`${projectName} — copied ${copied} bin tool(s)`);
2139
2179
  return true;
2140
2180
  }
2141
- return false;
2181
+ return cleaned > 0;
2142
2182
  }
2143
2183
 
2144
2184
  // One-shot migration: roll the project's progress.md Decision Log into archive
@@ -3497,6 +3537,7 @@ module.exports = {
3497
3537
  isNewerVersion,
3498
3538
  ensureDir,
3499
3539
  copyFile,
3540
+ copyBinToolsToProject,
3500
3541
  hasPlaywright,
3501
3542
  hasSwagger,
3502
3543
  hasApi,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "3.13.11",
3
+ "version": "3.13.12",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 54 slash commands with headless-by-default workflow spawning, unattended supervisor relay with event stream, graph-powered code analysis, real-time agent dashboard, task telemetry, doc-ripple enforcement, backlog management, impact analysis, test sync, milestone archival, and PRD generation",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",