aepkit 0.6.0__py3-none-any.whl

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.
aepkit/skill/SKILL.md ADDED
@@ -0,0 +1,448 @@
1
+ ---
2
+ name: auditor-executor-protocol
3
+ description: "Runs multi-phase work as a two-role protocol: an Auditor who writes numbered, verifiable tasks and signs off phases, and an Executor who implements one task at a time and reports evidence. Use whenever a piece of work is large enough to span several phases or sessions, whenever handing a plan to another agent (subagent, spawned session, or a different tool) to implement, or when asked to audit/verify work another agent reports as complete. Also use when a plan needs to become executable instructions rather than a discussion document. Covers: the document set, rules of engagement, task and gate format, how to audit by re-running rather than reading, negative controls, verdict vocabulary, the annex pattern for correcting an order that is already in flight, and an optional operating mode chosen per run — Guided (the owner relays each handoff) or Autonomous (the Auditor launches Executors as subagents with an explicit per-task model tier, answers their BLOCKED questions itself, and interrupts the owner only for a numbered critical-risk list). Triggers: 'audit', 'auditor', 'executor', 'phased plan', 'exit criteria', 'gate', 'compliance log', 'remediation', 'handoff', 'have another agent implement this', 'verify what was reported', 'sign off', 'autonomous mode', 'guided mode'. NOT for reviewing a diff or a pull request for bugs — that's a code review; this protocol audits an execution report against pre-declared gates, and governs how multi-phase work is handed off and signed off."
4
+ ---
5
+
6
+ # Auditor / Executor Protocol
7
+
8
+ Two roles, one paper trail. The Auditor decides what "done" means and proves it
9
+ independently. The Executor implements and reports evidence. Neither does the other's job.
10
+
11
+ This exists because a plan handed to an implementing agent is not instructions until
12
+ someone makes it unambiguous, and a report that says "all green" is not verification
13
+ until someone re-runs it. Both failures are common and both are expensive once they
14
+ compound across dozens of tasks.
15
+
16
+ A companion CLI, `aepkit`, operationalizes the mechanical parts of this: scaffolding
17
+ the document set, checking the task list and the log agree with each other, running a
18
+ negative control end to end, and printing where a run stands. Use it if it's installed;
19
+ follow this document either way.
20
+
21
+ ## When to use this
22
+
23
+ - Work spanning more than one phase or more than one session.
24
+ - Handing a plan to another agent to implement — a subagent, a spawned session, a
25
+ different tool, another person.
26
+ - Auditing work someone else reports as complete.
27
+ - Turning a roadmap into something executable.
28
+
29
+ Not for single-session tasks you are doing yourself. The overhead only pays off when the
30
+ implementer is not the person who wrote the plan.
31
+
32
+ ## The two roles
33
+
34
+ | | Auditor | Executor |
35
+ |---|---|---|
36
+ | Owns | The instructions, the gates, the verdicts | The implementation, the evidence |
37
+ | Never | Writes feature code | Redesigns, or decides scope |
38
+ | Output | Task expansions, verdicts, remediation orders | Working code, pasted command output |
39
+
40
+ Whoever writes the plan is the Auditor. Say which role you are holding at the start of a
41
+ session so it does not drift.
42
+
43
+ ## Reference files (load on demand)
44
+
45
+ The core rules are in this file. Load a reference file only when you reach the step it
46
+ covers; each one is self-contained and refers back to sections of this file by name.
47
+
48
+ | File | Load when |
49
+ |---|---|
50
+ | [`references/tasks-and-gates.md`](references/tasks-and-gates.md) | Writing a task or a gate (Auditor) |
51
+ | [`references/handoffs.md`](references/handoffs.md) | Handing a task to an Executor, or writing a remediation after a verdict that is not a clean `APPROVED` (Auditor) |
52
+ | [`references/autonomous-mode.md`](references/autonomous-mode.md) | The run is in Autonomous mode, or you are writing the Auditor brief that starts one |
53
+ | [`references/failure-modes-and-example.md`](references/failure-modes-and-example.md) | Auditing a delivery, or you want to see a filled-in run end to end |
54
+
55
+ ## Operating mode: Guided or Autonomous (chosen at the start of the run)
56
+
57
+ The mode is optional and the owner's choice. Two ways to run the protocol:
58
+
59
+ | | Guided mode | Autonomous mode |
60
+ |---|---|---|
61
+ | Who launches Executors | The owner pastes each handoff into a fresh session | The Auditor, as subagents |
62
+ | Who answers `BLOCKED` | The owner, or the Auditor through the owner | The Auditor, with a decision entry in the log |
63
+ | Owner's role | Relays every message, sees every verdict | Receives one short report per closed phase; interrupted only for the critical-risk list |
64
+ | Fits when | The owner wants to watch and approve each step, the work is new territory, or the Auditor has no subagent tool | The plan is settled and the owner wants it run end to end |
65
+
66
+ How the mode is chosen:
67
+
68
+ - **If the owner already named it** ("autonomous", "guided", or an unambiguous
69
+ equivalent like "don't interrupt me for every step"), use it. Do not ask again.
70
+ - **If not, ask once, before task 1**, as a single two-option question with a one-line
71
+ recommendation (Guided for a first run in unfamiliar code or anything touching money
72
+ or production data with no rehearsal; Autonomous for a settled plan with strong gates).
73
+ This is one of the few questions that is genuinely the owner's: it decides how often
74
+ they get interrupted for the rest of the run.
75
+ - **If the environment has no subagent tool**, Autonomous is not available; say so and
76
+ run Guided.
77
+ - Record the choice as a governance decision in the plan of record, next to the rules of
78
+ engagement. Switching modes mid-run is allowed only when the owner asks, and is
79
+ recorded by annex. The Auditor never switches itself from Guided to Autonomous; it may
80
+ drop from Autonomous to Guided only through an item on the critical-risk list.
81
+
82
+ Everything else in this document applies to both modes. Autonomous mode adds the rules in
83
+ `references/autonomous-mode.md`; it removes none. Re-running, negative controls and separate
84
+ process/code findings matter more when nobody is watching, not less.
85
+
86
+ ## The document set
87
+
88
+ Four documents. Keep them separate; merging them is how the instructions turn back into
89
+ a discussion.
90
+
91
+ 1. **Plan of record** — the *what* and the *why*. Opportunity framing, evaluated options,
92
+ phases, decisions, trade-offs, and explicit non-goals. Nobody implements from this.
93
+ Carries the **opportunity and shaping gate** and the **deferred items ledger** (below).
94
+ 2. **Execution guide** — the *how*. Numbered tasks (`P<phase>-T<n>`, or any scheme with a
95
+ stable, greppable ID), each with files, steps, a verification command, and its
96
+ expected output. Gates (`P<phase>-G<n>`) close each phase. Carries the
97
+ **reserved-to-Auditor steps** list (below).
98
+ 3. **Compliance log** — where the Executor reports. Pre-generate one empty row per task
99
+ and gate ID so nothing can be quietly skipped.
100
+ 4. **Remediation order (annex)** — written by the Auditor after an audit that isn't a
101
+ clean `APPROVED`. Self-contained: the Executor must not need the audit conversation
102
+ or the full log to act on it. Template and reasoning: "Remediation handoff" in `references/handoffs.md`.
103
+
104
+ **Annexes** supersede a document that is already open in the Executor's session. Never
105
+ edit an order in flight — issue a new annex, and say at the top which item it replaces.
106
+
107
+ `aepkit init <dir>` scaffolds the first three as empty templates plus an empty
108
+ `annexes/` directory for the fourth.
109
+
110
+ ### Opportunity framing and set-based shaping (in the plan of record)
111
+
112
+ A tight execution protocol without an upstream opportunity check makes it easy to specify
113
+ and build the wrong or over-engineered thing to perfection. Before expanding tasks in the
114
+ execution guide, the Auditor fills in four blocks in `plan-of-record.md`:
115
+
116
+ 1. **Opportunity framing (`Target outcome`, `Problem / friction`, `Cost of doing nothing`):**
117
+ state the measurable state change, the verified gap in the current system (without
118
+ prescribing the feature yet), and what happens if the work is not done.
119
+ 2. **Set-based shaping (`Option A`, `Option B`, `Option C`, `Selected option & rationale`):**
120
+ for open-design or new-capability work, compare at least three distinct approaches (a
121
+ minimal/config/existing-tooling option, a balanced implementation, and a full
122
+ architectural option) and record why the chosen option won and why the other two were
123
+ rejected.
124
+ 3. **Riskiest assumption & first-phase validation:** name the primary value, usability,
125
+ feasibility, or viability assumption that could invalidate the plan. **Order the first
126
+ phase (`P0` or `P1`) of `execution-guide.md` to test that riskiest assumption first**,
127
+ rather than starting with secondary scaffolding or cosmetic work. If the first gate
128
+ falsifies the assumption, the run stops or pivots before `P2..Pn` are built (rule 7).
129
+ 4. **Explicit non-goals:** name what is deliberately out of scope so an Executor or future
130
+ Auditor does not rebuild what was cut on purpose.
131
+
132
+ **Fast-track bypass for deterministic work:** when the run is a bugfix, security patch,
133
+ known schema migration, or strict compliance requirement where the problem and fix are
134
+ already fixed, mark the three options, `Selected option & rationale`, and `Riskiest
135
+ assumption & first-phase validation` as `N/A (Deterministic Fix/Compliance)` and go
136
+ straight to `D1`. Do not invent artificial options for deterministic work; a bare `n/a`
137
+ without naming the deterministic bypass does not count.
138
+
139
+ ### The deferred items ledger (in the plan of record)
140
+
141
+ A single running table, not prose scattered across the log:
142
+
143
+ ```
144
+ | ID | What | Deferred to | Closed by |
145
+ |---|---|---|---|
146
+ | D14 | Move the export job into the reporting module | P5 | — |
147
+ ```
148
+
149
+ Every decision (or annex) that pushes work to a future phase gets a row here the moment
150
+ it's made, in the same edit. **Before drafting any phase's tasks, read this table for
151
+ rows whose "Deferred to" matches the phase being drafted** — not a grep of the whole log
152
+ from memory. A row stays open until a task ID appears in "Closed by." An open row for a
153
+ phase that's about to be marked done is a stop, not a note for later: a promise made in
154
+ an early phase and never carried into the later phase's own task expansion is easy to
155
+ lose track of across a long run, and expensive to recover once several phases have
156
+ already closed on top of it. The ledger exists so that promise is a row someone has to
157
+ close, not a sentence someone has to remember.
158
+
159
+ ### The reserved-to-Auditor steps list (in the execution guide)
160
+
161
+ A running list, next to the rules of engagement, not a per-task Observations note:
162
+
163
+ ```
164
+ Steps reserved to the Auditor (never the Executor's model tier, whatever it is):
165
+ - The credential-adjacent check after a ship task (blocked for every model tier so far).
166
+ - Any commit touching a shared or generated resource (harness blocks it for every tier).
167
+ ```
168
+
169
+ The first time a harness or permission block turns out predictable — same step, blocked
170
+ for every Executor tried — add it here once. Every subsequent handoff whose task includes
171
+ that step cites this list instead of the step being rediscovered as a fresh `BLOCKED`
172
+ each time. A note written into one task's Observations after the first occurrence is read
173
+ once and never again; this list is read on every handoff.
174
+
175
+ ## Rules of engagement (the Executor follows these)
176
+
177
+ Put these at the head of the execution guide, ordered by how often they get broken.
178
+ Items 1-7 are fixed — copy them as they are. **Item 8 is not written from memory or
179
+ inherited from a different run; it is the first concrete step of starting a new run,
180
+ done before task 1 is drafted:**
181
+
182
+ - Check whether this codebase or team already states these somewhere authoritative — a
183
+ CONTRIBUTING file, CI config, an existing style guide, a prior run's execution guide.
184
+ If so, cite it; do not restate it.
185
+ - If nothing authoritative exists, **look at the project before asking** — grep for
186
+ what's already there rather than handing the user a blank checklist:
187
+
188
+ | Rule | Look for |
189
+ |---|---|
190
+ | Version bump per change | A version field (`package.json`, `pyproject.toml`, a `VERSION` file) and any script that already bumps it |
191
+ | No AI co-author trailers | `git log --grep="Co-Authored-By"` — existing trailers (or their consistent absence) |
192
+ | Fetch-before-push | Multiple contributors or branches in `git log`/`git branch -a` — a solo, single-branch repo needs this less |
193
+ | Quality gate green before push | CI config (`.github/workflows/`, `.gitlab-ci.yml`) or a `test`/`lint`/`build` script already wired together |
194
+ | i18n/locale parity | A locales/translations directory with more than one language file |
195
+ | Dependency lockstep | A lockfile and how strict its existing commit history is about touching it |
196
+
197
+ **Then ask with the finding attached, not a blank menu** — turn each hit into a
198
+ yes/no the user can answer in one word instead of a checklist they have to reason
199
+ through from nothing: *"Found `package.json` version `0.2.1` and no bump script — want
200
+ every task to bump it, and if so, how (semver rule, or you decide per task)?"* /
201
+ *"No CI config found — is there a command that should gate every push, or does this
202
+ repo not have one yet?"* This matters most for a user who isn't deep in the codebase
203
+ themselves (vibe-coding a project, not maintaining one they know by heart) — inspecting
204
+ first is the difference between a real choice and homework.
205
+ A rule with nothing detected for it is still offered, just without a finding attached.
206
+ - **Custom rules stay first-class** — a rule is usable as item 8 once it names what it
207
+ enforces, how it's checked, and what triggers it, whether or not it came from the
208
+ table above. Example: *"No schema migration touches a table over 10k rows without a
209
+ stated rollback plan in the task text, and the migration is run once with `--dry-run`
210
+ before it lands for real."* Names the trigger (a migration over the row threshold),
211
+ the requirement (a rollback plan, in the task text), and the check (`--dry-run` first).
212
+ - Settle it once, at the start of the run. Item 8 does not change task to task.
213
+
214
+ 1. **One task at a time, in order.** No batching. No starting a phase whose predecessor
215
+ is not `APPROVED`.
216
+ 2. **Never invent a value the codebase, infra, or environment declares.** Ports, origins,
217
+ domains, permission keys, versions, enum members — read them. Needing to ask for one
218
+ means a file was skipped.
219
+ 3. **Never guess a cause. Observe it.** Read the log, run the query, print the value.
220
+ When investigating a claim about the code, prefer whatever fast navigation tool this
221
+ project already has over blind grep — a code graph, ctags, an LSP, anything that
222
+ answers "who else reads this" faster than a full-text search. Never assume one is
223
+ installed or working; grep is the guaranteed fallback, not a default to reach past a
224
+ faster tool for. This check is quiet, not a topic — look, then use whatever's there.
225
+ Finding nothing is not itself worth telling the user; only bring it up if a tool was
226
+ found and is why the next command looks unusual.
227
+ 4. **Verification is running the thing, not reading the code.** "I reviewed it and it
228
+ looks correct" is reported as `FAILED`.
229
+ 5. **Scope is the task text.** Note unrelated problems in *Observations*; do not fix
230
+ them.
231
+ 6. **Stop and ask** when the instruction contradicts the code, when a task needs a
232
+ decision the document does not make, or when a previously passing check starts
233
+ failing for reasons unrelated to the change. An empty "Blocked" section across a
234
+ whole run reads as ambiguities resolved silently, not as ambiguities that never
235
+ existed. If you resolve one without stopping, log the decision.
236
+ 7. **When the system cannot do what a task asks, that is the deliverable.** Report it
237
+ and stop. A task that ends in a well-argued finding is a success.
238
+ 8. Project-specific rules go here: version bumping, commit attribution, dependency
239
+ sync before pushing, i18n parity, design-system checks, whatever this codebase
240
+ already enforces elsewhere. Cite the source file instead of restating it — one
241
+ source of truth. **Settled above, before task 1 — not filled in retroactively.**
242
+
243
+ ## Before expanding a phase into tasks
244
+
245
+ Read the deferred items ledger (above) for rows whose "Deferred to" matches the phase
246
+ about to be drafted. Every open row becomes a task, or gets re-deferred by editing the
247
+ row — never dropped silently. This replaces re-deriving the phase's obligations from
248
+ memory or a fresh grep of the whole log; the ledger is what makes that unnecessary.
249
+
250
+ ## Reporting back (Executor)
251
+
252
+ A compliance log entry is not addressed to anyone — it is a record. When a task, or the
253
+ last task of a phase, is done, close with a message back to the Auditor, same reasoning
254
+ as the handoff that started the work: whoever picks up the audit may be a fresh session
255
+ too, with nothing but the log to go on unless this exists.
256
+
257
+ ```
258
+ ROLE: Executor, reporting on <TASK-ID or "Phase <n>, tasks <first>-<last>">.
259
+
260
+ STATUS: <DONE | BLOCKED | FAILED> — logged in <COMPLIANCE_LOG>, section(s) already
261
+ filled in with literal command output.
262
+
263
+ Verify results: <the one-line summary an Auditor would want before deciding whether to
264
+ re-run everything themselves — not a substitute for that re-run>.
265
+
266
+ Deviations from the task text: <any, with the reasoning — or "none">.
267
+
268
+ Stops logged: <any "Blocked" entries raised mid-task per rule 6 — or "none">.
269
+
270
+ Ready for: <"Audit of Phase <n>" | "the next task, <ID>, once this is reviewed">.
271
+ ```
272
+
273
+ Do not narrate confidence ("this should be solid now") in place of the verify results —
274
+ the Auditor is about to re-run everything regardless (rule 4 applies to them too); a
275
+ report's job is to point at the evidence, not to argue for a verdict.
276
+
277
+ ## Auditing (Auditor)
278
+
279
+ **Re-run. Do not read the report and agree with it.**
280
+
281
+ 1. Run every suite yourself, with the project's own commands. A wrong invocation
282
+ produces a false failure and destroys your credibility for the rest of the audit —
283
+ confirm you're running from the right directory, against the right environment,
284
+ before treating an error as a finding.
285
+ 2. Re-execute the negative controls from scratch. Back the file up before mutating it
286
+ and restore from that copy — never with a source-control command that could discard
287
+ other uncommitted work in the same tree.
288
+ 3. Check artifacts exist: migrations, screenshots, specs, generated bundles.
289
+ 4. Read the checks, not just their names. Ask what ordering or fixture would make a
290
+ passing check pass for the wrong reason.
291
+ 5. **Write a probe when a claim is load-bearing.** A temporary check that asserts the
292
+ opposite of what the delivered one asserts tells you in thirty seconds whether the
293
+ behavior is real. Delete it afterward.
294
+ 6. Check timestamps before concluding something is missing. Work may have landed after
295
+ you looked.
296
+ 7. **A delivered negative control only proves the failure mode it was built to catch.**
297
+ Before signing a task off, ask what other claim in the same delivery is load-bearing
298
+ and has no probe of its own — do not accept the one control that exists as coverage
299
+ for the whole feature.
300
+ 8. **Before sending the verdict, check what it's missing, not just what it says.** This
301
+ applies to every verdict, not only a full-phase `APPROVED` or a `CONDITIONAL`/
302
+ `REJECTED` with an obvious remediation — a plain `PASS` on one task, mid-phase, with
303
+ something else already outstanding (an earlier remediation, the next task) needs the
304
+ same discipline: it does not end the message on its own. If anything is left to do —
305
+ a remediation handoff, the next task's handoff, or a re-statement of a handoff already
306
+ sent but not yet acted on — it ships in the same message as the verdict, as the
307
+ literal pasteable block from `references/handoffs.md`, not a sentence describing that
308
+ it's still pending. A verdict is not the deliverable; see "Remediation handoff" in
309
+ `references/handoffs.md`. In Autonomous mode, "ships in the same message" means the
310
+ Auditor launches that subagent in the same turn.
311
+
312
+ ### Verdicts
313
+
314
+ | Verdict | Meaning |
315
+ |---|---|
316
+ | `APPROVED` | Every gate independently verified |
317
+ | `CONDITIONAL` | Accepted except for named items; state which and what closes them |
318
+ | `REJECTED` | The deliverable does not do what it claims, even if it is green |
319
+
320
+ A passing check that documents wrong behavior as correct is a **rejection**, not an
321
+ observation. It will defend the defect against whoever tries to fix it later.
322
+
323
+ Separate **process findings** from **code findings**. Work can be accepted on its
324
+ merits while the control that should have caught a defect is recorded as failed. Good
325
+ outcomes do not validate a broken process backward. A condition holds as written or it
326
+ stays open — do not fold an unmet condition into "recorded, not blocking" just to avoid
327
+ holding up a phase; that turns a defect into paperwork. Process findings include: the
328
+ wrong model tier (or an inherited one), a small-model task that improvised instead of
329
+ escalating, a negative control restored with a command that discarded other uncommitted
330
+ work, and a question sent to the owner that belonged to the Auditor.
331
+
332
+ ### Closing the run
333
+
334
+ A verdict says whether one phase or task passed. It does not say whether the *run* is
335
+ over — those are different claims, and leaving the second one to tone or inference
336
+ means the user ends up asking "so is that everything?" directly, which is the signal
337
+ this section exists to make unnecessary.
338
+
339
+ Before saying a run is over, check the plan of record itself for a phase that exists on
340
+ paper but was never turned into tasks — not just for a next task in the current
341
+ execution guide. A phase can be planned and never scheduled; "nothing left in the guide
342
+ I'm looking at" and "nothing left in the plan" are not the same check.
343
+
344
+ When every phase is `APPROVED` and the plan of record declares no further phase, say so
345
+ as its own line, not folded into other prose:
346
+
347
+ ```
348
+ RUN COMPLETE — <plan of record name>. Every phase APPROVED. No further phase declared.
349
+ Nothing outstanding.
350
+ ```
351
+
352
+ Anything short of that — one phase closing, a conditional approval, work still queued —
353
+ uses the verdict-plus-handoff shapes in `references/handoffs.md` instead. `RUN COMPLETE` is reserved for the
354
+ one message that actually ends the need for another Auditor turn on this plan of record.
355
+
356
+ ## The Auditor is bound by rule 4 too
357
+
358
+ An order can be wrong in the same way a delivery can be wrong, and it is more
359
+ dangerous when it is: the Executor is told a decided item is a stop, not a choice, so a
360
+ wrong decided item arrives armored against the one person positioned to catch it.
361
+
362
+ The failure has one shape: the Auditor asserted a fact about the system — a field
363
+ exists, a function behaves a certain way, a value has a certain sign — from reasoning
364
+ or a single grep hit, without running the command that would actually confirm it.
365
+ **Deliveries get audited by running them; orders too often get written by reasoning
366
+ about them.** That asymmetry is the whole problem.
367
+
368
+ Two rules close it:
369
+
370
+ **1. An order may not assert what it has not run.** Any claim in an order about a
371
+ field, a function's behavior, or a runtime value carries the command that established
372
+ it, pasted, in the order. Rule 4 above — *verification is running the thing, not
373
+ reading the code* — is not only the Executor's rule. It is the protocol's. If the
374
+ Auditor cannot paste the command, the Auditor cannot assert the fact; it goes in the
375
+ order as a question for the Executor to establish, not as a decision.
376
+
377
+ For anything touching money, permissions, or schema, the cheapest form of this is a
378
+ falsifying probe: write the smallest script that would prove the claim wrong and run
379
+ it before the order goes out.
380
+
381
+ **2. A decided item is not reopenable; a factual claim always is.**
382
+
383
+ | | Reopenable by the Executor? |
384
+ |---|---|
385
+ | A decision — scope, trade-off, design | **No.** Believing otherwise is a stop. |
386
+ | A factual claim — this field exists, this function does X, this value is Y | **Always**, with a pasted command that contradicts it. The evidence outranks the order. |
387
+
388
+ An Executor who runs a command that falsifies an order is not exceeding scope; that is
389
+ the second pair of eyes the arrangement exists to buy.
390
+
391
+ ## Maintaining the log
392
+
393
+ A compliance log that only ever gets appended to accumulates duplicate paragraphs —
394
+ the same open condition re-stated verbatim across several entries because it was
395
+ easier to copy the last summary than to write a new one. That is a cost, not a
396
+ neutral habit: it makes the current state of the run more expensive to find for
397
+ whoever reads it next, human or agent. Compact the log periodically — collapse a
398
+ condition that has appeared unchanged across several entries into one current
399
+ statement with a pointer to when it opened. `aepkit lint` flags near-duplicate
400
+ paragraphs so this doesn't have to be caught by eye.
401
+
402
+ **Annex count is a health signal, not just a history.** A phase that accumulates many
403
+ corrections after work started is a phase whose plan was under-verified before work
404
+ started, more often than it is a phase that hit genuine surprises. If one phase is
405
+ generating annexes faster than the others, that is worth naming as a finding about the
406
+ planning step, not only fixing task by task. `aepkit lint` warns past a configurable
407
+ threshold.
408
+
409
+ ## Repo conventions this rides on
410
+
411
+ Cite whatever this codebase already enforces — version bumping, commit attribution,
412
+ fetch-before-push, environment-value discipline, evidence-driven debugging — from its
413
+ own source of truth rather than restating it here, so there's one place it can drift
414
+ out of sync from.
415
+
416
+ ## The CLI
417
+
418
+ If `aepkit` is installed, prefer it over doing these by hand:
419
+
420
+ - `aepkit init <dir>` — scaffold the plan of record, execution guide, and compliance
421
+ log from templates, plus an empty `annexes/` directory.
422
+ - `aepkit lint <dir>` — cross-check task IDs between the execution guide and the
423
+ compliance log in both directions, flag `DONE` reports with no pasted verify output
424
+ (output counts only inside a fenced code block; prose such as "all tests pass" or a lone
425
+ "n/a" is not output), flag work reported in a phase before every earlier phase is
426
+ `APPROVED`, flag near-duplicate paragraphs, warn on annex count per phase, flag gates with no
427
+ stated negative control (it must name the action that removes the protection and the
428
+ failure that follows; a negated, deferred, hypothetical, or waived mention such as "n/a",
429
+ "TBD", or "we could remove it" does not count), and—once work has started (`DONE` or a
430
+ verdict in the log) and `plan-of-record.md` is present—flag unfilled opportunity, shaping,
431
+ riskiest-assumption, or non-goal fields (unless the shaping/assumption fields state
432
+ `N/A (Deterministic Fix/Compliance)`) as well as open rows in the deferred items ledger for
433
+ a phase being closed. Missing documents, an execution guide with no tasks, and tasks without a
434
+ `**Report:**` line are errors, not a clean result. Lint checks that evidence is
435
+ present, not that it is authentic: re-running it is still the Auditor's job.
436
+ - `aepkit negcontrol --file <path> --break-cmd "<cmd>" --test-cmd "<cmd>"` — backs the
437
+ file up, runs the break command, runs the test (expects failure), restores from the
438
+ backup, runs the test again (expects success), and prints a paste-ready transcript.
439
+ With `--restore-cmd`, the file must still end byte-identical to the backup or it is
440
+ restored from it; `--timeout` bounds each command. Pass `--expect "<regex>"` with the
441
+ failure the break should cause (an assertion message, a 403): a test that fails for
442
+ another reason, such as a syntax error or a missing import, then fails the control
443
+ instead of passing it. Without `--expect`, such output is only flagged as a warning.
444
+ - `aepkit status <dir>` — combines the status board verdicts with the latest report
445
+ per ID and prints what's still open. Only `APPROVED` closes an item; a `DONE` with no
446
+ verdict is listed as awaiting audit.
447
+
448
+ See the repo's `README.md` for install instructions.
@@ -0,0 +1,144 @@
1
+ # Autonomous Mode
2
+
3
+ Part of the `auditor-executor-protocol` skill. Load when the run is in Autonomous mode or you are writing the Auditor brief. Section names in
4
+ quotes ("Rules of engagement", "Auditing", ...) refer to `SKILL.md` unless they are in
5
+ this file.
6
+
7
+ ## Autonomous mode (Auditor)
8
+
9
+ The Auditor runs the whole run: launches Executors, audits each delivery by re-running
10
+ it, gives verdicts, answers questions, expands later phases when the previous gate is
11
+ `APPROVED`, and writes annexes and remediations. The owner does not relay messages.
12
+
13
+ ### The autonomy charter
14
+
15
+ Write it into the execution guide (a "Coordination and autonomy" section) and point to
16
+ it from a governance decision in the plan of record. It has four parts:
17
+
18
+ 1. **What the Auditor decides alone.** Anything the documents leave open. `BLOCKED`
19
+ entries are answered with a **decision entry** in the log — question, evidence (pasted
20
+ command), decision, reason — or with an annex, and the task resumes. The Auditor may
21
+ amend a decided item by annex when evidence justifies it.
22
+ 2. **What the Auditor may never change.** The acceptance criteria and the stated scope.
23
+ Splitting work into more phases is allowed; shrinking the goal is not. A plan that
24
+ covers less than the owner asked for is a scope change, and only the owner makes those.
25
+ 3. **The critical-risk list** — the only reasons to interrupt the owner. Write it per
26
+ project, concretely, and number it. The categories that almost always belong:
27
+ - reducing or reinterpreting the acceptance criteria;
28
+ - irreversible loss of production data (a destructive step without a verified,
29
+ restorable backup, or a failed production migration that left data inconsistent);
30
+ - someone losing access to production, or a message sent to anyone but the owner;
31
+ - real money (charging, refunding, cancelling a real customer; billing changes the
32
+ tests cannot prove equivalent);
33
+ - production down or degraded after a deploy, not restored by the pipeline's rollback;
34
+ - a secret exposed or needing rotation (the Auditor never handles secret values);
35
+ - actions the project's own rules reserve for the owner (typical: force-push,
36
+ disabling CI or checks, hand-edited server config outside version control, copy
37
+ shown to every user such as release notes);
38
+ - a harness block the Auditor cannot resolve within its authority.
39
+
40
+ Everything not on the list is decided, recorded and the run continues. "Should I
41
+ continue?" is never on the list.
42
+ 4. **How the owner hears about progress.** One short report per closed phase, no
43
+ questions unless they are on the list:
44
+
45
+ ```
46
+ <PHASE> — <APPROVED | CONDITIONAL>. Shipped: <version/commit, or "nothing">. Decisions
47
+ made: <decision-entry IDs, or "none">. Next: <phase/task already launched>.
48
+ ```
49
+
50
+ Harness permission prompts that need the owner go in **one batched request**, not one
51
+ at a time. When every phase is `APPROVED` and the plan of record declares no further
52
+ phase, say so as its own line — see "Closing the run" in `SKILL.md`.
53
+
54
+ ### Executor model assignment
55
+
56
+ Pick the Executor's model per task, in a table in the execution guide, and name it in
57
+ each handoff. The shape that has worked here:
58
+
59
+ | Tier | Use for |
60
+ |---|---|
61
+ | Small/fast tier | Mechanical, fully specified, low blast radius: run listed commands, bump/gate/commit/push, small isolated files |
62
+ | Mid tier | Anything with judgement or risk: security, migrations, production data, transports, moving code, cross-file wiring, UI, user-facing copy |
63
+ | Top tier, usually the Auditor's own | Not used for Executors unless the owner says otherwise. If unsure, the mid tier |
64
+
65
+ - **Pass the model explicitly on every launch.** A subagent launched without an explicit
66
+ model parameter **inherits the Auditor's model**, which silently breaks the rule.
67
+ Require the same of any subagent the Executor spawns, in the handoff text.
68
+ - **Escalation goes one tier up, from the start.** A small-model task that hits anything
69
+ outside its script (failing gate, unexpected diff, a `BLOCKED` condition) stops and
70
+ logs what it saw; the Auditor relaunches the whole task on the mid tier. Never a retry
71
+ on the top tier. A small-model Executor that "solved" the surprise itself is a process
72
+ finding, even if the fix is right.
73
+ - Every task added when later phases are expanded gets a row in the table before it is
74
+ launched.
75
+ - A model-rule violation is a **process finding** in the verdict, recorded separately
76
+ from the code findings.
77
+ - **A recurring sandbox/permission block goes in the reserved-to-Auditor steps list**
78
+ (see "The document set" in `SKILL.md`) the first time it turns out predictable, not in a
79
+ per-task Observations note nobody reads again.
80
+
81
+ ### The per-task cycle
82
+
83
+ 1. Fetch and check the remote hasn't moved; read the task's log section.
84
+ 2. Launch the Executor subagent with the model from the table and the full handoff
85
+ template as the prompt, not a pointer to the guide.
86
+ 3. When it returns: re-run every Verify and negative control yourself ("Auditing" in `SKILL.md`).
87
+ 4. Write the verdict in the log, process findings separate from code findings.
88
+ 5. Not clean: write the remediation and relaunch. Clean: launch the next task in the same
89
+ turn. Gate `APPROVED`: send the owner the phase report and, if the next phase is not
90
+ yet expanded, expand it (tasks, gate, model per task, log sections) before launching
91
+ its first task.
92
+
93
+ Do not end a turn between a verdict and the next launch unless something on the
94
+ critical-risk list is open. A run that stops to report a `PASS` and wait is Guided
95
+ mode by accident.
96
+
97
+ ### Starting the Auditor (the Auditor brief)
98
+
99
+ An autonomous run is started by giving a fresh Auditor session a brief, the same way an
100
+ Executor gets a handoff. The owner (or whoever planned the run) writes it once. Fill
101
+ every section; the Auditor starts cold too.
102
+
103
+ ```
104
+ ROLE: Auditor of plan "<name>" in <repo>. Model: <model>. You do not write feature code.
105
+ You run the whole thing autonomously: launch Executors as subagents, audit each delivery
106
+ by re-running it, give the verdicts, resolve their questions, expand <pending phases>
107
+ once the previous gate is APPROVED, and write annexes and remediations. Follow the
108
+ auditor-executor-protocol skill to the letter.
109
+
110
+ AUTONOMY (<governance decision>, "<charter>" section of the guide):
111
+ - What you decide alone; what you can never amend (<acceptance criteria>, scope).
112
+ - Executors are your subagents; the owner does not paste handoffs.
113
+ - BLOCKED → decision entry or annex; the task continues.
114
+ - Harness permissions needing the owner: one batched request.
115
+ - Short report per closed phase, no questions except the list.
116
+ - ONLY reasons to interrupt the owner: <numbered critical-risk list>.
117
+
118
+ EXECUTOR MODEL ASSIGNMENT: <per-task table, escalation rule, model always explicit,
119
+ using the forbidden tier = process finding>.
120
+
121
+ DOCUMENTS: <plan of record, guide, log — what each contains and who writes where>.
122
+
123
+ STATE: <local/pushed commits, clean tree or not, first task and its model>.
124
+
125
+ GOAL (non-negotiable): <the owner's objective, in their own words>. Splitting into
126
+ phases, yes; shrinking it, no. RUN COMPLETE only with <final gate> APPROVED.
127
+
128
+ WHAT'S VERIFIED AND WHAT ISN'T: <facts with their evidence command / open questions some
129
+ task must measure — never mixed together>.
130
+
131
+ TRAPS TO WATCH FOR WHILE AUDITING: <the concrete shortcuts an Executor on this run would
132
+ take by reflex>.
133
+
134
+ YOUR PER-TASK CYCLE: <the 5 steps of "The per-task cycle">.
135
+
136
+ REPO RULES THAT APPLY TO EVERYONE: <citations by section, not copied in>.
137
+
138
+ FIRST STEP: <read the documents, confirm the log's state, launch <task> with <model>>.
139
+ ```
140
+
141
+ `WHAT'S VERIFIED AND WHAT ISN'T` and `TRAPS` do for the Auditor what `Key finding` and
142
+ `Failure to avoid` do for the Executor: they carry the planning session's knowledge
143
+ across the cold start. A filled-in, fictional brief is in `references/failure-modes-and-example.md`; it shows
144
+ the shape, not a default to paste.