notrest

The plugin: structure and architecture

Not Rest Inc. · Session Harness · 4 of 8 · Tree, events, laws, estate, contract

The harness ships as a plugin, and everything on this stop is in its tree. The facts below are read from the version this walk was written against.

v4.7.1 · 32 skills · 11 hook scripts · 7 CLI events

The tree

A skill is a folder; the folder's name is the skill's name; a skill with a script ships that script's test.

text version
plugins/notrest/
├── .claude-plugin/plugin.json      the manifest (name, version)
├── hooks/hooks.json                what runs on which event
├── hooks/*.sh, gate-check.py       the 11 hooks + 2 helpers
├── skills/<name>/SKILL.md          32 skills, one folder each
│         ├── scripts/*.py|.sh      the skill's runnable tool
│         └── scripts/fixture.sh    the tool's own test
└── README.md, docs/                what the consumer reads

.claude-plugin/marketplace.json     how it is installed
CHANGELOG.md · docs/MAP.md          the record and the map

Rule of the tree: a skill is a folder; a folder's name is the
skill's name; a skill with a script ships the script's test.

What runs when

Seven CLI events, nine command entries. Every entry declares its own timeout, and every hook fails open and silent — a broken hook never takes the session down.

text version
Runtime event        hook                     what it does
──────────────────   ───────────────────────  ─────────────────────────
SessionStart         session-start.sh         banner, laws, the packet
UserPromptSubmit     coord-nudge.sh           "log this prompt's work"
                     router.sh                "this looks like /verb"
PreToolUse (Agent)   spawn-gate.sh            refuses unlawful spawns;
                                              injects lessons; arms gates
PreToolUse (Bash)    pretool-gate.sh          ship gate, shadow guard
SubagentStop         agent-ledger.sh          receipts every lane; banks its card
Stop                 completion-gate.sh       "done" must earn itself:
                                              gates · lessons · open questions
PreCompact           pre-compact.sh           bank before memory shrinks
SessionEnd           session-end.sh           crash cushion, ledger roll

Every command declares its own timeout. Every hook fails OPEN
and silent: a broken hook never takes the session down.

Where a law lives

The same law is written in one place, enforced in another, audited in a third. When the text and the gate disagree, the gate wins.

text version
                 written        enforced          audited
                 ───────        ────────          ───────
Offload policy   CLAUDE.md      spawn-gate.sh     eval OFFLOAD-POLICY
                 SKILL.md                         spend report
Ship gate        CLAUDE.md      pretool-gate.sh   doctor + eval
Ledger law       protocol block coord-nudge.sh    doctor ESTATE
Lessons law      archivist      completion-gate   eval LEARNING-LOOP
Done-when        the brief's    spawn-gate writes completion-gate +
                 NOTREST-GATES  gates/ACTIVE.md   gate-check.py

Same law, three places. If the text and the gate disagree,
the gate wins — and eval says so.

The estate

This is what a project gains the moment the harness is established in it. Nothing here is written by the model from memory: hooks write the ledgers, scripts grade them.

text version
your-project/
├── CLAUDE.md          + a marked protocol block (v3)
├── COORD.md           one honest line per prompt, append-only
├── COORD-AGENTS.md    one row per finished lane, auto-written
├── briefs/agent-*.md  every lane's exact commission, banked
├── spend/ledger.md    every model spend, receipted
├── gates/ACTIVE.md    runnable done-when contracts (+ each lane's, keyed)
├── archive/findings.jsonl  findings · results · open questions · lessons
├── pulse/             instrument readings + auto-run.status (derived)
├── compile/<slug>/    drafted runtimes — ignored by git until ADOPTED
└── START-HERE.md …    the handoff a cold reader can follow

Nothing here is written by the model from memory.
Hooks write the ledgers; scripts grade them.

The skill contract

All thirty-two skills obey the same five-part contract, and the harness grades itself against it.

text version
1. TRIGGER      a /slash verb and plain-language phrases
2. CONTRACT     what goes in, what comes out, what it never does
3. SELF-CHECK   the skill grades its own output before returning
4. FINISH       what it hands to the next skill (chains)
5. EXIT CODES   for scripts: 0 green · 2 usage · 3 not-applicable
                              5 warnings · 6 failures

The harness grades itself against this contract:
`eval` fails any skill missing a part.

Structure is half of it. The next stop runs a single prompt through the whole of it, end to end.