@agentsfleet/orly 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.githooks/pre-commit +42 -0
  2. package/.githooks/pre-push +67 -0
  3. package/AGENTS.md +348 -0
  4. package/LICENSE +21 -0
  5. package/README.md +249 -0
  6. package/SOUL.md +90 -0
  7. package/audits/agents-md.md +497 -0
  8. package/audits/agents-md.sh +353 -0
  9. package/audits/cross-tier-rates.sh +105 -0
  10. package/audits/data.sh +185 -0
  11. package/audits/deinit-pairs.sh +224 -0
  12. package/audits/design-tokens.sh +143 -0
  13. package/audits/doc-read.sh +183 -0
  14. package/audits/error-codes.sh +221 -0
  15. package/audits/fixtures/clean.diff +15 -0
  16. package/audits/fixtures/dirty.diff +16 -0
  17. package/audits/lifecycle-anchors.sh +22 -0
  18. package/audits/logging.sh +217 -0
  19. package/audits/msid-ui.sh +144 -0
  20. package/audits/parity-dispatch.sh +51 -0
  21. package/audits/rule-ledger-lib.sh +264 -0
  22. package/audits/rule-ledger.sh +225 -0
  23. package/audits/rule-paths.sh +108 -0
  24. package/audits/spec-template.sh +258 -0
  25. package/audits/sql-mod.sh +102 -0
  26. package/audits/ufs.sh +303 -0
  27. package/bin/orly +26 -0
  28. package/core/operating-model.md +256 -0
  29. package/dispatch/edit_rules.md +69 -0
  30. package/dispatch/lib.sh +213 -0
  31. package/dispatch/lifecycle.md +187 -0
  32. package/dispatch/name_architecture.md +93 -0
  33. package/dispatch/verify.md +111 -0
  34. package/dispatch/write_any.md +740 -0
  35. package/dispatch/write_any.sh +49 -0
  36. package/dispatch/write_auth.md +36 -0
  37. package/dispatch/write_changelog.md +64 -0
  38. package/dispatch/write_documentation.md +45 -0
  39. package/dispatch/write_go.md +24 -0
  40. package/dispatch/write_http.md +45 -0
  41. package/dispatch/write_mdx.md +7 -0
  42. package/dispatch/write_python.md +8 -0
  43. package/dispatch/write_rust.md +38 -0
  44. package/dispatch/write_shell.md +8 -0
  45. package/dispatch/write_spec.md +105 -0
  46. package/dispatch/write_sql.md +112 -0
  47. package/dispatch/write_sql.sh +36 -0
  48. package/dispatch/write_ts_adhere_bun.md +493 -0
  49. package/dispatch/write_ts_adhere_bun.sh +37 -0
  50. package/dispatch/write_zig.md +852 -0
  51. package/dispatch/write_zig.sh +40 -0
  52. package/docs/CHANGELOG_VOICE.md +18 -0
  53. package/docs/DISPATCH_ARCHITECTURE.md +664 -0
  54. package/docs/DISPATCH_REVIEW_DISPOSITION.md +65 -0
  55. package/docs/DOCUMENTATION_RULES.md +209 -0
  56. package/docs/EXECUTE_DOC_READS.md +29 -0
  57. package/docs/HARNESS_VERIFY_OUTPUT.md +40 -0
  58. package/docs/LIFECYCLE_PATTERNS.md +316 -0
  59. package/docs/LOGGING_STANDARD.md +397 -0
  60. package/docs/ORLY_ARCHITECTURE.md +129 -0
  61. package/docs/REST_API_DESIGN_GUIDELINES.md +783 -0
  62. package/docs/RULE_ENFORCEMENT.md +41 -0
  63. package/docs/SCHEMA_CONVENTIONS.md +93 -0
  64. package/docs/TEMPLATE.md +411 -0
  65. package/docs/VERIFY_TIERS.md +57 -0
  66. package/docs/greptile-learnings/README.md +51 -0
  67. package/docs/greptile-learnings/RULES.md +1045 -0
  68. package/fixtures/registry-invalid.json +1 -0
  69. package/fixtures/registry-valid.json +18 -0
  70. package/fixtures/unclosed-pack-block.md +8 -0
  71. package/package.json +63 -0
  72. package/packs/language/go/rules.md +24 -0
  73. package/packs/language/mdx/rules.md +7 -0
  74. package/packs/language/python/rules.md +8 -0
  75. package/packs/language/rust/rules.md +38 -0
  76. package/packs/language/shell/rules.md +8 -0
  77. package/registry.json +405 -0
  78. package/schemas/evidence.schema.json +43 -0
  79. package/schemas/profile.schema.json +12 -0
  80. package/schemas/registry.schema.json +12 -0
  81. package/skills/orly-babysit-prs/SKILL.md +326 -0
  82. package/skills/orly-spec-new/SKILL.md +157 -0
  83. package/skills/orly-write-integration-test/SKILL.md +470 -0
  84. package/skills/orly-write-unit-test/SKILL.md +520 -0
  85. package/src/cli.test.ts +70 -0
  86. package/src/cli.ts +287 -0
  87. package/src/config.test.ts +226 -0
  88. package/src/config.ts +288 -0
  89. package/src/criteria.test.ts +137 -0
  90. package/src/criteria.ts +166 -0
  91. package/src/criteria_spec.ts +127 -0
  92. package/src/criteria_support.ts +53 -0
  93. package/src/gates.test.ts +183 -0
  94. package/src/gates.ts +169 -0
  95. package/src/gates_spec.test.ts +98 -0
  96. package/src/gates_test_support.ts +194 -0
  97. package/src/git_env.ts +20 -0
  98. package/src/install.test.ts +514 -0
  99. package/src/install.ts +447 -0
  100. package/src/install_nested.test.ts +32 -0
  101. package/src/model.test.ts +31 -0
  102. package/src/model.ts +245 -0
  103. package/src/references.test.ts +47 -0
  104. package/src/references.ts +147 -0
  105. package/src/render.test.ts +60 -0
  106. package/src/render.ts +94 -0
  107. package/src/surfaces.test.ts +43 -0
  108. package/src/surfaces.ts +89 -0
  109. package/src/validation.test.ts +11 -0
  110. package/src/validation.ts +87 -0
  111. package/src/verify.test.ts +13 -0
  112. package/src/verify.ts +59 -0
@@ -0,0 +1,497 @@
1
+ # Oracle rules invariance suite
2
+
3
+ A three-part proof that generated `AGENTS.md` still holds the line after edits:
4
+
5
+ 1. **Deterministic layer** β€” `audits/agents-md.sh` (mechanical, fast, runs in `pre-commit`).
6
+ 2. **Prompt-invariance layer** β€” this file. A Large Language Model (LLM) agent reads `AGENTS.md` and answers every question below. Every answer must be **YES**. A NO means the ruleset regressed.
7
+ 3. **Evidence layer** β€” `orly verify --write-evidence` records the source commit, registry digest, profile checks, and prompt result.
8
+
9
+ Run this suite before and after an operating-model change. Both runs must produce the same all-YES result. A pass that flips to NO is a broken invariant.
10
+
11
+ ---
12
+
13
+ ## Step 1 β€” Run the deterministic script
14
+
15
+ ```bash
16
+ bash audits/agents-md.sh
17
+ ```
18
+
19
+ If exit β‰  0, **STOP**. The script's `FAIL:` lines name the regression. Fix AGENTS.md first; do not proceed to Step 2 with a failing script.
20
+
21
+ ---
22
+
23
+ ## Step 2 β€” Prompt-invariance questionnaire
24
+
25
+ Hand AGENTS.md to the LLM and have it answer each question with **YES** / **NO** + the AGENTS.md line(s) that justify the answer. A `NO` (or "I can't find it") is a regression.
26
+
27
+ The questionnaire is organised by scenario. Each scenario corresponds to a moment in the lifecycle where determinism matters most β€” the points where a vague AGENTS.md would let an agent silently drift.
28
+
29
+ ### Scenario 1 β€” A new spec is handed over (pre-CHORE(open))
30
+
31
+ | # | Question | Expected |
32
+ |---|---|---|
33
+ | 1.1 | Does AGENTS.md require the new spec to land in `docs/v{N}/pending/` with `Status: PENDING`? | YES |
34
+ | 1.2 | Is writing a `TODO.md` explicitly forbidden? | YES |
35
+ | 1.3 | Must `orly-spec-new` be invoked rather than hand-rolling the spec file? | YES |
36
+ | 1.4 | Is the agent forbidden from writing code before CHORE(open) completes its 4 steps? | YES |
37
+ | 1.5 | When a spec contradicts a rule, must the spec be amended (not the rule weakened)? | YES |
38
+
39
+ ### Scenario 2 β€” Brainstorming leads to a new spec
40
+
41
+ | # | Question | Expected |
42
+ |---|---|---|
43
+ | 2.1 | Is the Golden-path walk-through required before PLAN approval, with `[?]` blocking? | YES |
44
+ | 2.2 | Must surfaced assumptions be listed (`ASSUMPTIONS I'M MAKING…`) before non-trivial work? | YES |
45
+ | 2.3 | Must Discovery findings (e.g. legacy consults) be logged in the spec's Discovery section or filed as a new pending spec? | YES |
46
+ | 2.4 | Are external-credential needs enumerated in `M{N}_001` before any `M{N}_002+`? | YES |
47
+
48
+ ### Scenario 3 β€” Executing a new spec; human spots and steers
49
+
50
+ | # | Question | Expected |
51
+ |---|---|---|
52
+ | 3.1 | When a mid-task conflict surfaces, must the agent STOP, name it, present tradeoff, and wait? | YES |
53
+ | 3.2 | Must the agent edit only files in the spec's approved scope (no opportunistic refactors)? | YES |
54
+ | 3.3 | If an NLR DECISION is required, does the agent have **no autonomous escape** β€” only the user can choose? | YES |
55
+ | 3.4 | Must Legacy-Design Consult **block on user reply** (not silently patch/keep)? | YES |
56
+ | 3.5 | If the user says "review this" / "look at this", does the agent treat it as investigation, not authorization? | YES |
57
+
58
+ ### Scenario 4 β€” Executing on UI, Zig, TS/JS, Rust, Go, Python, shell, Markdown JSX, or CI files
59
+
60
+ | # | Question | Expected |
61
+ |---|---|---|
62
+ | 4.1 (UI) | For every `*.tsx`/`*.jsx` under `ui/packages/app/`, must raw HTML be substituted with a design-system primitive when one exists? | YES |
63
+ | 4.1a (UI) | For every `*.tsx`/`*.jsx` under `ui/packages/{app,website}/`, does DESIGN TOKEN GATE block arbitrary `*-[...]` Tailwind classes (`text-[Npx]`, `leading-[...]`, `tracking-[...]`, `max-w-[Npx|Nch]`, `text-[clamp(...)]`, raw palette colours) when an equivalent token utility exists in `ui/packages/design-system/src/theme.css`? | YES |
64
+ | 4.1b (UI) | Is the DESIGN TOKEN GATE override `// DESIGN TOKEN: SKIPPED per user override (reason: ...)` user-only β€” i.e. auto-mode does NOT cover it, and reasons must cite a concrete external constraint (not "looks the same" / "shorter to write")? | YES |
65
+ | 4.1c (UI) | Does the project-side `audits/design-tokens.sh` audit run as part of `make lint` (`_website_lint` + `_app_lint`) and block on any arbitrary that has a token equivalent? (Default scope: full ui/packages working tree via `git ls-files`; the diff-scoped mode is retired.) | YES |
66
+ | 4.2 (Zig) | For every `*.zig` Edit/Write outside `vendor/`/`third_party/`/`.zig-cache/`, does ZIG GATE fire? | YES |
67
+ | 4.3 (Zig) | Must FILE SHAPE DECISION print before the first Write to a new `*.zig` under `src/` β€” and is that override **not** covered by auto-mode? | YES |
68
+ | 4.4 (Zig) | Does PUB GATE delegate mechanical consumer-grep to `zlint`'s `unused-decls: error` rule (run by `make lint`), leaving the gate body to enforce shape verdict + no-inheritance + per-edit proof? | YES |
69
+ | 4.4a (Zig) | Does AGENTS.md prohibit inheriting a sibling's `pub fn` decision β€” i.e. does every new pub surface require its own shape verdict, and does cloning a sibling's "Public for the integration test in …" comment NOT discharge the gate? | YES |
70
+ | 4.4b (Zig) | Does AGENTS.md require a per-edit proof-line (full block OR one-line `PUB GATE: skipped β€” <reason>`) before every `*.zig` Edit/Write, so silent gate-clean edits are still violations (the proof of consideration is part of the discipline)? | YES |
71
+ | 4.4c (Zig) | Does the PUB GATE trigger set explicitly include "any new `^pub` line in new-bytes" (the pre-edit grep at body Β§1), so the threshold list (first pub type / first method on pub-free-fn-dominant / last pub free fn removed) is a floor, not a ceiling? | YES |
72
+ | 4.5 (Zig) | Is cross-compile to `x86_64-linux` AND `aarch64-linux` mandatory before commit? | YES |
73
+ | 4.6 (TS/JS) | Are milestone IDs (`M{N}_{NNN}`, `Β§X.Y`, `T7`, `dim 5.8.15`) banned in source files (incl. tests)? | YES |
74
+ | 4.7 (TS/JS) | Does RULE UFS require string literals used in β‰₯2 sites to become a named constant? | YES |
75
+ | 4.7a (TS/JS/Zig) | Does RULE UFS extend to numeric literals carrying semantic meaning (conversion factors, thresholds, sub-cent rates) β€” required to become a named constant even at the first use site, with a pin-test carve-out? | YES |
76
+ | 4.7b (cross-runtime) | Must cross-runtime constants share an identical SCREAMING_SNAKE name across Zig + TS + JS (e.g. `NANOS_PER_USD` everywhere, never `NANOS_PER_DOLLAR` in one and `NANOS_PER_USD` in another)? | YES |
77
+ | 4.7c (test fixtures) | Are test fixtures, mock returns, and assertion arguments **not** RULE UFS exceptions β€” i.e. wire-format strings and semantic numerics in test code must use the named constant just like production code does? | YES |
78
+ | 4.8 (Shell) | Are shell scripts subject to the File & Function Length Gate (≀350 / ≀50 / ≀70)? | YES |
79
+ | 4.8a (Length) | Is 350 a **ceiling rather than a budget** β€” must a source file be split below the cap whenever the agent's own rubric (test coverage, simplicity, optimisation, performance, concurrency, adversarial review) says two files beat one, with two ~150-line files a good outcome rather than an over-split, and is a file with no headroom left for its own tests already too long? | YES |
80
+ | 4.8b (Length scope) | Does the File & Function Length Gate cover **test files and extensionless executables** too β€” no `.test.`/`_test`/`/tests/` carve-out anywhere, and an extensionless staged file carrying a shebang gated by `dispatch_add_shebang_files` because an ambiguous extension makes the gate fire by default? | YES |
81
+ | 4.9 (Shell) | Must `gitleaks` pass before any commit/push? | YES |
82
+ | 4.10 (CI) | Are CI/CD edits (`.github/workflows/**`, deploy configs) **forbidden without explicit user approval** even in auto mode? | YES |
83
+ | 4.11 (Bun) | For `*.ts`/`*.tsx`/`*.js`/`*.jsx` edits, does AGENTS.md route to `dispatch/write_ts_adhere_bun.md` (TS FILE SHAPE DECISION at PLAN, const/import/Bun-primitive discipline)? | YES |
84
+ | 4.12 (Logging) | For every Edit/Write that adds/removes/changes a log emit (Zig `std.log.*`/`std.debug.print`/`obs.scoped`, TS/JS `console.*`/custom logger, shell `echo` to `&2`), does LOGGING GATE require reading `docs/LOGGING_STANDARD.md` and printing the per-edit gate block citing Β§3 (wire format) / Β§4 (severity) / Β§5 (error codes) / Β§6 (PII) / Β§10A (tightenings)? | YES |
85
+ | 4.13 (Logging) | Is `std.debug.print` in non-test source AND `console.log` in `agentsfleet/src/**` an automatic blocking violation, with no "temporary" carve-out? | YES |
86
+ | 4.14 (Logging) | Must a new registry-scheme `error_code` reference (agentsfleet: `UZ-XXX-NNN`) land in the same commit as its registry entry (used-but-undeclared = blocking)? | YES |
87
+ | 4.15 (Lifecycle) | For every Edit/Write that adds/reshapes a lifecycle method in `*.zig` (`pub fn init|deinit|close|release|destroy|shutdown|dispose|free`) or an `errdefer`/`defer` adjacent to allocation, does LIFECYCLE GATE require reading `docs/LIFECYCLE_PATTERNS.md` and printing the per-edit gate block? | YES |
88
+ | 4.16 (Lifecycle) | Is `defer X.free(Y)` + `errdefer X.free(Y)` on the same allocation in the same scope a blocking violation? | YES |
89
+ | 4.17 (Lifecycle) | Must the LAST `errdefer` in init lexically precede the LAST allocation it protects (no batched-at-bottom errdefer)? | YES |
90
+ | 4.18 (Spec template) | For every Edit/Write to a spec under `docs/v*/{pending,active,done}/` or to `docs/TEMPLATE.md`, does SPEC TEMPLATE GATE forbid time/effort estimates, complexity ratings, percentage-complete fields, owners, and dates (per `TEMPLATE.md` "Prohibited" section)? | YES |
91
+ | 4.19 (Spec template) | Does `spec-template.sh` run as part of `make lint` and block on prohibited-section regex matches? | YES |
92
+ | 4.20 (Doc read) | For every Edit/Write whose file pattern matches a row in the EXECUTE doc-reads table, does DOC READ GATE require a `πŸ“– DOC READ: <path>` proof-line β€” either citing Β§N applied OR the cited-skip variant β€” before the turn's first triggering edit? | YES |
93
+ | 4.21 (Doc read) | Is the `πŸ“– DOC READ:` proof-line required **per triggered document per turn** (not once per session β€” every new turn that edits the trigger surface needs a fresh line)? | YES |
94
+ | 4.22 (Doc read) | Are auto-mode and "I read this earlier" both invalid grounds to skip the per-turn proof-line β€” already-loaded sections are cited rather than re-read, but the line itself is never skipped? | YES |
95
+ | 4.23 (Documentation) | Before published Markdown JSX (MDX), reusable snippets, customer readme, or public OpenAPI prose, must the agent read `dispatch/write_documentation.md` and `docs/DOCUMENTATION_RULES.md` before any narrower guide? | YES |
96
+ | 4.24 (Documentation) | Are page, snippet, generated API, and changelog scopes distinct, with repository-owned pre-commit checks enforcing the mechanical rules? | YES |
97
+ | 4.25 (Rust) | Do `*.rs` edits route to `dispatch/write_rust.md` β€” ownership, error variants, feature combinations, deterministic contention tests β€” with Microsoft's Pragmatic Rust Guidelines (`~/Projects/oss/rust-guidelines/all.txt`, fetched when absent) read sectioned and its `M-…` IDs cited in every Rust review? | YES | <!-- oracle-packs:language.rust -->
98
+ | 4.25a (Go) | Do `*.go` edits route to `dispatch/write_go.md`, with wrapped errors, goroutine exit paths, context-first signatures, defer-at-acquire, and `-race` verification? | YES | <!-- oracle-packs:language.go -->
99
+ | 4.26 (Python) | Do `*.py` edits route to `dispatch/write_python.md`, with parse-boundary validation and context-managed resources? | YES |
100
+ | 4.27 (Shell) | Do `*.sh` edits route to `dispatch/write_shell.md`, with quoted expansions, array arguments, cleanup, and compatibility requirements? | YES |
101
+ | 4.28 (Markdown JSX) | Do `*.mdx` edits route to `dispatch/write_mdx.md`, with structure, link, accessibility, and Mintlify-isolation requirements? | YES | <!-- oracle-packs:language.mdx -->
102
+
103
+ ### Scenario 5 β€” Picking up a handover
104
+
105
+ | # | Question | Expected |
106
+ |---|---|---|
107
+ | 5.1 | Is the agent required to verify CWD is inside the active worktree before resuming (`pwd` + `git worktree list`)? | YES |
108
+ | 5.2 | Must the agent re-read RULES.md when sub-task shape changes (new layer/language/resume after break)? | YES |
109
+ | 5.3 | If the spec is in `active/`, is CHORE(close) the mandatory next action after any COMMIT? | YES |
110
+ | 5.4 | If unexpected changes appear in files the agent is editing, must the agent stop and ask (not overwrite as stale)? | YES |
111
+
112
+ ### Scenario 6 β€” Conformance and verification lifecycle
113
+
114
+ | # | Question | Expected |
115
+ |---|---|---|
116
+ | 6.1 | Does CONFORM enumerate every gate as a row in its verdict block and invoke the active profile's `conform` commands? | YES |
117
+ | 6.2 | Does any remaining violation in CONFORM return the lifecycle to EXECUTE without advancing? | YES |
118
+ | 6.3 | Is `/orly-write-unit-test` the FIRST verify action, with skipping = CHORE(close) violation? | YES |
119
+ | 6.4 | Are `make lint` + `make test` always required (tier 1)? | YES |
120
+ | 6.5 | Is the repository's declared `verify.integration` required when the diff touches HTTP/schema/DB/Redis or integration-test surfaces? | YES |
121
+ | 6.6 | Is at least one declared `verify.integration` run from clean state required per branch before ship-ready (where the repository declares one)? | YES |
122
+ | 6.7 | Are package-scoped runners (`bun run test`, `vitest <file>`, `zig build test` w/o integration) explicitly **not** verification? | YES |
123
+ | 6.8 | Must memleak evidence (last 3 lines verbatim) appear in PR Session Notes when touching `src/http/**` / `src/cmd/serve.zig` / allocator wiring? | YES |
124
+ | 6.9 | Does CHORE(open) record a `Test Baseline:` line (unit + integration counts from the repository's declared `verify.*` commands; a product pack may name a dedicated counter) in the spec header? | YES |
125
+ | 6.10 | Does VERIFY end with a Test Delta row (growth vs the CHORE(open) baseline) plus a lacking-areas verdict, with zero/negative unit delta on a code-adding diff requiring justification or a return to EXECUTE? | YES |
126
+ | 6.11 | Do the lifecycle stage runbooks (CHORE(open/close) checklists, PLAN expansions, deferral quote format, pre-PR gates, LAND) resolve from `dispatch/lifecycle.md`, with AGENTS.md keeping each stage's binding essence? | YES |
127
+
128
+ ### Scenario 7 β€” Review discipline before merge
129
+
130
+ | # | Question | Expected |
131
+ |---|---|---|
132
+ | 7.1 | Is the skill chain order `/orly-write-unit-test` β†’ runtime review β†’ `orly-babysit-prs` preserved? | YES |
133
+ | 7.2 | Is REVIEW an explicit stage after VERIFY and before DOCUMENT, with the runtime's review route required there? | YES |
134
+ | 7.3 | Is gstack `/review` the single review route for every runtime (Claude, Codex, OpenCode, Amp) β€” local and pre-commit, distinct from post-push reviewer triage? | YES |
135
+ | 7.4 | Does `orly-babysit-prs` run after every push and stop only on two consecutive empty polls? | YES |
136
+ | 7.5 | Is using `gh pr checks --watch` for greptile explicitly disallowed? | YES |
137
+ | 7.6 | If an MCP-backed skill is unavailable, must PR Session Notes record the skip + a "rerun before merge" note? | YES |
138
+ | 7.7 | Is merging/closing/ready-from-draft of another user's PR forbidden without explicit approval? | YES |
139
+ | 7.8 | Does AGENTS.md require an Indy-acked verbatim quote (in PR Session Notes or the spec's Discovery section, format `> Indy (YYYY-MM-DD HH:MM): "<quote>"`) for any claim that a spec Section/Dimension was "deferred to follow-up" β€” and does an agent-unilateral deferral count as incomplete scope (not deferral), blocking CHORE(close) until either the item lands or the quote is captured? | YES |
140
+ | 7.9 | Does AGENTS.md treat `HANDOFF.md` (or `HANDOFF_*.md` at any depth) as a faithful state report β€” i.e. must a pickup agent reading a HANDOFF that claims items were deferred without ack-quotes treat those items as in-scope and surface the contradiction to Kishore before continuing? | YES |
141
+ | 7.10 (Architecture) | Does the `name_architecture` dispatch faΓ§ade (`dispatch/name_architecture.md`) explicitly name "chat brainstorming counts" β€” i.e. multi-turn chat designing a new pattern fires the dispatch even before code touches, and capturing the brainstorm as a "punchlist task to land after the code ships" is forbidden (a pickup agent reading such a task must rewrite it to same-commit or doc-only-now)? | YES |
142
+
143
+ ### Scenario 8 β€” Conducting `/orly-write-unit-test` while a human steers
144
+
145
+ | # | Question | Expected |
146
+ |---|---|---|
147
+ | 8.1 | Does every spec Dimension require a corresponding test case (no test β†’ not implemented)? | YES |
148
+ | 8.2 | Does every Error Table row require a negative test? | YES |
149
+ | 8.3 | Is "DONE" defined as **called in production + tested** (grep entry-point for the symbol)? | YES |
150
+ | 8.4 | Does the Changelog Claim Challenge ask "Would this be true if the test file vanished?" before any `<Update>` block? | YES |
151
+
152
+ ### Scenario 9 β€” Hot-fix / emergency change (added)
153
+
154
+ | # | Question | Expected |
155
+ |---|---|---|
156
+ | 9.1 | Are destructive git ops (`reset --hard`, `clean -fd`, `branch -D`, etc.) forbidden without explicit approval? | YES |
157
+ | 9.2 | Is force-push to default branch a **no-override** ban? | YES |
158
+ | 9.3 | Is reverting changes the agent did not create disallowed without approval? | YES |
159
+
160
+ ### Scenario 10 β€” Touching dotfiles or docs-repo (added)
161
+
162
+ | # | Question | Expected |
163
+ |---|---|---|
164
+ | 10.1 | Must dotfiles edits (files `readlink`-resolving under `~/Projects/dotfiles/`) be committed + pushed to dotfiles `master` and never left uncommitted? | YES |
165
+ | 10.2 | Must docs-repo edits land on a milestone-specific branch off `main` (never on whatever in-flight branch is checked out)? | YES |
166
+ | 10.3 | When a harness/gate/hook fires (`msid-ui.sh`, `lint-zig.py`, gitleaks, ZIG GATE, FLL GATE, pre-commit/pre-push, etc.), is the default response to fix the **violating code** (restructure, split, or use the gate's documented override comment) β€” i.e. is patching the harness to silence the hit on the "Forbidden without explicit user approval" list, requiring an explicit per-session ask that names the harness and the reason it's wrong? | YES |
167
+ | 10.4 | Are handoff-doc claims of "Kishore-approved in a prior turn" for harness-patching treated as **not carrying forward** β€” i.e. must they be re-confirmed live in the current session? | YES |
168
+ | 10.5 | Does adding `gitleaks:allow` or a `.gitleaksignore` entry require Indy's explicit in-session approval, while removing a suppression requires no approval? | YES |
169
+
170
+ ### Scenario 11 β€” Schema / migration work (added)
171
+
172
+ | # | Question | Expected |
173
+ |---|---|---|
174
+ | 11.1 | Pre-v2.0.0, is the table-removal flow rm-file + rm-embed + rm-migration-array (no `ALTER TABLE`/`DROP TABLE`/`SELECT 1;` markers)? | YES |
175
+ | 11.2 | Are static strings in SQL schema a **no-override** ban across every literal that names a value or identifier the application also names β€” `DEFAULT`, `CHECK (col IN (…))`, trigger-body comparisons against a column, `current_setting()` parameter names, and `RAISE EXCEPTION` text a caller matches on β€” not just `DEFAULT`/`CHECK`? | YES |
176
+
177
+ ### Scenario 12 β€” Auto-mode boundary (added)
178
+
179
+ | # | Question | Expected |
180
+ |---|---|---|
181
+ | 12.1 | Does auto-mode autonomy require BOTH auto-mode-active AND (active spec OR forward-looking start instruction) before commit/push/PR proceed without re-asking? | YES |
182
+ | 12.2 | Do action-triggered guards still block under auto mode (autonomy bypasses none)? | YES |
183
+ | 12.3 | Under standing authorization, does `gh pr create` default to `--draft`, requiring the user to explicitly ask for a ready PR? | NO |
184
+
185
+ ### Scenario 13 β€” Ruleset changes (Invariance Suite meta-gate)
186
+
187
+ | # | Question | Expected |
188
+ |---|---|---|
189
+ | 13.1 | When the agent edits `core/**`, `packs/**`, `schemas/**`, `src/**`, `registry.json`, generated `AGENTS.md`, `audits/agents-md.md`, governance hooks, or any dispatch entry, does `edit_rules` require the audit and questionnaire before declaring done? | YES |
190
+ | 13.2 | Is the agent forbidden from self-overriding the Invariance Suite Gate? (Only the user may bypass at push time via `SKIP_INVARIANCE_PUSH=1`.) | YES |
191
+ | 13.3 | Does generated evidence bind the source commit, registry digest, profile results, and prompt-comprehension result? | YES |
192
+ | 13.4 | Does the pre-push hook run the deterministic chain and regenerate evidence against the pushed commit, with live prompt evaluation deliberately off the push path (the hook records `--llm-result not-required` with its rationale; `make llmevals` is the manual matrix)? | YES |
193
+
194
+ ### Scenario 14 β€” Communication discipline
195
+
196
+ | # | Question | Expected |
197
+ |---|---|---|
198
+ | 14.1 | Does AGENTS.md require expanding non-obvious acronyms / project codenames / vendor names on first mention in chat replies, PR descriptions, commit messages, AND inline code comments? | YES |
199
+ | 14.2 | Is there an explicit skip-list of undergrad-CS staples (API, URL, HTTP, JSON, SQL, DNS) that need NO expansion? | YES |
200
+ | 14.3 | Does AGENTS.md require a pre-send self-check scanning outgoing text for unexpanded acronyms (regex `\b[A-Z][A-Z0-9]{1,5}\b`), treating skip as on par with skipping a gate (`ACRONYM CHECK: SKIPPED per user override (reason: ...)`)? | YES |
201
+ | 14.4 | Does the tone rule permit dry humour and swear words, while requiring that technical clarity is never traded for it? | YES |
202
+ | 14.5 | Does the verification done-message use βœ… / πŸ”΄ / 🟠 glyphs and the explicit format defined in `dispatch/verify.md`? | YES |
203
+ | 14.6 | Does AGENTS.md identify the human as Kishore (casual handle Indy) and the agent as Oracle (casual handle Orly), with address tags 🀠 Indy / πŸ¦‰ Orly so addressing resolves unambiguously? | YES |
204
+
205
+ ### Scenario 15 β€” Architecture-edit ordering
206
+
207
+ | # | Question | Expected |
208
+ |---|---|---|
209
+ | 15.1 | Must an architecture decision land its `docs/architecture/` edit either (a) in an immediate doc-only commit OR (b) in the same commit as the implementation, with (c) follow-up AFTER code explicitly forbidden? | YES |
210
+ | 15.2 | Must every M-spec branch touching flow-defining code produce a non-empty `git diff origin/main..HEAD -- docs/architecture/`, OR have PR Session Notes document why nothing architectural changed? | YES |
211
+
212
+ ### Scenario 16 β€” Credentials & vault
213
+
214
+ | # | Question | Expected |
215
+ |---|---|---|
216
+ | 16.1 | Are plaintext secrets in entity tables (`core.agents`, `core.workspaces`, etc.) a **no-override** forbidden? | YES |
217
+ | 16.2 | Must credentials be stored as a vault `key_name` reference and resolved at runtime via `crypto_store.load()`? | YES |
218
+ | 16.3 | Are static strings in SQL schema a **no-override** forbidden β€” enforced via app-code named constants, and where SQL cannot import the constant, pinned by a slot-grep test rather than left to vigilance? | YES |
219
+ | 16.4 | Must the agent NEVER print/log/paste a credential value, and always use `op read 'op://...'` at runtime when verification steps reference credentials? | YES |
220
+
221
+ ### Scenario 17 β€” DB discipline (Zig)
222
+
223
+ | # | Question | Expected |
224
+ |---|---|---|
225
+ | 17.1 | Does `conn.query()` require `.drain()` in the same function before `deinit()`, with `make lint-governance` verifying (it wraps `_lint_zig_pg_drain`, the drain check that actually exists)? | YES |
226
+ | 17.2 | Is `conn.exec()` the prescribed alternative when no rows are needed? | YES |
227
+
228
+ ### Scenario 18 β€” Commit/push hygiene & worktree isolation
229
+
230
+ | # | Question | Expected |
231
+ |---|---|---|
232
+ | 18.1 | Must `gitleaks` pass before any `git commit` / `git push`? | YES |
233
+ | 18.2 | Is the rule "one worktree per active stream β€” no edits outside, no reads from siblings, merge only after REVIEW and the final commit" preserved? | YES |
234
+ | 18.3 | Are cross-worktree edits explicitly forbidden without explicit user approval? | YES |
235
+
236
+ ### Scenario 19 β€” CONFORM combined audit
237
+
238
+ | # | Question | Expected |
239
+ |---|---|---|
240
+ | 19.1 | Does CONFORM include a combined awk pass over `git diff -U0 HEAD` that emits `MS-ID:`, `PUB:`, and `UI:` hits? | YES |
241
+ | 19.2 | Is non-empty awk output a violation that must be addressed before CONFORM passes? | YES |
242
+
243
+ ### Scenario 20 β€” Rule extension protocol
244
+
245
+ | # | Question | Expected |
246
+ |---|---|---|
247
+ | 20.1 | Does AGENTS.md document a "Rule extension protocol" requiring 4 same-diff steps when introducing a new rules file (`docs/<TOPIC>_RULES.md`) or dispatch entry (`dispatch/<entry>.md`)? | YES |
248
+ | 20.2 | Does the protocol require: (a) doc-reads table row, (b) audits/agents-md.md question, (c) `DOTFILES_RESIDENT` audit entry, (d) `make audit` passing before commit? | YES |
249
+ | 20.3 | Does the Invariance Suite Gate fire on any commit landing the protocol's edits, with generated evidence mandatory before push? | YES |
250
+
251
+ ### Scenario 21 β€” Gate-flag triage discipline
252
+
253
+ | # | Question | Expected |
254
+ |---|---|---|
255
+ | 21.1 | Does AGENTS.md define a "Gate-flag triage" rule that splits a fired gate by kind β€” a mechanical/deterministic fix is auto-applied + informed, a judgment-level flag makes the default a Kishore ask β€” never silencing the gate or patching the harness in either case? | YES |
256
+ | 21.2 | Does the rule require the ask to include: (a) symbol/file/line flagged, (b) fix scope (files, lines, follow-on), (c) what we gain, (d) what happens if not fixed? | YES |
257
+ | 21.3 | Does the rule explicitly forbid the agent from unilaterally classifying a flag as a false-positive (declaring the gate wrong), as distinct from auto-fixing a mechanical violation? | YES |
258
+
259
+ ### Scenario 22 β€” Pre-commit audit scope
260
+
261
+ | # | Question | Expected |
262
+ |---|---|---|
263
+ | 22.1 | When `make harness-verify` (the pre-commit ceremony) invokes `ufs.sh`, `design-tokens.sh`, `deinit-pairs.sh`, `error-codes.sh`, `logging.sh`, or `spec-template.sh`, do those scripts default to scanning the full working tree via `git ls-files` β€” so staged-but-not-yet-committed content is in scope? | YES |
264
+ | 22.2 | Is the `--diff` (BASE...HEAD) mode of `ufs.sh` and `design-tokens.sh` retired β€” explicitly rejected with exit 2 and a pointer to the gate body? | YES |
265
+ | 22.3 | Does `msid-ui.sh` (renamed from `combined.sh` after the PUB clause moved to zlint + agent chat-output discipline) remain the lone diff-shaped audit (still default `--staged`) β€” because its sub-checks (MS-ID / UI substitution) assert on *added* lines, not file state, and `git diff --cached` reads the index? | YES |
266
+ | 22.4 | Does every dispatch faΓ§ade that absorbed a converted full-codebase leaf audit (`dispatch/write_any.md` ← logging/error-registry/UFS, `dispatch/write_ts_adhere_bun.md` ← design-token, `dispatch/write_zig.md` ← lifecycle/deinit, `dispatch/write_spec.md` ← spec-template) carry a "Scope" section documenting full-codebase semantics and the staged-content forcing function? | YES |
267
+
268
+ ### Scenario 23 β€” Agent comprehension robustness
269
+
270
+ This scenario exists because the most likely failure of the operating model is
271
+ not a missing rule β€” it's the *agent misreading a rule that is present*.
272
+ AGENTS.md is ~32 KB of table-dense, exception-laden prose (SOUL.md inlined); the conditions
273
+ below are where an LLM reading it tends to drift, conflate, or confabulate.
274
+ The questions force *proof of reading* over *recall*.
275
+
276
+ | # | Question | Expected |
277
+ |---|---|---|
278
+ | 23.1 | When answering a rule-specific question, must the agent quote the dispatch **faΓ§ade** (`dispatch/<entry>.md`), not the one-line dispatch-index summary β€” because the index is explicitly "a floor, not a ceiling" and paraphrasing the faΓ§ade is a hallucination risk? | YES |
279
+ | 23.2 | When a recalled memory, `CLAUDE.md` snippet, or prior-session note conflicts with the current `AGENTS.md`/gate body, must the agent defer to the file-on-disk and surface the conflict (recall is stale-by-default)? | YES |
280
+ | 23.3 | Must override strings be reproduced **verbatim** (`<GATE>: SKIPPED per user override (reason: ...)`) and never paraphrased, since the harness matches the literal string? | YES |
281
+ | 23.4 | When two rules fire on the same edit (e.g. PUB + LIFECYCLE on `pub fn init`, or a spec that contradicts a rule), must the agent apply **both**/escalate rather than silently picking one? | YES |
282
+ | 23.5 | For an auto-mode / override question, must the agent trace the full conditional chain (auto-mode AND (active-spec OR start-instruction); action-triggered guards still block) rather than collapsing it to "auto mode = yes"? | YES |
283
+ | 23.6 | Is the negative-test harness (`evals/test-agents-md.sh`) required to pass β€” proving each deterministic check still *bites* β€” whenever `audits/agents-md.sh` itself changes? | YES |
284
+ | 23.7 | Does the live, cross-agent comprehension runner (`evals/llms/run.sh`, `make llmevals`) feed the frozen golden-set to every installed agent and grade each `VERDICT:` by exact match? | YES |
285
+ | 23.8 | When the live runner is unavailable or the golden-set changes, is `make llmevals CHECK=1` the minimum dry validation? | YES |
286
+ | 23.9 | Is live-eval token spend controlled by keeping it off the push path entirely (rationale recorded in `.githooks/pre-push`), with `make llmevals SMOKE=1` and the full `make llmevals` matrix available as explicit manual runs? | YES |
287
+
288
+ ### Scenario 24 β€” Memory routing (auto-memory retired)
289
+
290
+ The file-based auto-memory system is disabled (`autoMemoryEnabled: false`); durable
291
+ knowledge routes to dispatch / repo docs / HANDOFF instead of a per-session memory
292
+ store. These questions force the agent to *route a fact* rather than reach for a
293
+ memory file β€” the exact drift the `## Memory Discipline` section exists to prevent.
294
+
295
+ | # | Question | Expected |
296
+ |---|---|---|
297
+ | 24.1 | Is writing to `**/memory/*.md` or any `MEMORY.md` forbidden, because the harness neither records nor recalls them under `autoMemoryEnabled: false`? | YES |
298
+ | 24.2 | Does a rule that fires on a file-type / lifecycle trigger belong in `dispatch/<entry>.md` behind its gate, not in a memory note? | YES |
299
+ | 24.3 | Does in-flight state (branch / PR / next steps) belong in a `HANDOFF_*.md` + PR Session Notes + the spec, surfaced by the `pickup` / `handoff` skills? | YES |
300
+ | 24.4 | Is a durable architecture fact homed in the product repo's `docs/architecture/*.md`, not memory? | YES |
301
+ | 24.5 | If a fact has no firing gate and no doc home, is the correct move to add the rule (Rule extension protocol) or drop it β€” never to create a memory file? | YES |
302
+
303
+ ### Scenario 25 β€” Allocator & concurrency discipline (ghostty-derived rules A1–A6 / C1–C5)
304
+
305
+ The M126 adversarial review mined ghostty's Allocator and concurrency practice into eleven
306
+ citable rules in `dispatch/write_zig.md`. These questions force *reading the faΓ§ade rule
307
+ bodies* (per 23.1 β€” quote the faΓ§ade, not the index), because their failure mode is an
308
+ editing agent that omits the discipline the way the liveness sweeper diverged from its
309
+ siblings.
310
+
311
+ | # | Question | Expected |
312
+ |---|---|---|
313
+ | 25.1 (A1) | Does `dispatch/write_zig.md` rule A1 require the backing allocator to be chosen once in `main` and threaded as a parameter, with global state never holding the allocator for a Zig path? | YES |
314
+ | 25.2 (A2) | Does rule A2 require an `errdefer` immediately after each fallible acquisition in a multi-step init (never batched at the bottom), with `errdefer comptime unreachable` after the last fallible op? | YES |
315
+ | 25.3 (A3) | Does rule A3 require leaf structures to take `alloc` per call and store nothing, reserving a stored `alloc` field for lifecycle roots only? | YES |
316
+ | 25.4 (A4) | Does rule A4 make an arena the ownership unit (`_arena` per config/request object, scratch arena per transient op, arena-in-message across a thread boundary) and forbid using an arena to mask a missing free in a reusable helper? | YES |
317
+ | 25.5 (A5) | Does rule A5 require ownership stated in the fixed phrases "caller must free" / "takes ownership" on every allocating public fn plus `self.* = undefined` poisoning in every deinit β€” with the phrase/poison checks blocking inside the discipline roster and advisory outside? | YES |
318
+ | 25.6 (A6) | Does rule A6 require every multi-step init in the roster to carry comptime-erased tripwire fail points and a loop-all-failpoints test under `std.testing.allocator` asserting both that the errdefer chain freed everything and that state rolled back? | YES |
319
+ | 25.7 (C1) | Does rule C1 require cross-thread channels to be Single-Producer Single-Consumer (SPSC), with the payload carrying its own allocator and the receiver freeing in a `defer` at the top of the handler? | YES |
320
+ | 25.8 (C2) | Does rule C2 define shutdown as stop-signal β†’ join β†’ deinit, explicitly forbidding freeing shared state on a drain timeout while a straggler thread can still touch it? | YES |
321
+ | 25.9 (C3) | Does rule C3 forbid a blocking push/socket-write while holding a lock the consumer needs (try-instant, else notify + unlock + block + relock), with lock state an explicit parameter? | YES |
322
+ | 25.10 (C4) | Does rule C4 require exactly one documented mutex per shared aggregate whose doc comment names precisely what it protects, with `lock(); defer unlock();` adjacent? | YES |
323
+ | 25.11 (C5) | Does rule C5 make thread-confined state the default, marked by a "only touched by thread X" comment and a `*Locked` suffix on lock-required entry points? | YES |
324
+ | 25.12 (GRD) | Does every A1–A6 / C1–C5 rule in `dispatch/write_zig.md` carry an exemplar cite (ghostty or in-repo) per RULE GRD, so each rule is traceable to the source it was mined from? | YES |
325
+
326
+ ### Scenario 26 β€” Rules propagation
327
+
328
+ | # | Question | Expected |
329
+ |---|---|---|
330
+ | 26.1 | Is `registry.json` the canonical profile and pack registry, with `core/operating-model.md` as the global operating-model source? | YES |
331
+ | 26.2 | Is every repository's rule set carried by its own commit β€” `AGENTS.orly.md` beside the repository's own `AGENTS.md` β€” with **no** symlink from any agent home into this checkout, so a teammate's clone is governed without installing anything? | YES |
332
+ | 26.3 | Do consumer repositories carry their orly-managed files as tracked, committed snapshots β€” rule pages, gate scripts, skills, hooks, and `.oracle/orly.json` β€” rather than resolving them from `ORLY_ROOT` or a symlink into dotfiles? | YES |
333
+ | 26.4 | Are `orly sync`, `orly render`, and `orly validate` gone β€” `orly update` covering this checkout because pack sources living inside the target are skipped, `orly init --dry-run` covering the preview, and `orly verify` validating the registry on its way through β€” with every verb run from inside the repository it acts on? | YES |
334
+ | 26.5 | Does the `agentsfleet` profile map CONFORM to `make harness-verify` while VERIFY remains behavior proof? | YES |
335
+ | 26.6 | Does `README.md` document initialization, explicit synchronization, status, and doctor commands for new repositories? | YES |
336
+ | 26.7 | Does `orly gate pr` discover a spec closed to `done/` on the branch (its `Branch:` header names the branch) and run the spec criteria β€” including `spec.moved`, `spec.baseline`, `spec.ordering`, and `spec.deferrals` β€” instead of skip-passing as spec-less? | YES |
337
+
338
+ ### Scenario 27 β€” Rule-path residence & reachability
339
+
340
+ Added after the M143 worktree incident: an agent resolved
341
+ `docs/REST_API_DESIGN_GUIDELINES.md` against the product repository, found
342
+ nothing (consumer repos carry no rule copies), and designed an HTTP surface
343
+ from memory instead of the guide. Residence (where the doc lives) and
344
+ reachability (whether the read is pre-authorized) are separate invariants;
345
+ both must hold in every session, in every worktree, after every restart.
346
+
347
+ | # | Question | Expected |
348
+ |---|---|---|
349
+ | 27.1 | Does AGENTS.md state that every `dispatch/…`, `docs/…`, and `audits/…` rule path resolves inside **this** repository, materialised by `orly init`/`update` from the packs its own sources selected β€” so a path the repository lacks means its sources never selected that pack, not a broken reference? | YES |
350
+ | 27.2 | Does every rule document an agent is told to read exist inside the repository it is working in β€” so no read depends on a permission prompt, a second checkout, or a path outside the work tree? | YES |
351
+ | 27.3 | Must rule docs be cited relative to the installing repository β€” never through the `~/Projects/dotfiles/` anchor β€” in dispatch faΓ§ades, `docs/TEMPLATE.md`, `docs/EXECUTE_DOC_READS.md`, and spec Applicable-Rules lists, with `audits/rule-paths.sh` failing `make audit` on an **anchored** reference in any surface `orly init` materialises (engine-only files exempt)? | YES |
352
+
353
+ ### Scenario 28 β€” Rule-enforcement ledger & recorded doc reads
354
+
355
+ Added by M02_001. Two failures motivated it: nobody could answer "is
356
+ LOGGING_STANDARD adhered to, and which clauses?" without reading audit source
357
+ by hand, and the `πŸ“– DOC READ` proof-line was a claim an agent made about
358
+ itself, compared against nothing. The ledger answers the first in a committed
359
+ file; the read record answers the second mechanically, in every runtime rather
360
+ than only the one with a Read hook.
361
+
362
+ | # | Question | Expected |
363
+ |---|---|---|
364
+ | 28.1 | Is `docs/RULE_ENFORCEMENT.md` generated by `audits/rule-ledger.sh --write` and currency-checked by `make audit` (`--check` regenerates and byte-compares), so an edited rule doc reds the audit until the scoreboard is regenerated β€” and is the render a pure function of the tree, carrying no timestamp or commit hash? | YES |
365
+ | 28.2 | Do the ledger's clause counts INFORM only β€” never failing a build β€” with the reds reserved for structural conditions (a cited-but-unregistered doc, a registered path missing from disk, a faΓ§ade `.sh` declaring no `dispatch_init` scope, a stale scoreboard)? | YES |
366
+ | 28.3 | Does the DOC READ GATE require recording each triggered read with `bash audits/doc-read.sh log <path>` β€” runnable in every runtime, automatic in Claude Code via the `PostToolUse` Read hook β€” with `.githooks/pre-commit` comparing the record against the staged diff? | YES |
367
+ | 28.4 | When no read record exists (a runtime without hook support, before the command is run), does `audits/doc-read.sh check` warn 🟠 and exit 0 rather than red β€” because a check that fires where it cannot work teaches people to ignore it? | YES |
368
+
369
+ ## Comprehension layer
370
+
371
+ The deterministic audit proves the rules are *present*; it cannot prove an
372
+ agent *reading* them complies β€” the hallucination / won't-follow class. The
373
+ comprehension layer closes that gap:
374
+
375
+ - **Golden-set** β€” `evals/llms/fixtures.jsonl`: frozen
376
+ question β†’ expected `YES`/`NO` verdict + the justifying rule, each targeting
377
+ a known drift mode (index-vs-body paraphrase, override-string drift,
378
+ conditional collapse, co-firing rules, negation blindness, stale recall,
379
+ investigate-vs-authorize, no-override bans). YES/NO is balanced so a
380
+ constant-answer strategy fails the threshold.
381
+ - **Runner** β€” `evals/llms/run.sh` embeds AGENTS.md +
382
+ the dispatch faΓ§ades (`dispatch/*.md`) in every prompt (no
383
+ tool use, no file-read variance), asks
384
+ each installed agent, and grades the single `VERDICT:` line by exact match.
385
+ Resumable β€” each agent's verdict is journalled, so a re-run after an
386
+ interruption replays finished agents instead of re-spending tokens.
387
+ - **Cross-agent** β€” claude, codex, amp, opencode all run the same set;
388
+ divergence between models flags an *ambiguous rule* (a doc bug) as much as a
389
+ non-compliant model. In the FULL graded run an absent or credit-blocked
390
+ agent FAILS the gate β€” "every agent adheres" cannot be proven by an agent
391
+ that never answered; smoke logs + excludes it, never silently.
392
+ - **Evidence** β€” `orly verify --write-evidence` binds the result to the
393
+ current source commit and registry digest; pre-push records the live result
394
+ as `not-required` unless a manual `make llmevals` run supplied one.
395
+
396
+ ---
397
+
398
+ ## Step 3 β€” Generate evidence
399
+
400
+ After all questions answer YES and the report below is complete, generate the
401
+ machine-readable evidence file:
402
+
403
+ ```bash
404
+ orly verify --write-evidence --llm-result pass
405
+ ```
406
+
407
+ The evidence is local and ignored by Git. The pre-push hook regenerates it
408
+ against the exact commit being pushed.
409
+
410
+ ## Step 4 β€” Tabulated audit report
411
+
412
+ After all questions answer YES, the agent emits a final report in this exact shape:
413
+
414
+ ```
415
+ AGENTS.md INVARIANCE REPORT β€” <commit sha> β€” <UTC timestamp>
416
+
417
+ | Layer | Result |
418
+ |------------------|----------------------|
419
+ | Script (audit) | PASS / FAIL |
420
+ | Prompt (Q&A) | <N>/<total> YES |
421
+ | Size | <bytes> / <limit> |
422
+
423
+ Dispatch entries: <count> / 10 (list any missing)
424
+ Rules referenced: <count> / 13 (list any missing)
425
+ Lifecycle stages: <count> / 9 (CHORE(open), PLAN, EXECUTE, CONFORM, VERIFY, REVIEW, DOCUMENT, COMMIT, CHORE(close))
426
+ Always-forbidden: <count> / 6 (list any missing)
427
+ Skill chain order: <ordered | broken>
428
+ Cross-refs: <ok | broken: list>
429
+
430
+ Scenario verdicts:
431
+ | # | Scenario | Result |
432
+ |----|-----------------------------------------|-----------------|
433
+ | 1 | New spec handover | <N/M YES> |
434
+ | 2 | Brainstorming β†’ new spec | <N/M YES> |
435
+ | 3 | Executing, human steers | <N/M YES> |
436
+ | 4 | Editing UI/Zig/TS/JS/shell/CI files | <N/M YES> |
437
+ | 5 | Handover pickup | <N/M YES> |
438
+ | 6 | Conformance and verification | <N/M YES> |
439
+ | 7 | Review discipline before merge | <N/M YES> |
440
+ | 8 | /orly-write-unit-test with human steering | <N/M YES> |
441
+ | 9 | Hot-fix / emergency | <N/M YES> |
442
+ | 10 | Dotfiles / docs-repo | <N/M YES> |
443
+ | 11 | Schema / migration | <N/M YES> |
444
+ | 12 | Auto-mode boundary | <N/M YES> |
445
+ | 13 | Ruleset changes | <N/M YES> |
446
+ | 14 | Communication discipline | <N/M YES> |
447
+ | 15 | Architecture-edit ordering | <N/M YES> |
448
+ | 16 | Credentials and vault | <N/M YES> |
449
+ | 17 | Database discipline | <N/M YES> |
450
+ | 18 | Commit and worktree isolation | <N/M YES> |
451
+ | 19 | CONFORM combined audit | <N/M YES> |
452
+ | 20 | Rule extension protocol | <N/M YES> |
453
+ | 21 | Gate-flag triage | <N/M YES> |
454
+ | 22 | Pre-commit audit scope | <N/M YES> |
455
+ | 23 | Agent comprehension | <N/M YES> |
456
+ | 24 | Memory routing | <N/M YES> |
457
+ | 25 | Allocator and concurrency discipline | <N/M YES> |
458
+ | 26 | Rules propagation | <N/M YES> |
459
+ | 27 | Rule-path residence and reachability | <N/M YES> |
460
+
461
+ OVERALL: PASS | FAIL β€” <reason if fail>
462
+ ```
463
+
464
+ ---
465
+
466
+ ## Wiring it into `pre-commit`
467
+
468
+ The dotfiles `.githooks/pre-commit` runs `make audit` when generated rules,
469
+ canonical sources, profiles, dispatch pages, audits, or governance hooks are
470
+ staged. It is fast and deterministic.
471
+
472
+ The Step-2 questionnaire is read during the edit. A live smoke run is hooked
473
+ only for semantic governance changes because:
474
+
475
+ - It needs an LLM, which means latency, cost, and credentials in the hook environment.
476
+ - It only adds value when operating-model semantics change.
477
+ - Step 1 already catches the regressions a script can catch; Step 2 catches the regressions that need reading comprehension.
478
+
479
+ Required workflow when you edit Oracle rules:
480
+
481
+ 1. Run Step 1 (`bash audits/agents-md.sh`).
482
+ 2. Answer every question in this file against the generated `AGENTS.md` and dispatch pages.
483
+ 3. Emit the report. All-YES permits commit; any NO returns to the edit.
484
+ 4. Let pre-push run one fixture per installed agent and generate commit-bound evidence.
485
+
486
+ ---
487
+
488
+ ## Adding a new scenario or question
489
+
490
+ When the operating model grows (new gate, new rule, new lifecycle wrinkle):
491
+
492
+ 1. Add to `audits/agents-md.sh` if the invariant is mechanically checkable.
493
+ 2. Add to this file as a new question if the invariant needs reading comprehension.
494
+ 3. Update `REQUIRED_DISPATCH` / `CONFORM_KEYS` / `FORBIDDEN_KEYS` arrays in `audits/data.sh` as appropriate.
495
+ 4. Run both layers and check in the new baseline.
496
+
497
+ The cost of this suite is bounded by these arrays. If they grow without bound, the suite is leaking complexity β€” split AGENTS.md before adding more invariants.