Contributing Reference

This page holds the facts behind Contributing: Regression Suites. Read it to look one fact up. To find the suite for the file you changed, start on Which suite guards your file.

Which suite guards what

All commands run from the repository root. The automated suites are free: they are offline, deterministic and call no model.

Suite Guards Run command

agent-contract-regression.py

The delegation contract (rules/agents/delegation-contract.md) in agents/*.md, skills/*/SKILL.md and rules/. It has one test class for each acceptance requirement: definition of done, ownership zones, plan before edits, edit scope, least privilege, evidence over claims, independent review, durable knowledge, bounds and handoff. It also tests the handshake between ft-docs and the writer modes, and context economy. It pins the declared cost envelope (agent-runs, turns, wall-clock and context budgets) and the measured lens fanout.

python3 deploy/evals/agent-contract-regression.py

agent-contract-audit.py (in deploy/scripts/, described by agent-contract-audit.md)

The same ten requirements as a source-level audit, plus four more lines: token economy (ECON), the writer modes (DOCM), least-privilege allowlists (ROLES) and the canon in both installers (INST). For every clause it prints the path:line that carries it. It is the compliance half of the pair. The regression is the pinning half.

python3 deploy/scripts/agent-contract-audit.py --check (exit 1 on any unsatisfied clause). Add --json for machine output.

pipeline-cost-benchmark-regression.py

The source-level cost model of deploy/scripts/pipeline-cost-benchmark.py: the JSON schema and the current numbers. It holds the prompt-weight ceiling for the three entrypoints (agents/ft-developer.md, agents/bugfix-agent.md, agents/verifier.md) and the lens fanout.

python3 deploy/evals/pipeline-cost-benchmark-regression.py

delegation-gate-regression.py

deploy/templates/hooks/delegation-gate.py, the hook that checks a brief before the dispatch, not installed by the owner’s ruling of 2026-11-03. Payloads copy the real PreToolUse shape recorded in hook-payload-probe.md, so a test cannot pass against a shape the harness never sends. Boundary: delegation-gate.md.

python3 deploy/evals/delegation-gate-regression.py

diff-router-regression.py

deploy/templates/hooks/diff-router.py, route-schema.json and the route rules of the delegation gate. It checks that the mandatory core lenses survive every input, that doubt fires more lenses, and that the router rosters match the contracts. Boundary: diff-router.md.

python3 deploy/evals/diff-router-regression.py (add -v for detail)

evidence-store-regression.py

deploy/templates/hooks/evidence-store.py, evidence-schema.json and the cache path in the delegation gate. It checks key derivation, immutability, tamper detection, collisions, that a failure is never cached as a pass, and invalidation on drift. Boundary: evidence-store.md.

python3 deploy/evals/evidence-store-regression.py

version-gate-regression.py

deploy/templates/hooks/version-gate.py, the doc writer’s version gate. It checks the one-line stdout contract, the exit code, and the fail-direction rows: fetch failure, missing installed file, deleted remote branch, content only on a second remote, malformed record and no record.

python3 deploy/evals/version-gate-regression.py

runtime-collector-regression.py

deploy/scripts/runtime-collector.py, which reads Claude Code JSONL transcripts. The key case is the dedupe by message.id. Without it every token figure is roughly doubled.

python3 deploy/evals/runtime-collector-regression.py

runtime-fixtures-regression.py

deploy/scripts/runtime-fixtures.py and the benchmark fixtures on disk. Each fixture must fail on the pristine workspace, pass with its reference solution, and name the staged route it requires.

python3 deploy/evals/runtime-fixtures-regression.py

runtime-runner-regression.py

deploy/scripts/runtime-runner.py and runtime-compare.py. These are the only benchmark parts that can spend money or start a process. The suite checks safety: --run needs an acknowledgement flag, --dry-run starts nothing, and the child environment is an allowlist. It also checks that a run only counts when the staged route was taken.

python3 deploy/evals/runtime-runner-regression.py

codex-install-regression.sh

deploy/scripts/install-codex.sh and the Codex renderers: idempotent install, the unrelated config survives, skill and agent counts, the readonly-role-guard hook block in config.toml, trust state, the install layout and the doctor notes (cells I1 to I12, I14 to I17, I3a to I3d, I3d3 to I3d6, I3e to I3g and I7b). Details: Codex installer regression. User guide: Codex.

deploy/evals/codex-install-regression.sh

install-source-record-regression.sh

The toolkit-source record that install.sh and install.ps1 write for the doc-writer version gate (deploy/templates/hooks/version-gate.py reads it): the source branch name, no record on a detached HEAD or a name outside [A-Za-z0-9._/-], a stale record overwritten, the name never reaches a shell, and a dry run changes nothing. With pwsh it also parses install.ps1 and checks its dry-run output. A real .ps1 install cannot run off Windows, so its file write is not exercised. It works on a temporary HOME and CLAUDE_HOME.

bash deploy/evals/install-source-record-regression.sh

sdd-shape-regression.py

The ft-sdd templates in deploy/templates/sdd/: it runs shape-check.py --selftest and html-page.py --selftest as subprocesses, stages a document through word-pages.py on stubbed renderers (the DRAFT: / PUBLISH: tokens, indented and fenced images), checks the page’s JavaScript link resolver against the Python one under Node, pins two Word-side facts the page rests on against a real build_doc.py run (entities stay literal in Word, a | a | line over --- stops the Word build), and pins the contract phrases of agents/ft-sdd.md and the templates. Standard library plus Node.

python3 deploy/evals/sdd-shape-regression.py

codex-readonly-guard-regression.py

deploy/templates/codex-hooks/readonly-role-guard.py, the Codex PreToolUse hook that denies a read-only role apply_patch, shell-routed apply_patch, spawning or messaging other agents (cells U0 to U10), and every mcp__ tool outside the role’s tools: list plus the effect tools of the denied list (cells M1 to M7, which include the anchored matcher). Each cell runs the guard as a subprocess, the way Codex runs it, except U3dDifferentialCorpus: it loads the guard in-process and requires it to deny every script in deploy/evals/data/codex-intercept-corpus.json as a patch. Those are scripts that the tree-sitter query of Codex rust-v0.166.0 intercepts. deploy/evals/gen-codex-intercept-corpus.py generated the corpus once with tree-sitter-bash 0.25.1; CI never runs the generator, and the corpus header pins the parser and the query. To regenerate the corpus after a Codex bump, run the header’s generator_cmd in a venv with the header’s tree_sitter and tree_sitter_bash versions (pip install tree-sitter==0.26.0 tree-sitter-bash==0.25.1; the generator docstring lists the inputs and where to get them), then set CORPUS_SIZE in the regression to the new entry count. The suite also checks the real rendered codex/agents/ tree.

python3 deploy/evals/codex-readonly-guard-regression.py

codex-spawn-gate-regression.py

deploy/templates/codex-hooks/spawn-price-gate.py, the Codex PreToolUse hook that denies a priced spawn with an omitted field, a model outside the tier map or an effort above high (cells G1 to G9, including the matcher table). It runs the gate as a subprocess.

python3 deploy/evals/codex-spawn-gate-regression.py

harness-hooks-regression.py

The seam between the shipped hooks and the installer deploy/scripts/economy.py: a script dropped from HOOKS, a deleted or lowered WIRED entry, an installer --check that stops noticing, and a regression or CI file that names a hook which does not ship. It loads lane-nudge.py and main-compact.py together (class StopHooksCompose): both must name the same block marker file and the same default state directory, and main-compact.py must see a real block of lane-nudge.py. It does not run the --selftest of the hooks. It works on a temporary destination and never touches ~/.claude.

python3 deploy/evals/harness-hooks-regression.py

skills/ft-guide-page/tests/

skills/ft-guide-page/scripts/page-audit.py. Standard library only.

python3 -B -m unittest discover -s skills/ft-guide-page/tests -v

skills/friendly-branded-docs/tests/

The document builder of the friendly-branded-docs skill. Standard library only.

python3 -B -m unittest discover -s skills/friendly-branded-docs/tests -v

skills/ft-image-rollout-verification/tests/

The scripts of the ft-image-rollout-verification skill. Standard library only.

python3 -B -m unittest discover -s skills/ft-image-rollout-verification/tests -v

skills/tr069-walk-benchmark/tests/

The scripts of the tr069-walk-benchmark skill. Standard library only.

python3 -B -m unittest discover -s skills/tr069-walk-benchmark/tests -v

skills/grafana-dashboard-snapshot/tests/

The scripts of the grafana-dashboard-snapshot skill. Standard library only.

python3 -B -m unittest discover -s skills/grafana-dashboard-snapshot/tests -v

skills/ft-ux-audit/tests/

The scripts of the ft-ux-audit skill. Standard library only.

python3 -B -m unittest discover -s skills/ft-ux-audit/tests -v

skills/ft-jira/tests/

The scripts of the ft-jira skill, offline: no Jira access and no writes. test_run.py runs the checks of run.py. Standard library only.

python3 -B -m unittest discover -s skills/ft-jira/tests -v

The three runtime suites guard the benchmark tooling. Run them when you edit deploy/scripts/runtime-*.py.

skills/autoreview/scripts/test-review-harness.py is not one of these suites. It needs an external review engine and exits 1 when the engine is not installed.

Hook self-tests

These hooks and commands carry their own offline self-test. Each self-test builds temporary files and never touches ~/.claude or the real vault.

Hook Run command

artifact-registry.py, checkout-guard.py, decide.py, docker-workload-guard.py, encoded-exec-guard.py, heredoc-guard.py, janitor.py, lane-nudge.py, lane-status.py, main-compact.py, main-rules.py, ownership-check.py, price-gate.py, refresh-gate.py, session-audit.py, turn-guard.py, unit-check.py, vault-note.py

python3 deploy/templates/hooks/<hook>.py --selftest

git-safety-check.sh

deploy/templates/hooks/git-safety-check.sh --selftest

No suite or self-test covers these 9 hooks in deploy/templates/hooks/: context-guard.py, design-gate.py, durability-gate.py, graph-search-augment.py, phase-gate.py, reuse-gate.py, rules-loader.py, user-visible-gate.py and verify-gate.py.

Manual re-check documents

Some agents cannot be tested without a model. For those, a document lists canned scenarios. You launch the agent once for each scenario as a sub-agent dry run and compare the outcome with the expected one. Record the date, the scenario ids and pass or fail in the pull request or commit notes.

Document Re-check before you merge an edit to What you compare

verifier-regression.md

agents/verifier.md, and the checkpoint and lens wiring in skills/ft-fix/SKILL.md and agents/ft-developer.md

The verdict and the required payload fields. The verifier is shared by both pipelines.

test-adversary-regression.md

agents/ft-test-adversary.md, and its wiring in skills/ft-fix/SKILL.md (Stage 3.5), agents/bugfix-agent.md (Phase 6) and agents/ft-developer.md (Stage 7)

The verdict and the per-check reporting. The agent must not edit production code.

refactor-regression.md

agents/refactor-agent.md and the /ft-refactor shim

The outcome classification and the required behavior: a proven safety net and no silent behavior change.

docs-routing-regression.md

The documentation step of the bugfix pipeline: ft-doc-writer-agent audit step, agents/bugfix-agent.md Phase 7, skills/ft-fix/SKILL.md Stage 4.5

The routing verdict (EXTEND, REVISE, NEW, NO-OP). It never checks the prose, because documentation text is not reproducible.

Any edit to agents/verifier.md or agents/ft-test-adversary.md must pass the scenarios in deploy/evals/verifier-regression.md and deploy/evals/test-adversary-regression.md. The verifier and the test adversary are shared by both quality pipelines. An edit that suits one pipeline can degrade the other without any visible error, and npm run build cannot catch an incompatible change. The pipelines are described in Quality Pipelines.

Codex installer regression

deploy/evals/codex-install-regression.sh tests install-codex.sh against a temporary CODEX_HOME. The script does this:

  1. Creates a fake .codex with a sentinel config.toml that holds an unrelated role.

  2. Installs twice and compares the config.toml hash. The second run must leave the hash unchanged.

  3. Checks that the unrelated role survives.

  4. Counts installed skills and agent files.

  5. Runs the doctor.

It also checks the readonly-role-guard hook: one guard group inside the owned markers, the matcher, the sha256 of the installed guard, and a deny for verifier through the installed command. It checks that user hook groups keep their index and trust state, and that the doctor prints a note and never ok for trust. It checks that the installer prints a re-trust line when the guard, matcher or timeout changes (cells I1 to I12, I14 to I17, I3a to I3d, I3d3 to I3d6, I3e to I3g and I7b). Cells I-a to I-e check that the installed matcher equals the matcher of the guard, the deny of mcpxy and read_mcp_resource for verifier, the single re-trust line after the matcher change, and the shape gate. The cells also cover the hook block layout (the hook has its own owned block after the last user group), the [features.multi_agent_v2] tool_namespace matcher, and the doctor missing: and note: lines.

The script expects 24 skills and 15 agent files, the counts of the installer lists, and reads both counts from install-codex.sh. When you change the lists in install-codex.sh, change the counts on the docs pages and in README.md in the same commit. deploy/evals/harness-hooks-regression.py (class InventoryCounts) fails until they match. For the user commands of the Codex install, see Codex.

Hard rules for contributors

Rule What it means

English only

Skills, agent instructions and documentation are written in English.

Standards stay consistent

The Java, Angular and Python standards are authoritative for their stack. Edits must agree with the locked-decisions table in RESUME.prompt.md. Send a contested fork to the person running the session. Do not resolve it silently.

Scripts come in pairs

Every script in deploy/ exists as a .sh file and a .ps1 file: install, wire-repo, gen-component-map, component-map-gate and semantic-coverage. A change to one needs the same change in the other. Share logic in one Python helper (deploy/scripts/economy.py) instead of two copies. Validate a .ps1 edit with pwsh: parse it with the AST parser and run it with DRY_RUN=1 or on a fixture. CI has no .ps1 runner. install-codex.sh has no .ps1 pair today.

gen-component-map is byte-parity-critical

The drift gate regenerates the map on Linux CI and compares it with the committed file. The .ps1 must emit identical output: ordinal (C-locale) sort, GNU uniq -c width 7, LF line endings, UTF-8 without BOM. Diff both scripts on a fixture.

Skill naming

Never name a skill like a bundled one. See Skills policy.

Least privilege in tools:

Declare an agent’s privilege once, in its tools: allowlist. A role with an allowlist and no Write or Edit is read-only. render-codex-agents.py derives the Codex sandbox_mode from that list. Codex does not apply that key to a spawned role. The installed readonly-role-guard hook, once trusted, denies a read-only role apply_patch, shell-routed apply_patch, spawning or messaging other agents, and every mcp__ tool outside its tools: list. The renderer also writes a [features] table and one # ft-readonly-allowed-tools: comment line into each read-only role file. The toolkit ships no shell floor: a shell write inside a writable root is stopped by instruction only. See Codex. Do not add Write to verifier, ft-test-adversary or ft-architecture-audit.

Never modify ~/.claude/

Build and stage everything inside the repository. Change ~/.claude/ or ~/.codex/ only through the installers, and only when the user asks.

Rule paths: encode applicability

A paths: glob is a proxy for "when does this rule apply". See Writing a rule’s paths:.

Skills policy

Claude Code starts a skill when the description of the skill matches the work. The toolkit therefore keeps skill descriptions narrow and the skill set small.

How skills fire

Fact Consequence

The model starts a skill from its description.

Keep descriptions narrow and action-first, under about 150 characters. Broad descriptions fire too often.

Claude Code has no tie-break between skills and is not concurrency-safe.

Avoid overlapping triggers across skills.

~/.claude/skills/<name> overrides a bundled skill of the same name, silently.

Never name a skill code-review, security-review, verify, simplify, run or review.

disable-model-invocation: true makes a skill user-only.

Use it for a side-effect skill, for example autoreview.

Hooks register only through plugin.json or the frontmatter key hooks:.

Remove a stray .claude/ directory from a downloaded skill. This was done for oma-lwm2m-expert.

Skills the toolkit does not install

The toolkit ships none of the skills below in skills/. Two of them can still reach a machine: install.sh and install.ps1 offer the superpowers plugin, and that plugin carries brainstorming and requesting-code-review.

Skill Reason

code-reviewer, requesting-code-review

They duplicate the bundled /code-review and can fire twice with autoreview.

security-review (library version)

Its name collides with the bundled /security-review and would disable it silently. It also targets another stack (Next.js, Supabase, Solana).

brainstorming

Its hard rule "no code until a spec is approved" conflicts with plan mode and with the autonomous ft-developer flow.

java-coding-standards, springboot-patterns

ft-java-standards replaces them. The toolkit keeps one coding standard per stack.

java-pro

Broken.

performance-investigation

Written for Svelte.

coding-agent

Needs openclaw.

coding-standards

Covers JavaScript and TypeScript only.

Keep the two installers in lockstep

install.ps1 mirrors assets with robocopy and installs jdtls with Scoop (scoop install jdtls). install.sh uses rsync and Homebrew (brew install jdtls). An edit to one installer applies to the other. The scripts-in-pairs rule in Hard rules for contributors lists the other scripts that come in pairs.

The doctor of install.sh is --doctor, or DOCTOR=1. The doctor of install.ps1 is -Doctor, or $env:DOCTOR=1. The doctor verifies and installs nothing. It offers fixes when it runs in an interactive terminal.

Documentation build output

The build reports 3 known cross-component errors in glossary.adoc (docs-portal:: and ft-acs:: links). They resolve only inside the full portal. Without the Kroki server, the asciidoctor-kroki extension prints Skipping plantuml block for a diagram it cannot fetch.

Audit file lines

The audit file holds these lines:

Line Content

Root:

The absolute path of the module root.

Repo:

The absolute path of the repository.

Steering:

Pages and lines with text that tries to instruct the agent, or none. The agent does not follow that text.

One row for each flagged page

<rank> | <page path under pages/> | <KEEP|REWORK|SPLIT|TRIM|not read> | <target form> | <flags> | <reason and page:line>

Flagged, not read:

The number of flagged pages that the agent did not read. The agent reads at most the top 20 flagged pages.

Unflagged:

The number of pages without a flag. The agent does not read these pages and gives no verdict. Do not read an unlisted page as a passed page.

The skill reworks the REWORK and SPLIT rows only. The final report lists the KEEP and TRIM pages.

Page audit output

page-audit.py prints a legend, one row for each page and a skipped: footer. A row holds the size, tables, diagrams, headings, layout, inbound links and flags of the page. A flag fires when the value is above its limit.

Flag Fires when

LONG_PAGE

The page has more than 2500 words.

MANY_TABLES

The page has more than 5 tables.

BIG_TABLES

The tables have more than 60 rows.

NO_DIAGRAM

The page has more than 1200 words and no diagram.

FLAT_PAGE

The page has more than 600 words and fewer than 3 headings.

ORPHAN

No other page links to the page. index.adoc is excepted.

The flag --zone <root> prints the facts the /ft-docs chain gates on and exits with code 0:

Line Content

repo:

The absolute path of the repository.

root:

The absolute real path of the root.

head:

The commit at HEAD.

root-dirty:

The number of git status entries under the root, untracked files included.

inside:

The hash of the changes under the root.

outside:

The hash of the changes outside the root.

Ignored files are out of the hash. A git failure or a root outside a git repository exits with code 2 and prints nothing on standard output.

Plug in as a sub-portal

The FT Docs Portal (ft-docs-portal) builds and hosts every Antora component on Cloudflare Pages, with PlantUML through its own Kroki server. Nothing is built here. Register this repository in ft-docs-portal/antora-playbook.yml:

content:
  sources:
    # … existing product sources (ft-acs, ft-device-network-service, oneiot-ui, …) …
    - url: ./sources/ft-ai-toolkit
      branches: main
      start_path: docs          # this repo's Antora component root (docs/antora.yml)

The component name is ft-ai-toolkit. Link it from the portal navigation with xref:ft-ai-toolkit::index.adoc[FT AI Toolkit]. Product repositories mount at start_path: docs/src. This repository uses docs. Match what docs/antora.yml says.

Not covered here

The deploy/evals/ directory also holds dated measurement reports, baselines and recorded fixtures. They are internal evidence for decisions and are not part of the contributor workflow.