@oneie/claude 0.7.0 → 0.9.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 (263) hide show
  1. package/agents/abm-strategist.md +89 -0
  2. package/agents/ads-meta.md +97 -0
  3. package/agents/analyst.md +173 -0
  4. package/agents/architect.md +280 -0
  5. package/agents/brand-guardian.md +88 -0
  6. package/agents/brand-strategist.md +92 -0
  7. package/agents/campaign-content.md +90 -0
  8. package/agents/campaign-email.md +88 -0
  9. package/agents/campaign-sms.md +87 -0
  10. package/agents/campaign-social.md +87 -0
  11. package/agents/cco.md +99 -0
  12. package/agents/ceo.md +106 -0
  13. package/agents/chairman.md +120 -0
  14. package/agents/cmo.md +101 -0
  15. package/agents/community-greeter.md +89 -0
  16. package/agents/community-moderator.md +92 -0
  17. package/agents/compliance.md +92 -0
  18. package/agents/copywriter.md +100 -0
  19. package/agents/creative-strategist.md +95 -0
  20. package/agents/cro.md +98 -0
  21. package/agents/cto.md +267 -0
  22. package/agents/customer-interviewer.md +93 -0
  23. package/agents/customer-researcher.md +89 -0
  24. package/agents/customer-success-manager.md +90 -0
  25. package/agents/customer-trainer.md +90 -0
  26. package/agents/cxo.md +100 -0
  27. package/agents/demand-creator.md +89 -0
  28. package/agents/demo-mover.md +83 -0
  29. package/agents/demo-specialist.md +89 -0
  30. package/agents/demo-thai-family-law.md +87 -0
  31. package/agents/designer.md +112 -0
  32. package/agents/discovery-caller.md +98 -0
  33. package/agents/doctor.md +139 -0
  34. package/agents/educate-coach.md +100 -0
  35. package/agents/elevate-tutor.md +83 -0
  36. package/agents/email-lifecycle-marketer.md +91 -0
  37. package/agents/engage-specialist.md +99 -0
  38. package/agents/events-coordinator.md +90 -0
  39. package/agents/foundation-builder.md +94 -0
  40. package/agents/funnel-architect.md +89 -0
  41. package/agents/gift-creator.md +100 -0
  42. package/agents/google-ads.md +103 -0
  43. package/agents/guide.md +292 -0
  44. package/agents/helpdesk-dispatcher.md +88 -0
  45. package/agents/hook-specialist.md +91 -0
  46. package/agents/identify-optimizer.md +101 -0
  47. package/agents/implementer.md +305 -0
  48. package/agents/incident-commander.md +120 -0
  49. package/agents/insights-lead.md +93 -0
  50. package/agents/journey-runner.md +113 -0
  51. package/agents/linkedin-ads.md +123 -0
  52. package/agents/live-sales-chat.md +90 -0
  53. package/agents/market-researcher.md +88 -0
  54. package/agents/media-buyer.md +96 -0
  55. package/agents/movers-customer-researcher.md +95 -0
  56. package/agents/movers-foundation-builder.md +96 -0
  57. package/agents/movers-market-researcher.md +97 -0
  58. package/agents/movers-pricing-strategist.md +171 -0
  59. package/agents/nurture-architect.md +99 -0
  60. package/agents/offer-architect.md +92 -0
  61. package/agents/onboarder.md +222 -0
  62. package/agents/onboarding-specialist.md +92 -0
  63. package/agents/operations-dashboard.md +98 -0
  64. package/agents/perf-engineer.md +348 -0
  65. package/agents/playbook-writer.md +71 -0
  66. package/agents/plg-strategist.md +91 -0
  67. package/agents/positioning-architect.md +88 -0
  68. package/agents/press-officer.md +89 -0
  69. package/agents/pricing-strategist.md +94 -0
  70. package/agents/privacy-officer.md +92 -0
  71. package/agents/referral-manager.md +91 -0
  72. package/agents/refine-analyst.md +102 -0
  73. package/agents/release-manager.md +261 -0
  74. package/agents/renewals-upsell-rep.md +90 -0
  75. package/agents/review-engineer.md +327 -0
  76. package/agents/rewards-steward.md +82 -0
  77. package/agents/sales-call-coach.md +94 -0
  78. package/agents/sales-closer.md +98 -0
  79. package/agents/security-auditor.md +313 -0
  80. package/agents/sell-closer.md +101 -0
  81. package/agents/share-amplifier.md +99 -0
  82. package/agents/social-media-manager.md +92 -0
  83. package/agents/storyteller.md +250 -0
  84. package/agents/strategist.md +83 -0
  85. package/agents/strategy-aligner.md +94 -0
  86. package/agents/support-agent.md +90 -0
  87. package/agents/tagger.md +245 -0
  88. package/agents/tech-writer.md +216 -0
  89. package/agents/test-engineer.md +243 -0
  90. package/agents/tiktok-ads.md +105 -0
  91. package/agents/tracking-engineer.md +92 -0
  92. package/agents/upsell-strategist.md +101 -0
  93. package/agents/voice.md +85 -0
  94. package/agents/w4-tools.md +153 -0
  95. package/agents/w4-verify.md +20 -138
  96. package/agents/workflow-optimiser.md +84 -0
  97. package/commands/close.md +814 -160
  98. package/commands/create.md +2 -2
  99. package/commands/deploy.md +554 -175
  100. package/commands/do.md +119 -109
  101. package/commands/fast.md +67 -0
  102. package/commands/improve.md +2 -2
  103. package/commands/one.md +418 -0
  104. package/commands/see.md +1 -1
  105. package/commands/sync.md +1 -1
  106. package/commands/tasks.md +222 -0
  107. package/commands/vespio.md +110 -0
  108. package/commands/vespio.remote.md +227 -0
  109. package/hooks/hooks.json +25 -79
  110. package/hooks/lib/governor-escape-match.sh +88 -0
  111. package/hooks/lib/hook.sh +4 -13
  112. package/hooks/lib/signal.sh +9 -2
  113. package/hooks/scripts/branch-pin.sh +6 -0
  114. package/hooks/scripts/config-protect.sh +6 -0
  115. package/hooks/scripts/do-outcome-gate.sh +19 -2
  116. package/hooks/scripts/git-add-guard.sh +43 -2
  117. package/hooks/scripts/governor-escape.sh +96 -0
  118. package/hooks/scripts/load-guard.sh +127 -0
  119. package/hooks/scripts/post-edit-check.sh +36 -29
  120. package/hooks/scripts/session-start.sh +34 -80
  121. package/hooks/scripts/task-complete-verify.sh +46 -40
  122. package/package.json +1 -1
  123. package/rules/documentation.md +9 -0
  124. package/scripts/ad-copy-lint.sh +656 -0
  125. package/scripts/agentverse-audit.sh +256 -0
  126. package/scripts/asi-walk.sh +435 -0
  127. package/scripts/astro-build-cached.sh +143 -0
  128. package/scripts/blocks-manifest-cached.sh +100 -0
  129. package/scripts/blocks-manifest.mjs +497 -0
  130. package/scripts/blocks-ratchet.sh +116 -0
  131. package/scripts/blocks-render-probe.mjs +529 -0
  132. package/scripts/blocks-usage.mjs +334 -0
  133. package/scripts/chat-context-check.sh +89 -0
  134. package/scripts/close-metrics.sh +558 -0
  135. package/scripts/close-owner.sh +268 -0
  136. package/scripts/db-sync-lock-check.sh +116 -0
  137. package/scripts/deploy-dev.sh +35 -0
  138. package/scripts/deploy-emit.sh +298 -0
  139. package/scripts/deploy-gate-check.sh +128 -0
  140. package/scripts/deploy-ready.sh +78 -0
  141. package/scripts/deploy-record.sh +605 -0
  142. package/scripts/deploy.sh +1273 -0
  143. package/scripts/do-auto.sh +598 -48
  144. package/scripts/do-brief.sh +113 -0
  145. package/scripts/do-close.sh +1137 -0
  146. package/scripts/do-commit.sh +75 -0
  147. package/scripts/do-consumer-sweep.sh +18 -1
  148. package/scripts/do-cycle-shape-check.sh +160 -0
  149. package/scripts/do-decide.sh +476 -0
  150. package/scripts/do-derive-check.sh +436 -0
  151. package/scripts/do-fleet.sh +106 -28
  152. package/scripts/do-folder.sh +10 -1
  153. package/scripts/do-next.sh +106 -0
  154. package/scripts/do-orchestrate.sh +17 -5
  155. package/scripts/do-plan-json.mjs +201 -0
  156. package/scripts/do-plan-json.sh +8 -0
  157. package/scripts/do-preflight.sh +117 -0
  158. package/scripts/do-project.sh +157 -0
  159. package/scripts/do-prove-selftest.sh +108 -0
  160. package/scripts/do-prove.sh +295 -23
  161. package/scripts/do-rank.py +31 -1
  162. package/scripts/do-recon-cache.sh +7 -1
  163. package/scripts/do-recon-pack.sh +196 -0
  164. package/scripts/do-reconcile.sh +121 -4
  165. package/scripts/do-signal.sh +280 -23
  166. package/scripts/do-smoke.sh +18 -1
  167. package/scripts/do-test-gate.sh +80 -0
  168. package/scripts/do-tick.sh +102 -0
  169. package/scripts/do-tier.sh +6 -0
  170. package/scripts/do-triage.sh +182 -0
  171. package/scripts/do-ui-gate.sh +1 -1
  172. package/scripts/do-w4-gates.sh +451 -0
  173. package/scripts/do-walk.sh +12 -1
  174. package/scripts/env-sync.sh +173 -0
  175. package/scripts/factory-brief-check.sh +330 -0
  176. package/scripts/factory-check.sh +68 -14
  177. package/scripts/factory-close-check.sh +257 -0
  178. package/scripts/factory-emit.sh +211 -0
  179. package/scripts/factory-executor-check.mjs +353 -0
  180. package/scripts/factory-peak.sh +301 -0
  181. package/scripts/factory-repo.sh +118 -3
  182. package/scripts/factory-review-check.mjs +61 -0
  183. package/scripts/factory-ship.sh +61 -0
  184. package/scripts/factory-tasks-check.sh +18 -1
  185. package/scripts/factory-turn.sh +326 -0
  186. package/scripts/factory-walk.sh +396 -0
  187. package/scripts/factory-width.sh +57 -0
  188. package/scripts/fade-toxic.sh +4 -3
  189. package/scripts/fixtures/factory-brief-real.md +44 -0
  190. package/scripts/fixtures/triage-dupe.md +5 -0
  191. package/scripts/fleet-manifest.mjs +108 -0
  192. package/scripts/fleet-status.sh +110 -0
  193. package/scripts/full-suite-paths-check.sh +144 -0
  194. package/scripts/gate-reaper-check.sh +98 -0
  195. package/scripts/gate-reaper.sh +125 -0
  196. package/scripts/gate-run.sh +73 -0
  197. package/scripts/gc-content-check.sh +140 -0
  198. package/scripts/gen-dev-config.py +20 -0
  199. package/scripts/govern-bound-check.sh +60 -0
  200. package/scripts/govern-claims-check.sh +233 -0
  201. package/scripts/govern-mem-check.sh +290 -0
  202. package/scripts/governor-doors-check.sh +362 -0
  203. package/scripts/governor-escape-check.sh +171 -0
  204. package/scripts/health.sh +413 -0
  205. package/scripts/id-inventory.mjs +418 -0
  206. package/scripts/land.sh +551 -0
  207. package/scripts/lib/gc-finished.sh +77 -0
  208. package/scripts/lib/govern.sh +361 -0
  209. package/scripts/lib/govern.ts +756 -0
  210. package/scripts/lighthouse-run.sh +187 -0
  211. package/scripts/livekit-live-check.sh +61 -0
  212. package/scripts/livekit-ratchet.sh +46 -0
  213. package/scripts/load-guard-check.sh +49 -0
  214. package/scripts/machine-check.sh +102 -0
  215. package/scripts/machine-watch.sh +177 -0
  216. package/scripts/one-agents.mjs +415 -0
  217. package/scripts/one-resume.sh +78 -0
  218. package/scripts/orphan-baseline.json +182 -0
  219. package/scripts/orphan-modules.mjs +179 -0
  220. package/scripts/pr-body.sh +335 -0
  221. package/scripts/preview-fd-check.sh +289 -0
  222. package/scripts/promise-manifest.mjs +24 -1
  223. package/scripts/release.sh +322 -0
  224. package/scripts/roles-check.sh +946 -0
  225. package/scripts/sdk-build-cached.sh +64 -0
  226. package/scripts/signal-watch.sh +241 -0
  227. package/scripts/skills-publish.sh +94 -0
  228. package/scripts/speed-cache-check.sh +173 -0
  229. package/scripts/speed-check.mjs +907 -0
  230. package/scripts/speed-parity-check.sh +648 -0
  231. package/scripts/speed-waterfall-check.sh +355 -0
  232. package/scripts/substrate-env-parity.mjs +156 -0
  233. package/scripts/tasks-claim-race.mjs +108 -0
  234. package/scripts/tasks-loop.sh +185 -0
  235. package/scripts/test-cached.sh +255 -0
  236. package/scripts/test-full.sh +87 -0
  237. package/scripts/test-honesty.mjs +137 -0
  238. package/scripts/test-lanes.sh +166 -0
  239. package/scripts/test-speed.sh +94 -0
  240. package/scripts/triage-shape-check.sh +149 -0
  241. package/scripts/tsc-cached.sh +179 -0
  242. package/scripts/typedb-flake-check.sh +197 -0
  243. package/scripts/urls-lint.sh +15 -0
  244. package/scripts/verify-fast.sh +445 -0
  245. package/scripts/vespio-sync.sh +149 -0
  246. package/scripts/wf-check.mjs +104 -1
  247. package/scripts/worktree-preview.sh +879 -0
  248. package/scripts/worktree-up.sh +208 -0
  249. package/skills/livekit-agents/SKILL.md +285 -0
  250. package/skills/livekit-agents/references/freshness-rules.md +168 -0
  251. package/skills/shadcn/SKILL.md +1 -1
  252. package/skills/signal/SKILL.md +0 -1
  253. package/skills/voice/SKILL.md +94 -6
  254. package/skills/voice/corpus-check.sh +87 -0
  255. package/hooks/scripts/compact-hint.sh +0 -35
  256. package/hooks/scripts/gate-guard.sh +0 -83
  257. package/hooks/scripts/read-tracker.sh +0 -26
  258. package/hooks/scripts/session-end-verify.sh +0 -51
  259. package/hooks/scripts/stop-reflect.sh +0 -140
  260. package/hooks/scripts/sync-priority-todo.sh +0 -57
  261. package/hooks/scripts/sync-todo-docs.sh +0 -46
  262. package/hooks/scripts/tool-signal.sh +0 -48
  263. package/scripts/do-tasks-bridge.py +0 -366
@@ -63,10 +63,32 @@ manifest() {
63
63
  portable browser-check.mjs
64
64
  portable chrome.mjs
65
65
  portable do-analyze.sh
66
+ portable gate-reaper.sh
67
+ portable health.sh
68
+ portable govern-bound-check.sh
69
+ portable factory-width.sh
70
+ portable factory-executor-check.mjs
71
+ portable factory-peak.sh
66
72
  portable do-learn-loop.sh
67
73
  portable do-promise-lint.sh
68
74
  portable do-recon-cache.sh
75
+ portable do-cycle-shape-check.sh
76
+ portable do-next.sh
77
+ portable do-plan-json.sh
78
+ portable do-test-gate.sh
79
+ portable do-tick.sh
80
+ portable do-prove-selftest.sh
69
81
  portable do-validate-armed.py
82
+ portable factory-brief-check.sh
83
+ portable fixtures/triage-dupe.md
84
+ portable gate-run.sh
85
+ portable gate-reaper-check.sh
86
+ portable gc-content-check.sh
87
+ portable govern-mem-check.sh
88
+ portable governor-escape-check.sh
89
+ portable lib/gc-finished.sh
90
+ portable lib/govern.sh
91
+ portable lib/govern.ts
70
92
  portable package.json
71
93
  portable w1-recon.ts
72
94
  portable wf-check.mjs
@@ -78,6 +100,22 @@ needs-env do-fleet.sh
78
100
  needs-env do-folder.sh
79
101
  needs-env do-killswitch-audit.py
80
102
  needs-env do-orchestrate.sh
103
+ needs-env do-plan-json.mjs
104
+ needs-env do-commit.sh
105
+ needs-env do-brief.sh
106
+ needs-env test-speed.sh
107
+ needs-env do-recon-pack.sh
108
+ needs-env do-w4-gates.sh
109
+ needs-env sdk-build-cached.sh
110
+ needs-env astro-build-cached.sh
111
+ needs-env test-cached.sh
112
+ needs-env do-preflight.sh
113
+ needs-env tsc-cached.sh
114
+ needs-env load-guard-check.sh
115
+ needs-env governor-doors-check.sh
116
+ needs-env test-lanes.sh
117
+ needs-env test-full.sh
118
+ needs-env do-project.sh
81
119
  needs-env do-promise-settle.sh
82
120
  needs-env do-prove.sh
83
121
  needs-env do-reconcile.sh
@@ -85,14 +123,56 @@ needs-env do-rubric.py
85
123
  needs-env do-signal.sh
86
124
  needs-env do-survey.sh
87
125
  needs-env do-tier.sh
126
+ needs-env do-triage.sh
88
127
  needs-env do-untracked-gate.sh
89
128
  needs-env do-walk.sh
129
+ needs-env machine-check.sh
130
+ needs-env machine-watch.sh
90
131
  needs-env notify.sh
91
132
  needs-env reconcile-allow.txt
92
133
  needs-env rubric-weights.json
93
134
  needs-env w4-rubric.ts
135
+ needs-env govern-claims-check.sh
136
+ needs-env signal-watch.sh
137
+ monorepo-only substrate-env-parity.mjs
138
+ monorepo-only typedb-flake-check.sh
139
+ monorepo-only env-sync.sh
140
+ monorepo-only full-suite-paths-check.sh
141
+ monorepo-only land.sh
142
+ monorepo-only one-resume.sh
143
+ monorepo-only orphan-baseline.json
144
+ monorepo-only orphan-modules.mjs
145
+ needs-env worktree-preview.sh
146
+ needs-env factory-walk.sh
147
+ needs-env factory-turn.sh
148
+ needs-env factory-emit.sh
149
+ needs-env factory-close-check.sh
150
+ needs-env preview-fd-check.sh
151
+ portable factory-review-check.mjs
152
+ portable pr-body.sh
153
+ monorepo-only deploy-record.sh
154
+ monorepo-only deploy-emit.sh
155
+ needs-env fixtures/factory-brief-real.md
156
+ monorepo-only agentverse-audit.sh
157
+ monorepo-only asi-walk.sh
94
158
  monorepo-only cc-events-proof.sh
159
+ monorepo-only db-sync-lock-check.sh
160
+ monorepo-only skills-publish.sh
161
+ monorepo-only deploy.sh
162
+ monorepo-only factory-ship.sh
163
+ monorepo-only blocks-ratchet.sh
164
+ monorepo-only blocks-manifest.mjs
165
+ monorepo-only id-inventory.mjs
166
+ monorepo-only fleet-manifest.mjs
167
+ monorepo-only one-agents.mjs
168
+ monorepo-only blocks-render-probe.mjs
169
+ monorepo-only blocks-usage.mjs
170
+ monorepo-only lighthouse-run.sh
171
+ monorepo-only livekit-live-check.sh
172
+ monorepo-only speed-check.mjs
173
+ monorepo-only test-honesty.mjs
95
174
  monorepo-only do-consumer-sweep.sh
175
+ monorepo-only do-derive-check.sh
96
176
  monorepo-only do-rank.py
97
177
  monorepo-only do-smoke.sh
98
178
  monorepo-only do-substrate-check.sh
@@ -100,12 +180,18 @@ monorepo-only do-tasks-wire-check.sh
100
180
  monorepo-only do-ui-gate.sh
101
181
  monorepo-only factory-check.sh
102
182
  monorepo-only factory-repo.sh
183
+ monorepo-only deploy-gate-check.sh
184
+ monorepo-only release.sh
103
185
  monorepo-only factory-tasks-check.sh
104
186
  monorepo-only fade-toxic.sh
105
187
  monorepo-only hourly-brief.sh
188
+ monorepo-only livekit-ratchet.sh
106
189
  monorepo-only outcome-pull.ts
107
190
  monorepo-only promise-manifest.mjs
191
+ monorepo-only roles-check.sh
192
+ monorepo-only ad-copy-lint.sh
108
193
  monorepo-only spine-canary.sh
194
+ monorepo-only worktree-up.sh
109
195
  monorepo-only subdomains-proof.sh
110
196
  monorepo-only sync-claude-mirror.sh
111
197
  monorepo-only tg-listen.sh
@@ -117,6 +203,16 @@ monorepo-only typedb-probes/containment-probe.py
117
203
  monorepo-only typedb-probes/panic-probe-version.py
118
204
  monorepo-only typedb-probes/panic-probe.py
119
205
  monorepo-only urls-lint.sh
206
+ monorepo-only deploy-dev.sh
207
+ monorepo-only fleet-status.sh
208
+ monorepo-only gen-dev-config.py
209
+ monorepo-only speed-cache-check.sh
210
+ monorepo-only speed-parity-check.sh
211
+ monorepo-only speed-waterfall-check.sh
212
+ monorepo-only tasks-claim-race.mjs
213
+ monorepo-only tasks-loop.sh
214
+ monorepo-only verify-fast.sh
215
+ monorepo-only vespio-sync.sh
120
216
  MANIFEST
121
217
  }
122
218
 
@@ -129,6 +225,7 @@ text/contracts.md
129
225
  text/dictionary.md
130
226
  text/do.md
131
227
  text/do-engine-plan.md
228
+ text/do-reference.md
132
229
  text/docs.md
133
230
  text/dsl.md
134
231
  text/one-loop.md
@@ -154,6 +251,7 @@ text/agent-template-plan.md
154
251
  text/marketplace.md
155
252
  text/factory.md
156
253
  text/factory-plan.md
254
+ text/workflows.md
157
255
  CANON
158
256
  }
159
257
 
@@ -169,6 +267,11 @@ company text/remote-suspend-todo.md
169
267
  company text/sdk-mcp-cli-schema-design-integration.md
170
268
  company text/agent-api-plan.md
171
269
  company text/workflow-bridge-plan.md
270
+ # factory-do.md is this company's factory LEDGER — 5.5k lines of measured runs,
271
+ # one machine path. guide.md and factory-executor.js cite it as the design
272
+ # source, which is true; the design the loop needs is text/factory-plan.md,
273
+ # which ships.
274
+ company text/factory-do.md
172
275
  stale text/feature.md
173
276
  stale text/loop-log-archive.md
174
277
  stale text/rich-messages.md
@@ -189,6 +292,7 @@ excluded_claude() {
189
292
  .claude/commands/db-sync.md
190
293
  .claude/commands/deploy.md
191
294
  .claude/commands/release.md
295
+ .claude/commands/one.md
192
296
  .claude/commands/oo-push.md
193
297
  .claude/skills/dev.md
194
298
  .claude/skills/build.md
@@ -853,7 +957,7 @@ priority you author is the starting point, not the final order.
853
957
  | `.claude/agents/` | the four build waves — recon, decide, edit, verify |
854
958
  | `.claude/skills/` | domain skills the loop pulls in on match |
855
959
  | `.claude/rules/` | auto-loaded per file glob |
856
- | `.claude/hooks/` | the gates — staging guards, doc-sync, outcome checks |
960
+ | `.claude/hooks/` | the gates — staging guards, config guard, outcome check |
857
961
  | `.claude/scripts/` | the deterministic checks: promise lint, reconcile, rubric, walk |
858
962
  | `text/` | the canon the loop reads, and the doc templates it writes from |
859
963
  | `tests/` | this repo's own suite — it reaches into nothing |
@@ -1314,8 +1418,19 @@ verify() {
1314
1418
  "${FACTORY_VERIFY_PROMPT:-/do PATCH: create docs/standalone-proof.md — a short file recording that this tree closed a /do cycle with no monorepo on disk, naming the date and what the boundary suite asserts. The file does not exist yet; create it. Then run \`bun test tests/\` and report the count. Close the cycle properly.}"
1315
1419
  ) > "$log" 2>&1
1316
1420
  after="$(cd "$T" && git status --porcelain | wc -l | tr -d ' ')"
1317
- local suite; suite="$(cd "$T" && bun test tests/ 2>&1 | grep -oE '[0-9]+ pass' | head -1)"
1318
- if [ "$after" -gt 0 ] && [ -n "$suite" ] && ! (cd "$T" && bun test tests/ 2>&1 | grep -qE '[1-9][0-9]* fail'); then
1421
+ # Run the suite ONCE and match the captured text. The old form ran it twice
1422
+ # and the second run was a false GREEN: `bun test | grep -qE 'fail'` under
1423
+ # `set -o pipefail` (line 25) returns 141, not 0, when it MATCHES — grep -q
1424
+ # exits on the first hit, bun is still writing, bun takes SIGPIPE. That 141
1425
+ # then went through the surrounding `! ( … )`, which inverts any non-zero to
1426
+ # true. Measured 2026-08-04 against a suite reporting `201 pass 1 fail`:
1427
+ # this branch reported the clone's boundary suite green. A false pass on the
1428
+ # gate that decides whether the factory repo ships.
1429
+ local suite_out; suite_out="$(cd "$T" && bun test tests/ 2>&1 || true)"
1430
+ local suite; suite="$(grep -m1 -oE '[0-9]+ pass' <<<"$suite_out" || true)"
1431
+ local suite_failed=0
1432
+ if grep -qE '[1-9][0-9]* fail' <<<"$suite_out"; then suite_failed=1; fi
1433
+ if [ "$after" -gt 0 ] && [ -n "$suite" ] && [ "$suite_failed" -eq 0 ]; then
1319
1434
  pass "a real cycle ran in the clone and left the boundary suite green — $after file(s) changed, $suite"
1320
1435
  else
1321
1436
  fail "the cycle did not close — $after file(s) changed, suite: ${suite:-none}"
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ // classification: portable
3
+ // Red proof for factory-executor.js's Review predicate — and it READS THE FILE.
4
+ //
5
+ // The first version of this checker defined OLD and NEW as two inline lambdas
6
+ // and never opened the executor. It stayed green through two merges on
7
+ // 2026-09-06 while the executor's own line was fail-open (`0*2 > 1` = false
8
+ // for zero survivors). A checker that cannot see its subject proves nothing;
9
+ // this one lifts the predicate out of the source with new Function, drives it
10
+ // over the jury table beside the OLD shape, and fails closed if the lines it
11
+ // expects are not in the file.
12
+ import { readFileSync } from 'node:fs'
13
+ import { fileURLToPath } from 'node:url'
14
+ import { dirname, join } from 'node:path'
15
+
16
+ const here = dirname(fileURLToPath(import.meta.url))
17
+ const file = process.argv[2] || join(here, '..', 'workflows', 'factory-executor.js')
18
+ const src = readFileSync(file, 'utf8')
19
+
20
+ // Lift the two lines that ARE the predicate. Anchored on the const names, not
21
+ // on the arithmetic, so a wrong formula is caught by the table, not by the regex.
22
+ const mAgainst = src.match(/^\s*const against = (.+)$/m)
23
+ const mRefuted = src.match(/^\s*const refuted = (.+)$/m)
24
+ if (!mRefuted) {
25
+ console.log(`RED could not lift the Review predicate from ${file} — expected a \`const refuted = …\` line`)
26
+ process.exit(1)
27
+ }
28
+ // A pre-fix file has no `against` line; derive it so the OLD shape is DRIVEN and
29
+ // fails on the table (a wrong verdict), rather than tripping the regex (a miss).
30
+ const againstExpr = mAgainst ? mAgainst[1] : 'votes.filter((v) => v.refuted).length'
31
+ let LIFTED
32
+ try {
33
+ LIFTED = new Function('votes', `const against = ${againstExpr}; return ${mRefuted[1]};`)
34
+ } catch (e) {
35
+ console.log(`RED lifted predicate does not parse: ${e.message}`); process.exit(1)
36
+ }
37
+ const OLD = (v) => v.filter(x => x.refuted).length * 2 > Math.max(1, v.length)
38
+
39
+ const R = { refuted: true }, A = { refuted: false }
40
+ const cases = [
41
+ ['zero survivors (every lens threw)', [], true, 'THE BUG: nobody voted, so nobody objected'],
42
+ ['1 lens, refutes', [R], true, 'lone lens must bite'],
43
+ ['1 lens, approves', [A], false, 'lone lens approves'],
44
+ ['2 lenses split 1-1', [R, A], true, 'a split jury is not an acquittal'],
45
+ ['2 lenses both refute', [R, R], true, 'unanimous against'],
46
+ ['2 lenses both approve', [A, A], false, 'unanimous for'],
47
+ ['3 lenses, 1 refutes', [R, A, A], false, 'a lone dissenter is not a majority'],
48
+ ['3 lenses, 2 refute', [R, R, A], true, 'majority against'],
49
+ ]
50
+ let oldFails = 0, fileFails = 0
51
+ console.log(`predicate lifted from ${file}\n against = ${againstExpr}${mAgainst ? '' : ' (derived — file has no against line)'}\n refuted = ${mRefuted[1]}\n`)
52
+ console.log('case want OLD FILE')
53
+ for (const [name, votes, want, why] of cases) {
54
+ const o = OLD(votes), f = LIFTED(votes)
55
+ if (o !== want) oldFails++
56
+ if (f !== want) fileFails++
57
+ console.log(`${name.padEnd(36)} ${String(want).padEnd(6)} ${o === want ? ' ok ' : 'RED '} ${f === want ? ' ok' : 'RED'} ${f !== want ? '<- FILE WRONG: ' + why : ''}`)
58
+ }
59
+ console.log(`\nOLD shape: ${oldFails} failure(s) <- must be > 0 or this proof is worthless`)
60
+ console.log(`FILE: ${fileFails} failure(s) <- must be 0`)
61
+ process.exit(oldFails > 0 && fileFails === 0 ? 0 : 1)
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env bash
2
+ # factory-ship.sh — G4 (cycle 13, text/factory-do.md § The gaps, filled):
3
+ # highway-only auto-ship. Called from factory-executor.js's Close stage after
4
+ # a task closes verdict:ok — never before, never on a red/unrun verdict.
5
+ #
6
+ # manifest: monorepo-only
7
+ #
8
+ # Decision mirrors one.ie/web/src/lib/route-verdict.ts's shouldAutoShip(reason,
9
+ # tier) — the ONLY case that skips the human deploy.sh Step 6 approval prompt
10
+ # is reason=highway AND tier=patch (case-insensitive). FEATURE and SCHEMA never
11
+ # auto-skip regardless of reason; a warn on the ship:<surface> path drops the
12
+ # route below harden (verdictFor in route-verdict.ts), reason flips away from
13
+ # 'highway', and this script falls through to the prompt path instead of an
14
+ # unattended deploy.
15
+ #
16
+ # Usage:
17
+ # bash .claude/scripts/factory-ship.sh --reason <highway|classified|ceo> --tier <patch|fix|feature|schema> [--dry-run]
18
+ #
19
+ # Exit 0 always. Prints one line: either
20
+ # SHIP: deploying unprompted (reason=highway tier=patch)
21
+ # or
22
+ # PROMPT: human approval required (reason=<r> tier=<t>)
23
+ # --dry-run prints what WOULD run instead of invoking deploy.sh (used by tests
24
+ # and by any caller that wants the decision without the side effect).
25
+ set -uo pipefail
26
+ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
27
+
28
+ [[ -d "$ROOT/one.ie/web" && -d "$ROOT/pay/backend" ]] || {
29
+ echo "factory-ship.sh: not the one-ie monorepo: $ROOT" >&2
30
+ exit 2
31
+ }
32
+
33
+ REASON="" TIER="" DRY=0
34
+ while [[ $# -gt 0 ]]; do
35
+ case "$1" in
36
+ --reason) REASON="${2:-}"; shift 2 ;;
37
+ --tier) TIER="${2:-}"; shift 2 ;;
38
+ --dry-run) DRY=1; shift ;;
39
+ *) shift ;;
40
+ esac
41
+ done
42
+
43
+ [[ -n "$REASON" && -n "$TIER" ]] || {
44
+ echo "factory-ship.sh: --reason and --tier are required" >&2
45
+ exit 2
46
+ }
47
+
48
+ tier_lc="$(printf '%s' "$TIER" | tr '[:upper:]' '[:lower:]')"
49
+
50
+ if [[ "$REASON" == "highway" && "$tier_lc" == "patch" ]]; then
51
+ echo "SHIP: deploying unprompted (reason=$REASON tier=$TIER)"
52
+ if [[ "$DRY" -eq 1 ]]; then
53
+ echo "[dry-run] would run: DEPLOY_YES=1 bash $ROOT/.claude/scripts/deploy.sh --yes"
54
+ exit 0
55
+ fi
56
+ DEPLOY_YES=1 bash "$ROOT/.claude/scripts/deploy.sh" --yes
57
+ exit $?
58
+ fi
59
+
60
+ echo "PROMPT: human approval required (reason=$REASON tier=$TIER)"
61
+ exit 0
@@ -22,6 +22,23 @@
22
22
  # pointed at production writes fabricated rungs into the graph the board reads.
23
23
  set -uo pipefail
24
24
 
25
+ # _GATE — route a heavy compute through the machine governor. A gate_lock only
26
+ # dedupes IDENTICAL work; a SLOT is what bounds N worktrees each running one of
27
+ # these at once (measured 2026-09-07: three concurrent 2.5GB typecheckers, every
28
+ # lock uncontended, load 171). Empty when already inside a gate, so a nested call
29
+ # inherits the outer slot rather than taking a second one.
30
+ #
31
+ # Resolves gate-run.sh from its OWN directory, deliberately: an earlier version
32
+ # keyed off $ROOT and got inserted above the line that sets it, so _GATE was
33
+ # silently empty and every call ran ungoverned -- a fail-OPEN, which is the exact
34
+ # defect this preamble exists to close.
35
+ _GATE=()
36
+ if [ "${GOVERN_IN_GATE:-0}" != "1" ]; then
37
+ _GR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/gate-run.sh"
38
+ [ -f "$_GR" ] && _GATE=( bash "$_GR" "compute:$(basename "${BASH_SOURCE[0]}")" -- )
39
+ fi
40
+
41
+
25
42
  ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
26
43
  MODE="${1:-ladder-live}"
27
44
 
@@ -59,7 +76,7 @@ check_ladder_live() {
59
76
  TYPEDB_USERNAME="$TYPEDB_USERNAME" \
60
77
  TYPEDB_PASSWORD="$TYPEDB_PASSWORD" \
61
78
  TYPEDB_TEST_DB="$TYPEDB_TEST_DB" \
62
- bunx vitest run src/lib/resolvers/factory-ladder-live.test.ts 2>&1)
79
+ "${_GATE[@]}" bunx vitest run src/lib/resolvers/factory-ladder-live.test.ts 2>&1)
63
80
 
64
81
  # An empty scratch db answers "Type label 'thing' not found" — the schema was never
65
82
  # loaded there. That is an environment gap, not a broken ladder.