Agent-First Development Workflow¶
TermVerify is developed so that human developers and autonomous coding agents can follow the same evidence-producing loop.
Tight loop¶
- Orient: read
AGENTS.md, the smallest relevant knowledge pages, and executable sources of truth. - Specify: express one observable behavior as a unit test, property, or transcript expectation; semantic snapshot expectations are
[planned](see the evidence hierarchy below). - Red: run it and observe the expected failure.
- Green: make the minimum implementation change.
- Exercise: drive the application through the appropriate adapter; use the terminal adapter when the user-facing terminal path is relevant, injecting
ConptyBindingorPosixPtyBinding— only the Windows path is proven end to end today, so a POSIX result is evidence about the binding rather than about the pipeline until issue #269 lands. - Review: inspect diffs and reports, then run the wider quality gate.
- Preserve: turn every discovered bug into durable, replayable evidence.
Context budget¶
Always-loaded instructions must stay short. Use this retrieval order:
AGENTS.md
→ docs/knowledge/index.md
→ one or two relevant concept documents
→ source/tests for the exact behavior
Do not paste architecture dumps, old handovers, generated wiki pages, or volatile issue state into AGENTS.md.
Parallel worktrees¶
Use Git worktrees when independent, reviewable changes can proceed without editing the same public API or test fixture. The default layout is external sibling worktrees, not nested copies inside this repository:
C:\Users\<user>\Programming\Python\Projects\termverify # clean integration checkout
C:\Users\<user>\Programming\Python\Worktrees\termverify\
adapter-contracts\
conpty-spike\
docs-phase1-reconciliation\
An external layout prevents recursive repository scans, editor indexing, test
discovery, and agent context retrieval from crossing into other working copies.
Git still stores the worktree metadata in the primary checkout's .git
directory. A tool-specific nested location such as .claude/worktrees/ is
allowed for that tool, but is not the repository's canonical layout.
Create worktrees from an updated integration checkout and keep all Windows worktrees on the same volume:
git fetch origin
git worktree add -b feat/adapter-contracts \
/c/Users/<user>/Programming/Python/Worktrees/termverify/adapter-contracts \
origin/main
Rules:
- Assign exactly one writing agent and one branch to each worktree.
- Give every agent an explicit working directory; do not let it edit the integration checkout or another agent's worktree.
- Keep the integration checkout on
mainand clean except while integrating a reviewed change. Do not develop directly in it. - Run
uv --no-config sync --all-groups --lockedin each new worktree before development. The shared uv download cache is safe; generated outputs remain isolated by worktree. - Do not parallelize competing edits to public API/types, shared fixtures, or the same test modules. Sequence dependent work behind an accepted contract.
- Give each worktree a focused issue, PR, and validation evidence. A worktree is not a substitute for a branch or review boundary.
- After merge, remove the physical worktree before deleting its local branch:
git worktree remove /c/Users/<user>/Programming/Python/Worktrees/termverify/adapter-contracts
git branch -d feat/adapter-contracts
git worktree prune
Worktree-specific agent prompts live under docs/agent/prompts/; use them as
starting context, then inspect the current issue, branch, and source before
editing.
Handover lifecycle¶
Handover documents preserve the verified context needed to transfer a bounded initiative or phase. They are not task trackers: GitHub issues, pull requests, and Git remain the source of truth for volatile work state.
Create one handover under docs/agent/handovers/ when an initiative crosses a
meaningful ownership, phase, or context boundary. Name it
<initiative>-handover.md. An active handover must state its status, optional
owner, whether review is required, scope, verified current state, decisions,
risks, next actions, validation evidence, and completion or supersession
criteria.
Use these statuses:
- draft: proposed context, not yet accepted as the working handover;
- active: the current handover for its initiative;
- blocked: active work cannot proceed without an explicit decision or external dependency;
- complete: all documented completion criteria have been verified;
- superseded: a named successor replaces this handover.
Update handovers only at meaningful transitions and record evidence rather than copying issue-by-issue progress. A handover that changes architectural decisions, protocol commitments, security posture, or baseline governance requires human-readable independent review.
When a handover becomes complete or superseded, move it to
docs/agent/handovers/archive/ and update
docs/agent/handovers/index.md with its final status and successor, if any.
Do not delete it: the archived document and Git history preserve the rationale
needed for future work. index.md is navigation only; it must not duplicate
the handover's volatile detail.
Evidence hierarchy¶
Prefer, in order:
- direct semantic assertions over internal state/events;
- deterministic transcript replay;
- property/state-machine checks — write these directly with Hypothesis
today, as this repository's own suite does; TermVerify-specific harnesses
are
[planned]; - differential comparisons where a genuine reference exists;
[planned] - reviewed UI semantic snapshots;
[planned] - raw ANSI text only as diagnostic evidence.
[planned] marks machinery TermVerify does not ship yet — see
the product vision for its sequencing. The
marker does not demote a layer: where stock tools can already produce the
evidence, as Hypothesis does for layer 3, the preference order stands as
written. The full model is in
the verification model.
Review boundaries¶
An agent may generate code, fixtures, and candidate baseline updates. It must not approve its own snapshot/golden-master change. Changed expected behavior in the TermVerify repository requires a human-readable report and explicit human approval under the accepted independent-review or maintainer-self-review mode. This does not prescribe the baseline policy of downstream projects.