geneseed 5.3.1 → 5.5.0

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 (248) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/README.md +51 -18
  3. package/SHIPPED.md +7 -7
  4. package/adapters/bob/README.md +12 -1
  5. package/adapters/opencode/README.md +5 -3
  6. package/adapters/opencode/plugins/geneseed-context.js +77 -10
  7. package/adapters/opencode/plugins/geneseed-guard.js +106 -22
  8. package/adapters/opencode/plugins/geneseed-learn.js +641 -6
  9. package/bin/geneseed-cli.mjs +10 -0
  10. package/bin/geneseed-hook.mjs +5 -4
  11. package/docs/PRD.md +1 -1
  12. package/docs/README.md +1 -0
  13. package/docs/concepts/agents.md +14 -2
  14. package/docs/concepts/collaboration.md +2 -2
  15. package/docs/concepts/enforcement-table.md +5 -2
  16. package/docs/concepts/exclusions.md +16 -2
  17. package/docs/concepts/footprint.md +1 -1
  18. package/docs/concepts/foreman-mode.md +23 -4
  19. package/docs/concepts/hook-gates.md +4 -4
  20. package/docs/concepts/hooks.md +25 -7
  21. package/docs/concepts/host-matrix.md +4 -4
  22. package/docs/concepts/hosts.md +1 -1
  23. package/docs/concepts/kits.md +12 -2
  24. package/docs/concepts/loop-bricks.md +3 -3
  25. package/docs/concepts/loops.md +6 -4
  26. package/docs/concepts/ownership.md +1 -1
  27. package/docs/concepts/rules.md +2 -2
  28. package/docs/concepts/shared-tier.md +1 -1
  29. package/docs/concepts/skills.md +21 -1
  30. package/docs/concepts/themes.md +1 -1
  31. package/docs/extending.md +73 -29
  32. package/docs/guides/auto-merge.md +100 -0
  33. package/docs/guides/choose-your-setup.md +1 -1
  34. package/docs/guides/headless.md +1 -1
  35. package/docs/guides/install-clone.md +19 -1
  36. package/docs/guides/install-scripted.md +8 -2
  37. package/docs/guides/install.md +20 -2
  38. package/docs/guides/loop-finish.md +3 -3
  39. package/docs/guides/loop-running.md +4 -4
  40. package/docs/guides/project-context.md +1 -1
  41. package/docs/guides/run-a-factory.md +2 -2
  42. package/docs/guides/setup-doctrines.md +2 -2
  43. package/docs/guides/setup-footprint.md +1 -1
  44. package/docs/guides/uninstall.md +3 -3
  45. package/docs/guides/upgrade.md +2 -2
  46. package/docs/guides/worktree.md +1 -1
  47. package/docs/reference/env-context.md +1 -1
  48. package/docs/reference/environment.md +4 -2
  49. package/docs/reference/plugin-activity.md +1 -1
  50. package/docs/reference/plugin-guard.md +1 -1
  51. package/docs/reference/plugin-learn.md +5 -1
  52. package/docs/reference/plugin-workflow.md +1 -1
  53. package/docs/reference/profiles.md +142 -0
  54. package/docs/reference/troubleshoot-doctor.md +1 -1
  55. package/docs/reference/troubleshoot-hooks.md +2 -2
  56. package/docs/reference/troubleshoot-install.md +3 -3
  57. package/docs/reference/troubleshoot-tools.md +1 -1
  58. package/docs/token-footprint.md +11 -6
  59. package/docs/understand/design-choices-engineering.md +1 -1
  60. package/docs/understand/enforced-vs-asked.md +1 -1
  61. package/docs/understand/machine-claude.md +2 -2
  62. package/docs/understand/on-your-machine.md +1 -1
  63. package/docs/web-ui.md +8 -6
  64. package/harness.config.json +1 -1
  65. package/js/README.md +11 -3
  66. package/js/build/args.mjs +16 -4
  67. package/js/build/catalog.mjs +11 -1
  68. package/js/build/driver.mjs +74 -16
  69. package/js/build/emit-claude.mjs +32 -5
  70. package/js/build/emit-opencode.mjs +16 -9
  71. package/js/build/export.mjs +1 -1
  72. package/js/build/generate.mjs +12 -157
  73. package/js/build/notes-migrate.mjs +99 -0
  74. package/js/build/profile.mjs +326 -0
  75. package/js/build/render.mjs +110 -8
  76. package/js/build/retired-skills.mjs +60 -13
  77. package/js/build/source.mjs +100 -3
  78. package/js/build/stubs.mjs +4 -1
  79. package/js/cli-table.json +212 -7
  80. package/js/hosts/agent-runs.mjs +205 -0
  81. package/js/hosts/done-checks.mjs +3 -1
  82. package/js/hosts/hooks-done.mjs +428 -63
  83. package/js/hosts/hooks-learn.mjs +89 -3
  84. package/js/hosts/hooks-prims.mjs +44 -4
  85. package/js/hosts/hooks.mjs +159 -9
  86. package/js/hosts/hosts.mjs +10 -0
  87. package/js/hosts/installs.mjs +44 -2
  88. package/js/hosts/link.mjs +45 -10
  89. package/js/hosts/native.mjs +61 -7
  90. package/js/hosts/opencode.mjs +1 -1
  91. package/js/hosts/settings.mjs +101 -3
  92. package/js/hosts/spec-feedback.mjs +538 -0
  93. package/js/hosts/usage.mjs +67 -8
  94. package/js/inspect/agent-scores.mjs +118 -0
  95. package/js/inspect/checks-authoring.mjs +2 -1
  96. package/js/inspect/checks-build.mjs +20 -4
  97. package/js/inspect/checks-constitution.mjs +32 -0
  98. package/js/inspect/checks-repo.mjs +27 -2
  99. package/js/inspect/cost.mjs +6 -5
  100. package/js/inspect/diff.mjs +46 -8
  101. package/js/inspect/doctor.mjs +4 -0
  102. package/js/inspect/inventory.mjs +1 -1
  103. package/js/inspect/status.mjs +3 -1
  104. package/js/inspect/validate.mjs +1 -0
  105. package/js/lib/machine-dir.mjs +8 -0
  106. package/js/lib/paths.mjs +4 -1
  107. package/js/maintain/profile-scope.mjs +145 -0
  108. package/js/maintain/profiles.mjs +486 -0
  109. package/js/maintain/setup.mjs +413 -15
  110. package/js/maintain/uninstall.mjs +4 -1
  111. package/js/maintain/update.mjs +4 -2
  112. package/js/web/actions.mjs +44 -41
  113. package/js/web/api.mjs +13 -3
  114. package/js/web/handler.mjs +8 -0
  115. package/js/web/jobs.mjs +5 -4
  116. package/js/web/profiles-api.mjs +201 -0
  117. package/js/web/routes.mjs +5 -0
  118. package/package.json +2 -1
  119. package/profiles/guillaume-claude-global.json +16 -0
  120. package/profiles/starter.json +14 -0
  121. package/registry.json +14 -0
  122. package/src/AGENT.md.tmpl +16 -18
  123. package/src/agents/_self-improvement.md +15 -7
  124. package/src/agents/_template.md +4 -2
  125. package/src/agents/advocate.md +1 -1
  126. package/src/agents/architect.md +1 -1
  127. package/src/agents/developer.md +10 -3
  128. package/src/agents/devops-engineer.md +1 -1
  129. package/src/agents/docker-expert.md +1 -1
  130. package/src/agents/docs.md +1 -1
  131. package/src/agents/empiricist.md +1 -1
  132. package/src/agents/explorer.md +4 -2
  133. package/src/agents/framer.md +1 -1
  134. package/src/agents/historian.md +1 -1
  135. package/src/agents/kubernetes-specialist.md +1 -1
  136. package/src/agents/memory-curator.md +1 -1
  137. package/src/agents/operator.md +1 -1
  138. package/src/agents/performance.md +1 -1
  139. package/src/agents/pragmatist.md +1 -1
  140. package/src/agents/react-engineer.md +1 -1
  141. package/src/agents/react-reviewer.md +1 -1
  142. package/src/agents/researcher.md +1 -1
  143. package/src/agents/reviewer.md +10 -3
  144. package/src/agents/security.md +1 -1
  145. package/src/agents/skeptic.md +1 -1
  146. package/src/agents/spring-boot-engineer.md +1 -1
  147. package/src/agents/spring-reviewer.md +1 -1
  148. package/src/agents/spring-security.md +1 -1
  149. package/src/agents/steward.md +1 -1
  150. package/src/agents/tester.md +4 -2
  151. package/src/agents/user-advocate.md +1 -1
  152. package/src/agents/visionary.md +1 -1
  153. package/src/bricks/pr-open.md +3 -2
  154. package/src/doctrines/ops.md +2 -2
  155. package/src/doctrines/process.md +40 -36
  156. package/src/factories/analysis-to-build.json +1 -1
  157. package/src/factories/bug-report-to-fix.json +1 -1
  158. package/src/factories/issue-to-pr.json +1 -1
  159. package/src/kits/terminal-tools/rules.md +10 -0
  160. package/src/kits/terminal-tools.json +13 -0
  161. package/src/licenses/herdr.txt +201 -0
  162. package/src/memory/README.md +12 -2
  163. package/src/modes/foreman.md +25 -9
  164. package/src/skill-descriptions.json +63 -0
  165. package/src/skills/_self-improvement.md +42 -24
  166. package/src/skills/_template.md +3 -1
  167. package/src/skills/brainstorm.md +35 -22
  168. package/src/skills/commit.md +17 -17
  169. package/src/skills/daydream/VENDOR.md +6 -0
  170. package/src/skills/debug/ci.md +1 -1
  171. package/src/skills/dependencies.md +3 -3
  172. package/src/skills/diagram-design/VENDOR.md +4 -0
  173. package/src/skills/document-project.md +3 -2
  174. package/src/skills/explain-changes/VENDOR.md +5 -1
  175. package/src/skills/factory.md +13 -4
  176. package/src/skills/geneseed.md +4 -2
  177. package/src/skills/git-history.md +5 -7
  178. package/src/skills/herdr.md +135 -0
  179. package/src/skills/loop.md +3 -2
  180. package/src/skills/opencode-cli.md +84 -0
  181. package/src/skills/parallel-agents.md +11 -0
  182. package/src/skills/pipeline.md +3 -3
  183. package/src/skills/plan.md +5 -4
  184. package/src/skills/react-view-transitions/VENDOR.md +7 -1
  185. package/src/skills/release.md +11 -9
  186. package/src/skills/review-response.md +4 -2
  187. package/src/skills/rule/approve.md +2 -1
  188. package/src/skills/rule.md +27 -1
  189. package/src/skills/ship.md +54 -7
  190. package/src/skills/skill-forge.md +5 -3
  191. package/src/skills/token-report/VENDOR.md +5 -1
  192. package/src/skills/worktree.md +2 -2
  193. package/src/upstreams.json +9 -2
  194. package/themes/README.md +3 -1
  195. package/themes/_TEMPLATE.json +2 -0
  196. package/themes/biker.json +2 -0
  197. package/themes/commentator.json +2 -0
  198. package/themes/cyberpunk.json +2 -0
  199. package/themes/gamer.json +2 -0
  200. package/themes/imperial.json +2 -0
  201. package/themes/joker.json +2 -0
  202. package/themes/marvin.json +2 -0
  203. package/themes/mean.json +2 -0
  204. package/themes/military.json +2 -0
  205. package/themes/neutral.json +2 -0
  206. package/themes/pirate.json +2 -0
  207. package/themes/sports.json +2 -0
  208. package/themes/verstappen.json +2 -0
  209. package/themes/wizard.json +2 -0
  210. package/web/dist/assets/{ActiveLoops-BJJN3P-V.js → ActiveLoops-DOJCPPPc.js} +1 -1
  211. package/web/dist/assets/Activity-LKsDzsnK.js +1 -0
  212. package/web/dist/assets/ActivityDetail-DhwTfPm6.js +1 -0
  213. package/web/dist/assets/{Bonsai-BBl4XXqs.js → Bonsai-CePMLrpr.js} +1 -1
  214. package/web/dist/assets/{CopyButton-Beven8yn.js → CopyButton-CuoaJ6k7.js} +1 -1
  215. package/web/dist/assets/Dashboard-D1VKuvLe.js +2 -0
  216. package/web/dist/assets/Docs-CUrHJKaU.js +5 -0
  217. package/web/dist/assets/Factories-Ci1XfmSy.js +1 -0
  218. package/web/dist/assets/{GreenhouseView-Bce212qd.js → GreenhouseView-CNfH2lPK.js} +1 -1
  219. package/web/dist/assets/Installs-ZHQZM1iS.js +3 -0
  220. package/web/dist/assets/{JournalView-CV4omyww.js → JournalView-CMsWahkS.js} +1 -1
  221. package/web/dist/assets/Kits-CkliyK0n.js +1 -0
  222. package/web/dist/assets/Laws-hh4O3HZ4.js +4 -0
  223. package/web/dist/assets/{LibRows-Dag1s0ZX.js → LibRows-Brv0Hmkr.js} +1 -1
  224. package/web/dist/assets/Library-BYmiLjJr.js +3 -0
  225. package/web/dist/assets/Loops-ytm-xJ68.js +2 -0
  226. package/web/dist/assets/{OperatorHudView-JmYY1pBR.js → OperatorHudView-KaqCx_HP.js} +1 -1
  227. package/web/dist/assets/Personal-CmcnRKYE.js +2 -0
  228. package/web/dist/assets/Settings-tUrpdOfq.js +1 -0
  229. package/web/dist/assets/{Tabs-8zsyEPSK.js → Tabs-CD7etcGD.js} +1 -1
  230. package/web/dist/assets/api-CZ-x0iWG.js +1 -0
  231. package/web/dist/assets/{controls-D4wmg_pl.js → controls-CK7qHA8H.js} +1 -1
  232. package/web/dist/assets/{index-CRWqKxfY.css → index-Ba_Kg3Af.css} +1 -1
  233. package/web/dist/assets/index-COKbhFNo.js +6 -0
  234. package/web/dist/index.html +3 -3
  235. package/web/dist/assets/Activity-WQ3ykgxU.js +0 -1
  236. package/web/dist/assets/ActivityDetail-7rt04SkS.js +0 -1
  237. package/web/dist/assets/Dashboard-BgLArtgu.js +0 -2
  238. package/web/dist/assets/Docs-B5aHp86J.js +0 -5
  239. package/web/dist/assets/Factories-BjqzXAw8.js +0 -1
  240. package/web/dist/assets/Installs-B1OsrHXF.js +0 -3
  241. package/web/dist/assets/Kits-CW1e7xNa.js +0 -1
  242. package/web/dist/assets/Laws-1Ckf1lbs.js +0 -4
  243. package/web/dist/assets/Library-B3FuFLel.js +0 -3
  244. package/web/dist/assets/Loops-CwqgnLNw.js +0 -2
  245. package/web/dist/assets/Personal-DKLgLa7Z.js +0 -2
  246. package/web/dist/assets/Settings-BwErnh-R.js +0 -1
  247. package/web/dist/assets/api-DLDVY3K-.js +0 -1
  248. package/web/dist/assets/index-Ce6qF2nG.js +0 -6
@@ -25,8 +25,8 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
25
25
 
26
26
  ## Procedure
27
27
 
28
- 1. Take the trigger as given: the user's request for a crew, or foreman's judgement that the task needs several specialists. Do not weigh it again and fall back to doing the work yourself.
29
- 2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, and the rule that it commits only in its own worktree, never pushes, and never merges outside its own branch. Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead. **Then watch what you dispatched.** An envelope without proof, or one that says the crew is still waiting, is a failure: act on it at once — resume the crew lead (`SendMessage` on Claude Code) or take over its worktree — never wait for a notification it promised. A crew member's report that reaches you directly means its crew lead has already ended; act on it the same way. Set no timer to watch a crew: where the host re-invokes you when a background agent ends (Claude Code), that notification is the watch; check every crew still out at the start of every turn. A crew is stalled when its transcript and output have not grown for 15 minutes **and** it has no live child process: ping it once; if the next check shows no change, stop it, then take over from its worktree. A crew whose output still grows, or that runs a child process, is never taken over — a long suite or canary is not a stall.
28
+ 1. Take the trigger as given: the user's request for a crew, or foreman's judgement that the task needs several specialists. Do not weigh it again and fall back to doing the work yourself. Where you hold no dispatch tool, you are the crew lead: play each role in turn in one tree, and say so.
29
+ 2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, the rule that it commits only in its own worktree, never pushes, and never merges outside its own branch, and the **Brief checklist** in [parallel-agents](parallel-agents.md). Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead. **Then watch what you dispatched.** An envelope without proof, or one that says the crew is still waiting, is a failure: act on it at once — resume the crew lead (`SendMessage` on Claude Code, and on OpenClaude in its agent-teams mode; on OpenCode the `subagent` tool with its `sessionID`, V1 `task` with `task_id`) or, where the host has no resume (Bob, OpenClaude without agent teams), take over its worktree — never wait for a notification it promised. A crew member's report that reaches you directly means its crew lead has already ended; act on it the same way. Set no timer to watch a crew: where the host re-invokes you when a background agent ends (Claude Code), that notification is the watch; check every crew still out at the start of every turn. A crew is stalled when its transcript and output have not grown for 15 minutes **and** it has no live child process: ping it once; if the next check shows no change, stop it, then take over from its worktree. A crew whose output still grows, or that runs a child process, is never taken over — a long suite or canary is not a stall.
30
30
  3. **The crew lead composes the crew** from the floor above and adds any {{AGENT}} the task needs. It dispatches each crew member as its own subagent, each handed what the previous one produced. **The crew lead never ends with a member unresolved.** Its last message is its result: once it ends, nothing wakes it, and a member that outlives it reports past it, to the parent. It may run members in parallel, but holds every member's result before it ends — returned, or failed and then redone or named as failed in the envelope. A member that returns nothing has failed. Where the crew lead holds no dispatch tool (see *Hosts* below), it plays each role in turn itself, with the same hand-offs and the same envelope. Steps 4 to 7 are the crew lead's, except where they name the parent.
31
31
  4. Isolate the crew's work in its own git worktree/branch. Where worktrees are unavailable, fall back to a single tree, one pipeline at a time, and say so; without a worktree, the crew never commits. The crew writes only inside its write set; shared append files (registries, index tables, lockfiles, generated bundles) are the parent's to apply, never a crew's.
32
32
  5. **The dev↔tester loop:** the developer implements, the tester validates — runs the tests and lint, produces raw logs. On failure, the findings go back to the developer — two repair rounds at most, then one fresh developer (a higher model tier where the host offers one) carrying the tester's findings ({{DOCTRINE:bound-the-loop}}); if that fails too, stop, do not merge, and report the failure with the branch left in place for inspection. A conflict or ambiguity between the plan, the findings and the code is yours to decide: decide it, record `Ruling: <choice> — <why> — <cost if wrong>` in the worklog, and continue. Stop only for what {{LAW:echo-the-intent}}, {{LAW:deletion-is-deliberate}} or {{DOCTRINE:consent-before-push}} names; every ruling goes in the final report ({{DOCTRINE:declare-the-judgment-calls}}). When the plan names a `Spec:`, the analyst reads it once; the spec outranks the plan.
@@ -40,7 +40,7 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
40
40
  | Claude Code | yes — a subagent started from the main conversation runs in the background by default | yes — the install caps nesting at two layers (`env.CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH = "2"`; Claude Code allows three by default), and a background subagent keeps the `Agent` tool | crew lead → crew subagents. Not the `Workflow` tool: it refuses without the user's opt-in for that task, and the mode is not one |
41
41
  | OpenCode | the `task` tool starts a child session; whether the parent's turn waits is unverified | unverified — `permission.task` decides which subagents an agent may start; the install caps nesting at two (`subagent_depth: 2`) | crew lead → crew subagents where it holds `task`; else roles in turn. A saved `workflow` script (no opt-in needed) may stand in for the crew lead |
42
42
  | OpenClaude | expected as Claude Code (it reads Claude's subagent dialect); unverified | unverified | as Claude Code; else roles in turn |
43
- | Bob | unverified — Bob reads Claude's subagent dialect | unverified | crew lead plays the roles in turn |
43
+ | Bob | unverified on Bob IDE, where `spawn_subagent` exists only in a mode whose groups hold `subagent`; Bob Shell has no subagents (reported by Bob Shell itself, not read in code) | no — a Bob subagent cannot spawn subagents (`spawn_subagent` is forbidden to subagents, Bob IDE 2.2.3), and Bob Shell has none | crew lead plays the roles in turn; where the session cannot start a writing subagent (Bob Shell; `ask` mode, which may start only `explore`), the session is the crew lead and plays them in one tree |
44
44
 
45
45
  Check, do not assume: before the first pipeline of a session on a host marked unverified, look at the tools you and the crew lead actually hold ({{DOCTRINE:tool-discovery}}). When a fact above proves wrong, report it through this {{SKILL}}'s self-improvement loop.
46
46
 
@@ -15,8 +15,9 @@
15
15
  [brainstorm {{SKILL}}](brainstorm.md) first rather than planning blind. Otherwise
16
16
  restate the goal in one line. Either way, confirm the actual starting state before
17
17
  designing the steps ({{LAW:verify-before-asserting}} — verify before designing).
18
- 2. Write a numbered plan to `WORKLOG.md` (or `plans/<task>.md`) in your {{NOTEBOOK}}
19
- (§6) — into the repository only when the user asks. A worker or slice
18
+ 2. Write a numbered plan beside its spec, in the project's spec or plan home (e.g.
19
+ `docs/plans/`) when one exists; else to `WORKLOG.md` (or `plans/<task>.md`) in your
20
+ {{NOTEBOOK}} (§6). A worker or slice
20
21
  in another worktree cannot see the {{NOTEBOOK}}, so its brief carries the plan's path
21
22
  or text. The plan holds ordered steps, each
22
23
  independently checkable. Group the steps into milestones — coherent chunks after
@@ -55,7 +56,7 @@
55
56
 
56
57
  > The worklog is external memory: it lets a context-limited agent recover its
57
58
  > place after the window fills, and lets the user correct course early. The
58
- > {{NOTEBOOK}} is git-ignored; a worklog the user asked for in the repository is
59
- > committed or ignored as they decide.
59
+ > {{NOTEBOOK}} is git-ignored; a plan in the project's own spec or plan home is
60
+ > tracked there like its spec.
60
61
 
61
62
  <!-- INCLUDE: skills/_self-improvement.md -->
@@ -1,6 +1,6 @@
1
1
  # Vendored skill — react-view-transitions
2
2
 
3
- This folder is a third-party skill vendored **verbatim** (the frontmatter lines below aside) into Geneseed, not a
3
+ This folder is a third-party skill vendored into Geneseed with the deviations listed below, not a
4
4
  Geneseed-authored skill. It rides along in the rendered bundle and is exempt from
5
5
  Geneseed's authoring gates (token, dead-link, hermeticity, skill counts) — it is
6
6
  listed in the generator's `VENDORED_SKILL_DIRS`.
@@ -36,3 +36,9 @@ all-in-one copy, IS kept — `SKILL.md`'s closing section points the agent at it
36
36
  `SKILL.md`'s frontmatter also carries `disable-model-invocation: true`, which upstream lacks: the
37
37
  skill is user-only (`/react-view-transitions`), so its description stays out of the model's always-on catalogue —
38
38
  it is the largest skill and serves one stack. Re-apply it on update.
39
+
40
+ **Deviation 3, at emit time:** the emit replaces `SKILL.md`'s `description:` with the skill's
41
+ line in `src/skill-descriptions.json` (at most 80 characters: the host's skill listing has a
42
+ budget) and keeps the description written here as the first body line, a blockquote
43
+ (`vendoredWithCatalogueLine`, `js/hosts/native.mjs`). This file is not changed; nothing to
44
+ re-apply on update.
@@ -2,7 +2,8 @@
2
2
 
3
3
  > {{DESC_RELEASE}}
4
4
 
5
- **Trigger:** cutting a release — a version bump, a changelog entry, and a tag.
5
+ **Trigger:** the user asks to cut or publish a release — a version bump, a changelog entry,
6
+ and a tag. Finished work is not that ask: never start a release unasked.
6
7
 
7
8
  ## Procedure
8
9
  1. Decide the version from the changes since the last tag, following the project's
@@ -15,15 +16,16 @@
15
16
  3. Update the changelog: a dated section for the new version summarising the
16
17
  user-visible changes, grouped (added / changed / fixed), derived from the commits
17
18
  since the last tag.
18
- 4. Commit the version bump and changelog as one focused commit, through the
19
- [commit {{SKILL}}](commit.md) — summary and exact message presented for
20
- acceptance ({{LAW:one-intent-one-act}}, {{DOCTRINE:consent-before-push}}).
19
+ 4. Commit the version bump and changelog as one focused commit on a release branch,
20
+ through the [commit {{SKILL}}](commit.md) ({{LAW:one-intent-one-act}}), and land it on
21
+ the main branch through a pull request with green checks ({{DOCTRINE:consent-before-push}}).
22
+ Land that pull request by arming the forge's auto-merge (`gh pr merge --squash --auto`);
23
+ never `--admin`, never a direct push to main.
21
24
  5. Tag the release (annotated, matching the version). Tagging and publishing are
22
- **outward-facing** ({{LAW:deletion-is-deliberate}}), and the push itself needs explicit
23
- per-push acceptance — a release lands on a shared branch, where {{DOCTRINE:consent-before-push}}
24
- applies with extra care and grants no standing consent.
25
- 6. With that acceptance, push the commit and the tag together; trigger or verify
26
- the publish/release pipeline.
25
+ **outward-facing** and need the user's explicit acceptance ({{LAW:deletion-is-deliberate}}).
26
+ 6. With that acceptance, push the tag; trigger or verify the publish/release pipeline. Wait
27
+ on it with its own watch (`gh run watch --exit-status`) or the host's monitor, never a
28
+ sleep-then-poll loop.
27
29
 
28
30
  ## Done when
29
31
  - Version, changelog, and tag all name the same number, and the release is pushed
@@ -20,8 +20,10 @@ to be acted on; or the user wants a review criterion recorded ("add a review rul
20
20
  4. Respond to each comment: the change you will make and why, or a reasoned decline
21
21
  with evidence.
22
22
  5. Apply the accepted changes — one intent per commit ({{LAW:one-intent-one-act}}), each through the
23
- [commit {{SKILL}}](commit.md) so {{DOCTRINE:consent-before-push}}'s per-commit consent holds — then
24
- re-run the checks ({{LAW:verify-before-asserting}}).
23
+ [commit {{SKILL}}](commit.md), on the pull request's own branch ({{DOCTRINE:consent-before-push}}) — then
24
+ re-run the checks ({{LAW:verify-before-asserting}}). If the PR has auto-merge armed, disarm it
25
+ before you push the fixes (the commit {{SKILL}}'s push step says how), then re-arm through the
26
+ [ship {{SKILL}}](ship.md) on the new head.
25
27
  6. Surface anything the review missed that you noticed while addressing it.
26
28
  7. Upgrade the review itself. A finding that recurs, a criterion the user asks for, or a
27
29
  defect a review should have caught becomes a rule in the nearest `REVIEW.md` above the
@@ -29,7 +29,8 @@ that is gone was decided.
29
29
  - A `Rule from` block whose rule the shared file now holds word for word needs no decision.
30
30
  Skip it: the next fold of that host clears it.
31
31
  3. **Decide one item at a time.** Show the item, then ask. "Later" leaves the block and the row as
32
- they are. For each decision, write in this order: the target file, the ledger row, the draft.
32
+ they are. Approval names the items or says approve; a remark about where rules live is not
33
+ approval, so ask again and write nothing. For each decision, write in this order: the target file, the ledger row, the draft.
33
34
  A stop between the writes leaves the rule in force, and step 2 or the next fold finishes it.
34
35
 
35
36
  ### A `Rule from <host>` block
@@ -5,7 +5,7 @@
5
5
 
6
6
  {{CREDIT:mattpocock-skills-2509:skills/engineering/retro/SKILL.md}}
7
7
 
8
- **Trigger:** the user says "always…", "never…", "from now on…" or "remember that…". Anything the user wants to outlive this session counts: a standing rule ("make that a
8
+ **Trigger:** the user says "always…", "never…", "from now on…" or "remember that…", or "turn on auto-merge" / "turn off auto-merge". Anything the user wants to outlive this session counts: a standing rule ("make that a
9
9
  rule") or a durable fact ("note that…", "keep in mind…"). Also fires when a
10
10
  `feedback` {{MEMORY}} lesson keeps recurring and deserves promotion, or when
11
11
  `user-rules.md` needs review — a trial rule past its date, a stale rule, a bloated
@@ -109,6 +109,32 @@ The asymmetry is deliberate: Branch A costs no question, Branch B costs several.
109
109
  The price is the safeguard — make remembering cheap and legislating expensive, or
110
110
  the user picks "rule" out of impatience and the set inflates.
111
111
 
112
+ **Auto-merge flow** (the user says "turn on auto-merge", or "turn it off"). The wording is fixed
113
+ so the [ship {{SKILL}}](ship.md) reads it reliably: skip reformulation and the counter-example,
114
+ never the consent. Ask one question — every repo (`global`) or this project (`project`) — then
115
+ show this text, with the next free `R<n>`, the scope chosen and today's date, and append it to the
116
+ file Branch B step 5 names for that scope, on explicit consent:
117
+
118
+ ```
119
+ ## R<n> — Auto-merge green PRs
120
+ (scope: <global|project> | source: user, <date>)
121
+ Arm auto-merge on a PR I open, only when the forge has required checks.
122
+ - docs-tests: auto
123
+ - normal: human # human | reviewer
124
+ - sensitive: never
125
+ - Before any further push to a PR with auto-merge armed, disarm it first, then classify, review and arm again on the new head.
126
+ ```
127
+
128
+ `sensitive` never arms, whatever its line says. `docs-tests` accepts `auto | human | reviewer |
129
+ never`, `normal` accepts `human | reviewer | never`; any other value counts as `human`. `human`
130
+ waits for one approving review on the forge. The last line is part of the fixed text: the rule is
131
+ loaded every session, so every path that pushes sees it. `reviewer` is for a solo repo, where the
132
+ forge forbids approving your own PR: the blind reviewer must pass first. The rule arms only the
133
+ forge's merge; pushes still follow {{DOCTRINE:consent-before-push}} (a plain push of your own branch is
134
+ free, a push onto the main branch asks). To turn it off, remove
135
+ the rule with the same consent; to turn it off for one project only, write the rule into that
136
+ project's file with all three tier lines `never` (the later layer wins).
137
+
112
138
  **Review flow** (on request, or when a `trial until:` date has passed): for each rule
113
139
  due, ask whether it actually fired since adoption — graduate it (drop the trial
114
140
  marker), demote it back to a {{MEMORY}} fact, or delete it. Same consent gate as
@@ -22,11 +22,10 @@ request or merge the branch.
22
22
  before pushing.
23
23
  3. Confirm the branch carries only this change's commits and is rebased/updated on
24
24
  the base branch; resolve any divergence before opening.
25
- 4. Push the branch only with the user's explicit, per-push acceptance — on every
26
- branch, feature branches included ({{DOCTRINE:consent-before-push}}); present the change summary + commit
27
- message and wait, and never treat an earlier approval as consent for this push.
28
- Opening a PR or merging is **outward-facing** — get explicit confirmation first too,
29
- unless already authorized ({{LAW:deletion-is-deliberate}}).
25
+ 4. Push the branch with a plain push and open the pull request: the pull request is
26
+ the consent the main branch needs ({{DOCTRINE:consent-before-push}}). Merge only once its
27
+ required checks are green — never red, pending or absent. A forced push, or a push
28
+ straight onto the main branch, asks ({{LAW:deletion-is-deliberate}}).
30
29
  5. Open the PR with a three-part body. **Summary**: what changed and why, with the
31
30
  smallest visual that makes the point (a call tree, diff sketch, file tree or
32
31
  Mermaid diagram). **Evidence**: how it was tested, as before/after — the test that
@@ -35,9 +34,54 @@ request or merge the branch.
35
34
  published contract) or two-way (cheap to roll back), the blast radius (what breaks if
36
35
  it is wrong — consumers, layout, data), and any follow-up. Link the
37
36
  issue it closes; keep the title an imperative one-line summary.
38
- 6. If the project merges locally instead, merge into the base branch only after
37
+ 6. **Auto-merge.** It is off unless the user's standing rule *Auto-merge green PRs* in
38
+ `user-rules.md` arms it (the later layer wins: project over host over shared). That rule is
39
+ the durable authorization {{LAW:deletion-is-deliberate}} permits for the forge's merge; it
40
+ arms only that merge, and pushes still follow {{DOCTRINE:consent-before-push}}. With no such rule, say once per session in
41
+ each repo, when you open a PR there: "Auto-merge is off; say 'turn on auto-merge' to set a
42
+ standing rule" — the [rule {{SKILL}}](rule.md) writes it. With the rule, arm only when all of
43
+ these hold; otherwise leave the merge to the user:
44
+ - **Tier**, from the PR's diff. Any sensitive file → `sensitive`. Else, when every file is
45
+ docs (prose that is neither shipped nor executed) or tests → `docs-tests`, unless the diff
46
+ removes, skips or loosens a test or an assertion: CI cannot see a weakened test, so that diff
47
+ is `normal`. Anything else → `normal`. Sensitive is each `sensitive:` zone of the ownership block in the *base* branch's
48
+ `AGENTS.md` (never the head's), plus by default: auth and authz, secrets and credentials,
49
+ data migrations and schema, CI and deploy config, dependency manifests and lockfiles,
50
+ release and versioning, gate and hook config, `AGENTS.md`, `CLAUDE.md`, `CODEOWNERS`, any
51
+ `user-rules.md`, agent, skill and instruction files, and gate machinery (check scripts, CI-only
52
+ harnesses, coverage thresholds; not ordinary unit tests).
53
+ - **The rule's line for the tier.** `sensitive` never arms, whatever the rule says.
54
+ `docs-tests` accepts `auto | human | reviewer | never`; `normal` accepts `human | reviewer
55
+ | never` (`auto` is not valid there). A missing or other value counts as `human`. `auto`
56
+ arms. `human` arms only when the forge requires one approving review and dismisses it on a
57
+ new push. `reviewer` arms only
58
+ after the [fresh-eyes {{SKILL}}](fresh-eyes.md) passes: first add its verdict to the PR
59
+ body (`gh pr edit <pr> --body-file <file>`, `glab mr update <mr> --description <text>`).
60
+ `never` does not arm.
61
+ - **Forge**, one probe each; a result you cannot read counts as absent. Required checks on
62
+ the base: a `required_status_checks` rule in `gh api repos/{owner}/{repo}/rules/branches/<base>`,
63
+ or `required_status_checks` in `gh api repos/{owner}/{repo}/branches/<base>/protection`,
64
+ with a non-empty list of checks (`contexts` or `checks`): an empty list requires nothing,
65
+ and `--auto` then merges at once; GitLab: `only_allow_merge_if_pipeline_succeeds` in
66
+ `glab api projects/:id`. One approving review dismissed on a new push (`human`): a
67
+ `pull_request` rule with `required_approving_review_count` of 1 or more and
68
+ `dismiss_stale_reviews_on_push`, or the same under `required_pull_request_reviews`
69
+ (`dismiss_stale_reviews`) in the protection; GitLab: an approval rule with
70
+ `approvals_required` of 1 or more in `glab api projects/:id/approval_rules`, and
71
+ `reset_approvals_on_push` in `glab api projects/:id/approvals`. Auto-merge allowed:
72
+ `gh repo view --json autoMergeAllowed` (GitHub only; GitLab has no such switch). Never judge
73
+ green yourself: the forge's checks are the gate ({{DOCTRINE:external-gate}}).
74
+ Arm with the reviewed head named: `gh pr merge <pr> --auto --squash --match-head-commit
75
+ <sha>`, or `glab mr merge <mr> --auto-merge --squash --sha <sha>` (a plain `glab mr merge`
76
+ arms it too, so always name the flag). On GitHub the pin is checked only when you arm: an
77
+ armed PR stays armed after a later push. So before any further push to an armed PR, disarm
78
+ it (`gh pr merge <pr> --disable-auto`; GitLab: `glab api --method POST
79
+ projects/:id/merge_requests/<iid>/cancel_merge_when_pipeline_succeeds`), then classify,
80
+ review and arm again on the new head. Recommend CODEOWNERS with required code-owner review on
81
+ sensitive paths as the forge's own backstop.
82
+ 7. If the project merges locally instead, merge into the base branch only after
39
83
  review/approval.
40
- 7. Once the branch is merged — locally or through the PR — delete it, local and remote
84
+ 8. Once the branch is merged — locally or through the PR — delete it, local and remote
41
85
  (`git branch -d <branch>`, `git push origin --delete <branch>`), with consent: it is a
42
86
  deletion ({{LAW:deletion-is-deliberate}}). A PR usually merges after your turn ends,
43
87
  with nobody left to delete its branch, so the first time you ship in a repo, check
@@ -52,6 +96,9 @@ request or merge the branch.
52
96
  ## Done when
53
97
  - The diff passed review with no `blocking` finding, and the PR is open (or the branch is merged) with a Summary / Evidence / Merge danger
54
98
  body, and nothing unrelated rides along.
99
+ - Auto-merge is armed only under the user's standing rule, never for a sensitive diff, on a
100
+ forge that requires checks, on the reviewed head, and disarmed before any later push — or it
101
+ is off and the user was told once this session how to turn it on.
55
102
  - A branch merged while you are still working is deleted, local and remote, or the user
56
103
  declined.
57
104
 
@@ -5,7 +5,7 @@
5
5
  {{CREDIT:mattpocock-skills:skills/productivity/writing-for-agents/SKILL.md}}
6
6
 
7
7
  **Trigger:** a task has repeated and no {{SKILL}} covers it; a {{SKILL}}'s
8
- notes in `{{PATH_NOTES}}/skill-notes/` hold a correction worth making; the user says "make this a
8
+ notes in `{{PATH_NOTES}}/skill-notes/` or `{{PATH_PROJECT_NOTES}}/skill-notes/` hold a correction worth making; the user says "make this a
9
9
  skill", "write a skill for…", "fix the trigger of…"; or two {{SKILLS}} keep
10
10
  disambiguating against each other and should merge. Meta by nature: it edits the
11
11
  apparatus, so every step ends in the user's assent ({{LAW:one-intent-one-act}}, {{LAW:deletion-is-deliberate}}).
@@ -38,7 +38,9 @@ apparatus, so every step ends in the user's assent ({{LAW:one-intent-one-act}},
38
38
  says *when*, in the words a user would actually say and the situations the model
39
39
  would actually meet — the emitted `description:` is purpose + trigger, and it is
40
40
  the only text the host matches a task against. It is loaded every turn: one phrase per
41
- distinct case it catches, never synonyms of one case. Then the numbered procedure (each
41
+ distinct case it catches, never synonyms of one case. In the Geneseed source repo the
42
+ description is instead the skill's line in `src/skill-descriptions.json`: purpose and
43
+ trigger in at most 80 characters, because the host drops long descriptions first. Then the numbered procedure (each
42
44
  step an action with a verification), and a **Done when** that a stranger could
43
45
  check. Then cut every sentence the model would obey untold, and every restatement of
44
46
  what a config file or `--help` already says. Keep it to one coherent domain; a "Requires:" line only for a hard external
@@ -58,7 +60,7 @@ apparatus, so every step ends in the user's assent ({{LAW:one-intent-one-act}},
58
60
  `{{DIR_SKILLS}}/`, one row in AGENT.md §4's table, then `geneseed doctor` — it fails
59
61
  if the table and the files disagree. In the *Geneseed source repo* the cost is the
60
62
  full satellite set (`docs/extending.md` §3): the file, the §4 row, `DESC_<NAME>` in
61
- every theme, `SKILL_CLASS`, a `registry.json` row, the README enumeration, then
63
+ every theme, its `src/skill-descriptions.json` line, `SKILL_CLASS`, a `registry.json` row, the README enumeration, then
62
64
  `doctor --all` and the suites. A skill that bundles a script or several files is a
63
65
  folder skill (`<name>/SKILL.md` + `VENDOR.md`), listed in `VENDORED_SKILL_DIRS`.
64
66
  Text adapted from outside gets a `src/upstreams.json` entry and a `CREDIT` token (docs/extending.md §3, in the Geneseed source repo).
@@ -15,7 +15,11 @@ Consequences of riding this mechanism (deliberate):
15
15
  - exempt from the flat-skill authoring gates (theme DESC tokens, dead-link,
16
16
  hermeticity, skill counts) — the SKILL.md here carries its own frontmatter
17
17
  `description` and blockquote purpose line instead;
18
- - listed in AGENT.md's folder-skills section, not the main skills table.
18
+ - listed in AGENT.md's folder-skills section, not the main skills table;
19
+ - at emit time the `description:` of `SKILL.md` is replaced with the skill's line in
20
+ `src/skill-descriptions.json` (at most 80 characters: the host's skill listing has a budget),
21
+ and the description written here is kept as the first body line, a blockquote
22
+ (`vendoredWithCatalogueLine`, `js/hosts/native.mjs`).
19
23
 
20
24
  The script supports all four emitted hosts, with exact usage on each.
21
25
  If a host changes its session storage layout, fix the corresponding finder or
@@ -32,8 +32,8 @@ not make.
32
32
  state (a global config, a hook shim) run from the worktree only when they resolve
33
33
  the repo through it; verify with the tool's own status command rather than assume.
34
34
  5. **Integrate through the normal gate** — commit via the [commit {{SKILL}}](commit.md),
35
- ship via [ship](ship.md). A worktree earns no exemption from per-commit and
36
- per-push consent ({{DOCTRINE:consent-before-push}}). Expect conflicts with a sibling tree that
35
+ ship via [ship](ship.md). The worktree's branch is your own; the main branch still
36
+ changes only through a green pull request ({{DOCTRINE:consent-before-push}}). Expect conflicts with a sibling tree that
37
37
  touched the same files; resolve them on the branch, not in the other tree.
38
38
  6. **Clean up when the branch is merged or abandoned** — with consent, since removal
39
39
  is deletion ({{LAW:deletion-is-deliberate}}):
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "superpowers": {
31
31
  "repo": "obra/superpowers",
32
- "commit": "bb92a77741419a4ab5f06e711a283343f1ada0c3",
32
+ "commit": "22f0b463e7a5e579904dd6211a520321035526f7",
33
33
  "author": "Jesse Vincent",
34
34
  "license": "MIT",
35
35
  "licenseFile": "licenses/superpowers.txt"
@@ -65,11 +65,18 @@
65
65
  },
66
66
  "everything-claude-code": {
67
67
  "repo": "affaan-m/everything-claude-code",
68
- "commit": "90606c8315ee09cafc303515c5f33024db6b9882",
68
+ "commit": "d2ef2680594f9a17526a6e1a2e18b3d242c5d17b",
69
69
  "author": "Affaan Mustafa",
70
70
  "license": "MIT",
71
71
  "licenseFile": "licenses/everything-claude-code.txt"
72
72
  },
73
+ "herdr": {
74
+ "repo": "herdrdev/herdr",
75
+ "commit": "1cbd794559fb139f95f1bdb4b2a8998082017d0e",
76
+ "author": "herdrdev",
77
+ "license": "Apache-2.0",
78
+ "licenseFile": "licenses/herdr.txt"
79
+ },
73
80
  "i-have-adhd": {
74
81
  "repo": "ayghri/i-have-adhd",
75
82
  "commit": "1ecea1993b7fce257ffbd686c070948b5e07eda6",
package/themes/README.md CHANGED
@@ -57,7 +57,9 @@ English); the others range from `imperial` (Warhammer 40k) to community voices.
57
57
  `EPI_DOCTRINES`), section intros (`INTRO_*`), the nine Rule titles (`LEX_*`),
58
58
  the twenty-three doctrine rule titles (`DOC_<PACK>_<N>`), the four pack names
59
59
  (`PACK_CRAFT`, `PACK_RIGOR`, `PACK_OPS`, `PACK_PROCESS`), capability
60
- descriptions (`DESC_*`), and `ROAST_PERSONA`.
60
+ descriptions (`DESC_*`), and `ROAST_PERSONA`. A skill's `DESC_*` opens its
61
+ body; the `description:` a host lists is the theme-neutral line in
62
+ `src/skill-descriptions.json`, the same in every theme.
61
63
  - **Themed nouns** — `ONTOLOGY`, `LAW(S)`, `DOCTRINE(S)`, `AGENT(S)`, `SKILL(S)`,
62
64
  `MEMORY`, `NOTEBOOK`, `VAULT`, `WIKI`. These read in your voice but must stay
63
65
  nouns the prose can use. ⚠ `LAW` and `DOCTRINE` must each be a **single word** —
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "<one-line description: write or fix a declarative Jenkinsfile or shared library — stages, when, parallel, credentials, CPS and @NonCPS, sandbox approval, JenkinsPipelineUnit>",
166
166
  "DESC_GITLAB_CI": "<one-line description: write or fix .gitlab-ci.yml — rules, needs DAG, include and extends, cache and artifacts, protected and masked variables, environments, CI lint>",
167
167
  "DESC_COMPOSE_OPS": "<one-line description: write, review or run any Compose stack — healthchecks, volumes, pinned images, secrets, limits, logs, networks, safe update and rollback; not a Spring Boot image build (docker-expert)>",
168
+ "DESC_HERDR": "<one-line description: control Herdr workspaces, tabs, panes and agents from inside a Herdr pane (HERDR_ENV=1); only when the user names Herdr>",
169
+ "DESC_OPENCODE_CLI": "<one-line description: drive OpenCode V2 from another session through its CLI — headless run, sessions, background service, MCP, plugins, models, stats, debug; never auth login>",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
package/themes/biker.json CHANGED
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the ride.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the lights go out.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the run.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
package/themes/gamer.json CHANGED
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the boss fight.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Forge and mend a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Forge and mend .gitlab-ci.yml: rules, needs, cache.",
167
167
  "DESC_COMPOSE_OPS": "Muster and command a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Command Herdr panes and agents from within; only when Herdr is named.",
169
+ "DESC_OPENCODE_CLI": "Command OpenCode V2 through its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
package/themes/joker.json CHANGED
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before opening night.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a Jenkinsfile, which will fail anyway.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml, which will fail anyway.",
167
167
  "DESC_COMPOSE_OPS": "Write or run a Compose stack; not image builds. It'll fail.",
168
+ "DESC_HERDR": "Drive Herdr panes from inside it, if the user names Herdr. Rarely.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI. It will not thank you.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
package/themes/mean.json CHANGED
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml: rules, needs, includes, cache.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before deployment.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml: rules, needs, includes, cache.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml afore she leaves port.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before kickoff.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Write or fix a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Write or fix .gitlab-ci.yml before the real run.",
167
167
  "DESC_COMPOSE_OPS": "Write, review or run a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Drive Herdr panes and agents from inside it; only when the user names Herdr.",
169
+ "DESC_OPENCODE_CLI": "Drive OpenCode V2 from its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -165,6 +165,8 @@
165
165
  "DESC_JENKINS_PIPELINE": "Cast and mend a declarative Jenkinsfile or shared library.",
166
166
  "DESC_GITLAB_CI": "Cast and mend .gitlab-ci.yml: rules, needs, cache.",
167
167
  "DESC_COMPOSE_OPS": "Conjure, inspect and tend a Compose stack; not image builds.",
168
+ "DESC_HERDR": "Bind Herdr panes and agents from within; only when Herdr is named.",
169
+ "DESC_OPENCODE_CLI": "Command OpenCode V2 through its CLI: run, sessions, server, MCP, plugins.",
168
170
  "AGENT_COLORS": {
169
171
  "architect": "primary",
170
172
  "reviewer": "warning",
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{n as i,t as a}from"./usePoll-D5c_qIFZ.js";import{t as o}from"./DataTable-b9zTShqJ.js";var s=e(t(),1),c={x:260,y:190},l=110,u=28,d=14,f=44,p=e=>e*Math.PI/180,m=e=>Math.round(e*10)/10,h=(e,t=l,n=c)=>({x:m(n.x+t*Math.cos(p(e))),y:m(n.y+t*Math.sin(p(e)))}),g=e=>e/l*(180/Math.PI)+3,_=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,v=m(h(205).x-6),y=e=>e.length*6.4,b=e=>({x:e.x-y(e.name)/2,y:e.y-7,w:y(e.name),h:14}),x=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,S=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>x(b(n),b(e))));function C(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function w(e,t=[]){let n=T(e,t,0);if(n.mode!==`ring`)return n;let r=Math.min(...n.entry.map(e=>e.y-30),...n.nodes.map(e=>e.y-e.r-12),...n.inner.map(e=>e.cy-e.r-12),...n.exit?[n.exit.y-24]:[]);return r<0?T(e,t,Math.ceil(-r)):n}function T(e,t,n){let r={x:c.x,y:c.y+n},i=(e,t=l)=>h(e,t,r),a=e=>t.find(t=>t.name===e),o=e=>a(e)?.effect??null,s=e=>C(a(e)),p=e.loops||[],v=p.find(e=>e.iteration);if(!v||v.nodes.length>8)return E(e,o,s);let b=Math.max(...e.nodes.map(e=>p.filter(t=>t.nodes.includes(e)).length)),x=p.filter(e=>e!==v);if(b>3||x.some(e=>!e.nodes.every(e=>v.nodes.includes(e))))return E(e,o,s);let w=v.nodes[0],T=new Set(e.edges.filter(e=>e.to===w).map(e=>e.from)),D=new Map;for(let e of[...x].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==w&&!T.has(t)&&!D.has(t)&&D.set(t,e);let O=v.nodes.filter(e=>!D.has(e));if(O.length<2||x.some(e=>D.has(e.nodes[0])))return E(e,o,s);let k=360/O.length,A=O.map((e,t)=>({name:e,a:-90+t*k,r:u})),j=A.findIndex(e=>o(e.name)===`mutate`);j>=0&&A.splice(j,0,{name:`validate`,a:A[j].a-k/2,r:d,gate:!0});let M=A.map(e=>({name:e.name,...i(e.a),r:e.r,effect:e.gate?null:o(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:s(e.name)})),N=A.map((e,t)=>{let n=A[(t+1)%A.length],r=(t+1===A.length?n.a+360:n.a)-g(n.r)-2,a=e.a+g(e.r);return{d:_(l,i(a),i(r),+(r-a>180)),kind:`ring`}}),P=[],F=new Map;for(let e of x)F.set(e.nodes[0],[...F.get(e.nodes[0])||[],e]);for(let[e,t]of F){let n=A.find(t=>t.name===e),r=i(n.a),a=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let d=i(n.a+(a?t?18:-18:0),l+(a?54:44)),p=Math.atan2(d.y-r.y,d.x-r.x)*(180/Math.PI),g=e.nodes.filter(t=>D.get(t)===e),v=e=>g.map((t,n)=>({name:t,...h(p+(n-(g.length-1)/2)*e,f,d)})),y=105;for(;y<150&&S(v(y),M);)y+=5;v(y).forEach(({name:e,...t})=>{M.push({name:e,...t,r:u,effect:o(e),gate:!1,inner:!0,human:s(e)})});let b=p+180;N.push({d:_(f,h(b+42,f,d),h(b+138,f,d)),kind:`inner`}),N.push({d:_(f,h(b+222,f,d),h(b+318,f,d)),kind:`inner`});let x=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,C={lx:d.x,ly:d.y+f+20,anchor:`middle`};if(a){let e=d.x>=c.x,t=Math.max(f,...g.map(e=>{let t=M.find(t=>t.name===e);return Math.abs(t.x-d.x)+u}));C={lx:m(d.x+(e?t+8:-t-8)),ly:m(d.y+4),anchor:e?`start`:`end`}}P.push({loop:e.name,cx:d.x,cy:d.y,r:f,label:x,...C})})}let I=i(205).y,L=e.nodes.filter(e=>!v.nodes.includes(e)),R=L.map((e,t)=>({name:e,x:40,y:m(I-44*(L.length-1-t)),human:s(e)})),z=e.edges.find(e=>e.to===`$close`)?.from,B=M.find(e=>e.name===z),V=B?{from:z,x:B.x+200,y:B.y-30,d:`M${B.x+u},${B.y-6} C${B.x+90},${B.y-40} ${B.x+170},${B.y-40} ${B.x+200},${B.y-30}`}:null,H=Math.max(540,...M.map(e=>e.x+e.r+8),...V?[V.x+6+y(`close`)+8]:[],...P.map(e=>e.cx+e.r+8),...P.map(e=>e.anchor===`start`?e.lx+y(e.label)+8:e.lx+y(e.label)/2+8)),U=Math.max(300,...M.map(e=>e.y+e.r+12),...P.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(H),height:Math.ceil(U),center:{x:r.x,y:r.y,r:l},nodes:M,arcs:N,inner:P,entry:R,exit:V}}function E(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(u,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),s=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:u,effect:t(e),gate:!1,inner:!1,human:n(e)})),c=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+u},${a} L${o.get(t)-u-4},${a}`,kind:`flow`})),l=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return c.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:s,arcs:c,inner:l,entry:[],exit:null}}var D=n();function O({x:e,y:t,label:n}){return(0,D.jsxs)(`g`,{className:`lr-human`,children:[(0,D.jsx)(`title`,{children:n}),(0,D.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,D.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,D.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function k({graph:e,bricks:t,onSelect:n,highlight:r}){let i=w(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,s=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,D.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,style:{"--loop-w":`${i.width}px`},role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,D.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,D.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,D.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,D.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,D.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,D.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${v},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,D.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,D.jsx)(O,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,D.jsxs)(`g`,{className:`lr-gate`,children:[(0,D.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,D.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,D.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,D.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,D.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,...n?{role:`button`,tabIndex:0,"aria-label":o(e),onClick:s(e.name),onKeyDown:s(e.name)}:{role:`img`,"aria-label":`${o(e)}${e.name===r?`, current step`:``}`},children:[(0,D.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,D.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,D.jsx)(O,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,D.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,D.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,D.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var A=5e3,j=[`prudent`,`balanced`,`aggressive`],M={running:`acc`,awaiting:`warn`,unreadable:`bad`},N=e=>!!e.graph;function P(){let[e,t]=(0,s.useState)(null),[n,o]=(0,s.useState)(null),[c,l]=(0,s.useState)(null),[u,d]=(0,s.useState)(0);return i(e=>r.activeLoops().then(n=>e()&&(t(a(n)),o(null)),t=>e()&&o(t.message)),A,[u]),{loops:e?.loops??null,error:c||n,onPreset:(e,t)=>(l(null),r.setLoopPreset(e,t).then(()=>d(e=>e+1),e=>l(e.message)))}}var F=e=>({key:e,label:e,align:`right`,render:t=>(0,D.jsx)(`span`,{className:`num`,children:t[e]})}),I=[F(`iteration`),{key:`intent`,label:`intent`},F(`declared`),F(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function L({history:e}){return e.length?(0,D.jsx)(`div`,{className:`loop-history`,children:(0,D.jsx)(o,{caption:`Iterations`,captionHidden:!0,columns:I,rows:e,rowKey:e=>e.iteration})}):(0,D.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function R({loop:e,bricks:t,onPreset:n}){let r=N(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[i,a]=(0,s.useState)(!1);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`reader-tags`,children:[(0,D.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,D.jsx)(`span`,{className:`tag${M[e.status]?` ${M[e.status]}`:``}`,children:e.status})]}),(0,D.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,D.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),N(e)?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,D.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,D.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,D.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,D.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,disabled:i,onChange:t=>{a(!0),Promise.resolve(n(e.root,t.target.value)).finally(()=>a(!1))},children:j.map(e=>(0,D.jsx)(`option`,{children:e},e))})]}),(0,D.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,D.jsx)(`hr`,{className:`hr`}),(0,D.jsx)(`div`,{className:`loop-graph`,children:(0,D.jsx)(k,{graph:e.graph,bricks:t,highlight:e.node})}),(0,D.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,D.jsx)(L,{history:e.history})]}):(0,D.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}export{O as a,w as c,P as i,M as n,k as o,N as r,C as s,R as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-CZ-x0iWG.js";import{n as i,t as a}from"./usePoll-D5c_qIFZ.js";import{t as o}from"./DataTable-b9zTShqJ.js";var s=e(t(),1),c={x:260,y:190},l=110,u=28,d=14,f=44,p=e=>e*Math.PI/180,m=e=>Math.round(e*10)/10,h=(e,t=l,n=c)=>({x:m(n.x+t*Math.cos(p(e))),y:m(n.y+t*Math.sin(p(e)))}),g=e=>e/l*(180/Math.PI)+3,_=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,v=m(h(205).x-6),y=e=>e.length*6.4,b=e=>({x:e.x-y(e.name)/2,y:e.y-7,w:y(e.name),h:14}),x=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,S=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>x(b(n),b(e))));function C(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function w(e,t=[]){let n=T(e,t,0);if(n.mode!==`ring`)return n;let r=Math.min(...n.entry.map(e=>e.y-30),...n.nodes.map(e=>e.y-e.r-12),...n.inner.map(e=>e.cy-e.r-12),...n.exit?[n.exit.y-24]:[]);return r<0?T(e,t,Math.ceil(-r)):n}function T(e,t,n){let r={x:c.x,y:c.y+n},i=(e,t=l)=>h(e,t,r),a=e=>t.find(t=>t.name===e),o=e=>a(e)?.effect??null,s=e=>C(a(e)),p=e.loops||[],v=p.find(e=>e.iteration);if(!v||v.nodes.length>8)return E(e,o,s);let b=Math.max(...e.nodes.map(e=>p.filter(t=>t.nodes.includes(e)).length)),x=p.filter(e=>e!==v);if(b>3||x.some(e=>!e.nodes.every(e=>v.nodes.includes(e))))return E(e,o,s);let w=v.nodes[0],T=new Set(e.edges.filter(e=>e.to===w).map(e=>e.from)),D=new Map;for(let e of[...x].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==w&&!T.has(t)&&!D.has(t)&&D.set(t,e);let O=v.nodes.filter(e=>!D.has(e));if(O.length<2||x.some(e=>D.has(e.nodes[0])))return E(e,o,s);let k=360/O.length,A=O.map((e,t)=>({name:e,a:-90+t*k,r:u})),j=A.findIndex(e=>o(e.name)===`mutate`);j>=0&&A.splice(j,0,{name:`validate`,a:A[j].a-k/2,r:d,gate:!0});let M=A.map(e=>({name:e.name,...i(e.a),r:e.r,effect:e.gate?null:o(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:s(e.name)})),N=A.map((e,t)=>{let n=A[(t+1)%A.length],r=(t+1===A.length?n.a+360:n.a)-g(n.r)-2,a=e.a+g(e.r);return{d:_(l,i(a),i(r),+(r-a>180)),kind:`ring`}}),P=[],F=new Map;for(let e of x)F.set(e.nodes[0],[...F.get(e.nodes[0])||[],e]);for(let[e,t]of F){let n=A.find(t=>t.name===e),r=i(n.a),a=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let d=i(n.a+(a?t?18:-18:0),l+(a?54:44)),p=Math.atan2(d.y-r.y,d.x-r.x)*(180/Math.PI),g=e.nodes.filter(t=>D.get(t)===e),v=e=>g.map((t,n)=>({name:t,...h(p+(n-(g.length-1)/2)*e,f,d)})),y=105;for(;y<150&&S(v(y),M);)y+=5;v(y).forEach(({name:e,...t})=>{M.push({name:e,...t,r:u,effect:o(e),gate:!1,inner:!0,human:s(e)})});let b=p+180;N.push({d:_(f,h(b+42,f,d),h(b+138,f,d)),kind:`inner`}),N.push({d:_(f,h(b+222,f,d),h(b+318,f,d)),kind:`inner`});let x=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,C={lx:d.x,ly:d.y+f+20,anchor:`middle`};if(a){let e=d.x>=c.x,t=Math.max(f,...g.map(e=>{let t=M.find(t=>t.name===e);return Math.abs(t.x-d.x)+u}));C={lx:m(d.x+(e?t+8:-t-8)),ly:m(d.y+4),anchor:e?`start`:`end`}}P.push({loop:e.name,cx:d.x,cy:d.y,r:f,label:x,...C})})}let I=i(205).y,L=e.nodes.filter(e=>!v.nodes.includes(e)),R=L.map((e,t)=>({name:e,x:40,y:m(I-44*(L.length-1-t)),human:s(e)})),z=e.edges.find(e=>e.to===`$close`)?.from,B=M.find(e=>e.name===z),V=B?{from:z,x:B.x+200,y:B.y-30,d:`M${B.x+u},${B.y-6} C${B.x+90},${B.y-40} ${B.x+170},${B.y-40} ${B.x+200},${B.y-30}`}:null,H=Math.max(540,...M.map(e=>e.x+e.r+8),...V?[V.x+6+y(`close`)+8]:[],...P.map(e=>e.cx+e.r+8),...P.map(e=>e.anchor===`start`?e.lx+y(e.label)+8:e.lx+y(e.label)/2+8)),U=Math.max(300,...M.map(e=>e.y+e.r+12),...P.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(H),height:Math.ceil(U),center:{x:r.x,y:r.y,r:l},nodes:M,arcs:N,inner:P,entry:R,exit:V}}function E(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(u,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),s=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:u,effect:t(e),gate:!1,inner:!1,human:n(e)})),c=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+u},${a} L${o.get(t)-u-4},${a}`,kind:`flow`})),l=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return c.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:s,arcs:c,inner:l,entry:[],exit:null}}var D=n();function O({x:e,y:t,label:n}){return(0,D.jsxs)(`g`,{className:`lr-human`,children:[(0,D.jsx)(`title`,{children:n}),(0,D.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,D.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,D.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function k({graph:e,bricks:t,onSelect:n,highlight:r}){let i=w(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,s=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,D.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,style:{"--loop-w":`${i.width}px`},role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,D.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,D.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,D.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,D.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,D.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,D.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${v},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,D.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,D.jsx)(O,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,D.jsxs)(`g`,{className:`lr-gate`,children:[(0,D.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,D.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,D.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,D.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,D.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,...n?{role:`button`,tabIndex:0,"aria-label":o(e),onClick:s(e.name),onKeyDown:s(e.name)}:{role:`img`,"aria-label":`${o(e)}${e.name===r?`, current step`:``}`},children:[(0,D.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,D.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,D.jsx)(O,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,D.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,D.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,D.jsxs)(`g`,{children:[(0,D.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,D.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var A=5e3,j=[`prudent`,`balanced`,`aggressive`],M={running:`acc`,awaiting:`warn`,unreadable:`bad`},N=e=>!!e.graph;function P(){let[e,t]=(0,s.useState)(null),[n,o]=(0,s.useState)(null),[c,l]=(0,s.useState)(null),[u,d]=(0,s.useState)(0);return i(e=>r.activeLoops().then(n=>e()&&(t(a(n)),o(null)),t=>e()&&o(t.message)),A,[u]),{loops:e?.loops??null,error:c||n,onPreset:(e,t)=>(l(null),r.setLoopPreset(e,t).then(()=>d(e=>e+1),e=>l(e.message)))}}var F=e=>({key:e,label:e,align:`right`,render:t=>(0,D.jsx)(`span`,{className:`num`,children:t[e]})}),I=[F(`iteration`),{key:`intent`,label:`intent`},F(`declared`),F(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function L({history:e}){return e.length?(0,D.jsx)(`div`,{className:`loop-history`,children:(0,D.jsx)(o,{caption:`Iterations`,captionHidden:!0,columns:I,rows:e,rowKey:e=>e.iteration})}):(0,D.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function R({loop:e,bricks:t,onPreset:n}){let r=N(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[i,a]=(0,s.useState)(!1);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`reader-tags`,children:[(0,D.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,D.jsx)(`span`,{className:`tag${M[e.status]?` ${M[e.status]}`:``}`,children:e.status})]}),(0,D.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,D.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),N(e)?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,D.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,D.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,D.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,D.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,disabled:i,onChange:t=>{a(!0),Promise.resolve(n(e.root,t.target.value)).finally(()=>a(!1))},children:j.map(e=>(0,D.jsx)(`option`,{children:e},e))})]}),(0,D.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,D.jsx)(`hr`,{className:`hr`}),(0,D.jsx)(`div`,{className:`loop-graph`,children:(0,D.jsx)(k,{graph:e.graph,bricks:t,highlight:e.node})}),(0,D.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,D.jsx)(L,{history:e.history})]}):(0,D.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}export{O as a,w as c,P as i,M as n,k as o,N as r,C as s,R as t};