diff --git a/docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md b/docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md index 0661d2c67d..a1a3eaff22 100644 --- a/docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md +++ b/docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md @@ -6,7 +6,7 @@ epic: null github-issue: 2003 spec-path: docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md epic-owner: josecelano -last-updated-utc: "2026-11-17 08:58" +last-updated-utc: "2026-11-17 16:07" semantic-links: skill-links: - create-issue @@ -35,12 +35,14 @@ semantic-links: - docs/issues/open/2347-2003-triage-post-merge-review-findings/ISSUE.md - docs/issues/closed/2866-2003-move-skills-to-claude-skills/ISSUE.md - docs/issues/closed/2873-2003-shorten-skill-descriptions/ISSUE.md + - docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md - docs/schemas/frontmatter-v1.schema.json - "issue #2264" - "issue #2278" - "issue #2347" - "issue #2866" - "issue #2873" + - "issue #2904" --- @@ -137,7 +139,7 @@ Workflows and hooks can themselves be **composite guardrails** when they orchest - Changing the CI/CD provider, release process, or the external `torrust-linting` project. - Treating every agent instruction as suitable for deterministic enforcement. - Shutdown and runtime task-ownership work. Issue #1586 belongs with shutdown EPIC #1488 and is unrelated to repository automation or agent guardrails. -- Selecting, requiring, or routing work to a named model or vendor for any review or implementation role. +- Selecting, requiring, or routing work to a named model or vendor for any review or implementation role. The one approved exception is issue #2904; see Decisions Recorded on This EPIC. ## Known Existing Issues @@ -197,6 +199,7 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`. | 20 | #2822 - `wait-for-pr-review`: add a `--gh-command` option to name the GitHub CLI command | `docs/issues/closed/2822-2003-wait-for-pr-review-gh-option/ISSUE.md` | DONE | Enhancement to the #2581 poller: the caller names the command, so no `gh` stand-in on `PATH` is needed, and the identity it runs as is reported. Selects no shared runner, cache or policy engine. Independent of the other poller work; spec PR #2826, implemented by PR #2835. | | 21 | #2866 - Move the agent skills to `.claude/skills/` so Claude Code discovers them | `docs/issues/closed/2866-2003-move-skills-to-claude-skills/ISSUE.md` | DONE | Moves the 53 skills to a flat `.claude/skills//` with an index by area and redirect stubs at the old paths, so Claude Code discovers them. Must merge before the custom-agents migration is implemented, because agent definitions name skills. Selects no shared runner, cache or policy engine. | | 22 | #2873 - Shorten the agent skill descriptions so they fit Claude Code's skill listing budget | `docs/issues/closed/2873-2003-shorten-skill-descriptions/ISSUE.md` | DONE | Follow-up of #2866 (its task T1): shortens the 53 skill descriptions to 200 characters or less so the listing fits its 1% budget, fixes the `write-markdown-docs` description that YAML cuts at a `#`, and adds a `frontmatter-validator` rule. Selects no shared runner, cache or policy engine. Spec PR #2875, implemented by PR #2893. | +| 23 | #2904 - Migrate the custom agents to Claude Code and add an explicit orchestrator | `docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md` | TODO | Replaces the ten Copilot profiles in `.github/agents/` with six Claude Code agents in `.claude/agents/`, led by an `orchestrator` that is the session the contributor talks to. Started agents write JSON reply files validated against a schema; a stop hook holds the task reviewer until its reply is valid. Delivered in small pull requests that merge independently, after #2866. Selects no shared runner, cache or policy engine. | Also linked as GitHub sub-issues, outside the order: @@ -298,6 +301,7 @@ These are proposed planning subissues; none has been created. Titles and boundar - Where a product decision lives is settled by the prose-tests ADR that [`docs/issues/drafts/2003-adopt-prose-tests-as-executable-specification/ISSUE.md`](../../drafts/2003-adopt-prose-tests-as-executable-specification/ISSUE.md) drafts. Until that ADR is accepted, both homes are in use: Rustdoc beside the tests that specify the rule, and an ADR. The decision log and impact maps stay deferred until then, and a capability's goal lives in its EPIC's Goal section. - One issue template, with optional and conditional sections marked and no short form, because a second form is another copy to keep in step. The work is this EPIC's planning-template follow-up, not #2278's; the register tracks it as `issue-template-checkpoint-optionality-unmarked` and `create-issue-init-list-omits-conditional-sections`. - **The issue body is a short pointer, not a mirror (2026-11-16, maintainer, [PR #2887](https://github.com/torrust/torrust-tracker/pull/2887)).** The maintainer decided it in a working session with the EPIC coordinator session, not in a GitHub comment; the pull request that carries this entry, which he merges, is its record on GitHub. The mirror rule asked for the body to be re-derived on every change to this file. It was not followed: on 2026-11-16 the body was about 75,000 characters, had 15 of this file's 22 ordered subissue rows and still named the GitHub user da2ce7, whose ownership ended on 2026-11-06, as the EPIC owner. The rule is replaced: the body must hold only stable content, as Issue Body Pointer states, and this file stays the EPIC's record. Replacing the stale body is a separate edit by the maintainer; the change that records this decision does not make it. +- **Named models in #2904 (2026-11-17, maintainer, [PR #2905](https://github.com/torrust/torrust-tracker/pull/2905)).** Issue #2904 is an approved exception to the Out of Scope item about named models. Its decisions D4 and D13 set Opus 5.5 as the minimum for the role that addresses pull-request reviews and pin three review agents to that model's full ID, so its review-rounds measurement is against one known model; its other agents inherit the session's model. The maintainer settled both in the design session of that issue, not in a GitHub comment; the pull request that carries this entry, which he merges, is its record on GitHub. The exclusion holds for every other subissue. ## Friction Register @@ -454,6 +458,7 @@ For each completed subissue in this EPIC, the default completion policy is: - 2026-11-16 08:30 UTC - AI assistant (Claude Code, Claude Opus 5.5, issue #2873 session) - Added row 22 (#2873, shorten the agent skill descriptions) on 2026-11-16 at 08:26 UTC, as #2866's task T1; the description edits wait for #2866 to merge. - 2026-11-16 16:11 UTC - AI assistant (Claude Code, Claude Fable 5.2, EPIC #2003 coordinator session) - Replaced the Issue Body Mirror rule with Issue Body Pointer: the issue body must hold only stable content and point to this file. The body itself is not edited by this change. The decision has no GitHub comment; its record is [PR #2887](https://github.com/torrust/torrust-tracker/pull/2887). Decided by the maintainer on 2026-11-16. - 2026-11-16 17:35 UTC - AI assistant (Claude Code, Claude Opus 5.5, issue #2866 session) - Marked row 21 (#2866) DONE and pointed it at `docs/issues/closed/`: PR #2886 merged on 2026-11-16 at 17:34 UTC and closed the issue; the spec is archived by the close-out PR. +- 2026-11-17 12:14 UTC - AI assistant (Claude Code, Claude Fable 5.2, issue #2904 session) - Two entries in one. Late entry for row 22 (#2873), which was marked DONE on 2026-11-17 at 08:58 UTC without a log line: implemented by PR #2893, specification archived by the close-out PR #2900. Added row 23 (#2904, migrate the custom agents to Claude Code and add an explicit orchestrator), approved by the maintainer; linking it as a GitHub sub-issue is pending. ## Acceptance Criteria diff --git a/docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md b/docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md new file mode 100644 index 0000000000..468c1672da --- /dev/null +++ b/docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md @@ -0,0 +1,753 @@ +--- +schema-version: 1 +doc-type: issue +issue-type: task +status: planned +priority: p1 +epic: 2003 +github-issue: 2904 +spec-path: docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md +branch: "2904-migrate-custom-agents-to-claude-code-spec" +related-pr: null +last-updated-utc: "2026-11-17 16:07" +semantic-links: + skill-links: + - create-issue + - process-pr-review + related-artifacts: + - .claude/skills/create-issue/SKILL.md + - .claude/skills/process-pr-review/SKILL.md + - .claude/skills/wait-for-pr-review/SKILL.md + - .claude/skills/review-task/SKILL.md + - .claude/skills/review-pr/SKILL.md + - .claude/skills/commit-changes/SKILL.md + - .claude/skills/fix-clippy-warnings/SKILL.md + - .github/agents + - .github/agents/README.md + - AGENTS.md + - docs/agents/README.md + - docs/agents/orchestration.md + - docs/adrs/20260420200013_adopt_custom_github_copilot_aligned_agent_framework.md + - docs/adrs/20260821172000_establish_ai_agent_context_capability_and_portability_governance.md + - contrib/dev-tools/checks/agent-review-report-contract/src/main.rs + - docs/templates/ISSUE.md + - docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md + - docs/issues/drafts/2003-separate-ai-harness-cargo-workspace/ISSUE.md +--- + + + +# Issue #2904 - Migrate the custom agents to Claude Code and add an explicit orchestrator + +**Parent EPIC:** #2003 - Overhaul: Automation Tools and AI Agent Guardrails + +## Goal + +Replace the ten GitHub Copilot custom agent profiles in `.github/agents/` with a smaller set of +Claude Code custom agents in `.claude/agents/`, led by an explicit orchestrator agent, so the roles +can be launched again and a role's model can be fixed in its definition. + +The first agent delivered is the one that addresses pull-request reviews, with its model pinned, so +the number of review rounds per pull request can be measured. + +## Background + +### Why migrate + +The maintainer moved from GitHub Copilot to Claude Code. His reasons (2026-11-15): + +- the Claude Code tools are more mature, and the work costs less under its subscription; +- Claude Code is the more widely used of the two, and the other maintainer uses it too; +- he is the only active contributor today, and new contributors are more likely to use Claude Code; +- keeping two AI harnesses compatible is too much work for one person. + +Claude Code reads custom agents only from `.claude/agents/` (project) and `~/.claude/agents/` +(user). It does not read `.github/agents/*.agent.md`. So since the move, none of the ten profiles +has been available, and the handoffs drawn in `docs/agents/orchestration.md` have not run. + +### What the ten profiles did, and what covers it today + +| Profile | What it did | Covered today by | Still happening? | +| --- | --- | --- | --- | +| `copilot-suggestions-handler` | Entry point that processes Copilot review findings through `process-pr-review` | `process-pr-review` skill (all of it) | Yes, by the main session on whatever model it runs | +| `task-reviewer` | Independent check of the acceptance criteria before a pull request; writes `agent-review-reports.md` | `review-task` skill (checklist); the persistence rules are only in the profile | No | +| `pr-reviewer` | Local review of an open pull request; `POST_MERGE_FINDINGS` for a merged one; persists a report | `review-pr` skill (checklist) | Rarely; reviews arrive on GitHub | +| `researcher` | Read-only evidence from other trackers, BEPs and issue trackers | No skill | Ad hoc, without the "facts, not decisions" rule | +| `complexity-auditor` | Audit after every implementation step: cyclomatic count by hand, nesting, function length | Clippy `cognitive_complexity = "deny"` in `Cargo.toml` covers one of its four checks | No | +| `committer` | Review-and-verify commit workflow | `commit-changes` skill (most of it) | Sessions commit themselves; three rules have no other home | +| `implementer` | Test-driven implementation, and it also started the auditor, the task reviewer and the committer | `create-issue`, `fix-bug`, `write-unit-test`, `AGENTS.md` | The main session implements; the handoffs do not happen | +| `planner` | Write and classify specs, decompose, delegate | `create-issue` skill | Yes, through the skill | +| `github-operator` | GitHub operations kept out of the main context | `create-issue`, `link-subissue-to-parent-issue`, `fetch-review-threads`, `resolve-review-threads` | Yes, through the skills | +| `clippy-fixer` | Fix Clippy warnings, one commit per lint | `fix-clippy-warnings` skill | Yes, through the skill | + +Evidence that the independent task review stopped: of the issue folders archived in October 2026, +25 of 48 contain an `agent-review-reports.md`; of those archived from 1 November 2026 to +15 November 2026, 2 of 32 do. The issue template still has a checkpoint for that report. + +Method, on `develop` at the commit "Merge torrust/torrust-tracker#2900": a folder counts as +archived on the UTC date of the oldest commit that added or renamed a file into +`docs/issues/closed//` (`git log --diff-filter=AR --name-only`, committer date); it has a +report when `docs/issues/closed//agent-review-reports.md` exists at that revision of +`develop`, not at the commit that archived the folder: one October folder +(`2413-2410-si-22-1-document-event-flows-and-draft-adr`) received its report in a later commit the +same day, and checking at the archive commit gives 24 of 48. The +counts include EPIC folders: two in October, one of them with a report, and one in November, +without. + +The implementation retrospective was not lost with the profiles: the `create-issue` skill and the +issue template both require the completion review. + +The three `committer` rules with no other home are: check that the issue specification's progress +is current before committing; check that the branch's issue number has an open specification; and +commit `project-words.txt` changes first when one change is split into several commits. The +`run-pre-commit-checks` skill points to "the committer agent spec" for the second. + +### Why the review role comes first + +Review loops have been the main cost of recent work. Pull request #2851 took 14 review rounds, +recorded in `docs/pr-reviews/pr-2851-review/PR-REVIEW.md`. The attribution footers of the commits +that record each round name three models: rounds 1 to 3 Claude Fable 5.2, rounds 4 to 9 Claude +Sonnet (round 4 names Sonnet 5.5, rounds 5 to 9 name Sonnet 5), and rounds 10 to 14 Claude Opus +5.5. The processing log of that record holds 10 entries that correct earlier entries of the same +record. After round 9, the maintainer decided (2026-11-14) that the role that addresses reviews +runs on Opus 5.5 at minimum, and that the result is measured. So five rounds of that pull request +already ran on the model that D13 pins; the baseline for the measurement is the whole pull +request, 14 rounds on mixed models, not a count on one model. A Claude Code agent definition can pin the model, so the role no longer depends on +which model the session happens to use. + +### What Claude Code supports + +Every fact below was checked on 2026-11-15 against the raw text of the official Claude Code +documentation, and each row links the section that states it. The section anchors were derived +from the heading names and not opened in a browser; if one fails, search the page for the heading +in the link text. A row that starts with "Not documented" names the pages that were searched. +Nothing below was run yet; the manual scenarios verify the parts this issue relies on. The +installed version on the day was Claude Code 2.1.318. + +| Fact | Where the documentation says it | +| --- | --- | +| **Agent files** | | +| Project agents live in `.claude/agents/`, user agents in `~/.claude/agents/`; both are scanned recursively. | [Choose the subagent scope](https://code.claude.com/docs/en/sub-agents#choose-the-subagent-scope) | +| Only `name` and `description` are required in the frontmatter. | [Frontmatter reference](https://code.claude.com/docs/en/sub-agents#frontmatter-reference) | +| An unknown frontmatter key is ignored without an error. | [Frontmatter reference](https://code.claude.com/docs/en/sub-agents#frontmatter-reference) | +| `tools` is an allow list, and without it the agent inherits every tool; `disallowedTools` is a deny list. | [Restrict which tools a subagent can use](https://code.claude.com/docs/en/sub-agents#restrict-which-tools-a-subagent-can-use), [Frontmatter reference](https://code.claude.com/docs/en/sub-agents#frontmatter-reference) | +| `effort` is a frontmatter field; it overrides the session's effort level. | [Frontmatter reference](https://code.claude.com/docs/en/sub-agents#frontmatter-reference) | +| **Model** | | +| `model` takes `sonnet`, `opus`, `haiku`, `fable`, a full model ID, or `inherit`. | [Choose a model](https://code.claude.com/docs/en/sub-agents#choose-a-model) | +| The model is the first of: the model the caller passes for one invocation, the frontmatter `model`, `CLAUDE_CODE_SUBAGENT_MODEL`, the main conversation's model. So a caller can override a pinned model. | [Choose a model](https://code.claude.com/docs/en/sub-agents#choose-a-model) | +| `CLAUDE_CODE_SUBAGENT_MODEL` together with `CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1` makes Claude Code ignore the frontmatter `model`. | [Run every subagent on one model](https://code.claude.com/docs/en/sub-agents#run-every-subagent-on-one-model) | +| When an organization's model allow list blocks the pinned model, the agent runs on a substitute model, not an error. | [When an allowlist blocks a subagent model](https://code.claude.com/docs/en/sub-agents#when-an-allowlist-blocks-a-subagent-model), [Restrict model selection](https://code.claude.com/docs/en/model-config#restrict-model-selection) | +| **Starting an agent** | | +| Claude delegates to an agent from its `description`, or the user names it with `@agent-`. | [Understand automatic delegation](https://code.claude.com/docs/en/sub-agents#understand-automatic-delegation), [Invoke subagents explicitly](https://code.claude.com/docs/en/sub-agents#invoke-subagents-explicitly) | +| `claude --agent `, or the `agent` settings key (scope "Any file"), runs the whole session as that agent; the flag wins over the setting. | [Invoke subagents explicitly](https://code.claude.com/docs/en/sub-agents#invoke-subagents-explicitly), [`agent` setting](https://code.claude.com/docs/en/settings-reference#agent) | +| In that mode the agent's body replaces the default Claude Code system prompt entirely. | [Invoke subagents explicitly](https://code.claude.com/docs/en/sub-agents#invoke-subagents-explicitly) | +| `tools: Agent(a, b)` is an allow list of the agents that may be started; it applies only to an agent running as the main thread. | [Restrict which subagents can be spawned](https://code.claude.com/docs/en/sub-agents#restrict-which-subagents-can-be-spawned) | +| An agent can start its own agents, up to three layers below the main conversation. | [Let subagents spawn their own subagents](https://code.claude.com/docs/en/sub-agents#let-subagents-spawn-their-own-subagents) | +| The CLI, the desktop app and the IDE extensions read the same settings files. | [Settings](https://code.claude.com/docs/en/settings) (page introduction) | +| Not documented: starting a desktop-app session as a named agent. The desktop page was searched for `--agent`, "custom agent", "named agent" and "subagent"; the web-session page was not checked. | [Desktop](https://code.claude.com/docs/en/desktop) | +| **Talking to an agent** | | +| `AskUserQuestion` is one of the tools removed from every started agent, so it cannot ask the user. | [Available tools](https://code.claude.com/docs/en/sub-agents#available-tools) | +| The caller can continue a finished agent by its ID or name, and the agent keeps its full conversation history. | [Resume subagents](https://code.claude.com/docs/en/sub-agents#resume-subagents) | +| In the terminal the user can open an agent's transcript and type into it to continue it. | [Finished subagents in the panel and task list](https://code.claude.com/docs/en/sub-agents#finished-subagents-in-the-panel-and-task-list), [Resume subagents](https://code.claude.com/docs/en/sub-agents#resume-subagents) | +| In the desktop app the user can click a background entry to see its output in the subagent pane. Sending it a message there was not found. | [Watch background tasks](https://code.claude.com/docs/en/desktop#watch-background-tasks) | +| **Agent teams** | | +| Experimental and disabled by default; enabled with `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. | [Agent teams](https://code.claude.com/docs/en/agent-teams) (page introduction), [Enable agent teams](https://code.claude.com/docs/en/agent-teams#enable-agent-teams) | +| The user can message any teammate directly. | [Talk to teammates directly](https://code.claude.com/docs/en/agent-teams#talk-to-teammates-directly) | +| A session has exactly one team. | [Limitations](https://code.claude.com/docs/en/agent-teams#limitations) | +| A teammate can use an agent definition, but its `skills` field is not applied. | [Use subagent definitions for teammates](https://code.claude.com/docs/en/agent-teams#use-subagent-definitions-for-teammates) | +| Agent teams are listed among the features available in the CLI and not in the desktop app. | [What's not available in Desktop](https://code.claude.com/docs/en/desktop#whats-not-available-in-desktop) | +| **Enforcement** | | +| An agent's frontmatter can declare hooks; a `Stop` hook there becomes `SubagentStop`. | [Hooks in subagent frontmatter](https://code.claude.com/docs/en/sub-agents#hooks-in-subagent-frontmatter), [Hooks in skills and agents](https://code.claude.com/docs/en/hooks#hooks-in-skills-and-agents) | +| Exit code 2 from a `SubagentStop` hook prevents the agent from stopping. | [Exit code 2 behavior per event](https://code.claude.com/docs/en/hooks#exit-code-2-behavior-per-event) | +| A dynamic workflow takes no user input in the middle of a run. | [Behavior and limits](https://code.claude.com/docs/en/workflows#behavior-and-limits) | +| Not documented: using a named `.claude/agents/` definition in a workflow's `agent()` call. The workflows page was searched for `.claude/agents`, `subagent_type` and "agent type". | [Workflows](https://code.claude.com/docs/en/workflows) | +| **Skills** | | +| Project skills are `.claude/skills//SKILL.md`. The page describes no category folders between `skills/` and the skill. | [Choose where skills load](https://code.claude.com/docs/en/skills#choose-where-skills-load) | +| A `` entry can be a symlink to a directory elsewhere on disk. | [Choose where skills load](https://code.claude.com/docs/en/skills#choose-where-skills-load) | +| Not documented: a setting or variable that adds another skills folder, or reading `.agents/skills/`. The skills page was searched; the settings and environment-variable pages were not. `--add-dir` loads the skills of another directory's `.claude/skills/`. | [Load skills from a directory outside the project](https://code.claude.com/docs/en/skills#load-skills-from-a-directory-outside-the-project) | +| The `skills` field of an agent injects the full content of each listed skill at start; a skill that is missing is skipped with a warning in the debug log. | [Preload skills into subagents](https://code.claude.com/docs/en/sub-agents#preload-skills-into-subagents) | +| **`AGENTS.md`** | | +| Reading `AGENTS.md` directly needs Claude Code 2.1.277 or later. | [AGENTS.md](https://code.claude.com/docs/en/memory#agents-md) | +| By default it is read only when there is no `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` in the working directory or any directory above it. The rule is not limited to the repository, so a `CLAUDE.md` in a parent folder counts. | [When Claude Code reads AGENTS.md](https://code.claude.com/docs/en/memory#when-claude-code-reads-agents-md) | +| A user-level `~/.claude/CLAUDE.md` does not count. | [When Claude Code reads AGENTS.md](https://code.claude.com/docs/en/memory#when-claude-code-reads-agents-md) | +| To load both, a user chooses "Project instructions" = `claude-md-and-agents-md` in `/config`, or sets `pluginConfigs` in user or managed settings; project and local entries are ignored. | [Choose which instruction files load](https://code.claude.com/docs/en/memory#choose-which-instruction-files-load), [`pluginConfigs` setting](https://code.claude.com/docs/en/settings-reference#pluginconfigs) | +| A `CLAUDE.md` with an `@AGENTS.md` import next to it shares one file between tools. | [Share one file with other coding tools](https://code.claude.com/docs/en/memory#share-one-file-with-other-coding-tools) | +| A started agent loads every level of the instruction files the main conversation loads, including an `AGENTS.md` loaded as project instructions. The built-in Explore and Plan agents skip them. | [What loads at startup](https://code.claude.com/docs/en/sub-agents#what-loads-at-startup), [Built-in subagents](https://code.claude.com/docs/en/sub-agents#built-in-subagents) | + +What this means for this issue: + +- An agent definition can pin a model, but the pin can be overridden by the caller, by two + environment variables and by an organization's allow list. The evidence must therefore read the + model from the agent's transcript. +- An agent started by the orchestrator cannot ask the contributor a question. It returns the + question, and the orchestrator can continue the same agent with the answer. +- Claude Code did not discover our skills while they lived in `.github/skills/`, so an agent could + not preload them with `skills`. Since issue #2866 they are in `.claude/skills//` (D7), and + an agent can. +- With a `CLAUDE.md` above the checkout, neither the session nor the agents it starts get the + repository's `AGENTS.md`, unless the repository has its own `CLAUDE.md` that imports it (D11) + or the contributor opts in on their side. + +## Decisions + +Decided by the maintainer on 2026-11-15: + +- **D1 - One harness.** Claude Code is the repository's AI harness. Compatibility with GitHub + Copilot custom agents is not kept: `.github/agents/` is removed, not maintained beside + `.claude/agents/`. +- **D2 - Standards first.** Where an open standard exists that Claude Code and other agents + follow, the repository uses the standard, not a Claude-only equivalent. So the root instructions + stay in `AGENTS.md`, which is the single source of truth (see D11 for the pointer file that + Claude Code needs). There is no shared standard for + custom agent definitions, so `.claude/agents/` is the one harness-specific place. This decision + is recorded in an ADR that belongs to the AI harness, not to the tracker (see + [Architectural Decisions](#architectural-decisions)). +- **D3 - Explicit orchestrator.** A new `orchestrator` agent starts the implementer and the other + agents. The implementer no longer starts the reviewers or any other agent; it only implements. +- **D4 - Review role first.** The first agent ported is the one that addresses pull-request + reviews, with its model pinned to Opus 5.5 at minimum. It moves to Fable only if Opus 5.5 proves + not enough (maintainer, 2026-11-14). + +- **D5 - Every interaction between agents leaves a trace.** When one agent hands work to another, + or reports back, the exchange is recorded in a Markdown file in the issue specification's + folder, so a person can later see who asked what, who answered what, and with which result. The + reviewer's report on the implementer's work is the first case. Agents may also pass messages in + whatever way the harness offers, but the file is the record. In this issue the file is only a + trace. Controlling the workflow from it, and later from a state machine, is future work + (maintainer, 2026-11-15). D18 refines the format: JSON reply files, not Markdown. +- **D6 - The Copilot pull-request reviewer is not a constraint.** Moving or rewriting the agents + and skills may change how well GitHub's Copilot reviewer reviews pull requests. That effect is + accepted and is not measured or protected here. Review quality rests on two other layers: the + independent review inside the orchestrated workflow while implementing (`task-reviewer`), and + the review of the open pull request by the other maintainer, who uses a separate Claude account + and configuration (maintainer, 2026-11-15). +- **D7 - The skills must be discoverable by Claude Code, in a flat folder with an index.** Leaving + them where Claude Code does not find them is not an option. The 53 skills move from + `.github/skills/dev///` to `.claude/skills//`, the only layout the + documentation describes. Their names are already unique, so no skill is renamed. The grouping by + area, which the folders gave, moves to an index file that lists the skills by area. Symlinks and + plugins were considered and rejected: a second place to keep in sync, or an install step for + every contributor. The move was a separate sub-issue of EPIC #2003, so + that this issue does not grow too big (maintainer, 2026-11-15). Done: issue #2866, merged on + 2026-11-16. The index is `.claude/skills/README.md`, and the old `SKILL.md` paths hold redirect + stubs. +- **D8 - The skills move first.** This issue started after the skills sub-issue (D7) was merged. + The agents are therefore written against `.claude/skills/` from the start and can preload their + skills with the `skills` field. The move rewrote two files in `.github/agents/`: `README.md` + and `copilot-suggestions-handler.agent.md`, which now name the new skills folder. It did not + rewrite the other profiles: five of them (`committer`, `implementer`, `github-operator`, + `pr-reviewer`, `task-reviewer`) name skill paths that now hold redirect stubs, until this issue + removes the profiles (maintainer, 2026-11-15). +- **D9 - The orchestrator is the session the contributor talks to.** It is not an agent started + by another session. An agent that another agent starts cannot ask the contributor a question, + and the orchestrator must: the approval of the specification, design questions, the hand-over. + As a started agent it would need the main session to relay every exchange, and that session + would be a second orchestrator with no rules. The role must not depend on one tool, neither the + Claude Code desktop app nor Claude Code itself: + + - The body of `.claude/agents/orchestrator.md` is plain Markdown and complete on its own, so a + session in any tool can take the role by reading it. + - How a session gets the role is a convenience, not a requirement: + `claude --agent orchestrator` in the terminal, or an instruction to read the file and act as + the orchestrator anywhere else. + - The frontmatter (model, tools, `skills`) is the only Claude Code part of the file. + + Two costs are accepted. When the implementer has a design question, it returns it; the + orchestrator asks the contributor and continues the same implementer with the answer, which + keeps its context. And a session started with `--agent` loses the default Claude Code system + prompt, which is one more reason for the body to be complete. Agent teams, which would let the + contributor talk to the implementer directly, are not used: they are experimental and not + available in every Claude Code surface (maintainer, 2026-11-17). +- **D10 - The harness ADR goes in `docs/adrs/` now.** The ADR for D1 and D2 is written beside the + other AI-harness ADRs, which are already there. The harness-workspace draft + (`docs/issues/drafts/2003-separate-ai-harness-cargo-workspace/ISSUE.md`) moves the harness + crates and today plans no ADR move. So this issue adds an item to that draft's scope: decide + whether the AI-harness ADRs move to the workspace, with this ADR named among them (maintainer, + 2026-11-17). +- **D11 - One source of truth, and pointers instead of copies.** `AGENTS.md` holds the root + instructions because it is the standard and Claude Code supports it. Where a harness-specific + file is needed for something the standard file cannot do, that file only points to the source of + truth and repeats none of its content. First case: Claude Code does not read `AGENTS.md` when + any `CLAUDE.md` exists in a directory above the checkout, so the repository adds a `CLAUDE.md` + whose only content is the import `@AGENTS.md`. With it, every session and every agent it starts + gets `AGENTS.md`, whatever the contributor has in parent folders. The same rule applies to any + later harness-specific file (maintainer, 2026-11-17). + + The repository also has ten scoped `AGENTS.md` files in subdirectories (for example + `packages/configuration/AGENTS.md`). The documentation says a subdirectory's `AGENTS.md` loads + when Claude Code reads a file there and that subdirectory has no `CLAUDE.md` of its own + ([When Claude Code reads AGENTS.md](https://code.claude.com/docs/en/memory#when-claude-code-reads-agents-md)). + It does not say whether a `CLAUDE.md` at the root or above stops that. A reviewer of pull + request #2905 reports that it does. So T2 tests it (scenario M4): if a scoped `AGENTS.md` is not + loaded once the root `CLAUDE.md` exists, T2 adds a `CLAUDE.md` beside each scoped `AGENTS.md` + whose only content is the import of that file, under the same rule. +- **D12 - The complexity audit becomes one review item, then a linter.** `complexity-auditor` is + not ported. The `review-task` checklist gains one item on function length and nesting, checked + once before the pull request. A follow-up issue evaluates Clippy's `too_many_lines` and + `excessive_nesting` lints as the deterministic replacement, in line with the EPIC's first design + principle. The lints are not enabled here, because they may flag existing code (maintainer, + 2026-11-17). +- **D13 - Models.** `pr-review-handler`, `task-reviewer` and `pr-reviewer` are pinned to the full + model ID of Opus 5.5. A full ID, not the alias `opus`, so the review-rounds measurement is + against one known model and does not change when a new model ships. The reviewers are pinned + because a reviewer weaker than the author finds little, and the pin keeps the review independent + of how the session was started. `orchestrator`, `implementer` and `researcher` use `inherit`, so + the contributor chooses the model per session. Known limit: the frontmatter cannot express a + minimum, so in a session on a stronger model the pinned reviewers are weaker than the + implementer. Changing a pin is a one-line pull request (maintainer, 2026-11-17). +- **D14 - The implementer commits; commit rules live in the skill, the plan and the hook.** There + is no `committer` agent for now: a gate in front of every commit costs one agent run and two + trace entries per commit, which is too much. Its work is placed as follows: + + - Conventions: the implementer preloads `commit-changes` with the `skills` field. The three + rules that only the committer held move into that skill. + - Rules about the shape of commits that need judgement (for example refactor first, then + change): they are decided before implementing, in the specification's Commit Points, and the + task reviewer checks the commit series against that plan once, before the pull request. + - Rules a script can check (size, number, message format): they belong in the Git hook, added + by their own issues when the rules exist. + + A `committer` agent can be added later if these three places prove not enough; nothing here + blocks it (maintainer, 2026-11-17). +- **D15 - The Copilot setup workflow stays.** `.github/workflows/copilot-setup-steps.yml` is not + removed, here or in a follow-up. Copilot is still requested as a reviewer of pull requests, and + it is not known whether that review uses the workflow. It goes away when the Copilot review is + replaced by the project's own reviewer, which is a later decision (maintainer, 2026-11-17). +- **D16 - One issue, in small pull requests that merge independently.** The priority is the + review: each pull request is small enough to review easily, and nothing is merged that depends + on an agent, a template or a rule that is not merged yet. So the order goes from what depends on + nothing to what depends on everything: + + 1. Foundations that the agents refer to (the pointer `CLAUDE.md`, the reply schema and its + validator). + 2. One pull request per agent that starts no other agent (`pr-review-handler` first, then + `task-reviewer`, `implementer`, `pr-reviewer`, `researcher`). Each is additive. + 3. The `orchestrator`, with the rewritten `docs/agents/orchestration.md`, after every agent it + starts is merged. + 4. The removal of `.github/agents/` and the last references, with the ADR, at the end. + + An old profile is removed in the pull request of its replacement only when no live document + still depends on it; otherwise it waits for step 4. After each merge `develop` is consistent: + every check passes and no live document names something that does not exist (maintainer, + 2026-11-17). +- **D17 - A stop hook enforces the task-review reply.** `task-reviewer` declares a stop hook in + its frontmatter. When the agent tries to finish, the hook runs the reply validator (D18) on the + reply file the reviewer was asked to write; if the file is missing or invalid, it exits with + code 2, which keeps the agent working, and tells it what is wrong. Reason: the review report is + the one that stopped being written (25 of 48 archived folders in October, 2 of 32 in the first + half of November; see Background for the method). Requirements: the hook cannot loop forever, + and it lets the agent finish when the reviewer was given no folder-style specification, because + then there is no place for a reply file. The bound is 3 refusals per run of the agent, the same + number as the round limit of D18: the fourth attempt to finish is allowed, and the hook reports + that the limit was reached. The orchestrator then finds no valid reply file, stops, and asks the + contributor. This is the only + hook in this issue; it is a Claude Code mechanism, so the rule itself stays written in the + `review-task` skill (maintainer, 2026-11-17). +- **D18 - The trace is one JSON reply file per reply, validated against a schema.** Only replies + are recorded for now, not requests. Stricter formats are preferred for artifacts, so that a + schema can validate them and, later, the communication between agents: + + - Location: the folder `agent-replies/` in the issue specification's folder. + - Name: `--r.json`. The agent is an agent name; the subject is a task ID + of the Implementation Plan in lower case (`t2`) or `pr`; the round starts at 1. + Example: `task-reviewer-t2-r1.json`. No other name is accepted. + - Rounds: each call of an agent on a subject writes a new file; earlier files are never + edited. The limit is 3 rounds per agent and subject. If round 3 does not end in a pass, the + orchestrator stops and asks the contributor. + - Schema: one schema for every reply, `docs/schemas/agent-reply-v1.schema.json`, with the + fields `schema-version`, `agent`, `model`, `subject`, `round`, `created-utc`, `verdict`, + `summary`, `findings` (each with `severity`, `location`, `description`), `questions` and + `evidence`. `verdict` is a closed list (for example `REVIEW_PASSED`, `REVIEW_FAILED`, `DONE`, + `BLOCKED`, `QUESTION`), so the orchestrator decides the next step from one field. + - Validation: one validator, used by the stop hook (D17) and by the repository checks on every + reply file in a pull request. It checks the file name, the schema, and that the name agrees + with the `agent`, `subject` and `round` fields. + - Every agent the orchestrator starts writes a reply file. `pr-review-handler` is the + exception for now: its audit record `PR-REVIEW.md` is its trace, and converting it belongs + to the audit tooling of EPIC #2278. + - The reply file replaces `agent-review-reports.md` from T5, the task that adds the + `task-reviewer` agent and its stop hook. The switch is keyed to whether the branch reviewed + has that agent, not to the template a specification came from, so the hook needs no + exemption. The review of T5 itself is made on the T5 branch, where the agent and its hook + already exist, so it runs the agent and writes a reply file (scenario M7 runs it there). + From the merge of T5 a `task-reviewer` run on any folder-style specification, this one + included, writes a reply file and no entry in `agent-review-reports.md`. A review made on + a branch without the agent is recorded in `agent-review-reports.md`, and closed + specifications keep theirs. A specification created from the earlier template still has a + checkpoint that names `agent-review-reports.md`; T5 states in `review-task` that a reply + file satisfies it, and T9 changes the template. For this issue, that means + `agent-review-reports.md` for a review of T2 to T4 and reply files for a review of T5 to + T12. The `agent-review-report-contract` check loses only + the rules that name the Copilot profiles and `docs/templates/AGENT-REVIEW-REPORTS.md`; the + reply validator replaces those. Its other rules stay: they guard the pull-request audit + contract (`process-pr-review`, `PR-REVIEW-TEMPLATE.md`, the review-finding references, the + thread skills and the `pr_review_audit` node of `docs/agents/orchestration.md`), which this + issue does not change. Issues #2349 and #2362 plan changes to that check and are not blocked + by this one. + - Reply files are committed with the work they describe (maintainer, 2026-11-17). + +Proposed in this specification and approved with it: + +- **P1 - Agent roster.** Six agents: + + | Agent | From | Notes | + | --- | --- | --- | + | `orchestrator` | New | Owns the delivery path of one issue; starts the others | + | `implementer` | `implementer` | Without the handoffs | + | `task-reviewer` | `task-reviewer` | Gains one complexity item from `complexity-auditor` | + | `pr-review-handler` | `copilot-suggestions-handler` | For every reviewer, not only Copilot; model pinned | + | `pr-reviewer` | `pr-reviewer` | | + | `researcher` | `researcher` | | + + Not ported: `planner` (its leftovers go to `create-issue`), `committer` (its three rules go to + `commit-changes`), `github-operator`, `clippy-fixer` (its one-commit-per-lint rule goes to + `fix-clippy-warnings`) and `complexity-auditor` (one checklist item goes to `review-task`; the + audit after every step is dropped). See D12 and D14. +- **P2 - Thin agents.** An agent file holds the role's identity, tools, model, inputs and report + format, and lists the skill that owns the workflow in its `skills` field, which preloads it. + The workflow text is not copied into the agent, following the single-source-of-truth policy in `AGENTS.md`. + +## Scope + +### In Scope + +- Create `.claude/agents/` with the agreed agents, one small pull request at a time (D16). +- Pin the model of `pr-review-handler` in its definition. +- Define the `orchestrator` agent and rewrite `docs/agents/orchestration.md` for it. +- Move the rules that only a dropped profile held into the skill that owns the workflow. +- Remove `.github/agents/`. +- Update every tracked reference to the profiles: `AGENTS.md`, `docs/agents/README.md`, the + `agent-review-report-contract` check (only its rules about the profiles and the review-report + template, which the reply validator replaces), the + `frontmatter-validator` rule for `.agent.md` files, + the `run-pre-commit-checks` pointer to the committer, the issue template checkpoints, and the + governance ADR's inventory and review record. +- Add a root `CLAUDE.md` that only imports `AGENTS.md`, and keep the scoped `AGENTS.md` files + loading (D11). +- Record decisions D1 and D2 in an ADR in `docs/adrs/`, and add to the harness-workspace draft's + scope the item about moving the AI-harness ADRs (D10). +- Define the JSON reply files (D18): the schema, the validator with its tests, and the rule in + every agent that writes one. +- Add the stop hook of `task-reviewer` (D17). +- Record the evidence that each agent works, and the review rounds per pull request for the first + pull requests that `pr-review-handler` handles. + +### Out of Scope + +- The maintainer's personal roles and session conventions (coordinator sessions, session names, + the contributor account). They are not repository content. +- A redesign of the review process. `process-pr-review` and `wait-for-pr-review` keep their + contract; they gain only the sentence that says which agent runs a round. +- The audit tooling of EPIC #2278 (scripted thread resolution, generated or validated audit rows). +- Creating the separate AI-harness workspace + (`docs/issues/drafts/2003-separate-ai-harness-cargo-workspace/ISSUE.md`). +- Moving the skills to `.claude/skills/` (D7, done in issue #2866), shortening their descriptions + (issue #2873), and removing the redirect stubs left under `.github/skills/`. +- A state machine, or any other use of the reply files to control the workflow beyond the + orchestrator reading the `verdict` field. Recording the requests is also left for later (D18). +- Dynamic workflows, or any machine enforcement of the handoffs other than the one stop hook of + D17. The orchestrator is an agent that follows instructions; `docs/agents/orchestration.md` + already says an arrow is intent, not enforcement. + +## Architectural Decisions + +- Related ADRs: + - `docs/adrs/20260420200013_adopt_custom_github_copilot_aligned_agent_framework.md`: this issue + changes what it decided (Copilot alignment, profiles in `.github/agents/`). + - `docs/adrs/20260821172000_establish_ai_agent_context_capability_and_portability_governance.md`: + its adapter rules still apply; its inventory row for custom profiles and its review records + are updated, because a provider migration is one of its review triggers. + - `docs/adrs/20261116082711_store_agent_skills_flat_in_claude_skills.md`: where the skills that + the agents preload live (D7). +- ADRs to create: "Use Claude Code as the AI harness and prefer open agent standards" (D1, D2 and D11). + It supersedes the Copilot-alignment part of ADR `20260420200013`. It belongs to the AI harness. + The harness workspace does not exist yet, so it goes in `docs/adrs/` for now (D10). + +## Design and Ownership Review + +Not applicable. The work adds Markdown agent definitions, a JSON schema with a small validator, +one stop hook and documentation; it has no asynchronous I/O, network readiness or test fixtures. + +The ownership that matters here is between agents: + +| Agent | Talks to the contributor | Starts other agents | Writes | +| --- | --- | --- | --- | +| `orchestrator` | Yes; it is the session | Yes | The issue specification's progress, including the contributor's answers to returned questions | +| `implementer` | No; returns questions to the orchestrator | No | Code, tests, docs, commits, its reply file | +| `task-reviewer` | No | No | Verified checkboxes, its reply file | +| `pr-review-handler` | No; returns undecided findings | No | Fixes, commits, the push, replies, thread resolutions, `PR-REVIEW.md` | +| `pr-reviewer` | No | No | Its reply file | +| `researcher` | No | No | Its reply file, when it was given an issue folder | + +The reply files are defined in D18. Only the agent named in a reply file writes it. + +## Bug-Fix Process + +Not applicable. + +## Regression Test Strategy + +Not applicable. + +## Open Questions + +All settled with the maintainer between 2026-11-15 and 2026-11-17. Each answer is a decision above. + +- **Q1 - Settled by D9.** The orchestrator is the session the contributor talks to. +- **Q2 - Settled by D10.** The ADR for D1 and D2 goes in `docs/adrs/` now. +- **Q3 - Settled by D11.** The repository adds a `CLAUDE.md` that only imports `AGENTS.md`. +- **Q4 - Settled by D7 and D8.** The skills moved to a flat `.claude/skills/` with an index in + issue #2866. Its index records that Claude Code never lists a skill one folder deeper. The + context cost of the 53 descriptions is handled by issue #2873. +- **Q5 - Settled by D12.** One item in `review-task` now; a follow-up issue for the Clippy lints. +- **Q6 - Settled by D13.** The handler and both reviewers are pinned to Opus 5.5; the rest inherit. +- **Q7 - Settled by D14.** The implementer commits; no `committer` agent for now. +- **Q8 - Settled by D15.** The Copilot setup workflow stays. +- **Q9 - Settled by D16.** One issue, in small pull requests that merge independently. +- **Q10 - Settled by D17.** `task-reviewer` gets a stop hook that requires its report. +- **Q11 - Settled by D18.** One JSON reply file per reply, validated against a schema. + +## Implementation Plan + +Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`. + +Each task is one pull request, in this order (D16). A task starts only after the tasks it depends +on are merged. + +| ID | Status | Task | Notes / Expected Output | +| --- | ------ | ---- | ----------------------- | +| T1 | TODO | Specification pull request | This specification in `docs/issues/open/`, and a new row in the EPIC's Subissues table | +| T2 | TODO | Pointer `CLAUDE.md` | A root `CLAUDE.md` whose only content is the import of `AGENTS.md` (D11); if scenario M4 shows that a scoped `AGENTS.md` is not loaded, an import-only `CLAUDE.md` beside each of the ten scoped `AGENTS.md` files; scenario M4 recorded | +| T3 | TODO | Reply schema and validator | `docs/schemas/agent-reply-v1.schema.json`; the validator with tests, developed in the progressive loop of the `write-unit-test` skill with a recorded design review per increment, and run by the repository checks; `docs/schemas/README.md` updated (D18) | +| T4 | TODO | `pr-review-handler` | `.claude/agents/pr-review-handler.md` with the pinned model; `wait-for-pr-review` and `process-pr-review` say which agent runs a round; the inventory `removed-profile-rules.md` created in this folder with the rules of `copilot-suggestions-handler` (AC6); scenarios M1 to M3 recorded | +| T5 | TODO | `task-reviewer` | The agent file with the pinned model and the stop hook (D17), with tests of its limit of 3 refusals; the complexity item in `review-task` (D12); the reply rule in `review-task`, which also says that a reply file satisfies the earlier template's checkpoint (D18); scenario M7 recorded | +| T6 | TODO | `implementer` | The agent file; the three committer rules in `commit-changes` (D14); the rules that only `planner` held moved into `create-issue` | +| T7 | TODO | `pr-reviewer` | The agent file with the pinned model; the reply rule in `review-pr` | +| T8 | TODO | `researcher` | The agent file | +| T9 | TODO | `orchestrator` | The agent file; `docs/agents/orchestration.md` rewritten for the orchestrator-led flow, with the 3-round limit; the issue template checkpoints; scenario M5 recorded | +| T10 | TODO | End of `.github/agents/` | `.github/agents/` removed, with the rules of the `agent-review-report-contract` check that name the profiles and `docs/templates/AGENT-REVIEW-REPORTS.md`; the rest of that check kept and passing; the one-commit-per-lint rule in `fix-clippy-warnings`; the inventory `removed-profile-rules.md` completed for all ten profiles (AC6); `AGENTS.md`, `docs/agents/README.md`, `docs/templates/AGENT-REVIEW-REPORTS.md`, the `frontmatter-validator` rule and the governance ADR updated; the new ADR, and the ADR-move item added to the scope of the harness-workspace draft (D10) | +| T11 | TODO | Measurement | Review rounds recorded for the first three pull requests handled by `pr-review-handler` (scenario M6); the pull requests of this issue count | +| T12 | TODO | Close-out pull request | Completion review, specification moved to `docs/issues/closed/`, EPIC row `DONE` | + +T4 to T8 are additive: each adds one agent and removes nothing that a live document still names. +The Copilot profiles stay until T10, so `develop` is consistent after every merge. + +The inventory of AC6 is the file `removed-profile-rules.md` in this folder. It lists every rule +that only a Copilot profile holds, with its destination or the reason it +is dropped. The destination is a named skill. It is the agent file only for a rule about the role +itself (its identity, tools, inputs or report format), which P2 keeps in the agent; workflow text +never goes there. T4 creates it, each of T5 to T9 adds the rows of the profiles its agent replaces, and +T10 completes it before removing the profiles. + +## Commit Points + +| Task | Coherent change set | Commit policy | +| ---- | ------------------- | ------------- | +| T1 | The specification; the EPIC row | One commit each, after `linter all` | +| T2 | The root pointer file; the scoped pointer files, if M4 requires them; the evidence | One commit each | +| T3 | The schema; the validator, one commit per reviewed test increment; its wiring into the checks; the documentation | One commit per item, after focused validation and the test-design review | +| T4 to T8 | The agent file; each skill change (in T6 the `create-issue` change is its own commit); the inventory rows; the evidence | One commit per item, after focused validation | +| T9 | The agent file; the orchestration guide; the template checkpoints; the inventory rows; the evidence | One commit per item, after focused validation | +| T10 | The completed inventory; the removal of `.github/agents/` with the profile rules of the contract check and the validator rule; each moved rule; each documentation update; the ADR | One commit per item, after focused validation | +| T11 | The measurement evidence | One commit per recorded pull request | +| T12 | The completion review; the move to `closed/`; the EPIC row | One commit each | + +Tests are added in T3 (the reply validator) and in T5 (the limit of 3 refusals of the stop hook). For +this test-producing work, use the `write-unit-test` skill and complete an explicit design review +after each passing test increment, before maintainer review and commit. Confirm that the test +exposes the one causal initial-state difference; its fixture owns only incidental mechanics; and +the production Act plus independently specified expected result remain visible. The review must +use the mandatory prose-first Arrange-Act-Assert comparison: write temporary prose for each +section, refactor until the code expresses it, remove redundant prose, and retain only irreducible +context. Record this review in task evidence or a file-local test plan. Assess helper boundaries +by meaningful named actions and abstraction-level alignment, not caller count: a single-use helper +is valid when it keeps the test readable and hides only incidental mechanics. Commit each reviewed +test-design increment before starting the next planned file or behavior area. Keep final +verification and completion evidence separate when it improves reviewability. + +Record a justified no-change decision in the task's evidence without creating an empty commit. Use +a Conventional Commit message with the narrow affected scope, and sign every commit with GPG. + +## Progress Tracking + +### Workflow Checkpoints + +- [x] Folder-style spec drafted in `docs/issues/drafts/2003-migrate-custom-agents-to-claude-code/ISSUE.md` +- [x] Spec reviewed and approved by user/maintainer +- [x] GitHub issue created and issue number added to this spec +- [ ] Spec-only PR merged into `develop` before implementation +- [ ] Implementation completed +- [ ] Automatic verification completed (`linter all`, relevant tests, and any pre-push checks) +- [ ] Manual verification scenarios executed and recorded in issue-local `manual-verification-evidence.md` +- [ ] Acceptance criteria reviewed after implementation and updated with evidence +- [ ] Evidence-based implementation completion review recorded: issue-local retrospective created for material discoveries, or progress log states why none was needed +- [ ] Reviewer validated acceptance criteria and updated checkboxes +- [ ] Independent reviewer reports recorded in issue-local `agent-review-reports.md` when reviewers received this folder-style specification (from the review of T5 a reply file in `agent-replies/` satisfies this; see D18) +- [ ] Spec progress verified as up to date before each commit +- [ ] Issue closed and spec moved from `docs/issues/open/` to `docs/issues/closed/` + +### Progress Log + +- 2026-11-15 08:40 UTC - Claude Code (Claude Fable 5.2) - Inventoried the ten profiles against the skills and the Claude Code documentation; drafted this specification with the maintainer's decisions D1 to D8, and eleven open questions; added what the Claude Code documentation says is possible, each fact with its link. +- 2026-11-17 12:09 UTC - Claude Code (Claude Fable 5.2) - Updated the draft after the skills move (#2866) merged; settled the open questions Q1 to Q11 with the maintainer as decisions D9 to D18; reordered the Implementation Plan into small pull requests that merge independently (D16). +- 2026-11-17 12:14 UTC - Claude Code (Claude Fable 5.2) - The maintainer approved the draft; created issue #2904, moved the specification to `docs/issues/open/`, and added row 23 to the EPIC's Subissues table. Linking #2904 as a GitHub sub-issue of #2003 is pending: the contributor account's request was refused with `404`. +- 2026-11-17 12:55 UTC - Claude Code (Claude Fable 5.2) - Addressed the review `5938631990` of `da2ce7` on pull request #2905 (findings F1 to F7), one commit per finding: the baseline of pull request #2851 is 14 rounds on three models, not 9 on one; the archived-report counts are recomputed with their method; the plan gains the AC6 inventory, the planner rules and the test-development loop. +- 2026-11-17 13:11 UTC - Claude Code (Claude Fable 5.2) - Addressed Copilot's review `5939023583` on pull request #2905 (findings F8 and F9): the stop hook's limit is 3 refusals, and D18 states which report file this issue uses for its own reviews. +- 2026-11-17 13:19 UTC - Claude Code (Claude Fable 5.2) - Addressed the review `5939071001` of `da2ce7` on pull request #2905 (three nits): the archived-report method names the revision where the report is checked, the inventory's destinations agree with AC6, and Automatic Checks lists the stop hook's tests. +- 2026-11-17 13:35 UTC - Claude Code (Claude Fable 5.2) - Addressed the approving review `5939415019` of `da2ce7` on pull request #2905 (one minor finding): the switch from `agent-review-reports.md` to reply files is keyed to the merge of T5, so the stop hook needs no exemption for this specification. +- 2026-11-17 13:54 UTC - Claude Code (Claude Fable 5.2) - Addressed Copilot's review `5939656808` on pull request #2905 (two findings): T2 and M4 cover the ten scoped `AGENTS.md` files, and the `agent-review-report-contract` check keeps its pull-request audit rules. +- 2026-11-17 15:23 UTC - Claude Code (Claude Fable 5.2) - Addressed the reviews `5939681382` and `5939862849` of `da2ce7` on pull request #2905 (one nit, one minor finding about the audit record): the review of T5 itself runs the `task-reviewer` agent on the T5 branch and writes a reply file, so this issue uses `agent-review-reports.md` for T2 to T4 and reply files for T5 to T12. +- 2026-11-17 16:07 UTC - Claude Code (Claude Fable 5.2) - Addressed Copilot's review `5941597022` on pull request #2905 (two minor findings): AC10 exempts the forced run of M7 that ends without a reply file, and the EPIC records this issue's named models (D4, D13) as an approved exception to its Out of Scope item. + +## Acceptance Criteria + +- [ ] AC1: `.claude/agents/` contains the agreed agents, and each loads in Claude Code with no + ignored frontmatter key. +- [ ] AC2: `pr-review-handler` declares its model in its frontmatter, and a recorded run shows it + ran on that model. +- [ ] AC3: One real review round on a real pull request was processed by `pr-review-handler` from + fetch to resolved threads, with `validate-audit-record.py` exiting `0`. +- [ ] AC4: The `orchestrator` started the `implementer` and the `task-reviewer` on a real task, and + each wrote a valid reply file. The implementer started no agent. +- [ ] AC5: `.github/agents/` no longer exists, and no tracked live document, skill, check or + template refers to a removed profile. Closed specifications and merged audit records are + history and stay unchanged. +- [ ] AC6: Every rule that only a removed profile held is either in a named skill, or in the agent + file when it is about the role itself (identity, tools, inputs, report format), or listed as + dropped with its reason, in the inventory `removed-profile-rules.md` in this specification's + folder. +- [ ] AC7: `docs/agents/orchestration.md` describes the orchestrator-led flow and matches the + agent files. +- [ ] AC8: The ADR for D1 and D2 exists at the agreed location, and the governance ADR's inventory + and review record describe the new adapters. +- [ ] AC9: The review rounds of the first three pull requests handled by `pr-review-handler` are + recorded next to the baseline of pull request #2851: 14 rounds, with its split by model. +- [ ] AC10: Every agent started in scenarios M5 and M7 has its reply file in `agent-replies/`, each + file passes the validator, and a reader can follow the sequence from the files alone. The + one exception is the forced run of M7 that uses up the 3 refusals: it ends without a reply + file, as D17 states, and its evidence is the 3 refusals and the allowed fourth attempt + recorded in `manual-verification-evidence.md` section V7. +- [ ] AC11: The stop hook of `task-reviewer` refuses to let it finish without a valid reply file, + and lets it finish on the fourth attempt, after 3 refusals, reporting that the limit was + reached. +- [ ] AC12: The root `CLAUDE.md` contains only the import of `AGENTS.md`, and a rule of a scoped + `AGENTS.md` reaches a session that reads a file in its directory (scenario M4). +- [ ] `linter all` exits with code `0` +- [ ] Relevant tests pass +- [ ] Manual verification scenarios are executed and documented in issue-local `manual-verification-evidence.md` +- [ ] Acceptance criteria are re-reviewed after implementation and reflect actual behavior +- [ ] Documentation is updated when behavior/workflow changes + +## Verification Plan + +### Automatic Checks + +- `linter all` +- The reply validator's tests, and a run of the validator on every reply file +- The tests of the stop hook's limit of 3 refusals (T5) +- `cargo test -p agent-review-report-contract` and a run of the check itself, in every task that + touches a file it reads, including T9 (`docs/agents/orchestration.md`) and T10 +- `cargo test -p frontmatter-validator` in the task that changes its `.agent.md` rule +- The pre-commit and pre-push hooks + +### Manual Verification Scenarios + +Status values: `TODO`, `IN_PROGRESS`, `DONE`, `FAILED`, `BLOCKED`. + +Every scenario records the Claude Code version it ran on. + +| ID | Scenario | Human-oriented command/steps | Expected Result | Status | Evidence | +| --- | -------- | ---------------------------- | --------------- | ------ | -------- | +| M1 | The agent files load | Start Claude Code with `--debug` in the repository; list the agents; search the debug output for ignored frontmatter | Every agent merged so far is listed; no key is reported as ignored | TODO | `manual-verification-evidence.md` section V1 | +| M2 | The pinned model applies | Start `pr-review-handler` from a session running on a different model; record the model named in the agent's transcript file, not the one the agent says it is | The agent ran on the model in its frontmatter, with no fallback | TODO | `manual-verification-evidence.md` section V2 | +| M3 | A real review round | On an open pull request with a submitted review, let the session that owns it delegate the round to `pr-review-handler` | Fixes committed and pushed, every thread replied to and then resolved, the audit record updated, `validate-audit-record.py` exits `0`, a short report returned | TODO | `manual-verification-evidence.md` section V3 | +| M4 | `AGENTS.md` reaches the agents | In a checkout with a `CLAUDE.md` in a parent folder, and in one without, ask the session and one started agent which repository rules they were given; then make each read a file in `packages/configuration/` and ask for a rule that only `packages/configuration/AGENTS.md` holds | Both the session and the started agent received the root `AGENTS.md` in both cases, and the scoped rule after reading a file in that directory; each `CLAUDE.md` contains only an import | TODO | `manual-verification-evidence.md` section V4 | +| M5 | The orchestrator leads | Start a session as the orchestrator on a small real task, once with `claude --agent orchestrator` and once by telling a normal session to read the file and take the role | It starts the implementer, then the task reviewer; each writes a valid reply file in `agent-replies/`; the implementer starts no agent; questions come back to the contributor through the orchestrator | TODO | `manual-verification-evidence.md` section V5 | +| M6 | Review rounds per pull request | For the first three pull requests handled by `pr-review-handler`, count the review rounds with fixes | The counts are recorded with the model of each round, next to the baseline of pull request #2851 (14 rounds, split by model) | TODO | `manual-verification-evidence.md` section V6 | +| M7 | The stop hook holds the reviewer | Start `task-reviewer` on a task, first with an instruction that makes it try to finish without a reply file, then normally | The hook refuses the first attempt and names what is missing; the agent then writes a valid reply file and finishes; a forced case shows 3 refusals and then the fourth attempt allowed, with the limit reported | TODO | `manual-verification-evidence.md` section V7 | + +Notes: + +- Manual verification is mandatory even when automated tests pass. +- Create `manual-verification-evidence.md` from `docs/templates/MANUAL-VERIFICATION-EVIDENCE.md` + when executing these scenarios, with the actual commands, output and outcomes. +- If a scenario fails, record the failure and diagnosis in the progress log before proceeding. + +### Disposable Verification Scripts + +None planned. + +### Acceptance Verification + +| AC ID | Status (`TODO`/`DONE`) | Evidence | +| ----- | ---------------------- | -------- | +| AC1 | TODO | | +| AC2 | TODO | | +| AC3 | TODO | | +| AC4 | TODO | | +| AC5 | TODO | | +| AC6 | TODO | | +| AC7 | TODO | | +| AC8 | TODO | | +| AC9 | TODO | | +| AC10 | TODO | | +| AC11 | TODO | | +| AC12 | TODO | | + +## Risks and Trade-offs + +- **The orchestrator relays questions.** An implementer started by the orchestrator cannot ask the + contributor anything. Each design question costs one stop and one restart of the implementer. + Mitigation: the specification is approved before implementation starts, and the implementer is + started per task, not per issue. +- **A reply can say more than what happened.** Each reply is written by a model. The schema + checks its form, not its truth. Mitigation: replies are short, the `evidence` field names + commands and paths that a reader can check, and the rules of "Statements in Your Own Records" + in `process-pr-review` apply. +- **JSON is harder to read in a pull request.** Long findings read worse than in Markdown. + Accepted for the validation it allows; the `summary` field keeps the first read short. +- **Many small pull requests.** Twelve pull requests, eleven after the specification's, each with + its own review rounds. + Accepted (D16): small pull requests are easier to review and never depend on unmerged work. +- **Three samples say little.** Three pull requests cannot prove that the pinned model lowers the + round count; pull requests differ in size and reviewers. The measurement records the counts and + claims no more than they show. +- **An agent is still instructions.** Nothing forces the orchestrator to start the task reviewer. + The reviewer's reply file is the evidence that it did, and the stop hook (D17) guarantees the + file once the reviewer runs. +- **A harness-specific folder.** `.claude/agents/` only works in Claude Code. The governance ADR + allows it as an adapter: the workflows stay in skills and documents that any agent can read. +- **A role taken by instruction is weaker.** Where a session cannot be started as a named agent, + the orchestrator role depends on the session being told to take it and keeping to it. M5 runs + both ways and records the difference. +- **Text contract check.** The `agent-review-report-contract` check requires exact sentences in + four Copilot profiles, and others in the pull-request audit skills and templates. The profiles + and their rules stay untouched until T10 removes both together, so the check passes after every + merge. T9 rewrites `docs/agents/orchestration.md` and must keep the text the check requires + there. T10 coordinates with issues #2349 and #2362, which change the same file. + +## Implementation Completion Review + +After implementation, compare the result with this specification. Record invalidated assumptions, +material design changes, unexpected validation findings, and reusable lessons. + +- Retrospective: `Not yet assessed` +- If needed, create `implementation-retrospective.md` from the repository template at + `docs/templates/IMPLEMENTATION-RETROSPECTIVE.md` in this issue specification's directory. +- If no retrospective is needed, add a concise progress-log entry explaining why the work had no + material discovery. +- When an independent reviewer receives this folder-style specification, it records its result in + `agent-review-reports.md` using `docs/templates/AGENT-REVIEW-REPORTS.md`. From the review of T5 + the reviewer writes a JSON reply file instead, as D18 states. + +This step is not optional: the close-out pull request carries either the retrospective or the +progress-log entry. + +## References + +- Related issues: #2003, #2155, #2160, #2278, #2349, #2362 +- Related PRs: #2851 (the baseline: 14 review rounds on three models, see Background) +- Related ADRs: `docs/adrs/20260420200013_adopt_custom_github_copilot_aligned_agent_framework.md`, + `docs/adrs/20260821172000_establish_ai_agent_context_capability_and_portability_governance.md` +- Agent orchestration guide: `docs/agents/orchestration.md` +- Claude Code documentation: `https://code.claude.com/docs/en/sub-agents.md` diff --git a/docs/pr-reviews/pr-2905-review/PR-REVIEW.md b/docs/pr-reviews/pr-2905-review/PR-REVIEW.md new file mode 100644 index 0000000000..e7fc5ac9b2 --- /dev/null +++ b/docs/pr-reviews/pr-2905-review/PR-REVIEW.md @@ -0,0 +1,390 @@ +--- +pr-number: 2905 +pr-url: https://github.com/torrust/torrust-tracker/pull/2905 +last-updated-utc: "2026-11-17 16:14" +--- + + + +# PR #2905 Review Audit + +Source: pull-request reviews and inline review threads for https://github.com/torrust/torrust-tracker/pull/2905. + + + +## Ownership + +The PR author owns this tracked audit record. Reviewers, including repository review agents, +deliver findings through GitHub and have no repository-artifact obligation. + +- Post-merge workflow approval: N/A + + + +## Status Values + +- Relationship: `ORIGINAL`, `RE_RAISE_OF:` +- Disposition: `FIXED`, `NO_ACTION`, `SUPERSEDED`, `FOLLOW_UP` +- Thread state: `OPEN`, `RESOLVED`, `NON_RESOLVABLE`, `SUPERSEDED`. `OPEN` applies prospectively + to audits created or updated for approved follow-up work; historical audits remain valid without + bulk migration. +- Severity: `Blocker`, `Major`, `Minor`, `Nit`, `Suggestion`; append `(inferred)` when derived + from free prose. +- Author class: `Copilot`, `Human`, `Unknown` +- Category: `link-integrity`, `formatting`, `metadata`, `testing`, `correctness`, + `documentation`, `maintainability`, `security`, `other` +- An outdated thread whose concern was fixed is `FIXED`/`RESOLVED`, even when GitHub marks the + original thread outdated after the push. For in-PR feedback, use `NO_ACTION`/`SUPERSEDED` only + for a duplicate, superseded, or no-change concern. A post-merge `NO_ACTION` requires maintainer + approval to decline the follow-up work. +- When the current identity cannot resolve a thread (`viewerCanResolve` is `false`), keep the + disposition established from the current tree and record `Thread state=OPEN`. The reviewer or PR + author resolves it; permission says nothing about whether the concern was fixed. + +## Findings + +Round 1 is the review `5938631990` of `da2ce7` (CHANGES_REQUESTED, F1 to F7, reviewer-provided IDs), on the first head of +the pull request. Its body holds no finding beyond the seven inline threads. +Round 2 is Copilot's review `5939023583` (COMMENTED, F8 and F9, audit-local IDs), also on the first head of the pull +request; it was submitted after the round 1 fixes were pushed. Copilot labels both findings "Medium severity"; the +severity `Minor` is inferred from that label. Its body says the full agentic review did not run because it did not +start before the timeout. +Round 3 is the review `5939071001` of `da2ce7` (DISMISSED, F10 to F12, audit-local IDs; the reviewer's own F8 and F9 +collide with the audit's F8 and F9, and its F10 follows them, so all three are recorded as the original), on the head +that carried the round 1 audit. +Round 4 is the approving review `5939415019` of `da2ce7` (F13, audit-local ID; the reviewer's own F11 collides with the +audit's F11 and is recorded as the original), on the head that carried the round 3 audit. +Round 5 is Copilot's review `5939656808` (COMMENTED, F14 and CC1, reviewer-provided IDs, which do not collide), on the head +that carried the round 4 audit. Its comments carry `[Major]` and `[Minor]` brackets, which are used. +Round 6 is two reviews of `da2ce7`, one finding each: `5939681382` (DISMISSED, F15, audit-local ID; the reviewer's own +F13 collides with the audit's F13), on the head that carried the round 4 audit, and the approving review `5939862849` +(F16, audit-local ID; the reviewer's own F14 collides with the audit's F14), on the head that carried the round 5 fixes. +Round 7 is Copilot's review `5941597022` (COMMENTED, F17 and F18, reviewer-provided IDs, which do not collide; its +comments carry `[Minor]` brackets, which are used) and the approving review `5941484820` of `da2ce7` (F19, audit-local +ID; the reviewer's own F15 collides with the audit's F15), both on the head that carried the round 6 audit. + +| Finding ID | Review finding reference | Author class | Severity | Category | Relationship | Disposition | Thread state | +| ---------- | ------------------------ | ------------ | -------- | -------- | ------------ | ----------- | ------------ | +| F1 | `review-finding:pr-2905-f1` | Human | Major | correctness | ORIGINAL | FIXED | RESOLVED | +| F2 | `review-finding:pr-2905-f2` | Human | Minor | correctness | ORIGINAL | FIXED | RESOLVED | +| F3 | `review-finding:pr-2905-f3` | Human | Minor | documentation | ORIGINAL | FIXED | RESOLVED | +| F4 | `review-finding:pr-2905-f4` | Human | Minor | testing | ORIGINAL | FIXED | RESOLVED | +| F5 | `review-finding:pr-2905-f5` | Human | Nit | correctness | ORIGINAL | FIXED | RESOLVED | +| F6 | `review-finding:pr-2905-f6` | Human | Nit | correctness | ORIGINAL | FIXED | RESOLVED | +| F7 | `review-finding:pr-2905-f7` | Human | Nit | formatting | ORIGINAL | FIXED | RESOLVED | +| F8 | `review-finding:pr-2905-f8` | Copilot | Minor (inferred) | documentation | ORIGINAL | FIXED | RESOLVED | +| F9 | `review-finding:pr-2905-f9` | Copilot | Minor (inferred) | documentation | ORIGINAL | FIXED | RESOLVED | +| F10 | `review-finding:pr-2905-f10` | Human | Nit | correctness | ORIGINAL | FIXED | RESOLVED | +| F11 | `review-finding:pr-2905-f11` | Human | Nit | documentation | ORIGINAL | FIXED | RESOLVED | +| F12 | `review-finding:pr-2905-f12` | Human | Nit | testing | ORIGINAL | FIXED | RESOLVED | +| F13 | `review-finding:pr-2905-f13` | Human | Minor | correctness | ORIGINAL | FIXED | RESOLVED | +| F14 | `review-finding:pr-2905-f14` | Copilot | Major | correctness | ORIGINAL | FIXED | RESOLVED | +| CC1 | `review-finding:pr-2905-cc1` | Copilot | Minor | maintainability | ORIGINAL | FIXED | RESOLVED | +| F15 | `review-finding:pr-2905-f15` | Human | Nit | correctness | ORIGINAL | FIXED | RESOLVED | +| F16 | `review-finding:pr-2905-f16` | Human | Minor | documentation | ORIGINAL | FIXED | RESOLVED | +| F17 | `review-finding:pr-2905-f17` | Copilot | Minor | correctness | ORIGINAL | FIXED | RESOLVED | +| F18 | `review-finding:pr-2905-f18` | Copilot | Minor | documentation | ORIGINAL | FIXED | RESOLVED | +| F19 | `review-finding:pr-2905-f19` | Human | Minor | documentation | ORIGINAL | FIXED | RESOLVED | + +## Finding Details + +### F1 - The baseline of 9 review rounds for pull request 2851 contradicts that pull request's audit record + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729270 +- Concern: The specification said pull request 2851 took 9 review rounds with the review-addressing session on Sonnet 5.5. The audit record of that pull request has 14 rounds, and the round commits name three models, so 9 is neither the total nor the count on the named model. AC9, M6 and References measured against that figure. +- Solution: Background states the 14 rounds with the split by model and says that five rounds already ran on the model D13 pins. AC9, M6 and References use that baseline. The uncounted sentence about where most rounds came from is replaced by a count from the record. +- Current-tree verification: `docs/pr-reviews/pr-2851-review/PR-REVIEW.md` describes rounds 1 to 14. `gh api repos/torrust/torrust-tracker/pulls/2851/commits` lists the round-recording commits with the footers Fable 5.2 (rounds 1 to 3), Sonnet 5.5 (round 4), Sonnet 5 (rounds 5 to 9) and Opus 5.5 (rounds 10 to 14). `grep -c "^- 2026.* - Correction"` on that record prints 10. `grep -n "9 rounds\|9 review"` on the specification prints nothing. +- Resolution reference: `docs(issues): [#2904] state the 14 review rounds of PR #2851 with their split by model` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599865065 + +### F2 - D10 adds a line to a list of ADRs to move that the harness-workspace draft does not have + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729286 +- Concern: D10, In Scope and T10 said the new ADR is listed among the ADRs to move in the harness-workspace draft. That draft moves crates and lists no ADR to move. +- Solution: D10, In Scope and T10 now say that this issue adds an item to the draft's scope: decide whether the AI-harness ADRs move to the workspace, naming this ADR. +- Current-tree verification: `grep -n -i adr docs/issues/drafts/2003-separate-ai-harness-cargo-workspace/ISSUE.md` shows the container-build ADR and one ADR to create, no ADR to move. `grep -n "ADRs to move\|moves with"` on the specification prints nothing. +- Resolution reference: `docs(issues): [#2904] say that the harness-workspace draft plans no ADR move yet` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599865539 + +### F3 - No task produces the AC6 inventory, or moves the planner's leftovers into `create-issue` + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729299 +- Concern: AC6 requires an inventory of every rule that only a removed profile held, and P1 sends the planner's leftovers to `create-issue`, but no task of the plan delivered either. +- Solution: The inventory is the file `removed-profile-rules.md` in the specification folder: T4 creates it, T5 to T9 add rows, T10 completes it. T6 moves the rules that only `planner` held into `create-issue`. Commit Points and AC6 name them. +- Current-tree verification: Read the Implementation Plan, the paragraph under it, Commit Points and AC6 in the specification after the change: each names the inventory file; the T6 row names the planner rules. +- Resolution reference: `docs(issues): [#2904] schedule the removed-rules inventory and the planner rules in the plan` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599866005 + +### F4 - The plan adds tests (T3) but omits the test-development loop the governing skill requires + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729312 +- Concern: The `create-issue` skill requires a progressive test-development loop with a recorded design review when a plan adds tests. Commit Points had dropped the template paragraph that carries it. +- Solution: Commit Points carries the template paragraph again, for T3 and T5, and the T3 rows name the review step. A later commit adds the hook's tests to the T5 row. +- Current-tree verification: Compared the restored paragraph with `docs/templates/ISSUE.md` (the paragraph after the Commit Points table). `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] restore the test-development loop for the tasks that add tests` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599866406 + +### F5 - The archive figures do not recompute under the windows stated + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729327 +- Concern: The counts 24 of 46 (October) and 2 of 30 (1 to 15 November) of archived specifications with an `agent-review-reports.md` could not be reproduced, and no method was stated. D17 repeated them. +- Solution: Background gives recomputed counts, 25 of 48 and 2 of 32, with the method; D17 uses them. The reviewer counted 24 of 48 for October; the cause of that difference of one was not found and the reply says so. The body of issue 2904 carried the same counts and was edited to match. +- Current-tree verification: On `develop` at the commit "Merge torrust/torrust-tracker#2900": `TZ=UTC git log --diff-filter=AR --name-only --date=format-local:%Y-%m-%d --format='@%cd' -- docs/issues/closed`, keeping for each folder the oldest date, then `git cat-file -e :docs/issues/closed//agent-review-reports.md` per folder. Output: October 25 of 48, 1 to 15 November 2 of 32; EPIC folders two in October (one with a report) and one in November (without). +- Resolution reference: `docs(issues): [#2904] recompute the archived-report counts and state the method` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599866826 + +### F6 - The skills move did rewrite two files under `.github/agents/` + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729342 +- Concern: D8 said the skills move did not rewrite the Copilot profiles. Its commit changed `README.md` and one profile there. +- Solution: D8 names the two rewritten files and the five profiles that still name stub paths. +- Current-tree verification: `git show --stat` of the commit "refactor(skills): [#2866] move the skills to .claude/skills", limited to `.github/agents`, lists `README.md` and `copilot-suggestions-handler.agent.md`. `grep -ln "\.github/skills/" .github/agents/*` lists `committer`, `implementer`, `github-operator`, `pr-reviewer` and `task-reviewer`. +- Resolution reference: `docs(issues): [#2904] say which profile files the skills move rewrote` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599867281 + +### F7 - Numbering is out of order in three lists, and the count of pull requests is loose + +- PR number: 2905 +- Source review ID: 5938631990 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599729361 +- Concern: The acceptance criteria, the settled questions and the manual scenarios were not in ID order, and Risks said about ten pull requests for twelve tasks. +- Solution: The three lists are ordered by ID, and Risks says twelve pull requests, eleven after the specification's. +- Current-tree verification: `grep -n` on the three lists prints AC1 to AC12, Q1 to Q11 and M1 to M7 in order. +- Resolution reference: `docs(issues): [#2904] order the criteria, questions and scenarios by ID and give the pull request count` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599867733 + +### F8 - D17 requires the stop hook to be bounded but gives no number + +- PR number: 2905 +- Source review ID: 5939023583 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599997320 +- Concern: D17 said the stop hook lets the agent finish after a bounded number of refusals, without the number. T5 tests the bound and AC11 checks it, so they could not be verified against the specification. +- Solution: D17 sets the bound to 3 refusals per run of the agent, the same number as the round limit of D18; the fourth attempt to finish is allowed and the hook reports that the limit was reached. T5, AC11 and scenario M7 name the number. +- Current-tree verification: `grep -n "bounded"` on the specification prints nothing; `grep -n "3 refusals"` lists D17, T5, Commit Points, the progress log, AC11 and M7. +- Resolution reference: `docs(issues): [#2904] set the stop hook's limit to 3 refusals` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600064214 + +### F9 - The checkpoints and the completion review still require `agent-review-reports.md` + +- PR number: 2905 +- Source review ID: 5939023583 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4599997411 +- Concern: D18 replaces `agent-review-reports.md` with JSON reply files, but the workflow checkpoints and the Implementation Completion Review of the specification still require the old file, with no rule saying which one applies to this issue. +- Solution: D18 states the transitional rule: the reply files apply to specifications created after T9 changes the issue template; this specification keeps `agent-review-reports.md` for the reviews of its own work until it closes, and the reply files in its folder are the evidence of scenarios M5 and M7 only. The checkpoint and the completion-review bullet point to that rule. +- Current-tree verification: Read D18, the checkpoint line and the last bullet of Implementation Completion Review in the specification after the change; each states or points to the rule. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] say which report file this issue uses for its own reviews` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600064725 + +### F10 - The stated method gives 24 of 48 for October, not 25 + +- PR number: 2905 +- Source review ID: 5939071001 +- Reviewer finding ID: F8 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600032714 +- Concern: The method added for F5 said a folder has a report when the file exists "at that commit". Read as the commit that archived the folder, it gives 24 of 48 for October, not the 25 stated. The folder `2413-2410-si-22-1-document-event-flows-and-draft-adr` received its report in a later commit the same day. +- Solution: The method says the report is checked at the counting revision of `develop`, not at the archive commit, names that folder, and says that checking at the archive commit gives 24 of 48. The counts stay 25 of 48 and 2 of 32. This also answers the difference of one that the F5 entry could not place. +- Current-tree verification: `TZ=UTC git log torrust/develop --diff-filter=AR --date=format-local:'%Y-%m-%d %H:%M' --format='%cd %s' -- docs/issues/closed/2413-2410-si-22-1-document-event-flows-and-draft-adr` prints the archive commit at 2026-10-19 15:56 and the commit that added the report at 2026-10-19 17:22. `git cat-file -e torrust/develop:docs/issues/closed/2413-2410-si-22-1-document-event-flows-and-draft-adr/agent-review-reports.md` exits 0. +- Resolution reference: `docs(issues): [#2904] say at which revision the archived report is checked` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600155615 + +### F11 - The inventory accepts an agent as a rule's destination; AC6 accepts only a skill + +- PR number: 2905 +- Source review ID: 5939071001 +- Reviewer finding ID: F9 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600032737 +- Concern: The inventory paragraph added for F3 let a rule's destination be a named skill or agent, while AC6 required a named skill. A rule moved into an agent file would satisfy the inventory and fail AC6. +- Solution: Both now say the same: a named skill, or the agent file only when the rule is about the role itself (identity, tools, inputs, report format), which P2 keeps in the agent. +- Current-tree verification: Read the inventory paragraph under the Implementation Plan and AC6 in the specification after the change; both carry the same rule. `linter markdown` passed. +- Resolution reference: `docs(issues): [#2904] align the inventory's destinations with AC6` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600156170 + +### F12 - Automatic Checks names the reply validator's tests but not the stop hook's + +- PR number: 2905 +- Source review ID: 5939071001 +- Reviewer finding ID: F10 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600032753 +- Concern: T5 and the test paragraph add tests of the stop hook's limit, but the Automatic Checks list named only the reply validator's tests. +- Solution: Automatic Checks lists the tests of the stop hook's limit of 3 refusals (T5). +- Current-tree verification: Read the Automatic Checks list in the specification after the change. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] list the stop hook's tests among the automatic checks` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600156740 + +### F13 - The transition rule contradicts the stop hook's exemption in D17 + +- PR number: 2905 +- Source review ID: 5939415019 +- Reviewer finding ID: F11 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600284617 +- Concern: The rule added for F9 kept `agent-review-reports.md` for the reviews of this issue's own work until it closes. D17 exempts the stop hook only when the reviewer was given no folder-style specification, and this specification is folder-style, so after T5 a `task-reviewer` run on T6 to T12 would be held until it wrote a reply file here. +- Solution: D18 keys the switch to the merge of T5, not to the template a specification came from: from that merge a `task-reviewer` run on any folder-style specification writes a reply file and no entry in `agent-review-reports.md`, so the hook needs no exemption. For this issue that is `agent-review-reports.md` for T2 to T5 and reply files for T6 to T12. T5 states in `review-task` that a reply file satisfies the earlier template's checkpoint. This replaces the rule recorded under F9. +- Current-tree verification: Read D17, D18, the T5 row, the checkpoint line and the last bullet of Implementation Completion Review in the specification after the change; none keeps `agent-review-reports.md` for a review made after T5. `grep -n "specifications created after"` on the specification prints nothing. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] key the switch to reply files to the merge of T5` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600337329 + +### F14 - Preserve scoped instruction loading in T2 + +- PR number: 2905 +- Source review ID: 5939656808 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600475505 +- Concern: The reviewer says that, in the default mode, adding a root `CLAUDE.md` stops Claude Code from loading the `AGENTS.md` files in subdirectories, so importing only the root file leaves scoped rules such as `packages/configuration/AGENTS.md` unloaded. It asks T2 to preserve scoped loading and M4 to verify a scoped rule. +- Solution: The repository has ten scoped `AGENTS.md` files. The documentation states when a subdirectory's `AGENTS.md` loads but not whether a `CLAUDE.md` at the root or above stops it, and the file the reviewer cites could not be opened. The specification therefore asserts neither behaviour: D11 states what is documented, M4 reads a file in `packages/configuration/` and asks for a rule that only its `AGENTS.md` holds, T2 adds an import-only `CLAUDE.md` beside each scoped `AGENTS.md` if M4 shows they are not loaded, and AC12 requires the scoped rule to reach the session. +- Current-tree verification: `git ls-files | grep -E "(^|/)(AGENTS|CLAUDE)\.md$"` lists the root `AGENTS.md`, ten scoped `AGENTS.md` files and no `CLAUDE.md`. The page `https://code.claude.com/docs/en/memory`, section "When Claude Code reads AGENTS.md", was read on 2026-11-17: it says a subdirectory's `AGENTS.md` loads when Claude opens a file there and that subdirectory has none of the `CLAUDE.md` files of its own, and says nothing about a `CLAUDE.md` above it. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] keep the scoped AGENTS.md files loading when the root pointer is added` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600557255 + +### CC1 - Preserve the checker's non-profile checks + +- PR number: 2905 +- Source review ID: 5939656808 +- Reviewer finding ID: N/A +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600475579 +- Concern: T10 removed the whole `agent-review-report-contract` check, which also checks the pull-request audit skills, templates and finding references. The reply validator of D18 does not replace those. Issues #2349 and #2362 plan changes to the same check. +- Solution: D18, In Scope, T10, Commit Points, Automatic Checks and Risks say that only the rules about the Copilot profiles and `docs/templates/AGENT-REVIEW-REPORTS.md` are removed; the rest of the check stays and must pass, including after T9 rewrites `docs/agents/orchestration.md`. Issues #2349 and #2362 are named as changing the same check and are listed in References. +- Current-tree verification: `grep -n '\.md"' contrib/dev-tools/checks/agent-review-report-contract/src/main.rs` lists, besides four Copilot profiles and `AGENT-REVIEW-REPORTS.md`, the files `process-pr-review/SKILL.md`, `PR-REVIEW-TEMPLATE.md`, `semantic-skill-link-convention.md`, the thread skills and `docs/agents/orchestration.md`. `gh issue view` shows #2349 and #2362 open. `grep -n "check removed\|check is removed\|replaced by the validator"` on the specification prints nothing. +- Resolution reference: `docs(issues): [#2904] keep the pull-request audit rules of the contract check` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600557739 + +### F15 - The review of T5 itself sits on the boundary of the new rule + +- PR number: 2905 +- Source review ID: 5939681382 +- Reviewer finding ID: F13 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600494873 +- Concern: D18 put the review of T5 in `agent-review-reports.md`, because it is made before T5 merges. On the T5 branch the `task-reviewer` agent and its stop hook already exist, and scenario M7 runs the agent there with reply files (AC10), so a `task-reviewer` run reviewing T5 would be held until it wrote a reply file. The reviewer asks which record applies to T5. +- Solution: D18 keys the switch to whether the branch reviewed has the agent: the review of T5 itself runs the agent on the T5 branch and writes a reply file, and from the merge of T5 every `task-reviewer` run on a folder-style specification does. For this issue that is `agent-review-reports.md` for T2 to T4 and reply files for T5 to T12. The checkpoint line and the Implementation Completion Review bullet say "from the review of T5". +- Current-tree verification: Read D18, the T5 row, scenario M7, AC10, the checkpoint line and the last bullet of Implementation Completion Review after the change. `grep -n "T2 to T5\|T6 to T12"` on the specification prints nothing. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] say which record the review of T5 itself uses` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601683650 + +### F16 - The automated review's two threads still need audit rows + +- PR number: 2905 +- Source review ID: 5939862849 +- Reviewer finding ID: F14 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4600635189 +- Concern: The two threads of review `5939656808` were answered and resolved, but the audit record on the pull request's head still ended at F13. Rows were owed for that review and for the nit of review `5939681382` once answered. +- Solution: The rows F14 and CC1 were written at 13:58Z in a commit that stayed local, because the next fix would have been round 6 and needed the contributor's go-ahead. That commit is pushed now, together with the rows F15 and F16 of this round. +- Current-tree verification: `grep -c "^| F14 \|^| CC1 \|^| F15 \|^| F16 "` on this record prints 4. `git log torrust/develop..HEAD --format=%s` lists the round 5 audit commit. +- Resolution reference: `docs(pr-reviews): [#2904] record round 5 in the review audit of PR #2905` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601684277 + +### F17 - Exempt M7's deliberate missing-reply run from AC10 + +- PR number: 2905 +- Source review ID: 5941597022 +- Reviewer finding ID: F17 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601921916 +- Concern: Scenario M7 includes a forced case that uses up the 3 refusals of the stop hook. D17 says that case ends without a valid reply file, but AC10 required a valid file for every agent started in M7, so a correct escape path could not satisfy it. +- Solution: AC10 exempts the forced run of M7 that uses up the 3 refusals and names its evidence: the 3 refusals and the allowed fourth attempt recorded in `manual-verification-evidence.md` section V7. Every other agent started in M5 and M7 still needs a valid reply file. +- Current-tree verification: Read D17, AC10, AC11 and the M7 row after the change; they agree. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] exempt the forced run of M7 from AC10` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4602315071 + +### F18 - Reconcile the new subissue with the EPIC's model-selection exclusion + +- PR number: 2905 +- Source review ID: 5941597022 +- Reviewer finding ID: F18 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601921825 +- Concern: The EPIC's row 23 approves issue 2904, whose D4 and D13 require named models for the review roles, while the EPIC's Out of Scope list excludes selecting, requiring or routing work to a named model for any review or implementation role. +- Solution: The EPIC has a new entry under "Decisions Recorded on This EPIC" that records issue 2904 as the one approved exception, with what D4 and D13 pin and why, and the Out of Scope item points to it. The maintainer settled D4 and D13 in the design session of issue 2904 and chose to fix this finding in this pull request. The child specification is unchanged on this point. +- Current-tree verification: `grep -n "named model" docs/issues/open/2003-overhaul-guardrails-and-automation/EPIC.md` shows the Out of Scope item with its pointer and the new decision entry. Read D4 and D13 of the specification: the entry states them as written. `linter markdown` and `linter cspell` passed. +- Resolution reference: `docs(issues): [#2904] record the named models of issue 2904 as an EPIC exception` +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4602314436 + +### F19 - Round 6 was replied to and resolved before its fixes were pushed + +- PR number: 2905 +- Source review ID: 5941484820 +- Reviewer finding ID: F15 +- Source URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601834291 +- Concern: In round 6 the two replies were posted and the two threads resolved before the push that carried the fix and the audit commits, and one reply said "Both are pushed" about four minutes before they were. `resolve-review-threads` resolves a thread once its fix is pushed, and `process-pr-review` says to state only what ran. The reviewer says the record states the order truthfully and the bytes need no change; the order is the finding. +- Solution: Acknowledged in the reply; no file needed a change beyond this row. Round 7 follows the order: the fixes were pushed first, the replies posted after `git ls-remote` showed the fork branch at the local head, and the threads resolved after that. +- Current-tree verification: The round 6 entries of the processing log give the reply times (15:24:09Z, 15:24:12Z) and say the replies came before the push. The round 7 entry gives the push before the replies. +- Resolution reference: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601867922 +- Follow-up PR URL: N/A +- Reply URL: https://github.com/torrust/torrust-tracker/pull/2905#discussion_r4601867922 + +## Processing Log + +- 2026-11-17 12:58 UTC - Started audit, after the seven replies, because it holds their URLs. Review `5938631990` of `da2ce7` was submitted at 12:45:09Z (forge `submitted_at`) with seven findings, F1 to F7. The seven fixes and a plan and log follow-up were committed between 12:48:39Z and 12:55:23Z (`git log --format=%cI`, in UTC), one commit per finding, and pushed; `git ls-remote` showed the fork branch at the local head before the replies. The seven replies were posted between 12:57:58Z and 12:58:14Z (forge `created_at`). The body of issue 2904 was edited for F5 before the replies. +- 2026-11-17 12:59 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through the contributor account's `gh-bot`, exited 0 (7 rows, 0 failures). Resolved the seven threads; a GraphQL refresh showed 0 unresolved threads. +- 2026-11-17 13:14 UTC - Round 2: Copilot's review `5939023583` (submitted 13:09:05Z, forge `submitted_at`) on the first head, with two findings, F8 and F9. Both still applied to the current tree. The two fixes were committed at 13:10:24Z and 13:11:26Z (`git log --format=%cI`, in UTC) and pushed; `git ls-remote` showed the fork branch at the local head before the replies. The two replies were posted at 13:14:27Z and 13:14:29Z (forge `created_at`). +- 2026-11-17 13:15 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (9 rows, 0 failures). Resolved the two threads of round 2; a GraphQL refresh showed 0 unresolved threads. +- 2026-11-17 13:23 UTC - Correction for the entry stamped 13:15: it says the two threads of round 2 were resolved. The call resolved every unresolved thread, five in all: the two of round 2 and the three threads of review `5939071001`, which had been submitted at 13:11:58Z (forge `submitted_at`) and had not been read or answered. The three were reopened by 13:16:45Z (`date -u` after the call). This repeats the mistake recorded in round 8 of the audit of pull request 2851; from here on threads are resolved by their IDs, not by a query for unresolved threads. +- 2026-11-17 13:23 UTC - Round 3: review `5939071001` of `da2ce7` with three nits, recorded as F10 to F12. The three fixes were committed between 13:17:23Z and 13:18:56Z (`git log --format=%cI`, in UTC) and pushed with the round 2 audit commit; `git ls-remote` showed the fork branch at the local head before the replies. The three replies were posted between 13:22:34Z and 13:22:40Z (forge `created_at`). +- 2026-11-17 13:23 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (12 rows, 0 failures). Before resolving, the only unresolved threads were the three of round 3, each with the contributor's reply as its last comment. Resolved those three by their thread IDs; a GraphQL refresh showed 0 unresolved threads. +- 2026-11-17 13:39 UTC - Round 4: the approving review `5939415019` of `da2ce7` (submitted 13:34:02Z, forge `submitted_at`) with one finding, recorded as F13. The fix was committed at 13:36:02Z (`git log --format=%cI`, in UTC) and pushed; `git ls-remote` showed the fork branch at the local head before the reply. The reply was posted at 13:38:44Z (forge `created_at`). The reviewer's `ACK` comments name the heads before this fix. +- 2026-11-17 13:39 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (13 rows, 0 failures). The only unresolved thread was the one of F13. Resolved it by its thread ID; a GraphQL refresh showed 0 unresolved threads. +- 2026-11-17 13:58 UTC - Round 5: Copilot's review `5939656808` (submitted 13:50:36Z, forge `submitted_at`) with two findings, F14 and CC1. The two fixes were committed at 13:53:23Z and 13:54:41Z (`git log --format=%cI`, in UTC) and pushed; `git ls-remote` showed the fork branch at the local head before the replies. The two replies were posted at 13:57:32Z and 13:57:35Z (forge `created_at`). The `ACK` comments of `josecelano` (13:43:51Z) and `da2ce7` (13:52:21Z) name the head that carried the round 4 audit, before these two fixes. +- 2026-11-17 13:58 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (15 rows, 0 failures). Resolved the two threads of round 5 by their thread IDs. A GraphQL refresh showed 1 unresolved thread: the one of review `5939681382` of `da2ce7` (submitted 13:52:17Z, forge `submitted_at`, one nit about which record the review of T5 itself uses). It is not processed: a fix would be round 6, and the round limit of `wait-for-pr-review` requires asking the contributor first. It has no row yet. +- 2026-11-17 15:24 UTC - The contributor (maintainer of the repository) answered the round-limit question with "Push before merge": fix the nit as round 6 and push it with the audit commits, although `josecelano` (15:20:48Z) and `da2ce7` (14:04:11Z) had posted `ACK` for the head that carried the round 5 fixes (forge `created_at`); the push moves the head past those comments. +- 2026-11-17 15:24 UTC - Round 6: the reviews `5939681382` (submitted 13:52:17Z) and `5939862849` (submitted 14:04:07Z, forge `submitted_at`) of `da2ce7`, one finding each, recorded as F15 and F16. The fix for F15 was committed at 15:23:34Z (`git log --format=%cI`, in UTC). The two replies were posted at 15:24:09Z and 15:24:12Z (forge `created_at`), before the push, so that the fix and both audit commits reach the pull request as one new head. +- 2026-11-17 15:25 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (17 rows, 0 failures). The only unresolved threads were the two of round 6, each with the contributor's reply as its last comment. Resolved them by their thread IDs; a GraphQL refresh showed 0 unresolved threads. +- 2026-11-17 16:12 UTC - The contributor (maintainer of the repository) answered the round-limit question for Copilot's review `5941597022` with "Fix as round 7", although `josecelano` (15:33:57Z) and `da2ce7` (15:35:36Z) had posted `ACK` for the head that carried the round 6 audit (forge `created_at`); the push moves the head past those comments. +- 2026-11-17 16:12 UTC - Round 7: Copilot's review `5941597022` (submitted 15:42:17Z, forge `submitted_at`) with two findings, F17 and F18, and the approving review `5941484820` of `da2ce7` with one finding about the order of round 6, recorded as F19. The reply to F19 was posted at 15:38:07Z (forge `created_at`) with no commit, and its thread was left unresolved until this row existed. The two fixes for F17 and F18 were committed at 16:08:15Z and 16:08:48Z (`git log --format=%cI`, in UTC) and pushed; `git ls-remote` showed the fork branch at the local head at 16:11:45Z (`date -u`). The two replies were posted after that, at 16:12:04Z and 16:12:06Z (forge `created_at`). +- 2026-11-17 16:14 UTC - `validate-audit-record.py --pr-number 2905 --base torrust/develop`, with its `gh` calls made through `gh-bot`, exited 0 (20 rows, 0 failures). The unresolved threads were the three of round 7, each with the contributor's reply as its last comment. Resolved the two threads of F17 and F18 by their thread IDs, their fixes being on the pull request; a GraphQL refresh showed 1 unresolved thread, the one of F19. Its row records `RESOLVED` as the state it takes once this record is pushed: it is not resolved at the time of this entry, and is resolved by its thread ID after the push. + + + +## Completion Rules + +- Re-derive the reply claim against the current tree before replying or resolving a thread. +- Reply on every resolvable thread before resolving it. +- For an outdated thread whose concern was fixed, record `Disposition=FIXED` and + `Thread state=RESOLVED`, even if GitHub marks the thread outdated after the push. For a + duplicate, superseded, or no-change in-PR thread, reply exactly + `Superseded by : .`, record `Disposition=NO_ACTION` and + `Thread state=SUPERSEDED`, then resolve it. A post-merge `NO_ACTION` requires maintainer + approval to decline the follow-up work. When the current identity cannot resolve a thread + (`viewerCanResolve` is `false`), still reply, keep the disposition established from the current + tree, and record `Thread state=OPEN`; the reviewer or PR author resolves it. +- A consolidated PR conversation response may cover multiple review rounds only when it names + every review ID and every finding ID with its disposition and resolution reference. Record its + durable URL in each related row. +- Cite a fix by its unique Conventional Commit subject or durable reply URL, never by a branch SHA + that can change after a rebase. +- Refresh review threads using GraphQL and confirm that no unresolved actionable thread remains.