Project Conventions
The agency standards are canonical. This page maps them onto a TypeScript/pi-extension codebase and records what is different here and why. It is the project-owned complement to the (unedited, synced) standards pages — see ADR-002 for the downstream-in-spirit posture.
Language mapping (Rust standard → this repo)
| Standard (Rust) | Here (TypeScript) | Notes |
|---|---|---|
|
|
Same principle: one typed automation entrypoint, no loose scripts. |
rustfmt + clippy |
Biome (format + lint), CI-blocking |
One tool for both, matching the bundled ecosystem (gotgenes stack). It
formats Markdown too (Biome 2.6, #396), the YAML header included. A file a
program reads as raw text says the same thing in Markdown: the field-study
scenarios write a seed path such as |
cargo-nextest |
vitest |
|
|
Typed |
Same judgment residue, TS idioms. |
Newtypes over raw primitives |
Branded types / dedicated interfaces for domain values (model refs, region ids, provider ids) |
Compile-time arg-transposition safety where it pays. |
|
|
The equivalent "prove it or handle it" posture. |
SPDX header on |
SPDX header on |
Enforced by pre-commit (staged blobs) + |
Alpine/musl containers |
CI images: Debian |
Alpine wherever it works; Debian where a native module has no musl
prebuild (the docs search embedder’s |
Conventions specific to this repo
-
Model invocation: always pi’s composed-provider path (
ctx.modelRegistry.completeSimple/ providerstreamSimple). Neverpi-ai/compatcomplete*— it cannot reach custom-api/ADC providers. -
Config files: extensions ship a bundled default next to the code and read a per-user override from the agent dir (
$PI_CODING_AGENT_DIRor~/.pi/agent/…). First-run bootstrap seeds external consumers' configs (e.g. the permission system’sconfig.json) only when absent. -
peerDependencies: pi’s own packages (@earendil-works/pi-ai,@earendil-works/pi-coding-agent,pi-tui) are provided by pi at runtime, never bundled. The range says the oldest pi a package works with, and it is the same everywhere:>=1.5.0for pi-coding-agent in every package and for pi-ai where a package names it (inpi-remote),pi-tui(pi-modes only). One floor, at the pi the box runs, because that is the only pi the workspace tests against: the workspace installs exactly that pi (overridesinpnpm-workspace.yaml), the CI rehearsal installs the floor itself (a distribution test holds the two equal), and the current majors of the permission system and helper runtime that@gadhs/pibundles require pi 1.0 or later.typeboxis a*peer inpi,pi-modesandpi-remoteand a direct dependency ofpi-workflow; the workspace overrides it to the version pi-ai pins. -
Commit attribution: AI-assisted commits carry
Co-Authored-By: <Model Name> <noreply@dhs.ga.gov>, derived at commit time from$PI_MODEL(title-cased) — never a stale hardcoded value. The address is configurable ascoAuthorEmail(Configuration Cookbook).
Plans use a canonical Status vocabulary, enforced by
node tools/task.mjs plan-lint.
Stability from 1.0
From @gadhs/pi 1.0.0, SemVer binds the stable tier of
The public surface: config files and keys, slash
commands, tools, operator environment variables, stable bus channels,
versioned wires, @gadhs/pi/bus-rules.json, and @gadhs/pi/package.json.
-
A breaking change to a stable item — removing or renaming it, changing the type of a parameter or payload field, a config loader refusing what it previously accepted, or a wire change where peers on adjacent versions refuse each other — requires a major version bump of
@gadhs/piand an entry under=== BreakinginCHANGELOG.adocthat says what to change. -
An addition to the stable tier (a new optional key, command, tool, event, or additive payload field) is a minor version bump.
-
Internal items (including every named export of a sibling package and every export of the
@gadhs/pi-bashand@gadhs/pi-workspacelibraries) and upstream items may change in any release. -
The ten sibling
@gadhs/pi-*packages are private to the workspace (private: true), move in lockstep with `@gadhs/pi’s version, and are not published standalone (#836).
This section is this repository’s concrete form of the agency standards' "API contract stability" rule; the synced standards pages are not edited (ADR-002).
Project Overrides (dated, per the override convention)
-
2026-08-26 — Agent context lives in
AGENTS.md, not.claude/CLAUDE.md. pi loadsAGENTS.mdnatively and the whole point of this project is model-agnostic configuration. Supersedes the template’s.claude/layout for this repo. The genericization is phase 2’s deliverable; this override is its first step. -
2026-08-26 —
check-docsdrift gating is stubbed. This is the template’s first non-Rust downstream; the sync engine and manifest are cargo-bound and the syncedcoding-conventionspage is Rust-specific. Standards pages are byte-copied unedited (drift-checkable later); gating activates when upstream ships a language-profile manifest. A macro-feedback issue upstream is held until this repo’s auto-mode is operational (operator instruction). -
2026-08-26 — Work tracking uses a parent tracking issue, not an epic (same constraint and rationale as the template’s own override: project tokens cannot create group-level epics).
-
2026-08-26 — Docs format: AsciiDoc/Antora canonical; published packages additionally carry a thin
README.mdstub because npm/pi.dev render only Markdown. The stub holds no content beyond install + a docs pointer. -
2026-09-07 — Plans authored before v2026.5 keep their per-step Status lines. The template froze plans at implementation start and reduced Status to one header value; the archived plans here were written under the earlier living-spec rule and are history. New plans follow the shipped rule.
task plan-lintvocabulary-checks any line beginningStatus:and requires none, so both shapes pass it; it does not distinguish a header from a step, and the boldStatus:header form these plans use is not matched at all (the template’splan-lint --donecompletion gate was not adopted).