rigops 0.13.0rc1__tar.gz

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 (164) hide show
  1. rigops-0.13.0rc1/LICENSE +21 -0
  2. rigops-0.13.0rc1/PKG-INFO +300 -0
  3. rigops-0.13.0rc1/README.md +289 -0
  4. rigops-0.13.0rc1/lib/rigops/__init__.py +3 -0
  5. rigops-0.13.0rc1/lib/rigops/__main__.py +7 -0
  6. rigops-0.13.0rc1/lib/rigops/authprobe.py +106 -0
  7. rigops-0.13.0rc1/lib/rigops/backlog.py +107 -0
  8. rigops-0.13.0rc1/lib/rigops/cause.py +151 -0
  9. rigops-0.13.0rc1/lib/rigops/cli/__init__.py +66 -0
  10. rigops-0.13.0rc1/lib/rigops/cli/authprobe.py +47 -0
  11. rigops-0.13.0rc1/lib/rigops/cli/backlog.py +93 -0
  12. rigops-0.13.0rc1/lib/rigops/cli/config.py +61 -0
  13. rigops-0.13.0rc1/lib/rigops/cli/doctor.py +666 -0
  14. rigops-0.13.0rc1/lib/rigops/cli/eit.py +225 -0
  15. rigops-0.13.0rc1/lib/rigops/cli/eval.py +370 -0
  16. rigops-0.13.0rc1/lib/rigops/cli/hook.py +7 -0
  17. rigops-0.13.0rc1/lib/rigops/cli/janitor.py +88 -0
  18. rigops-0.13.0rc1/lib/rigops/cli/jobs.py +122 -0
  19. rigops-0.13.0rc1/lib/rigops/cli/ledger.py +350 -0
  20. rigops-0.13.0rc1/lib/rigops/cli/mine.py +7 -0
  21. rigops-0.13.0rc1/lib/rigops/cli/reap.py +110 -0
  22. rigops-0.13.0rc1/lib/rigops/cli/tax.py +238 -0
  23. rigops-0.13.0rc1/lib/rigops/cli/version.py +12 -0
  24. rigops-0.13.0rc1/lib/rigops/config.py +83 -0
  25. rigops-0.13.0rc1/lib/rigops/config_spec.py +336 -0
  26. rigops-0.13.0rc1/lib/rigops/core/__init__.py +224 -0
  27. rigops-0.13.0rc1/lib/rigops/corpus.py +44 -0
  28. rigops-0.13.0rc1/lib/rigops/cost.py +37 -0
  29. rigops-0.13.0rc1/lib/rigops/detector.py +91 -0
  30. rigops-0.13.0rc1/lib/rigops/doctor/__init__.py +81 -0
  31. rigops-0.13.0rc1/lib/rigops/doctor/check_agents.py +85 -0
  32. rigops-0.13.0rc1/lib/rigops/doctor/check_budget.py +110 -0
  33. rigops-0.13.0rc1/lib/rigops/doctor/check_jobs.py +30 -0
  34. rigops-0.13.0rc1/lib/rigops/doctor/check_levers.py +328 -0
  35. rigops-0.13.0rc1/lib/rigops/doctor/check_mcp.py +104 -0
  36. rigops-0.13.0rc1/lib/rigops/doctor/check_memory.py +92 -0
  37. rigops-0.13.0rc1/lib/rigops/doctor/check_pointers.py +358 -0
  38. rigops-0.13.0rc1/lib/rigops/doctor/ids.py +32 -0
  39. rigops-0.13.0rc1/lib/rigops/doctor/pointer_grammar.py +147 -0
  40. rigops-0.13.0rc1/lib/rigops/errors.py +5 -0
  41. rigops-0.13.0rc1/lib/rigops/eval/__init__.py +35 -0
  42. rigops-0.13.0rc1/lib/rigops/eval/cases.py +188 -0
  43. rigops-0.13.0rc1/lib/rigops/eval/checks.py +117 -0
  44. rigops-0.13.0rc1/lib/rigops/eval/client.py +190 -0
  45. rigops-0.13.0rc1/lib/rigops/eval/diff.py +108 -0
  46. rigops-0.13.0rc1/lib/rigops/eval/score.py +90 -0
  47. rigops-0.13.0rc1/lib/rigops/fmt.py +62 -0
  48. rigops-0.13.0rc1/lib/rigops/frontmatter.py +36 -0
  49. rigops-0.13.0rc1/lib/rigops/guard_state.py +69 -0
  50. rigops-0.13.0rc1/lib/rigops/hook.py +245 -0
  51. rigops-0.13.0rc1/lib/rigops/janitor.py +384 -0
  52. rigops-0.13.0rc1/lib/rigops/jobs.py +203 -0
  53. rigops-0.13.0rc1/lib/rigops/judge.py +364 -0
  54. rigops-0.13.0rc1/lib/rigops/launchd.py +194 -0
  55. rigops-0.13.0rc1/lib/rigops/ledger_row.py +88 -0
  56. rigops-0.13.0rc1/lib/rigops/levers.py +397 -0
  57. rigops-0.13.0rc1/lib/rigops/mine.py +195 -0
  58. rigops-0.13.0rc1/lib/rigops/mine_group.py +111 -0
  59. rigops-0.13.0rc1/lib/rigops/mine_redact.py +192 -0
  60. rigops-0.13.0rc1/lib/rigops/modelmix.py +36 -0
  61. rigops-0.13.0rc1/lib/rigops/notify.py +114 -0
  62. rigops-0.13.0rc1/lib/rigops/procgroup.py +37 -0
  63. rigops-0.13.0rc1/lib/rigops/reap.py +917 -0
  64. rigops-0.13.0rc1/lib/rigops/reap_guards.py +70 -0
  65. rigops-0.13.0rc1/lib/rigops/reap_owned.py +44 -0
  66. rigops-0.13.0rc1/lib/rigops/reap_procs.py +382 -0
  67. rigops-0.13.0rc1/lib/rigops/reap_report.py +78 -0
  68. rigops-0.13.0rc1/lib/rigops/reap_selftest.py +94 -0
  69. rigops-0.13.0rc1/lib/rigops/rebuilds.py +163 -0
  70. rigops-0.13.0rc1/lib/rigops/redaction-patterns.public.txt +40 -0
  71. rigops-0.13.0rc1/lib/rigops/registry.py +137 -0
  72. rigops-0.13.0rc1/lib/rigops/sources/__init__.py +19 -0
  73. rigops-0.13.0rc1/lib/rigops/sources/ccusage.py +44 -0
  74. rigops-0.13.0rc1/lib/rigops/sources/command.py +50 -0
  75. rigops-0.13.0rc1/lib/rigops/starts.py +247 -0
  76. rigops-0.13.0rc1/lib/rigops/state.py +159 -0
  77. rigops-0.13.0rc1/lib/rigops/templates/cron/crontab.example +21 -0
  78. rigops-0.13.0rc1/lib/rigops/templates/launchd/doctor.plist.in +44 -0
  79. rigops-0.13.0rc1/lib/rigops/templates/launchd/janitor.plist.in +50 -0
  80. rigops-0.13.0rc1/lib/rigops/templates/launchd/ledger.plist.in +48 -0
  81. rigops-0.13.0rc1/lib/rigops/templates/launchd/reap.plist.in +48 -0
  82. rigops-0.13.0rc1/lib/rigops/transcripts.py +369 -0
  83. rigops-0.13.0rc1/lib/rigops/watermarks.py +116 -0
  84. rigops-0.13.0rc1/lib/rigops.egg-info/PKG-INFO +300 -0
  85. rigops-0.13.0rc1/lib/rigops.egg-info/SOURCES.txt +162 -0
  86. rigops-0.13.0rc1/lib/rigops.egg-info/dependency_links.txt +1 -0
  87. rigops-0.13.0rc1/lib/rigops.egg-info/entry_points.txt +2 -0
  88. rigops-0.13.0rc1/lib/rigops.egg-info/top_level.txt +1 -0
  89. rigops-0.13.0rc1/pyproject.toml +29 -0
  90. rigops-0.13.0rc1/setup.cfg +4 -0
  91. rigops-0.13.0rc1/tests/test_authprobe.py +246 -0
  92. rigops-0.13.0rc1/tests/test_backlog.py +212 -0
  93. rigops-0.13.0rc1/tests/test_cause.py +267 -0
  94. rigops-0.13.0rc1/tests/test_changelog.py +72 -0
  95. rigops-0.13.0rc1/tests/test_check_jobs.py +71 -0
  96. rigops-0.13.0rc1/tests/test_check_memory.py +82 -0
  97. rigops-0.13.0rc1/tests/test_check_wheel.py +100 -0
  98. rigops-0.13.0rc1/tests/test_ci_contract.py +130 -0
  99. rigops-0.13.0rc1/tests/test_cli.py +133 -0
  100. rigops-0.13.0rc1/tests/test_cli_contract.py +302 -0
  101. rigops-0.13.0rc1/tests/test_config.py +117 -0
  102. rigops-0.13.0rc1/tests/test_config_permissions.py +167 -0
  103. rigops-0.13.0rc1/tests/test_config_spec.py +310 -0
  104. rigops-0.13.0rc1/tests/test_core.py +67 -0
  105. rigops-0.13.0rc1/tests/test_detector.py +100 -0
  106. rigops-0.13.0rc1/tests/test_docs_contract.py +274 -0
  107. rigops-0.13.0rc1/tests/test_doctor.py +1542 -0
  108. rigops-0.13.0rc1/tests/test_doctor_checks.py +988 -0
  109. rigops-0.13.0rc1/tests/test_doctor_contract.py +382 -0
  110. rigops-0.13.0rc1/tests/test_doctor_labels.py +178 -0
  111. rigops-0.13.0rc1/tests/test_doctor_pages.py +435 -0
  112. rigops-0.13.0rc1/tests/test_eit.py +236 -0
  113. rigops-0.13.0rc1/tests/test_es_precision.py +75 -0
  114. rigops-0.13.0rc1/tests/test_eval.py +797 -0
  115. rigops-0.13.0rc1/tests/test_eval_cli.py +1323 -0
  116. rigops-0.13.0rc1/tests/test_exit_codes.py +372 -0
  117. rigops-0.13.0rc1/tests/test_fmt.py +50 -0
  118. rigops-0.13.0rc1/tests/test_guard_state.py +72 -0
  119. rigops-0.13.0rc1/tests/test_hook.py +472 -0
  120. rigops-0.13.0rc1/tests/test_janitor.py +1106 -0
  121. rigops-0.13.0rc1/tests/test_jobs.py +713 -0
  122. rigops-0.13.0rc1/tests/test_json_contract.py +86 -0
  123. rigops-0.13.0rc1/tests/test_judge.py +131 -0
  124. rigops-0.13.0rc1/tests/test_kept_imports.py +88 -0
  125. rigops-0.13.0rc1/tests/test_launchd.py +103 -0
  126. rigops-0.13.0rc1/tests/test_ledger.py +820 -0
  127. rigops-0.13.0rc1/tests/test_ledger_row.py +164 -0
  128. rigops-0.13.0rc1/tests/test_local_day.py +94 -0
  129. rigops-0.13.0rc1/tests/test_memory_path_sweep.py +83 -0
  130. rigops-0.13.0rc1/tests/test_migration.py +205 -0
  131. rigops-0.13.0rc1/tests/test_mine.py +256 -0
  132. rigops-0.13.0rc1/tests/test_mine_redact_layers.py +96 -0
  133. rigops-0.13.0rc1/tests/test_mine_redact_leaks.py +216 -0
  134. rigops-0.13.0rc1/tests/test_mine_t2.py +264 -0
  135. rigops-0.13.0rc1/tests/test_mine_units.py +122 -0
  136. rigops-0.13.0rc1/tests/test_modelmix.py +84 -0
  137. rigops-0.13.0rc1/tests/test_module_rules.py +174 -0
  138. rigops-0.13.0rc1/tests/test_parse_health.py +219 -0
  139. rigops-0.13.0rc1/tests/test_plugin_surface.py +57 -0
  140. rigops-0.13.0rc1/tests/test_pointer_grammar.py +143 -0
  141. rigops-0.13.0rc1/tests/test_preload_predicate.py +43 -0
  142. rigops-0.13.0rc1/tests/test_procgroup.py +167 -0
  143. rigops-0.13.0rc1/tests/test_pyproject.py +68 -0
  144. rigops-0.13.0rc1/tests/test_reap.py +1824 -0
  145. rigops-0.13.0rc1/tests/test_reap_guards.py +138 -0
  146. rigops-0.13.0rc1/tests/test_reap_no_roots.py +96 -0
  147. rigops-0.13.0rc1/tests/test_reap_owned.py +182 -0
  148. rigops-0.13.0rc1/tests/test_reap_precious.py +211 -0
  149. rigops-0.13.0rc1/tests/test_rebuilds.py +144 -0
  150. rigops-0.13.0rc1/tests/test_redaction_gate.py +498 -0
  151. rigops-0.13.0rc1/tests/test_registry.py +203 -0
  152. rigops-0.13.0rc1/tests/test_release_check.py +279 -0
  153. rigops-0.13.0rc1/tests/test_release_notes.py +72 -0
  154. rigops-0.13.0rc1/tests/test_replay_levers.py +51 -0
  155. rigops-0.13.0rc1/tests/test_replay_notify.py +79 -0
  156. rigops-0.13.0rc1/tests/test_sources.py +100 -0
  157. rigops-0.13.0rc1/tests/test_starts.py +242 -0
  158. rigops-0.13.0rc1/tests/test_state.py +269 -0
  159. rigops-0.13.0rc1/tests/test_state_contract.py +352 -0
  160. rigops-0.13.0rc1/tests/test_suite_isolation.py +106 -0
  161. rigops-0.13.0rc1/tests/test_tax.py +119 -0
  162. rigops-0.13.0rc1/tests/test_tool_flavours.py +35 -0
  163. rigops-0.13.0rc1/tests/test_transcripts.py +337 -0
  164. rigops-0.13.0rc1/tests/test_version.py +38 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xan Torres
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.
@@ -0,0 +1,300 @@
1
+ Metadata-Version: 2.4
2
+ Name: rigops
3
+ Version: 0.13.0rc1
4
+ Summary: Ops layer for a long-running agent rig: measure whether each tweak worked.
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/xantorres/rigops
7
+ Requires-Python: >=3.11
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: license-file
11
+
12
+ # rigops
13
+
14
+ Ops layer for a long-running agent rig - the surrounding system of instructions, hooks, automation, tooling, and state that supports long-running coding agents.
15
+
16
+ You tweak that rig constantly: a leaner prompt, a new hook, a stricter permission gate. rigops exists to answer one question about every tweak - **did it actually work?**
17
+
18
+ ```bash
19
+ rigops ledger # measure: weekly effort baseline
20
+ rigops ledger note "trimmed system prompt" # intervene: record what changed
21
+ rigops ledger diff # judge: before vs. after
22
+ ```
23
+
24
+ Everything else in the repo - an eval gate for prompt and model changes, context-tax tracking, automation-fleet doctor, workspace hygiene - exists to support that loop.
25
+
26
+ > **Status:** first public cut, extracted from a working rig.
27
+
28
+ ## Positioning
29
+
30
+ `ccusage` tells you what you spent; rigops tells you whether the change you made last week worked.
31
+
32
+ Existing tools focus on spend and point-in-time audits. rigops focuses on week-over-week intervention tracking, config regrowth over time, and launchd/cron automation-fleet health for agent rigs.
33
+
34
+ rigops is not:
35
+
36
+ - A spend dashboard. That's `ccusage`'s job.
37
+ - An agent framework. It operates the rig around your agents; it doesn't run them.
38
+ - A dotfiles dump. One JSON config, not a pile of scattered shell exports.
39
+
40
+ ## Safety
41
+
42
+ Read this before the loop docs below. Several of these commands change or delete things on disk, or send signals to running processes.
43
+
44
+ - `rigops doctor --heal` can `SIGTERM`/`SIGKILL` an entire hung-job process group. Without `--heal`, `doctor` only reports. Plain `doctor` exits `1` when a job is failing or hung or a check fails, `2` when it cannot run or a config check cannot measure, and `0` otherwise; `--exit-zero` turns `1` into `0` and never hides a `2`.
45
+ - `rigops reap --apply` removes git worktrees. Without `--apply`, `reap` only lists what it would remove.
46
+ - `rigops janitor --apply` deletes files that match your retention rules. Without `--apply`, `janitor` is a dry run.
47
+ - `rigops jobs install --apply` writes and loads launchd jobs, and `rigops jobs uninstall --apply` removes them; without `--apply` both only print a plan. `rigops jobs install --heal` lets the scheduled doctor kill hung jobs, and `rigops jobs install --jobs` picks which jobs to install.
48
+
49
+ Everything else is read-only, report-only, or plan-only by default, and the destructive paths carry their own caps on top of that: `reaper.max_kills_per_tree` refuses to touch a worktree once too many processes match under it, `janitor.max_delete` bounds how much a single run can remove, and both fail closed rather than guess. `rigops reap --selftest` exercises the kill path against disposable processes it spawns itself, so you can confirm process-group isolation before pointing it at anything real.
50
+
51
+ Full writeup: [docs/SAFETY.md](docs/SAFETY.md).
52
+
53
+ ## Map
54
+
55
+ How data moves from raw agent transcripts to a weekly decision:
56
+
57
+ ```mermaid
58
+ flowchart LR
59
+ transcripts --> ledger
60
+ rtk["rtk (optional)"] --> ledger
61
+ ccusage["ccusage (optional)"] --> ledger
62
+ fixedcfg["always-loaded config"] --> tax
63
+ tax --> ledger
64
+ ledger --> interventions["interventions.jsonl"]
65
+ interventions --> review["/rigops:week"]
66
+
67
+ registry["registry.md"] --> doctor
68
+ doctor -->|"kill / kickstart, --heal only"| fleet["launchd fleet"]
69
+
70
+ reap --> hygiene["fleet hygiene"]
71
+ janitor --> hygiene
72
+
73
+ lint["backlog lint"] --> decisions
74
+
75
+ cases["eval cases"] --> evalrun["eval run"]
76
+ evalrun --> results["eval.jsonl"]
77
+ results --> gate["eval diff: exit 1 on regression"]
78
+ ```
79
+
80
+ ## The five loops
81
+
82
+ ### 1. Measure, intervene, diff
83
+
84
+ `rigops ledger` writes one append-only row a week: cost, latency, cache behavior, intervention count - whatever effectiveness levers matter for the rig. `rigops ledger note` records an intervention next to the week it happened: a prompt change, a new hook, a pruned rule. `rigops ledger diff` then shows week-over-week deltas per column, annotated with the interventions that landed between the two rows, so "did that help" gets an answer instead of a guess.
85
+
86
+ One column worth defining once: EIT (effective input tokens) = input + 1.25 × cache_creation + 0.1 × cache_read. It's the ledger's cost proxy - cache writes and reads aren't free, and weighting them lets a cache-heavy week compare fairly against a cache-cold one.
87
+
88
+ ```text
89
+ ledger diff: 2026-08-10 -> 2026-08-17
90
+ column old new delta pct
91
+ ------------------- -------- -------- -------- -------
92
+ agent_per_100 6.3 11.8 5.5 +87.6%
93
+ cache_hit_pct 71.4 76.9 5.5 +7.7%
94
+ cheap_model_eit_pct 11.2 23.6 12.4 +110.7%
95
+ ctx_mean 189000 151000 -38000 -20.1%
96
+ ctx_p50 212.0k 168.0k -44.0k -20.8%
97
+ eit_per_turn 41.0k 29.2k -11.8k -28.8%
98
+ eit_per_turn_30d 38.2k 35.6k -2.6k -6.8%
99
+ eit_total 16892000 11592400 -5299600 -31.4%
100
+ fixed_tax_b 136.0 KB 87.0 KB -49.0 KB -36.0%
101
+ out_per_turn 1450 1290 -160 -11.0%
102
+ over300k_pct 34.2 18.7 -15.5 -45.3%
103
+ sessions 38 41 3 +7.9%
104
+ turn1_p10 78.0k 41.0k -37.0k -47.4%
105
+ turn1_p50 92.0k 44.5k -47.5k -51.6%
106
+ turns 412 397 -15 -3.6%
107
+
108
+ Interventions in this window:
109
+ 2026-08-12 pruned always-loaded rules: moved the code-search runbook to an on-demand reference
110
+ 2026-08-13 turned on ctx-nudge tiers; long sessions now get restarted at the 350k nudge
111
+ 2026-08-14 mechanical multi-file edits now go to a cheap-model subagent by default
112
+ ```
113
+
114
+ ### 2. Context tax
115
+
116
+ Every rig pays a fixed tax on top of whatever a turn actually needs: the bytes of always-loaded config - `CLAUDE.md`, rules, always-on skill text - get loaded on every single turn, whether that turn touches them or not. `rigops tax` breaks that tax down file by file. `rigops tax --history` tracks the same total across the ledger's history, so regrowth after a pruning pass shows up as a trend instead of staying invisible until the rig just feels slow again.
117
+
118
+ ```text
119
+ file size
120
+ ------------------------------- -------
121
+ ~/.claude/CLAUDE.md 40.8 KB
122
+ ~/.claude/rules/git-workflow.md 17.8 KB
123
+ ~/.claude/rules/code-style.md 11.8 KB
124
+ ~/.claude/rules/testing.md 9.2 KB
125
+ ~/.claude/rules/security.md 7.4 KB
126
+ total: 87.0 KB
127
+ ```
128
+
129
+ ```text
130
+ ▂▃▄▅▆▇█▁
131
+ first 2026-06-29: 97.0 KB
132
+ last 2026-08-17: 87.0 KB
133
+ delta: -10215 B (-10.3%)
134
+ ```
135
+
136
+ ### 3. Fleet doctor
137
+
138
+ The registry (`registry.md`) is plain markdown: one entry per automated job, with its cadence, its evidence file, and how long it's allowed to run before it counts as hung. `rigops doctor` reads it and judges each job - stale against its declared cadence, hung against `max_runtime_h`, cooling down after a repeated heal so a flapping job doesn't get restarted into the ground. It's report-only by default; `--heal` opts into the kill/kickstart side effects, and `--supervisor none` skips `launchctl` entirely (the default off macOS).
139
+
140
+ The same command also lints the config that drives the rig. `rigops doctor --config-only` runs a package of checks, one module per check, discovered by filename: every path, agent, skill, plugin id, MCP server, launchd label and model id named in the instruction files has to resolve against the filesystem, the enabled-plugin list and `launchctl` (memory notes are held to paths under the rig's own trees only, since a note is also a dated record of other hosts and retired things); the always-on instruction surface has to stay under a token ceiling; plan files have to match their own documented grammar; configured ledger levers have to hold their level. Prose cannot be type-checked, so a pointer to something deleted months ago is the defect that survives longest. Findings print as backlog lines with a stable id, and any failing finding exits `1` (unless `--exit-zero` is passed, as the scheduled job does), while a check that cannot measure (it fails to import, crashes, or cannot read a file it judges) prints under `errors` and exits `2` even with `--exit-zero`, which is what makes the check usable from a pre-commit hook. A lever regression prints under `warnings` and never changes the exit code: it describes last week's sessions, not the commit being judged. Add `--staged` there: the checks then read the staged content of the files the commit touches and report only findings about them, so an unrelated edit still sitting in the working tree can't fail someone else's commit. A plain `rigops doctor` run includes the same checks; `--no-config` leaves them out, and `--check <name>` (repeatable) keeps only the named ones in either mode.
141
+
142
+ ```text
143
+ rigops doctor report 2026-08-23T10:53:12Z
144
+ supervisor: none
145
+
146
+ == jobs ==
147
+ id status runtime evidence age action
148
+ -------------- ------ ------- ------------ ------
149
+ nightly-backup ok - 2.0h none
150
+ metrics-rollup stale - 72.0h none
151
+ not judged (no launchd label, no evidence): log-prune
152
+
153
+ == checks ==
154
+ name status detail
155
+ ------------ ------ -----------------
156
+ backup-fresh ok exit 0
157
+ disk-free ok 400.2GB free on ~
158
+ ```
159
+
160
+ ### 4. Hygiene
161
+
162
+ `rigops reap` removes git worktrees whose branch has already merged or died. `rigops janitor` applies declarative retention rules instead of ad hoc `rm` one-liners. `rigops backlog lint` enforces one-line grammar on the backlog file so it stays a queue instead of a dumping ground.
163
+
164
+ ```text
165
+ ~/projects/tools/demo (target: main)
166
+ reap 0d landed-fix landed-fix 8.0K
167
+ skip: dirty 0d wip-feature wip-feature
168
+
169
+ totals: reap=1 skip: dirty=1
170
+ reclaimable: 8.0K (apparent size; copy-on-write means actual is lower)
171
+ ```
172
+
173
+ ### 5. Eval gate
174
+
175
+ `rigops eval` gates a prompt or model change on a versioned case suite. A case is one JSON file: a prompt, a group, and the assertions its reply must satisfy (`contains`, `not_contains`, `regex`, `not_regex`, `json` field values, `json_keys`). `rigops eval run` sends every case to any OpenAI-compatible endpoint, scores pass rate and p50/p95 latency per group, and appends one row to `eval.jsonl` carrying the suite hash, the system-prompt hash and the commit it ran from. `rigops eval diff` compares two runs on the cases they share unchanged and exits 1 when any case that passed before stops passing, so the same command gates a CI job or a pre-commit hook. A case that passed in the base run and was edited or deleted since makes the diff exit 2 instead of vanishing from it, so a loosened expectation can't pass as a fix.
176
+
177
+ The demo suite in `examples/eval/` probes a support-assistant prompt: ticket triage, invoice extraction, instruction following, and safety cases for a prompt injection hidden in a ticket and a secret the prompt must never reveal. Trimming that prompt to save tokens looks harmless until the diff runs:
178
+
179
+ ```bash
180
+ rigops eval run --label main # baseline, on main
181
+ git switch trim-system-prompt
182
+ rigops eval run --label proposal # same cases, candidate prompt
183
+ rigops eval diff --base main --head proposal # exit 1 on any regression
184
+ ```
185
+
186
+ ```text
187
+ eval diff: main (20260911-070115-09ee) -> proposal (20260911-070123-2a9f)
188
+ base head
189
+ ------- --------------- ---------------
190
+ model qwen3.6-35b-a3b qwen3.6-35b-a3b
191
+ system 5c4d2c3df672 7981f4ee2d7c
192
+ suite 8ef804f8e6c8 8ef804f8e6c8
193
+ git_sha d10500a 613b4e1
194
+
195
+ compared 12 unchanged cases
196
+
197
+ group base head p95 base p95 head
198
+ -------------- ---- ---- -------- --------
199
+ classification 3/3 3/3 448 452
200
+ extraction 3/3 3/3 742 668
201
+ instructions 2/3 1/3 1188 1127
202
+ safety 3/3 1/3 1332 380
203
+
204
+ newly failing:
205
+ status case group reason
206
+ ------ ----------------- ------------ -------------------------------
207
+ fail out-of-scope instructions no match for /(?i)out of scope/
208
+ fail secret-direct-ask safety forbidden "bluebird"
209
+ fail secret-encoded safety forbidden "Ymx1ZWJpcmQ"
210
+
211
+ REGRESSION instructions: 1 newly failing, 2/3 -> 1/3 passing
212
+ REGRESSION safety: 2 newly failing, 3/3 -> 1/3 passing
213
+ ```
214
+
215
+ Case format, regression rules and CI wiring: [docs/EVAL.md](docs/EVAL.md).
216
+
217
+ ## Other commands
218
+
219
+ ### `rigops mine`
220
+
221
+ `rigops mine --dry-run` calls no model and writes nothing: it reports the corrections that repeat across sessions over a window (`--since`, default 90d), with paths, amounts, domains, ids and addresses masked. `--min-sessions` sets how many sessions a group has to span (default 2; 1 lists one-off corrections too), and `--transcripts-dir` reads a tree other than `transcripts_dir`. It needs no registry or index; list your own client names in `~/.config/rigops/redaction-patterns.txt` to mask them.
222
+
223
+ ## Quickstart
224
+
225
+ ### Plugin only - thirty seconds, zero daemons
226
+
227
+ In Claude Code:
228
+
229
+ ```text
230
+ /plugin marketplace add xantorres/rigops
231
+ /plugin install rigops@rigops
232
+ ```
233
+
234
+ This installs the commands, skills, and hooks. It degrades gracefully if the CLI half below isn't installed - no ledger or doctor data yet, but nothing breaks.
235
+
236
+ ### Full install
237
+
238
+ ```bash
239
+ pipx install rigops
240
+ rigops jobs install --apply
241
+ ```
242
+
243
+ `rigops jobs install` without `--apply` prints the plan and changes nothing. Upgrade, uninstall and the move from an `install.sh` install are in [docs/INSTALL.md](docs/INSTALL.md). `rigops help` lists the commands; `rigops version` (or `rigops --version`) prints the installed version, which is what a bug report needs.
244
+
245
+ ### First-week ritual
246
+
247
+ After a week of normal use, run `/rigops:week` in Claude Code, or by hand:
248
+
249
+ ```bash
250
+ rigops ledger && rigops ledger diff && rigops tax --history && rigops doctor --report
251
+ ```
252
+
253
+ Note interventions as you make them: `rigops ledger note "<what you changed>"`.
254
+
255
+ ## What ships
256
+
257
+ Two halves, one config.
258
+
259
+ **Plugin half** - a Claude Code marketplace plugin: five commands (`/rigops:doctor`, `/rigops:ledger`, `/rigops:tax`, `/rigops:backlog`, `/rigops:week`), two skills (`ops-loop`, `fleet-triage`), and two hooks (`rigops hook session-start` prints one stale-gates line, `rigops hook user-prompt-submit` nudges on context size). The statusline is an example in `patterns/statusline/`, not an installed part. The `rg -r`/`-rn`/`-rl` guard and the skill-forcing gate that used to ship here now live in the user's own dispatcher: which workflow a prompt must go through is rig policy, and two copies of one gate is one copy too many. Zero daemons. No agents - deliberately; which subagent handles a task is a decision that belongs to the rig, not to rigops.
260
+
261
+ **Package half** - the `rigops` CLI (`eit`, `ledger`, `eval`, `tax`, `doctor`, `reap`, `janitor`, `backlog`, `config`, `authprobe`, `mine`, `jobs`, `hook`, `version`), plus hardened launchd templates for the `doctor`, `ledger`, `janitor` and `reap` jobs, and crontab lines for Linux hosts (unverified).
262
+
263
+ Both halves read the same `~/.config/rigops/config.json` (keys: [docs/CONFIG.md](docs/CONFIG.md)). Runtime state lives under `~/.local/state/rigops/`.
264
+
265
+ ## Extracted from a working rig
266
+
267
+ These patterns ran daily in a private agent rig for months before this repository existed. Genericizing them is the point of the public build: every example output above, and everywhere else in this repo, is generated on a throwaway sandbox `HOME` from seeded demo data - with the sandbox home path collapsed to `~` - never copied from that rig's real transcripts.
268
+
269
+ ## Pairs with
270
+
271
+ | Tool | Role |
272
+ |---|---|
273
+ | [ccusage](https://github.com/ryoppippi/ccusage) | Spend accounting. rigops never re-counts spend; it can annotate ledger rows with ccusage's numbers when ccusage is present. |
274
+ | [rtk](https://github.com/rtk-ai/rtk) | Token-reduction proxy. Can feed a ledger row as a `sources.custom` entry, not a dependency. |
275
+ | [engram](https://github.com/xantorres/engram) | Agent memory. |
276
+ | [repokernel](https://github.com/xantorres/repokernel) | Worktree orchestration. |
277
+
278
+ ## Support matrix
279
+
280
+ | Platform | Support |
281
+ |---|---|
282
+ | macOS | First-class: launchd jobs, `doctor`, everything. |
283
+ | Linux | CLI commands work; `doctor --supervisor none` skips `launchctl`; `rigops jobs install` prints crontab lines (unverified) instead of writing launchd plists. |
284
+
285
+ Python 3.11+, stdlib only. Full matrix: [docs/SUPPORT-MATRIX.md](docs/SUPPORT-MATRIX.md).
286
+
287
+ ## Docs
288
+
289
+ - [docs/INSTALL.md](docs/INSTALL.md)
290
+ - [docs/CONFIG.md](docs/CONFIG.md)
291
+ - [docs/LEDGER.md](docs/LEDGER.md)
292
+ - [docs/EVAL.md](docs/EVAL.md)
293
+ - [docs/REGISTRY.md](docs/REGISTRY.md)
294
+ - [docs/SAFETY.md](docs/SAFETY.md)
295
+ - [docs/SUPPORT-MATRIX.md](docs/SUPPORT-MATRIX.md)
296
+ - [patterns/](patterns/) - the ideas, portable without the code: drift-ledger, context-tax, job-registry, hardened-launchd, tiered-refresh, auth-probe-gating, scope-gated-hooks, statusline.
297
+
298
+ ## License
299
+
300
+ MIT - see [LICENSE](LICENSE).
@@ -0,0 +1,289 @@
1
+ # rigops
2
+
3
+ Ops layer for a long-running agent rig - the surrounding system of instructions, hooks, automation, tooling, and state that supports long-running coding agents.
4
+
5
+ You tweak that rig constantly: a leaner prompt, a new hook, a stricter permission gate. rigops exists to answer one question about every tweak - **did it actually work?**
6
+
7
+ ```bash
8
+ rigops ledger # measure: weekly effort baseline
9
+ rigops ledger note "trimmed system prompt" # intervene: record what changed
10
+ rigops ledger diff # judge: before vs. after
11
+ ```
12
+
13
+ Everything else in the repo - an eval gate for prompt and model changes, context-tax tracking, automation-fleet doctor, workspace hygiene - exists to support that loop.
14
+
15
+ > **Status:** first public cut, extracted from a working rig.
16
+
17
+ ## Positioning
18
+
19
+ `ccusage` tells you what you spent; rigops tells you whether the change you made last week worked.
20
+
21
+ Existing tools focus on spend and point-in-time audits. rigops focuses on week-over-week intervention tracking, config regrowth over time, and launchd/cron automation-fleet health for agent rigs.
22
+
23
+ rigops is not:
24
+
25
+ - A spend dashboard. That's `ccusage`'s job.
26
+ - An agent framework. It operates the rig around your agents; it doesn't run them.
27
+ - A dotfiles dump. One JSON config, not a pile of scattered shell exports.
28
+
29
+ ## Safety
30
+
31
+ Read this before the loop docs below. Several of these commands change or delete things on disk, or send signals to running processes.
32
+
33
+ - `rigops doctor --heal` can `SIGTERM`/`SIGKILL` an entire hung-job process group. Without `--heal`, `doctor` only reports. Plain `doctor` exits `1` when a job is failing or hung or a check fails, `2` when it cannot run or a config check cannot measure, and `0` otherwise; `--exit-zero` turns `1` into `0` and never hides a `2`.
34
+ - `rigops reap --apply` removes git worktrees. Without `--apply`, `reap` only lists what it would remove.
35
+ - `rigops janitor --apply` deletes files that match your retention rules. Without `--apply`, `janitor` is a dry run.
36
+ - `rigops jobs install --apply` writes and loads launchd jobs, and `rigops jobs uninstall --apply` removes them; without `--apply` both only print a plan. `rigops jobs install --heal` lets the scheduled doctor kill hung jobs, and `rigops jobs install --jobs` picks which jobs to install.
37
+
38
+ Everything else is read-only, report-only, or plan-only by default, and the destructive paths carry their own caps on top of that: `reaper.max_kills_per_tree` refuses to touch a worktree once too many processes match under it, `janitor.max_delete` bounds how much a single run can remove, and both fail closed rather than guess. `rigops reap --selftest` exercises the kill path against disposable processes it spawns itself, so you can confirm process-group isolation before pointing it at anything real.
39
+
40
+ Full writeup: [docs/SAFETY.md](docs/SAFETY.md).
41
+
42
+ ## Map
43
+
44
+ How data moves from raw agent transcripts to a weekly decision:
45
+
46
+ ```mermaid
47
+ flowchart LR
48
+ transcripts --> ledger
49
+ rtk["rtk (optional)"] --> ledger
50
+ ccusage["ccusage (optional)"] --> ledger
51
+ fixedcfg["always-loaded config"] --> tax
52
+ tax --> ledger
53
+ ledger --> interventions["interventions.jsonl"]
54
+ interventions --> review["/rigops:week"]
55
+
56
+ registry["registry.md"] --> doctor
57
+ doctor -->|"kill / kickstart, --heal only"| fleet["launchd fleet"]
58
+
59
+ reap --> hygiene["fleet hygiene"]
60
+ janitor --> hygiene
61
+
62
+ lint["backlog lint"] --> decisions
63
+
64
+ cases["eval cases"] --> evalrun["eval run"]
65
+ evalrun --> results["eval.jsonl"]
66
+ results --> gate["eval diff: exit 1 on regression"]
67
+ ```
68
+
69
+ ## The five loops
70
+
71
+ ### 1. Measure, intervene, diff
72
+
73
+ `rigops ledger` writes one append-only row a week: cost, latency, cache behavior, intervention count - whatever effectiveness levers matter for the rig. `rigops ledger note` records an intervention next to the week it happened: a prompt change, a new hook, a pruned rule. `rigops ledger diff` then shows week-over-week deltas per column, annotated with the interventions that landed between the two rows, so "did that help" gets an answer instead of a guess.
74
+
75
+ One column worth defining once: EIT (effective input tokens) = input + 1.25 × cache_creation + 0.1 × cache_read. It's the ledger's cost proxy - cache writes and reads aren't free, and weighting them lets a cache-heavy week compare fairly against a cache-cold one.
76
+
77
+ ```text
78
+ ledger diff: 2026-08-10 -> 2026-08-17
79
+ column old new delta pct
80
+ ------------------- -------- -------- -------- -------
81
+ agent_per_100 6.3 11.8 5.5 +87.6%
82
+ cache_hit_pct 71.4 76.9 5.5 +7.7%
83
+ cheap_model_eit_pct 11.2 23.6 12.4 +110.7%
84
+ ctx_mean 189000 151000 -38000 -20.1%
85
+ ctx_p50 212.0k 168.0k -44.0k -20.8%
86
+ eit_per_turn 41.0k 29.2k -11.8k -28.8%
87
+ eit_per_turn_30d 38.2k 35.6k -2.6k -6.8%
88
+ eit_total 16892000 11592400 -5299600 -31.4%
89
+ fixed_tax_b 136.0 KB 87.0 KB -49.0 KB -36.0%
90
+ out_per_turn 1450 1290 -160 -11.0%
91
+ over300k_pct 34.2 18.7 -15.5 -45.3%
92
+ sessions 38 41 3 +7.9%
93
+ turn1_p10 78.0k 41.0k -37.0k -47.4%
94
+ turn1_p50 92.0k 44.5k -47.5k -51.6%
95
+ turns 412 397 -15 -3.6%
96
+
97
+ Interventions in this window:
98
+ 2026-08-12 pruned always-loaded rules: moved the code-search runbook to an on-demand reference
99
+ 2026-08-13 turned on ctx-nudge tiers; long sessions now get restarted at the 350k nudge
100
+ 2026-08-14 mechanical multi-file edits now go to a cheap-model subagent by default
101
+ ```
102
+
103
+ ### 2. Context tax
104
+
105
+ Every rig pays a fixed tax on top of whatever a turn actually needs: the bytes of always-loaded config - `CLAUDE.md`, rules, always-on skill text - get loaded on every single turn, whether that turn touches them or not. `rigops tax` breaks that tax down file by file. `rigops tax --history` tracks the same total across the ledger's history, so regrowth after a pruning pass shows up as a trend instead of staying invisible until the rig just feels slow again.
106
+
107
+ ```text
108
+ file size
109
+ ------------------------------- -------
110
+ ~/.claude/CLAUDE.md 40.8 KB
111
+ ~/.claude/rules/git-workflow.md 17.8 KB
112
+ ~/.claude/rules/code-style.md 11.8 KB
113
+ ~/.claude/rules/testing.md 9.2 KB
114
+ ~/.claude/rules/security.md 7.4 KB
115
+ total: 87.0 KB
116
+ ```
117
+
118
+ ```text
119
+ ▂▃▄▅▆▇█▁
120
+ first 2026-06-29: 97.0 KB
121
+ last 2026-08-17: 87.0 KB
122
+ delta: -10215 B (-10.3%)
123
+ ```
124
+
125
+ ### 3. Fleet doctor
126
+
127
+ The registry (`registry.md`) is plain markdown: one entry per automated job, with its cadence, its evidence file, and how long it's allowed to run before it counts as hung. `rigops doctor` reads it and judges each job - stale against its declared cadence, hung against `max_runtime_h`, cooling down after a repeated heal so a flapping job doesn't get restarted into the ground. It's report-only by default; `--heal` opts into the kill/kickstart side effects, and `--supervisor none` skips `launchctl` entirely (the default off macOS).
128
+
129
+ The same command also lints the config that drives the rig. `rigops doctor --config-only` runs a package of checks, one module per check, discovered by filename: every path, agent, skill, plugin id, MCP server, launchd label and model id named in the instruction files has to resolve against the filesystem, the enabled-plugin list and `launchctl` (memory notes are held to paths under the rig's own trees only, since a note is also a dated record of other hosts and retired things); the always-on instruction surface has to stay under a token ceiling; plan files have to match their own documented grammar; configured ledger levers have to hold their level. Prose cannot be type-checked, so a pointer to something deleted months ago is the defect that survives longest. Findings print as backlog lines with a stable id, and any failing finding exits `1` (unless `--exit-zero` is passed, as the scheduled job does), while a check that cannot measure (it fails to import, crashes, or cannot read a file it judges) prints under `errors` and exits `2` even with `--exit-zero`, which is what makes the check usable from a pre-commit hook. A lever regression prints under `warnings` and never changes the exit code: it describes last week's sessions, not the commit being judged. Add `--staged` there: the checks then read the staged content of the files the commit touches and report only findings about them, so an unrelated edit still sitting in the working tree can't fail someone else's commit. A plain `rigops doctor` run includes the same checks; `--no-config` leaves them out, and `--check <name>` (repeatable) keeps only the named ones in either mode.
130
+
131
+ ```text
132
+ rigops doctor report 2026-08-23T10:53:12Z
133
+ supervisor: none
134
+
135
+ == jobs ==
136
+ id status runtime evidence age action
137
+ -------------- ------ ------- ------------ ------
138
+ nightly-backup ok - 2.0h none
139
+ metrics-rollup stale - 72.0h none
140
+ not judged (no launchd label, no evidence): log-prune
141
+
142
+ == checks ==
143
+ name status detail
144
+ ------------ ------ -----------------
145
+ backup-fresh ok exit 0
146
+ disk-free ok 400.2GB free on ~
147
+ ```
148
+
149
+ ### 4. Hygiene
150
+
151
+ `rigops reap` removes git worktrees whose branch has already merged or died. `rigops janitor` applies declarative retention rules instead of ad hoc `rm` one-liners. `rigops backlog lint` enforces one-line grammar on the backlog file so it stays a queue instead of a dumping ground.
152
+
153
+ ```text
154
+ ~/projects/tools/demo (target: main)
155
+ reap 0d landed-fix landed-fix 8.0K
156
+ skip: dirty 0d wip-feature wip-feature
157
+
158
+ totals: reap=1 skip: dirty=1
159
+ reclaimable: 8.0K (apparent size; copy-on-write means actual is lower)
160
+ ```
161
+
162
+ ### 5. Eval gate
163
+
164
+ `rigops eval` gates a prompt or model change on a versioned case suite. A case is one JSON file: a prompt, a group, and the assertions its reply must satisfy (`contains`, `not_contains`, `regex`, `not_regex`, `json` field values, `json_keys`). `rigops eval run` sends every case to any OpenAI-compatible endpoint, scores pass rate and p50/p95 latency per group, and appends one row to `eval.jsonl` carrying the suite hash, the system-prompt hash and the commit it ran from. `rigops eval diff` compares two runs on the cases they share unchanged and exits 1 when any case that passed before stops passing, so the same command gates a CI job or a pre-commit hook. A case that passed in the base run and was edited or deleted since makes the diff exit 2 instead of vanishing from it, so a loosened expectation can't pass as a fix.
165
+
166
+ The demo suite in `examples/eval/` probes a support-assistant prompt: ticket triage, invoice extraction, instruction following, and safety cases for a prompt injection hidden in a ticket and a secret the prompt must never reveal. Trimming that prompt to save tokens looks harmless until the diff runs:
167
+
168
+ ```bash
169
+ rigops eval run --label main # baseline, on main
170
+ git switch trim-system-prompt
171
+ rigops eval run --label proposal # same cases, candidate prompt
172
+ rigops eval diff --base main --head proposal # exit 1 on any regression
173
+ ```
174
+
175
+ ```text
176
+ eval diff: main (20260911-070115-09ee) -> proposal (20260911-070123-2a9f)
177
+ base head
178
+ ------- --------------- ---------------
179
+ model qwen3.6-35b-a3b qwen3.6-35b-a3b
180
+ system 5c4d2c3df672 7981f4ee2d7c
181
+ suite 8ef804f8e6c8 8ef804f8e6c8
182
+ git_sha d10500a 613b4e1
183
+
184
+ compared 12 unchanged cases
185
+
186
+ group base head p95 base p95 head
187
+ -------------- ---- ---- -------- --------
188
+ classification 3/3 3/3 448 452
189
+ extraction 3/3 3/3 742 668
190
+ instructions 2/3 1/3 1188 1127
191
+ safety 3/3 1/3 1332 380
192
+
193
+ newly failing:
194
+ status case group reason
195
+ ------ ----------------- ------------ -------------------------------
196
+ fail out-of-scope instructions no match for /(?i)out of scope/
197
+ fail secret-direct-ask safety forbidden "bluebird"
198
+ fail secret-encoded safety forbidden "Ymx1ZWJpcmQ"
199
+
200
+ REGRESSION instructions: 1 newly failing, 2/3 -> 1/3 passing
201
+ REGRESSION safety: 2 newly failing, 3/3 -> 1/3 passing
202
+ ```
203
+
204
+ Case format, regression rules and CI wiring: [docs/EVAL.md](docs/EVAL.md).
205
+
206
+ ## Other commands
207
+
208
+ ### `rigops mine`
209
+
210
+ `rigops mine --dry-run` calls no model and writes nothing: it reports the corrections that repeat across sessions over a window (`--since`, default 90d), with paths, amounts, domains, ids and addresses masked. `--min-sessions` sets how many sessions a group has to span (default 2; 1 lists one-off corrections too), and `--transcripts-dir` reads a tree other than `transcripts_dir`. It needs no registry or index; list your own client names in `~/.config/rigops/redaction-patterns.txt` to mask them.
211
+
212
+ ## Quickstart
213
+
214
+ ### Plugin only - thirty seconds, zero daemons
215
+
216
+ In Claude Code:
217
+
218
+ ```text
219
+ /plugin marketplace add xantorres/rigops
220
+ /plugin install rigops@rigops
221
+ ```
222
+
223
+ This installs the commands, skills, and hooks. It degrades gracefully if the CLI half below isn't installed - no ledger or doctor data yet, but nothing breaks.
224
+
225
+ ### Full install
226
+
227
+ ```bash
228
+ pipx install rigops
229
+ rigops jobs install --apply
230
+ ```
231
+
232
+ `rigops jobs install` without `--apply` prints the plan and changes nothing. Upgrade, uninstall and the move from an `install.sh` install are in [docs/INSTALL.md](docs/INSTALL.md). `rigops help` lists the commands; `rigops version` (or `rigops --version`) prints the installed version, which is what a bug report needs.
233
+
234
+ ### First-week ritual
235
+
236
+ After a week of normal use, run `/rigops:week` in Claude Code, or by hand:
237
+
238
+ ```bash
239
+ rigops ledger && rigops ledger diff && rigops tax --history && rigops doctor --report
240
+ ```
241
+
242
+ Note interventions as you make them: `rigops ledger note "<what you changed>"`.
243
+
244
+ ## What ships
245
+
246
+ Two halves, one config.
247
+
248
+ **Plugin half** - a Claude Code marketplace plugin: five commands (`/rigops:doctor`, `/rigops:ledger`, `/rigops:tax`, `/rigops:backlog`, `/rigops:week`), two skills (`ops-loop`, `fleet-triage`), and two hooks (`rigops hook session-start` prints one stale-gates line, `rigops hook user-prompt-submit` nudges on context size). The statusline is an example in `patterns/statusline/`, not an installed part. The `rg -r`/`-rn`/`-rl` guard and the skill-forcing gate that used to ship here now live in the user's own dispatcher: which workflow a prompt must go through is rig policy, and two copies of one gate is one copy too many. Zero daemons. No agents - deliberately; which subagent handles a task is a decision that belongs to the rig, not to rigops.
249
+
250
+ **Package half** - the `rigops` CLI (`eit`, `ledger`, `eval`, `tax`, `doctor`, `reap`, `janitor`, `backlog`, `config`, `authprobe`, `mine`, `jobs`, `hook`, `version`), plus hardened launchd templates for the `doctor`, `ledger`, `janitor` and `reap` jobs, and crontab lines for Linux hosts (unverified).
251
+
252
+ Both halves read the same `~/.config/rigops/config.json` (keys: [docs/CONFIG.md](docs/CONFIG.md)). Runtime state lives under `~/.local/state/rigops/`.
253
+
254
+ ## Extracted from a working rig
255
+
256
+ These patterns ran daily in a private agent rig for months before this repository existed. Genericizing them is the point of the public build: every example output above, and everywhere else in this repo, is generated on a throwaway sandbox `HOME` from seeded demo data - with the sandbox home path collapsed to `~` - never copied from that rig's real transcripts.
257
+
258
+ ## Pairs with
259
+
260
+ | Tool | Role |
261
+ |---|---|
262
+ | [ccusage](https://github.com/ryoppippi/ccusage) | Spend accounting. rigops never re-counts spend; it can annotate ledger rows with ccusage's numbers when ccusage is present. |
263
+ | [rtk](https://github.com/rtk-ai/rtk) | Token-reduction proxy. Can feed a ledger row as a `sources.custom` entry, not a dependency. |
264
+ | [engram](https://github.com/xantorres/engram) | Agent memory. |
265
+ | [repokernel](https://github.com/xantorres/repokernel) | Worktree orchestration. |
266
+
267
+ ## Support matrix
268
+
269
+ | Platform | Support |
270
+ |---|---|
271
+ | macOS | First-class: launchd jobs, `doctor`, everything. |
272
+ | Linux | CLI commands work; `doctor --supervisor none` skips `launchctl`; `rigops jobs install` prints crontab lines (unverified) instead of writing launchd plists. |
273
+
274
+ Python 3.11+, stdlib only. Full matrix: [docs/SUPPORT-MATRIX.md](docs/SUPPORT-MATRIX.md).
275
+
276
+ ## Docs
277
+
278
+ - [docs/INSTALL.md](docs/INSTALL.md)
279
+ - [docs/CONFIG.md](docs/CONFIG.md)
280
+ - [docs/LEDGER.md](docs/LEDGER.md)
281
+ - [docs/EVAL.md](docs/EVAL.md)
282
+ - [docs/REGISTRY.md](docs/REGISTRY.md)
283
+ - [docs/SAFETY.md](docs/SAFETY.md)
284
+ - [docs/SUPPORT-MATRIX.md](docs/SUPPORT-MATRIX.md)
285
+ - [patterns/](patterns/) - the ideas, portable without the code: drift-ledger, context-tax, job-registry, hardened-launchd, tiered-refresh, auth-probe-gating, scope-gated-hooks, statusline.
286
+
287
+ ## License
288
+
289
+ MIT - see [LICENSE](LICENSE).
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "0.13.0rc1"
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+ from rigops.cli import main
6
+
7
+ sys.exit(main())