frizz-server 0.15.42 → 0.15.44

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 (105) hide show
  1. package/dist/claude-agent-broker.js +9432 -9079
  2. package/dist/codex-app-server-daemon.js +5 -2
  3. package/dist/dev-child.js +38398 -36988
  4. package/package.json +1 -1
  5. package/runtime/cc-worker/DECISIONS.md +9 -0
  6. package/runtime/cc-worker/hooks/scratchpad.mjs +8 -1
  7. package/runtime/cc-worker/hooks/session-seed.mjs +64 -14
  8. package/runtime/cc-worker/lib/frizz-tools.mjs +101 -14
  9. package/runtime/cc-worker/skills/gh/SKILL.md +72 -19
  10. package/web-dist/assets/{abnfDiagram-VRR7QNED-R4fnqpL_.js → abnfDiagram-VRR7QNED-pzT4fWMK.js} +1 -1
  11. package/web-dist/assets/{arc-D7SIyyY_.js → arc-BW6ZT0Zs.js} +1 -1
  12. package/web-dist/assets/architecture-TIHT7OUA-Cd4KKjcr.js +1 -0
  13. package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-D22HkIR4.js → architectureDiagram-ZJ3FMSHR-DjJJlL8J.js} +1 -1
  14. package/web-dist/assets/{blockDiagram-677ZJIJ3-BYSQJXJL.js → blockDiagram-677ZJIJ3-BFxmMqh-.js} +1 -1
  15. package/web-dist/assets/{c4Diagram-LMCZKHZV-SjlUwA7R.js → c4Diagram-LMCZKHZV-pPNLdLrQ.js} +1 -1
  16. package/web-dist/assets/channel-BJRRpPvu.js +1 -0
  17. package/web-dist/assets/{chunk-32BRIVSS-B6CWPyBg.js → chunk-32BRIVSS-DO2QffFz.js} +1 -1
  18. package/web-dist/assets/{chunk-52WLFC77-CPot8sRW.js → chunk-52WLFC77-BCQbJBxs.js} +1 -1
  19. package/web-dist/assets/{chunk-C7G6YPKG-yG-A9TmK.js → chunk-C7G6YPKG-CqrojpJt.js} +1 -1
  20. package/web-dist/assets/{chunk-EX3LRPZG-UAuz2xkd.js → chunk-EX3LRPZG-ClooPSHv.js} +1 -1
  21. package/web-dist/assets/{chunk-FWX5IMBZ-CSJBWLcY.js → chunk-FWX5IMBZ-BRUVeEPm.js} +2 -2
  22. package/web-dist/assets/{chunk-HOUHSVGY-CGGIln55.js → chunk-HOUHSVGY-Daa5JPul.js} +1 -1
  23. package/web-dist/assets/{chunk-ICXQ74PX-DPvO3p3l.js → chunk-ICXQ74PX-D1EePAvT.js} +1 -1
  24. package/web-dist/assets/{chunk-MOJQB5TN-cR_XVznl.js → chunk-MOJQB5TN-B5dCeSWz.js} +1 -1
  25. package/web-dist/assets/{chunk-OGEWGWER-DgJ4Na7c.js → chunk-OGEWGWER-DQZCm2QT.js} +1 -1
  26. package/web-dist/assets/{chunk-PUDLZKDR-PVkKiizt.js → chunk-PUDLZKDR-DS74vQXD.js} +1 -1
  27. package/web-dist/assets/{chunk-Q4XR5HBZ-BiE_9prp.js → chunk-Q4XR5HBZ-DRapbjEK.js} +1 -1
  28. package/web-dist/assets/{chunk-RYQCIY6F-Dfd2lI97.js → chunk-RYQCIY6F-Db3_N4pr.js} +1 -1
  29. package/web-dist/assets/{chunk-V7JOEXUC-MSd34shk.js → chunk-V7JOEXUC-DuoGUcxW.js} +1 -1
  30. package/web-dist/assets/{chunk-VAUOI2AC-_LdsfMm9.js → chunk-VAUOI2AC-IhEj8PHl.js} +1 -1
  31. package/web-dist/assets/{chunk-VR4S4FIN-DgNM8Q2U.js → chunk-VR4S4FIN-CBE53WRM.js} +1 -1
  32. package/web-dist/assets/{chunk-WYO6CB5R-DvwyN_Z1.js → chunk-WYO6CB5R-CFzJhIFb.js} +1 -1
  33. package/web-dist/assets/{chunk-XXDRQBXY-C0vY3rJT.js → chunk-XXDRQBXY-BghDEsiV.js} +1 -1
  34. package/web-dist/assets/{chunk-ZGVPDNZ5-Ca-iIrGH.js → chunk-ZGVPDNZ5-f1DUaopj.js} +1 -1
  35. package/web-dist/assets/classDiagram-OUVF2IWQ-B0ydbnfq.js +1 -0
  36. package/web-dist/assets/classDiagram-v2-EOCWNBFH-B0ydbnfq.js +1 -0
  37. package/web-dist/assets/{cose-bilkent-JH36ORCC-BLE-b6JZ.js → cose-bilkent-JH36ORCC-C94dFTH0.js} +1 -1
  38. package/web-dist/assets/{cynefin-VYW2F7L2-DbgUjSrw.js → cynefin-VYW2F7L2-CD3XB9bu.js} +1 -1
  39. package/web-dist/assets/{cynefinDiagram-TSTJHNR4-DRmXMjB5.js → cynefinDiagram-TSTJHNR4-DKpothpE.js} +1 -1
  40. package/web-dist/assets/{dagre-VKFMJZFB-BXVJTmZ5.js → dagre-VKFMJZFB-DEgXDrsI.js} +1 -1
  41. package/web-dist/assets/{diagram-FQU43EPY-NURkTSwG.js → diagram-FQU43EPY-DtNEUk_t.js} +1 -1
  42. package/web-dist/assets/{diagram-G47NLZAW-Cj3RSicU.js → diagram-G47NLZAW-DQqDEo1Z.js} +1 -1
  43. package/web-dist/assets/{diagram-NH7WQ7WH-WL3LSlQV.js → diagram-NH7WQ7WH-CWaXDOAf.js} +1 -1
  44. package/web-dist/assets/{diagram-OA4YK3LP-BDgiFton.js → diagram-OA4YK3LP-BRnuMLIx.js} +1 -1
  45. package/web-dist/assets/{diagram-WEI45ONY-fOXZHugt.js → diagram-WEI45ONY-DF6OlbS6.js} +1 -1
  46. package/web-dist/assets/{dist-CdXepqKz.js → dist-D2xRtqvF.js} +1 -1
  47. package/web-dist/assets/{ebnfDiagram-CCIWWBDH-C3rumWt2.js → ebnfDiagram-CCIWWBDH-EcDTeY-l.js} +1 -1
  48. package/web-dist/assets/{erDiagram-Q63AITRT-fXC5vjIx.js → erDiagram-Q63AITRT-O3W_7L5X.js} +1 -1
  49. package/web-dist/assets/eventmodeling-45OFAUF4-DcKi0Mal.js +1 -0
  50. package/web-dist/assets/flowDiagram-23GEKE2U-YZDRiDvt.js +1 -0
  51. package/web-dist/assets/{ganttDiagram-NO4QXBWP-C_YYhYTS.js → ganttDiagram-NO4QXBWP-DIplx6-n.js} +1 -1
  52. package/web-dist/assets/{gitGraph-TEB2WS4Q-BzIRwr8p.js → gitGraph-TEB2WS4Q-fEwpElLL.js} +1 -1
  53. package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-BOAG2hkd.js → gitGraphDiagram-IHSO6WYX-CawRNGyW.js} +1 -1
  54. package/web-dist/assets/index-DGZQ7U7X.css +2 -0
  55. package/web-dist/assets/index-DfeNuuiA.js +378 -0
  56. package/web-dist/assets/{info-DKCQHKI2-DiYenczO.js → info-DKCQHKI2-e722xjCC.js} +1 -1
  57. package/web-dist/assets/{infoDiagram-FWYZ7A6U-bY5uPyPk.js → infoDiagram-FWYZ7A6U-rQjsScen.js} +1 -1
  58. package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-XWRtGb2K.js → ishikawaDiagram-FXEZZL3T-D6AaIADa.js} +1 -1
  59. package/web-dist/assets/{journeyDiagram-5HDEW3XC-CHNPHjLQ.js → journeyDiagram-5HDEW3XC-Dek8lEHD.js} +1 -1
  60. package/web-dist/assets/{kanban-definition-HUTT4EX6-DyZmBgdz.js → kanban-definition-HUTT4EX6-D169tPMd.js} +1 -1
  61. package/web-dist/assets/{line-B7I8Db8G.js → line-Dw47KvcS.js} +1 -1
  62. package/web-dist/assets/{linear-BYlHJE0j.js → linear-HQnAERIY.js} +1 -1
  63. package/web-dist/assets/{mermaid-parser.core-1DKULFlf.js → mermaid-parser.core-BJDWCQPF.js} +3 -3
  64. package/web-dist/assets/{mermaid.core-DS92P-bA.js → mermaid.core-R9E4C3Es.js} +3 -3
  65. package/web-dist/assets/{mindmap-definition-LN4V7U3C-CDhSXmFL.js → mindmap-definition-LN4V7U3C-CV_FsJk7.js} +1 -1
  66. package/web-dist/assets/{packet-7NZHBO7P-gxHCLGcb.js → packet-7NZHBO7P-C0ayNcsr.js} +1 -1
  67. package/web-dist/assets/{pegDiagram-2B236MQR-B2WHH9TM.js → pegDiagram-2B236MQR-DjnQ3Pi7.js} +1 -1
  68. package/web-dist/assets/{pie-RZYD4A2V-CJfSfoox.js → pie-RZYD4A2V-D7lrHyQY.js} +1 -1
  69. package/web-dist/assets/{pieDiagram-ENE6RG2P-Cg0kblQs.js → pieDiagram-ENE6RG2P-643_YE-H.js} +1 -1
  70. package/web-dist/assets/{quadrantDiagram-ABIIQ3AL-BEF0HFg0.js → quadrantDiagram-ABIIQ3AL-CeBAmaJJ.js} +1 -1
  71. package/web-dist/assets/{radar-I7S5WNFK-BD-NCKAZ.js → radar-I7S5WNFK-DCmcE8Eq.js} +1 -1
  72. package/web-dist/assets/{railroad-3IZDKUUU-6euojYMA.js → railroad-3IZDKUUU-BFgc9gYw.js} +1 -1
  73. package/web-dist/assets/railroad-abnf-AHOZXSZD-DG591qcs.js +1 -0
  74. package/web-dist/assets/railroad-ebnf-EBAXGLYW-BJwrR-19.js +1 -0
  75. package/web-dist/assets/railroad-peg-LSFZ7HO6-C5UFkdLB.js +1 -0
  76. package/web-dist/assets/{railroadDiagram-RFXS5EU6-CXsPEV9p.js → railroadDiagram-RFXS5EU6-ClmxWxOm.js} +1 -1
  77. package/web-dist/assets/{requirementDiagram-TGXJPOKE-m_jpRKM1.js → requirementDiagram-TGXJPOKE-CpF-MZaV.js} +1 -1
  78. package/web-dist/assets/{sankeyDiagram-HTMAVEWB-cvi4BPq1.js → sankeyDiagram-HTMAVEWB-DofntocC.js} +1 -1
  79. package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-tRc--AQc.js → sequenceDiagram-DBY2YBRQ-B_qOaZbF.js} +1 -1
  80. package/web-dist/assets/{src-CkPXvRdk.js → src-CeayMM0l.js} +1 -1
  81. package/web-dist/assets/{stateDiagram-2N3HPSRC-DpFbxWsG.js → stateDiagram-2N3HPSRC-D3mAgfcK.js} +1 -1
  82. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-ppCieyPJ.js +1 -0
  83. package/web-dist/assets/{swimlanes-5IMT3BWC-CmuQ3olM.js → swimlanes-5IMT3BWC-CcP_7CWL.js} +1 -1
  84. package/web-dist/assets/swimlanesDiagram-G3AALYLV-BPdgLhxf.js +8 -0
  85. package/web-dist/assets/{timeline-definition-FHXFAJF6-yuDa2CuK.js → timeline-definition-FHXFAJF6-BuY243vk.js} +1 -1
  86. package/web-dist/assets/{treeView-QDETBFTQ-rO5Wh8Eu.js → treeView-QDETBFTQ-DWPoUOUX.js} +1 -1
  87. package/web-dist/assets/{treemap-6X3UGDF4-wNat2V0h.js → treemap-6X3UGDF4-MUlKNSNq.js} +1 -1
  88. package/web-dist/assets/{vennDiagram-L72KCM5P-CNDV0uDF.js → vennDiagram-L72KCM5P-BgdszIwK.js} +1 -1
  89. package/web-dist/assets/{wardley-OPB4EBWU-Bahki8cs.js → wardley-OPB4EBWU-BsmoKrjx.js} +1 -1
  90. package/web-dist/assets/{wardleyDiagram-EHGQE667-B87eSsOa.js → wardleyDiagram-EHGQE667-Be33pA9H.js} +1 -1
  91. package/web-dist/assets/{xychartDiagram-FW5EYKEG-Cajd3Ik6.js → xychartDiagram-FW5EYKEG-DtcL7ziG.js} +1 -1
  92. package/web-dist/index.html +2 -2
  93. package/web-dist/assets/architecture-TIHT7OUA-CiN6_7kZ.js +0 -1
  94. package/web-dist/assets/channel-DMQMWHKq.js +0 -1
  95. package/web-dist/assets/classDiagram-OUVF2IWQ-DTyv6Ys_.js +0 -1
  96. package/web-dist/assets/classDiagram-v2-EOCWNBFH-DTyv6Ys_.js +0 -1
  97. package/web-dist/assets/eventmodeling-45OFAUF4-O_wbqgIy.js +0 -1
  98. package/web-dist/assets/flowDiagram-23GEKE2U-DPWulizP.js +0 -1
  99. package/web-dist/assets/index-BZoI3aqA.css +0 -2
  100. package/web-dist/assets/index-CfGKCD_6.js +0 -378
  101. package/web-dist/assets/railroad-abnf-AHOZXSZD-BxRR4FEv.js +0 -1
  102. package/web-dist/assets/railroad-ebnf-EBAXGLYW-DYynHpjS.js +0 -1
  103. package/web-dist/assets/railroad-peg-LSFZ7HO6-wOmjP52W.js +0 -1
  104. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-CrP44Mxj.js +0 -1
  105. package/web-dist/assets/swimlanesDiagram-G3AALYLV-gsPqoddO.js +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frizz-server",
3
- "version": "0.15.42",
3
+ "version": "0.15.44",
4
4
  "private": false,
5
5
  "description": "Replaceable Frizz server runtime",
6
6
  "license": "MIT",
@@ -1219,3 +1219,12 @@ The sixteen worker capabilities (`ask`, `unask`, `secret`, `done`, `activity`, `
1219
1219
  - **Exit 2 is a refusal, not a failure.** `frizzctl done` with a question open or a watch armed prints what blocks it and exits 2; a fault or a misuse exits 1.
1220
1220
  - **A worker's own command never becomes an approval card.** Dispatch pre-approves `Bash(frizzctl:*)`, the promise the MCP server's own pre-approval made: on a thread a human moved to `default`, the worker can still ask, register and sign off unasked. Measured against a real worker on Claude Code 2.1.296, the rule carries every form the contract teaches except a quoted heredoc whose body is a JSON object, which Claude Code's own command checks send to a prompt — and that is the form `frizzctl ask` needs. `hooks/perm-policy.mjs` approves exactly that shape itself (`own-frizzctl`: `frizzctl`, words the shell does not interpret, `<<'WORD'`, a literal body, nothing after the terminator) and nothing wider.
1221
1221
  - **Which threads still get the MCP server.** A Claude worker is handed the contract at every fork, so a daemon forked now never gets it. A Codex thread's contract is its base instructions and an ACP thread's is its first prompt, both fixed when the thread started, so the session row records which surface the thread was taught (`worker_surface`) and only a thread taught MCP is still handed the server, on its own thread config. Every thread, old or new, gets `frizzctl` on its shell's PATH.
1222
+
1223
+ ## 2026-11-04: the gh pointer has two tiers — signed-in `gh`, or `gh` through Keyward
1224
+
1225
+ GitHub CLI access on the maintainer's Mac moved behind Keyward: `keyward --reason "…" -- gh …` hands `gh` his token in `GH_TOKEN` for that run, one Touch ID covers a repository's runs for 10 minutes, and the keychain token is logged out. Plain `gh auth status --active` then fails, so the old gate would have stopped teaching `gh` at all, on exactly the machine Frizz is built on.
1226
+
1227
+ - **`hooks/session-seed.mjs` checks two tiers, in order.** A signed-in plain `gh` still gets `⟦gh available⟧`: that is every other Frizz user, who has no Keyward, and this machine until the logout. Otherwise a `keyward` executable on PATH gets `⟦gh available through Keyward⟧`, which teaches the prefix, batching reads under one touch, and stopping on `keyward: not released:` without a retry (a locked screen does not clear by asking again, and a decline was the human's answer). Neither gets nothing, as before, and the gate still fails closed and never throws.
1228
+ - **Keyward is found by walking PATH for the file, never by running it.** Any `keyward` invocation that releases raises a Touch ID sheet, and a SessionStart hook fires on every start, resume, clear and compact.
1229
+ - **Waits moved to the server in both modes.** `frizzctl watch-pr add` / `watch-issue add` run on Frizz's own read-only GitHub credential, unattended and while the screen is locked, so both blocks, the `frizz:gh` skill and the Codex contract name them first. The bundled `ci-watch.mjs` / `review-watch.mjs` stay as the in-turn fallback where plain `gh` is signed in: Keyward releases to `gh` alone, so a script that runs `gh` itself gets no token under it.
1230
+ - **Rejected: running `keyward` to learn whether a release would work.** It is the one check that is accurate, and the one that puts a sheet on the screen at every session start.
@@ -54,7 +54,7 @@
54
54
  // tried and REMOVED on 2026-07-02 (maintainer's call): the block-until-file-edited nag forced even
55
55
  // trivial workers into Read/Edit dances that render as noise in the chat UI. This nudges; it never
56
56
  // blocks.
57
- import { readFileSync, writeFileSync, mkdirSync, statSync, readdirSync, openSync, readSync, closeSync } from 'node:fs';
57
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, statSync, readdirSync, openSync, readSync, closeSync } from 'node:fs';
58
58
  import { join } from 'node:path';
59
59
  import { currentSessionId } from '../scripts/frizz/config.mjs';
60
60
 
@@ -160,6 +160,13 @@ if (mode === 'subagent-start') {
160
160
  process.exit(0);
161
161
  }
162
162
 
163
+ // Claude Code fixes CLAUDE_PROJECT_DIR when the session starts, so it still names the old path after
164
+ // the project's folder is renamed. Writing there would `mkdir -p` an empty stub of the old folder, and
165
+ // Claude Code then moves the session's working directory into that stub. A folder that has gone gets
166
+ // nothing: Frizz leaves a link at the old path while a worker from before the rename runs, and retires
167
+ // the worker into the new folder at its next rest (packages/server/src/project-relocation.ts).
168
+ if (!existsSync(projectDir)) process.exit(0);
169
+
163
170
  // Ensure the directory exists so a first Write lands. frizz's dispatcher already provisions this for
164
171
  // a real thread; this only covers a session that started outside a dispatch.
165
172
  try {
@@ -23,7 +23,8 @@
23
23
  // A fresh worker never runs `frizz on`, so such a cc is already dormant; we write cc's own per-session
24
24
  // `off` sentinel anyway via the shared config API (board survives as cc-worker's board
25
25
  // implementation) so a stale install is guaranteed inert. Cheap belt-and-suspenders. See DECISIONS.md.
26
- import { readFileSync } from 'node:fs';
26
+ import { accessSync, constants, existsSync, readFileSync, statSync } from 'node:fs';
27
+ import { delimiter, join } from 'node:path';
27
28
  import { execFileSync } from 'node:child_process';
28
29
  import { setSessionOverride, currentSessionId } from '../scripts/frizz/config.mjs';
29
30
 
@@ -48,7 +49,9 @@ const dir = process.env.CLAUDE_PROJECT_DIR ?? '.';
48
49
  let sid = null;
49
50
  try {
50
51
  sid = currentSessionId(input.session_id);
51
- if (sid) setSessionOverride(dir, sid, 'off');
52
+ // Never into a project folder that has gone: CLAUDE_PROJECT_DIR keeps the old path after a rename,
53
+ // and the sentinel's `mkdir -p` would recreate it as an empty stub (see scratchpad.mjs).
54
+ if (sid && existsSync(dir)) setSessionOverride(dir, sid, 'off');
52
55
  } catch {
53
56
  /* best-effort — a failed sentinel write just leaves cc at its dormant default */
54
57
  }
@@ -74,30 +77,77 @@ const core =
74
77
  const grounding =
75
78
  '⟦frizz worker re-grounding (post-compaction)⟧ Context was just compacted. You are still the frizz worker for effort `' + thread + '` — read whatever you left yourself in `' + scratch + '` NOW to recover your working state and to-do list before asserting anything, and re-read any code before claiming how it is structured. Your system prompt still carries the full contract; sign off as it says.';
76
79
 
77
- // AUTH-GATED gh guidance — teach the worker to use `gh` well, but ONLY when signed in.
78
- // Shell `gh auth status --active`: exit 0 = an active gh account is authenticated. The whole gate is
79
- // wrapped so it can NEVER throw into SessionStart, and it fails CLOSED — no gh binary, not authed, a
80
- // stall past the timeout, or any other error → we inject NOTHING (guidance is absent, not stale/wrong).
81
- // It re-evaluates on every start/resume/clear/compact, so a later `gh auth login` starts injecting on
82
- // the next turn boundary (and a `gh auth logout` stops it). See DECISIONS.md / plan §8.
80
+ // AUTH-GATED gh guidance — teach the worker to use `gh` well, but ONLY when it can actually reach GitHub.
81
+ // TWO TIERS, checked in order (2026-11-04, see DECISIONS.md):
82
+ // 1. Plain `gh auth status --active` exits 0 — an active gh account is signed in, as on any machine
83
+ // that never adopted Keyward. Inject the plain block.
84
+ // 2. Otherwise, a `keyward` executable on PATH — the maintainer's Secure Enclave vault, which hands gh
85
+ // its token in `GH_TOKEN` for one run at a time, so plain gh is signed OUT by design. Inject the
86
+ // Keyward block: every gh command goes through `keyward --reason "…" -- gh …`.
87
+ // Neither → inject nothing. Tier 2 is found by walking PATH for the file, NEVER by running `keyward`:
88
+ // a release raises a Touch ID sheet, and a SessionStart hook must not put one on the maintainer's screen.
89
+ // The whole gate is wrapped so it can NEVER throw into SessionStart, and it fails CLOSED — no gh
90
+ // binary, a stall past the timeout, an unreadable PATH entry, or any other error → that tier is absent
91
+ // (guidance missing, not stale/wrong). It re-evaluates on every start/resume/clear/compact, so a later
92
+ // `gh auth login` or `gh auth logout` changes the block at the next turn boundary.
93
+ const ghReadOnly =
94
+ '• READ-ONLY BOUNDARY: never comment, label, assign, close, review, approve, or merge — no mutation of any kind — UNLESS the human explicitly asks in this session. Default to producing your findings/review as your final message, not as a GitHub post.\n';
95
+
83
96
  const ghBlock =
84
97
  '⟦gh available⟧ You are signed into the `gh` CLI and in a GitHub repo. Use `gh` EAGERLY and well — it is the fastest path to issue/PR/CI/release context, and you should reach for it before guessing:\n' +
85
98
  '• READ freely: `gh issue view N -R OWNER/REPO --comments`, `gh pr view N`, `gh pr diff N`, `gh pr checks N`, `gh run list`/`gh run view`, `gh api repos/OWNER/REPO/…`. Prefer `--json <fields>` over scraping human text.\n' +
86
99
  '• SEARCH across the repo (and GitHub) with `gh search issues`/`gh search prs` when hunting related work, duplicates, or prior art.\n' +
87
- '• READ-ONLY BOUNDARY: never comment, label, assign, close, review, approve, or merge — no mutation of any kind — UNLESS the human explicitly asks in this session. Default to producing your findings/review as your final message, not as a GitHub post.\n' +
88
- 'Load the `frizz:gh` skill for the full playbook (recipes + explicit project-local monitor selection + native Monitor/background-Bash CI/PR watches).';
100
+ ghReadOnly +
101
+ 'To wait on CI or reviews, register `frizzctl watch-pr add` / `frizzctl watch-issue add` rather than polling. Load the `frizz:gh` skill for the full playbook (recipes, waits, and the bundled monitors as a fallback).';
102
+
103
+ const ghKeywardBlock =
104
+ '⟦gh available through Keyward⟧ Plain `gh` is signed OUT here; Keyward, the human\'s vault, signs it in for one run at a time. Run EVERY gh command as `keyward --reason "<what this command is for>" -- gh …` (gh first after `--`, or right after a package runner such as `npx`). It is still the fastest path to issue/PR/CI/release context — reach for it before guessing:\n' +
105
+ '• One Touch ID covers this repository\'s gh runs for 10 minutes (less if the screen locks), so BATCH your gh reads together rather than spreading them out. Prefer `--json <fields>`.\n' +
106
+ '• On any stderr line starting `keyward: not released:` (screen locked, declined), STOP and report it to the human; NEVER retry. A locked screen does not clear by retrying, and a decline was their answer.\n' +
107
+ '• WAITS: register `frizzctl watch-pr add` / `frizzctl watch-issue add` for CI and reviews — Frizz\'s server watches on its own credential, even while the screen is locked. Never poll gh; the bundled ci-watch/review-watch monitors cannot sign in under Keyward.\n' +
108
+ ghReadOnly +
109
+ 'Load the `frizz:gh` skill for the full playbook (recipes and the exact Keyward failures).';
89
110
 
90
- let ghAuthed = false;
111
+ /** Whether `name` is an executable file in some PATH directory. Stats files only, runs nothing. */
112
+ function onPath(name) {
113
+ const win = process.platform === 'win32';
114
+ const exts = win ? (process.env.PATHEXT ?? '.EXE;.CMD;.BAT').split(';').filter(Boolean) : [''];
115
+ for (const d of (process.env.PATH ?? '').split(delimiter)) {
116
+ if (!d) continue;
117
+ for (const ext of exts) {
118
+ try {
119
+ const file = join(d, name + ext);
120
+ if (!statSync(file).isFile()) continue;
121
+ if (!win) accessSync(file, constants.X_OK);
122
+ return true;
123
+ } catch {
124
+ /* absent, unreadable or not executable → keep looking */
125
+ }
126
+ }
127
+ }
128
+ return false;
129
+ }
130
+
131
+ /** @type {'plain' | 'keyward' | null} */
132
+ let ghMode = null;
91
133
  try {
92
134
  execFileSync('gh', ['auth', 'status', '--active'], { stdio: 'ignore', timeout: 4000 });
93
- ghAuthed = true;
135
+ ghMode = 'plain';
94
136
  } catch {
95
- /* no gh / not authed / stalled → fail CLOSED: leave ghAuthed false, inject nothing */
137
+ /* no gh / not authed / stalled → fall through to the Keyward tier */
138
+ }
139
+ if (!ghMode) {
140
+ try {
141
+ if (onPath('keyward')) ghMode = 'keyward';
142
+ } catch {
143
+ /* fail CLOSED: inject nothing */
144
+ }
96
145
  }
97
146
 
98
147
  const parts = [core];
99
148
  if (input.source === 'compact') parts.push(grounding);
100
- if (ghAuthed) parts.push(ghBlock);
149
+ if (ghMode === 'plain') parts.push(ghBlock);
150
+ else if (ghMode === 'keyward') parts.push(ghKeywardBlock);
101
151
 
102
152
  process.stdout.write(
103
153
  JSON.stringify({
@@ -110,6 +110,48 @@ const SPAWN_THREAD = {
110
110
  },
111
111
  }
112
112
 
113
+ // CHILD THREADS (an experiment behind Settings → Child threads, 2026-11-04). The server's `spawnChild`
114
+ // (router.ts) is the whole of it; this is its spelling.
115
+ const SPAWN_CHILD = {
116
+ name: "spawn_child",
117
+ description:
118
+ "AN EXPERIMENT, switched on in Frizz's Settings (refused, exit 2, while it is off). Start a CHILD THREAD: a " +
119
+ "new thread on YOUR board, on Claude Code or Codex, that works for YOU. It is a full Frizz thread — its own " +
120
+ "session, scratch directory and watchers — dispatched like any other, so it runs on its harness's own runtime " +
121
+ "with the project's skills and instructions, and it can rest, own a PR watcher and be woken by it. What makes " +
122
+ "it a child: every rest of its that would have gone to the human's queue — its `done`, a `needs_input` " +
123
+ "handoff, a crash — is handed to YOU instead, as a message that wakes you, and it sits under your thread on " +
124
+ "the board rather than in the queue. Answer it, or give it more work, with `frizzctl steer <slug>`. Only a " +
125
+ "permission approval, a secret it needs and a usage-limit stop still go to the human directly. " +
126
+ "WHEN TO USE IT, and when not: an in-session sub-agent is still the tool for a helper that finishes inside your " +
127
+ "turn — a review, a research prong, a verification pass — because it is cheaper (no worker prompt, no cold " +
128
+ "start, no process of its own). A child thread is for work a sub-agent structurally cannot do: work that must " +
129
+ "REST and be woken (a pull request it opened and must shepherd through CI and review rounds), work on the OTHER " +
130
+ "harness, or work that must survive your process. Rest on a running child with `threads: [<slug>]` in your " +
131
+ "```awaiting fence. A child cannot start children of its own. You MUST choose `model` and `effort` by the " +
132
+ "child's task, as for `spawn-thread`.",
133
+ inputSchema: {
134
+ type: "object",
135
+ properties: {
136
+ prompt: {
137
+ type: "string",
138
+ description: "The full task for the child. Be self-contained — it starts with empty context, and is told it is your child.",
139
+ },
140
+ model: SPAWN_THREAD.inputSchema.properties.model,
141
+ effort: SPAWN_THREAD.inputSchema.properties.effort,
142
+ backend: {
143
+ type: "string",
144
+ enum: ["claude", "codex"],
145
+ description:
146
+ "Optional harness (default `claude`). If `codex`, `model` must be a codex model id. A child on your own " +
147
+ "harness starts in your current permission mode; one on the other starts in that harness's default.",
148
+ },
149
+ title: { type: "string", description: "Optional short title for the child (else derived from the prompt)." },
150
+ },
151
+ required: ["prompt", "model", "effort"],
152
+ },
153
+ }
154
+
113
155
  const GOAL = {
114
156
  name: "goal",
115
157
  description:
@@ -849,10 +891,12 @@ const MONITOR = {
849
891
  description:
850
892
  "WAKE ON EVERY LINE A LONG-RUNNING SCRIPT PRINTS. Give Frizz a script that keeps running and prints a " +
851
893
  "line each time something happens — a log tail filtered to the lines you would act on, a poll loop that " +
852
- "prints each new PR comment, a listener on a socket — and the SERVER runs it for you: every line it " +
853
- "prints on stdout wakes you with that line, for as long as `--for` lasts. Register once, woken many " +
854
- "times. Nothing of yours runs meanwhile, so your thread can hibernate while it rests; Claude Code's own " +
855
- "Monitor tool dies with your session after at most 30 minutes, and pins your process tree while it runs.\n\n" +
894
+ "prints each new row a query returns, a listener on a socket — and the SERVER runs it for you: every " +
895
+ "line it prints on stdout wakes you with that line, for as long as `--for` lasts. Register once, woken " +
896
+ "many times. Nothing of yours runs meanwhile, so your thread can hibernate while it rests; Claude Code's " +
897
+ "own Monitor tool lives in your session, pins your process tree while it runs, and dies with it. A pull " +
898
+ "request or an issue needs none of this: `watch-pr` and `watch-issue` already wake you on each comment, " +
899
+ "review and check.\n\n" +
856
900
  "STDOUT IS THE EVENT STREAM. Lines printed within 200ms of each other are one event; blank lines are " +
857
901
  "nothing. Stderr is never an event, but its tail is reported when the script exits — merge it with " +
858
902
  "`2>&1` into a filter if its failures are what you watch for. Every stage of a pipe must flush per line " +
@@ -865,7 +909,8 @@ const MONITOR = {
865
909
  "environment and PATH, stdin closed. Nothing your session exported, no aliases, no functions; use " +
866
910
  "absolute paths. Registration watches it for 2s: anything it prints by then, or its exit, is in the " +
867
911
  "reply instead of a wake. If Frizz restarts, the script is started again from the top — so make its " +
868
- "first lines harmless to repeat (baseline silently, then print only what is new).\n\n" +
912
+ "first lines harmless to repeat (baseline silently, then print only what is new: `tail -n0 -F` starts " +
913
+ "at the end of the file). What happened while it was down is the script's to catch up on, or missed.\n\n" +
869
914
  "IT ENDS when the script exits (you are woken once with the exit code and its last output), when " +
870
915
  "`--for` runs out, or when you drop it. A poll loop that should stop on a known end — a CI run " +
871
916
  "finishing — exits itself. ONLY ON A THREAD WITH NO PERMISSION CHECKS: Frizz refuses it unless this " +
@@ -890,8 +935,9 @@ const MONITOR = {
890
935
  description: {
891
936
  type: "string",
892
937
  description:
893
- "Optional for `add`, and worth giving: what it watches, in a few words (\"errors in deploy.log\", " +
894
- "\"new comments on acme/app#62\"). It labels every wake and the row the human sees.",
938
+ "Required for `add`. What it watches, in a few words, sentence case (\"Errors in deploy.log\", " +
939
+ "\"Failed jobs in jobs.ndjson\"): the name the human sees on its row and its drawer, and the label " +
940
+ "on every wake. Never the script itself.",
895
941
  },
896
942
  for: {
897
943
  type: "string",
@@ -951,11 +997,12 @@ const THREADS = {
951
997
  // WATCH_ISSUE rides at the END (2026-09-14), and SECRET, STEER, WATCH_COMMAND, MONITOR and THREADS after it: the tool list is
952
998
  // read by position in frizz-mcp.test.ts, and a worker's runtime reads it by name, so the order costs nothing and appending
953
999
  // breaks nothing.
954
- const TOOLS = [SPAWN_THREAD, GOAL, TIMER, WATCH_PR, WATCH, UNWATCH, ASK, UNASK, DONE, TITLE, ACTIVITY, LINK, UNLINK, WATCH_ISSUE, SECRET, STEER, WATCH_COMMAND, MONITOR, THREADS]
1000
+ const TOOLS = [SPAWN_THREAD, GOAL, TIMER, WATCH_PR, WATCH, UNWATCH, ASK, UNASK, DONE, TITLE, ACTIVITY, LINK, UNLINK, WATCH_ISSUE, SECRET, STEER, WATCH_COMMAND, MONITOR, THREADS, SPAWN_CHILD]
955
1001
 
956
1002
  /** @type {Record<string, (args: Record<string, unknown>) => Promise<string>>} */
957
1003
  const HANDLERS = {
958
1004
  [SPAWN_THREAD.name]: spawnThread,
1005
+ [SPAWN_CHILD.name]: spawnChild,
959
1006
  [GOAL.name]: goal,
960
1007
  [TIMER.name]: timer,
961
1008
  [WATCH_PR.name]: watchPr,
@@ -1071,6 +1118,11 @@ function threadFacts(t, nowMs) {
1071
1118
  if (t.questions > 0) facts.push(`${plural(t.questions, "question")} open`)
1072
1119
  if (t.subAgents > 0) facts.push(`${plural(t.subAgents, "sub-agent")} running`)
1073
1120
  if (t.shells > 0) facts.push(`${plural(t.shells, "shell")} running`)
1121
+ // Its child threads have no row of their own (they report to it, not to the human), so they are named here.
1122
+ if (Array.isArray(t.children) && t.children.length) {
1123
+ const busy = (/** @type {any} */ c) => c.runtime === "running" || c.runtime === "spawning"
1124
+ facts.push(`child threads: ${t.children.map((/** @type {any} */ c) => `${c.slug}${busy(c) ? " (turn in flight)" : ""}`).join(", ")}`)
1125
+ }
1074
1126
  for (const w of t.watches ?? []) facts.push(`watching ${w}`)
1075
1127
  if (t.limited) facts.push("stopped by a usage limit")
1076
1128
  else if (t.crashed) facts.push("crashed mid-turn")
@@ -1203,14 +1255,14 @@ async function activity() {
1203
1255
  // keys are PLURAL sequences, so an id printed on its own line is no longer something a worker can copy
1204
1256
  // into a fence — it has to see the shape. This command is where the contract sends a worker that has lost
1205
1257
  // an id, so printing the retired one-line-per-item form would teach the very grammar frizz refuses.
1206
- const byKind = { shell: [], agent: [], timer: [], pr: [], issue: [], command: [] }
1258
+ const byKind = { shell: [], agent: [], timer: [], pr: [], issue: [], command: [], thread: [] }
1207
1259
  for (const i of items) if (byKind[i.kind] && i.id) byKind[i.kind].push(i.id)
1208
- const block = Object.entries({ shells: byKind.shell, agents: byKind.agent, timers: byKind.timer, prs: byKind.pr, issues: byKind.issue, commands: byKind.command })
1260
+ const block = Object.entries({ shells: byKind.shell, agents: byKind.agent, timers: byKind.timer, prs: byKind.pr, issues: byKind.issue, commands: byKind.command, threads: byKind.thread })
1209
1261
  .filter(([, ids]) => ids.length > 0)
1210
1262
  .map(([key, ids]) => ` ${key}: [${ids.join(", ")}]`)
1211
1263
  // The template guesses `status:` from the kinds — a shell or a sub-agent is usually work that finishes
1212
1264
  // by itself, a PR, an issue or a timer a watch — and the prose tells the worker to correct it.
1213
- const status = byKind.shell.length + byKind.agent.length > 0 ? "working" : "watching"
1265
+ const status = byKind.shell.length + byKind.agent.length + byKind.thread.length > 0 ? "working" : "watching"
1214
1266
  return (
1215
1267
  `${items.length} thing${items.length === 1 ? "" : "s"} running on this thread:\n\n${lines.join("\n")}\n\n` +
1216
1268
  "Name the ones you are ACTUALLY waiting on in your ```awaiting fence. The frontmatter is YAML — one " +
@@ -1455,6 +1507,32 @@ async function spawnThread(args) {
1455
1507
  return spawnedReceipt(slug, typeof body.title === "string" ? body.title : slug, undefined)
1456
1508
  }
1457
1509
 
1510
+ async function spawnChild(args) {
1511
+ const prompt = typeof args.prompt === "string" ? args.prompt.trim() : ""
1512
+ if (!prompt) throw new Error("`prompt` is required and must be a non-empty string")
1513
+ const model = typeof args.model === "string" ? args.model.trim() : ""
1514
+ if (!model) throw new Error("`model` is required — choose one by the child's task (claude: opus/sonnet/haiku, opus being the top tier; codex: a gpt-5.6 model id). There is no default.")
1515
+ const effort = typeof args.effort === "string" ? args.effort.trim() : ""
1516
+ if (!effort) throw new Error("`effort` is required — choose one by complexity (low/medium/high/xhigh/max). There is no default.")
1517
+ /** @type {Record<string, unknown>} */
1518
+ const body = { prompt, model, effort, from: threadSlug() }
1519
+ const title = typeof args.title === "string" ? args.title.trim() : ""
1520
+ if (title) body.title = title
1521
+ if (args.backend === "claude" || args.backend === "codex") body.backend = args.backend
1522
+ // The server writes the footer that tells the child it is one (shared childThreadFooter): only it can
1523
+ // name this thread by its board title.
1524
+ const result = (await callRpc("spawnChild", body))?.result
1525
+ if (result?.refused) return new Refused(`NO CHILD WAS STARTED: ${result.refused}.`)
1526
+ if (typeof result?.slug !== "string" || !result.slug) throw new Error(`spawnChild returned no slug: ${JSON.stringify(result)?.slice(0, 300)}`)
1527
+ return (
1528
+ `Started child thread \`${result.slug}\`. It works for you: when it rests with a handoff — done, needing ` +
1529
+ `input, or stopped — Frizz hands it to you as a message that wakes you. Send it more with ` +
1530
+ `\`frizzctl steer ${result.slug} --message-file <file|->\`. To rest while it works, name it in your fence: ` +
1531
+ `\`threads: [${result.slug}]\`.\n\nIt sits under your thread on the board; this link opens it:\n\n` +
1532
+ `[${title || result.slug}](/thread/${result.slug})`
1533
+ )
1534
+ }
1535
+
1458
1536
  /** What the spawner reads back. `project` is the new thread's project slug when it is not ours.
1459
1537
  * @param {string} slug @param {string} label @param {string | undefined} project @returns {string} */
1460
1538
  function spawnedReceipt(slug, label, project) {
@@ -2288,8 +2366,9 @@ async function monitor(args) {
2288
2366
  if (!command) throw new Error("`command` is required — a script that keeps running and prints a line per event")
2289
2367
  const forValue = typeof args.for === "string" ? args.for.trim() : ""
2290
2368
  if (!forValue) throw new Error("`for` is required — how long to keep it running, a DURATION like `6h` or `3d` (max 7d)")
2291
- const description = typeof args.description === "string" && args.description.trim() ? args.description.trim() : undefined
2292
- const result = (await callRpc("addOwnMonitor", { slug, command, for: forValue, ...(description ? { description } : {}) }))?.result
2369
+ const description = typeof args.description === "string" ? args.description.trim() : ""
2370
+ if (!description) throw new Error("`description` is required — what it watches in a few words (\"Errors in deploy.log\"), the name the human sees on its row")
2371
+ const result = (await callRpc("addOwnMonitor", { slug, command, for: forValue, description }))?.result
2293
2372
  const printed = Array.isArray(result?.events) && result.events.length
2294
2373
  ? `\n\nIt printed in its first 2s (handed to you here, not as a wake):\n${result.events.map((e) => e.split("\n").map((l) => ` ${l}`).join("\n")).join("\n")}`
2295
2374
  : ""
@@ -2408,7 +2487,7 @@ const CLI = {
2408
2487
  positional: ["action"],
2409
2488
  then: { add: ["command"], drop: ["id"] },
2410
2489
  examples: [
2411
- 'frizzctl monitor add "tail -F /var/log/app.log | grep --line-buffered -E \'ERROR|FATAL\'" --description "errors in app.log" --for 1d',
2490
+ 'frizzctl monitor add "tail -n0 -F /var/log/app.log | grep --line-buffered -E \'ERROR|FATAL\'" --description "errors in app.log" --for 1d',
2412
2491
  "frizzctl monitor list",
2413
2492
  "frizzctl monitor drop cmw_ab12cd34ef56",
2414
2493
  ],
@@ -2488,6 +2567,14 @@ const CLI = {
2488
2567
  'frizzctl spawn-thread --project nub --model opus --effort high --title "Bump the SDK pin" --prompt-file prompt.md',
2489
2568
  ],
2490
2569
  },
2570
+ spawn_child: {
2571
+ group: "Other threads",
2572
+ summary: "Start a child thread that reports to this one (an experiment, off by default)",
2573
+ examples: [
2574
+ 'frizzctl spawn-child --model opus --effort high --title "Fix the resolver and shepherd its PR" --prompt-file prompt.md',
2575
+ 'frizzctl spawn-child --backend codex --model gpt-5.6-sol --effort high --prompt-file prompt.md',
2576
+ ],
2577
+ },
2491
2578
  }
2492
2579
 
2493
2580
  export { TOOLS, HANDLERS, CLI, Refused, doneOpenQuestionsRefusal }
@@ -1,16 +1,49 @@
1
1
  ---
2
2
  name: gh
3
- description: The gh-CLI playbook for a frizz worker signed into GitHub (invoke as frizz:gh). Load this whenever your effort touches GitHub — reading or triaging an issue or PR, reviewing a diff, checking CI/release status, or searching issues/PRs — to use `gh` eagerly and correctly: the read-vs-write boundary (never comment/label/close/merge unless the human asks), concrete read recipes, and active Monitor/background-Bash CI/PR watches. Only meaningful when you are signed in (`gh auth status --active` exit 0); the session-seed hook injects a pointer here when you are.
4
- version: 0.1.2
3
+ description: The gh-CLI playbook for a frizz worker that can reach GitHub (invoke as frizz:gh). Load this whenever your effort touches GitHub — reading or triaging an issue or PR, reviewing a diff, checking CI/release status, or searching issues/PRs — to use `gh` eagerly and correctly, either signed in directly or through Keyward (`keyward --reason "…" -- gh …`): the read-vs-write boundary (never comment/label/close/merge unless the human asks), concrete read recipes, Keyward's failure lines and what to do on each, and waiting on CI and reviews with `frizzctl watch-pr add` / `watch-issue add`. The session-seed hook injects a pointer here when plain `gh` is signed in (`⟦gh available⟧`) or when it is signed out and `keyward` is on PATH (`⟦gh available through Keyward⟧`).
4
+ version: 0.2.0
5
5
  metadata:
6
6
  internal: true
7
7
  ---
8
8
 
9
9
  # frizz:gh — the gh-CLI playbook
10
10
 
11
- You are a **frizz worker** and you are **signed into the `gh` CLI in a GitHub repo** (the session-seed hook confirmed `gh auth status --active` before pointing you here). `gh` is the fastest path to issue / PR / CI / release context — reach for it before guessing, and prefer it over scraping the web UI or reasoning from memory.
11
+ You are a **frizz worker in a GitHub repo, and `gh` can reach GitHub** — the session-seed hook checked before pointing you here. `gh` is the fastest path to issue / PR / CI / release context — reach for it before guessing, and prefer it over scraping the web UI or reasoning from memory.
12
12
 
13
- This skill is the full playbook the injected `⟦gh available⟧` block summarizes: the **read-vs-write boundary**, concrete **read recipes**, and how to keep a **CI/PR watch** active until the next actionable event.
13
+ This skill is the full playbook the injected block summarizes: **which of two modes you are in**, the **read-vs-write boundary**, concrete **read recipes**, and how to **wait on CI and reviews** until the next actionable event.
14
+
15
+ ## Two modes: signed in, or through Keyward
16
+
17
+ The injected block names your mode.
18
+
19
+ - **`⟦gh available⟧` — plain `gh` is signed in.** Run the recipes below as written.
20
+ - **`⟦gh available through Keyward⟧` — plain `gh` is signed OUT, by design.** Keyward is the human's Secure Enclave vault. It hands `gh` their token in `GH_TOKEN` for one run, and only for that run. Run **every** recipe below with this prefix:
21
+
22
+ ```bash
23
+ keyward --reason "<what this command is for, in a sentence>" -- gh issue view 123 -R OWNER/REPO --comments
24
+ ```
25
+
26
+ `gh` comes first after `--`, or right after a package runner (`npx`, `pnpm exec`, `nub exec`, `nubx`, `bunx`, `yarn dlx`, `npm exec`). The reason is shown on the human's Touch ID sheet, so write what they need to recognise the job; a run without `--reason` is refused before anything is asked. Otherwise the exit code is gh's own.
27
+
28
+ ### Working under Keyward
29
+
30
+ - **One Touch ID covers this repository's gh runs for 10 minutes**, ending early when the screen locks or the Mac sleeps. Batch your gh reads into one burst (the issue, its comments, the linked PR, its checks) rather than spreading them across the task, so each burst costs the human one touch.
31
+ - **Nothing is released while the screen is locked.** That includes the first run of a burst.
32
+ - **Don't check sign-in with `gh auth status` or `gh auth token`.** Plain `gh` is signed out here, so `gh auth status` reports no account even when Keyward would release, and `gh auth token` / `gh auth login` outside Keyward are refused. The injected block already tells you which mode you are in; to find out whether a release works, run the read you need.
33
+ - **Only `gh` itself is signed in.** `keyward -- node script.mjs` hands the script NOTHING, so a script that runs `gh` itself will not authenticate under Keyward. That includes the bundled `ci-watch.mjs` / `review-watch.mjs`. A form that hands a script the token, `keyward --reason "…" --token gh -- node <script>`, is PROVISIONAL and may change, and it asks for Touch ID on every run; use it only to run a repo script that has to call gh itself, never as a way to keep a monitor running.
34
+
35
+ ### What a refusal looks like
36
+
37
+ Each of these is printed on stderr and exits 1:
38
+
39
+ | stderr | What it means | What to do |
40
+ | --- | --- | --- |
41
+ | `keyward: not released: screen locked` (also `not at the console`, `screen state unreadable`) | Nobody is at the Mac to approve. | **Stop and report it to the human.** |
42
+ | `keyward: not released: declined or authentication failed` | The human said no, or Touch ID failed. | **Stop and report it to the human.** |
43
+ | `keyward: no gh sign-in for <repo> or globally: …` | Keyward holds no GitHub token for this repo. | Stop and report it; the human has to store one. |
44
+ | a refusal naming the missing `--reason` | Nothing was asked; a reason is required. | Add `--reason "…"` and run it again. |
45
+
46
+ **On any stderr line starting `keyward: not released:`, stop and report it to the human. Never retry.** A locked screen does not clear because you asked again, and a decline was the human's answer. Say which command you were trying to run and why, then carry on with whatever does not need GitHub, or come to rest saying what is blocked on it.
14
47
 
15
48
  ## The one hard rule — READ freely, WRITE only when asked
16
49
 
@@ -25,7 +58,7 @@ There is no server-side enforcement of this; the boundary is yours to hold.
25
58
 
26
59
  ## Read recipes
27
60
 
28
- Always scope with `-R OWNER/REPO` so a command is dir-independent, and prefer `--json <fields>` (+ `-q <jq>`) so you pull exactly what you need.
61
+ Always scope with `-R OWNER/REPO` so a command is dir-independent, and prefer `--json <fields>` (+ `-q <jq>`) so you pull exactly what you need. The recipes are written as plain `gh`; under Keyward, prefix each with `keyward --reason "…" -- `, and run related ones back to back so one Touch ID covers them.
29
62
 
30
63
  **Issues**
31
64
  ```bash
@@ -89,10 +122,38 @@ gh api "repos/OWNER/REPO/issues?state=open&labels=bug&per_page=50" --jq '.[] | {
89
122
  ## Keep GitHub automation active
90
123
 
91
124
  CI, automated review, releases, merge queues, and already-authorized merge progression are work you
92
- can observe with `gh`; they do not earn an `awaiting` fence. Keep a live operation attached to the
93
- thread and continue when it reports.
125
+ can observe; they do not earn a blind `awaiting` fence. Keep a live wait attached to the thread and
126
+ continue when it reports.
127
+
128
+ ### Wait on a PR or an issue with `frizzctl watch-pr` / `watch-issue`
129
+
130
+ This is the way to wait on CI and reviews, in both modes:
131
+
132
+ ```bash
133
+ frizzctl watch-pr add OWNER/REPO#NUMBER --for 6h # your own PR; MONTHS (180d) for someone else's
134
+ frizzctl watch-issue add OWNER/REPO#NUMBER --for 30d
135
+ ```
136
+
137
+ Frizz's SERVER runs these watches on its own read-only GitHub credential. They need no `gh` sign-in
138
+ from you, keep running while the screen is locked and across restarts, and cost no Touch ID. Register
139
+ the PR, then rest with it in the fence's `prs:` list (`prs: [OWNER/REPO#NUMBER]`) and the same long
140
+ `for:`: Frizz baselines current reviews/comments and wakes you on CI turning green or red and on ANY
141
+ new review or comment after registration — bot or human. The registration creates the wait; the fence
142
+ only declares it. A GitHub ISSUE — a reporter you asked for a reproduction, a maintainer you asked to
143
+ triage — is `frizzctl watch-issue add`, named in the fence's `issues:` list: it wakes you on every later
144
+ comment, on a label or assignee change, and when the issue closes. `frizzctl watch-pr --help` has the rest.
145
+
146
+ If a specific external human reviewer/approver is the only remaining gate, that is a question for the
147
+ human (a ` ```question ` fence) — waiting on a person is never a park. The dashboard operator's own
148
+ go/no-go remains a registered question. If the next check deliberately belongs at a named wall-clock
149
+ instant, set a durable timer with `frizzctl timer set` and park with its id in your fence's `timers:` list.
150
+
151
+ ### Watching inside a turn — only where plain `gh` is signed in
94
152
 
95
- ### Select monitor tooling explicitly
153
+ Sometimes you want the verdict inside the turn you are in, not as a wake after a rest: a CI run you
154
+ are about to read the logs of. That takes a session-bound monitor, and it needs a signed-in plain `gh`.
155
+ **Under Keyward, don't: the monitors and a `gh run watch` loop cannot authenticate there.** Register
156
+ `frizzctl watch-pr add` and rest instead.
96
157
 
97
158
  Before launching any CI/review monitor, inspect project-local `AGENTS.md`, active skills, repository
98
159
  docs, `package.json` scripts, and declared monitor tooling. Prefer an explicit project-local monitor
@@ -103,7 +164,7 @@ never execute a monitor merely because its filename looks plausible.
103
164
 
104
165
  When no project monitor is declared, the bundled fallback scripts are
105
166
  `<this-skill-dir>/scripts/ci-watch.mjs` and `review-watch.mjs`. They are generated byte-for-byte from
106
- Frizz's canonical `monitors/` source and require only Node plus logged-in `gh`. Their stdout is
167
+ Frizz's canonical `monitors/` source and require only Node plus a signed-in plain `gh`. Their stdout is
107
168
  `frizz.github-monitor/v1` NDJSON: `status` means keep waiting; `terminal` is a verdict. They join
108
169
  exact-head workflow runs with PR checks, keeping `ACTION_REQUIRED` pending, and baseline every review
109
170
  and comment so any new one wakes — bot or human, with no actor
@@ -124,16 +185,8 @@ such as `push` and `pull_request` both contribute to the aggregate verdict.
124
185
  - A background Bash launch exposes an output-file path. Use `Read` on that path only for diagnostics;
125
186
  `TaskOutput` is deprecated. Do not fake waiting with `echo waiting` or sleep-only Bash calls.
126
187
 
127
- Both mechanisms are session-bound. If the next check deliberately belongs at a named wall-clock
128
- instant, set a durable timer with `frizzctl timer set` and park with its id in your fence's `timers:`
129
- list. If a specific external human reviewer/approver is the only remaining gate, that is a
130
- question for the human (a ` ```question ` fence) — waiting on a person is never a park. For a GitHub PR, register it with
131
- `frizzctl watch-pr add` and name it in the fence's `prs:` list (`prs: [OWNER/REPO#NUMBER]`): frizz
132
- baselines current reviews/comments and wakes on ANY new activity after registration — bot or human —
133
- durably across restarts. The registration creates the wait; the fence only declares it. For a GitHub ISSUE — a
134
- reporter you asked for a reproduction, a maintainer you asked to triage — register it with `frizzctl watch-issue add` and
135
- name it in the fence's `issues:` list (`issues: [OWNER/REPO#NUMBER]`): frizz wakes you on every later comment, on a label
136
- or assignee change, and when the issue closes. The dashboard operator's own go/no-go remains a registered question.
188
+ Both mechanisms are session-bound: they die with the session, and a rest does not wait on them. A wait
189
+ you rest on is `frizzctl watch-pr` / `watch-issue`.
137
190
 
138
191
  ## Fitting gh work into your thread type
139
192
 
@@ -1 +1 @@
1
- import{m as e,t}from"./mermaid-parser.core-1DKULFlf.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-CkPXvRdk.js";import"./chunk-WYO6CB5R-DvwyN_Z1.js";import"./chunk-VAUOI2AC-_LdsfMm9.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-cR_XVznl.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
1
+ import{m as e,t}from"./mermaid-parser.core-BJDWCQPF.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-CeayMM0l.js";import"./chunk-WYO6CB5R-CFzJhIFb.js";import"./chunk-VAUOI2AC-IhEj8PHl.js";import{n as i,r as a,t as o}from"./chunk-MOJQB5TN-B5dCeSWz.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=n(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
@@ -1 +1 @@
1
- import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-CdXepqKz.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{n as e,t}from"./path-BWPyau1x.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-D2xRtqvF.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i)if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-BfrZ3jm6.js";import{M as e}from"./mermaid-parser.core-BJDWCQPF.js";export{e as createArchitectureServices};