@tech-leads-club/harness-toolkit 0.16.2 → 0.16.4

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/README.md CHANGED
@@ -448,11 +448,15 @@ Healthy install checklist:
448
448
 
449
449
  ```mermaid
450
450
  graph LR
451
- EV["provider event<br/><i>Cursor or Claude Code hook</i>"]
452
- HK["user-level hook file"]
453
- LX["bin/tlc-exec.mjs &lt;handler&gt;<br/><i>Bun first, Node + dist fallback</i>"]
454
- EP["src/entrypoints/&lt;handler&gt;.ts<br/><i>core + resolved adapter</i>"]
455
- OUT["follow-up · handoff · observability<br/><i>under project policy</i>"]
451
+ EV["`provider event
452
+ *Cursor or Claude Code hook*`"]
453
+ HK["`user-level hook file`"]
454
+ LX["`bin/tlc-exec.mjs #60;handler#62;
455
+ *Bun first, Node + dist fallback*`"]
456
+ EP["`src/entrypoints/#60;handler#62;.ts
457
+ *core + resolved adapter*`"]
458
+ OUT["`follow-up · handoff · observability
459
+ *under project policy*`"]
456
460
  EV --> HK --> LX --> EP --> OUT
457
461
  ```
458
462
 
@@ -482,7 +486,7 @@ See `tlc harness help architecture` or [`docs/architecture.md`](docs/architectur
482
486
  | `tlc harness build` | Compile `dist/` for the Node fallback path |
483
487
  | `tlc harness test` | Run the full local gate |
484
488
  | `tlc harness grind [on\|off]` | Lint/test follow-ups on stop |
485
- | `tlc harness pause` / `resume` | Disable / enable stop checks |
489
+ | `tlc harness pause` / `resume` | Circuit breaker: every hook steps aside except the floor / back on |
486
490
  | `tlc harness mode solo\|paired\|focus` | Operator posture |
487
491
  | `tlc harness attest` | Tamper-evident record of what each session ran under |
488
492
  | `tlc harness handoff` | Handoff state between turns and sessions — the sanctioned reader |
package/bin/tlc-cli.ts CHANGED
@@ -116,7 +116,7 @@ export function statusScreen(root: string): Screen {
116
116
  },
117
117
  {
118
118
  label: "gates",
119
- value: report.gatesPaused ? "PAUSED — stop checks disabled" : "active",
119
+ value: report.gatesPaused ? "PAUSED — every hook steps aside; only the floor runs" : "active",
120
120
  level: report.gatesPaused ? "warn" : "ok",
121
121
  },
122
122
  ],
@@ -185,13 +185,13 @@ export function setPaused(root: string, on: boolean): string {
185
185
  if (on) {
186
186
  writeFileSync(path, "");
187
187
  coreFacade.policy.refreshPolicyBaselines(root);
188
- return "gates PAUSED — stop checks disabled until `tlc harness resume`";
188
+ return "harness PAUSED — every hook steps aside (only the floor still runs) until `tlc harness resume`";
189
189
  }
190
190
  if (existsSync(path)) {
191
191
  rmSync(path);
192
192
  }
193
193
  coreFacade.policy.refreshPolicyBaselines(root);
194
- return "gates ACTIVE again";
194
+ return "harness ACTIVE again";
195
195
  }
196
196
 
197
197
  /**
package/bin/tlc-exec.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from "node:child_process";
3
- import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
3
+ import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync, writeSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import { delimiter, dirname, join } from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -235,8 +235,10 @@ export function decideRuntime({ harnessHome, entry, bunPath, nodeMajor, distExis
235
235
  }
236
236
 
237
237
  function run(harnessHome, command, commandArgs, origin = harnessHome, entry = "") {
238
+ const isHook = HOOK_ENTRIES.has(entry);
238
239
  const result = spawnSync(command, commandArgs, {
239
- stdio: "inherit",
240
+ stdio: isHook ? ["inherit", "pipe", "inherit"] : "inherit",
241
+ maxBuffer: 64 * 1024 * 1024,
240
242
  // why: `TLC_ORIGIN` is where this copy physically lives, which is not `TLC_HOME` once an npm-installed shim
241
243
  // is driving the runtime installed under the conventional path. `tlc harness install` needs the former as
242
244
  // its source and the latter as its destination, and nothing else in the runtime reads it.
@@ -259,6 +261,16 @@ function run(harnessHome, command, commandArgs, origin = harnessHome, entry = ""
259
261
  }
260
262
  process.exit(127);
261
263
  }
264
+ if (isHook) {
265
+ const stdout = result.stdout ?? Buffer.alloc(0);
266
+ if (stdout.toString("utf8").trim() === "") {
267
+ console.error(
268
+ `tlc: ${entry} produced no verdict (exit ${result.status ?? result.signal}); carrying on without one.`,
269
+ );
270
+ carryOn();
271
+ }
272
+ writeSync(1, stdout);
273
+ }
262
274
  process.exit(result.status ?? 1);
263
275
  }
264
276