This repository packages The Last Harness as an isolated profile for the upstream Pi coding agent. The installer must provide a tlh command without modifying a user's normal Pi configuration under ~/.pi/agent.
- Installer entrypoints:
install.shperforms install/update bootstrap work and creates thetlhwrapper;uninstall.shremoves the isolated profile and managed wrapper artifacts. - Installer/runtime scripts:
scripts/contains installer, update, doctor, wrapper, merge, runtime-TypeScript, release-notes, ticket helpers, and legacy-profile cleanup support;scripts/lib/holds shared installer modules;scripts/installer-smoke/contains staged smoke-test helpers;scripts/check-installer-smoke.sh,scripts/check-package-versions.mjs,scripts/check-startup-performance.mjs, andscripts/check-lazy-import-boundaries.mjsare contributor-facing validation checks. - Packaged profile defaults:
config/contains installer-owned settings, keybindings, librarian defaults, bundled extension manifests, and appended system prompt text for the isolated profile. - Packaged resources:
extensions/,prompts/,skills/, andthemes/are published package resources. First-party subagent orchestration lives underextensions/subagents/; its.tsfiles are authoritative and same-layout.jsfiles are generated, while imported tests stay in the repository/CI and are excluded from publication.skills/contains the pinned Herdr, cmux-cli, and tmux runtime closures; upstream README files,AGENTS.md, and agent metadata are intentionally excluded, and the consolidated terminal-skill notice lives inlicenses/terminal-skills.txt. - Agent definitions:
agents/primary/andagents/subagents/hold packaged primary-agent and subagent prompt specs used by tlh. - Tests and evals:
tests/contains the automated test suite and fixture helpers, whiletests/evals/contains deterministic workflow/trace-policy checks plus opt-in live-eval tooling. - Contributor automation:
.github/workflows/defines CI, release, startup-performance, and Claude automation;.github/PULL_REQUEST_TEMPLATE.mdprovides PR guidance. - Contributor-local tooling:
.pi/stores repo-local prompts and skills for contributors,.gnosis/entries.jsonlstores repo-local Gnosis memory, and.symphony/setupcontains local dependency setup automation. - Repository illustrations:
assets/stores documentation and workflow illustrations used in the repository and is not shipped in the npm package. - Contributor docs:
README.mdcovers install/update/uninstall and security,CONTRIBUTING.mdexplains contribution workflow,VALIDATING.mdandnpm run validatedefine the standard validation pass,CHANGELOG.mdtracks releases, andVISION.mdcaptures product direction. - Extended docs:
docs/contains install, integration, MCP, telemetry, local-development, release, workflow-eval, and web-search reference material.docs/subagents.mddocuments the first-party runtime;docs/subagents-history/preserves its provenance, including an immutable archive whose directories must never be used as a task working directory. - Package/tooling manifests:
package.json,package-lock.json,.oxfmtrc.json,tsconfig.json, andtsconfig.runtime-scripts.jsondefine the Node package, Oxlint/Oxfmt linting and formatting, and TypeScript settings used by contributors and validation.
- Never overwrite or mutate normal Pi config at
~/.pi/agent. - Installer Pi commands must set
PI_CODING_AGENT_DIRto the isolated profile directory. - Default isolated profile path:
~/.the-last-harness/agent. - Default wrapper path:
~/.local/bin/tlh. - The generated
tlhwrapper should run upstreampiwith the isolatedPI_CODING_AGENT_DIR, except for installer-owned helper subcommands such astlh defaults. - Keep settings merges conservative: append missing packages, respect
tlh.disabledDefaultExtensions, preserve existing isolated user values, and back up existing isolated settings before writes. - Public installs should use GitHub Release installer assets or explicit version tags; do not rely on a
stablebranch. - Do not clobber unmanaged files when creating wrappers; require explicit
--forcefor overwrites.
Run this before considering changes ready:
npm run validateUseful targeted checks:
bash -n install.sh
node --check scripts/tlh-gnosis.mjs
bash install.sh --dry-run --agent-dir "$(mktemp -d)/agent" --bin-dir "$(mktemp -d)"
bash -s -- --dry-run --agent-dir "$(mktemp -d)/agent" --bin-dir "$(mktemp -d)" < install.sh
npm run lint:shFor installer tests, prefer temporary --agent-dir and --bin-dir values. Do not run a real install into home directories unless the user explicitly asks.
- Shell scripts should use Bash with
set -euo pipefailand careful quoting. - Node scripts are ESM (
type: module) and should usenode:imports. - Keep installer output clear and actionable.
- Keep package resources small, reviewable, and documented in
README.md. - After implementing a feature or notable behavior change, consider whether
README.mdshould be updated before calling the work complete. - Prefer explicit paths over implicit environment defaults when writing settings.
- Use short imperative commit subjects, e.g.
Add isolated tlh installer. - Scope commits to one logical change.
- Before committing, review staged files with:
git diff --cached --stat
git diff --cached- Every GitHub issue should carry a type label (
bug/enhancement/documentation) plus anarea/*label, and be tracked in the TLH Roadmap project. - If a Github issue is picked up, move it to
In Progressin the TLH Roadmap. Once work is merged, move it toReady for release. If released, tag it with the release it went out with, and move it toDone.
- At the start of any task, run
gn help planand follow its instructions. - After finishing a task, run
gn help review. - Always commit gnosis entries with the relevant work.
- Always merge gnosis conflicts as a union, keeping both sides.
- Before final handoff or review for TLH repository work, load and apply the repo-local hygiene skill at
.pi/skills/tlh-dev-hygiene/SKILL.md. - The
tlh-dev-hygienechecklist is for TLH repository contributors only; it is not part of the packaged end-user tlh workflow. - For TypeScript boundary parsing or open-object decisions, load
.pi/skills/tlh-typescript-boundaries/SKILL.md. - This project uses a CLI ticket system for task management. Run
tk helpwhen you need to use it. - If the human links you a PR comments, or pastes you one, do not take it at face value — instead, investigate if valid and report back first. Do not start fixing it immediately.
- If the human asks you to open a PR, after creating it check CI/status checks and investigate PR comments/review comments. Address valid findings; resolve or dismiss invalid or non-actionable comments with rationale.