This guide is for AI agents and human operators recovering context in the Graft repository.
- NEVER amend commits.
- NEVER rebase or force-push.
- NEVER push to
mainwithout explicit permission. - NEVER create draft pull requests.
- NEVER open a pull request before the local retro for the cycle has been completed, committed, and validated. PR creation is a Ship step, not a Retro substitute.
- NEVER use a
codexprefix in branch names, PR titles, or commit messages. - Always use standard commits and regular pushes.
- When opening pull requests, include
Closed #XYZreferences for every GitHub issue the PR closes.
Only write tests that assert actual Graft software invariants, behavior, and
acceptance criteria. Do not write tests that merely assert design document
formatting, markdown structure, incidental wording, or brittle strings in
stdout/stderr. When command output is the product surface, assert stable
semantics, structured data, or user-visible behavior rather than fragile
phrasing. Write good tests.
Before calling a PR merge-ready, follow the merge gate in
CODE_STANDARDS.md. The review requirement is third-party review, not a fixed
number of GitHub approvals.
- Treat CodeRabbitAI and Codex reactions or acknowledgement comments as pending, not complete review.
- Wait for a substantive follow-up: clean final result such as
LGTM, no actionable comments, or review issues that must be fixed or explicitly accepted. - If CodeRabbitAI is in cooldown, rate-limited, or out of credits, post
@codex review please. - If a CodeRabbitAI cooldown comment says to check back after a wait window,
compare that window to the comment's last-updated timestamp. Wait out the
remaining time if still inside the window; if the window has expired and no
review is pending or complete, post
@coderabbitai review please. - The requirement is met when every successfully requested reviewer for the current PR head has finished and no actionable review issue remains open.
- Green CI on the current PR head is always required unless the operator explicitly overrides the gate.
Do not infer release or publish state by waiting on a coarse progress display. When a workflow looks slow, inspect the workflow and the job state directly.
Releases are tag-driven from main. A release must only occur from a commit
that is already on main and tagged with the release version, for example
v1.2.3. Merge release-prep work to main first, create the version tag on
that main commit, then push the tag and let GitHub Actions deploy that tag.
Do not cut releases from release branches, PR heads, local-only commits, or
untagged commits.
Required release-debug sequence:
- Read the workflow that owns the behavior, usually
.github/workflows/release.yml, before guessing what the run is doing. - Query the run and jobs:
gh run view <run-id> --json status,conclusion,jobs,url,workflowName,event,headBranch,headSha. - If a job is still active, inspect the active step from the job list. Do not call it stuck unless the job is not advancing or the logs prove a blocker.
- If a job failed, inspect logs through Actions:
gh run view <run-id> --job <job-id> --log. Ifghsays logs are unavailable while the job is in progress, use the job state first and wait only with a stated reason. - For npm publish, verify delivery from the registry:
npm view @flyingrobots/graft version dist-tags time --json. The registry result is the publish truth; the GitHub Release asset upload is not npm delivery. - Record the run id, job outcomes, GitHub Release URL, and npm registry result in the release witness. Do not claim publish success until both the Actions publish job and registry query agree.
For tag-triggered releases, sanity, GitHub Release creation, and npm publish are
separate jobs. Treat each job as its own gate. If publish is slow, inspect the
publish job and npm registry state instead of assuming the publish step is
hung.
Do not audit the repository by recursively walking the filesystem. Follow the authoritative manifests:
Design packets come first. Before implementation, repair, or RED/GREEN work on
a backlog item, pull the work into docs/design/ and make the hill, acceptance
criteria, playback questions, and non-goals explicit. Implementation starts
from that packet, not from an unrecorded chat plan.
README.md: Public front door, core value prop, and quick start.GUIDE.md: Orientation, fast path, and system orchestration.docs/SETUP.md: Detailed per-editor MCP and hook configuration.
ARCHITECTURE.md: Authoritative structural reference (Ports, Adapters, WARP).docs/VISION.md: Core tenets and the provenance-aware mission.METHOD.md: Repo work doctrine (Backlog lanes, Cycle loop).CODE_STANDARDS.md: Code Lawyer audit standards, Red-Green repair loop, and merge-gate doctrine.
docs/BEARING.md: Current execution gravity and active tensions.docs/method/backlog/: The active source of truth for pending work.docs/design/: Active and landed cycle design documents.
CHANGELOG.md: Historical truth of merged behavior.docs/audit/: Structural health and due diligence reports.
When starting a new session or recovering from context loss:
- Read
docs/BEARING.mdto find the current execution gravity. - Read
METHOD.mdto understand the work doctrine. - Read
CODE_STANDARDS.mdbefore review, release, or PR repair work. - Check
docs/method/backlog/asap/for imminent work. - Check
git log -n 5andgit statusto verify the current branch state.
After altering files:
- Verify Truth: Ensure documentation is updated if behavior or structure changed.
- Log Debt: File bad-code items to
docs/method/backlog/bad-code/(one file per concern). - Log Ideas: File cool ideas to
docs/method/backlog/cool-ideas/(one file per idea). - Commit: Use focused, conventional commit messages. Propose a draft before executing.
- Validate: Run checks appropriate to the changed surface. For
docs/process-only edits,
git diff --checkandpnpm lintare enough unless the document is an executable/product contract. Do not run the full runtime suite just because prose changed. - Push: Push to origin after every commit.
At the end of every turn where you interacted with the user, present:
- Cycle stepper: Use the Bijou MCP
bijou_stepperto show current cycle progress (PULL → RED → GREEN → Playback → Drift → Retro). - Summary: What you did this turn — cycles completed, files changed, tests passing.
- Backlog items filed: List any
bad-code/orcool-ideas/cards you committed this turn. Don't just call them out verbally — they must be files in the backlog, committed and pushed. - Questions for the user: Surface any open questions, ambiguities, design decisions, or things you noticed that need the user's input. Important questions get buried in long turns — this section prevents that. Keep it short and actionable.
The goal is inevitability. Every feature is defined by its tests.