Skip to content

agent-ops

Operations tooling for the Poetic autonomous agent pipelines: the implementation cycle (agent-cycle.sh), the repository-review cycle (review-cycle.sh), the Pipeline Monitor (monitor-cycle.sh), and the local dashboard (dashboard/). README.md is the landing page; docs/guides/ explains what the pipelines do and how to configure, install, pause, and monitor them; docs/spec/ holds the as-built requirement specifications for each component; prompts/ holds the runtime prompts the pipelines pass to their agents.

For a map of all documentation and how to find answers to common questions, see docs/README.md.

Each component has an as-built requirements specification in docs/spec/:

  • docs/spec/implementation/README.md — implementation pipeline
  • docs/spec/review/README.md — repository-review pipeline
  • docs/spec/monitor.md — Pipeline Monitor
  • docs/spec/dashboard/README.md — monitoring dashboard

The specifications are requirement documents: they describe the system as it actually exists. A change that alters what a component does, requires, or produces must land in the same PR as the spec edit that keeps its document accurate. To resolve a citation of a specific requirement, acceptance check or component (requirement 17a, IMPL AC 1g, REV R5, MON M4), run scripts/spec.sh show <label> rather than opening and searching the spec file by hand.

For the full details on working with the as-built specifications — understanding the rule, resolving a citation, finding governing requirements, adding new ones, and handling specification splits on in-flight branches — see docs/guides/contributing/README.md § “The as-built rule in practice”.

Five types of generated regions exist in this repository:

  1. Configuration tables — rendered from config.schema.json by scripts/render-config-table.sh. Never hand-edit a row inside <!-- config-table:start … --> regions; edit the schema instead, then regenerate.

  2. Table of contents — guides have <!-- toc:start … --> markers; specs have directory-wide ones. Rendered by scripts/render-toc.sh. Never hand-edit between the markers; edit headings instead, then regenerate.

  3. Stamped regions — the three <!-- agent-info:start fragment=... --> regions in this file carry shared organization text, stamped from Pullwright/.agent. Never hand-edit inside them; change the source fragment, then re-stamp.

  4. The labels table — docs/reference/labels.md’s <!-- labels-table:start … --> region, rendered from lib/labels.sh’s catalogue by scripts/render-labels-table.sh. Never hand-edit a row; edit the catalogue (or that script’s own metadata) instead, then regenerate.

  5. The scripts index — docs/reference/scripts.md’s <!-- scripts-index:start … --> region, rendered from every script’s own header comment under lib/ and scripts/ by scripts/render-scripts-index.sh. Never hand-edit a row; edit the script’s own header comment instead, then regenerate.

For the full workflow — how to make changes to configuration, when to regenerate, which checks to run — see docs/guides/contributing/README.md § “Generated and stamped regions”.

lib/markdown-scan.sh lists every generated region. The renderers read from this list, and scripts/check-docs.sh excludes these regions from the documentation size budget.

main is protected: it does not accept direct commits or pushes, from anyone or anything, including maintainers and AI agents. Every change goes through a pull request. A repo ruleset scoped to the default branch restricts merges into main to squash only (other branches allow any merge method) — so a pull request’s title becomes the subject line of the single commit that lands on main. Write that title in Conventional Commits format (see “Commit messages” below); the individual commits on the branch are discarded when squashed, so only the title needs to conform. The squash commit’s body is pre-filled from the pull request’s description (GitHub repo setting squash_merge_commit_message: PR_BODY), so a filled-in PR description carries through to main’s history — write one whenever the change needs more context than the title alone gives.

Because every change is gated by a PR and CI regardless of who or what proposes it, agents work autonomously up to the PR stage: commit, push a branch, and open the pull request without pausing to ask permission first. Review happens on the PR, not before it — the repo owner reviews there and requests changes if needed. This does not extend to actions on main itself (direct commits/pushes are rejected by the branch protection anyway) or to force-pushing/merging, which still require explicit instruction.

All Poetic-Poems and Pullwright repositories, this one included, operate in a multi-agent environment: autonomous and interactive agents, and the maintainer, may push branches, merge pull requests, and move main at any time. Before commencing any changes, make your own dedicated fresh clone of origin/main and work in that — never in a checkout shared with anyone else, such as the user’s working copy (which may be edited at any moment) or a clone another agent is already using:

Terminal window
git clone --filter=blob:none https://github.com/Pullwright/agent-ops.git <scratch-dir>/agent-ops

A blobless clone is the default: it keeps the full commit history, so rebasing onto a moved main, git log, git blame and merge-base all just work, and it fetches file contents only as they are read. It is the default because you cannot reliably know in advance whether a task will need history, and the two ways of guessing wrong are not symmetric — a blobless clone that never needed history has cost a little metadata, whereas a shallow clone (--depth 1) has no merge base and must be deepened (git fetch --unshallow) before it can rebase. Use --depth 1 only where nothing will rebase or read history, and a full clone where you want every blob locally. Commit, push the feature branch, and open the pull request from that clone; delete the clone once the work has landed. And when you open the PR, do not assume origin/main is still in the state it was when you cloned — another change may have merged meanwhile, which is why the post-PR mergeable check below is mandatory.

Before starting on any implementation, check for in-flight or prior work on the same problem: open pull requests (gh pr list --search "<keywords>"), open issues, and any claim the autonomous pipeline may hold on the item. These repositories are worked by concurrent autonomous agents, so the work may already be under way; if it is, reconcile first — adopt it, supersede it with an explanation, or stand down — before writing code.

Keep feature branches short-lived and narrowly scoped. Prefer breaking a large piece of work into a series of small pull requests, each a safe, self-contained, independently reviewable and mergeable unit, over accumulating many changes on one long-running branch. As soon as a branch reaches such a unit of work — coherent on its own, with CI passing — open it (or mark an existing draft) as “Ready for review” rather than holding it back to bundle in more. Smaller PRs review faster, land sooner, and keep branches close to main, which minimises the divergence and conflicts that long-running branches invite. Split off follow-on work into its own branch and PR.

A pull request’s readiness state is the signal the maintainer reads. Open it as a draft (gh pr create --draft) while its content is still changing, its tests are unproven, or a correction is still on its way, and mark it Ready only when it may merge exactly as it stands: a Ready, green, unconflicted pull request may be put into the merge queue at any moment, and once queued its head branch refuses further pushes (the queue lock, not a permissions problem — stack any further change on a fresh branch instead). A “do not merge” note in the description is not a substitute for Draft.

In this workspace, a local post-checkout Git hook in .githooks/ refreshes the local main branch from origin/main after switching to main, helping keep the branch aligned with GitHub while working locally.

After opening (or updating) a pull request, confirm it is actually mergeable via gh (e.g. gh pr view <n> --json mergeable,mergeStateStatus) — in addition to, not instead of, whatever local checks the agent already ran. The remote can diverge from what the agent last saw locally (another PR merging to main first, for example), so this check has to happen after the PR exists, against GitHub’s own view of it, not inferred from the local working tree. If it comes back conflicting, resolve the conflict (e.g. rebase onto the current main) and push the fix; force-pushing to update a branch still requires explicit instruction, per above.

All commits follow Conventional Commits (<type>[(scope)][!]: <description>, e.g. fix(build): resolve output path). Allowed types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test. A commit-msg hook (.githooks/commit-msg) enforces this once a contributor runs git config core.hooksPath .githooks. Because main only accepts squash merges (see “Branch workflow” above), the pull request title is what actually becomes the commit on main — CI (.github/workflows/commit-format.yml) checks both the PR title and every commit on the branch.

This project presently has a single maintainer. The one approving review that the main ruleset requires (it is a required review, not a code-owner review — CODEOWNERS lists @warwickallen and @Warwick-Allen only so that a reviewer is requested automatically) is given either by that maintainer’s own second GitHub account or by the Pullwright Approver App acting on the maintainer’s behalf — one person, two handles, one email throughout the git history — so it is self-review by design, not independent peer review; a reader (human or agent) should not infer otherwise from the branch-protection description above. There is also no succession plan: if the maintainer becomes unavailable, no one else currently holds equivalent access or repo context. The multi-agent conventions in this file manage concurrent agents working on the repo at once; they do not substitute for independent review or bus-factor redundancy.

The pipelines this repo hosts already follow the dedicated-clone rule by construction: every cycle clones its target repo fresh from GitHub into workspace_root and deletes the clone afterwards, and the user’s own checkouts under ~/Code are never touched.

A pull request whose head branch is named agent/<n> is, to CI, an issue-sourced work order: .github/workflows/closing-keyword.yml fails it unless the body carries both the <!-- agent-ops:closes-issue item=<n> --> marker and a real closing keyword (Closes #<n>) for that issue — see requirement 1b of docs/spec/implementation/requirements/the-script-01.md. An interactive session that opens such a branch must write both; a body edit (gh pr edit <n> --body-file …) re-runs the check.

Run the suite through ./scripts/run-tests.sh, which copies the working tree into a throwaway container from the image; the host’s tools and a docker exec into a live node both fail tests on a pristine main (see docs/guides/contributing/README.md §“Running the tests” for why). A test asserts that config.json is valid — it matches the schema and doctor.sh accepts it — and never what it says: every fixture supplies its own values by mutating test/fixtures/config-base.json or writing its own block, and a check that really is about the shipped file reads its values back through config_defaults, the same resolution the code uses, rather than repeating them. A routine configuration change must not break a test.

  • The changelog entry lives in the pull request, not in a file the change edits. A notable change (one an operator of the pipeline would notice) records itself under a ## Changelog heading in the pull request’s description: one or more of the six Keep a Changelog category sub-headings — ### Added, ### Changed, ### Deprecated, ### Removed, ### Fixed, ### Security — each followed by bullet points written for that audience. A change that is not notable — a patch-level fix, a routine documentation update — says so with the single line None. under the same heading, so the omission is visibly deliberate rather than forgotten. A pull request whose title’s type is feat, fix or perf, or which carries the ! breaking-change marker, must carry the section, even if only to say None.; other types may omit it. The squash merge carries the description onto main as the commit message, and CHANGELOG.md (Keep a Changelog format) is assembled from those commit messages by the release pull request — or, in a repository that does not cut releases, by the scheduled roll — which is the only pull request that edits the file. Two pull requests therefore never conflict over the changelog.
  • All other docs are as-built. Write them to describe the current state only — no “previously”, “used to be”, “now uses”, “migration completed”, or “old format (deprecated)” phrasing. Git log already records history; docs that repeat it become misleading as the codebase evolves.
  • If you encounter historical language in an existing doc, remove it and move the substance into your pull request’s ## Changelog section if it is significant.

When you defer work, take a shortcut, or notice a known gap, record it — do not leave it only in a commit message or in chat. Tech debt is filed as a GitHub issue labelled pw::type:tech-debt, not as a file in this repository: dedup-search first (gh issue list --label pw::type:tech-debt --search "<working title>"), and cite an existing hit instead of filing a second one. File the issue with the shortcut and its provenance in the body (e.g. “Noticed while working #631”), then add a Defers: #<n> line to the pull request that noticed it — never a closing keyword, since deferring is not resolving.

Resolve a tech-debt issue by closing it with a real closing keyword (e.g. Fixes #<n>) in the pull request that fixes it, plus a fenced td-record block in that pull request’s body (issue, title, filed, summary, resolution) — the squash-merge commit then carries the permanent record into main’s own immutable history, since a GitHub issue is mutable and editable but main’s history is not. Where the issue names a frozen register file (its body’s final line reading “Filed as tech-debt/<id>.md, .”), the same pull request must also flip that file’s frontmatter to a terminal status: — see TECH-DEBT.md’s “Resolution and history” — which scripts/check-closing-keyword.sh enforces mechanically.

tech-debt/ is a frozen historical archive of the per-item register this repository used before this policy: every record ever allocated under scope PPagop, kept in place forever — never deleted or renamed, and never edited beyond the terminal-status: frontmatter flip above, which leaves each record’s body exactly as filed. TECH-DEBT.md is a short policy pointer; docs/TECH-DEBT-REGISTER.md in Poetic-Poems/poetic documents the frozen archive’s format, ID grammar and the scope-code registry. Do not add new files to tech-debt/, and do not resurrect the td/<id> claim-branch workflow — both belong to the frozen format, not the current policy.