@tech-leads-club/harness-toolkit 0.10.5 → 0.10.6

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.
Files changed (46) hide show
  1. package/bin/tlc-cli.ts +13 -11
  2. package/dist/compact-before.mjs +79 -79
  3. package/dist/doctor.mjs +80 -80
  4. package/dist/init-project.mjs +82 -82
  5. package/dist/install-runtime.mjs +79 -79
  6. package/dist/lessons-cli.mjs +79 -79
  7. package/dist/obs-cli.mjs +84 -84
  8. package/dist/price-lookup.mjs +1 -1
  9. package/dist/prompt-submit.mjs +79 -79
  10. package/dist/refresh-model-prices.mjs +79 -79
  11. package/dist/response-after.mjs +79 -79
  12. package/dist/run.mjs +79 -79
  13. package/dist/session-end.mjs +84 -84
  14. package/dist/session-start.mjs +86 -86
  15. package/dist/shim.mjs +78 -78
  16. package/dist/ship-gate.mjs +79 -79
  17. package/dist/stop.mjs +85 -85
  18. package/dist/subagent-start.mjs +79 -79
  19. package/dist/subagent-stop.mjs +80 -80
  20. package/dist/support.mjs +83 -83
  21. package/dist/tlc-cli.mjs +97 -97
  22. package/dist/tool-after.mjs +79 -79
  23. package/dist/tool-before.mjs +81 -81
  24. package/dist/tool-failure.mjs +79 -79
  25. package/dist/uninstall-runtime.mjs +4 -4
  26. package/docs/log.md +4 -0
  27. package/package.json +1 -1
  28. package/src/core/core.facade.ts +8 -0
  29. package/src/core/gate/gate.lock.ts +8 -32
  30. package/src/core/handoff/handoff.service.ts +110 -27
  31. package/src/core/handoff/handoff.session-store.ts +200 -0
  32. package/src/core/handoff/handoff.store.ts +5 -20
  33. package/src/core/handoff/handoff.types.ts +42 -9
  34. package/src/core/presence/presence.service.ts +59 -13
  35. package/src/entrypoints/prompt-submit.ts +1 -1
  36. package/src/entrypoints/response-after.ts +4 -4
  37. package/src/entrypoints/session-end.ts +1 -1
  38. package/src/entrypoints/session-start.ts +5 -4
  39. package/src/entrypoints/ship-gate.ts +2 -2
  40. package/src/entrypoints/stop.ts +18 -18
  41. package/src/entrypoints/subagent-stop.ts +4 -3
  42. package/src/entrypoints/support.ts +5 -3
  43. package/src/entrypoints/tool-after.ts +1 -1
  44. package/src/entrypoints/tool-before.ts +1 -1
  45. package/src/platform/paths.ts +4 -0
  46. package/src/platform/process.ts +36 -0
package/bin/tlc-cli.ts CHANGED
@@ -195,9 +195,10 @@ export function setPaused(root: string, on: boolean): string {
195
195
  }
196
196
 
197
197
  /**
198
- * why: the operator's escape hatch for a stuck gate — `blockers` and `previous_gaps` are project-wide,
199
- * so a grind-cap or stagnation signal from one session can block every later subagent until either a
200
- * clean stop clears it or this runs. Denied from inside a session by `policy-surface-write`.
198
+ * why: the operator's escape hatch for a stuck gate — `blockers`/`previous_gaps` are per session
199
+ * ([/decisions/ad-122.md](/decisions/ad-122.md)), and a subagent inheriting its parent's session key inherits
200
+ * a stuck signal the same way, until either a clean stop clears it or this runs across every session on
201
+ * record. Denied from inside a session by `policy-surface-write`.
201
202
  */
202
203
  export async function resetStuckState(root: string): Promise<string> {
203
204
  const cleared = await coreFacade.handoff.clearStuckSignals(root);
@@ -244,22 +245,23 @@ export function setMode(root: string, raw: string): string {
244
245
 
245
246
  export type HandoffReport = {
246
247
  root: string;
247
- providers: Record<string, ReturnType<typeof coreFacade.handoff.readHandoff>>;
248
+ providers: Record<string, ReturnType<typeof coreFacade.handoff.readLatestSlice>>;
248
249
  };
249
250
 
250
251
  /**
251
252
  * The sanctioned way to read handoff state.
252
253
  *
253
- * why: the bootstrap used to tell the agent to read `.tlc/harness/state/handoff.json`, a path the floor guards. So
254
- * the instruction and the permission disagreed, and the obvious command `test -f && head -c 2000 …` was
255
- * refused with advice about writing policy. An instruction is not an affordance; the route the harness asks for has
256
- * to be one it grants ([/decisions/ad-047.md](/decisions/ad-047.md)).
254
+ * why: the route the floor grants instead of the raw file path it guards ([/decisions/ad-047.md](/decisions/ad-047.md)).
255
+ * One row per provider, the most recent session, not liveness-gated a diagnostic summary, not a turn's own
256
+ * decision ([/decisions/ad-122.md](/decisions/ad-122.md)).
257
257
  */
258
258
  export function handoffJson(root: string): HandoffReport {
259
- const file = coreFacade.handoff.readHandoffFile(root);
259
+ const providerNames = new Set(
260
+ coreFacade.handoff.listHandoffSessionFiles(root).map((file) => file.owner.provider),
261
+ );
260
262
  const providers: HandoffReport["providers"] = {};
261
- for (const provider of Object.keys(file.by_provider)) {
262
- providers[provider] = coreFacade.handoff.readHandoff(root, provider);
263
+ for (const provider of providerNames) {
264
+ providers[provider] = coreFacade.handoff.readLatestSlice(root, provider);
263
265
  }
264
266
  return { root, providers };
265
267
  }