@tekyzinc/gsd-t 5.11.15 → 5.11.16

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,28 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [5.11.16] - 2026-08-10
6
+
7
+ ### Added — typing the default branch name works in the main checkout
8
+
9
+ Working directly in the main checkout is rare but real, and there was no way to
10
+ ask for it: every name typed at the session-start prompt created a worktree.
11
+ Naming the repo's own default branch now means "work here" — no worktree, no
12
+ branch created — and it says so rather than going silent, since silence would
13
+ read as the name being ignored.
14
+
15
+ The default branch is asked of git, never assumed to be `main`: a repo on
16
+ `trunk` treats trunk as its default, and `main` there is just another branch
17
+ name. The typed name is matched case-insensitively, so `Main` is `main`.
18
+
19
+ Choosing the main checkout opts out of the worktree, not out of the
20
+ one-session-per-tree guard — a second live session there will still block
21
+ writes, correctly.
22
+
23
+ - `bin/gsd-t-pick-worktree.cjs`: `isDefaultBranch()` + the stay path
24
+ - `~/.zshrc` (local): both prompts now mention `"main" = work in main`
25
+ - `test/m111-pick-worktree.test.js`: 3 tests — stay, case-insensitive, and a `trunk` repo
26
+
5
27
  ## [5.11.15] - 2026-08-09
6
28
 
7
29
  ### Removed — the reply shortener (M107) is retired
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # GSD-T: Contract-Driven Development for Claude Code
2
2
 
3
- **v5.11.15** - A methodology for reliable, parallelizable development using Claude Code with optional Agent Teams support.
3
+ **v5.11.16** - 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.
@@ -79,6 +79,21 @@ function main() {
79
79
  const home = path.join(process.env.HOME, "Worktrees", path.basename(cwd));
80
80
 
81
81
  if (wanted) {
82
+ // Asking for the repo's own default branch means "work here, in the main
83
+ // checkout" — not "make a worktree called main", which git refuses anyway
84
+ // because that branch is already checked out. Rare, but it is a real
85
+ // choice, and the only way to express it is to name it.
86
+ if (isDefaultBranch(cwd, branchNameFrom(wanted))) {
87
+ // Said out loud on stderr: every other path here is silent, but this one
88
+ // is a deliberate choice to work somewhere the house rules steer away
89
+ // from, and silence would read as "the name was ignored". stdout stays
90
+ // empty because the shell reads it as the directory to move to.
91
+ process.stderr.write(
92
+ `[GSD-T WORKTREE] staying in the main checkout on ${branchNameFrom(wanted)} — ` +
93
+ `no worktree created.\n`
94
+ );
95
+ stay();
96
+ }
82
97
  process.stdout.write(create(cwd, home, branchNameFrom(wanted)).path + "\n");
83
98
  return;
84
99
  }
@@ -99,6 +114,28 @@ function main() {
99
114
  process.stdout.write(free.path + "\n");
100
115
  }
101
116
 
117
+ /**
118
+ * Is this the repo's own default branch — the one the main checkout sits on?
119
+ *
120
+ * Asked of git rather than matched against a list: a repo may use `master`,
121
+ * `trunk` or anything else, and a hardcoded list would send those repos into a
122
+ * worktree named after their own main branch. The branch currently checked out
123
+ * in the main tree IS the answer, since that is the thing being opted into.
124
+ *
125
+ * A repo git cannot answer for is not the default-branch case — it falls
126
+ * through to the ordinary worktree path, which fails loudly on its own if git
127
+ * is genuinely broken.
128
+ */
129
+ function isDefaultBranch(repo, name) {
130
+ const r = spawnSync("git", ["branch", "--show-current"], {
131
+ cwd: repo, encoding: "utf8", timeout: 10000,
132
+ });
133
+ if (r.status !== 0) return false;
134
+ // Both sides lowercased: a branch name typed at a prompt is a value the user
135
+ // types, and "Main" must mean main.
136
+ return String(r.stdout || "").trim().toLowerCase() === String(name).toLowerCase();
137
+ }
138
+
102
139
  // Turn what the user typed into a name git will accept, without silently
103
140
  // becoming a different branch than they asked for.
104
141
  function branchNameFrom(input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "5.11.15",
3
+ "version": "5.11.16",
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",