Git exports GIT_DIR to the hooks it runs, so under the run-tests pre-push
hook the validate-provenance-skill.bats fixtures' `git -C "$tmp"` calls
resolved to this repo: 84 failures, core.bare=true and an emptied index on
every push. run-tests.sh now unsets git's repo-locating variables before
any suite runs. Reproduced with GIT_DIR pointed at a throwaway repo (61
failures) and verified clean after the fix (463/463).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
@@ -141,3 +141,7 @@ The pre-push `run-tests` failed 2 of 3 full runs, on a different suite each time
## 2026-09-16 — A static guard covers exactly the spellings its regex models
## 2026-09-16 — A static guard covers exactly the spellings its regex models
The guard added above (`tests/test-no-pipefail-early-exit-grep.sh`) reported the tree clean the day it landed, and the tree was not clean. Its pattern could not see a multi-stage pipeline (`echo x | filter | grep -q y`), a pipeline wrapped after a trailing `|`, or `set -o errexit -o pipefail` — the last a file-level miss that silently skipped every site in that file. Five live vulnerable sites sat in `tests/test-apm-current-hook.sh` while the suite reported green, and the fixtures carried 4 of the 12 vulnerable spellings that turned out to exist. A clean verdict from a static scanner is a claim about its regex, not about the tree. Fix: before trusting one, enumerate the spellings of the defect and measure the miss surface against them; and write the scanner's remit and its known false-positive shapes into the gate's own documentation, so the next reader knows what the green covers.
The guard added above (`tests/test-no-pipefail-early-exit-grep.sh`) reported the tree clean the day it landed, and the tree was not clean. Its pattern could not see a multi-stage pipeline (`echo x | filter | grep -q y`), a pipeline wrapped after a trailing `|`, or `set -o errexit -o pipefail` — the last a file-level miss that silently skipped every site in that file. Five live vulnerable sites sat in `tests/test-apm-current-hook.sh` while the suite reported green, and the fixtures carried 4 of the 12 vulnerable spellings that turned out to exist. A clean verdict from a static scanner is a claim about its regex, not about the tree. Fix: before trusting one, enumerate the spellings of the defect and measure the miss surface against them; and write the scanner's remit and its known false-positive shapes into the gate's own documentation, so the next reader knows what the green covers.
## 2026-11-13 — Hook-exported GIT_DIR turned test fixtures loose on the real repo
Under the `run-tests` pre-push hook, git exports `GIT_DIR` to the hook, so a bats fixture's `git -C "$tmp" init/commit/update-ref` hit this repo instead of its temp dir: 84 failures, `core.bare=true` and an emptied index on every push. The 2026-07-05 "repo root is a bare checkout" entry was likely this bug's symptom, not the repo's real shape. Fix: `tests/run-tests.sh` unsets git's repo-locating env vars before any suite runs. Rule: a test that builds its own repo must never inherit the caller's git environment.
@@ -16,6 +16,18 @@ Use the plugin skills, which wrap the Gitea MCP tools (`mcp__gitea__*`); do not
- Apply triage state with the `Status/*` labels mapped in `docs/agents/triage-labels.md`.
- Apply triage state with the `Status/*` labels mapped in `docs/agents/triage-labels.md`.
- "Publish to the issue tracker" means create a Gitea issue; "fetch the relevant ticket" means read it with `gitea-issues`.
- "Publish to the issue tracker" means create a Gitea issue; "fetch the relevant ticket" means read it with `gitea-issues`.
## Wayfinding operations
How the `wayfinder` skill's map and tickets map onto Gitea, which has native issue dependencies but no sub-issues.
- **Labels**: the skill's `wayfinder:<x>` labels are expressed as the Gitea scoped labels `Wayfinder/<X>`, matching the repo's `Scope/Value` convention: `wayfinder:map` is `Wayfinder/Map`, `wayfinder:research` is `Wayfinder/Research`, and so on.
- **Map**: an issue labelled `Wayfinder/Map`, paired with a milestone of the same title (`Map: <name>`).
- **Child ticket**: an issue whose body starts with `Part of #<map>`, assigned to the map's milestone, carrying exactly one type label (`Wayfinder/Research`, `Wayfinder/Prototype`, `Wayfinder/Grilling`, `Wayfinder/Task`) and no `Status/*` label.
| Shape | First-party description | Fit for spec → code → review |
|---|---|---|
| Orchestrator–worker | "a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results" [S1]. A lead agent with parallel subagents [S2]. "Agents as tools… manager keeps control" [S8]. ADK "Coordinator/Dispatcher" and "Hierarchical decomposition" [S9] | **Primary.** It is the one shape every harness supports natively (subagents) |
| Pipeline / hand-off | Prompt chaining [S1]. ADK "Sequential Pipeline… hands the baton" [S9]. OpenAI "handoffs: a triage agent routes… specialist takes over" [S8] | Good for phase boundaries (spec → tickets → code), each phase being a fresh session |
| Generator–critic / review loop | Evaluator–optimizer [S1]. ADK "Generator and critic", "Iterative refinement" [S9] | Good for review. `code-review` is already a two-critic fan-out |
| Parallel fan-out / gather | Parallelisation [S1]. ADK "Parallel Fan-Out/Gather" [S9] | Good for read-heavy work. Codex: be careful with write-heavy parallel work [S12] |
| Peer team with a shared task list | Claude Code agent teams: lead, teammates, a shared task list with blocking, and mailboxes [S7] | **Experimental and Claude-only.** Vendor advice is to "start with research and review", because parallel implementation brings coordination problems [S7] |
**State without a provider runtime.** First-party sources converge on *external artifacts passed by
reference*:
- Anthropic: "Subagents call tools to store their work in external systems, then pass lightweight
references back to the coordinator" [S2].
- Delegation needs "an objective, an output format, guidance on the tools and sources to use, and
clear task boundaries" [S2].
- ADK passes state through `session.state`, with each agent writing to an `output_key` [S9]. That
is runtime-specific. Its portable equivalent is a file or an issue.
- Claude agent teams keep their task list in `~/.claude/tasks/…`. That is session-scoped and
"one team per session", so it is not portable and not shareable [S7].
The portable carriers are therefore these:
- **Issue tracker:** tickets, native blocking links as the task graph, assignee as the claim,
comments as the resolution record. This is the mechanism `wayfinder` and `implement-spec` already
use.
- **Git:** an integration branch per spec and one worktree plus branch per worker
(`implement-spec`).
- **Files:** research notes, specs and ADRs.
- **AGENTS.md:** standing conventions. More than 20 tools read it, including Codex, Copilot's
coding agent, Cursor, Gemini CLI, Jules, Devin, Zed and VS Code [S20].
## 3. What is portable across harnesses
| Primitive | Portable? | Evidence |
|---|---|---|
| Skill (`SKILL.md`) | **Yes.** It is the open standard, and apm copies it verbatim to every target (`.agents/skills/` for most, `.claude/skills/` for Claude) | [S6]. `plugins/kyberforge/docs/research/docs/microsoft-apm/agent-primitive-schema.md:64-66` |
| AGENTS.md | **Yes.** It is read natively by 20+ tools | [S20] |
| Agent (`.agent.md`) | **Partly.**`name`, `description` and the body survive everywhere apm deploys agents. Claude, Copilot and Cursor get a verbatim copy. Codex gets a TOML rebuild in which `model` and `tools` are dropped. Kiro strips `name`. Apm's research records that Gemini and Windsurf get no agent at all | `agent-primitive-schema.md:27-37`. ADR-0016 |
| Tool fence on an agent | **No.**`tools:` vocabularies conflict. `disallowedTools` is honoured by Claude, but its meaning on Copilot is unverified, and Codex drops it | ADR-0016 and its 2026-08-14 amendment. Codex: "To prevent edits, set sandbox and approval controls on the parent session, not in agent instructions" [S12] |
| Skill preload on an agent (`skills:`) | Claude only. Agent-team teammates ignore it even in Claude [S7] | [S4], [S7] |
**A gap to verify.** Apm's research says Gemini "has no agents primitive" (`agent-primitive-schema.md:37`).
Gemini CLI now documents `.gemini/agents/*.md` subagents, with `name`/`description`/`tools`/`model`
frontmatter, enabled by default [S13]. Cursor reads `.claude/agents/` and `.codex/agents/` as
compatibility paths [S14]. Apm's Gemini mapping may therefore be stale. Check the current apm
release before relying on it either way.
Consequence: in this repo, **a role agent can portably carry only a name, a description and a body
of prose.** So a generic-role agent is cheap to make portable. A specialist agent whose value
depends on a tool fence or a skill preload is not portable at all.
## 4. Verdict on the `*-orchestrate` agents
The three agents are `git-orchestrate`, `gitea-orchestrate` and `apm-orchestrate`
(`plugins/{git,gitea,kyberforge}/.apm/agents/`). Each is a dispatcher for one tool domain. An
*agent* caller sends it an `operation` plus `confirm`. It enforces "Hard rules", routes to that
domain's skills, and returns JSON.
| Aspect | Judgement | Basis |
|---|---|---|
| Narrow job, an isolated context, a structured result | **Accepted** | Codex "narrow and opinionated" [S12]. Anthropic's delegation contract (objective, output format, boundaries) [S2]. ADK Coordinator/Dispatcher [S9] |
| Read-only fence (`disallowedTools` on gitea/apm) | Accepted intent, **Claude-only effect** | §3 above. On Codex the fence is dropped, and the vendor says to put it on the session instead [S12] |
| Specialised by *tool domain* (git, Gitea, apm), not by function | **Outlier.** In the sources reviewed, no vendor or framework puts a dispatcher agent between an agent and a set of skills. The vendor pattern is that the working agent loads the skill itself [S4], [S5], [S17] | §1 |
| "Hard rules" restated from the domain skills | **Anti-pattern** (GLOSSARY "Delegation discipline": restatement). `git-orchestrate` says it outright: "Sub-skills carry their own local copies of these rules" | `plugins/git/.apm/agents/git-orchestrate.agent.md` |
| Safety gates enforced only by the prompt (`confirm: true`, never force-push `main`) | **Anti-pattern for invariants.** Governance makes deterministic tooling the enforcement layer ("Agent instructions alone cannot enforce what deterministic tooling must enforce"), and vendors put it in session permissions or hooks [S7], [S12] | `core/instructions/governance.md`. Pre-push hooks in `.pre-commit-config.yaml` are the repo's existing deterministic layer |
| Code-smell view | "Middle Man: a class or function that mostly just delegates onward → cut it" | mattpocock `code-review` baseline |
Net: **an outlier, not accepted practice for a team pattern.** The parts worth keeping are the
domain gotchas, such as the Gitea `delete_release` id-versus-tag asymmetry and 404-means-forbidden.
Those belong in the domain skills. Irreversible-action gates belong in hooks and permissions. A
generic implementer or operator agent would then call `git-commits` or `gitea-prs` directly, which
also saves a nesting level against Claude's default subagent depth limit of three [S4].
`lint-runner` is the one agent of this kind that sits closer to accepted practice: it is a
| Fog → decisions | `wayfinder` (tracker map, typed tickets, frontier, claim by assignee, research subagents on `research/<name>` branches) | Research subagent |
| Code | `implement` (single session), `implement-spec` (integration branch, frontier-driven parallel implementers in worktrees, merger subagent, "communicate primarily through context pointers") | Exploration, implementer and merger subagents |
| Test-first | `tdd`, `codebase-design` | — |
| Review | `code-review` (Standards and Spec as parallel fresh-context subagents, not merged or reranked) | Standards reviewer and spec reviewer |
| Learn | `retro` | — |
`implement-spec` already *is* the orchestrator–worker shape with tracker and git state that §2
recommends. Its roles are generic (implementer, reviewer) and load skills (`tdd`). So the pipeline
and the generic roles are covered. What is not covered:
1.**No named role-agent files.** The roles exist only as prompts inside the orchestrating skill,
so they cannot carry a tool fence and cannot be reused on their own.
2.**No operator or deploy role.** Nothing covers plan/apply against infrastructure with a HITL
gate. Today that is the infra package's territory.
3.**The entry points are hand-invoked only.**`wayfinder`, `to-tickets`, `to-spec`, `implement`,
`implement-spec` and `triage` set `disable-model-invocation: true`, so another agent cannot
route to them through the Skill tool (`plugins/mattpocock/apm.yml` comments). A team package
could not chain them autonomously without a local wrapper.
4.**There is a tracker dependency.** They read the tracker doc that `setup-matt-pocock-skills`
writes, and here that is Gitea through the `gitea-*` skills (`docs/agents/issue-tracker.md`).
## Options for the map (evidence, not a decision)
| Option | For | Against |
|---|---|---|
| A. No team package. Use `mattpocock` as is, and the infra package adds tool skills only | Zero new surface. Matches vendor guidance and §5 coverage | Roles stay unfenced prompts, and the pipeline is hand-driven stage by stage |
| B. **Thin generic-roles package** (recommended): `planner`, `implementer`, `reviewer`, optional `operator` agents, each a short body that names the skills to load. Reviewer and planner fenced read-only with `disallowedTools`. State in Gitea and branches | Matches what vendors ship ([S4], [S12], [S13]). Portable as name, description and body. Reusable as subagents and as Claude teammates [S7] | Fences hold on Claude only. Needs a skill-level wrapper to start the hand-invoked `mattpocock` entry points |
| C. Role-specialist roster (`ansible-engineer`, `k8s-reviewer`, …) | Familiar from CrewAI and community catalogues | Linear description cost, overlapping implicit decisions [S3], no vendor precedent, couples the team to the infra domain, which the brief rules out |
## Sources
Primary sources were fetched 2026-11-12. Quotations are verbatim from the fetched page.
- [S4] Claude Code docs, "Subagents" — <https://code.claude.com/docs/en/sub-agents>
- [S5] Anthropic, "Equipping agents for the real world with Agent Skills" — <https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills>
- [S9] Google Developers Blog, "Developer's guide to multi-agent patterns in ADK" — <https://developers.googleblog.com/en/developers-guide-to-multi-agent-patterns-in-adk/>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.