@techgoblin/gobstack 0.6.0-alpha.4 → 0.6.0-beta.2

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/CHANGELOG.md +59 -0
  2. package/README.md +249 -116
  3. package/VERSION +1 -1
  4. package/bans/README.md +5 -5
  5. package/bans/grep-ban.sh +1 -1
  6. package/bin/goblin-bans +103 -27
  7. package/bin/goblin-init +345 -259
  8. package/bin/goblin-install +269 -213
  9. package/bin/goblin-lib.sh +63 -66
  10. package/bin/goblin-map +130 -579
  11. package/bin/goblin-mcp.js +9 -14
  12. package/bin/goblin-verify +411 -993
  13. package/bin/goblin.js +4 -9
  14. package/docs/CURATION-2026-11-07-gobigrams.md +223 -0
  15. package/docs/GUIDE.md +727 -179
  16. package/docs/LIMITS.md +297 -301
  17. package/docs/RECORD-NOTES.md +1 -2
  18. package/manifest/bans.tsv +9 -9
  19. package/manifest/categories.tsv +18 -0
  20. package/manifest/enforcement.tsv +14 -67
  21. package/manifest/glossary.tsv +6 -12
  22. package/manifest/library.tsv +33 -0
  23. package/package.json +1 -4
  24. package/skills/goblin-bootstrap/SKILL.md +20 -32
  25. package/skills/goblin-feature-map/SKILL.md +1 -1
  26. package/skills/goblin-handoff/SKILL.md +5 -0
  27. package/skills/goblin-verify-author/SKILL.md +14 -2
  28. package/skills/practice/SKILL.md +4 -4
  29. package/templates/AGENTS.md.tmpl +6 -6
  30. package/templates/HANDOFF.md.tmpl +8 -6
  31. package/templates/SPEC.md.tmpl +2 -2
  32. package/templates/agents-block.tmpl +1 -10
  33. package/adapters/_template/adapter.tsv +0 -16
  34. package/adapters/_template/detect.sh +0 -10
  35. package/adapters/_template/emit.sh +0 -5
  36. package/adapters/_template/verify.sh +0 -4
  37. package/adapters/claude/adapter.tsv +0 -8
  38. package/adapters/claude/detect.sh +0 -8
  39. package/adapters/claude/verify.sh +0 -47
  40. package/adapters/codex/adapter.tsv +0 -12
  41. package/adapters/codex/detect.sh +0 -9
  42. package/adapters/codex/verify.sh +0 -45
  43. package/adapters/copilot/adapter.tsv +0 -10
  44. package/adapters/copilot/detect.sh +0 -8
  45. package/adapters/copilot/verify.sh +0 -45
  46. package/adapters/cursor/adapter.tsv +0 -11
  47. package/adapters/cursor/detect.sh +0 -10
  48. package/adapters/cursor/verify.sh +0 -45
  49. package/adapters/gemini/adapter.tsv +0 -15
  50. package/adapters/gemini/detect.sh +0 -11
  51. package/adapters/gemini/verify.sh +0 -49
  52. package/adapters/hermes/adapter.tsv +0 -9
  53. package/adapters/hermes/detect.sh +0 -8
  54. package/adapters/hermes/verify.sh +0 -27
  55. package/adapters/opencode/adapter.tsv +0 -14
  56. package/adapters/opencode/detect.sh +0 -9
  57. package/adapters/opencode/verify.sh +0 -45
  58. package/automations/README.md +0 -53
  59. package/automations/bugreporter-intake.sh +0 -145
  60. package/automations/drift-audit.sh +0 -139
  61. package/automations/report.schema.tsv +0 -10
  62. package/bin/goblin +0 -144
  63. package/bin/goblin-audit +0 -143
  64. package/bin/goblin-doctor +0 -233
  65. package/bin/goblin-emit +0 -495
  66. package/bin/goblin-extras +0 -365
  67. package/bin/goblin-model +0 -105
  68. package/bin/goblin-upgrade +0 -580
  69. package/docs/ADOPTION.md +0 -173
  70. package/docs/CI.md +0 -190
  71. package/docs/CONTRACTS.md +0 -218
  72. package/docs/DESIGN.md +0 -92
  73. package/docs/ENFORCEMENT.md +0 -228
  74. package/docs/FLOWS.md +0 -164
  75. package/docs/GLOSSARY.md +0 -40
  76. package/docs/GUARDRAILS.md +0 -126
  77. package/docs/INTEGRATION.md +0 -92
  78. package/docs/LOOP.md +0 -165
  79. package/docs/RE-PLAYBOOK.md +0 -183
  80. package/docs/RISKS.md +0 -70
  81. package/docs/ROLES.md +0 -105
  82. package/extras-catalogue/catalogue.tsv +0 -42
  83. package/extras-catalogue/payload/README.md +0 -14
  84. package/extras-catalogue/payload/taste-skill/taste/REFERENCE.md +0 -3
  85. package/extras-catalogue/payload/taste-skill/taste/SKILL.md +0 -9
  86. package/manifest/classes.tsv +0 -51
  87. package/manifest/playbooks.tsv +0 -16
  88. package/presets/electron-overlay.yaml +0 -38
  89. package/presets/fleet.yaml +0 -43
  90. package/presets/game.yaml +0 -38
  91. package/presets/research.yaml +0 -41
  92. package/presets/service.yaml +0 -40
  93. package/presets/software.yaml +0 -48
  94. package/roles.yaml +0 -54
  95. package/skills/goblin-bugfix/SKILL.md +0 -26
  96. package/skills/goblin-bugreporter/SKILL.md +0 -52
  97. package/skills/goblin-drift-audit/SKILL.md +0 -43
  98. package/skills/goblin-eval/SKILL.md +0 -68
  99. package/skills/goblin-feature/SKILL.md +0 -26
  100. package/skills/goblin-investigation/SKILL.md +0 -26
  101. package/skills/goblin-judge/SKILL.md +0 -74
  102. package/skills/goblin-loop/SKILL.md +0 -88
  103. package/skills/goblin-mode/SKILL.md +0 -70
  104. package/skills/goblin-overnight/SKILL.md +0 -42
  105. package/skills/goblin-pr-gate/SKILL.md +0 -42
  106. package/skills/goblin-re-mobile/SKILL.md +0 -51
  107. package/skills/goblin-refactor/SKILL.md +0 -23
  108. package/skills/goblin-sweep/SKILL.md +0 -23
  109. package/skills/goblin-tdd-repro/SKILL.md +0 -27
  110. package/templates/audit-waiver.tsv.tmpl +0 -10
  111. package/templates/install-hooks.allowlist.tmpl +0 -9
  112. package/templates/report.yaml.tmpl +0 -16
package/roles.yaml DELETED
@@ -1,54 +0,0 @@
1
- # roles.yaml — the role catalogue. A ROLE is what the work needs; a PROFILE is a worker
2
- # identity. They are kept separate on purpose: five documents once gave five different model
3
- # answers because a role name was used as a model name.
4
- #
5
- # THIS FILE NAMES NO MODEL. It names a capability and the default profile that carries it.
6
- # The machine-specific mapping (profile -> provider/model/effort) is read at run time from
7
- # the mapping file declared as models_file: in .goblin/goblin.yaml — the single documented
8
- # install-time machine input. bin/goblin-model resolves a role through it.
9
- #
10
- # profiles: a list. One lane runs per entry, so the LIST LENGTH is the lane count — that is
11
- # how the review panel is bounded by configuration rather than by code.
12
-
13
- role-code:
14
- capability: fast, cheap, mechanical correctness
15
- profiles: [coder]
16
- used_by: P2, P4, P5, P10
17
- budget: one effort token per role, read from the mapping file
18
-
19
- role-judgment:
20
- capability: strongest available reasoning and prose
21
- profiles: [architect]
22
- used_by: P1, P3 (spec half), P6, P8, P9
23
-
24
- role-review-panel:
25
- capability: N independent verdict lanes, each its own lane
26
- profiles: [reviewer, architect]
27
- used_by: P7 at stakes S3 and above
28
- budget: bounded — lanes only at S3+, because five parallel lanes cost about five times the tokens
29
-
30
- role-synthesis:
31
- capability: merges many outputs into one artifact
32
- profiles: [architect]
33
- used_by: P11, P12
34
-
35
- role-investigate:
36
- capability: read-only exploration returning a distilled summary
37
- profiles: [researcher]
38
- used_by: P1 (read-only half)
39
-
40
- role-judge:
41
- capability: decides whether a process met its own predicate, from a command's output and a
42
- pointer it can resolve, never from a report
43
- profiles: [judge]
44
- used_by: P10 (the exit predicate), P12 (grading), P7 at S3+ (the panel's foreman), the terminal
45
- handoff gate, an automation agent's "did the fix land"
46
- budget: one lane per verdict - a verdict is a decision, so this role never fans out
47
-
48
- # Role-pinned fan-out goes through the kanban, never through a bare subagent spawn:
49
- # delegate_task takes no model or provider parameter, so it cannot honour a role.
50
- # kanban_create takes both. docs/ROLES.md states this as a rule.
51
- fanout:
52
- carrier: kanban
53
- rule: one card per lane, each carrying the resolved provider/model, the pinned SHA, the diff and one focus
54
- judge_is_not_a_panel: role-judge is a single lane; N independent verdicts is role-review-panel
@@ -1,26 +0,0 @@
1
- ---
2
- name: goblin-bugfix
3
- description: P2: reproduce a defect, fix its measured root cause, prove absence with a control.
4
- ---
5
-
6
- # goblin-bugfix (P2)
7
-
8
- 1. **Reproduce it yourself**, with the exact command, before touching anything. A bug you did
9
- not reproduce is a bug you will not fix.
10
- 2. **State the root cause with a measurement.** Never "should be" and never "probably". Paste
11
- the command and its output that shows the cause.
12
- 3. **Fix the root, not the symptom.** A guard added at the call site of a wrong value is a
13
- symptom fix; the wrong value is the bug.
14
- 4. **Prove absence on the same surface, with a negative control.** The repro command fails
15
- before and passes after. Then revert the fix, confirm the repro fails again, restore.
16
-
17
- ## Verification
18
-
19
- - The repro fails before and passes after, on the *same* command.
20
- - A unit test shows branch behaviour, not bug absence. Do not report a green suite as proof
21
- the bug is gone; report the repro.
22
- - If the defect also exists in a sibling project, say so and do not silently fix it there.
23
-
24
- ## What this cannot see
25
-
26
- Bugs whose only symptom is a human noticing something looks wrong.
@@ -1,52 +0,0 @@
1
- ---
2
- name: goblin-bugreporter
3
- description: P13: intake a bug report, reproduce it at a named revision, and hand off a fix card only on proof.
4
- ---
5
-
6
- # goblin-bugreporter (P13)
7
-
8
- Use when a report has arrived as an **event** — a report file under `reports/<slug>/`, a chat
9
- message turned into one, or a webhook payload. You are the reporter. You never fix.
10
-
11
- 1. **Validate the intake.** `reports/<slug>/report.yaml` must carry the six required keys
12
- (`repo`, `symptom`, `expected`, `observed`, `repro_steps`, `revision`) and its `dedup_key`.
13
- Run the validator rather than eyeballing the file:
14
-
15
- bash .goblin/automations/bugreporter-intake.sh <slug>
16
-
17
- A missing key is a **refusal**, not a guess: create the same card with **no `--assignee`**,
18
- so the dispatcher buckets it `skipped_unassigned` and no agent acts on it, and name the
19
- missing field in a comment. The human sees it; nothing is silently lost or invented.
20
- 2. **Freeze the coordinates.** `repo` and `revision` are immutable for the run. If `revision`
21
- is not a commit that resolves (`git rev-parse --verify <rev>^{commit}`), the report is a
22
- refusal: a repro at a revision nobody can check is not a repro.
23
- 3. **Reproduce, in this order.**
24
- - **R1** — a failing command with its output, at the named revision. The best form.
25
- - **R2** — the REPLAY form: `git show <revision>:<file>` into a temp dir, run the probe
26
- against it, require RED. Never a probe that is green on both trees.
27
- - **R3** — a real-UI drive with captured evidence. Admissible only with a configured
28
- control adapter, and **never** accepted as harness proof; it is evidence for a human.
29
- 4. **Write `reports/<slug>/repro.md`** as a two-row table, not a story: `command:`/`revision:`,
30
- a `pre:` row that is RED with the pasted output, and the `post:` row. The `pre` row is the
31
- negative control and it is not optional — a single green run reproduces nothing.
32
- 5. **Create the fix card only on `reproduced`.** `--assignee coder`, `--skill goblin-bugfix`,
33
- `--parent <this card>`, the report's dedup key. The child waits in `todo` until this card is
34
- `done`, so the gate is a dispatcher-enforced dependency rather than a promise.
35
- 6. **Complete your own card with the verdict** in the completion metadata:
36
- `reproduced` | `could-not-reproduce` | `blocked`. `could-not-reproduce` is a complete,
37
- successful run — not a failure to work around. `blocked` names the missing capability.
38
-
39
- ## Write surface
40
-
41
- `reports/**`, and the card this lineage owns (`kanban_create` for the fix card). Nothing else:
42
- no `git commit`, no source edit, no edit under the harness dir, no vault write. `AU-03` asserts
43
- the working tree is clean after a run, so a reporter that edited the tree fails its own gate.
44
-
45
- ## What this cannot see
46
-
47
- Whether the report is *true*. The gate proves the symptom reproduces at a revision; it cannot
48
- prove the reporter's description of intent, severity or cause is right, and it cannot see a fix
49
- that fixed the wrong thing. It cannot see a defect whose only detector is a human eye, anything
50
- needing a device, a network or a running production instance, or a defect that reproduces only
51
- on a revision that no longer builds. In those cases the verdict is `could-not-reproduce`, and
52
- that is the whole answer.
@@ -1,43 +0,0 @@
1
- ---
2
- name: goblin-drift-audit
3
- description: P14: repair a recorded claim that no longer agrees with the artifact, one card per drifting repo.
4
- ---
5
-
6
- # goblin-drift-audit (P14)
7
-
8
- Use when a drift card exists. The producer (`automations/drift-audit.sh`) compared a recorded
9
- claim against an artifact, disagreed, and filed **one card per drifting repo**. You repair the
10
- disagreement; you do not re-derive it from memory.
11
-
12
- 1. **Read the record, not your memory.** The card body carries the repo, the check id and the
13
- detail line the producer computed. Re-run that exact check yourself and confirm it is still
14
- RED:
15
-
16
- <repo>/.goblin/bin/goblin-verify --only <check-id>
17
-
18
- A drift that is no longer reproducible is a stale card, and closing it with that fact is a
19
- complete run.
20
- 2. **Classify it.** A **real regression** (the artifact changed and the claim did not) | a
21
- **stale-by-design claim** (the claim is historical, and `PROJECT-PRACTICE` section 1 requires
22
- it kept, so it gets a dated parenthetical) | **fixture drift** (the recorded value is right
23
- and the check is wrong).
24
- 3. **Repair the right one.** A hash drift after an intended edit of the referenced standard is
25
- a deliberate `--re-pin`, never a hand-edited hash. A missing installed file is a re-install.
26
- An absent gate line is a gate run. **Never edit a harness to make a number green** — that is
27
- the one repair that must never happen from here, and it is the repair an automated actor is
28
- most likely to reach for.
29
- 4. **Prove it.** Re-run the same `--only <check-id>` and show GREEN, and name the command and
30
- the revision in the completion metadata.
31
-
32
- ## Write surface
33
-
34
- Only the drifting repo named by the card, only the repair the card names — the config, the
35
- ignore file, the pin, or the install. No harness edit, no vault write, no push.
36
-
37
- ## What this cannot see
38
-
39
- Whether the *claim* is the right one to keep. It compares a recorded value with an artifact, so
40
- it cannot detect drift in something nobody recorded: an unwritten assumption, a stale sentence
41
- with no number in it, or a document that was never generated from the artifact. It also cannot
42
- see whether the producer's ceiling stopped a real finding from being filed — that is why a
43
- capped run prints its own line.
@@ -1,68 +0,0 @@
1
- ---
2
- name: goblin-eval
3
- description: P12: measure whether a skill or prompt change did anything, blinded.
4
- ---
5
-
6
- # goblin-eval (P12)
7
-
8
- Use when a skill or prompt changed and you want to know if it did anything — including when the
9
- thing that changed is a **generated verification skill** (P6's output). This is the only mechanism
10
- goblin-stack has for that question, and it has never been run — treat its output as a first
11
- measurement, not a verdict. The runner is **not shipped**: every step below is a procedure an
12
- operator executes, and no row in `manifest/enforcement.tsv` reads a lane yet.
13
-
14
- 1. **Candidate and control run in sanitized directories.** Same task, same starting tree, one
15
- difference. Sanitized means a **clean workspace with nothing borrowed**: no prior chats, no
16
- prior artifacts, no prior executions. An agent that can reach a previous run can produce the
17
- answer without using the skill, and then the eval measures nothing but the leak.
18
- 2. **No condition token anywhere the candidate can see.** The ban is eleven tokens — `eval`,
19
- `test`, `judge`, `experiment`, `rubric`, `score`, `compare`, `benchmark`, `candidate`,
20
- `arena`, `control` — not only the four this skill used to name, and it covers the directory
21
- names, the file names and the prompt. A candidate that knows it is being graded changes
22
- behaviour.
23
- 3. **Grade the chain from the transcript** — which files it actually opened, which commands it
24
- ran — never the self-report.
25
- 4. **The judge runs as `role-judge`, on a lane disjoint from the candidate's.** A model grading its
26
- own family's output is grading itself; the lane that decides must not be the lane that wrote.
27
- `JG-02` checks the declared lanes are disjoint, and reports an unresolved judge lane as `ADV`
28
- rather than failing a repo for the fleet's routing. What the judge receives, what it must
29
- refuse and how its verdict is recorded is `docs/LOOP.md` — the short form is: **a predicate and
30
- a handle the repo can resolve, never a self-report.**
31
- 5. **Write the record where the next reader looks.** One directory per eval, `evals/<slug>/`:
32
- `prompt.md` (the one organic prompt, identical across lanes), `rubric.md` (3–6 criteria, for
33
- the judge only), `manifest.tsv` (`lane · condition · label · profile · provider · model ·
34
- family · workspace · card_id · session_id · transcript`), `transcripts/<label>.jsonl` (the
35
- exported session, one file per lane) and `verdict.md` (the judge's per-criterion scores, each
36
- with an `evidence:` line naming the lane and the location). The **family** is recorded, never
37
- only the model slug — and **no model slug belongs under `skills/ manifest/ bin/ templates/
38
- presets/ .goblin/ .hermes/`**; `evals/` sits outside that scope on purpose, because a slug is
39
- run data, not content for a rule.
40
- 6. **A change must improve the evaluated cases or add new evaluations.** That is the merge rule,
41
- and it is this repo's "a check must be able to go RED" applied to skill prose: changing
42
- instructions requires evidence about the resulting behaviour, not a judgement that the new
43
- wording sounds better. **When the subject is a generated verification skill, the pass condition
44
- is a number**: every seeded defect must make the harness RED, the control (the same defects
45
- against a harness carrying no assertions) must detect **zero**, and every correction must be
46
- RED before it is GREEN. A skill that misses a seeded defect has a hole; a sensitivity below
47
- 1.0 is reported with the number beside it, never rounded up to a pass.
48
- 7. **Cheap checks first; the judge last.** Regex and script assertions for what is concrete (the
49
- right SDK, the right method, the absence of an obsolete pattern); an LLM judge with an explicit
50
- rubric only for what needs interpretation. **Triggering is a diagnostic, not the objective** —
51
- loading the skill on the fifth turn can be fine and completing the task without loading it can
52
- be fine too, so the trigger result stays visible without defining pass/fail.
53
-
54
- ## Verification
55
-
56
- - The judge's verdict is reproducible from the transcripts alone.
57
- - Candidates never learn that other candidates exist.
58
- - Every lane named in `manifest.tsv` has a transcript file that exists.
59
- - A generated verification skill is not "verified" until a record exists for it: its declared
60
- doctor exits 0 (`VA-01` is the executable half), and the record carries the sensitivity.
61
-
62
- ## What this cannot see
63
-
64
- Small effects. With a handful of runs, a difference smaller than the run-to-run variance is
65
- noise, and no amount of prose makes it a signal. It also cannot see **its own blinding**: on a
66
- machine where a candidate holds terminal access, sibling workspaces, sibling cards and other
67
- sessions are readable, so blinding is a discipline with a detector rather than a property. And
68
- the runner is not shipped — with no record, this skill is a procedure, not a measurement.
@@ -1,26 +0,0 @@
1
- ---
2
- name: goblin-feature
3
- description: P3: SPEC first, then land the feature in units that each end checkable.
4
- ---
5
-
6
- # goblin-feature (P3)
7
-
8
- 1. **SPEC first.** A `*-SPEC.md` with a measured root cause and an `AC:` list, committed with
9
- or before the code. No code moves until it exists.
10
- 2. **Name the data shape before the code.** The shape decided late is the shape that gets
11
- rewritten.
12
- 3. **Land it in units that each end checkable.** Each unit ends with a measurement, not with
13
- "and now the next part".
14
- 4. **Write the SHA it landed at into the review note** (`goblin-pr-gate`, P7). "The reviewer
15
- approved this" is a claim about a moment until it names a commit.
16
-
17
- ## Verification
18
-
19
- - Every `AC:` item has a checkable assertion: a backticked command, or a comparison operator.
20
- - The round reports one line of measured numbers.
21
- - The commit SHA is named.
22
-
23
- ## What this cannot see
24
-
25
- Whether the feature was the right thing to build. That is the SPEC's job, and it is a human's
26
- decision.
@@ -1,26 +0,0 @@
1
- ---
2
- name: goblin-investigation
3
- description: P1: answer a read-only question with cited evidence, or mark it unverified.
4
- ---
5
-
6
- # goblin-investigation (P1)
7
-
8
- For a read-only question, or "why is this happening". **No code changes.**
9
-
10
- 1. **Name the question as a falsifiable claim.** "The board writes to the wrong path" is a
11
- claim; "the board is broken" is not.
12
- 2. **Read the code paths and cite `file:line`.** A claim with no anchor is a rumour.
13
- 3. **If the answer is observable by running something, run it instead of asking.** A question
14
- whose answer is a fact a command can print is not the human's to answer. This is the whole
15
- classifier: *observable by running* -> run it; *a preference or a decision* -> ask.
16
- 4. **Write the answer with its evidence.** Command and real output, or `file:line`.
17
-
18
- ## Verification
19
-
20
- - Every claim carries a `file:line` or a command plus its output.
21
- - No file is modified. Prove it: `git status --short` is unchanged from before the pass.
22
- - Anything you could not source is marked `[unverified]`. There is no third state.
23
-
24
- ## What this cannot see
25
-
26
- Intent, and anything outside the repo — a service that is down, a decision not written down.
@@ -1,74 +0,0 @@
1
- ---
2
- name: goblin-judge
3
- description: role-judge: decide whether a process met its own predicate, from a command's output and a pointer it can resolve - never from a report.
4
- ---
5
-
6
- # goblin-judge (role-judge)
7
-
8
- A **reviewer inspects an artifact**. A **judge decides whether a process met its own predicate**.
9
- Different input, different output, different failure mode, which is why the judge is a role of its
10
- own and not a sentence inside another playbook.
11
-
12
- | | reviewer (`role-review-panel`) | judge (`role-judge`) |
13
- |---|---|---|
14
- | input | an artifact: a diff at a SHA, a file, a spec | a **predicate** plus the evidence the predicate produced |
15
- | question | "is this artifact right?" | "did the process meet the condition it declared?" |
16
- | output | findings, categorised (act / consider / noted / dismissed) | a verdict from a **closed enum**, plus the handle it rests on |
17
- | may accept | the artifact itself, at a named revision | only what the verdict can be re-derived from |
18
- | failure mode | misses a defect, or bikesheds | **says yes** - a judge that has never returned "not done" |
19
- | retry | re-review, possibly by another lane | re-run the *same* predicate on the recorded evidence |
20
- | relation to the author | may be a sibling lane | **not the author, and not the author's profile** |
21
-
22
- A reviewer's verdict is an opinion attached to a SHA, and a new head voids it. A judge's verdict
23
- is a decision about a **process**, so it is honest only when it is reproducible from a record and
24
- useful only when it can say **no**.
25
-
26
- ## What it receives
27
-
28
- - **A predicate** - one shell command, the loop's declared exit condition. Never a rubric.
29
- - **Evidence** - a pointer the repo can resolve: `sha:<hex>` (a commit), `file:<path>`, or
30
- `sha256:<hex>` (a file's digest). **Never the author's prose.** The single most common failure
31
- of a judging loop is that its only input is the worker's own summary; the prompt can demand
32
- evidence and still be handed a self-report.
33
- - The **budget** and the iteration rows, so it can see what the loop has already tried.
34
-
35
- ## What it outputs
36
-
37
- One verdict, from a closed enum: **`done` | `blocked` | `continue` | wait** - plus, in this repo's
38
- record, the **handle** the verdict rests on. `done` may only cite a handle the repo resolves.
39
- Anything else is a claim.
40
-
41
- ## What it must refuse
42
-
43
- - **A self-report as evidence.** A summary is not a handle. If the only thing offered is prose,
44
- the verdict is `continue`, not `done`.
45
- - **Grading its own family.** The judge's profile set must be disjoint from the author's
46
- (`JG-02`). A judge drawn from the same lane as the author is the author.
47
- - **Ruling a goal done to unblock itself.** `blocked` blocks; it is never a completion. A
48
- judged-done-but-unfinalised loop gets one nudge, then a block - never a completion.
49
-
50
- ## Where the judge is called
51
-
52
- 1. **P10 `goblin-overnight`** - the exit predicate.
53
- 2. **P12 `goblin-eval`** - the rubric, graded from the transcript chain.
54
- 3. **P7 `goblin-pr-gate` at S3+** - the panel's *foreman*: N lane verdicts are opinions, one
55
- judge turns them into a decision. A panel is N opinions; a judge is one decision.
56
- 4. **The terminal handoff gate** - the card is judged *before* it is marked done.
57
- 5. **An automation's "did the fix land"** - the repro fails before, passes after, twice.
58
-
59
- ## How a verdict is recorded
60
-
61
- One row per iteration in `.goblin/loop/decisions.tsv` (the decision-log shape pstack already
62
- uses): `ts · phase · decision · why · evidence · result`, where `decision` is `verdict:<one of the
63
- enum>` and `evidence` is a handle. `JG-01` reads it; `JG-03` counts it. On the board, the same
64
- turn also leaves one line in the worker log, which is a UI surface - the committed row is what a
65
- later reader can re-derive from.
66
-
67
- ## What this cannot see
68
-
69
- - Whether a **resolvable handle supports the verdict** it is attached to. `JG-01` proves a commit
70
- or a file exists; a judge may cite a real commit that has nothing to do with the claim.
71
- - **Which lane actually produced a verdict.** No repo-local file observes which profile ran;
72
- `JG-02` checks that the *declared* lanes are disjoint, not that a judge ran on one.
73
- - Whether a lane that has always said yes is **bad**, from one repo's rows (`JG-03`, counted).
74
- - Whether the predicate was the **right** one. The judge measures what it was told to measure.
@@ -1,88 +0,0 @@
1
- ---
2
- name: goblin-loop
3
- description: Arm, pin, run and close one unattended loop whose exit condition is a command - and stop when it stops making progress.
4
- ---
5
-
6
- # goblin-loop (the loop contract)
7
-
8
- A **loop** is an unattended run whose exit condition is a **command**. One run, one record:
9
- `.goblin/loop/`, committed, so a reader tomorrow can re-derive every decision. An unrecorded loop
10
- is a story.
11
-
12
- ## 1. Arm it: the predicate comes first
13
-
14
- Write the exit condition as **one** shell command in `.goblin/loop/predicate`, and **run it once
15
- before iteration 1**:
16
-
17
- .goblin/loop/predicate # one command; exits 0 == the loop is finished
18
- .goblin/loop/predicate.sha256 # its digest, recorded at loop start
19
- .goblin/loop/first-run # exit=<n> ts=<ISO8601>, from that first run
20
- .goblin/loop/budget # the turn budget this run declares
21
-
22
- A **duration is not a finish condition.** Neither is a description of one. The run-once rule is
23
- not ceremony: it is the only way to know the command is runnable *and currently red*, which is
24
- what makes a later green mean anything.
25
-
26
- `.goblin/loop/budget` is capped by `loop_max_turns_ceiling` in `.goblin/goblin.yaml` (default
27
- **20**). The number is not invented: 20 is the engine's own default turn budget for a kanban goal
28
- loop, and a ceiling that disagreed with the engine would be a number someone made up.
29
-
30
- ## 2. Pin it: never relax
31
-
32
- The predicate's digest is recorded at loop start (`LP-02`). Changing it mid-loop is **not an
33
- edit** - it is closing this loop and opening another:
34
-
35
- .goblin/loop/closed-<date>/ # the relaxed predicate AND its pin go here, committed
36
- # then re-record predicate.sha256 with a `previous: <archived digest>` line beside the new one
37
-
38
- The chain is what the row checks: a silent relaxation fails, a recorded re-scope costs one line.
39
- Whether the new predicate is *weaker* is not decidable from a digest and is recorded in
40
- `docs/LIMITS.md` #39 rather than claimed.
41
-
42
- The pin never updates itself, for the same reason `practice_sha256:` never re-pins itself: a
43
- self-updating pin is the silent edit it exists to catch. The remedy is printed when the row fails
44
- and is never automatic.
45
-
46
- ## 3. Log every iteration
47
-
48
- One row per iteration, appended to `.goblin/loop/decisions.tsv` - the decision-log shape, unchanged
49
- from the template:
50
-
51
- ts · phase · decision · why · evidence · result
52
- decision = "verdict:<done|blocked|continue|wait>"
53
- evidence = a pointer that resolves: sha:<hex> | file:<path> | sha256:<hex>
54
- result = "predicate:red" | "predicate:green" | "parked" | "stuck"
55
-
56
- `evidence` is the thing a judge's verdict rests on. A `verdict:done` row that cites nothing
57
- resolvable is refused by `JG-01`: the verdict may only rest on a handle the repo can re-derive.
58
-
59
- ## 4. Guard rails - what stops a night being burned
60
-
61
- - **No progress stops the loop.** Three consecutive verdict rows with an **unchanged evidence
62
- pointer** and a result that is not `predicate:green` is a failure (`LP-04`). What it measures
63
- is a *changed pointer*, a proxy for progress, not progress itself - a loop that edits a file
64
- each turn to keep the pointer moving is not caught.
65
- - **The check cannot be weakened.** The predicate is pinned by digest (`LP-02`); the budget is
66
- declared and capped (`LP-03`); and a card's own predicate cannot be edited by its worker at all,
67
- which is why the file predicate needs the pin and the card predicate does not.
68
- - **A stuck loop writes up and stops.** A run whose last row is not `predicate:green` carries
69
- `.goblin/loop/stuck.md`: at least three non-blank lines naming the predicate it failed
70
- (`LP-05`). The exit a worker can actually reach is `kanban_block` - naming the predicate - plus
71
- the write-up. Thrashing is not an option the record allows.
72
-
73
- ## 5. The morning audit
74
-
75
- Read the rows whose `result` is not `predicate:green`, **in order**, then the last five rows for
76
- context. That is the same discipline as P10's "read the Attention section first": the interesting
77
- rows are the ones that did not reach the goal, and a green summary line is not one of them.
78
-
79
- ## What this cannot see
80
-
81
- - **Whether the predicate was the right one.** Every `LP-` row checks the process; a loop can run
82
- perfectly against a predicate that measures the wrong thing - and a predicate that was
83
- **vacuously true from the start** (a `grep -c` against a renamed directory exits 1, passes
84
- `LP-01` and `LP-02`, and ends green on nothing) is the failure mode the run-once rule exists to
85
- make visible to a human, not one a row can catch.
86
- - **Whether the recorded `exit=` was measured or typed**, and whether the loop really ran - the
87
- record proves a date and a code exist, not that a command produced them.
88
- - **Cost.** A turn budget bounds turns, not tokens, and the record prices nothing.
@@ -1,70 +0,0 @@
1
- ---
2
- name: goblin-mode
3
- description: Route a request to one goblin-stack playbook, seed the todos, and keep the two reply habits.
4
- ---
5
-
6
- # goblin-mode
7
-
8
- The router. Load this first in any repo that has goblin-stack installed. It turns a request
9
- into exactly one playbook, and it refuses to invent machinery that does not exist here.
10
-
11
- ## The index — one request, one playbook
12
-
13
- | request | playbook | skill |
14
- |---|---|---|
15
- | a read-only question, or "why is this happening" | P1 | `goblin-investigation` |
16
- | a reported defect | P2 | `goblin-bugfix` |
17
- | new behaviour | P3 | `goblin-feature` |
18
- | a behaviour-preserving reshape | P4 | `goblin-refactor` |
19
- | a defect where a regression test is cheap | P5 | `goblin-tdd-repro` |
20
- | a project has no live lane, or its gates drift | P6 | `goblin-verify-author` |
21
- | a feature map is missing, or its entry points have drifted | P6 | `goblin-verify-author` + `goblin-feature-map` |
22
- | anything that should be reviewed before it lands | P7 | `goblin-pr-gate` |
23
- | adopting goblin-stack in a repo, or starting one | P8 | `goblin-bootstrap` |
24
- | ending a session, or picking up another's | P9 | `goblin-handoff` |
25
- | an unattended run over a predicate | P10 | `goblin-overnight` |
26
- | the same change or question across projects | P11 | `goblin-sweep` |
27
- | a skill or prompt changed, and you want to know if it did anything | P12 | `goblin-eval` |
28
- | an event delivered a report (a bug report, a chat message, a webhook) | P13 | `goblin-bugreporter` |
29
- | a recorded claim disagrees with the artifact (drift) | P14 | `goblin-drift-audit` |
30
-
31
- If a request matches none of these, say so and ask — do not stretch a playbook to fit.
32
-
33
- ## The two reply habits
34
-
35
- 1. **Lead with the answer, evidence after.** The first line is the outcome; the command and
36
- its output follow. Never open with what you are about to do.
37
- 2. **Say what is NOT verified.** Every report ends with the surface the checks did not reach.
38
- A claim you cannot source is marked `[unverified]`; it is never quietly implied.
39
-
40
- ## Todo seeding
41
-
42
- Before the first tool call of a non-trivial task, seed the todo list from the playbook's
43
- required steps — one todo per step, in order, with the verification step last. A todo is
44
- closed only by the measurement it names, never by "looks right". If a step turns out to be
45
- unnecessary, close it with the reason rather than deleting it: the list is the record.
46
-
47
- ## The read-vs-write fan-out rule
48
-
49
- The axis that decides fan-out is **read versus write**, not difficulty.
50
-
51
- - **Read-only work** (P1, P12, a P11 sweep) may fan out: independent readers cannot corrupt
52
- each other, and the cost is bounded by the number of targets.
53
- - **Write work** (P2, P3, P4, P5) does not fan out by default. Parallel writers to one tree
54
- cost about N times the tokens and produce conflicts a single careful pass would not.
55
-
56
- **Role-pinned fan-out goes through the kanban.** A bare subagent spawn has no model or
57
- provider parameter, so it cannot honour a role: it would silently run every lane on one
58
- model, which is exactly the review failure the panel exists to prevent. Use a board card per
59
- lane — each carrying the resolved provider/model, the pinned SHA, the diff and one focus —
60
- never a subagent spawn. `docs/ROLES.md` states this as a rule.
61
-
62
- ## Forbidden code
63
-
64
- `.goblin/bin/goblin-bans` runs the ban table `.goblin/manifest/bans.tsv`; the bans this repo
65
- turns on are named by `bans:` in `.goblin/goblin.yaml`. Run it before you write the line —
66
- `goblin-verify` only reports a ban once the code already exists.
67
-
68
- ## What this cannot see
69
-
70
- Whether the request was the right one to make. It routes; it does not judge intent.
@@ -1,42 +0,0 @@
1
- ---
2
- name: goblin-overnight
3
- description: P10: an unattended run over a checkable predicate written before iteration 1.
4
- ---
5
-
6
- # goblin-overnight (P10)
7
-
8
- 1. **The exit condition is a checkable predicate written before iteration 1**, and it is a
9
- command — in the card body, or in `.goblin/loop/predicate`. Run it once before starting, so
10
- you know it is runnable; record that run as `exit=<n> ts=<ISO8601>` in `.goblin/loop/first-run`
11
- and pin the predicate (`LP-01`, `LP-02`).
12
- 2. **It never gets relaxed.** If the predicate turns out to be wrong, stop and write up why; do
13
- not edit the predicate to fit the result. Relaxing it is closing this loop and opening
14
- another, with the old predicate archived under `.goblin/loop/closed-<date>/`.
15
- 3. **An escape hatch.** A genuine dead end writes up why and stops: `.goblin/loop/stuck.md`, at
16
- least three non-blank lines naming the predicate, committed. The exit a worker can actually
17
- reach is **`kanban_block`** (naming the predicate) — there is no `kanban_edit` tool in a
18
- worker's toolset. An unattended run that cannot stop is a runaway.
19
- 4. **The morning audit reads the `Attention` section first**, then the record's rows whose
20
- `result` is not `predicate:green`, in order.
21
-
22
- ## Verification
23
-
24
- - The predicate is one command, and its first run is recorded at or before the first log row
25
- (`LP-01`).
26
- - The predicate is pinned by digest and the pin has not moved (`LP-02`).
27
- - `goal_max_turns` is set, at or under `loop_max_turns_ceiling`, and the record never exceeds it
28
- (`LP-03`).
29
- - No three consecutive verdict rows share an evidence pointer without reaching
30
- `predicate:green` (`LP-04`).
31
- - A run whose last row is not `predicate:green` carries `.goblin/loop/stuck.md` naming the
32
- predicate (`LP-05`).
33
- - Every landed change has a P7 verdict row, and any verdict that says `done` cites a handle the
34
- repo resolves (`JG-01`).
35
- - The four record artifacts — `predicate`, `predicate.sha256`, `first-run`, `decisions.tsv` —
36
- are committed, so tomorrow's reader can re-derive every decision.
37
-
38
- ## What this cannot see
39
-
40
- Whether the predicate was the right one. It measures only what it was told to measure — and a
41
- predicate that was **vacuously true from the start** runs green on nothing, which is why the
42
- run-once rule exists and why a human reads the predicate.
@@ -1,42 +0,0 @@
1
- ---
2
- name: goblin-pr-gate
3
- description: P7: classify stakes S0-S4, run the gate at the candidate SHA, write a SHA-named verdict.
4
- ---
5
-
6
- # goblin-pr-gate (P7)
7
-
8
- Use for anything that should be reviewed before it lands.
9
-
10
- 1. **Classify the stakes S0-S4.** The gate is chosen by the *change*, not by the repo.
11
- - S0: no review. A typo in a comment.
12
- - S1: self-review. A local edit with no shared surface.
13
- - S2: one reviewer, gate set run at the candidate SHA.
14
- - S3: a panel of two or more independent lanes, each its own card and its own model.
15
- - S4: a panel plus a human decision before landing.
16
- 2. **Run the gate set at the candidate SHA and record the numbers.**
17
- 3. **Write `reviews/<slug>-<head7>.md`** with `head:`, `base:`, `patch-id:`, `stakes:`,
18
- `checks-run:`, `lanes:`. The file is the artifact; a board card is only the routing record.
19
- At S2+, add a `security:` line naming three things the checks cannot tell a reader: the audit
20
- record's date, the number of matched waivers, and the perf number with its baseline commit.
21
- It is prose on purpose — a review prompt, not a check (`SC-07`, `PF-01`).
22
- 4. **Evaluate the panel rule for S3+.** One lane is not a panel. Lanes go through the kanban
23
- (see `goblin-mode`), each carrying the resolved provider/model.
24
- 5. **At S3+, the foreman is `role-judge`.** N lane verdicts are **opinions**; the foreman turns
25
- them into one **decision**, and it is a lane disjoint from the author's — a panel that grades
26
- its own author is the author. A vote count is not a decision.
27
- 6. **Re-check the patch-id before landing.**
28
-
29
- ## Verification
30
-
31
- - `patch-id:` of `base..head` still matches. A new head voids the verdict — a matching commit
32
- message does not restore it, and a green check from an older SHA is not a substitute.
33
- - The named `head:` exists in `git rev-list --all`.
34
- - For S2+, a check actually ran on that SHA.
35
- - At S3+, the deciding lane is disjoint from the author's (`JG-02`).
36
-
37
- ## What this cannot see
38
-
39
- A required check that self-skips (it reports Success), and a protected branch whose only
40
- admin is the person pushing (it protects nothing). Nor can it see *which* lane produced a
41
- verdict: the review note names the declared lanes, and no file in the repo observes the profile
42
- that actually ran (`MD-03`).