@tekyzinc/gsd-t 5.11.27 → 5.11.28

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,41 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [5.11.28] - 2026-08-11
6
+
7
+ ### Fixed — the graph stored the alias edges, then could not find them (two bugs)
8
+
9
+ `who-imports src/lib/db.ts` returned 5 importers on hilo-figma-atos.
10
+ `grep -rl '@/lib/db' src` returned 793. Found by David, who halted the scan
11
+ rather than running it on a graph that was answering wrongly.
12
+
13
+ v5.11.26 taught the INDEXER to expand `@/lib/db` into `src/lib/db`, and it does
14
+ — the edges are in the database, correctly. It never met the QUERY side, which
15
+ is what turns `src/lib/db` into the real file id `src/lib/db.ts`. Two
16
+ independent bugs there, and fixing either alone still returns nothing:
17
+
18
+ 1. The resolver opened with `if (!dst.startsWith(".")) return dst` — an expanded
19
+ alias has no leading dot, so it was classed as an external package like
20
+ "react" and returned untouched. The extension was never appended.
21
+ 2. The set of known files was built from FUNCTION nodes, so a module exporting
22
+ only constants, types, or re-exports was not in it. Atos's `src/lib/db.ts`
23
+ exports a constant. The indexer already records every file it walked in the
24
+ `files` table — the authoritative list was stored all along.
25
+
26
+ - `bin/gsd-t-graph-query-cli.cjs`: resolve non-relative targets against the file
27
+ set (packages still pass through untouched, and an expanded alias is NOT
28
+ re-joined to the importer's directory); read the file set from the `files`
29
+ table, announcing the degradation on an older graph that lacks it.
30
+ - `test/m112-alias-query-resolution.test.js`: 7 regressions, all going through
31
+ the QUERY rather than the stored edge.
32
+
33
+ Every v5.11.26 test asserted the edge was STORED correctly. Not one asked
34
+ whether it could then be FOUND — the feature was tested at the write and called
35
+ done. These tests close that gap.
36
+
37
+ Requires `gsd-t graph index` only if the graph predates the `files` table;
38
+ otherwise the fix applies to existing indexes immediately.
39
+
5
40
  ## [5.11.27] - 2026-08-11
6
41
 
7
42
  ### Fixed — the scan's volume probe returned a stand-in, and the whole run was built on it
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GSD-T: Contract-Driven Development for Claude Code
2
2
 
3
- **v5.11.27** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
3
+ **v5.11.28** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
4
4
 
5
5
  **Eliminates context rot** — task-level fresh dispatch (one subagent per task, ~10-20% context each) means compaction never triggers.
6
6
  **Compaction-proof debug loops** — `gsd-t headless --debug-loop` runs test-fix-retest cycles as separate `claude -p` sessions. A JSONL debug ledger persists all hypothesis/fix/learning history across fresh sessions. Anti-repetition preamble injection prevents retrying failed hypotheses. Escalation tiers (sonnet → opus → human) and a hard iteration ceiling enforced externally.
@@ -437,10 +437,68 @@ function loadSqliteStore(dbPath) {
437
437
  // TS/JS routinely omit the extension; the graph keys on real file ids.
438
438
  // Every indexed file appears as the `file` of its nodes (the indexer does not
439
439
  // emit dedicated FILE nodes), so collect the distinct file set from there.
440
- const fileIds = new Set(nodes.map((n) => norm(n.file)).filter(Boolean));
440
+ // [RULE] query-file-set-comes-from-files-table-not-inferred-from-functions
441
+ //
442
+ // hilo-figma-atos, 2026-08-11, the second half of the same miss. This set
443
+ // decides whether an extensionless import target can be matched to a real
444
+ // file. Built from node rows, it contains only files that declare a
445
+ // FUNCTION — so `src/lib/db.ts`, which exports a constant, was not in it,
446
+ // and no query could ever resolve an import of it. A file of constants,
447
+ // types, or re-exports is exactly the kind of shared module a whole codebase
448
+ // imports, and it was invisible.
449
+ //
450
+ // The indexer records every file it walked in the `files` table. That is the
451
+ // authoritative list; inferring one from functions was always an
452
+ // approximation of a fact already stored.
453
+ let fileIds;
454
+ const hasFilesTable = db
455
+ .prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='files'")
456
+ .get();
457
+ if (hasFilesTable) {
458
+ fileIds = new Set(
459
+ db.prepare("SELECT file FROM files").all().map((r) => norm(r.file)).filter(Boolean)
460
+ );
461
+ } else {
462
+ // A graph built before the files table existed. Node-derived is what this
463
+ // has always done — announced, because it under-reports imports of any
464
+ // file that declares no function.
465
+ fileIds = new Set(nodes.map((n) => norm(n.file)).filter(Boolean));
466
+ process.stderr.write(
467
+ "[graph] this index predates the files table — imports of constant-only/type-only files may be missed; re-run `gsd-t graph index`\n"
468
+ );
469
+ }
441
470
  const EXTS = ["", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".py", "/index.ts", "/index.tsx", "/index.js"];
471
+ // [RULE] query-resolves-expanded-alias-not-only-relative
472
+ //
473
+ // hilo-figma-atos, 2026-08-11: `who-imports src/lib/db.ts` returned 5 of 793
474
+ // real importers. The 788 missing ones all wrote `@/lib/db`.
475
+ //
476
+ // The two halves of the alias fix did not meet. The indexer (v5.11.26)
477
+ // expands `@/lib/db` to `src/lib/db` — correct, and stored. But this
478
+ // resolver, which is what appends the file extension, skipped it: the gate
479
+ // below returned early for anything not starting with ".", treating an
480
+ // expanded project path exactly like the package import `react`. So the edge
481
+ // sat in the database as `src/lib/db` while the query asked for
482
+ // `src/lib/db.ts`, and the two never met.
483
+ //
484
+ // A relative specifier is resolved against its source file's directory; an
485
+ // expanded alias is ALREADY project-relative and must not be — joining it to
486
+ // the importer's directory would produce `src/app/src/lib/db`. So the two
487
+ // take different routes to the same place: add the extension either way.
442
488
  const resolveDst = (srcFile, dst) => {
443
- if (typeof dst !== "string" || !dst.startsWith(".")) return dst; // package/external
489
+ if (typeof dst !== "string" || !dst) return dst;
490
+
491
+ if (!dst.startsWith(".")) {
492
+ // Not relative. Either a package ("react", "next/navigation") or an
493
+ // alias the indexer already expanded to a project path. The file set is
494
+ // what tells them apart — a package matches nothing in it.
495
+ const base = norm(dst);
496
+ for (const ext of EXTS) {
497
+ if (fileIds.has(base + ext)) return base + ext;
498
+ }
499
+ return dst; // genuinely external — keep it exactly as written
500
+ }
501
+
444
502
  const base = path.posix.normalize(path.posix.join(path.posix.dirname(norm(srcFile)), norm(dst)));
445
503
  // Prefer an actual indexed file id (try the bare path, then common extensions).
446
504
  for (const ext of EXTS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "5.11.27",
3
+ "version": "5.11.28",
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",