@tekyzinc/gsd-t 4.20.10 → 5.0.10

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,31 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [5.0.10] - 2026-07-12
6
+
7
+ ### Added — `/gsd-t-architect`: run the Architect's Oversight pass on demand
8
+
9
+ A standalone command that runs the M101 Six-Stage Pass (Objective → Conflict → Reuse → Simplicity → Reuse-forecast → Risk) on **existing** work — an already-frozen plan, a messy subsystem, or a pasted tangle of problems — and produces the simplest correct solution as plain-English pseudocode, plus the traps each stage surfaces and what's already reusable. Major bump: this is the on-demand front door to design-first, reuse-first development, not an incremental command. Where the plan/milestone workflow runs the pass *while generating* a plan, this runs it as a standalone audit over work that already exists.
10
+
11
+ - `commands/gsd-t-architect.md`: prose-driven command — spawns one opus analysis subagent, reasons from the code graph (reuse/duplication) and real code, not memory. Default = plan-only then offers to build; `--build` auto-builds the simplest fix; `--chat-only` skips writing a file. Always prints a findings + plan summary to the session, even in auto-build. Reuses the existing prose-command + Task-subagent pattern (`/gsd-t-status`, `/gsd-t-impact`) — no new workflow file (the doctrine obeying its own Stage 3/4).
12
+ - `README.md` + `commands/gsd-t-help.md`: command documented.
13
+ - `test/filesystem.test.js`: command counts 54→55 / 48→49.
14
+
15
+ ## [4.20.11] - 2026-07-12
16
+
17
+ ### Added — M101: Architect's Oversight Doctrine
18
+
19
+ Fills GSD-T's empty architect seat. Every existing quality gate (Red Team, QA, code-review, pre-mortem) asks "is this correct?" — none asked "is this the smartest, simplest design given what already exists?" The result was the wrong thing built correctly, tested thoroughly, and shipped (origin: a real waste where a whole-page scan re-derived a value already stored locally, invisible under jargon). Now every build runs a Six-Stage Pass before code: Objective → Conflict → Reuse (process AND output, queried against the code graph) → Simplicity → Reuse-forecast → Risk, each answered with evidence not conviction. Three-layer enforcement, sibling of the M90 Unproven-Assumption Doctrine.
20
+
21
+ - `templates/CLAUDE-global.md` + `~/.claude/CLAUDE.md`: the doctrine (definition layer) — Six-Stage Pass, reuse logic (HIGH/LOW forecast, extract-don't-mutate, graph-registered reuse-candidate links to prevent silent duplicate sprawl), plain-English proof, jargonless output co-equal with brevity (absorbs backlog #47).
22
+ - `~/.claude/scripts/gsd-t-architect-oversight-guard.js`: PreToolUse Write|Edit reminder hook (trigger layer) — one line at the build moment, fail-open, code-only (silent on prose/pseudocode/docs/non-project). Wired into settings.json.
23
+ - `templates/workflows/gsd-t-phase.workflow.js`: injects the Six-Stage directive into plan/milestone phases (execution layer; `[RULE] phase-workflow-injects-architect-pass`, enforced by the existing guard-map gate).
24
+ - `.gsd-t/contracts/architects-oversight-contract.md` v1.0.0 STABLE; `.gsd-t/pseudocode/PseudoCode-ArchitectsOversight.md` (self-obedience, plain-English house style).
25
+ - `scripts/gsd-t-auto-route.js`: sharpened READER_CONTRACT jargon rule + 2 worked examples (backlog #47).
26
+ - `test/m101-architect-oversight-hook.test.js`: 9 tests (fires on code, silent on prose, fails open on garbage).
27
+
28
+ Follow-on (recorded, not built): a dedicated verify agent for pseudocode-completeness / reuse-evidence / no-silent-twin checks. The existing guard-map gate already enforces the `[RULE]` marker.
29
+
5
30
  ## [4.20.10] - 2026-07-08
6
31
 
7
32
  ### Added — M100: Universal Trace + Audit Logging (framework defaults)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GSD-T: Contract-Driven Development for Claude Code
2
2
 
3
- **v4.20.10** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
3
+ **v5.0.10** - 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.
@@ -200,6 +200,7 @@ This will replace changed command files, back up your CLAUDE.md if customized, a
200
200
  | `/gsd-t-partition` | Decompose into domains + contracts | In wave |
201
201
  | `/gsd-t-plan` | Create atomic task lists per domain (tasks auto-split to fit one context window) | In wave |
202
202
  | `/gsd-t-impact` | Analyze downstream effects | In wave |
203
+ | `/gsd-t-architect` | Run the Architect's Oversight Six-Stage Pass on existing work — finds the simplest solution + reuse + traps, as plain-English pseudocode (plan-only; `--build` to auto-build) | Manual |
203
204
  | `/gsd-t-execute` | Run tasks — task-level fresh dispatch, worktree isolation, adaptive replanning | In wave |
204
205
  | `/gsd-t-test-sync` | Sync tests with code changes | In wave |
205
206
  | `/gsd-t-qa` | QA agent — test generation, execution, gap reporting | Auto-spawned |
@@ -0,0 +1,135 @@
1
+ # GSD-T: Architect — Run the Architect's Oversight Six-Stage Pass on Existing Work
2
+
3
+ You are the **architect**. You assess a plan, a subsystem, or a tangle of problems the user
4
+ points you at, and you find the **simplest correct solution** — reusing what already exists,
5
+ surfacing the traps, and writing the answer in plain-English pseudocode the user can approve
6
+ BEFORE any code is written.
7
+
8
+ This is a standalone, on-demand run of the **Architect's Oversight Doctrine** (see the project
9
+ `CLAUDE.md` / `~/.claude/CLAUDE.md` § Architect's Oversight, and
10
+ `.gsd-t/contracts/architects-oversight-contract.md`). Use it when a plan already exists (or is
11
+ half-formed) and you want it interrogated for simplicity + reuse before building.
12
+
13
+ Unlike the plan/milestone workflow (which runs the Six-Stage Pass *while generating* a plan),
14
+ this command runs it as a **standalone pass over existing work** — an already-frozen plan, a
15
+ messy subsystem, or a pasted description of problems.
16
+
17
+ ---
18
+
19
+ ## Argument Parsing
20
+
21
+ Parse `$ARGUMENTS`:
22
+ - **First positional** = `$TARGET` — what to assess. Either a plain-English description
23
+ ("the feed scanning stalls — image watcher, completeness, comment finder"), a file/dir path,
24
+ or "the current plan" (→ read `.gsd-t/domains/*/tasks.md` + `.gsd-t/progress.md` Current Milestone).
25
+ - **`--build`** — after producing the plan, AUTO-BUILD the simplest solution in the same run
26
+ (do not stop to ask). Default (no flag): produce the plan, then OFFER to build.
27
+ - **`--chat-only`** — report in the session only; do NOT write a pseudocode file to disk.
28
+ Default: write the pseudocode artifact to `.gsd-t/pseudocode/`.
29
+
30
+ If `$TARGET` is empty, ask the user what to assess. Do not guess.
31
+
32
+ ---
33
+
34
+ ## Behavior contract (what the user asked for)
35
+
36
+ 1. **Default = plan, then offer to build.** Produce the assessment + plan, then end by asking
37
+ "Build the simplest solution now?" — unless `--build` was passed, in which case auto-build.
38
+ 2. **`--build` = auto-build after planning.** Assess → plan → implement the simplest solution,
39
+ without pausing — BUT still print the findings + plan summary to the session first.
40
+ 3. **ALWAYS print a session summary** — even in auto-build mode. The user scans the conversation
41
+ for anything that catches their eye while it keeps moving. Never silently proceed.
42
+
43
+ ---
44
+
45
+ ## Step 1: Launch the architect via a Task subagent
46
+
47
+ Give the assessment a fresh context window. Spawn ONE Task subagent (`model: opus`) — this is
48
+ high-stakes design judgment, top tier. Pass it the target and this protocol.
49
+
50
+ **Before spawning**, gather evidence sources so the subagent reasons from facts, not memory:
51
+ - If a code graph exists (`.gsd-t/graph.db`), the subagent uses `gsd-t graph` for reuse/caller
52
+ queries (Stage 3 + Stage 5 duplication check). If absent, it greps/reads and says so LOUDLY
53
+ (reuse-detection is reduced — never a silent "nothing found").
54
+ - Read the relevant code the target names (or the plan files).
55
+
56
+ ---
57
+
58
+ ## Step 2: The subagent runs the Six-Stage Pass (with EVIDENCE, never conviction)
59
+
60
+ The subagent works through the six stages IN ORDER. Each can kill or reshape the plan. Every
61
+ "am I sure?" is answered by looking (grep / Read / graph), not by asserting.
62
+
63
+ 1. **OBJECTIVE** — What is the core objective, in one plain sentence? Why is it the objective?
64
+ (Often the traps shrink once this is pinned down.)
65
+ 2. **CONFLICT** — Does solving this conflict with another objective? Must a previously-built
66
+ piece be re-examined/re-planned?
67
+ 3. **REUSE** — Have I already accomplished any piece of this? Can I reuse the **process**, or
68
+ the **output** (a value already computed/stored)? *Query the graph, not memory.* This is the
69
+ stage that kills redundant work (e.g. re-deriving a value already stored locally).
70
+ **Also — is this the SAME pattern repeated elsewhere?** If the target is one instance of a
71
+ bug, search for the other instances (one fix for a class beats N fixes for N instances).
72
+ 4. **SIMPLICITY** — What is the simplest, most efficient solution? Prove it's simplest.
73
+ 5. **REUSE FORECAST & DUPLICATION** — For anything new: HIGH reuse likelihood (core entity /
74
+ recurs / pure transform) → build clean + extractable; LOW → simplest inline. If a similar
75
+ thing exists: same JOB → extract a shared core (do NOT mutate the working original); if
76
+ stability forbids touching it → build new BUT register the duplication (a "reuse-candidate"
77
+ note) so it's visible, never a silent rogue twin.
78
+ 6. **RISK** — Does the proposed fix create security or stability/scalability risk? **And prove
79
+ the simpler fix actually works** — if the plan says "handled elsewhere / picked up later,"
80
+ VERIFY that's true; do not assert self-healing you haven't checked. (This is the trap that
81
+ hides inside a simplification.)
82
+
83
+ A stage the subagent cannot answer with evidence is a HALT — surface it as an open question for
84
+ the user, do not paper over it with a guess.
85
+
86
+ ---
87
+
88
+ ## Step 3: The subagent produces the output
89
+
90
+ **A — Plain-English pseudocode** (the artifact), in the house style — title + one-line purpose,
91
+ `CURRENT` (what it does today) and `PROPOSED` (the simplest fix) blocks, `# plain comment` inline,
92
+ a summary table, near-zero preamble. For each CURRENT block, say **why it does what it does now**
93
+ — and flag explicitly if it's a "got complicated over time" accretion (mechanisms stacked by
94
+ successive fixes). Unless `--chat-only`, write it to `.gsd-t/pseudocode/PseudoCode-<Target>.md`.
95
+
96
+ **B — Session summary** (always printed, even under `--build`):
97
+ - **Core objective** (one line)
98
+ - **Is this a "complicated over time" issue?** (yes/no + the accretion history if yes)
99
+ - **What's reusable** (process or a stored output already available)
100
+ - **Same pattern elsewhere?** (other instances of the bug/design found)
101
+ - **Simplest solution** (one paragraph)
102
+ - **Traps surfaced** (each stage's kill/risk finding — especially the Stage-6 "does the fix
103
+ really self-heal?" check)
104
+ - **Open questions** (any HALT stages needing the user)
105
+
106
+ ---
107
+
108
+ ## Step 4: Build decision
109
+
110
+ - **No `--build` flag (default):** end with the plain-English summary and ask:
111
+ *"Build the simplest solution now?"* — offer it, do not proceed.
112
+ - **`--build` flag:** proceed to implement the simplest solution immediately (still after
113
+ printing the summary). Follow the normal build discipline — smallest change that hits the
114
+ crux, Pre-Commit Gate, run affected tests. Report what was built.
115
+
116
+ ---
117
+
118
+ ## Document Ripple
119
+
120
+ The underlying assessment updates (when it writes / when a build follows):
121
+ - `.gsd-t/pseudocode/PseudoCode-<Target>.md` — the plain-English design (unless `--chat-only`).
122
+ - `.gsd-t/progress.md` Decision Log — one line recording the architect run + verdict.
123
+ - If `--build` produced code: the standard Pre-Commit Gate ripple (contracts, docs, tests) for
124
+ whatever the build touched.
125
+
126
+ ---
127
+
128
+ ## Notes
129
+
130
+ - **This command plans; it does not force a build.** The default keeps the architect a pure
131
+ "think before build" gate. `--build` is the explicit opt-in to act on its own conclusion.
132
+ - **Reuse over rebuild** (the doctrine obeying itself): this command is prose-driven and spawns
133
+ a single analysis subagent — it does NOT add a new workflow file. It reuses the existing
134
+ prose-command + Task-subagent pattern (like `/gsd-t-status`, `/gsd-t-impact`).
135
+ - Standalone command — no successor in the Next-Up map.
@@ -241,6 +241,13 @@ Use these when user asks for help on a specific command:
241
241
  - **Creates**: `.gsd-t/impact-report.md`
242
242
  - **Use when**: Before making changes, to understand what might break
243
243
 
244
+ ### architect
245
+ - **Summary**: Run the Architect's Oversight Six-Stage Pass (Objective → Conflict → Reuse → Simplicity → Reuse-forecast → Risk) on existing work — an already-frozen plan, a messy subsystem, or a pasted tangle of problems. Finds the simplest correct solution, what's already reusable (process or a stored value), and the traps each stage surfaces — written as plain-English pseudocode you can approve before any code.
246
+ - **Auto-invoked**: No (standalone, on-demand)
247
+ - **Args**: `/gsd-t-architect "<what to assess>"` — plus `--build` (auto-build the simplest fix after planning) and `--chat-only` (report in session, don't write a pseudocode file).
248
+ - **Creates**: `.gsd-t/pseudocode/PseudoCode-<Target>.md` (unless `--chat-only`)
249
+ - **Use when**: A plan already exists (or is half-formed) and you want it interrogated for simplicity + reuse before building; or a subsystem "got complicated over time" and you want the simplest version. Default is plan-only, then it offers to build.
250
+
244
251
  ### execute
245
252
  - **Summary**: Run tasks from plan, solo or with agent teams
246
253
  - **Auto-invoked**: Yes (in wave, after impact)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "4.20.10",
3
+ "version": "5.0.10",
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",
@@ -429,6 +429,33 @@ asserting. If you lack a fresh source, say so explicitly: *"I believe X, but I d
429
429
  source — please verify."* Do NOT state an external/time-varying fact as known when it is a guess.
430
430
  See memory pointer: `feedback_auto_research_external_gaps`.
431
431
 
432
+ ### Architect's Oversight Doctrine (M101 — governed, enforced)
433
+
434
+ **Contract:** `.gsd-t/contracts/architects-oversight-contract.md` v1.0.0 STABLE
435
+
436
+ **Never build before the design has passed the architect's interrogation.** GSD-T staffs verifiers (Red Team, QA, code-review, pre-mortem) — all asking "is this correct?" — but no seat asked "is this the *smartest, simplest* design given what we already have?" The result: the wrong thing built correctly, then thoroughly tested, then shipped (the Binvoice completeness-scan waste — a whole-page scan re-deriving a count already stored locally). This doctrine fills the empty architect seat. Sibling to the Unproven-Assumption Doctrine: that one bars unproven *facts*; this one bars unproven *necessity*.
437
+
438
+ **The Six-Stage Pass — run IN ORDER before proposing or building any solution. Each stage can KILL the plan. Every "am I sure?" is answered with EVIDENCE (a grep, a Read, a graph query), never conviction — self-confidence is what produced the waste.**
439
+
440
+ 1. **Objective** — What is the core objective? Why is it the core objective? *(Kills: building the wrong thing.)*
441
+ 2. **Conflict** — Does it support or conflict with other core objectives? Must we re-examine/re-plan an already-built objective? *(Kills: a local win that breaks the system; frozen past decisions.)*
442
+ 3. **Reuse** — Have I already accomplished any piece of this? Can I reuse the **process**, or the **output** of that process? *(Query the graph — not memory. This stage kills redundant work like the completeness scan. Split is load-bearing: reuse the answer already produced, not just the code.)*
443
+ 4. **Simplicity** — Is this the simplest, most efficient plan? Am I sure? *(Evidence, not conviction. Kills bloat.)*
444
+ 5. **Reuse forecast & duplication** — see §Reuse Logic below. *(Kills both over-engineering and rogue-twin sprawl.)*
445
+ 6. **Risk** — Security risks? Stability/scalability risks? Am I sure? *(Kills fast-but-fragile.)*
446
+ → **Then build.**
447
+
448
+ **§Reuse Logic (Stage 5 — how to avoid both sprawl and stability-breakage):**
449
+ - **Forecast reuse likelihood** against long-term project scope (read requirements/architecture — don't guess): **HIGH** (core domain entity / recurs in roadmap / pure transformation) or **LOW** (one-off UI/debug/glue / single caller). HIGH → build clean + extractable now (NOT config-knobbed — that's the YAGNI trap), register in the graph as reuse-likely. LOW → simplest inline thing, no abstraction.
450
+ - **When a similar-but-not-reusable thing already exists:** (a) same WHAT (job) or same HOW (surface)? Same WHAT → generalize; merely similar → build new. (b) If generalize: **extract a shared core, do NOT mutate** the working original (old callers keep identical behavior). (c) If blast-radius/stability forbids touching it → build new, **but register a "reuse-candidate" link in the graph** pointing at the twin, so the duplication is visible and re-decided on next touch. **Never build a silent rogue twin** — sprawl disables Stage 3's reuse-check for everyone after you.
451
+ - **A wrong forecast self-corrects:** the graph's similarity check surfaces a LOW-forecast function that got reused anyway at the next Stage 3. So the forecast need only be directionally right — the graph rescues the misses. That is what removes the paralysis.
452
+
453
+ **§Plain-English proof (the artifact you can always review, never must):** the Six-Stage answers are written into the milestone's **PseudoCode document** in plain, jargon-free language (style: `.gsd-t/pseudocode/` — title + one-line purpose, `CURRENT`/`PROPOSED` blocks, `# plain comment` inline, a summary table; near-zero preamble). Jargon is where unexamined complexity hides — a layman-legible sentence has nowhere for a pointless operation to survive. The pseudocode IS the audit, and it lets the user approve *direction before code* as the senior reviewer, not a rubber-stamp.
454
+
455
+ **§Jargonless output (co-equal with brevity, NOT a trade-off):** short and clear are different axes; jargon is short, so brevity rules alone reward it. Every reply, plan, options-prompt, and mid-work narration glosses jargon in plain words on first use. The crux: individual shorthand may be decodable, but **several mashed into one sentence become unintelligible** — never force the reader toward an "I don't understand" escape hatch; if that option would help, the sentence already failed. Enforced by the Reader Contract (injected every turn).
456
+
457
+ **§Enforcement (three layers — same shape as Unproven-Assumption):** (1) this doctrine = the *definition* (reference, always available); (2) a **PreToolUse hook on Write/Edit** = the *trigger* — injects a one-line reminder pointing here at the build moment, so it can't be missed under load; (3) the **plan/milestone workflow gate** = the *execution* — the Six-Stage Pass runs as blocking `agent()` steps with graph/doc evidence, and pseudocode-completeness is a verify check. Injecting the doctrine ≠ executing it; the workflow does the doing.
458
+
432
459
  ### Phase Flow
433
460
  - Upon completing a phase, automatically proceed to the next phase
434
461
  - ONLY run Discussion phase if truly required (clear path → skip to Plan)
@@ -867,6 +867,38 @@ let result;
867
867
  // M90 §2 D4-T4: holds the divergence-path result from the competition arm (R-ARCH-1).
868
868
  // Set inside the competition arm (before Finalize), attached to result after.
869
869
  let _pendingArchTriggerDivergence = null;
870
+
871
+ // M101 — Architect's Oversight Six-Stage Pass. Injected as a PROTOCOL DIRECTIVE into
872
+ // the design phases (plan/milestone) where the design is decided, before code exists.
873
+ // Reuses the existing phase agent rather than adding a parallel gate (the doctrine's
874
+ // own "reuse the process" rule). Each stage answered with EVIDENCE (grep/Read/graph),
875
+ // never conviction. Contract: architects-oversight-contract.md §1/§4.
876
+ // [RULE] phase-workflow-injects-architect-pass
877
+ const _ARCHITECT_PHASES = new Set(["plan", "milestone"]);
878
+ const _architectPassLine = _ARCHITECT_PHASES.has(phaseName)
879
+ ? [
880
+ ``,
881
+ `ARCHITECT'S OVERSIGHT — run this Six-Stage Pass BEFORE finalizing the ${phaseName}, IN ORDER.`,
882
+ `Each stage can KILL/reshape the plan. Answer each with EVIDENCE (a grep, a Read, or the`,
883
+ `graph slice above) — never conviction. Record the answers in plain, jargon-free language`,
884
+ `in the milestone's PseudoCode document (.gsd-t/pseudocode/), house style: title + one-line`,
885
+ `purpose, CURRENT/PROPOSED blocks, "# plain comment" inline, a summary table.`,
886
+ ` 1. OBJECTIVE — what is the core objective, and why is it the objective?`,
887
+ ` 2. CONFLICT — does it conflict with another objective? must a prior one be re-examined?`,
888
+ ` 3. REUSE — have I already done any piece of this? Can I reuse the PROCESS, or the OUTPUT`,
889
+ ` (a value already computed/stored)? Consult the graph slice, NOT memory. This stage`,
890
+ ` kills redundant work (e.g. re-deriving a value already stored locally).`,
891
+ ` 4. SIMPLICITY — is this the simplest, most efficient plan? Prove it.`,
892
+ ` 5. REUSE FORECAST — HIGH (core entity / recurs / pure transform) → build clean+extractable,`,
893
+ ` register in graph as reuse-likely. LOW → simplest inline, no abstraction. If a similar`,
894
+ ` thing exists: same JOB → extract a shared core (do NOT mutate the working original);`,
895
+ ` if stability forbids touching it → build new BUT register a "reuse-candidate" graph link`,
896
+ ` to the twin (never a silent rogue duplicate).`,
897
+ ` 6. RISK — any security or stability/scalability risk? Am I sure?`,
898
+ `A stage you cannot answer with evidence HALTS the plan (needs-human) — do not proceed on a hunch.`,
899
+ ].join("\n")
900
+ : "";
901
+
870
902
  if (!competitionOn) {
871
903
  // ── Single-producer path (default, unchanged behavior) ──
872
904
  phase("Phase");
@@ -879,6 +911,7 @@ if (!competitionOn) {
879
911
  userInput ? `\nUser input:\n${userInput}` : "",
880
912
  ``,
881
913
  `Objective: ${baseObjective}`,
914
+ _architectPassLine,
882
915
  ``,
883
916
  `Follow the CLAUDE.md Pre-Commit Gate. Commit artifacts with prefix "${(milestone || "m").toLowerCase()}(${phaseName})".`,
884
917
  `Return JSON per the schema.`,