@williacj/rigger 0.0.0-stage → 0.1.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 (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +370 -2
  3. package/package.json +56 -4
  4. package/scripts/doc-reference-check.mjs +59 -0
  5. package/scripts/gate-check.mjs +249 -0
  6. package/scripts/lib/pack-result.mjs +9 -0
  7. package/scripts/record-commit.mjs +67 -0
  8. package/src/cli/doctor.mjs +1021 -0
  9. package/src/cli/init.mjs +384 -0
  10. package/src/cli/once.mjs +489 -0
  11. package/src/cli/pause.mjs +56 -0
  12. package/src/cli/plan.mjs +106 -0
  13. package/src/cli/recording.mjs +52 -0
  14. package/src/cli/report.mjs +242 -0
  15. package/src/cli/resume.mjs +96 -0
  16. package/src/cli/rigger.mjs +12 -0
  17. package/src/cli/run.mjs +10 -0
  18. package/src/cli/setup-board.mjs +108 -0
  19. package/src/cli/verbs.mjs +82 -0
  20. package/src/cli/verdict.mjs +180 -0
  21. package/src/config/validate.mjs +960 -0
  22. package/src/execution/groups.mjs +185 -0
  23. package/src/execution/kept-output.mjs +21 -0
  24. package/src/execution/role.mjs +171 -0
  25. package/src/execution/run.mjs +490 -0
  26. package/src/execution/step.mjs +26 -0
  27. package/src/execution/workspace.mjs +866 -0
  28. package/src/observation/push.mjs +103 -0
  29. package/src/observation/report.mjs +415 -0
  30. package/src/observation/sink.mjs +271 -0
  31. package/src/package-commit.json +1 -0
  32. package/src/scheduling/admission.mjs +390 -0
  33. package/src/scheduling/clock.mjs +98 -0
  34. package/src/scheduling/lane.mjs +160 -0
  35. package/src/scheduling/loop.mjs +1738 -0
  36. package/src/scheduling/pull-order.mjs +46 -0
  37. package/src/substrate/data-ref.mjs +147 -0
  38. package/src/substrate/forge/assets.mjs +5 -0
  39. package/src/substrate/forge/graphql.mjs +258 -0
  40. package/src/substrate/forge/item-write.mjs +74 -0
  41. package/src/substrate/forge/read.mjs +998 -0
  42. package/src/substrate/forge/repository-write.mjs +152 -0
  43. package/src/substrate/forge/runners.mjs +510 -0
  44. package/src/substrate/forge/schema-write.mjs +70 -0
  45. package/src/substrate/forge/write-made.mjs +40 -0
  46. package/src/substrate/git-environment.mjs +54 -0
  47. package/src/substrate/host.mjs +23 -0
  48. package/src/substrate/launchd.mjs +23 -0
  49. package/src/substrate/process-table.sh +48 -0
  50. package/src/substrate/process.mjs +2474 -0
  51. package/src/substrate/providers/adapters.mjs +8 -0
  52. package/src/substrate/providers/claude.mjs +427 -0
  53. package/src/substrate/providers/codex.mjs +349 -0
  54. package/src/substrate/standard-error.mjs +134 -0
  55. package/src/substrate/worktrees.mjs +517 -0
  56. package/src/workflow/clock-mark.mjs +40 -0
  57. package/src/workflow/escalation.mjs +110 -0
  58. package/src/workflow/facts.mjs +92 -0
  59. package/src/workflow/first-above.mjs +17 -0
  60. package/src/workflow/form-check.mjs +88 -0
  61. package/src/workflow/gate.mjs +62 -0
  62. package/src/workflow/judges.mjs +695 -0
  63. package/src/workflow/marker.mjs +265 -0
  64. package/src/workflow/next-action.mjs +456 -0
  65. package/src/workflow/status-issue.mjs +268 -0
  66. package/src/workflow/transitions.mjs +588 -0
  67. package/templates/claude/agents/architect.md +116 -0
  68. package/templates/claude/agents/engineer.md +57 -0
  69. package/templates/claude/agents/pm.md +114 -0
  70. package/templates/claude/agents/reviewer.md +37 -0
  71. package/templates/claude/agents/spike-engineer.md +80 -0
  72. package/templates/claude/hooks/refuse-reserved-git-commands.mjs +909 -0
  73. package/templates/claude/settings.json +50 -0
  74. package/templates/claude/skills/acceptance/SKILL.md +275 -0
  75. package/templates/claude/skills/agent-style/SKILL.md +78 -0
  76. package/templates/claude/skills/code-review/SKILL.md +242 -0
  77. package/templates/claude/skills/proposal/SKILL.md +175 -0
  78. package/templates/claude/skills/spec-style/SKILL.md +112 -0
  79. package/templates/claude/skills/tdd/SKILL.md +230 -0
  80. package/templates/codex/config.toml +19 -0
  81. package/templates/doc-reference-check.md +25 -0
  82. package/templates/githooks/pre-push +24 -0
  83. package/templates/github/workflows/rigger-gate.yml +209 -0
  84. package/templates/launchd/com.williacj.rigger.plist +31 -0
  85. package/templates/rigger.config.mjs +78 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CJ Williams
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,371 @@
1
- # Temporary Holding Version
1
+ # Rigger
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Rigger is the engine that lets your AI agents deliver work you defined, to a standard you set,
4
+ while you do something else.** Agents pull cards from your board and do the work in isolation.
5
+ Different agents review it against a procedure you define, and nothing merges without their verdict.
6
+ A feature, writing a doc, website change or even deep analysis: the loop is the same.
7
+
8
+ [![CI](https://github.com/williacj/rigger/actions/workflows/ci.yml/badge.svg)](https://github.com/williacj/rigger/actions/workflows/ci.yml)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
10
+ [![Status: v0](https://img.shields.io/badge/Status-v0-blue.svg)](#status)
11
+
12
+ It decides which of your cards to work on next, keeps the agent that made a change from being the
13
+ agent that approves it, and recognizes the decisions that are not its to make. Everything else it
14
+ finishes on its own, or stops and says why.
15
+
16
+ It is not a kanban UI where a person reviews every diff, and it is not a methodology plugin that
17
+ improves one agent's session. It runs with nobody watching, and
18
+ the merge gate is enforced by a required check on the forge, not by a prompt.
19
+
20
+ ## Table of contents
21
+
22
+ - [Background](#background)
23
+ - [How it works](#how-it-works)
24
+ - [A piece of work, start to finish](#a-piece-of-work-start-to-finish)
25
+ - [The guarantee](#the-guarantee)
26
+ - [Security](#security)
27
+ - [Status](#status)
28
+ - [Prerequisites](#prerequisites)
29
+ - [Install and usage](#install-and-usage)
30
+ - [Configuration](#configuration)
31
+ - [Support](#support)
32
+ - [Architecture](#architecture)
33
+ - [What Rigger learns](#what-rigger-learns)
34
+ - [Telemetry](#telemetry)
35
+ - [Contributing](#contributing)
36
+ - [Maintainers](#maintainers)
37
+ - [License](#license)
38
+
39
+ ## Background
40
+
41
+ One agent can do one task, and do it well. Doing it a hundred times, unattended, to a standard that
42
+ holds up, is a different problem. Something has to choose the next piece of work, isolate each piece of work,
43
+ get it reviewed by someone other than its author, merge it only when the review is fresh, and know
44
+ when to stop and ask. Rigger is that something.
45
+
46
+ ## How it works
47
+
48
+ | | |
49
+ |---|---|
50
+ | **You describe, Rigger decomposes** | Work arrives as cards: you write them, a clock trigger creates them, or an intake role breaks a larger need down into cards and puts them on the board. Every card runs the same loop from there. |
51
+ | **The board is the truth** | A GitHub Projects v2 board holds every card and its column. Rigger reads it, moves cards, and keeps no workflow state of its own. If it stops mid-card, the restart re-reads the board and picks the card up again; half-finished work never merges. |
52
+ | **Every card carries its acceptance** | Before any work starts, a card states what done means, as items a judge can test. The maker finishes against that acceptance, each judge rules on every item in it, and a card carrying none is not admitted. |
53
+ | **One worktree per card** | Each card gets an isolated git worktree and a deterministic branch. Agents never share a checkout, so multiple cards run at once on a host, with the local git operations that need serializing serialized. |
54
+ | **One maker, one or more judges** | One agent produces the work and opens a pull request. One or more different agents, each in its own dispatch, review it against the card's acceptance and your procedure, and write a verdict bound to the exact head SHA. A new commit stales it, and so does a revised acceptance. |
55
+ | **The gate is mechanical** | A required check on the forge refuses any merge into the default branch that lacks a verdict fresh for both the head commit and the card's current acceptance. No prompt can talk it out of that. |
56
+ | **Escalates only what you must decide** | Everything else Rigger finishes. When a card needs a decision only you can make, Rigger escalates it with the reason and the evidence, and nothing proceeds until you answer. Rigger's own documents call you the **owner**. |
57
+
58
+ ## A piece of work, start to finish
59
+
60
+ ![rigger once claims card #12 from board 3 and dispatches its maker; the maker exits 0 and opens no pull request, so Rigger escalates the card as ambiguous and once exits 1, naming its workspace](docs/demo.gif)
61
+
62
+ 1. A piece of work starts as a **card**: an issue on your board. You write it, a clock trigger
63
+ creates it, or an intake role breaks a larger need into several — ex. a product manager
64
+ drafting requirements, judged by a designer and an architect, then by you. Whoever writes the
65
+ card also writes its **acceptance** — what done means, as items a judge can test. Whatever its
66
+ origin, it lands in **Ready**, in priority order.
67
+ 2. Rigger claims it, creates a worktree on a branch derived from the card by a rule you set, and
68
+ runs your
69
+ provisioning steps. A step you marked required must succeed; an optional one that fails is
70
+ logged, and the work proceeds.
71
+ 3. The **maker** runs in that worktree, commits, and opens a pull request. The card moves to
72
+ **Review**.
73
+ 4. Each **judge** you configured for that kind of work runs in its own dispatch and reviews the
74
+ pull request against the card's acceptance and your procedure. It posts its findings and writes
75
+ a marker bound to the head SHA, holding its verdict and every acceptance item, met or unmet. A
76
+ judge that finds the acceptance did not cover what the card asked returns the card to whoever
77
+ wrote it, rather than rewriting the acceptance. Judges do not see each other's verdicts.
78
+ 5. If any judge asks for changes, the maker revises and every judge reviews the new commit. That
79
+ continues until every verdict is sound or the loop reaches its limit.
80
+ 6. If you named yourself the last judge for this kind of work, you are asked now, and not before.
81
+ When every verdict is sound and your CI is green, the gate admits the merge. The card moves to
82
+ **Done**.
83
+ 7. At any step, anything only you can decide is escalated to you with the reason and the evidence.
84
+ The card moves to **Owner** and waits.
85
+
86
+ Every piece of work ends in one of three places: merged, escalated to you with the reason
87
+ attached, or back with whoever wrote the card, because its acceptance did not cover what the work
88
+ asked for.
89
+
90
+ ## The guarantee
91
+
92
+ **The role that makes a thing never judges it.**
93
+
94
+ There is one maker and at least one judge, and no judge is the maker. Each judge runs in its own
95
+ dispatch, only judges write verdicts, every verdict binds to the exact commit it reviewed, and a
96
+ new commit stales all of them — as does a revised acceptance. When there is a panel, the merge
97
+ needs every judge's verdict.
98
+ No configuration removes that separation. An engine that could approve its own work would be a
99
+ faster way to merge mistakes.
100
+
101
+ The pairing is yours to name, and the same loop runs each one:
102
+
103
+ - an engineer and a code reviewer;
104
+ - a designer and a design reviewer;
105
+ - a spike engineer answering a question and a reviewer judging whether the writeup answers it;
106
+ - a writer and an editor;
107
+ - a product manager proposing requirements, judged by a designer and an architect, and then by
108
+ you.
109
+
110
+ Sometimes the last judge is you. Where you named yourself last for a kind of work, the agent
111
+ judges rule first, so what reaches you has already been vetted.
112
+
113
+ ## Security
114
+
115
+ Rigger merges code without a person in the loop, so this section is explicit.
116
+
117
+ **What Rigger does on its own:**
118
+
119
+ - creates cards on your board, from a clock trigger or from a role decomposing larger work;
120
+ - creates the board's columns, fields and labels, when you run `setup-board`;
121
+ - creates branches and worktrees, and runs the provisioning steps you configured;
122
+ - dispatches your agent CLI;
123
+ - opens and comments on pull requests, and merges the ones that pass the gate;
124
+ - files follow-up issues, comments on card issues, adds labels to card issues, and moves cards between columns;
125
+ - opens the status issue with its label and puts it on the board, then removes that label and closes the issue;
126
+ - pushes the event stream to a data ref in your repository, if you turn that on.
127
+
128
+ **What Rigger never does:**
129
+
130
+ - approve its own work;
131
+ - merge without a verdict fresh for both the head commit and the card's acceptance;
132
+ - ratify a change to one of your recorded decisions;
133
+ - push to the default branch except through a gated merge;
134
+ - post your verdict for you: `rigger verdict` posts one only once you confirm it at your terminal;
135
+ - continue past an ambiguity it cannot resolve.
136
+
137
+ **Credentials.** Rigger stores none. It calls `gh` and your agent CLI, each authenticated by you,
138
+ and inherits exactly the permissions you gave them. Scope those permissions with each tool's own
139
+ settings.
140
+
141
+ **Agents run as you.** A maker or judge runs with your user's access to the machine and to the
142
+ repository. Rigger contains the process groups it creates, and the processes of your user that
143
+ work in the directory it made for a dispatch or below it. When a dispatch ends, Rigger ends every
144
+ process left in its group or working in its directory, unless Rigger itself is killed outright.
145
+ Where Rigger's own exit runs past a fixed time, it ends each remaining group without searching that group's directories, and its next start ends what remains in them. Until that start, such a process keeps running.
146
+ Otherwise, Rigger ends a process of yours working in a running dispatch's directory, such as a shell, when
147
+ that dispatch ends. A process that leaves its group and works elsewhere is outside that
148
+ containment. While Rigger holds a sign that a dispatch's process may have outlived the dispatch,
149
+ it starts no further dispatch for your repository and names the sign;
150
+ `docs/spec/requirements.md` says what counts as a sign. Rigger cannot make an agent more
151
+ restricted than the account it runs under.
152
+ An agent running as you can still post a verdict in your name with `gh`, or confirm one with
153
+ `rigger verdict` at a terminal it opens itself, and the gate cannot tell either from yours.
154
+
155
+ **Agents use only what your repository declares.** A dispatched agent uses only the tools and
156
+ connectors your repository declares. A connector is an outside service, such as mail or a shop,
157
+ that an agent acts on through your own login. A dispatched agent never uses a connector you
158
+ connected to your own account unless your repository declares it. Where your repository allows a
159
+ Bash command that runs an agent CLI, such as `claude` or `codex`, a dispatched agent running it
160
+ acts with your account. So that rule gives the agent your account.
161
+ `docs/spec/requirements.md` says what counts as declared.
162
+
163
+ **Telemetry is yours.** See [Telemetry](#telemetry).
164
+
165
+ ## Status
166
+
167
+ **v0, released on npm.** Rigger is built in the open in this repository. There have been several
168
+ private versions of Rigger to prove out the concept and identify key requirements.
169
+
170
+ Milestones, in order:
171
+
172
+ | | Milestone |
173
+ |---|---|
174
+ | M0 | Skeleton, agent assets, consumer contract |
175
+ | M1 | Board client and scheduler |
176
+ | M2 | Execution core |
177
+ | M3 | Worktrees and provisioning |
178
+ | M4 | Roles |
179
+ | M5 | Gate and merge |
180
+ | M6 | Escalation and infrastructure hold |
181
+ | M7 | Report complete, clock triggers |
182
+ | M8 | Acceptance on Emend |
183
+ | M9 | Object-level improvement loop |
184
+ | M10 | Meta-level improvement loop |
185
+
186
+ Emend is a separate project that is built using Rigger; M8 is where Rigger proves itself on a repository that is not
187
+ its own. Each milestone's exit test is in `docs/v0-build-plan.md`, which owns them. v0 is M0
188
+ through M8.
189
+ The improvement loops follow as M9 and M10. Not planned for v0: an adjudicator role and the
190
+ triage lane that routes to it, conflict domains declared per card, resume,
191
+ multi-host coordination, and native Windows. `docs/spec/decisions.md` records each one and the
192
+ evidence that would bring it back.
193
+
194
+ ## Prerequisites
195
+
196
+ - A GitHub repository with a Projects v2 board. `rigger setup-board` creates the columns, fields
197
+ and labels.
198
+ - [`gh`](https://cli.github.com/) version 2.97.0 or later, authenticated with access to that
199
+ repository and board.
200
+ - One coding-agent CLI, authenticated. Claude Code is the default adapter; Codex is shipped beside it.
201
+ - Node.js 24 or later.
202
+ - **macOS** today. **Windows** is planned through WSL2, pending a spike; native Windows is not in
203
+ v0. Linux is untested as a host in its own right, though the WSL2 route runs on it.
204
+ - The owner provisions the forge settings needed by the required check; see
205
+ [What the owner provisions](ARCHITECTURE.md#what-the-owner-provisions). Run `rigger doctor` to
206
+ check that setup.
207
+
208
+ For repository development and testing, see the [macOS guide](docs/testing-macos.md) or the
209
+ [experimental Windows/WSL guide](docs/testing-windows.md). Windows uses Ubuntu on WSL 2 for
210
+ the ordinary test suite; engine installation and supported engine hosts are separate.
211
+
212
+ ## Install and usage
213
+
214
+ > Published on npm as `@williacj/rigger`. `rigger --help` lists exactly the verbs below, in this
215
+ > order.
216
+
217
+ ```bash
218
+ npx @williacj/rigger init # write a starter config, fork the role templates
219
+ npx @williacj/rigger doctor # check Node, gh version, gh auth, agent CLI auth, config, board reachability, board columns, board priority field, board sharing, gate check required, admission, launchd job
220
+ npx @williacj/rigger setup-board # create the board columns, fields, and labels
221
+ npx @williacj/rigger plan # show what the next run would pull, and what it refuses, though no sign that would stop that run
222
+ npx @williacj/rigger once # pull and finish one card, then exit
223
+ npx @williacj/rigger run # run until the board drains, or, while a clock trigger is declared, until stopped
224
+ npx @williacj/rigger pause # stop admitting new cards; in-flight cards finish
225
+ npx @williacj/rigger resume # reopen admission and close the status issue
226
+ npx @williacj/rigger report # derive the signals from the event stream
227
+ npx @williacj/rigger verdict <pr> <verdict> # post your verdict on a pull request, once you confirm it
228
+ ```
229
+
230
+ Elsewhere in this document the commands are written in short form; `rigger <verb>` means
231
+ `npx @williacj/rigger <verb>`.
232
+
233
+ How to operate Rigger is in the [guide](docs/guide.md), and where to look each fact up is in the
234
+ [reference](docs/reference.md).
235
+
236
+ Unattended runs on macOS use launchd, whose assets are part of the substrate Rigger ships.
237
+
238
+ ### Installing the launchd job
239
+
240
+ On macOS, one per-user LaunchAgent re-launches `rigger run`, and `D28` records why. Installing it
241
+ changes your host, so you install it yourself. In these steps, `<uid>` is what `id -u` prints.
242
+
243
+ 1. Copy `templates/launchd/com.williacj.rigger.plist` from the installed package to
244
+ `~/Library/LaunchAgents/`.
245
+ 2. In that copy, replace each placeholder with its value:
246
+
247
+ | Placeholder | What you write |
248
+ |---|---|
249
+ | `__RIGGER__` | the absolute path of an installed package's `rigger` executable. It lies outside the repository `__REPOSITORY__` names (`R-SAFE-5`). It is neither a link into a Rigger source checkout (`AGENTS.md`, "Self-hosting") nor a path in `npx`'s cache. |
250
+ | `__REPOSITORY__` | the absolute path of the repository the engine runs against |
251
+ | `__PATH__` | a `PATH` that reaches `node`, `gh`, `claude` and `codex` (`ARCHITECTURE.md`, "Triggers", "The environment") |
252
+ | `__HOME__` | your home directory |
253
+ | `__START_INTERVAL__` | the seconds launchd waits, after a run exits, before starting the next |
254
+ | `__EXIT_TIMEOUT__` | the seconds launchd waits at the job's exit, at least the bound `ARCHITECTURE.md`'s "Triggers" sets; 60 is enough on every macOS Rigger supports |
255
+
256
+ 3. Install the job, re-install it, or apply an edit to the plist, with these two commands:
257
+
258
+ ```bash
259
+ launchctl bootout gui/<uid>/com.williacj.rigger
260
+ launchctl bootstrap gui/<uid> ~/Library/LaunchAgents/com.williacj.rigger.plist
261
+ ```
262
+
263
+ - Before a first install, the `bootout` exits 3, `No such process`, which is harmless
264
+ ([S2 report](docs/spikes/launchd-lost-cells.md), Q-o2).
265
+ - The `bootstrap` then exits 0, and the job starts at once, because the template sets
266
+ `RunAtLoad` (S2 report, Q-a2).
267
+ - A `bootstrap` of a label already loaded exits 5 and leaves the loaded job as it was, edits
268
+ ignored (S2 report, Q-o1). So always `bootout` first.
269
+ - Never read exit 5 as "already loaded". It is a generic error, which the S2 report measured
270
+ for that one cause alone.
271
+
272
+ 4. To learn whether the job is loaded, run `launchctl print gui/<uid>/com.williacj.rigger`. It
273
+ exits 0 for a loaded label and 113 for one not loaded (S2 report, Q-o2 and "For M6-12b").
274
+
275
+ Once loaded, the job starts again at your next login after a reboot, never before it (`D28` rule
276
+ 1; `ARCHITECTURE.md`, "Triggers", "When it starts").
277
+
278
+ On the owner's host, a first install raised a "Background Items Added" notice, and Login Items
279
+ then listed the job ([S1 report](https://github.com/williacj/rigger/issues/744#issuecomment-6390300670), Q-k3).
280
+
281
+ The job writes its standard output to `~/Library/Logs/rigger/rigger.out`, and its standard error
282
+ to `~/Library/Logs/rigger/rigger.err`. Make no directory for them. The S1 report judges, from
283
+ timing and mode, that launchd makes a missing one itself (Q-m2).
284
+
285
+ To unload the label, run `launchctl bootout gui/<uid>/com.williacj.rigger`. It exits 0 for a
286
+ loaded label, and step 4's `print` then exits 113 (S2 report, Q-o1 and Q-o2). To unload it for
287
+ good, run that `bootout`, then remove `~/Library/LaunchAgents/com.williacj.rigger.plist`.
288
+
289
+ ## Configuration
290
+
291
+ One config file names the repository, the board, the column display names, the provider and model
292
+ tier per role, the concurrency, the worktree root, and the rule that derives a branch from a card.
293
+ It names the provisioning steps, each with the card labels that select it and whether the work
294
+ requires it. And for each kind of work it names one maker role, the judges that review it, and how
295
+ many review rounds that kind gets before a standing disagreement escalates — three by default. A
296
+ code change might have one judge. A requirements proposal might have three, with you last. Which
297
+ outcomes are yours to decide is also configuration. The categories are a fixed set of three, and
298
+ you add none to it: a change to a recorded decision, a critical finding, and an ambiguity no role
299
+ could resolve. For each category you name a destination, you or one of your roles, and a category
300
+ you give none goes to you. A critical finding and a change to a recorded decision go only to you,
301
+ and only an ambiguity a maker raises goes to a role. Scheduled work is declared the same way: a clock trigger
302
+ creates a card on your board, and that card goes through the loop like any other.
303
+ [`ARCHITECTURE.md`](ARCHITECTURE.md) lists every extension point; there are no others.
304
+
305
+ Almost every feature is optional. A project with a dozen roles and binding decision documents runs
306
+ the full set. A project with one command that checks its work runs the minimum, and an absent
307
+ block is a tested state, not a degraded one. The exception is acceptance: no card is admitted
308
+ without one. Role
309
+ prompts, the review skill, the default-branch push hook, and the gate workflow are forked into
310
+ your repository by `rigger init` and are yours from then on. Rigger ships them as templates and
311
+ never reads them at runtime from the package.
312
+
313
+ ## Support
314
+
315
+ [GitHub Issues](https://github.com/williacj/rigger/issues) for bugs and questions. There is no
316
+ chat channel yet.
317
+
318
+ ## Architecture
319
+
320
+ Rigger is eight layers, each with one job and one boundary: adapters at the bottom, you at the
321
+ top, and between them execution, workflow, scheduling, the roles and procedures you supply,
322
+ observation, and the improvement loops. A fault is handled at the lowest layer that can handle it,
323
+ so a card reaches you only through an escalation category you configured.
324
+
325
+ Three documents hold the rest, and they read in this order:
326
+
327
+ 1. [`docs/spec/requirements.md`](docs/spec/requirements.md) — what must be true of Rigger.
328
+ 2. [`ARCHITECTURE.md`](ARCHITECTURE.md) — the structure that satisfies them: what each layer
329
+ decides, what it may never decide, what it emits, who may change it, and every extension point
330
+ a consumer has.
331
+ 3. [`docs/spec/decisions.md`](docs/spec/decisions.md) — what was chosen, why, and what would
332
+ reverse it.
333
+
334
+ Read them before changing anything.
335
+
336
+ ## What Rigger learns
337
+
338
+ Rigger measures from the first dispatch. How long work takes, how many review rounds each kind of
339
+ work needs, how often it escalates and why, how often a host fault interrupts it, and how well the
340
+ model tier matched the card. `rigger report` shows those signals per layer.
341
+
342
+ Two loops read the report. The first reorders and re-tiers your backlog from the evidence, using
343
+ a role you name. The second runs a retrospective and proposes changes: to your roles, your review
344
+ procedure, or to Rigger itself. Every proposal comes to you with the signal it would improve, and
345
+ a proposal against Rigger's core must also fit the size budget. Neither loop applies anything to
346
+ the engine on its own. The improvement loops land after v0; the measurement is there from day one.
347
+
348
+ ## Telemetry
349
+
350
+ Rigger writes one JSONL event stream to your repository's state directory: dispatches, verdicts,
351
+ merges, escalations, holds, and every other layer's events. It is sent to nobody. If you turn it
352
+ on, Rigger also pushes that stream to a data ref in your own repository so it survives the machine.
353
+ Rigger makes no network calls except through `gh`, `git` and your agent CLI.
354
+
355
+ ## Contributing
356
+
357
+ Rigger is not accepting pull requests until the improvement loops land (M9 and M10). Open an issue
358
+ if you have found a bug or want to discuss a direction. When contributions open, the process will
359
+ be: discuss in an issue first, then a PR that follows this repository's TDD and review rules.
360
+
361
+ **Developing Rigger.** Clone, `npm ci`, `npm test`. One rule specific to agent tooling: never run
362
+ Rigger against the checkout it is running from, and never point a consumer's worktree root inside
363
+ this package. An agent dispatched by Rigger can delete the runtime it is running under.
364
+
365
+ ## Maintainers
366
+
367
+ [@williacj](https://github.com/williacj).
368
+
369
+ ## License
370
+
371
+ MIT. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@williacj/rigger",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "The engine that lets your AI agents deliver work you defined, to a standard you set, while you do something else.",
5
+ "license": "MIT",
6
+ "author": "CJ Williams",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/williacj/rigger.git"
10
+ },
11
+ "homepage": "https://github.com/williacj/rigger#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/williacj/rigger/issues"
14
+ },
15
+ "type": "module",
16
+ "files": [
17
+ "src/",
18
+ "templates/",
19
+ "scripts/doc-reference-check.mjs",
20
+ "scripts/gate-check.mjs",
21
+ "scripts/record-commit.mjs",
22
+ "scripts/lib/pack-result.mjs"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "bin": {
28
+ "rigger": "src/cli/rigger.mjs"
29
+ },
30
+ "engines": {
31
+ "node": ">=24"
32
+ },
33
+ "scripts": {
34
+ "test": "sh test/suite.sh",
35
+ "test:host": "sh test/suite.sh --host",
36
+ "prepack": "node scripts/record-commit.mjs",
37
+ "gate:check": "node scripts/gate-check.mjs",
38
+ "budget:package": "node scripts/package-budget.mjs",
39
+ "budget:instructions": "node scripts/instruction-budget.mjs",
40
+ "lint:spec-style": "node scripts/spec-style-lint.mjs",
41
+ "check:references": "node scripts/doc-reference-check.mjs",
42
+ "check:paths": "node scripts/path-check.mjs",
43
+ "check:ids": "node scripts/duplicate-id-check.mjs",
44
+ "check:card": "node scripts/card-check.mjs",
45
+ "check:words": "node scripts/ruled-out-word-check.mjs",
46
+ "check:headers": "node scripts/aboutme-header-check.mjs",
47
+ "preflight": "node scripts/preflight.mjs",
48
+ "matrix": "node scripts/build-test-matrix.mjs --write",
49
+ "matrix:check": "node scripts/build-test-matrix.mjs",
50
+ "mutation:receipt": "node scripts/mutation-receipt.mjs",
51
+ "proof:diff": "node scripts/proof-diff.mjs",
52
+ "absorption-check:self-test": "node scripts/absorption-check.mjs --self-test"
53
+ },
54
+ "devDependencies": {
55
+ "acorn": "8.18.0",
56
+ "saxes": "6.0.0"
57
+ }
58
+ }
@@ -0,0 +1,59 @@
1
+ // ABOUTME: Verifies the references in the documents doc-references.json names, at the fail level
2
+ // it gives each. Today that is one reference it can never verify: a path:line pointer.
3
+
4
+ import { readFileSync } from 'node:fs';
5
+ import { join, resolve, dirname } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ // The document-checking extension point, which ARCHITECTURE.md puts in a file the config points
9
+ // at rather than in the config. This path is the only fact the checks that read it hold of their
10
+ // own; every document, every level and every exemption comes out of the file.
11
+ export const CONFIG = 'doc-references.json';
12
+
13
+ /**
14
+ * A pointer into a file at a line: a path with an extension, a colon, and a number.
15
+ *
16
+ * The extension is what keeps `node:fs`, a clock time and a clause opener out. A pointer is a
17
+ * claim about where something sits, and the file it points into moves without telling the
18
+ * document, so the resolver reads one as a finding rather than trying to verify it.
19
+ */
20
+ const POINTER = /\b[\w.@-]+(?:\/[\w.@-]+)*\.[A-Za-z]{1,6}:\d+\b/g;
21
+
22
+ /** What doc-references.json declares: the checked documents, their levels, and the exemptions. */
23
+ export function documentChecking(root) {
24
+ return JSON.parse(readFileSync(join(root, CONFIG), 'utf8'));
25
+ }
26
+
27
+ /** Every hand-typed path:line pointer in one document, with the line it sits on. */
28
+ export function pathLineLiterals(text) {
29
+ return text.split('\n').flatMap((line, index) =>
30
+ [...line.matchAll(POINTER)].map((found) => ({ line: index + 1, literal: found[0] })));
31
+ }
32
+
33
+ /**
34
+ * Every pointer in every checked document, and whether any of them fails the build.
35
+ *
36
+ * A `soft` document is reported and does not fail, which is how a document naming assets that
37
+ * have yet to land is read before they land.
38
+ */
39
+ export function check(root) {
40
+ const { documents } = documentChecking(root);
41
+ const findings = Object.entries(documents).flatMap(([path, level]) =>
42
+ pathLineLiterals(readFileSync(join(root, path), 'utf8')).map((found) => ({ path, level, ...found })));
43
+ return { findings, failing: findings.some((found) => found.level === 'strict') };
44
+ }
45
+
46
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
47
+ // CI passes no argument and this repository is read. A path reads that repository instead,
48
+ // which is how a test watches the check refuse one.
49
+ const here = resolve(dirname(fileURLToPath(import.meta.url)), '..');
50
+ const { findings, failing } = check(process.argv[2] ? resolve(process.argv[2]) : here);
51
+ for (const { path, level, line, literal } of findings) {
52
+ console.error(`${path}:${line} [${level}] hand-typed pointer \`${literal}\``);
53
+ }
54
+ console.log(`${String(findings.length).padStart(6)} pointers, across the documents ${CONFIG} names`);
55
+ if (failing) {
56
+ console.error('A strict document points at a line. Name what the source calls the thing, never where it sits.');
57
+ process.exit(1);
58
+ }
59
+ }