agentleFS
JetBrainsKnown publisherJetBrains/ytdb-slate/AGENTS.md

ytdb-slate

AGENTS.md10 starsChanged 4 days agoApache-2.0View on GitHub

This repo is a pi package. It provides the slate extension for thread-weaving orchestration in pi. The orchestrator dispatches each bounded action to a new worker thread. Results return as compressed episodes. The shipped doctrine uses eleven risk-defined focus areas as workflow triggers. Orchestrator-judged proofs select gates and routine implementation reviewers. A track with at least one proved area gets one general Reviewer I plus its required specialists. An implementer's approximate size above 100 counted lines also adds Reviewer I,…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the full diff before you commit: No tool does this for you.

    line 40
  2. Distinctive:

    Run all five Linux checks before you commit.

    line 141
  3. Very specific:

    Use a temporary home outside the repository.

    line 207
  4. Very specific:

    Run it with bash verification/run-resolver-checks.sh --repo .

    line 252
  5. Distinctive:

    Run both package-content commands:

    line 358
  6. Distinctive:

    Write for a reader whose first language is not English.

    line 423
  7. Distinctive:

    Use plain words that appear in standard libraries and textbooks.

    line 424
  8. Distinctive:

    Use one term for each concept.

    line 430
  9. Distinctive:

    Do not explain an idea with a metaphor.

    line 431
  10. Distinctive:

    Do not invent a term when the project already has one.

    line 432
  11. Very specific:

    Before you edit README.md, read README-GUIDELINES.md.

    line 439
  12. Very specific:

    Keep the pi-bundled SDK packages (@earendil-works/pi-ai, @earendil-works/pi-coding-agent, @earendil-works/pi-tui, typebox) in …

    line 443
  13. Very specific:

    Keep "keywords": ["pi-package"] — it is what lists the package in the pi.dev gallery.

    line 450

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md — ytdb-slate contributor guide

Overview

This repo is a pi package. It provides the slate extension for thread-weaving orchestration in pi. The orchestrator dispatches each bounded action to a new worker thread. Results return as compressed episodes.

The shipped doctrine uses eleven risk-defined focus areas as workflow triggers. Orchestrator-judged proofs select gates and routine implementation reviewers. A track with at least one proved area gets one general Reviewer I plus its required specialists. An implementer's approximate size above 100 counted lines also adds Reviewer I, except on documentation-only tracks. Before implementation, an orchestrator estimate above 100 counted lines requires a high-level design even for documentation-only tracks. Counted lines exclude lockfiles, migration files and generated output. With neither review trigger, a track gets no routine implementation reviewer. Each change uses one branch and one optional draft pull request. Levels group planning only. Root final acceptance follows every required whole-subtree acceptance and precedes merge handoff. Record the accepted final head before handoff and verify the host merged that head before root closure.

Dispatch uses logical-model routing and common recovery. router.models defines provider-free action choices, fixed effort, ratings, guidance, cautions, and exact physical permissions. router.compressor.models is an independent ordered list. Slate resolves one immutable trusted parent-session policy. Dispatch, compression, main recovery, handoff, doctrine, and effective output share it. Reference: docs/model-routing.md.

  • Extension entry point: extension/index.ts
  • Shipped doctrine docs: docs/ — track-workflow.md, review-rules.md, design-principles.md, pr-publishing.md and (since routing shipped) model-routing.md are cited by ABSOLUTE path resolved inside the installed package (extension/paths.ts)
  • Default branch: main
  • Finding tags come from slate's own adversarial reviews. This file uses AD6, and code comments use AD41, RG2 and other tags. Each review round numbers its findings from 1, so one tag can name two different findings. The AD6 in § Packaging rules is not the AD6 of the tier-1 CI review. Only the pull request or the track discussion that raised a finding explains the tag. Every citation in this file therefore states the finding in words, and the tag gives the origin only.

Dogfooding

This repo runs slate on itself:

  • .pi/settings.json carries exactly ONE slate package entry, and that entry is the literal relative path ../../main. pi resolves a project-scope local path against the .pi directory, so the entry names the sibling main worktree of this repository, and a session in this checkout loads the extension source of that worktree. The file holds no npm:ytdb-slate@<version> entry any more, so a session here does NOT run the published release, and there is no dogfood pin to bump at release time. The measured file also lists npm:pi-smart-fetch and npm:pi-web-search, which are unrelated packages. T5 of the load check asserts that exact shape.
  • This checkout supplies .pi/, and the sibling main worktree supplies slate. A plain clone and a CI checkout need no sibling for verification. The project-only extension .pi/extensions/require-main-worktree.ts checks the arrangement at session start in a trusted project started at the checkout root. It checks that main exists, contains the slate entry and package name, shares the resolved Git common directory, and has branch main checked out. It also checks registration of thread and /slate, including both source paths inside the sibling's real path. The first failed worktree condition stops later worktree checks. Registration is always checked. Each failure reports an error and remedy without stopping the session. Starting from the main worktree itself is supported.
  • After the worktree conditions pass, the check queries origin for remote main in the background with git ls-remote. It changes no repository state. It stays silent when local main contains the remote commit. An absent local commit produces a behind warning with an unknown count and pull advice. When local main is an ancestor of a present remote commit, the warning reports the behind count and pull advice. Histories with neither tip containing the other produce a divergence warning. Query errors, authentication failures and time limits produce warnings. Credential prompts and lazy object fetching are disabled. The remote command has a ten-second limit, and each local Git command has a one-second limit. The check stops its child process group on timeout or session shutdown. Process exit also stops live query groups. Awaited startup commands keep pi alive until they finish. Background query commands do not. It discards results after shutdown. Print and JSON modes also receive reports on stderr.
  • The project check does not load from a subdirectory, in an untrusted project, or with --no-extensions. Worker sessions and verification harnesses disable extension discovery, so they do not run it. The check does not prove that slate tools work. It stays outside the published package and the patch-coverage gate. Its unit tests and the typecheck cover it. T5 protects the tracked settings entry in CI and in a plain clone. The manual isolated-load smoke test, pi --no-extensions -e ., checks the explicitly selected worktree, not the sibling arrangement.
  • An edit under main/extension/ IS live in the next session of this checkout, because that directory is what the package entry resolves to. An edit under extension/ of THIS checkout is NOT live, because nothing loads this directory. Put the edit in the sibling worktree and start a new session, or run pi --no-extensions -e . from the root of the worktree that holds the edit.
  • Two older instructions no longer apply. The first said to smoke-test with pi --no-extensions -e . because a pinned npm copy would otherwise load beside your edit and mask a failure. No published copy loads here, so nothing masks it, and the flag now only keeps the session away from your other project packages. The second forbade a local path entry beside the npm pin. That prohibition is inverted now: the local entry is the only slate entry, and a registry entry for slate beside it would create exactly the duplicate load that broke pi startup before. T5 fails on such an entry. T8 used to fail when more than one copy loaded, and T8 is gone. T5 still catches the tracked registry-entry case. A duplicate that escapes T5 surfaces as a dead session: pi reports a tool conflict and exits 1 before the first prompt.
  • Development follows the package's own docs/track-workflow.md, with workflow.draftPRs enabled in .pi/slate.json.
  • pi creates a .pi/settings.json.lock directory in the checkout while it reads the project settings, and then deletes it. A session or a verification run that stops abruptly can leave one lock behind. .gitignore therefore covers .pi/*.lock. You can delete an old lock safely when no session runs. When a session runs, the lock belongs to that session.

Build & verification

  • There is no build step, but there is a typecheck. pi loads raw TypeScript through jiti, and it uses extension/index.ts as it is. No tool compiles the sources before pi runs them. jiti removes the types, and it does not check them. The typecheck is therefore the only check of the types, and it has no other purpose. npm run typecheck runs tsc --noEmit -p tsconfig.json, and it writes no output: no artifact, no dist/ directory, and no input for a later step.

The typecheck also reads verification/markdown-hashes.ts and verification/update-markdown-hashes.ts. The npm test roster includes the Markdown document hash check and its negative fixture tests (§ Markdown document hashes).

The typecheck reads extension/**/*.ts, .pi/extensions/require-main-worktree.ts, test/**/*.ts, verification/probe.ts, verification/ci-canary.ts, verification/worker-reminder-canary.ts and verification/required-case-*.ts. Test imports also bring verification/logical-model-import-check.ts into the checked graph. It skips verification/*.mjs, because that code is JavaScript without type annotations. tsconfig.json sets strict, noUncheckedIndexedAccess, noUncheckedSideEffectImports and erasableSyntaxOnly. The last flag carries a second job beyond type safety: it keeps every source under extension/ executable by Node's native type stripping, which is how the node:test suite imports the shipped modules with no build step (§ Unit tests and the coverage gate). It also sets skipLibCheck: true, and that flag is necessary. Without it, tsc reports more errors, and all of them sit inside third-party .d.ts files under the pi SDK. This repo cannot correct those files. exactOptionalPropertyTypes and noPropertyAccessFromIndexSignature stay off. This repo measured both flags, then deferred the first and rejected the second, and tsconfig.json records the reasons together with the two commands that re-derive the current diagnostics. It records no counts on purpose: the include list moves them, and a recorded count went stale twice, most recently when test/**/*.ts joined the include list. Nobody must repeat that decision without re-measuring. Every flag in the set passes on the current tree. Add a new flag together with its fix. A flag that fails makes the check unreliable, and people then ignore it.

A passing npm run typecheck does NOT make the TypeScript brands (SessionBaseline, OpenModel in extension/logical-model-runtime.ts) tamper-proof: TypeScript permits an assertion to a branded subtype, so someString as OpenModel — the exact shape that reintroduced a shipped defect while the full suite stayed green — still typechecks cleanly. The resolver checks' source scan is therefore load-bearing. It rejects direct and unknown or any two-step named as assertions in every scanned extension source except the exact producer extension/logical-model-runtime.ts. In the bounded consumer extension/threads.ts, it also rejects angle-bracket assertions to either brand and as never. The scan uses syntax only. It does not resolve renamed imports, local or transitive type aliases, type flow, or arbitrary loader forms. The typecheck and source scan cover different failures, and neither makes the brands tamper-proof.

  • Automated verification exists. CI runs five checks on each Linux Node leg, plus narrow macOS and Windows notification-push jobs, on every pull request, on every merge-queue candidate and on a push to main or a branch matching release/[0-9]*. A manual dispatch runs the same jobs. It skips patch coverage loudly because that event carries no change boundary. Each check uses a local command (§ CI). The fifth Linux check is npm test. It runs the node:test suite under test/ and then the patch-coverage gate. That suite unit-tests the modules the tests import (§ Unit tests and the coverage gate). It is also the one check that no longer takes about a second. It dominates CI's wall clock. Additional nets run by hand and are named below. Writing also has a focused correctness suite. verification/writing-check-tests.mjs tests the shipped, dependency-free JavaScript checker in extension/writing-check.mjs. It also tests the turn-outcome helper measureWritingTurn in extension/writing.ts. It does not unit-test the modules that test/ leaves alone. Four tasks stay manual:
    1. Read the full diff before you commit. No tool does this for you.
    2. Run the isolated-load smoke test when you must use an edit that you just made. The command is pi --no-extensions -e . from the root of the worktree that holds the edit, because an ordinary session in this checkout loads the sibling main worktree named by .pi/settings.json and not the directory you are standing in. The load check proves that the extension loads and registers its tools, but it does not prove that the tools work. Exercise tool execution, worker sessions, failover and handoff by hand here. Never run it while the ladder runs — § Verification ladder states what that costs.
    3. Open an INTERACTIVE session to reach the doctrine and the router. A headless pi --no-extensions -e . -p "exit" run exercises extension registration and session_start only, and it never builds the doctrine. slate seeds orchestrator mode only when ctx.mode === "tui" (extension/mode.ts), and before_agent_start returns at once while the mode is off. A headless run therefore reaches neither buildDoctrine nor the getRouter() consultation inside it, and that consultation is the only one in the doctrine. Every smoke test during the work on the routing feature missed both. A release-time accident exposed this gap.

      An automatic interactive session needs a pty. This machine has no script(1), and a small Python pty.fork harness works instead. Use \r as the submit key, and not \n.

      The session JSONL holds no doctrine text. Its entries are session, message, custom, model_change and thinking_level_change, and the system prompt is not one of them. To verify the CONTENT of the doctrine, ask the model to repeat it, and do not grep the transcript. This gap is a smoke-test gap, and it is not a coverage gap. The doctrine-* checks cover the rendering, and the router checks cover the resolution. Only a live session proves that the wiring runs.

    4. Run by hand every net that CI leaves out. The hand-run set is:

      • the verification ladder (§ Verification ladder below).
      • the package-content check and its --self-test (§ Package-content check).
      • the writing checker's correctness suite.
      • the writing checker's scaling gate (§ Writing-checker nets).
      • the writing-reminder integration check (§ Writing-reminder integration check).
      • the worker-reminder integration check (§ Worker-reminder integration check).

      Each section states its own re-run trigger. These hand-run nets stay outside CI. The Release workflow runs them through verification/release-checks.sh. The unit tests and the patch-coverage gate are NOT in this set any more: CI runs them (§ Unit tests and the coverage gate).

CI (.github/workflows/ci.yml)

CI references no secret. Every check uses fabricated inputs and tracked checkout files. The default resolver suite also reads repository Git objects from the original base. A shallow clone without those objects fails. Dependency setup reaches the network for Node, npm dependencies and Linux read-back packages. The checks need no external network. The SSH terminal read-back and portable push checks use IPv4 loopback only. The packaging guards reach no registry, and they pass when npm runs offline.

The checks do NOT prove that no credential reaches a child process. The load check scrubs the child environment by variable-name pattern, and not by a list of permitted variables, so a credential under a name the pattern list does not cover reaches the child. A gate measured AWS_ACCESS_KEY_ID doing exactly that. What holds instead is that a session has nothing to spend a credential on: every session runs with PI_OFFLINE=1, without models.json and without auth.json, and it contacts no provider. The permitted-variable list is the stronger design, and it is deferred.

The checks also touch real pi state, in one read path. The load check runs one pi --version probe with ordinary agent-directory resolution and PI_CODEMODE_MAX_WORKERS unset, and pi creates and removes a settings.json.lock directory beside the REAL user settings file during that probe. The Linux load check and npm test start real pi sessions in CI. Both load-check sessions point PI_CODING_AGENT_DIR at a throwaway empty directory. No session of the load check reads the real user agent directory any more. The mirror of that directory, and the fingerprint that watched it, belonged to T8 and were deleted with it.

The checks write in these places only:

  • The load check, the resolver checks and the unit-test wrapper each make a scratch directory under TMPDIR, outside the checkout. Each harness removes its own directory after a clean run. The load check and unit-test wrapper keep their directories when a check fails, and each prints the path.
  • Unit tests create disposable folders through Node's mkdtemp under os.tmpdir(), outside the checkout. Test teardown removes them.
  • The packaging guards write nothing.
  • The macOS and Windows native cases each leave one uniquely marked notification in the operating system store.
  • pi creates a .pi/settings.json.lock directory inside the checkout, and deletes it again, around each read of the project settings.
  • pi creates and removes a settings.json.lock directory beside the real user settings file during the load check's pi --version probe. That directory is pi's own behaviour and not the harness's, and it moves the modification time of the real agent directory while every entry inside stays byte-identical.

CI is not hermetic beyond that, and it makes no such claim: the install fills the npm cache under HOME, like every other install.

The workflow uses a read-only token (permissions: contents: read). Four events start it: pull_request, merge_group, a push to main or release/[0-9]*, and workflow_dispatch. It never uses pull_request_target. Each Linux job stops after 20 minutes (timeout-minutes: 20). Each macOS and Windows job stops after five minutes. test/delivery-reference-contract.test.ts uses bounded resolver selection for package, heading and forbidden history cases. The workflow pins each third-party action to a commit SHA. The Linux job matrix pins Node 22.23.1 and Node 24.18.0: those are the exact versions on which native TypeScript execution, LCOV, stripTypeScriptTypes, physical-line DA emission, directive matching and the full suite were measured. A floating major would take experimental APIs beyond the evidence silently; an exact pin instead costs a manual re-measurement and workflow edit for every accepted Node patch. pi needs node 22.19.0 or later, and the two pins still exercise both current LTS lines.

The Linux jobs use the version-specific ubuntu-24.04 runner label. They keep the five checks below and the stable names Node 22 and Node 24. The full suite and patch-coverage gate run only on Linux.

The narrow jobs are macOS notification push on macos-15 (arm64) and Windows notification push on windows-2025 (x64). These labels fix the operating-system line, not the image revision. Missing prerequisites fail and no required case skips.

The Windows job also runs test/safe-record-write.test.ts with --test-concurrency=1.

The Linux jobs install dbus, libnotify-bin, python3-dbus-next, openssh-client, openssh-server and tmux with apt-get before the five checks. See verification/README.md § Continuous integration for commands, notification check details and the duty to re-measure the Node structured-event schema.

The five Linux checks follow. Install the Linux read-back prerequisites above and run npm ci --ignore-scripts before reproducing them. Locally, npm test derives a merge-base with main. CI passes an explicit base for pull_request, merge_group and a push with a previous commit. A branch-creation push and workflow_dispatch run the tests without the patch-coverage gate.

checklocal command
typechecknpm run typecheck
packaging guardsbash verification/run-packaging-checks.sh --repo . and bash verification/run-packaging-checks.sh --repo . --self-test
extension load checkbash verification/run-load-check.sh --repo .
pure-resolver checksbash verification/run-resolver-checks.sh --repo . --strict
unit tests + patch coveragenpm test

Keep --ignore-scripts on the install. The pinned pi SDK is a devDependency. Its dependency tree declares two install scripts: @google/genai (preinstall) and protobufjs (postinstall). package-lock.json carries two entries with hasInstallScript, one for each package. The published pi 1.6.0 package has no npm-shrinkwrap.json, so this repository's lockfile fixes its transitive versions. A plain npm ci runs both scripts. CI needs neither script, so the flag prevents their execution. npm creates node_modules/.bin without those scripts, so the pi and tsc launchers remain available.

How the harnesses find pi. Three of the five Linux checks need a pi binary, and all three start with the same two steps:

  1. PI_BIN, when you set it. The harness prints NOTE lines for this case. PI_BIN is an override for an expert user, and it is not a security boundary.
  2. node_modules/.bin/pi in the checkout. The install above creates it, and a CI runner has no other pi.

The three harnesses then differ on purpose. The resolver checks and peer linker accept a pi from PATH as a last choice. The peer linker imports the SDK copies bundled with that pi, so choosing the checkout-local exact pin before PATH is load-bearing: CI has both paths available through npm, and must not silently take another global installation. A PI_BIN override remains explicit and prints a note.

The load check accepts no pi from PATH and requires the same version from pi --version as the @earendil-works/pi-coding-agent pin. pi's rpc output shapes are the evidence for its checks, and a new shape can look like "no events" and pass in silence. The verification ladder keeps its own rule: it needs pi on PATH.

The three Linux CI harnesses (the packaging guards, the load check and the resolver checks) share one exit-code contract:

exit codemeaning
0every check passed
1a check failed
2the harness refused to start: a bad invocation, a missing tool, or a failed precondition

An exit code of 2 gives no verdict for any check, because the harness verified nothing. The build still fails. One case of exit 2 reports a real defect on purpose: the load check refuses to start when the checkout has no extension/index.ts. pi drops a nonexistent entry from pi.extensions in silence, so every check would otherwise pass on an empty session.

The typecheck stands outside this contract. tsc uses its own exit codes. With the pinned TypeScript, a type error gives exit 2. An unknown compiler option, or a missing tsconfig.json, gives exit 1. Read an exit code from tsc as a tsc code, and never as a refusal.

Read the exit code first when a check fails. An exit code of 2 points at the invocation, the environment or a precondition. All three harnesses print the same first words: verification: refused to start — <reason>. The reason names the missing tool, the bad path, the version mismatch or the absent file, and it gives a remedy where one exists. You can therefore grep a CI log for that phrase.

That phrase belongs to the three wrapper scripts. verification/packaging-checks.mjs and verification/resolver-checks.mjs print their own refusal in the form <module>.mjs: … when you run a driver directly. Use the wrapper scripts for that reason.

An exit code of 1 reports a real finding. The CHECK … FAIL — <detail> line explains the failure:

  • typecheck — tsc prints file(line,col): error TS…. Correct the source. A new run costs about 2 seconds.
  • packaging guards — the detail names the manifest field or the shipped path that broke a rule. A failure under --self-test means the opposite: a guard no longer detects its own violating mutation. Correct the guard, and keep the manifest.
  • load check — a failing run that started pi prints the raw rpc streams in its own output. It prints one section for each stream, stderr before stdout, and it cuts each stream at a limit. It also keeps the streams in the scratch directory (artifacts: …), so the evidence survives a CI job that deletes that directory. The detail line summarises those streams, so read the streams first. A pi run must happen before the streams appear, and the identity of the failed check does not matter. A full run that fails the config-syntax check still prints the streams of the earlier pi runs, and only a run with --only T4 prints none.
  • resolver checks — the detail line repeats the expectation that broke, and the harness prints the same sentence for a pass, for example CHECK memoization FAIL — createWorkerExtensionResolver walks the registry exactly once across repeated calls. An observed: line under it gives the value that the check saw, for example observed: {"walked":3}. The harness removes its fixtures on exit, but the pipeline is pure and deterministic. Read the body of that check in verification/resolver-checks.mjs, then run the harness again.

A NOT RUN from the ladder is neither a pass nor a fail. verification/README.md holds the table of the action for each one.

The full unit tests dominate the Linux CI set, and the load check is the slowest of the other Linux checks. One machine gave these times on 2026-09-04, and each one is a single measurement and not a speed promise:

checktime
typecheck2.5 s
packaging guards, each pass0.4 s
extension load check2.6 s (it starts three real pi processes: two rpc sessions and one pi --version pin probe)
pure-resolver checks1.1 s

Run all five Linux checks before you commit. After changing a narrow job or its tests, run its command directly on the target operating system when available.

Re-run obligations. The two sections below use the same form:

  • Run the packaging guards again after a change to a packaging-relevant manifest field. Those fields are the files whitelist, peerDependencies, dependencies, keywords, scripts and pi.changelogPath. Run both packaging modes after a change to root CHANGELOG.md too. Run them again also after you add, move or delete a file under extension/ or docs/. The pack layer asserts the real file list from npm pack, and not the manifest. The guard asserts the files whitelist by exact equality, so a deliberate change to the whitelist must update FILES_EXACT in verification/packaging-checks.mjs in the same commit. Run --self-test too: it runs every guard against the real input with one violating mutation, and it requires a failure.
  • Run the load check again after a change to extension loading, to tool or command registration, or to session_start. Run it again also after a change to the .pi/slate.json or the .pi/settings.json of this checkout. Run it again after a change to the shared package-resolution helpers, to the T5 assertion, or to the redaction paths. The sibling-worktree triggers are gone with T6, T7 and T8: a change to the sibling target, to its manifest, to a declared entry point, to the worktree layout, to a user-scope settings entry or to either automatically discovered extensions directory no longer moves any result here. That set of triggers is the set verification/README.md carries under its check table, and the two must agree. Those failure modes have no other signal (see § How extension-load failures surface). A check of its own reads the config file directly from disk, because slate drops an unparseable file in silence. The load check answers two conditions with exit 2 instead of a FAIL report:
    • A checkout without extension/index.ts stops the run. pi drops a nonexistent entry from pi.extensions in silence, and every check then passes on an empty session. A checkout without verification/ci-canary.ts stops the run for the same reason.
    • A mismatch between the pin and the installed pi stops the run. The message carries the remedy run 'npm ci --ignore-scripts', which is the install that CI runs. The rpc output shapes hold for one pi version only.
  • The verification ladder stays outside CI on purpose (issue #24). It takes about 3 minutes, and most of that time is wall-clock wait in timing-sensitive rungs. It needs GNU coreutils, and it refuses to run as root. On a slow machine, or on a machine without the optional tools, it reports NOT RUN instead of PASS. A required check with that behaviour gives unreliable results, so the ladder stays a check for a person to read. Run it as § Verification ladder describes.

How extension-load failures surface (pi 1.6.0)

The lists below describe extension-load behavior in pinned pi 1.6.0. Check both the exit code and the diagnostic channels.

pi reports each failure below on stderr with Error: Failed to load extension "<path>": <detail>. Each failure exits 1.

  • a syntax error;
  • a broken import that the module uses;
  • a throw at the top level or inside the factory function;
  • a module without a default export;
  • -e <path> for a path that does not exist, with the detail Extension path does not exist;
  • -e <dir> for a directory that resolves to no module at all, with the detail Cannot find module '<dir>'. Such a directory has no pi.extensions, no main and no index.*.

A directory can load without a pi field or a package.json file. A bare index.ts is enough when the directory resolves. For each load failure above, both the exit code and the diagnostic string identify failure.

The following failures leave the exit code at 0. Their diagnostic channels differ.

  • An entry in the pi.extensions list of a package points at a file that does not exist. pi drops the entry without a word, and it starts with no extension. A real install has this shape, so this case matters most.
  • A hook for session_start throws. RPC mode emits an extension_error event on stdout. Text mode prints Extension error (<path>): <msg> on stderr. Both modes exit 0 when the remaining invocation succeeds. Neither diagnostic matches Failed to load extension.
  • A tool registration disappears. pi prints no diagnostic for the missing registration: it exits 0, its stderr equals the stderr of a clean run, and the /slate command still works.

verification/run-load-check.sh holds all of this knowledge, so you do not have to remember it. L1 reads the exit code. L2 reads both stderr markers. L3 reads the extension_error channel on stdout. L4 and L5 read the registered tool set through the positive control in verification/ci-canary.ts. L6 reads which copy of slate pi loaded. T1 through T5 add the trusted path and the tracked package entry. Take the current identifier set from bash verification/run-load-check.sh --repo . --list-checks and not from this file. A measured run of that command printed 13 identifiers, and a measured clean full run printed 14 result lines, because the roster audit reports one line of its own and is not selectable.

A pipeline hides the exit code of a process, and that trap probably produced the wrong claim. $? after a pipeline gives the status of the last command, and not the status of the piped process. A broken extension shows the difference. A direct run of pi exits 1. The same run as pi … 2>&1 | head -1 gives a $? of 0, while ${PIPESTATUS[0]} for that pipeline is still 1, and set -o pipefail makes the pipeline exit 1. Read a real exit code in one of three ways: use no pipe, read ${PIPESTATUS[0]}, or run set -o pipefail first. Every script in verification/ runs set -o pipefail.

Run the typecheck after ANY TypeScript change. That trigger is wide on purpose, and the deep nets below use a narrow trigger instead. The run takes about 2 seconds, and it checks every file that it covers in one pass. Spend no time on a decision about the type relevance of your edit.

The silent-failure nets are the ladder, pure-resolver checks, packaging guards, extension-load check, unit tests with the patch-coverage gate, and package-content check. They also include both writing-checker nets, the writing-reminder integration check and the worker-reminder integration check. The sections below define their scope.

This inventory intentionally has no total. Earlier totals went stale twice. Add each new net to this inventory when you add it.

The typecheck is NOT one of these nets. It sees shapes, while each listed mechanism can fail with correct types. Run every net that covers a shared change. For example, extension/writing-check.mjs implicates its correctness suite, scaling gate and the resolver suite's writing-* families.

failover.ts, episodes.ts, worker.ts and the router use the model-spec helpers in extension/state.ts. failover.ts and handoff.ts drive extension/base-model.ts and are the protected main-session switch sites in the ladder. Changes to either module require both nets. project-model-startup.ts switches before the tracker seed and uses no global-settings guard.

Verification ladder (global model defaults across slate's model switches)

verification/run-ladder.sh is the deepest regression net in this repo. It is not the only net. § CI names the five Linux checks and the two narrow jobs that run on every pull request. The sections below add the package-content check, the writing checker's two nets and the writing-reminder integration check. The ladder is the only net that touches the global model-default machinery. It covers:

  • extension/model-default.ts and its protected main-session switch sites (extension/failover.ts failover, extension/handoff.ts handoff adoption): pi 1.6.0 production setters must write zero global-settings bytes. A test-only persist:true fixture keeps the compatibility restore, per-key rule, untrustworthy-read stand-downs, retry budget and reporting channels under test.
  • extension/worker.ts's worker-session settings isolation, in rung WK1: a worker-side per-dispatch model AND effort switch — what every routed action performs — writes zero bytes to the global settings file and does not survive into a reopened session as a sticky default. A file-backed control uses explicit persistence to prove the read-only worker settings boundary has teeth. It is the only automated net for that guarantee, and the only rung that opens a worker session at all.

The third main-session switch site is extension/project-model-startup.ts. It applies the private project model without the global-settings guard. Unit tests cover the plain setters and startup order. A recorded interactive run covers the switch and the global settings file. No ladder rung exercises this site.

Everything in the ladder runs against fake offline providers in a throwaway agent directory, so real pi settings are never touched (the run fails if the real file changes).

RUN THE LADDER ALONE. Any other pi process that shares the real agent directory can make its SAFE check lie. A process redirected to another directory through PI_CODING_AGENT_DIR cannot touch the watched file, but the harness refuses an inherited value because it must own that redirect. The final SAFE check compares the REAL ~/.pi/agent/settings.json before and after the run, and it compares size and mtime as well as the hash. It therefore reports SAFE FAIL — REAL SETTINGS FILE CHANGED when a pi you started yourself — the isolated-load smoke test of manual task 2, an interactive session, or a dogfooding session in another terminal — rewrites that file mid-run. Measured shape of the false alarm: an identical hash and size with only the mtime moved, under a summary that reads 26 pass, 1 fail. Read the hash first. Equal hashes mean only that the bytes did not change. They do not identify the writer: an escaped child can rewrite identical bytes too. Stop every other pi that shares the real agent directory and rerun the ladder, because a SAFE FAIL voids every rung above it and cannot be dispositioned by argument. Sequence the two nets. Never overlap them.

Running the ladder beside an active pi session

The harness computes the watched settings file from node os.homedir() as <home>/.pi/agent/settings.json, unless SLATE_LADDER_REAL_AGENT_DIR names another agent directory (verification/run-ladder.sh, safety guards). It refuses to start when PI_CODING_AGENT_DIR exists in the environment, including an empty value, because the harness must own that variable (verification/run-ladder.sh, Guard 1).

The harness creates a throwaway <lab>/agent directory and assigns it to AGENT (verification/run-ladder.sh, labdir calls). Every child pi launch sets PI_CODING_AGENT_DIR to a validated throwaway agent directory (verification/run-ladder.sh, pi execution helpers). A child that ignores that redirect writes under the run process home directory when pi resolves its agent path through os.homedir(). An isolated home therefore keeps escape detection intact (verification/README.md § Safety model).

A run can therefore overlap another pi session using the real home directory when the run uses an isolated home. That session cannot change the watched file in the isolated home. The isolation is not an operating system sandbox. A process using a hard-coded path instead of the home directory could still escape detection (verification/README.md § What the guards do NOT cover).

Use a temporary home outside the repository. Create its agent directory and a settings file before the run. Keep PI_CODING_AGENT_DIR removed, and preserve a PATH containing every required tool. Prepend the repository's node_modules/.bin directory so the pinned pi resolves first:

tmp_home=$(mktemp -d /tmp/slate-ladder-home.XXXXXX)
mkdir -p "$tmp_home/.pi/agent"
printf '{}' > "$tmp_home/.pi/agent/settings.json"
env -u PI_CODING_AGENT_DIR -u SLATE_LADDER_REAL_AGENT_DIR HOME="$tmp_home" \
  PATH="$PWD/node_modules/.bin:$PATH" bash verification/run-ladder.sh --repo . --strict

The harness takes pi from the search path. The search path can provide a different version than the version pinned in package.json. A wrong version can produce many rung failures that look like code regressions. On 2026-08-31, pi 0.84.4 from the search path made branch main report 10 pass, 15 fail and 2 not run. The pinned pi 0.83.0 from node_modules/.bin made the same branch report 26 pass, 0 fail and 0 not run. The same failing set appeared on a feature branch and produced a false regression report.

Record pi --version with the run. The ladder requires pi on PATH and has no version-drift guard (verification/README.md § Requirements and hard constraints). Compare that version with the exact @earendil-works/pi-coding-agent devDependency pin in package.json. If the isolated run fails, run the same ladder on branch main with the same isolated-home setup, command shape and pi version. Treat a failure as a current-branch regression only after that comparison. The final safety verdict is based on the before-and-after watched-file fingerprint (verification/run-ladder.sh, Guard 4 and its second half).

  • Run it with bash verification/run-ladder.sh --repo . (~3 min; --only <ids> for a subset). Not as root, and needs GNU coreutils. Exit 0 means nothing failed and the real settings file is unchanged — rungs can still report NOT RUN, so read the lines; automation should pass --strict, which makes any NOT RUN fatal.
  • Re-run it after any change to extension/model-default.ts or to a main-session switch site (failover, handoff adoption, or private project model application), and after any change to how a worker session is opened or switched — extension/worker.ts's settings manager, the model/thinkingLevel options it passes to createAgentSession, or the per-dispatch switch in threads.ts's applyRoute (WK1). A switch can succeed while it changes the user's global Pi settings. A smoke test that only observes the switch does not check those settings. Also repeat the private project model interactive check after a change to private project model application or its startup order. Details, rung table and the timing-sensitive rungs: verification/README.md.

Pure-resolver checks

verification/run-resolver-checks.sh tests pure production pipelines with fabricated in-memory inputs and tracked files. The default suite also reads repository Git objects from the original base. A shallow clone without those objects fails. It starts no Pi session and uses no network. The closed roster includes these current areas:

  • worker-extension selection, load units, barriers, collisions, and doctrine rendering
  • logical-model definitions, configuration resolution, runtime activation, exact reviewed imports, fixed effort, recovery planning, and effective output
  • logical doctrine trust, sanitation, numbering, exact portable render sizes, runtime rejection boundaries, and whole-doctrine growth controls
  • state snapshot sanitation, episode headers, base-model reduction, writing policy, writing reminders, worker reminders, and workflow contracts

The logical import check parses TypeScript and JavaScript module references. It requires the exact reviewed active edge roster for recognized static imports, exports, import-equals declarations, dynamic imports, and direct require calls. It does not recognize arbitrary loader forms. Its brand-cast check rejects direct and unknown or any two-step named as assertions in every scanned extension source except extension/logical-model-runtime.ts. In extension/threads.ts, it also rejects angle-bracket assertions to either protected brand and as never. The syntax-only scan does not resolve renamed imports, local or transitive type aliases, or type flow. A passing typecheck cannot replace this bounded source scan, and the scan does not make the brands tamper-proof.

Run it with bash verification/run-resolver-checks.sh --repo . --strict. Exit 0 means every check passed. Exit 1 means a check failed or disappeared. Exit 2 means the wrapper refused to start. --only <id,id> selects one or more of contract-delivery-packages, contract-heading-regions and contract-review-history. Selection skips unrelated checks and their conditional imports. The driver still loads its static imports, and the wrapper still runs its common prerequisite checks. The driver owns the selectable list. Unknown, empty, duplicate or repeated selection, roster, and any combination with --exclude refuse with exit 2. Heading selection audits all independent heading-policy identities. History selection shares the full escalation check's history assertion and audits all 17 review-history identities. Package selection audits an empty mutation scope. Missing, duplicate, incomplete, outside-family or crashed mutation execution fails the scoped audit. The separate selected roster rejects missing, duplicate, unexpected or NOT RUN reports even without --strict. A selected pass proves only its requested checks and scoped accounting. Accepted selected delivery-reference cases prove target acceptance, not whole-suite acceptance. Compliant history cases require acceptance by every non-excluded check. The clean comparisons match selected verdicts and mutation counts against the clean run with the two original-base checks excluded. Re-run the resolver suite after a change to any covered production module, doctrine source, workflow contract, import edge, or published budget figure. verification/README.md records the fixture basis and check families.

Doctrine size uses portable characters. The check removes each installed docs/ directory prefix and keeps each filename. Canonical measured baselines must retain five-percent reserve. The separate runtime controls accept exactly 19,400 characters and 105 lines, reject 19,401 and 106, and use the measured 26,300 whole-doctrine ceiling. A valid logical policy with an enlarged supported worker-tool roster supplies the over-cap counterfactual.

The suite loads the six active logical-model-* modules, mode.ts, paths.ts, worker-extensions.ts, state.ts, base-model.ts, episodes.ts, writing and reminder modules, worker.ts, and threads.ts. Re-run the ladder as well after changes to shared model-switch, handoff, worker-session, or saved-default behavior.

Writing-reminder integration check

bash verification/run-writing-reminder-check.sh --repo . starts three real pi sessions against a deterministic in-process fake provider. The main scenario proves the finding trigger and four-turn cadence. The trigger-off and findings-off scenarios prove that cadence remains active when the trigger or findings section is disabled. Session JSONL must persist hidden custom messages with display: false. Tool results must equal the exact one-block content shape.

The harness requires node, mktemp, GNU timeout, mkdir, rm, date, env, cat, tr and sed. GNU timeout supplies the required --kill-after option. The selected pi CLI must match the exact devDependency pin.

The harness resolves every scratch path physically and rejects a scratch root inside the checkout. It creates a trusted project, agent directory, home and temp directory under that root. The child starts through env -i. Only explicit throwaway values, a minimal PATH, dead proxy settings and canary paths cross the boundary.

PI_OFFLINE=1 keeps pi startup offline. The fake provider performs no network operation. This is not a network sandbox because reviewed extension code can still open raw sockets.

The canary uses a 1,000,000-token model window and reports 25,001 input tokens on its first provider call. The controller paces prompts from the RPC agent_settled event instead of using a fixed delay. The three project configs set remindTurns: 4 and vary remindOnFinding and findings. The main scenario proves the immediate finding reminder and the later cadence reminder. The two switch scenarios prove that the four-turn cadence still fires.

The pi phase is about one second on the reference machine. The wrapper's observed wall clock is around two seconds. These figures describe one machine, not a speed promise. GNU timeout sends TERM after 60 seconds and KILL five seconds later.

Exit 0 means every assertion passed. Exit 1 means a check failed. Exit 2 means the harness refused to start. A failed run keeps its scratch directory and inlines pi stderr and stdout. A clean run removes the directory.

This net is outside CI, the load check and the ladder. It proves the real hook, steer, next-turn, provider and persistence paths. It proves display: false structurally, not visual TUI invisibility. Check that presentation manually.

See the writing-reminder integration re-run rules.

A change to extension/handoff.ts still requires the full ladder. Run the pure-resolver checks for reminder policy, config, mode, doctrine or ordering changes.

Worker-reminder integration check

bash verification/run-worker-reminder-check.sh --repo . starts isolated real offline Pi sessions against a deterministic in-process provider. The orchestrator calls the real thread tool. Workers use built-in reads, including independent reads in one turn. The provider context must receive the expected exact hidden reminders. The worker transcript must retain the expected tool results and hidden reminder records with display: false. The compressor request and durable episode must contain no automatic reminder. Successful delivery must not produce a reminder-miss warning.

The normal cases keep workerExtensions empty and set cacheKeyEnabled to false. They prove that the internal component loads across those two boundaries. Matched cases compare tools-only and combined reminders. Other cases exercise the default cadence with the setting omitted, both steering modes, construction rejection, threshold compaction, recovery, and independent model and compaction-handler follow-ups. The harness audits the expected check roster for each case. It exits 0 when every assertion passes, 1 when a check fails, 2 when it refuses to start and 130 when it handles cancellation. A clean case removes its disposable scratch directory. A failed case keeps it and prints the path.

This net is outside CI, the load check and the ladder. It proves matched worker paths through the loader, tool-result hook, steer queue, provider context, JSON Lines persistence and episode filtering. It proves that successful delivery produces no false reminder-miss warning. A single clean run cannot prove that a real missing reminder produces the warning. The pure worker-reminder-detection and worker-reminder-wiring checks, plus test/single-action-threads.test.ts, prove the current rule. The rule reports a miss only when session-local handler evidence exists, the retained action slice has no message with role custom and custom type slate-worker-reminder, and no successful compaction invalidated that slice. The warning check does not compare the text or display flag. The integration harness checks both. Aborted compaction and a compaction event without a result do not suppress the warning. A real reminder loss during a successful compaction inside the same action is not reported. The project accepts this blind spot because the retained action slice no longer supports a conclusion about delivery. The integration run proves display: false structurally. It does not prove visual invisibility in the terminal user interface. Check that presentation manually. It does not prove concurrent worker-session isolation. The pure worker-reminder-state check covers two interleaved factory instances.

Re-run it after these changes:

  • Reminder type, text, factory state, hook registration, message shape or detection in extension/worker-reminder.ts.
  • Worker reminder construction, session settings, factory loading or loader-error reporting in extension/worker.ts.
  • Configuration source merging or permission checks for worker writing in extension/config.ts.
  • Completed-turn input, observation capture, action-slice detection, warning delivery or compression filtering in extension/threads.ts.
  • Shared writing forms or cadence validation in extension/writing-reminder.ts or extension/writing.ts.
  • Custom-message or steer semantics.
  • verification/run-worker-reminder-check.sh or verification/worker-reminder-canary.ts.
  • The pi pin, RPC shape, provider-evidence shape or JSON Lines shape.

Package-content check (package-resolved runtime files)

Run both package-content commands:

  • node verification/package-content-check.mjs --repo .
  • node verification/package-content-check.mjs --repo . --self-test

The normal check runs npm pack --dry-run --json --ignore-scripts. It derives every exported extension command and document path from extension/paths.ts. It recursively enumerates every Markdown file under docs/. It also recursively enumerates .mjs files under extension/ whose first line is exactly #!/usr/bin/env node.

That shebang is the runtime-command criterion. Helpers without it need no command export. Every document and command needs exactly one export. Every exported runtime path must appear in the publish set. The check also validates named path imports in extension/mode.ts.

The self-test uses temporary fixtures outside the checkout. It proves recursive nested-command discovery, helper exclusion, and the three required missing-roster findings. Isolated subprocesses prove help works without TypeScript and real analysis refuses missing TypeScript with exit 2. Exit 0 means all checks passed. Exit 1 means a real roster mismatch, missing packed runtime file, or escaped mutation. Exit 2 means a bad invocation, unavailable tool, parse failure, or failed precondition.

  • Re-run both commands after adding, moving or deleting a Markdown file under docs/. Run both after adding, moving or deleting a shebang-bearing .mjs command anywhere under extension/. The same rule covers runtime path exports. Run both after a package.json files-whitelist change. Run both after a path import change in extension/mode.ts, and before release.
  • The check covers package presence and roster completeness only. The resolver suite still covers doctrine content and rendering.
  • It overlaps the CI packaging guards. The overlap is not yet consolidated. Both read the file list from npm pack --dry-run. Both require doctrine documents to ship. The package-content check derives the complete Markdown roster and recursive shebang-command roster independently, then requires matching exports. pack-doctrine-docs scans extension/*.ts for document joins instead. The package-content check is also the only net that requires each shipped runtime command by roster. Merging the nets is reasonable future work. Until then, run both and both self-tests.

Writing-checker nets (correctness suite + scaling gate)

extension/writing-check.mjs is the shipped writing checker and the only module with two nets of its own. It has them because it is called from a HOT path: extension/mode.ts's message_end hook runs it synchronously on the completed assistant message, so its wall clock is the TUI's. WRITING_TURN_MAX_BYTES (16 KiB of assistant text, in mode.ts) is what keeps a pathological input away from that hook — the command's own cap is 1 MiB, 64 times the hook's cap, and only the command can reach it.

  • node verification/writing-check-tests.mjs — CORRECTNESS: the rules, source offsets (BG2), the caps, report and file-input safety, command modes, the five hand-written scanners against the regexes they replaced, and extension/writing.ts's turn outcomes. Under 1 s, machine-independent. Exit 1 on any failure. It is fail-soft (one failure does not hide the rest) and ends with a roster audit against an EXPECTED list, so a deleted, duplicated or crashed test cannot exit 0. Any test added, renamed or removed must update EXPECTED. Its test count and test numbers are the run's business and are deliberately NOT transcribed here or in verification/README.md: both were, and both went stale.
  • node verification/writing-check-scaling.mjs — GROWTH: nothing in that module may grow faster than linearly. ~18 s, wall-clock. It is a separate file on purpose, so a timing assertion never makes the correctness suite read as machine-dependent.
  • Re-run BOTH after any change to extension/writing-check.mjs, and the scaling gate in particular after adding or editing a REGEX, which is the change that reintroduces the class. Re-run the correctness suite and pure-resolver checks after a change to extension/writing.ts. Three reviews found six superlinear paths in the checker while every correctness net stayed green — the findings were right and the module was slow, which is precisely the failure a correctness suite cannot see. The gate's roster refuses an unclassified new regex literal by name, and its canary fails if the thresholds stop discriminating.

Unit tests and the coverage gate

npm test runs verification/run-tests.sh: it runs verification/link-peers.sh, then partitions the discovered node:test roster into a native TypeScript process and a separate mandatory real-Pi host process, then runs the patch-coverage gate in verification/coverage-gate.mjs. The host process contains only test/recovery-ownership-host.test.ts. It has an independent temporary directory and Jiti cache, and it writes separate host LCOV. It receives no patch-coverage credit. The native LCOV remains the only gate input. Jiti-loaded code gets no patch-coverage credit because its byte offsets do not match the TypeScript source. In the native test process, each launch site that loads extension code through jiti must disable coverage collection. Set an own NODE_V8_COVERAGE child-environment key to undefined, or unset the variable in the shell. Otherwise, jiti records overwrite native line counts. The host process collects jiti coverage in its separate host LCOV, which gets no patch-coverage credit. Native child processes keep coverage unless a test excludes it. The runner requires a disjoint, exhaustive roster, and either process can fail the run. It needs node, git and a pi. The linker resolves PI_BIN, then the exact-pinned node_modules/.bin/pi, then PATH, and deliberately refuses to start without one.

CI runs this net on both exact-pinned Linux Node legs. The checkout uses fetch-depth: 0, because the gate measures a COMMITTED <base>..HEAD diff and the default resolver suite reads original-base repository Git objects. A shallow clone without those objects fails. The base is event-specific and explicit. pull_request.base.sha against GitHub's synthetic PR merge commit measures that PR candidate. merge_group.base_sha against the queue's synthetic head measures the queued candidate. github.event.before against a push head measures that push to main or a release branch. A branch-creation push has no base and runs the tests without patch coverage with a visible warning.

A missing, all-zero, absent or HEAD-equal base exits 2. workflow_dispatch has no event change boundary. It runs the tests with --no-gate and emits a GitHub warning plus a job-summary section. It does not invent a diff or pass silently.

CI keeps a WARN green but makes it prominent. The gate enforces a fixed 70% branch floor for 1–19 changed branches and the configured branch floor (85% by default) at 20 or more. Zero changed branches, zero line records, and uncommitted in-scope files produce WARN with exit 0 and require manual disposition. For WARN, the test step keeps exit 0, emits a GitHub warning annotation, and copies the OVERALL/WARN/VERDICT lines into the job summary with the instruction to record a manual disposition on the pull request. A green check is not that disposition.

  • The harness adds no publish payload. It uses Node built-ins, shell, git, the SDK bundled with pi, and exact-pinned tooling devDependencies. TypeScript has four direct uses: npm run typecheck, the coverage gate's executable-line classifier, package-content analysis, and the logical-model import-syntax check. The direct marked dependency has one use: Markdown block parsing in the assigned-forms rule checks. Its exact pin matches the version the pi SDK installs. test/, verification/ and tsconfig.json stay outside the files whitelist (§ Packaging rules), so no part of this reaches a consumer install.
  • Native execution depends on an ERASABLE-SYNTAX invariant, and the compiler enforces it. There is still no build step: stable native type stripping lets Node execute the TypeScript tests and every extension module they import directly, but it handles erasable syntax only. Constructor parameter properties are not erasable and were the single construct that would have forced --experimental-transform-types; this change replaced them in extension/state.ts and extension/threads.ts with explicit fields. Keep erasableSyntaxOnly: true: npm run typecheck now rejects a parameter property ANYWHERE under extension/, including in a module no test imports. Without that compiler guard, such a module passes both the typecheck and the tests, then throws when a real pi session loads it. (--experimental-test-coverage stays isolated in the wrapper, because Node's native LCOV API is separately still experimental.)
  • The two SDK import mechanisms have different jobs. The ordinary path is link-peers.sh above: it resolves pi's own bundled copy of every declared SDK peer, replaces any installed package or stale link at the local target, symlinks the pi copies into node_modules, and verifies every resulting target. That is zero stub code, it keeps coverage clean, and it tests against the SDK the installed pi runs. Treat the alternate verification/test-hooks.mjs, verification/test-resolve-hooks.mjs and verification/stubs/*.mjs path as INTENTIONALLY DORMANT scaffolding until a test invocation activates it with --import ./verification/test-hooks.mjs; the absence of that preload is not evidence that the scaffold is dead. A test that must CONTROL SDK behaviour, scripted failure injection for example, uses the preload so module.register() maps peer imports to the mutable local stubs.
  • The default floors are 85% LINE and 85% BRANCH patch coverage at 20 or more changed branches, with a fixed 70% BRANCH floor for 1–19 changed branches. Coverage is measured on the committed <base>..HEAD diff rather than on the repository. Line and branch floors are independent. This is a FLOOR, not a target; the wrapper prints the configured floors and the gate prints the live numerators, denominators and percentages on every run. Branch coverage is the load-bearing metric for concurrency work, because the defects at issue are untaken paths — a waiter never woken, a join that throws, an abort arriving mid-flight — which line coverage does not distinguish. Coverage is not evidence by itself: a test that calls a function and asserts nothing can execute every measured path and still be worth nothing. A test earns its place only if it fails when the behaviour regresses.
  • Executable-line classification is SOURCE-authoritative; LCOV is coverage evidence only. Node emits a DA record for EVERY physical line of a loaded file, including blanks, comments, JSDoc, interfaces, type-only imports and overload signatures, while a coverage-disable region can remove DA from genuinely executable code. DA presence therefore does not prove executability, and DA absence does not disprove it: source decides whether an added line is COUNTED, and LCOV decides whether that counted line is COVERED. The gate erases types with stripTypeScriptTypes, then classifies the stripped JavaScript with the exact-pinned TypeScript parser (ts.createSourceFile(..., ScriptKind.JS)) and a JSDoc-excluding leaf-token walk. The repo owns NO bespoke string/template/regex lexer; preserve that invariant, because the deleted lexer produced repeated defects in consecutive fixes. Type erasure remains REQUIRED rather than subsumed by the AST: the raw TypeScript AST was measured to over-include type-only lines and inflate the denominator.
  • Classifier uncertainty fails closed by forcing ZERO hits. A missing typescript devDependency is a guarded infrastructure error and exits 2; non-erasable syntax rejected by stripTypeScriptTypes also exits 2; a parser diagnostic or a classifier exception marks the file void, counts every added line, and assigns each one zero hits. erasableSyntaxOnly is therefore a shared boundary for native test execution AND for gate classification, not merely a test-runner convenience. Do not replace the last rule with “assume executable and use DA”: covered comments commonly carry positive DA hits, so that intuitive fallback has already produced a false PASS. One known boundary remains: a .d.ts file using export = hard-exits 2 instead of being classified as non-executable; no such file exists in this repo. The TypeScript parser roughly doubles gate runtime and raises peak memory, an accepted dev-tooling cost; re-measure it by running the same gate command with the same refs and fresh LCOV under /usr/bin/time -v on the revisions being compared, not by recording a duration here.
  • Branch floors depend on the changed-branch denominator. For 1–19 changed branches, the gate enforces a fixed 70% floor with no small-denominator warning. Counts of 1–3 therefore require full branch coverage. At 20 or more it enforces the configured branch floor, which defaults to 85%. Zero changed branches produce WARN, never automatic PASS. Zero line records and uncommitted in-scope files also produce WARN. The gate always prints both denominators and both branch floors with the 20-branch boundary. A WARN is not acceptance: inspect the changed paths and denominators, record the manual disposition (including why a zero denominator or an incomplete committed range is adequate), add tests for any unjustified uncovered or unmeasured path, and do not report PASS. run-tests.sh preserves the distinction as RUN VERDICT: WARN even though WARN exits 0.
  • Locally the base is a merge-base with your main REF, so a stale ref silently changes the numbers. run-tests.sh prefers refs/heads/main, then origin/main. A local main left behind while the remote moved therefore makes the diff include every commit that landed on main since, and the gate then measures other people's code against this suite: a real run in that state reported a 276-line denominator and VERDICT: FAIL for a change whose own denominator is 23. Nothing is wrong with the gate when that happens. Fetch and fast-forward main, or pass --base <sha> explicitly, which is what CI always does.
  • The gate sees committed changes only. Uncommitted in-scope files are invisible to its <base>..HEAD coverage numbers; WORKTREE WARNING makes that omission visible but cannot measure the work. Commit the change, rerun npm test, and disposition any remaining WARN by hand. At the LCOV boundary the gate fails closed per changed file: no usable line records make every added line uncovered and add a synthetic uncovered branch; if a recorded file has an added line missing or uncovered and no changed-line BRDA records, it adds the synthetic branch rather than letting the LCOV gap disappear. A nonempty diff that parses to zero files is an internal ERROR, never an empty PASS.
  • Treat BRDA as execution-dependent, not as a static branch inventory. Optional chaining, && short-circuits and destructuring defaults do not appear as uncovered branches until the alternate path actually executes, so weak tests can produce a SMALLER denominator and a better-looking percentage. Always regenerate LCOV from a real full run; never trust a static branch inventory.
  • Coverage-DIRECTIVE matching is a separate boundary: do not make that scanner cleverer than Node. Node v22.23.1 and v24.18.0 define byte-identical coverage directives with kIgnoreRegex and kStatusRegex in lib/internal/test_runner/coverage.js lines 43 and 46, then applies them directly to each RAW source line at lines 113 and 122. Both regexes are unanchored, case-sensitive, exact-spacing, block-comment-shaped matches with NO lexical analysis. Consequently a matching substring inside a string or template literal IS honoured; // node:coverage ... syntax is NEVER honoured, whether line-leading or trailing; and changed case (DISABLE) or doubled spacing is inert. The gate copies those regexes VERBATIM and deliberately does not normalize, parse or broaden them. That rule governs directive recognition only; delegating executable-line classification to TypeScript's parser removes bespoke cleverness rather than violating it. Any directive-regex divergence is a defect in either direction: under-matching hides coverage, and over-matching rejects legitimate inert text. The gate adds one policy after the verbatim match: every matching substring on an added line fails unless text AFTER it on that SAME line carries an explicit reason, because or rationale label followed by :, = or - and a substantive value. This is self-referential: an exact block-shaped directive substring on a newly added fixture, comment or explanatory string is itself caught, even when it merely describes the pattern, so its line also needs the trailing reason annotation. The wrapper's central include/exclude policy remains the sanctioned exclusion mechanism, because it is auditable in one place; inline directives are the most gameable form.
  • The gate has its own regression net. test/coverage-gate.test.ts exercises diff grammar, malformed and foreign LCOV, source classification, threshold boundaries, fail-closed behaviour, directive reasons and WARN propagation through the wrapper. Run npm test after ANY change to verification/coverage-gate.mjs or verification/run-tests.sh. This is load-bearing quality control for every other test: manual review found false-PASS defects in the gate that no other check would have caught, so a gate change without its fixture family can invalidate all downstream coverage claims while still printing success.
  • Waiter tests require an explicit timeout. node:test has no default timeout. Every test that awaits an operation which might never resolve must carry one, following the timeout option on the waiter test in test/thread-manager.test.ts; read that test for the maintained value instead of copying it here. Deadlocks and missed wakeups are exactly the defects that concurrency work targets; without the timeout they HANG the suite instead of failing it.
  • Run npm test after ANY change under extension/ or test/. Do not transcribe suite size or cost here: run-tests.sh prints the discovered test-file count, and Node's summary prints the current test count and duration on every run.

Markdown document hashes

npm test checks every Markdown document in the Git index against a stored SHA-256 digest. The check reads current file bytes and converts CRLF to LF before hashing. Untracked files do not count. The central file is verification/markdown-hashes.txt, sorted by path with one blank line between entries. The tools run from the repository root.

Before updating a changed document's hash, run git log --follow -p -- <path> and git log --merges --follow -- <path>. Find the commits and merges that changed the document. Inspect each merge against both parents with git diff <merge>^1 <merge> -- <path> and git diff <merge>^2 <merge> -- <path>. Check that each merge kept the document logically consistent. Fix merge errors before updating its hash. A hash update without this investigation is forbidden. A matching hash does not prove semantic consistency.

After investigation and repairs, run node verification/update-markdown-hashes.ts <path> [<path> ...]. Name each document explicitly. There is no update-all option. For a new document, investigate its available history, review its content, run git add -- <path>, then run the update command for that path. Commit the document and hash entry together. For a deleted document, remove it from the Git index and disk, then name its path explicitly to remove its stored entry.

Release notes at release/requests/<version>/notes.md use notesSha256 in their sibling request.json, not the central file. The check requires a readable JSON object with a lowercase 64-digit hexadecimal notesSha256 equal to the SHA-256 digest of either the exact notes bytes or the notes bytes after CRLF-to-LF conversion. A missing or invalid sibling fails. The update command refuses release notes. Use the reviewed release request process for these files.

Writing convention

The convention governs new or changed prose in the root README.md, PR descriptions and commit bodies. It also governs issues, comments, release notes and agent messages to users. Use short, active language. Write sentences a reader understands on one reading. Keep exact technical terms. Do not use semicolons or contractions.

An attributed user quote with recorded permission stays verbatim and is exempt from the writing requirements and style convention.

These ten requirements are project-authored:

  1. Write for a reader whose first language is not English.
  2. Use plain words that appear in standard libraries and textbooks. Treat any other term as new. A multi-word noun phrase, an abbreviation and a CamelCase name are terms.
  3. Avoid idioms.
  4. Replace bare-reference openers with the subject they reference.
  5. Explain each term, including project-specific, at first use.
  6. Define each abbreviation at first use.
  7. Express one idea in each sentence.
  8. Use one term for each concept.
  9. Do not explain an idea with a metaphor.
  10. Do not invent a term when the project already has one.

Research logs and worker-thread task text are excluded. A high-level design is always governed, even inside a research log. The project's own agent instruction file, AGENTS.md, is also excluded from these ten requirements and the style convention. Its rules need a dense, exact register. The requirements govern docs/, but every checker finding there remains advisory. verification/README.md remains a precision-first mechanism reference and is excluded.

The separate current-state documentation rule governs new or changed text in the root README.md, docs/, code comments and AGENTS.md itself. Describe only current state, not removed features or past behavior. Existing historical sentences are pre-existing debt and need no rewrite now. Pull request descriptions, commit bodies, release notes and issues may describe removals as change records. Support for a deprecated key that still exists is current state and may be documented. See docs/writing-guidance.md § Current-state documentation rule.

The writing checker is diagnostic everywhere and authoritative nowhere. A match directs reviewer attention, and the reviewer decides whether the text has a defect. Changed convention-governed text should carry no fail-level findings. Findings in unchanged text are pre-existing debt, not an unrelated blocker. Every checker class is advisory in excluded files because mechanical findings can conflict with required precision. ASD-STE100 inspires only, Slate claims no conformance, and contributors must copy no standard material or examples. Before you edit README.md, read README-GUIDELINES.md.

Packaging rules

  • Keep the pi-bundled SDK packages (@earendil-works/pi-ai, @earendil-works/pi-coding-agent, @earendil-works/pi-tui, typebox) in peerDependencies with the version "*". Never bundle them, and never add them to dependencies.
  • The devDependency carve-out. devDependencies also pins the same four packages to exact versions, so the typecheck, the load check and the unit tests use one known SDK. That practice is correct, and a bundle is a different matter: npm installs devDependencies for no consumer, and it installs dependencies only. devDependencies pins the tooling in the same place and for the same reason: @types/node serves the typecheck, typescript serves the typecheck, coverage classification, package-content analysis, and the logical-model import-syntax check, and marked serves only the assigned-forms Markdown block checks as a direct dependency. Its exact pin matches the version the pi SDK installs. The packed manifest records the development pin, but the archive does not include marked code. tsconfig.json, test/ and verification/ all sit outside the files whitelist, so no part of the checks or the tests reaches a consumer install. Re-check that boundary with npm pack --dry-run --json after a packaging change.
  • Commit package-lock.json. This repo ignored the file while the four SDK packages existed as "*" peers only, because a lockfile then pinned an arbitrary resolution from npm. The exact pins in devDependencies removed that reason, and the lockfile now records the versions that this repo chose. npm ci --ignore-scripts, the install that CI runs, also needs the file.
  • Never add an install-time lifecycle script. npm runs prepare, postinstall, install and preinstall on every consumer install. Add none of them to scripts.
  • The files whitelist in package.json must include docs/. The doctrine points at those files at package-resolved paths at run time. A publish without them ships a doctrine with a dangling citation in every rule, and an orchestrator that reads the workflow rules finds nothing. This is a rule and not a note, because adversarial review raised it as a finding (AD6 in that round). Action-level routing needed no packaging change, because docs/ ships as a whole and covered docs/model-routing.md on its first day. That fact makes the rule MORE important: one more doc now resolves at a package-resolved path at run time.
  • The guard asserts the files whitelist by exact equality. A deliberate change to the whitelist must update the guard in the same commit (see § CI).
  • The exact files whitelist is extension, docs, README.md, CHANGELOG.md, LICENSE. The root changelog ships with no pi.changelogPath override. Packaging guards require its packed path and every ## heading to be exactly ## [X.Y.Z]. Zero entries are valid. Each guard has a violating self-test mutation.
  • Keep "keywords": ["pi-package"] — it is what lists the package in the pi.dev gallery.

verification/run-packaging-checks.sh enforces every rule above. It asserts the manifest, and it also asserts the real file list from npm pack --dry-run, because the manifest alone proves too little. npm expands a whitelisted directory recursively, and a files whitelist makes .npmignore and .gitignore inert. A stray file under extension/ or docs/ therefore ships behind a correct manifest.

The pack policy answers that risk. It permits package.json, README.md, CHANGELOG.md, LICENSE, docs/**/*.md, extension/**/*.ts and extension/**/*.mjs, and it rejects junk and secrets. It also requires every doctrine doc that the extension references. verification/README.md gives the details.

The permitted kinds include extension/**/*.mjs, and that is deliberate. The shipped writing checker is dependency-free plain JavaScript. It runs as a command and inside a hot turn hook without a transpiler. The pack policy must permit this runtime command. verification/package-content-check.mjs enumerates runtime commands independently. It proves that each has one exported path and packed file.

Release & versioning

Before prepare, draft the short update note after the release notes, show its complete text to the user after every change, and obtain explicit approval. Add it unchanged to root CHANGELOG.md under exactly ## [<version>]. The user merges its ordinary pull request into the selected target before preparation. For release/X.Y, land it on main first and backport it. Confirm the target head contains the entry for the preparation version. Never include the changelog in the release request. After success, give the user that same approved text and release link for social networks. Do not post it. Follow RELEASING.md for formatting and unsuccessful-release handling.

Before any release, read RELEASING.md in full. The Release workflow prepares one identity-bound branch. A user creates and merges its pull request. A two-parent merge into main starts publication. A merge into release/X.Y requires a publish dispatch on main with the exact version and request identity before publication starts.

The release-state branch keeps an additive durable lifecycle. It binds the original request, reviewed notes and path set, exact merge and its own parent, complete executable check roster, inspected archive, upload execution, registry bytes, clean install proof, promotion intent and observations, Git tag, and GitHub release. Version alone is never release identity. Each preparation dispatch adds a unique authorization generation to the request identity. A rerun of that workflow run keeps the generation. Preparation scans the additive release-state history at the commit bound to its lease and refuses any identity with a terminal record. A failed history read or parse refuses preparation. A still-prepared own identity can resume. Every later stage and operator action must carry the launch identity and reject a different current owner before an effect or state write. Compare-and-swap pushes fence the workflow's own writers.

One release permits one live package upload. The publisher binds the upload to one GitHub run and run-attempt pair and publishes under the internal slate-candidate npm distribution tag. Unknown upload blocks retry, abandonment, promotion, and final records. Retirement of an unknown upload requires a completed sealed run attempt, a completed non-success upload job, 60 minutes since job completion, and a fresh full npm package document from an empty cache with earlier versions and publication times. The version must be absent from both versions and time. A not-found response, read failure or malformed document refuses retirement without a state write. The terminal state keeps the archive and upload execution, marks the upload observed-absent, and frees the lane for a new identity. The gate records an observation, not proof that npm never accepted a request. A wrong verdict can leave only an unpromoted version under slate-candidate with the sealed archive. latest never moves without proof, and a later same-version upload fails and records unknown or mismatch. Recovery from upload-unknown requests failed jobs and their dependents from the original release run. The sealed upload authority rejects the upload rerun. Proof-gated dependents may later record registry and installation proof, promote, and create final records. Installation proof is read-only and may be retried under a later run attempt. Its success or failure result binds the producing execution to the exact request identity, version, release commit, parent, and verified registry record. Recovery from published state also requests failed jobs and their dependents. The recovery job itself grants no upload or promotion authority. Other stage artifacts bind the request identity, release commit, and owning stage execution. A late result cannot replace the outcome of a newer owner. A confirmed byte mismatch is terminal and records no uploader attribution that the evidence cannot prove.

After byte and exact-version install proofs, promotion uses OpenID Connect (OIDC) in the main-only npm-promote environment. Upload uses the main-only npm-release environment. Exactly upload, promote and recover-promote have id-token: write. No workflow job reads an npm token secret. npm trusted publisher A permits direct upload with dist-tag access off. Configuration B permits dist-tag access with direct publish off. Before every release, confirm exactly these two configurations, with both environment fields set. npm permits staged publishing in every configuration. The workflow never stages a version, and maintainers must never approve a staged ytdb-slate version. Upload still chooses its own version's tag. No credentialed job installs dependencies or executes package, test, lifecycle, or extension code.

Promotion uses Node built-in fetch for the GitHub ID token, npm exchange and latest PUT, only after the guard permits a write. Registry URLs are fixed to https://registry.npmjs.org. A different or invalid promotion registry origin saves refused with errorCode unknown before any read or credential request. The GitHub URL must use HTTPS. Requests reject redirects and time out after ten seconds each. Returned credentials are masked immediately and stay in memory. Results contain only existing closed codes. The tag PUT endpoint has no public API specification. Before merging a workflow interface, confirm no release is prepared or in progress and no Release run is active. Do not rerun a preparation or claim run whose stored executor lacks /-/npm/v1/oidc/token/exchange/. The stored executor uses OIDC only when it contains /-/npm/v1/oidc/token/exchange/. An executor without that path uses the stored-token route. A release with that stored-token executor can only close after unknown effects are resolved. Fresh preparation supplies OIDC control. Delete NPM_STAGE_ONLY_TOKEN and revoke its npm token after merge. After the first verified OIDC promotion, enable the npm package setting Require two-factor authentication and disallow tokens. Its effect on OIDC tag writes is undocumented. The first release after enabling it provides the first proof. If that setting blocks promotion, a maintainer turns it off and chooses recover.

Recovery selects bounded observation only when BOTH stored control modules export PROMOTION_OBSERVATION = "bounded-latest-v1". When both declarations are absent, recovery selects the supported legacy route. Partial or unsupported declarations fail visibly without a state change. Under OIDC bounded control, missing GitHub OIDC request variables save not-attempted with the existing cause missing-token. A failed or malformed guard read fails the job without a write or state change. It does not save not-attempted or latest-read-failed. The guard permits a write only at the saved earlier value. The release version verifies promotion without a write. Another version starts bounded observation without a write. Successful and failed authorized writes use the shared observer. After a failed write, observing the release version saves verified. Every other outcome saves refused with a fixed recognized npm error code or unknown, never free text. A completed observation supplies its actual after value. A failed observation still saves refused and omits after, never substituting the guard value. Its 60-second allowance includes reads, waits and npm retries, with five-second polling intervals and per-read timeouts within the remaining allowance. Reads run without npm tokens or GitHub OIDC request variables, with two distinct empty temporary npm configuration files and an isolated working directory without a project .npmrc file. No read starts with less than one second remaining. The observer then classifies the last valid read. A started read that fails, returns malformed data or times out cannot reuse an earlier successful read. Such failures change no state except after a failed write, which still saves refused. The release version gives verified. At the deadline the saved earlier value gives unchanged, and a third version gives superseded. unchanged does not prove npm never accepted the write. Every non-verified result emits a fixed GitHub error annotation while allowing recording. The recorder accepts a closed result shape and preserves expectedLatest and the release identity binding. Only verified permits final records. Recovery observes unknown outcomes and resolved refused, unchanged or not-attempted results through the same observer. A target observation records verified, including from a resolved result. An unchanged observation authorizes a new protected promoter with the same expectedLatest. That promoter checks the value again before writing. Stop every earlier promoter before recovery. Automatic inactivity proof is outside this route.

The legacy route retains stored policy and result vocabulary. A guard conflict records conflict without writing. Stored support for not-attempted determines whether missing-token and failed-first-read branches save that result, with fixed causes missing-token and latest-read-failed. Inspect both stored modules before using that result. Legacy recovery retries refused or supported not-attempted only when one read equals the saved expected value. Another value refuses the retry. An unknown outcome verifies the release version or saves superseded, including when the saved earlier value remains selected. Historical refused evidence without an error code and historical conflict evidence remain valid and permit close. Check the workflow at a rerun's commit for the required retry conditions. A rerun of the original promoter cannot retry. If a promotion result artifact exists but its recorder failed, rerun only that recorder first while the original intent owns state. Do not choose recover first. A failed promotion recorder can download the original fixed-name result artifact on a later run attempt when the original intent still owns state. Recorders commit only validated promotion content, not downloaded promotion directories. Neither route rolls back another observed selection. npm tag writes are unconditional, so independent writers inside the read-and-write window remain outside the guarantee. Nobody may change latest manually while release automation is active.

Ordinary abandonment covers only an unmerged request with no upload. A merged prepared request retires only after a successful GitHub read shows exactly one merged pull request into the request's bound target from this repository and its identity-bound branch. Failed or malformed reads and zero or multiple matches refuse the write. Prepared retirement uses current control code and keeps null claim fields. A claimed no-upload authorization also uses explicit retirement. Claim requires the durable owner to match the identified launch identity and refuses terminal or replaced owners. Do not retire while a preparation or claim run that started before pull request #439 merged is still active. Do not rerun a preparation or claim run that started before pull request #439 merged. GitHub permits reruns for 30 days. An observed-absent unknown upload may also retire under the evidence gate above. Preparation refuses a version listed in npm versions or time, and refuses package-not-found or failed registry reads. A corrected request may reuse the same unused version and may omit manifest files when the bound target branch already names that version. A proved release with a resolved but impossible promotion may close without promotion. A registry-verified published release with durable installation-failure evidence may also close without promotion. The attempt-keyed install-failure-<attempt> artifact feeds record-install-failure, which commits validated evidence under install-failures/. If that recorder fails, failed-job recovery must rerun the failed installation job and recorder together. A recorder-only rerun requests an artifact under a new attempt number that no installation job produced. This route requires resolved upload and promotion outcomes and no active publisher or promoter. Retirement, mismatch, and close preserve evidence, revoke the exact identity, create no success final records, and free the lane. A published close consumes the version and rejects late installation results.

Preparation on main binds each request to main or to an existing release/X.Y branch for the version line. A new version exceeds every npm version and publication-time entry. The durable request binds the target in its hash identity. New release admission accepts only two-parent merges on the bound target's first-parent history. Automatic discovery follows first-parent history in the pushed range and selects one release merge, including a push with unrelated merges. Both target types require exactly one matching merged pull request from this repository and the identity-bound request branch into the bound target, with that exact merge endpoint. Every result page must be readable and valid. Discovery, admission before claim, release checks and the coverage-warning decision compare the merge with its actual first parent with rename detection disabled. The complete result must satisfy the reviewed metadata path rule before claim. The preparation base remains an ancestry check only. Release identity and check evidence bind the exact merge and actual first parent. Collect release notes from first-parent history and verified linked pull requests, not commit-title conventions. Inspect commits without matching linked pull requests directly. A repeated attempt reuses its recorded base or refuses. A release-branch merge needs a publish dispatch on main with the exact version and request identity. That dispatch reads the stored control copy and checks the bound target, merged pull request and first-parent history before claim. Only the claiming workflow run can continue a claim or upload. Its later attempt reuses the recorded release commit, parent and pull request. On this path the release commit supplies check and package content only. The check roster runs in report mode, and stored control decides a coverage warning. Jobs that run the check roster or the package content of the release commit hold no persisted credential and save no dependency cache. On a main release, identify, claim and seal run control code from the main release commit. Claim and seal write release-state with a persisted checkout credential. For release-branch publication, identify, claim, the coverage decision, seal, upload, registry and installation proofs, recorders, promotion, and finalization use control code from release-state. Recover and close also use stored control code. Abandon and retire use current control code from the dispatch commit on main for operator checks. Some of their state transitions use stored control code. A main release keeps its push trigger and normal check-roster mode. The release request changes only package.json, package-lock.json, and its three files under release/requests/<version>/. A same-version correction can change a subset of the three request files, including request.json. The request records the fixed permitted set. A version-changing request must change both manifests and request.json. Those files remain outside the package files whitelist. CI runs on pushes to main and branches matching release/[0-9]*. A branch-creation push runs tests without patch coverage and reports the skip. One follow-up merge from main to release/0.12 supplies its CI trigger and check roster report mode before the first release from that branch. An administrator creates a release branch at the first verified tag of its line, updates the merge-queue ruleset and locks the previous branch. No ruleset restricts creation or deletion of matching release branches. The trusted group remains every collaborator with write access. The workflow moves no dogfood pin. Existing SDK pins change only during a targeted pi release.

verification/release-checks.sh is the executable release roster. Keep every listed command, order, strict flag, exit status, and verdict check. A refusal, failure, unsupported result, absent verdict, or NOT RUN stops before publication. A coverage WARN advances only when the changed paths are a subset of the reviewed permitted set, include request.json, and include both manifests for a version-changing request. The exact parent and identity enter evidence.

verification/release-job.mjs owns the upload, promotion, installed-command proof, and final-record execution boundaries. Behavioral tests invoke those production functions with closed fake interfaces. They also execute the real workflow run blocks for upload sealing, installation, installation-failure recording, published-state recovery, retirement, and close against isolated state and closed fake commands. The tests execute the real roster script against an isolated fake repository and command set. Keep all three forms of evidence when changing the workflow or release roster.

The fresh-install proof checks installation, extension loading, and /slate command registration. It does not prove interactive doctrine rendering, model routing, or tool registration. The first live release must prove trusted upload through configuration A and OIDC promotion through configuration B. It must also observe the package and organization token and two-factor authentication policy. Development work must not run the Release workflow live.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.