Phase 1 — Widgets: the @gadhs/pi distribution
On this page
Summary
Phase 1 delivers the "one package to rule them all": @gadhs/pi, bundling our
custom extensions with pinned upstream ones, so onboarding is a single
pi install. Phase 2 (guidance injections — the model-agnostic replacement for
vendor context files) depends on the seam shipped here but not on its
content: the pipe ships as a no-op with test hooks proving injected
instructions land verbatim in the composed system prompt.
Operator constraints in force: the agent runs in yolo mode until auto mode (modes + permission system) is operational; no cross-project interfacing (including the upstream claude-quickstart macro-feedback issue, which is drafted but held) until then.
Design
See Architecture. Non-negotiables: upstream
security code is never patched; all model calls go through pi’s composed
provider; the judge is advisory-only on ask decisions.
Work items
-
Bootstrap scaffold — monorepo, toolchain, hooks, Antora, standards copy, GitLab templates, ADR-001/002, this plan.
Status: Done (2026-08-26) — commit 3bbe437; tracking issues #1–#11 created -
@gadhs/pi-vertex-anthropicto standards — rename/rescope, thin README stub + Antora page, unit tests for option mapping & config loading, contract test with a fake Vertex client.
Status: Done (2026-08-26) — MR !6 merged; 28 tests + guarded live smoke -
@gadhs/pi-modescore — config loader (bundled default + user override), mode registry, mode switching (pi.setModel/setThinkingLevel), per-mode system-prompt addendum + tool filter,/modecommands + cycle shortcut, state persistence.
Status: Done (2026-08-26) — MR !1 merged (2a7cc7c / 5ca0e39) -
Guidance-injection seam — global + per-mode guidance blocks composed into the system prompt; no-op default; test hooks (canary block asserted byte-for-byte in the composed prompt); precedence order documented.
Status: Done (2026-08-26) — MR !2 merged (fe97d06 / 2a53be4); live canaries verified -
Model-judge authorizer —
registerAuthorizer("gadhs-mode-judge", …)onpermissions:ready; composed-provider model call; fail-closed verdict parser (property-tested); per-mode judge policy (default deny-only); disposer lifecycle.
Status: Done (2026-08-26) — commit 647ed1e (direct-to-main; process violation self-reported in #4, guard added) -
Permission-system bootstrap — seed a conservative default
config.json+authorizerChainfor@gotgenes/pi-permission-systemwhen absent; document the default policy.
Status: Done (2026-08-26) — MR !4 merged; live first-run verified -
@gadhs/pimeta assembly — pin + bundle upstreams, verify each bundled entrypoint loads fromnode_modulespaths, defaults/prompts dirs, publish dry-run against the GitLab registry.
Status: Done (2026-08-26) — MR !5 merged; consumer-simulation verified; publish dry-runs green -
Auto-mode dogfood gate — run this repo’s own development under modes
permission enforcement (exit yolo). Acceptance: judge adjudicatesaskdecisions with a Vertex model; deterministic denies hold; operator signs off.
Status: Done (2026-08-31) — #9 closed with operator sign-off. The repo develops itself under its own stack; friction became fixes and eval cases (routine allowlist, /tmp whitelist, settings-read split, ask/plan tools, sticky model); gates green (521 tests, corpus 119/122 x3 zero unsafe, consumer-sim 10/10, publish dry-runs) -
CI pipeline — GitLab CI running
task validate(+ signature check) on org runners; publish job for the registry.
Status: Done (2026-08-26) — MR !7 merged. Pipeline-green + test-publish rehearsal DEFERRED: DHS runner fleet capacity outage (operator directive: localtask validateis the merge gate until the fleet recovers; see #8)
Post-plan increments (same phase, operator-directed)
-
TUI: Orchard themes, status line, inline adjudication/subagent traces.
Status: Done (2026-08-29) — #25 closed; live-verified -
Typed subagent results (
output_schemacontracts, one validator).
Status: Done (2026-08-29) — #20 closed; false-positive regression pinned -
Session continuity: model/thinking restore, ADC rotation + auth retry.
Status: Done (2026-08-29) — #26/#27 closed; live-verified -
Workflow guards at the tool_call seam (deterministic; #29).
Status: Done (2026-08-29) — commit/authoring/GitLab/setup guards, all live-verified -
Guidance payload: packaged digests + language profiles +
/gadhs-init(#28).
Status: Done (2026-08-29) — canary-verified injection -
Governed auto-memory +
/remember,/memory.
Status: Done (2026-08-30) — #30 closed -
counttool: exact match counts, because models miscount by eye.
Status: Done (2026-08-30) — validated over four gibberish fixtures; chosen unprompted every trial -
Scratch-space allowance:
/tmp,/var/tmp,/var/folderswritable in auto/manual, read-only in plan.
Status: Done (2026-08-30) — credential patterns still outrank by specificity -
yield: structured subagent results, all-issues-at-once schema feedback, in-child retries, sidecar collection for large/background payloads.
Status: Done (2026-08-30) — live-verified (agent=Explore phase=yielded) -
Human-legible status line and traces (no counters, no shouting).
Status: Done (2026-08-30) — per-mode icon + colour; amber reserved for attention states -
Agent-callable plan mode:
enter_plan_mode/exit_plan_mode, three outcomes, plan rendered before the approval dialog.
Status: Done (2026-08-30) — fail-closed path live-verified; the unrendered plan was found by the operator using it, not by tests -
ask: put a question to the human mid-task, every mode, free-text escape always offered.
Status: Done (2026-08-30) — verified interactively and headless -
Reflection pause sunset of
PRECOMMIT_TOKEN: one review per commit, keyed by the staged diff, in every repo.
Status: Done (2026-08-30) — live-verified 2 commits / 2 pauses -
Workflow guards apply in every mode, yolo included (opt-out removed).
Status: Done (2026-08-30) — yolo had silently dropped the pause, attribution, SPDX-at-write and the debt gate -
Cold-reader reflection review: an independent model, never weaker than the author, reviews the staged diff against J1-J8.
Status: Done (2026-08-30) — caught 4 planted defects with file:line, incl. a comment asserting a guarantee the diff did not establish
Deferred
-
@gotgenes/pi-subagents-worktrees— REJECTED for v2 (2026-08-29, #10): worktree children load none of our permission stack;--no-verifyrescue path. Revisit only with a writing subagent + both upstream fixes. -
Upstream language-profile macro-feedback issue — drafted, held until the auto-mode dogfood gate passes (operator instruction).
Exit criteria
pi install npm:@gadhs/pi on a clean machine yields: Vertex Claude models
(per-model regions) available after /login + env, modes switchable with
per-mode models, permission enforcement active with the judge advising on
ask, web access and subagents loaded — and this repo’s own development runs
under that stack (dogfood gate passed).