From 4907a3aad1e2d2f6f1fb6bc87cd7015fd67b8c9d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 18:58:21 +0000 Subject: [PATCH 01/24] docs: release-agents - Specify portable changelog and release agents Add spec 020 (spec.md and requirements checklist) for the portable release-preparation MVP and standalone changelog MVP, plus a Draft catalog entry. issue-map.md and delivery-plan.md follow separately. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../checklists/requirements.md | 35 +++ .../spec.md | 228 ++++++++++++++++++ .github/specs/CATALOG.md | 1 + 3 files changed, 264 insertions(+) create mode 100644 .github/specs/020-portable-changelog-release-agents/checklists/requirements.md create mode 100644 .github/specs/020-portable-changelog-release-agents/spec.md diff --git a/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md b/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md new file mode 100644 index 0000000000..612ca9cd7b --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md @@ -0,0 +1,35 @@ +# Specification Quality Checklist: Portable Changelog and WordPress Release Preparation Agents + +**Purpose**: Validate specification completeness and quality before proceeding to planning +**Created**: 2026-10-09 +**Feature**: [spec.md](../spec.md) + +## Content Quality + +- [x] No implementation details beyond names the brief mandates (existing utilities, test frameworks, package layout are constraints, not new design) +- [x] Focused on user value and safety outcomes +- [x] Written so maintainers and reviewers can follow it +- [x] All mandatory sections completed + +## Requirement Completeness + +- [x] No [NEEDS CLARIFICATION] markers remain (three open decisions are listed for `/speckit-clarify`) +- [x] Requirements are testable and unambiguous +- [x] Success criteria are measurable +- [x] Success criteria avoid invented thresholds +- [x] All acceptance scenarios are defined +- [x] Edge cases are identified +- [x] Scope is clearly bounded (MVP versus roadmap versus out of scope) +- [x] Dependencies and assumptions identified + +## Feature Readiness + +- [x] All functional requirements have clear acceptance criteria +- [x] User scenarios cover primary flows +- [x] Feature meets measurable outcomes defined in Success Criteria +- [x] No unverified claims (issue/PR numbers appear only where the brief cites them) + +## Notes + +- `issue-map.md` and `delivery-plan.md` are not yet written: they require reading live GitHub issue and PR records and a separate approval boundary. +- Run `/speckit-clarify` for the three open decisions before `/speckit-plan`. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md new file mode 100644 index 0000000000..196f9eb3c6 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -0,0 +1,228 @@ +# Feature Specification: Portable Changelog and WordPress Release Preparation Agents + +**Feature Branch**: `docs/portable-changelog-release-agents` + +**Created**: 2026-10-09 + +**Status**: Draft + +**Input**: User description: "Create .github/specs/020-portable-changelog-release-agents and use the attached prompt (Spec Kit 020 verified issue/PR plan) to specify the spec." + +## Scope and Delivery Boundaries + +This specification defines a bounded, manually invoked **release-preparation MVP** (delivery priority 1) and a **standalone changelog MVP** (delivery priority 2), joined by an explicit, blocking verification handoff. It extends existing implementations; it does not rebuild them. + +**In scope (executable MVP)** + +- Release-preparation readiness and approved preparation edits for WordPress plugins, themes and enhancement repositories. +- Standalone changelog inspection, drafting, validation, release-entry preparation and separately approved bounded edits. +- The release-to-changelog verification request and handback. +- Reuse and hardening of the existing WordPress version utilities and the shipped changelog validation engine. + +**Roadmap only (not executable spec 020 tasks)** + +- Other first-wave agents (PRD, linting, PR, reviewer, testing, PageSpeed, design-partner, issue, reporting). +- Provider installation and marketplace distribution, release/rollback workflow automation, pilot rollouts and the later documentation restructure. These are tracked in `issue-map.md` and `delivery-plan.md` as separate, later, independently reviewable slices. + +**Out of scope** + +- Promising a same-day release, or inferring deployment from a merged preparation PR. +- A second changelog validation engine, a second release agent, or speculative deletion of existing utilities. +- Any change to locked governance files (labels, issue types, issue/PR templates, branch routing). +- Changes to GitHub or Linear records, commits, PRs, tags, releases or deployments, without separate approval. + +## User Scenarios & Testing *(mandatory)* + +### User Story 1 - Release preparation readiness (Priority: P1) + +A maintainer points the release agent at a target WordPress plugin, theme or enhancement repository (by explicit repository root) and asks whether it is ready to prepare for release. The agent reports readiness without writing anything. Only after the maintainer separately approves does it apply allowlisted, recoverable preparation edits. + +**Why this priority**: Release preparation is delivery priority 1. A false "ready" result or a partially updated version set is the most damaging failure, so the safe, read-only readiness check is the first value delivered. + +**Independent Test**: Run the agent in dry-run mode against fixtures for a plugin, a theme, an enhancement and an ordinary repository, with the working directory set somewhere other than the target. Confirm correct detection and readiness output, and confirm zero writes. + +**Acceptance Scenarios**: + +1. **Given** a plugin or theme repository with consistent version fields, **When** the maintainer requests a dry run with an explicit repository root, **Then** the agent reports readiness for that target and makes no file or git changes. +2. **Given** a process working directory that differs from the requested repository root, **When** the agent runs, **Then** every filesystem and git operation applies to the requested root only. +3. **Given** a repository with no optional `VERSION` file, **When** the agent detects the component, **Then** detection and readiness still succeed using the authoritative plugin header, theme stylesheet, readme or package fields. +4. **Given** an ordinary WordPress repository that merely contains `.github`, `package.json` and `VERSION`, **When** the agent evaluates it, **Then** it is not misidentified as a governance repository. +5. **Given** version fields that disagree (drift) or authoritative headers that are ambiguous, **When** readiness is checked, **Then** the agent stops, names the conflicting sources and files, and does not report ready. +6. **Given** a dirty working tree, missing required checks, an unsafe path, or conflicting version/tag evidence, **When** readiness is checked, **Then** the agent stops with a meaningful error and takes no staging, stashing or remote action. +7. **Given** an approved preparation edit that fails part-way, **When** the failure is detected, **Then** the agent reports the failure, does not present the result as ready, and leaves the repository recoverable. + +--- + +### User Story 2 - Standalone changelog preparation (Priority: P2) + +A maintainer uses the changelog agent on its own, without any release workflow, to inspect a changelog, draft entries, validate them and prepare a release entry. Edits are applied only when separately approved and are bounded. + +**Why this priority**: The changelog agent is delivery priority 2 and must work locally without unbuilt `changelog.yml` or `release.yml` workflows. Future workflows may enforce per-PR use later. + +**Independent Test**: Run the agent against fixtures (well-formed, malformed, repeated-run, empty-Unreleased) in inspect and draft modes, then apply one approved edit and confirm only that edit occurred. + +**Acceptance Scenarios**: + +1. **Given** a changelog with entries under Unreleased, **When** the maintainer asks for a draft, **Then** the agent proposes release entries and changes no file. +2. **Given** an entry using a category outside Added, Changed, Deprecated, Removed, Fixed or Security, **When** validated, **Then** it is reported as invalid with the allowed categories listed. +3. **Given** the shipped validation engine, **When** the agent validates, **Then** it uses that engine and no second validation implementation exists. +4. **Given** an approved bounded edit, **When** applied, **Then** historic entries and links are preserved unchanged. +5. **Given** the agent is run twice with no new changes, **When** Unreleased handling executes the second time, **Then** the result is unchanged (idempotent). +6. **Given** neither `changelog.yml` nor `release.yml` exists, **When** the agent runs locally, **Then** all MVP behaviour still works. + +--- + +### User Story 3 - Blocking release-to-changelog handoff (Priority: P1) + +When release preparation reaches the changelog step, the release agent explicitly asks the changelog agent to verify the changelog. The release agent treats the verification result as blocking evidence and only proceeds on recorded success. + +**Why this priority**: Without a fail-closed handoff, preparation could be reported ready while the changelog is unverified. This is the integration point that makes the two MVPs one safe flow. + +**Independent Test**: Simulate success, failure, missing and timed-out verification responses and confirm the release agent reports ready only on recorded success. + +**Acceptance Scenarios**: + +1. **Given** the changelog agent returns verification success with evidence, **When** the release agent receives it, **Then** readiness may be reported complete. +2. **Given** verification fails, is missing or is not received, **When** the release agent evaluates handback, **Then** it reports not ready and names the missing or failing evidence. +3. **Given** the changelog agent is unavailable, **When** release preparation is run, **Then** the agent fails closed and never silently falls back or skips the gate. +4. **Given** the MVP flow, **When** it runs, **Then** it requires no new labels and no event services. + +--- + +### User Story 4 - Portable, self-contained packaging (Priority: P2) + +A maintainer copies the two agents into another repository or user environment. Each is a coherent package with one canonical agent definition, a README, an agent changelog and namespaced skills, and it works without depending on a checkout of this governance repository. + +**Why this priority**: Portability is the purpose of the work, but it is only valuable once the behaviour in Stories 1-3 is correct. + +**Independent Test**: Install the packages into a clean location that has no `~/.github` checkout and confirm they resolve all needed resources and run. + +**Acceptance Scenarios**: + +1. **Given** a copied Claude adapter, **When** it runs outside the governance checkout, **Then** it resolves its resources without relying on thin relative references into that checkout. +2. **Given** an existing release or WordPress utilities capability, **When** callers and exports are inventoried, **Then** the WordPress utilities become reused and hardened adapter functionality, with callers and tests migrated before any removal. +3. **Given** a skill package, **When** validated, **Then** it conforms to the skill standard; the agent envelope as a whole is not forced into that standard. + +--- + +### User Story 5 - Verified delivery plan for the work (Priority: P3) + +A governance maintainer reviews a traceable plan that maps existing GitHub issues to bounded roles and to one-PR-per-slice branch profiles, so existing work is reused rather than duplicated and no record changes without approval. + +**Why this priority**: The plan makes delivery governable but does not itself change runtime behaviour. + +**Independent Test**: Review `issue-map.md` and `delivery-plan.md` against live issue and PR records and confirm every entry has a URL, current state, proposed change and approval preview, with no fabricated numbers. + +**Acceptance Scenarios**: + +1. **Given** an existing issue that fits a role, **When** the map is produced, **Then** it proposes repurposing that issue rather than creating a replacement. +2. **Given** any proposed issue, label, type or assignment change, **When** presented, **Then** it appears as an exact preview that requires separate approval. +3. **Given** a PR profile, **When** documented, **Then** it states branch, base, title, template, labels, assignee, prerequisites and closure rule, using the repository's current routing and flagging any template-label conflict for maintainer resolution. + +### Edge Cases + +- Plugin and theme markers both present, or neither present. +- Authoritative header missing, duplicated or contradicting `readme` stable-tag, `style.css` version or package version. +- A `VERSION` file present but disagreeing with headers. +- Repository root path containing symlinks, relative segments or characters that escape the root. +- Existing tag already present, or local and remote tag evidence conflicting. +- Changelog missing, empty, or containing only Unreleased with no entries. +- Changelog edited by hand between draft and apply. +- Approved edit interrupted part-way (some files updated, others not). +- Repository access denied for a target (for example a permission boundary on a pilot repository): affected checks remain blocked, not skipped. +- Spec directory number 019 is reserved on an unmerged branch and must not be allocated. + +## Requirements *(mandatory)* + +### Functional Requirements + +**Release preparation** + +- **FR-001**: The release agent MUST operate in readiness (dry-run) mode by default and MUST NOT write files or change git state in that mode. +- **FR-002**: An explicit repository root MUST be propagated to every filesystem and git operation, independent of the process working directory. +- **FR-003**: The agent MUST detect plugin, theme and enhancement targets without requiring an optional `VERSION` file, and MUST NOT classify a repository as governance merely because it contains `.github`, `package.json` and `VERSION`. +- **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. +- **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. +- **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. +- **FR-007**: Approved preparation edits MUST be limited to an allowlist, MUST be recoverable on failure, and MUST return meaningful errors; a partial version update MUST NOT be presented as ready. +- **FR-008**: The agent MUST treat preparation and readiness as its default purpose and MUST NOT perform automatic release execution, tagging or publication. + +**Changelog** + +- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved and bounded. +- **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. +- **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. +- **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. +- **FR-013**: The five-operation shared-skill obligations carried by the existing changelog MVP issue MUST be preserved. + +**Handoff** + +- **FR-014**: The release agent MUST send an explicit verification request to the changelog agent and MUST treat the response as blocking evidence; missing, failed or unreceived verification MUST yield not-ready (fail closed). +- **FR-015**: The handoff MUST require no new labels or event services for the MVP. + +**Packaging and architecture** + +- **FR-016**: Exactly two user-facing orchestration agents exist; the WordPress utilities become reused and hardened release adapter functionality after callers, exports and tests are migrated, with no speculative deletion. +- **FR-017**: Each agent package MUST contain one canonical `AGENT.md`, a `README.md`, an agent `CHANGELOG.md`, `package.json` and lockfile where the project convention requires, `scripts/`, namespaced `skills//SKILL.md`, and a small Claude adapter; `references/` and `assets/` only for actual content, with no gratuitous includes, gates, shared, results, manifest or example trees and no invented dependencies. +- **FR-018**: The specification MUST resolve explicitly the distinct roles of working-instructions `AGENTS.md` and the definition `AGENT.md`, reuse the in-flight canonical-source migration, and keep module boundaries (no incidental CommonJS-to-ESM or TypeScript migration). +- **FR-019**: Copied adapters MUST resolve resources outside the governance checkout; installation MUST default to dry run, refuse name collisions, preserve user and project overrides, pin source and version, and never copy secrets, hooks or cloud configuration wholesale. +- **FR-020**: Compatibility claims for Gemini, OpenAI and Copilot adapters MUST be backed by independent current documentation and tests; none is assumed. + +**Testing** + +- **FR-021**: Automated tests MUST use Jest beside JavaScript scripts (`scripts/__tests__/` or `scripts/adapters/__tests__/`) and Bash/Bats at the agent-root `tests/` with fixtures; no new test framework or language is introduced and existing Node-test, PHP and Playwright tests are not converted merely for placement. +- **FR-022**: Fixtures MUST cover plugin, theme and enhancement variation, an ordinary `.github` target, optional `VERSION`, ambiguous headers, drift, repeated runs, invalid paths, working directory differing from repository root, dry-run zero writes, fail-closed handoff and recoverable edit failures. + +**Release-process contract (guidance, not execution permission)** + +- **FR-023**: The specification MUST state the safe invariant that no tag is created before reviewed release changes are merged into the authoritative main release commit, and MUST describe the typical flow: validated preparation, approved preparation PR if required, release branch, reviewed release PR to main, verification of merged main SHA and version, one immutable annotated tag, approved publication, and a reviewed main-to-develop backmerge. +- **FR-024**: The specification MUST resolve the single-PR versus two-PR contradiction in current release docs, MUST NOT force identical branch flow on every target, and MUST NOT equate GitHub publication with live deployment or no drift with identical branch tips. + +**Governance of the work itself** + +- **FR-025**: Spec artefacts MUST be Markdown/design only, limited to the permitted allowlist, with a draft entry in the spec catalog that follows its actual schema; feature number 019 MUST NOT be allocated. +- **FR-026**: `issue-map.md` MUST map each existing issue to a bounded role with full URLs, current state, proposed repurpose, preserved history, task/story/path mapping, owner and decision gaps, native-type versus label distinction, and an exact approval preview; `delivery-plan.md` MUST give one profile per slice (branch, base, title, template, labels, assignee, closure rule, prerequisites), existing PR reuse, conditional stack plan, merge order and deferred phases; neither may contain fabricated issue/PR numbers or test results. +- **FR-027**: Locked governance files MUST NOT be edited; template and label conflicts MUST be presented for maintainer resolution. + +### Key Entities + +- **Target repository**: the plugin, theme or enhancement being prepared; identified by an explicit repository root. +- **Authoritative version source**: a header, readme, stylesheet, package or `VERSION` field designated by the target's instructions. +- **Readiness report**: the read-only outcome of a dry run, including detected type, version evidence, drift and blockers. +- **Preparation edit**: an approved, allowlisted, recoverable change to version fields. +- **Changelog entry / release entry**: an entry in one of the six allowed categories, linked to history that must be preserved. +- **Verification handoff**: the request and blocking response between the release and changelog agents. +- **Delivery slice**: one independently reviewable issue-to-PR unit (spec, consolidation, release MVP, changelog MVP, decisions, documentation, setup, distribution, workflows, rollback). + +## Success Criteria *(mandatory)* + +### Measurable Outcomes + +- **SC-001**: In every required fixture scenario, a dry run produces zero file or git-state changes. +- **SC-002**: With the working directory different from the target, 100% of filesystem and git operations in the fixtures act on the requested repository root. +- **SC-003**: Every drift, ambiguity, dirty-tree, unsafe-path and conflicting-tag fixture results in a not-ready outcome that names the specific cause; none results in a false ready. +- **SC-004**: Every interrupted-edit fixture ends with the repository recoverable and no result presented as ready. +- **SC-005**: Every missing, failed or unreceived changelog verification fixture yields not-ready; ready is reported only on recorded success. +- **SC-006**: The changelog flow completes all MVP fixtures with neither `changelog.yml` nor `release.yml` present, and a second run with no new changes alters nothing. +- **SC-007**: Historic changelog entries and links are byte-identical after every approved apply fixture. +- **SC-008**: A copied agent package runs in a clean location with no governance checkout present. +- **SC-009**: Each existing issue in scope is either repurposed in the issue map or explicitly dispositioned; zero replacement issues are proposed where an existing issue fits, and zero entries contain fabricated numbers. +- **SC-010**: No locked governance file, source code, package manifest, root version or root changelog is modified by this specification's pull request. + +## Assumptions + +- Feature number 020 is correct: 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. +- Existing work is reused: the in-flight consolidation (issue 3880 / PR 3881, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, open and blocked, not merged), merged PR 3820, and spec 016 with the shipped `.github/validation/changelog/` engine. +- Default delivery is S independent, existing consolidation finished, then release MVP and changelog MVP branched from refreshed develop; stacking the release MVP on PR 3881 happens only if it needs layout available exclusively there, and never on the Qodo reservation. +- Pilot repositories, installer behaviour, marketplace distribution, workflow restoration and rollback are later work owned by existing issues; no pilot architecture or code transfer is decided here. +- Live environment, version, deployment and rollback decisions remain unresolved and are not inferred. +- Archived release workflows are evidence only and not production-ready dependencies. +- Branch creation and the rename to `docs/portable-changelog-release-agents` followed the session branching hook; the branch was created from the current develop tip and no commit or push has occurred. + +## Open Decisions for `/speckit-clarify` + +These are recorded as decisions for the clarify stage rather than guessed: + +1. Which source is authoritative when a target's own instructions are silent on version fields. +2. Whether any release-preparation edit beyond version fields (for example changelog stamping) belongs to the release agent or only to the changelog agent. +3. Whether a plugin/theme adapter ships as one coherent module or two separately reviewed slices. diff --git a/.github/specs/CATALOG.md b/.github/specs/CATALOG.md index f1af55fd7d..cd8af09a1a 100644 --- a/.github/specs/CATALOG.md +++ b/.github/specs/CATALOG.md @@ -59,6 +59,7 @@ All specification catalog entries MUST follow this exact column order and naming | 014 | agents-restructure-consolidate | Agent Structure Standardization & Skill Consolidation | Draft | 2026-09-18 | [./014-agents-restructure-consolidate/spec.md](./014-agents-restructure-consolidate/spec.md) | | 015 | pr-agent-consolidation | PR Agent Consolidation & Portability | Draft | 2026-09-18 | [./015-pr-agent-consolidation/spec.md](./015-pr-agent-consolidation/spec.md) | | 016 | changelog-agent-quality | Changelog Agent Quality & Validation Framework | Draft | 2026-09-18 | [./016-changelog-agent-quality/spec.md](./016-changelog-agent-quality/spec.md) | +| 020 | portable-changelog-release-agents | Portable Changelog and WordPress Release Preparation Agents | Draft | 2026-10-09 | [./020-portable-changelog-release-agents/spec.md](./020-portable-changelog-release-agents/spec.md) | --- From 603bff99cc927719bf3bc8b14baba50db3df6811 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:03:05 +0000 Subject: [PATCH 02/24] docs: release-agents - Add spec 020 plan, research and contracts Add plan.md, research.md (code audit against the spec, decisions, Linear GIT-1293 reconciliation), data-model.md, three Markdown contracts and a quickstart. issue-map.md, delivery-plan.md and tasks.md follow separately. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/agent-package-layout.md | 30 ++++ .../contracts/readiness-report.md | 38 +++++ .../contracts/verification-handoff.md | 33 ++++ .../data-model.md | 77 +++++++++ .../plan.md | 147 ++++++++++++++++++ .../quickstart.md | 48 ++++++ .../research.md | 93 +++++++++++ 7 files changed, 466 insertions(+) create mode 100644 .github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md create mode 100644 .github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md create mode 100644 .github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md create mode 100644 .github/specs/020-portable-changelog-release-agents/data-model.md create mode 100644 .github/specs/020-portable-changelog-release-agents/plan.md create mode 100644 .github/specs/020-portable-changelog-release-agents/quickstart.md create mode 100644 .github/specs/020-portable-changelog-release-agents/research.md diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md b/.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md new file mode 100644 index 0000000000..1ff9f867c1 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md @@ -0,0 +1,30 @@ +# Contract: Agent Package Layout + +Applies to `agents/release-agent/` and `agents/changelog-agent/` (FR-017). Reconciliation with the in-flight canonical-source migration (issue #3880, PR #3881) is a prerequisite. + +## Required + +| Item | Notes | +|------|-------| +| `AGENT.md` | One canonical agent definition. Distinct from working-instructions `AGENTS.md`. | +| `README.md` | Usage, safety defaults and portability notes. | +| `CHANGELOG.md` | The agent's own changelog. | +| `scripts/` | Node scripts; tests in `scripts/__tests__/` or `scripts/adapters/__tests__/` (Jest). | +| `skills//SKILL.md` | Namespaced, conforming to the skill standard. Only real skills; no empty placeholders. | +| `claude/` | Small Claude adapter that resolves resources outside any governance checkout. | + +## Conditional + +| Item | When | +|------|------| +| `package.json` and lockfile | Where the selected project convention requires them. | +| `tests/` with fixtures | Bash/Bats cases at agent root. | +| `references/`, `assets/` | Only when actual content exists. | + +## Prohibited + +Gratuitous `includes/`, `gates/`, `shared/`, `results/`, `manifest` or example trees; invented dependencies; empty directories created to look compliant. + +## Install behaviour (for the later setup and distribution slices) + +Default dry run; refuse name collisions; preserve user and project overrides; pin source and version; define upgrade and uninstall ownership; never copy secrets, hooks or cloud configuration wholesale. Claude local and cloud discovery differ; other providers need independent current documentation and tests. diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md new file mode 100644 index 0000000000..23975d9c80 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md @@ -0,0 +1,38 @@ +# Contract: Release Readiness Report + +**Producer**: release agent (readiness operation) | **Consumers**: maintainer, changelog agent (via handoff) + +The readiness operation is read-only. Producing this report must not write files, stage, stash, tag, push or contact a remote. + +## Inputs + +| Input | Required | Notes | +|-------|----------|-------| +| `repoRoot` | Yes | Explicit path. Applied to every filesystem and git operation. | +| `mode` | No | Defaults to `readiness`. Any other mode is a separate, approved operation. | + +## Output fields + +| Field | Description | +|-------|-------------| +| `status` | `ready` or `not-ready`. | +| `repoRoot` | Echo of the root actually used. | +| `componentType` | `plugin`, `theme`, `enhancement` or `unknown`. | +| `versionSources[]` | Each source: kind, repository-relative path, value, authoritative flag. | +| `findings[]` | Each finding: `code`, `severity` (`blocker` or `note`), `message`, affected paths. | +| `writes` | Always `0` for readiness. Non-zero is a defect. | + +## Required blocker codes + +| Code | Raised when | +|------|-------------| +| `dirty-tree` | Uncommitted changes exist. | +| `version-drift` | Detected versions differ. Findings name each source and file. | +| `version-ambiguous` | Authoritative field cannot be determined from the target's instructions. | +| `unsafe-path` | A path escapes `repoRoot` or is absolute where relative is required. | +| `missing-check` | A required check could not run; it is never skipped silently. | +| `tag-conflict` | Local and remote tag evidence disagree, or the target tag exists. | +| `component-unknown` | No plugin, theme or enhancement could be identified. | +| `changelog-unverified` | Handoff verification is missing, failed or not received. | + +`status` is `ready` only when no `blocker` finding exists. diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md new file mode 100644 index 0000000000..f8b68250d9 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md @@ -0,0 +1,33 @@ +# Contract: Release to Changelog Verification Handoff + +**Requester**: release agent | **Responder**: changelog agent | **Transport**: structured document, no new labels or event services (FR-015) + +## Request + +| Field | Description | +|-------|-------------| +| `contractVersion` | Version of this contract. | +| `repoRoot` | Explicit root the changelog agent must use. | +| `targetVersion` | Version the release is being prepared for. | +| `readiness` | Summary of the readiness report at request time, including its `status`. | +| `changelogPath` | Repository-relative path. | + +The changelog agent refuses a request whose `readiness.status` is not `ready` for the pre-changelog checks, or whose fields are missing, and replies `failed` with a reason. + +## Response + +| Field | Description | +|-------|-------------| +| `result` | `verified` or `failed`. | +| `evidence` | Required when `verified`: validation outcome, categories found, Unreleased entry count, and the validation engine identity and version used. | +| `reason` | Required when `failed`. | + +## Release-agent handling + +| Situation | Outcome | +|-----------|---------| +| `verified` with evidence | Readiness may be reported complete. | +| `failed` | `not-ready`, `changelog-unverified`, reason surfaced. | +| No response, malformed response, or changelog agent unavailable | `not-ready`, `changelog-unverified`. Never a silent fallback or skipped gate. | + +Verification is read-only. Applying changelog edits is a separate operation requiring its own approval. diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md new file mode 100644 index 0000000000..5cc98d3e11 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -0,0 +1,77 @@ +# Data Model: Portable Changelog and WordPress Release Preparation Agents + +**Feature**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) + +Entities are conceptual. They describe what each agent must know and the states it moves through, not storage schemas. + +## Target repository + +| Field | Meaning | +|-------|---------| +| `repoRoot` | Explicit absolute path supplied by the caller. Never defaulted from the process working directory. | +| `componentType` | `plugin`, `theme`, `enhancement` or `unknown`. `unknown` is a stop, not a guess. | +| `instructionsFound` | Whether the target's own instructions name authoritative version fields. | + +**Rules**: an ordinary repository that merely contains `.github/`, `package.json` and `VERSION` is not a governance repository (FR-003). Detection must never require `VERSION`. + +## Version source + +| Field | Meaning | +|-------|---------| +| `kind` | plugin header, readme stable tag, theme stylesheet, package, `VERSION`. | +| `path` | Repository-relative path, validated to stay inside `repoRoot`. | +| `value` | Detected version string. | +| `authoritative` | True only when the target's instructions designate it. | + +**Rules**: if no source is designated, every detected value is reported and the result is `ambiguous` (FR-004). Differing values across sources are `drift`. + +## Readiness report + +See [contracts/readiness-report.md](./contracts/readiness-report.md). States: + +```text +not-run -> ready | not-ready +``` + +`ready` requires: component detected, no drift, no ambiguity, clean tree, safe paths, no conflicting tag evidence, and (when the handoff is in play) recorded changelog verification success. + +## Preparation edit + +| Field | Meaning | +|-------|---------| +| `path` | Allowlisted version-field file. | +| `from`, `to` | Current and target version. | +| `approval` | Reference to the separate approval. Absent means the edit must not run. | +| `backup` | Recovery point captured before the edit. | + +States: `proposed -> approved -> applied | failed-recovered`. A `failed` edit that cannot be recovered is never reported as ready. + +## Changelog entry + +| Field | Meaning | +|-------|---------| +| `category` | One of Added, Changed, Deprecated, Removed, Fixed, Security. | +| `text` | Entry text, subject to the repository's length and link rules. | +| `link` | Pull request or issue reference where required. | +| `section` | `Unreleased` or a version heading. | + +**Rules**: historic sections and links are preserved byte-for-byte; Unreleased handling is idempotent. + +## Verification handoff + +See [contracts/verification-handoff.md](./contracts/verification-handoff.md). States: + +```text +requested -> verified | failed | missing +``` + +Only `verified` with evidence allows the release agent to report ready. `failed`, `missing` and no response all yield not-ready. + +## Delivery slice + +| Field | Meaning | +|-------|---------| +| `id` | Profile code from the delivery plan (S, F, R1, C2, DEC, DOC, SETUP, DIST, WFLOW, ROLLBACK). | +| `issues` | Full GitHub issue URLs, and the Linear identifier once confirmed. | +| `branch`, `base`, `template` | As recorded in `delivery-plan.md` once written. | +| `closure` | Which issues the slice may close; partial work uses reference-only wording. | diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md new file mode 100644 index 0000000000..50173bcfce --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -0,0 +1,147 @@ +# Implementation Plan: Portable Changelog and WordPress Release Preparation Agents + +**Branch**: `docs/portable-changelog-release-agents` | **Date**: 2026-10-09 | **Spec**: [spec.md](./spec.md) + +**Input**: Feature specification from `.github/specs/020-portable-changelog-release-agents/spec.md`, plus the planning note that Linear is the primary issue-planning system and epic GIT-1293 with its children is central to spec 020. + +## Summary + +Deliver two manually invoked agents by hardening what already exists: the release agent (`agents/release-agent/`) becomes a read-only-by-default readiness and approved-preparation agent that honours an explicit repository root, and the changelog agent (`agents/changelog-agent/`) becomes a standalone inspect/draft/validate/prepare agent that reuses the shipped validation engine. The WordPress utilities (`agents/wordpress-release-utilities-agent/`) are absorbed as release adapter functionality after their callers and tests are migrated. A fail-closed verification handoff joins the two. This plan is design only: no runtime, package or workflow change is made by this specification PR. + +The code audit in [research.md](./research.md) found concrete gaps between today's code and the spec, which the implementation slices must close (explicit root propagation, dirty tree as a hard stop, control-plane misdetection, ESM/CJS boundary, remote-effect operations in the preparation path). + +## Linear and issue-tracking context + +Linear is where issue planning happens, so epic [GIT-1293](https://linear.app/lightspeedwp/issue/GIT-1293/epic-portable-agents-deliver-the-essential-first-wave) and its children are authoritative for ownership, status and sequencing. They were read on 2026-10-09 (the Linear connector became available mid-session); the GitHub mirror is [lightspeedwp/.github#1546](https://github.com/lightspeedwp/.github/issues/1546). + +**GIT-1293**: status Tracking, assignee Ash Shaw, 18 children (3 Done: GIT-1306, GIT-1308, GIT-1314). The epic description still carries the broad release-redesign scope and states that its older phase status and "no blockers" claims are historical, not verified. + +**Spec 020 slices as they exist in Linear**: + +| Linear | GitHub | Title in Linear | Status | Assignee | Parent | +|--------|--------|-----------------|--------|----------|--------| +| GIT-1302 | #1555 | aiops: release-agent - Specify portable multi-repo support | In Progress | Ash Shaw | GIT-1293 | +| GIT-1303 | #1556 | aiops: changelog-agent - Define the changelog agent specification | Backlog | Ash Shaw | GIT-1293 | +| GIT-1300 / 1301 / 1304 | #1553 / #1554 / #1557 | requirements, architecture, WordPress versioning design | Backlog / Todo / Todo | Ash Shaw | GIT-1293 | +| GIT-1312 / 1313 | #1565 / #1566 | WordPress plugin and theme version handling | Todo | Ash Shaw | GIT-1293 | +| GIT-1310 | #1563 | aiops: release-agent - Build portable agent | In Progress | Ash Shaw | none | +| GIT-1744 | #2653 | aiops: changelog-automation - Create portable shared skill | Todo | Chris | none | +| GIT-2623 | #3880 / PR #3881 | aiops: release agents - Consolidate release and changelog agent guidance | In Review | Zared | none | +| GIT-2624 | #3470 | docs: changelog-agent - Document specification decisions | Todo | Ash Shaw | GIT-1293 | +| GIT-2617 | #3873 | aiops: developer-onboarding - Define agent configuration | Todo | Warwick | GIT-2614 | + +**Consequences for this plan**: + +- The release MVP (GIT-1310), the changelog MVP (GIT-1744) and the consolidation (GIT-2623) are not children of GIT-1293. Linking them is a planning decision for the owner; this plan does not reparent anything. +- Titles in Linear differ from the titles the source brief proposed (for example GIT-1310 is "Build portable agent", GIT-1744 is "Create portable shared skill"). Title and scope changes belong in `issue-map.md` as previews requiring approval. +- GIT-1744's owner is Chris and GIT-2623's is Zared; ownership is preserved. +- GIT-1303 is in Backlog (the brief assumed a reopened or Done state); its labels contain legacy `migrate:` values and a `type:bug` label that do not match its aiops title. Cleanup is a proposal, not an action. +- GIT-1297 (authorisation gating failure) is related to the epic and is out of spec 020 scope. + +Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GIT-1305 and GIT-1315 to GIT-1317 documentation, GIT-1307 and GIT-1309 workflows) are roadmap or later slices, per the spec's scope boundaries. No Linear record has been changed. + +## Technical Context + +**Language/Version**: Node.js with CommonJS (`.cjs`) for the release and changelog agent modules, matching existing agents; no incidental migration to ESM or TypeScript. `wordpress.agent.js` is currently ESM and needs an explicit interop boundary (research R-04). + +**Primary Dependencies**: none new. Existing: the shipped changelog validation engine at `.github/validation/changelog/` (ESM package, `bin/validate.js`), Node built-ins, `git`. No Python, no new test framework. + +**Storage**: files only (version fields, `CHANGELOG.md`); no database. Handoff evidence is a structured JSON document passed between agents. + +**Testing**: Jest 30.x via `.jest.config.cjs` for JavaScript (`scripts/__tests__/` or `scripts/adapters/__tests__/` per agent); Bash/Bats under agent-root `tests/` with fixtures. Existing Node-test, PHP and Playwright tests stay where they are. Discovery and package commands must be verified before any test moves. + +**Target Platform**: local CLI and Claude (local and cloud) discovery; macOS paths use `~/` or `/Users/`. Other providers are unverified and out of MVP claims (FR-020). + +**Project Type**: portable agent packages (Markdown definition plus Node scripts and skills), not an application. + +**Performance Goals**: none specified; correctness and zero-write dry runs outrank speed. No numeric targets are invented. + +**Constraints**: explicit `repoRoot` on every filesystem and git call; dry run by default; fail closed; no broad staging, auto-stash, remote effects, tag creation or publication during preparation; no locked governance edits. + +**Scale/Scope**: two user-facing agents, one absorbed utilities module, one handoff contract, fixtures for the cases listed in FR-022. + +## Constitution Check + +*GATE: passed before research; re-checked after design (below).* + +| Principle | Assessment | +|-----------|------------| +| I Governance authority | Pass. Spec lives in `.github/specs/`; no override of org rules. | +| II Locked governance | Pass. No label, issue-type, template or routing edits; the `pr_docs.md` / `pr_aiops.md` label conflict is surfaced, not changed. | +| III Asset boundaries | Pass. Portable agents stay in top-level `agents/`; only the specification is under `.github/`. | +| IV Technology-agnostic guidance | Pass with note. WordPress-specific behaviour lives in the release adapter and agent docs, not in central guidance. | +| V and VIII Branch naming | Pass. `docs/portable-changelog-release-agents`; later slices use `aiops/` per the delivery profiles. | +| VI UK English, accessibility, security | Pass. Path-safety and no-secrets requirements are explicit (FR-006, FR-019). | +| VII Specification quality | Pass for the spec checklist; three open decisions remain and are carried into research as provisional, not closed. | +| IX Changelog compliance | Pass. Entries must stay within the length rule and link to PRs/issues; the agent validates using the shipped engine. | +| X Metrics-driven governance | Pass. No new dashboards; reuses existing validation output. | + +**Gate risk (not a violation)**: the Specification Validation check on the spec PR currently fails on the 019 numbering gap (reserved Qodo spec). Resolution is owner-decided; see the PR comment and [research.md](./research.md) R-11. + +**Post-design re-check**: no new violations. The Complexity Tracking table is not needed. + +## Project Structure + +### Documentation (this feature) + +```text +.github/specs/020-portable-changelog-release-agents/ +├── spec.md # Feature specification +├── plan.md # This file +├── research.md # Phase 0: decisions, code audit, open items +├── data-model.md # Phase 1: entities and states +├── quickstart.md # Phase 1: validation scenarios +├── contracts/ +│ ├── readiness-report.md +│ ├── verification-handoff.md +│ └── agent-package-layout.md +├── checklists/ +│ └── requirements.md +├── issue-map.md # Pending: needs live GitHub and Linear reads and approval +├── delivery-plan.md # Pending: depends on issue-map.md +└── tasks.md # Phase 2: created by /speckit-tasks, not by this command +``` + +### Source Code (repository root) + +Target layout for the implementation slices (not created by this PR). Paths follow the approved package shape in FR-017; the exact reconciliation with the in-flight consolidation (#3880 / PR #3881) is a prerequisite recorded in research R-02. + +```text +agents/release-agent/ +├── AGENT.md # one canonical definition +├── README.md +├── CHANGELOG.md # agent changelog +├── package.json # and lockfile only where convention requires +├── scripts/ +│ ├── release.agent.cjs # orchestration: readiness, approved preparation +│ ├── adapters/ # absorbed WordPress plugin/theme/readme adapters +│ │ └── __tests__/ +│ └── __tests__/ +├── skills//SKILL.md # namespaced skills +├── claude/ # small Claude adapter +└── tests/ # Bats plus fixtures + +agents/changelog-agent/ +├── AGENT.md +├── README.md +├── CHANGELOG.md +├── package.json +├── scripts/ +│ └── __tests__/ +├── skills//SKILL.md # five-operation shared-skill obligations preserved +├── claude/ +└── tests/ + +.github/validation/changelog/ # shipped engine: reused, not copied or forked +``` + +**Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent, no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. Whether the adapter lands as one module or two reviewed slices is open decision 3 (research R-06). + +## Phase 0 and Phase 1 Outputs + +- Phase 0: [research.md](./research.md) +- Phase 1: [data-model.md](./data-model.md), [contracts/](./contracts/), [quickstart.md](./quickstart.md) + +## Complexity Tracking + +No constitution violations to justify. diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md new file mode 100644 index 0000000000..fea1ed7270 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -0,0 +1,48 @@ +# Quickstart: Validating Spec 020 + +**Spec**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) + +This guide describes how a reviewer proves the specification and, later, the implementation slices. It contains no implementation code. Fixture names are placeholders for the implementation slices to create. + +## Prerequisites + +- A clean working tree on a branch based on refreshed `develop`. +- Node.js and the repository's installed dependencies (`npm ci`). +- Fixture repositories for: plugin, theme, enhancement, ordinary `.github` target, optional `VERSION`, ambiguous headers, drift, repeated runs, invalid paths. + +## Specification checks (this PR) + +1. Lint the changed Markdown: `npm run lint:md`. +2. Confirm the catalog row exists and links resolve: run the catalog validation Bats suite under `tests/bash`. +3. Confirm numbering: `bash .specify/scripts/bash/audit-specs.sh`. Expected today: a gap at 019 until the reserved Qodo spec merges or the owner approves another resolution. +4. Confirm no change to locked governance files, source code, manifests, root version or root changelog (SC-010): `git diff --name-only origin/develop` lists only files under `.github/specs/`. + +## Release readiness scenarios (R1 slice) + +| Scenario | Expected | +|----------|----------| +| Consistent plugin, working directory elsewhere | `ready`; operations applied to the requested root; zero writes. | +| Theme with no `VERSION` file | Detected and `ready` using authoritative fields. | +| Ordinary repo with `.github`, `package.json`, `VERSION` | Not classified as governance. | +| Drift or ambiguity | `not-ready` with `version-drift` or `version-ambiguous`, sources named. | +| Dirty tree, unsafe path, tag conflict | `not-ready` with the matching blocker; nothing staged or stashed. | +| Interrupted approved edit | Repository recoverable; not reported ready. | + +## Changelog scenarios (C2 slice) + +| Scenario | Expected | +|----------|----------| +| Valid Unreleased entries | Draft proposed; no file change. | +| Invalid category | Reported with the six allowed categories. | +| Approved apply | Historic entries and links byte-identical. | +| Second run, no new entries | No change. | +| No `changelog.yml` or `release.yml` present | All MVP behaviour works. | + +## Handoff scenarios + +| Scenario | Expected | +|----------|----------| +| `verified` with evidence | Readiness may complete. | +| `failed`, missing, malformed or unavailable responder | `not-ready` with `changelog-unverified`. | + +Contracts: [readiness-report](./contracts/readiness-report.md), [verification-handoff](./contracts/verification-handoff.md), [agent-package-layout](./contracts/agent-package-layout.md). Entities: [data-model.md](./data-model.md). diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md new file mode 100644 index 0000000000..408461444c --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -0,0 +1,93 @@ +# Research: Portable Changelog and WordPress Release Preparation Agents + +**Feature**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) | **Date**: 2026-10-09 + +Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f458a34e5`, GitHub issue [#1546](https://github.com/lightspeedwp/.github/issues/1546) and its sub-issue list. Linear was read later in the session (see R-10). Findings are inspected facts at that revision, not permanent guarantees. + +## Code audit against the spec + +| ID | Finding (develop) | Spec impact | +|----|-------------------|-------------| +| A-1 | `agents/release-agent/includes/repoDetector.cjs` tries `detectControlPlane` first. It returns `control-plane` for any repository that has `.github/`, `VERSION` and `package.json`. | Violates FR-003: an ordinary WordPress repository with those files is misclassified. Detection order and criteria must change. | +| A-2 | `gitOps.cjs` functions default `workDir = process.cwd()`. `release.agent.js` calls `gitOps.stageFiles(versionFiles)` without passing the root (around line 128). | Violates FR-002: the explicit `repoRoot` does not reach every git operation. | +| A-3 | `release.agent.js` validation records an unclean working tree as a warning (around line 230), not a stop. | Violates FR-005: dirty tree must stop. | +| A-4 | `gitOps.cjs` exposes `push`, `createTag`, `deleteTag` and `deleteRemoteTag`; the agent also drives release flow steps. | FR-006 and FR-008: preparation mode must not reach tag, push or remote paths. These need to be unreachable from the preparation entry point, not merely unused. | +| A-5 | `wordpress.agent.js` is ESM (`export function detectWordPressComponent`, `validateVersionConsistency`, `updateAllVersions`, plus `bumpAllVersions`, `getComponentMetadata`); the release agent and the plugin/theme/readme includes are CommonJS. | FR-018: absorbing the utilities needs an explicit interop boundary without a wholesale module-system migration. | +| A-6 | `wordpress-release-utilities-agent/__tests__/integration.test.js.skip` is skipped; unit tests live under `includes/tests/`. | FR-016 and FR-022: failure and partial-write behaviour is untested today; it must be tested, not assumed atomic. | +| A-7 | The shipped changelog engine is an ESM package at `.github/validation/changelog/` with its own `node:test` runner and `bin/validate.js` CLI. The changelog agent has its own CommonJS validator modules in `agents/changelog-agent/includes/`. | FR-010: there are two validation code paths today. The agent must route to the shipped engine and retire or wrap the duplicate, not add a third. | +| A-8 | Callers of the WordPress utilities outside its own package, from a repository search: `.github/dependabot.yml`, audit/baseline JSON, `tests/jest.working-tree-guard.cjs`. | Removal is blocked until each reference is inventoried and migrated (FR-016). | +| A-9 | Root `package.json` has `typecheck`, `test:js` (Jest 30.5.2 via `.jest.config.cjs`) and `test:changelog-validation`. | Confirms Jest-beside-scripts is the in-repo convention and that a typecheck script exists. | + +## Decisions + +### R-01 Readiness is a distinct read-only operation + +- **Decision**: the release agent has a readiness operation that cannot write or invoke git mutations, separate from the approved preparation operation. +- **Rationale**: FR-001 and SC-001 require zero writes in dry run; structural separation is stronger than a flag. +- **Alternatives**: a single function with a dry-run flag (rejected: a missed branch could write). + +### R-02 Reuse the in-flight canonical-source migration + +- **Decision**: do not duplicate the migration in issue #3880 / PR #3881 (open, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at brief time). The release MVP branches from refreshed develop after it merges. A stacked branch is used only if the release MVP imports layout available solely in #3881. +- **Rationale**: avoids two competing definitions of the canonical agent layout. +- **Prerequisite not yet done**: read the actual #3881 diff and checks. This plan makes no claim about its test results. + +### R-03 Distinct roles of AGENTS.md and AGENT.md + +- **Decision**: keep `AGENTS.md` as working instructions and `AGENT.md` as the agent definition. Do not merge them blindly. +- **Rationale**: `.github/docs/AGENT_FOLDER_STRUCTURE.md` distinguishes them, while #3881 consolidates the definition into `AGENT.md`; both must hold. FR-018. + +### R-04 WordPress utilities interop + +- **Decision**: provide a thin CommonJS-facing adapter that calls the existing logic, keeping function behaviour and exports (`detectWordPressComponent`, `validateVersionConsistency`, `updateAllVersions`) intact; no ESM-to-CJS rewrite of the logic. +- **Rationale**: preserves tested logic and avoids incidental migration (FR-018). **Alternatives**: convert the utilities to CommonJS (rejected as unrequested migration); keep a separate agent (rejected: FR-016 forbids a second release agent). + +### R-05 Changelog validation reuse and portability tension + +- **Decision**: the changelog agent invokes the shipped engine for validation and does not add another engine. +- **Unresolved tension**: the engine lives under `.github/`, but FR-019 requires copied adapters to work without a governance checkout. Candidate resolutions: resolve the engine from the target repository if present, else from a pinned bundled copy with recorded source and version. This is a design choice with portability and drift consequences and needs owner confirmation; it is carried into `/speckit-tasks` as a decision task, not assumed. + +### R-06 Plugin and theme adapter: one module or two slices (open decision 3) + +- **Provisional recommendation**: one coherent adapter module with both acceptance mappings (#1565 plugin, #1566 theme), splitting only if independently reviewable. +- **Status**: provisional; owner confirmation required. + +### R-07 Authoritative version source when instructions are silent (open decision 1) + +- **Provisional recommendation**: when a target's own instructions do not name an authoritative field, the agent refuses to choose, reports every detected value and source, and stops as ambiguous (FR-004). No default hierarchy is invented. +- **Rationale**: the first draft of the spec invented a hierarchy; the brief says to derive sources from target instructions. +- **Status**: provisional; owner confirmation required. + +### R-08 Who stamps the changelog (open decision 2) + +- **Provisional recommendation**: only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff. +- **Rationale**: keeps the changelog agent standalone and avoids two writers. **Status**: provisional. + +### R-09 Handoff mechanism needs no new infrastructure + +- **Decision**: the handoff is a structured, versioned document passed between the two agents (see [contracts/verification-handoff.md](./contracts/verification-handoff.md)); it requires no labels, event service or workflow (FR-015, FR-012). +- **Alternatives**: workflow-event based (rejected for MVP; deferred workflows are unbuilt). + +### R-10 Linear is the planning system of record + +- **Finding**: Linear was unavailable early in the session and was read later the same day. GIT-1293 has 18 children; the three core spec 020 slices (GIT-1310, GIT-1744, GIT-2623) have no parent, and GIT-2617 is under GIT-2614. The full table is in [plan.md](./plan.md). +- **Earlier GitHub-only observation, now explained**: GitHub #1546 lists 16 sub-issues; #1563, #2653, #3880 and #3470 are not among them, matching the Linear hierarchy (GIT-2624 / #3470 is a child of GIT-1293 in Linear but was not in the GitHub list; the mirrors differ). +- **Decision**: Linear is authoritative for status, ownership and sequencing. Tasks reference both identifiers. Reparenting, retitling, relabelling and status changes are proposals in `issue-map.md` with exact previews and need separate approval. No Linear record is changed by spec 020 work. +- **Label caution**: several children carry legacy `migrate:` labels and mismatched types (for example GIT-1303 as `type:bug`); the plan does not rely on Linear labels to infer scope. + +### R-11 Spec numbering gap blocks the spec PR check + +- **Finding**: `.specify/scripts/bash/audit-specs.sh` fails on gaps; 019 is reserved on an unmerged branch. +- **Decision**: owner-decided. Either merge the 019 spec first, or approve a separate change allowing reserved numbers. Neither is performed by this plan. + +### R-12 Preparation path forbids remote and tag effects + +- **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. + +## Open items carried forward + +1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). +2. Read PR #3881 diff and checks (R-02). +3. Owner confirmation of R-05, R-06, R-07, R-08. +4. 019 numbering gap resolution (R-11). +5. `issue-map.md` and `delivery-plan.md` from live GitHub and Linear records. From 48d4167cd3bb83303a6369f98150f6a8c0f69c4f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:07:00 +0000 Subject: [PATCH 03/24] docs: release-agents - Add spec 020 issue map and delivery plan Map existing GitHub and Linear records to bounded roles with exact, unapplied change previews, and add per-slice branch, PR, stack and merge order profiles. No records were changed. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../checklists/requirements.md | 2 +- .../delivery-plan.md | 111 ++++++++++++++++++ .../issue-map.md | 93 +++++++++++++++ .../plan.md | 4 +- .../research.md | 2 +- 5 files changed, 208 insertions(+), 4 deletions(-) create mode 100644 .github/specs/020-portable-changelog-release-agents/delivery-plan.md create mode 100644 .github/specs/020-portable-changelog-release-agents/issue-map.md diff --git a/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md b/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md index 612ca9cd7b..8de2cff145 100644 --- a/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md +++ b/.github/specs/020-portable-changelog-release-agents/checklists/requirements.md @@ -31,5 +31,5 @@ ## Notes -- `issue-map.md` and `delivery-plan.md` are not yet written: they require reading live GitHub issue and PR records and a separate approval boundary. +- `issue-map.md` and `delivery-plan.md` are written from live records; every record change in them is a preview that needs separate approval. - Run `/speckit-clarify` for the three open decisions before `/speckit-plan`. diff --git a/.github/specs/020-portable-changelog-release-agents/delivery-plan.md b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md new file mode 100644 index 0000000000..fe9593e56c --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md @@ -0,0 +1,111 @@ +# Delivery Plan: Spec 020 Branch and PR Strategy + +**Spec**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) | **Issue map**: [issue-map.md](./issue-map.md) + +**Read on**: 2026-10-09. Proposed branches are plans, not branches that already exist, unless marked EXISTING. All new PR numbers are TBD until a PR is created: none is invented here. The only real PR numbers used are [#3881](https://github.com/lightspeedwp/.github/pull/3881) (existing consolidation) and [#3883](https://github.com/lightspeedwp/.github/pull/3883) (this specification). No branch, PR, label, assignee or issue was created or changed by writing this plan. + +Preserved from the source brief: delivery priority is release preparation first (priority 1), changelog second (priority 2), followed by an explicit blocking verification handoff. Priority is not a code dependency. + +## Rules applied to every profile + +- Base and target is `develop` (a `release/*` or `hotfix/*` PR may target `main`; none is proposed here). +- Start each branch from refreshed `develop` after its prerequisites merge, unless the conditional stack below is justified and approved. +- Use the live template body and checklists for the branch type; omit its frontmatter. Reference real issue URLs in the PR body, not the title. +- Use `Closes` only for fully delivered accepted scope. Use `Ref` or `Relates to` for design contributions, partial adapters and deferred work. Never auto-close [#1546](https://github.com/lightspeedwp/.github/issues/1546). +- Exactly one changelog disposition per PR (`meta:needs-changelog` or `meta:no-changelog`), never both. +- Runtime-shipping PRs need exactly one appropriate `release:*` label after reviewed impact. Patch, minor or major is not decided beforehand. +- Verify labels again before applying: they come from `.github/labels.yml`, which is locked. + +### Label sets (GitHub only) + +| Set | Labels | Use | +|-----|--------|-----| +| D | `type:docs`, `area:documentation`, `status:needs-review`, and `meta:no-changelog` only when a documentation exemption is valid | Documentation and specification PRs | +| A | `type:aiops`, `area:agents`, `status:needs-review`, `meta:needs-changelog` for runtime or user-visible change | AI operations and agent PRs | +| X | `type:refactor`, `status:needs-review`, `meta:needs-changelog`, plus a relevant existing `area:` label only with scope evidence | Refactor PRs | + +### Template and routing conflict (maintainer resolution, no edit in spec 020) + +`.github/branch-types.yml` routes `docs` to `pr_docs`, `aiops` and `automation` to `pr_aiops`, and `refactor` to `pr_refactor`; there is no `pr_automation.md`. The live templates still carry legacy labels: `pr_docs.md` lists `type:documentation` and `pr_aiops.md` lists `type:ai-ops` and `meta:needs-review`, which conflict with the canonical `type:docs`, `type:aiops` and `status:needs-review`. The constitution records this as pending a `[TEMPLATE-UPDATE-REQUEST]`. Do not apply both a legacy and a canonical type, and do not copy template labels blindly. The file labeler owns area routing; preserve existing useful labels and inspect automation output. On [#3883](https://github.com/lightspeedwp/.github/pull/3883) the router applied only `type:docs`. + +## Per-slice profiles + +| Profile | Issue(s) | Branch | Base | Proposed PR title | Template | Labels | Assignee | Closure rule | Prerequisites | +|---------|----------|--------|------|-------------------|----------|--------|----------|--------------|---------------| +| S | [#1555](https://github.com/lightspeedwp/.github/issues/1555) with #1553, #1554, #1556, #1557 | `docs/portable-changelog-release-agents` (EXISTING, PR #3883, draft) | `develop` | `docs: release-agents - Specify portable changelog and release agents` | `pr_docs.md` | D | ashleyshaw (proposed; not yet set) | `Relates to` all; `Closes #1555` only if the owner confirms specification delivery. #1546 never closed. | 019 numbering gap resolved (see below) | +| F | [#3880](https://github.com/lightspeedwp/.github/issues/3880) | `aiops/git-2623-consolidate-release-changelog-agents` (EXISTING, PR #3881) | `develop` | Keep the existing title until normalisation is approved to `aiops: release-agents - Consolidate canonical agent guidance` | `pr_aiops.md` | Preserve current labels; propose canonical reconciliation separately | Preserve ZaredRogers | Existing `Closes #3880` | Read the actual diff and checks; reviews and the reason for `blocked` are unread | +| R1 | [#1563](https://github.com/lightspeedwp/.github/issues/1563), acceptance traced from [#1565](https://github.com/lightspeedwp/.github/issues/1565) and [#1566](https://github.com/lightspeedwp/.github/issues/1566) | `aiops/release-agent-portable-mvp` | `develop` (or the F head if the conditional stack applies) | `aiops: release-agent - Deliver portable preparation MVP` | `pr_aiops.md` | A | ashleyshaw | `Closes #1563` only when its accepted scope is delivered; `Ref` #1565 and #1566 unless fully covered | Spec approved; F normally merged; final ready state blocked on C2 handoff evidence | +| C2 | [#2653](https://github.com/lightspeedwp/.github/issues/2653) | `aiops/changelog-agent-portable-mvp` | `develop` | `aiops: changelog-agent - Deliver portable changelog MVP` | `pr_aiops.md` | A | ashleyshaw for the requested authored PR; preserve Chris's Linear ownership | `Closes #2653` when its accepted scope is delivered | F and spec dependencies | +| DEC | [#3470](https://github.com/lightspeedwp/.github/issues/3470) | `docs/changelog-agent-spec-findings` | `develop` | `docs: changelog-agent - Document specification decisions` | `pr_docs.md` | D | ashleyshaw | `Closes #3470` only if all owner decisions are recorded; otherwise `Ref` | Owner decisions resolved; no runtime remediation approval inferred | +| DOC | [#1558](https://github.com/lightspeedwp/.github/issues/1558) with #1568, #1569, #1570 | `docs/portable-agents-reference-guidance` | `develop` | `docs: portable-agents - Restructure and complete guidance` | `pr_docs.md` | D, or an alternative changelog disposition justified by impact | ashleyshaw | `Closes` each issue only where its guide is delivered | Affected structure and code merged first; no competing docs PRs | +| SETUP | [#3873](https://github.com/lightspeedwp/.github/issues/3873) | `docs/portable-agents-local-setup` | `develop` | `docs: portable-agents - Document verified local setup` | `pr_docs.md` | D | ashleyshaw as the PR author of this governance PR; preserve Warwick's issue ownership | `Ref` unless fully delivered | Setup contract verified; documentation only, no installer implementation | +| DIST | [#3468](https://github.com/lightspeedwp/.github/issues/3468) | `aiops/agent-distribution-portable-marketplace` | `develop` | `aiops: agent-distribution - Validate the portable marketplace` | `pr_aiops.md` | A | Future ownership to be confirmed | `Ref` | Setup and source contract first; LS-4233 versus GIT-2306 overlap resolved | +| WFLOW | [#1560](https://github.com/lightspeedwp/.github/issues/1560) | `automation/release-workflow-portable-validation` | `develop` | `automation: release-workflow - Validate portable release gates` | `pr_aiops.md` | Confirm the primary automation classification and routing before metadata; no incompatible two-type set | To be confirmed | `Ref` | Later scope, not spec 020 implementation; archived workflow reviewed and tested first | +| ROLLBACK | [#1562](https://github.com/lightspeedwp/.github/issues/1562) | `automation/release-workflow-safe-rollback` | `develop` | `automation: release-workflow - Add approved rollback safeguards` | `pr_aiops.md` | Confirm automation type, routing and actual release impact | To be confirmed | `Ref` | Later; workflow contract first | + +**Optional adapter slices** (only if the plugin and theme adapters are independently reviewable; prefer one coherent R1 adapter with both acceptance mappings): `aiops/release-agent-plugin-version-adapter` titled `aiops: release-agent - Validate plugin version fields` for #1565, and `aiops/release-agent-theme-version-adapter` titled `aiops: release-agent - Validate theme version fields` for #1566, both `pr_aiops.md` with label set A and impact checks. Split to make a unit reviewable, not to create more PRs. + +### Roadmap-only agent slices (not spec 020 tasks) + +Each is a later, independently reviewable PR against `develop`. Confirm a real GitHub issue exists before any closure keyword; do not infer cross-repository number identity. + +| Agent and records | Proposed branch | Proposed PR title | Template and labels | +|-------------------|-----------------|-------------------|---------------------| +| PRD (#1248 / GIT-1123, unread) | `docs/prd-agent-portable-handoff` | `docs: prd-agent - Record verified portable handoff` | `pr_docs.md`, D; preserve parent and completed evidence | +| Linting (#1818 / GIT-1456, unread) | `aiops/linting-agent-repo-configuration` | `aiops: linting-agent - Configure repository-aware checks` | `pr_aiops.md`, A | +| PR agent ([GIT-701](https://linear.app/lightspeedwp/issue/GIT-701/aiops-pr-agent-complete-portable-consolidation); GitHub number unresolved) | `aiops/pr-agent-portable-consolidation` | `aiops: pr-agent - Complete portable consolidation` | `pr_aiops.md`, A; reuse merged PR 3400, 3401, 3403 evidence | +| Reviewer (#1802 / GIT-1446, unread) | `aiops/reviewer-agent-portable-contract` | `aiops: reviewer-agent - Define portable review boundaries` | `pr_aiops.md`, A | +| Testing (#1344 / GIT-1190, unread) | `aiops/testing-agent-portable-package` | `aiops: testing-agent - Consolidate the portable package` | `pr_aiops.md`, A; reconcile legacy Playwright path | +| PageSpeed (#1343 / GIT-1189, unread) | `aiops/pagespeed-agent-portable-package` | `aiops: pagespeed-agent - Consolidate the portable package` | `pr_aiops.md`, A | +| Design partner (#1341 / GIT-1187, unread) | `aiops/design-partner-agent-portable-package` | `aiops: design-partner-agent - Consolidate after Figma audit` | `pr_aiops.md`, A; preserve audit dependency | +| Issue agent ([GIT-106](https://linear.app/lightspeedwp/issue/GIT-106/refactor-issue-agent-verify-portable-source-migration); GitHub #2826 unread) | `refactor/issue-agent-portable-source` | `refactor: issue-agent - Verify portable source migration` | `pr_refactor.md`, X | +| Reporting (#1901 / GIT-1506, unread) | `aiops/reporting-agent-portable-contract` | `aiops: reporting-agent - Validate portable reporting` | `pr_aiops.md`, A | + +## Existing PR reuse + +| PR | State at read | Use | +|----|---------------|-----| +| [#3881](https://github.com/lightspeedwp/.github/pull/3881) | Open, not draft, mergeable state `blocked`, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, 27 files, `Closes #3880` | Reused as profile F. No test results from it are claimed here. | +| [#3820](https://github.com/lightspeedwp/.github/pull/3820) | Merged | Changelog spec, skill and index alignment is reused, not redone. | +| [#2655](https://github.com/lightspeedwp/.github/pull/2655) | Closed unmerged | Not delivery proof. | +| [#3532](https://github.com/lightspeedwp/.github/pull/3532) | Reserves Qodo 019 | Unrelated to 020 and not a required stack base. | +| [#3883](https://github.com/lightspeedwp/.github/pull/3883) | Draft | Profile S. | + +## Stack plan (conditional, not automatic) + +**Default**: S is independent. Finish the existing F. Branch R1 and C2 from refreshed `develop`. R1 and C2 may be sibling PRs if their files and contracts permit. R1's readiness inventory may land first but must fail closed until changelog evidence exists. + +**Optional stack, only if R1 imports canonical layout or tooling available solely in the unmerged #3881**: + +1. Lower: existing #3881, `aiops/git-2623-consolidate-release-changelog-agents` into `develop`. +2. Upper: R1 `aiops/release-agent-portable-mvp` based on that exact head, with the lower branch as PR base. +3. Record lower and upper links, ownership, inherited diff and the blocked merge. Merge the lower first; then retarget or rebase the upper onto updated `develop`, rerun tests and review, and inspect the remaining diff before merge. + +Do not duplicate F's migration, do not stack spec 020 on the Qodo PR #3532, and do not put all agent PRs in one chain. + +**If final handoff integration fits neither independent slice**: propose one small follow-on integration PR under #1563 after R1 merges, dependent on C2. Exact preview, not yet requested: branch `aiops/release-agent-changelog-handoff`, base `develop`, template `pr_aiops.md`, label set A, scope limited to the remaining handoff acceptance criteria. Do not create a new issue or PR automatically. + +Documentation (DOC, SETUP) uses merged contracts and never stacks on unfinished implementation merely for speed. + +## Merge order + +1. S (#3883), once the 019 numbering gap is resolved. It is independent of the rest. +2. F (#3881), after its diff, checks and reviews are read and its blocker is understood. +3. R1 and C2 as siblings from refreshed `develop`; R1 is not reported ready until C2 evidence exists. +4. Optional follow-on handoff integration PR, if needed, after R1 merges and depending on C2. +5. DEC, then DOC, then SETUP, using merged contracts. +6. DIST, then WFLOW, then ROLLBACK as later phases. + +## Blockers and open items + +| Item | Detail | +|------|--------| +| 019 numbering gap | The spec audit requires contiguous numbers and 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch, so S fails Specification Validation until the 019 spec merges or the owner approves another resolution. | +| "AI Feedback Validation" check | Requests a `Closes` or `Resolves` link and a `FEEDBACK_RESPONSE.md`. S currently uses `Relates to`. The owner decides whether `Closes #1555` is acceptable. | +| PR #3881 blocker | Reviews and the cause of `blocked` were not read. | +| Linear parenting | GIT-1310, GIT-1744 and GIT-2623 have no parent; reparenting is an approval item (A9 in the issue map). | +| Pilots | Warwick (krugazul) on to-faq and Zared (ZaredRogers) on sd-theme-2026 and sd-enhancements-2026 are proposed, not verified. Enhancement repository access previously returned 403 and is a permission boundary: affected checks stay blocked. No pilot or FAQ architecture is decided, and no code transfer is planned in spec 020. Each target repository's own rules must be read first; `pr_aiops.md` must not be imported into them silently. | + +## Deferred phases + +Provider installation and marketplace distribution (DIST), release workflow validation (WFLOW), rollback automation (ROLLBACK), the roadmap agent slices above, pilot rollouts and the later documentation restructure (DOC) are not executable spec 020 MVP tasks. Live environment, version, deployment and rollback decisions remain unresolved and are not inferred. diff --git a/.github/specs/020-portable-changelog-release-agents/issue-map.md b/.github/specs/020-portable-changelog-release-agents/issue-map.md new file mode 100644 index 0000000000..41041036b2 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/issue-map.md @@ -0,0 +1,93 @@ +# Issue Map: Spec 020 Existing Work + +**Spec**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) | **Delivery plan**: [delivery-plan.md](./delivery-plan.md) + +**Read on**: 2026-10-09 from GitHub (`lightspeedwp/.github`) and Linear. Records were read by this session and by a read-only research agent. Nothing in this file has been applied: no GitHub or Linear record, title, body, label, native issue type, parent or assignee was changed. Every proposal needs the separate approval described in [Approval preview](#approval-preview). + +Linear is the planning system of record. Where GitHub and Linear disagree, both are shown and the disagreement is listed in [Gaps and mismatches](#gaps-and-mismatches). + +**Conventions**: GitHub issue links are full URLs. Native GitHub issue types (the issue Type field) are separate from `type:*` labels and are shown separately. Linear classifications are not copied onto GitHub. Task IDs are pending `/speckit-tasks`, so the mapping column uses user stories (US1 to US5), functional requirements (FR) and target paths instead. + +## Parent and programme + +| Record | Current state | Proposed role | Preserve | Proposed change | +|--------|---------------|---------------|----------|-----------------| +| [GitHub #1546](https://github.com/lightspeedwp/.github/issues/1546) / [GIT-1293](https://linear.app/lightspeedwp/issue/GIT-1293/epic-portable-agents-deliver-the-essential-first-wave) | GitHub open, native type Task, labels `type:task`, `area:agents`, `area:release`, `priority:critical`, `status:needs-triage`; milestone v1.1; 16 sub-issues, 3 complete. Linear: Tracking, Ash Shaw, 18 children, 3 Done. | First-wave programme: release (priority 1), changelog (priority 2), deferred rollout. | Current manual edits; its own note that earlier phase status and "no blockers" claims are historical. | Reconcile body so it carries no stale completion or deadline claims. Do not auto-close. No umbrella implementation PR. | + +## Spec 020 primary issues + +| GitHub | Linear | Native type | Current labels (prefixed) | State | Proposed bounded role | Proposed delta | Delivery slice | Story / FR / path | +|--------|--------|-------------|---------------------------|-------|-----------------------|----------------|----------------|-------------------| +| [#1555](https://github.com/lightspeedwp/.github/issues/1555) | [GIT-1302](https://linear.app/lightspeedwp/issue/GIT-1302/aiops-release-agent-specify-portable-multi-repo-support) In Progress, Ash Shaw, parent GIT-1293 | AI Ops | `type:aiops`, `area:release`, `priority:normal`, `status:needs-triage` | Open (reopened 2026-09-23 as planned, not started) | Primary spec 020 tracker | Title: `docs: release-agents - Specify portable changelog and release agents`. Native type to Documentation and `type:docs` only after independent checks. | S | All stories; `.github/specs/020-portable-changelog-release-agents/` | +| [#1553](https://github.com/lightspeedwp/.github/issues/1553) | [GIT-1300](https://linear.app/lightspeedwp/issue/GIT-1300/docs-release-process-generate-requirements-from-github-spec-kit) Backlog, Ash Shaw, parent GIT-1293 | Task | `type:task`, `area:release`, `priority:normal`, `status:needs-planning` | Open | Requirements and traceability contribution | Keep accepted requirements; drop unverified fixed requirement counts. Reference-only to S. | S | FR-001 to FR-027; `spec.md`, `checklists/requirements.md` | +| [#1554](https://github.com/lightspeedwp/.github/issues/1554) | [GIT-1301](https://linear.app/lightspeedwp/issue/GIT-1301/design-release-process-create-architecture-diagrams-and-workflow-yaml) Todo, Ash Shaw, parent GIT-1293 | Task | same as #1553 | Open | Architecture and interfaces | Scope to diagrams and design contracts, not active executable workflow YAML. | S | `contracts/`, `data-model.md` | +| [#1556](https://github.com/lightspeedwp/.github/issues/1556) | [GIT-1303](https://linear.app/lightspeedwp/issue/GIT-1303/aiops-changelog-agent-define-the-changelog-agent-specification) Backlog, Ash Shaw, parent GIT-1293 | Bug | `type:bug`, `area:release`, `priority:normal`, `status:needs-planning` | Open (reopened) | Changelog specification contribution | Re-read current state; keep Reference-only until accepted criteria are covered. Native type and `type:bug` do not match the title; correction proposed, not assumed. | S | US2, FR-009 to FR-013 | +| [#1557](https://github.com/lightspeedwp/.github/issues/1557) | [GIT-1304](https://linear.app/lightspeedwp/issue/GIT-1304/design-wordpress-versioning-specify-plugin-and-theme-support) Todo, Ash Shaw, parent GIT-1293 | Task | `type:task`, `area:release`, `priority:normal`, `status:needs-planning` | Open | WordPress plugin and theme version-field design | Optional `VERSION`; authoritative headers, readme, `style.css`, configuration. | S | US1, FR-003, FR-004 | + +## Implementation slices + +| GitHub | Linear | Native type | Current labels (prefixed) | State | Proposed bounded role | Proposed delta | Delivery slice | Story / FR / path | +|--------|--------|-------------|---------------------------|-------|-----------------------|----------------|----------------|-------------------| +| [#1563](https://github.com/lightspeedwp/.github/issues/1563) | [GIT-1310](https://linear.app/lightspeedwp/issue/GIT-1310/aiops-release-agent-build-portable-agent) "Build portable agent", In Progress, Ash Shaw, no parent | Documentation | `area:automation`, `area:release`, `priority:normal`, `status:ready`, `status:needs-triage`; no `type:` label | Open (reopened 2026-09-23); no GitHub parent | Release preparation MVP, priority 1 | Title: `aiops: release-agent - Deliver portable preparation MVP`; correct obsolete `agents/release/` to `agents/release-agent/` in the preview; add `type:aiops`; native type to AI Ops. | R1 | US1, US3, US4, FR-001 to FR-008, FR-014 to FR-022; `agents/release-agent/` | +| [#2653](https://github.com/lightspeedwp/.github/issues/2653) | [GIT-1744](https://linear.app/lightspeedwp/issue/GIT-1744/aiops-changelog-automation-create-portable-shared-skill) "Create portable shared skill", Todo, Chris, no parent | Task | `type:aiops`, `area:automation`, `priority:high`, `status:needs-triage` | Open; GitHub assignees eleshar and ashleyshaw | Standalone changelog MVP, priority 2 | Title: `aiops: changelog-agent - Deliver portable changelog MVP`; preserve the five-operation shared-skill obligations (FR-013). | C2 | US2, US3, FR-009 to FR-015; `agents/changelog-agent/` | +| [#1565](https://github.com/lightspeedwp/.github/issues/1565) | [GIT-1312](https://linear.app/lightspeedwp/issue/GIT-1312/automation-wordpress-plugins-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Plugin version adapter acceptance, traced to R1 | Trace to reused utilities, not a second implementation. Optional separate slice only if independently reviewable. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | +| [#1566](https://github.com/lightspeedwp/.github/issues/1566) | [GIT-1313](https://linear.app/lightspeedwp/issue/GIT-1313/automation-wordpress-themes-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Theme version adapter acceptance, traced to R1 | As #1565, with theme fixtures. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | +| [#3880](https://github.com/lightspeedwp/.github/issues/3880) | [GIT-2623](https://linear.app/lightspeedwp/issue/GIT-2623/aiops-release-agents-consolidate-release-and-changelog-agent-guidance) In Review, Zared, no parent | not set | `type:dependency`, `area:instructions`, `priority:normal`, `status:needs-triage` | Open; assignee ZaredRogers | Canonical source migration verification | Reuse the existing work and PR 3881; do not duplicate the migration. | F (existing) | FR-017, FR-018; prerequisite for R1 and C2 | + +## Decisions, documentation and later slices + +| GitHub | Linear | Native type | State | Proposed role | Proposed delta | Delivery slice | +|--------|--------|-------------|-------|---------------|----------------|----------------| +| [#3470](https://github.com/lightspeedwp/.github/issues/3470) | [GIT-2624](https://linear.app/lightspeedwp/issue/GIT-2624/docs-changelog-agent-document-specification-decisions) Todo, Ash Shaw, parent GIT-1293 | not set; GitHub parent is #3464 | Open, unassigned on GitHub | Spec 016 owner decisions | Title `docs: changelog-agent - Document specification decisions`; no runtime remediation approval inferred. Linear and GitHub titles and parents differ. | DEC | +| [#1558](https://github.com/lightspeedwp/.github/issues/1558) | [GIT-1305](https://linear.app/lightspeedwp/issue/GIT-1305/docs-release-process-plan-documentation-reorganisation) Todo | Task | Open | One later documentation restructure and missing-doc inventory | Title `docs: portable-agents - Restructure and complete guidance`; widen planning-only scope only by approved preview. | DOC | +| [#1568](https://github.com/lightspeedwp/.github/issues/1568), [#1569](https://github.com/lightspeedwp/.github/issues/1569), [#1570](https://github.com/lightspeedwp/.github/issues/1570) | [GIT-1315](https://linear.app/lightspeedwp/issue/GIT-1315/docs-branching-strategy-align-documentation), [GIT-1316](https://linear.app/lightspeedwp/issue/GIT-1316/docs-changelog-automation-update-documentation), [GIT-1317](https://linear.app/lightspeedwp/issue/GIT-1317/docs-wordpress-release-create-release-guide) Todo | Documentation | Open | Branching, changelog and WordPress guide obligations | Reconcile into DOC; existing docs are not greenfield; no competing docs PRs. | DOC | +| [#3873](https://github.com/lightspeedwp/.github/issues/3873) | [GIT-2617](https://linear.app/lightspeedwp/issue/GIT-2617/aiops-developer-onboarding-define-agent-configuration) Todo, Warwick, parent GIT-2614 | not set | Open; assignee krugazul; GitHub parent is a cross-repository issue | Local, global and project discovery and scaffold configuration contract | Preserve the manually expanded scope and its current parent; dependency only, no automatic reparent. | SETUP | +| [#3468](https://github.com/lightspeedwp/.github/issues/3468) | [GIT-2306](https://linear.app/lightspeedwp/issue/GIT-2306) Backlog, unassigned, parent GIT-2302; Linear LS-4233 (Todo, Ash Shaw, no parent) | AI Ops | Open, no milestone | Marketplace and install distribution | Use the existing delivery record. LS-4233 overlaps GIT-2306 and needs an explicit disposition; whether it is linked to #3468 is unconfirmed. | DIST (later) | +| [#1560](https://github.com/lightspeedwp/.github/issues/1560) | [GIT-1307](https://linear.app/lightspeedwp/issue/GIT-1307/automation-release-workflow-update-workflow-configuration) Todo | Security | Open | Portable release workflow validation (deferred) | Review the archived workflow and its tests first; automation classification to be confirmed. | WFLOW (later) | +| [#1562](https://github.com/lightspeedwp/.github/issues/1562) | [GIT-1309](https://linear.app/lightspeedwp/issue/GIT-1309/automation-release-workflow-create-rollback-automation) Todo | Security | Open | Rollback automation (deferred) | Bounded rollback outcome after the workflow contract. | ROLLBACK (later) | + +**Historical, no reopening by default**: [#1559](https://github.com/lightspeedwp/.github/issues/1559) (closed completed, PR 1637), [#1561](https://github.com/lightspeedwp/.github/issues/1561) (closed completed, PR 1658), [#1567](https://github.com/lightspeedwp/.github/issues/1567) (closed completed, PR 2272). [#1564](https://github.com/lightspeedwp/.github/issues/1564) is closed `not_planned` and superseded; it is not active changelog delivery. + +**Existing PRs**: PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) is open, not a draft, mergeable state `blocked`, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, base `develop`, 27 files (+111, -406), body `Closes #3880`. Merged PR [#3820](https://github.com/lightspeedwp/.github/pull/3820) delivered the changelog spec, skill and index alignment and is reused. PR [#2655](https://github.com/lightspeedwp/.github/pull/2655) is closed unmerged and is not delivery proof. The spec PR for this work is [#3883](https://github.com/lightspeedwp/.github/pull/3883). + +## Roadmap-only first-wave records + +These are links, not spec 020 tasks, and are not reparented. Linear children of GIT-1293 outside spec 020: [GIT-701](https://linear.app/lightspeedwp/issue/GIT-701/aiops-pr-agent-complete-portable-consolidation) (pr-agent, Todo, Brandon) and [GIT-106](https://linear.app/lightspeedwp/issue/GIT-106/refactor-issue-agent-verify-portable-source-migration) (issue-agent, Todo). The GitHub issue number for GIT-701 and the Linear and GitHub identities for the PRD, linting, reviewer, testing, PageSpeed, design-partner and reporting agents were not read in this session and remain **UNREAD**. Confirm real issues exist before any closure keyword is used. + +## Owner and decision gaps + +| Gap | Detail | +|-----|--------| +| Parenting | GIT-1310, GIT-1744 and GIT-2623 have no parent in Linear (GIT-2617 sits under GIT-2614). #1563, #2653 and #3880 also have no GitHub parent. Whether they belong under GIT-1293 is the owner's call. | +| Ownership | GIT-1744 is assigned to Chris and GIT-2623 to Zared; GitHub #2653 lists eleshar and ashleyshaw. Ownership is preserved and not reassigned. | +| Why PR 3881 is blocked | Not shown by the API; reviews were not read (**UNREAD**). | +| Identity of eleshar and Chris | Not established here; do not infer. | + +## Gaps and mismatches + +1. **#3470 / GIT-2624**: titles differ (`task: resolve spec 016 changelog-agent design findings` versus `docs: changelog-agent - Document specification decisions`), labels differ (`type:task` versus `type:docs`), and parents differ (#3464 versus GIT-1293). +2. **#3468 / LS-4233 / GIT-2306**: two Linear issues for one GitHub topic; titles differ (`aiops:` versus `task:`). +3. **#1555 / GIT-1302**: Linear says In Progress; GitHub comments say the planned work had not started. +4. **Native issue types**: several do not match their titles (#1560 to #1562 Security for automation; #1563 to #1566 Documentation for aiops and automation; #1556 Bug for a specification). #1563 and #1564 have no `type:` label. +5. **Legacy labels**: Linear GIT-1303 and others carry `migrate:` labels; GitHub issues carry bare-label warnings from automation. None of these is used to infer scope. +6. **Epic wording**: the epic is now titled `epic: portable-agents`, while several children still describe "Release Process Redesign". + +## Approval preview + +**Nothing below is applied.** Approval for the spec PR does not imply approval for any of these. Each line is an exact, independently approvable change; approving one does not approve the others. Native issue type, `type:*` label, parent and assignee are listed separately because they are separate fields. + +| ID | Target | Field | Current | Proposed | +|----|--------|-------|---------|----------| +| A1 | GitHub #1555 | Title | `aiops: release-agent - Specify portable multi-repo support` | `docs: release-agents - Specify portable changelog and release agents` | +| A2 | GitHub #1555 | Native type, label | AI Ops, `type:aiops` | Documentation, `type:docs` (only after independent checks) | +| A3 | GitHub #1563 | Title | `aiops: release-agent - Build portable agent` | `aiops: release-agent - Deliver portable preparation MVP` | +| A4 | GitHub #1563 | Native type, label | Documentation, no `type:` label | AI Ops, `type:aiops` | +| A5 | GitHub #2653 | Title | `aiops: changelog-automation - Create portable shared skill` | `aiops: changelog-agent - Deliver portable changelog MVP` | +| A6 | GitHub #3470 | Title | `task: resolve spec 016 changelog-agent design findings` | `docs: changelog-agent - Document specification decisions` | +| A7 | GitHub #1558 | Title | `docs: release-process - Plan documentation reorganisation` | `docs: portable-agents - Restructure and complete guidance` | +| A8 | GitHub #1546 | Body | Current epic body | Remove stale completion or deadline claims; keep Linear link | +| A9 | Linear GIT-1310, GIT-1744, GIT-2623 | Parent | none | Decision needed: GIT-1293 or leave as is | +| A10 | Linear GIT-1302, GIT-1310, GIT-1744 | Title | Linear titles as above | Match the GitHub titles after A1, A3 and A5 | +| A11 | Linear LS-4233 versus GIT-2306 | Disposition | Two records for #3468 | Decision needed: merge, link or keep both | + +No issue is closed, reopened, reparented or reassigned by this map. Replacement issues are not proposed because existing records fit every role. diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index 50173bcfce..a688046723 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -97,8 +97,8 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI │ └── agent-package-layout.md ├── checklists/ │ └── requirements.md -├── issue-map.md # Pending: needs live GitHub and Linear reads and approval -├── delivery-plan.md # Pending: depends on issue-map.md +├── issue-map.md # Live GitHub and Linear mapping; previews only, nothing applied +├── delivery-plan.md # Branch, PR, stack and merge-order profiles └── tasks.md # Phase 2: created by /speckit-tasks, not by this command ``` diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 408461444c..ae10816170 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -90,4 +90,4 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 2. Read PR #3881 diff and checks (R-02). 3. Owner confirmation of R-05, R-06, R-07, R-08. 4. 019 numbering gap resolution (R-11). -5. `issue-map.md` and `delivery-plan.md` from live GitHub and Linear records. +5. Approval decisions on the previews in `issue-map.md` (A1 to A11). From fec1c45a631bb2d2fcf7a0396011bb374549bee4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:09:23 +0000 Subject: [PATCH 04/24] docs: release-agents - Add spec 020 task breakdown Add tasks.md: 65 traceable tasks across setup, foundational, five user stories and polish, with release preparation first, changelog second and the blocking handoff depending on both. Design only; no implementation. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../tasks.md | 262 ++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 .github/specs/020-portable-changelog-release-agents/tasks.md diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md new file mode 100644 index 0000000000..9a24c3eb44 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -0,0 +1,262 @@ +--- +description: "Task list for spec 020: portable changelog and WordPress release preparation agents" +--- + +# Tasks: Portable Changelog and WordPress Release Preparation Agents + +**Input**: Design documents from `.github/specs/020-portable-changelog-release-agents/` + +**Prerequisites**: [plan.md](./plan.md), [spec.md](./spec.md), [research.md](./research.md), [data-model.md](./data-model.md), [contracts/](./contracts/), [quickstart.md](./quickstart.md), [issue-map.md](./issue-map.md), [delivery-plan.md](./delivery-plan.md) + +**Tests**: Included. The spec requires them (FR-021, FR-022): Jest beside scripts, Bash/Bats at agent-root `tests/` with fixtures. No new framework, no Python. + +**Organization**: Grouped by user story. Delivery order follows the brief: release preparation first (priority 1), changelog second (priority 2), then the blocking handoff that needs both. Delivery priority is not a code dependency; the real dependencies are in [Dependencies](#dependencies-and-execution-order). + +**Scope note**: This specification PR is Markdown only. Everything below the Setup decisions describes work for later, separately reviewed implementation PRs (profiles R1, C2, F, DEC, DOC in [delivery-plan.md](./delivery-plan.md)). No task here may be started by the spec PR. Roadmap agents (PRD, linting, PR, reviewer, testing, PageSpeed, design-partner, issue, reporting), provider installation, workflow restoration, rollback and pilots are not tasks; they stay in the delivery plan. + +## Format: `[ID] [P?] [Story] Description` + +- **[P]**: can run in parallel (different files, no dependency on an incomplete task) +- **[Story]**: US1 release readiness, US2 changelog, US3 handoff, US4 packaging, US5 delivery governance +- Paths follow the target layout in [plan.md](./plan.md); T002 confirms them against the in-flight consolidation before any file is moved or created. + +## Path Conventions + +- Release agent: `agents/release-agent/` (`scripts/`, `scripts/adapters/`, `skills/`, `claude/`, `tests/`) +- Changelog agent: `agents/changelog-agent/` (same shape) +- Shipped validation engine (reused, never forked): `.github/validation/changelog/` +- Jest config: `.jest.config.cjs`; scripts: root `package.json` + +--- + +## Phase 1: Setup and decisions (shared, no story) + +**Purpose**: Close the gaps that would otherwise cause rework. No implementation yet. + +- [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. +- [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. +- [ ] T003 Obtain owner confirmation of the provisional decisions R-05 (engine resolution outside a governance checkout), R-06 (one adapter module or two slices), R-07 (no default version-source hierarchy; stop as ambiguous) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. +- [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. +- [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. +- [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. + +**Checkpoint**: Paths, decisions and test discovery are confirmed. + +--- + +## Phase 2: Foundational (blocks all user stories) + +**Purpose**: Shared guarantees every story relies on: explicit root, safe paths, fail-closed results, interop. + +- [ ] T007 [P] Write failing Jest tests for explicit repository root propagation (every filesystem and git call uses the supplied `repoRoot`; process working directory deliberately different) in `agents/release-agent/scripts/__tests__/repoRoot.test.cjs`. +- [ ] T008 [P] Write failing Jest tests for path safety (reject `../` escape, absolute paths where relative is required, symlink escape out of `repoRoot`) in `agents/release-agent/scripts/__tests__/pathSafety.test.cjs`. +- [ ] T009 Remove the `process.cwd()` default from every function in `agents/release-agent/includes/gitOps.cjs` (path per T002) so `workDir` is required, and pass `repoRoot` at the call that currently omits it in `agents/release-agent/release.agent.js` (`gitOps.stageFiles(versionFiles)`, finding A-2). Depends on T007. +- [ ] T010 [P] Implement the path-safety validator in `agents/release-agent/scripts/pathSafety.cjs`. Depends on T008. +- [ ] T011 [P] Implement the fail-closed result module in `agents/release-agent/scripts/readiness.cjs` with the blocker codes from `contracts/readiness-report.md` verbatim: `dirty-tree`, `version-drift`, `version-ambiguous`, `unsafe-path`, `missing-check`, `tag-conflict`, `component-unknown`, `changelog-unverified`; `status` is `ready` only when no `blocker` finding exists; `writes` is always `0` for readiness. +- [ ] T012 Implement the ESM-to-CommonJS interop boundary for the WordPress utilities in `agents/release-agent/scripts/adapters/wordpressAdapter.cjs`, calling the existing `detectWordPressComponent`, `validateVersionConsistency` and `updateAllVersions` from `agents/wordpress-release-utilities-agent/wordpress.agent.js` without rewriting their logic or migrating module systems (research R-04, finding A-5). Add `agents/release-agent/scripts/adapters/__tests__/wordpressAdapter.test.cjs`. + +**Checkpoint**: Explicit root, safe paths, fail-closed results and interop exist; story work can begin. + +--- + +## Phase 3: User Story 1 - Release readiness validation (Priority: P1) + +**Goal**: A maintainer gets a read-only readiness report for a plugin, theme or enhancement target, and only after separate approval can allowlisted, recoverable preparation edits run. + +**Independent Test**: Run the readiness operation against the fixtures with the working directory elsewhere; confirm detection, blockers and zero writes ([quickstart.md](./quickstart.md) release scenarios). + +### Fixtures and tests for User Story 1 + +- [ ] T013 [P] [US1] Create fixture repositories under `agents/release-agent/tests/fixtures/`: `plugin/`, `theme/`, `enhancement/`, `ordinary-github-target/` (has `.github/`, `package.json`, `VERSION`), `optional-version/` (no `VERSION`), `ambiguous-headers/`, `drift/`, `repeat-run/`, `invalid-paths/`, `tag-conflict/`. No fake placeholder content beyond what each case needs. +- [ ] T014 [P] [US1] Write failing Jest tests for detection in `agents/release-agent/scripts/__tests__/detect.test.cjs`: plugin, theme, enhancement, no `VERSION`, and the ordinary `.github` target not classified as governance (FR-003). +- [ ] T015 [P] [US1] Write failing Jest tests for version evidence in `agents/release-agent/scripts/__tests__/versionEvidence.test.cjs`: drift reports every differing source and file; ambiguous headers return `version-ambiguous`; no authoritative field designated means stop and report every detected value, never a silent choice (FR-004, R-07). +- [ ] T016 [P] [US1] Write failing Jest tests for blockers in `agents/release-agent/scripts/__tests__/blockers.test.cjs`: `dirty-tree`, `unsafe-path`, `tag-conflict`, `missing-check`, and that no staging, stashing, tagging, push or remote call occurs on any blocker (FR-005, FR-006). +- [ ] T017 [P] [US1] Write failing Jest tests for dry run in `agents/release-agent/scripts/__tests__/dryRun.test.cjs`: filesystem hash and git state identical before and after, `writes` equals `0`, and the working directory differs from `repoRoot` (FR-001, FR-002, SC-001, SC-002). +- [ ] T018 [P] [US1] Write failing Jest tests for preparation edits in `agents/release-agent/scripts/__tests__/prepareEdit.test.cjs`: edits run only with an approval reference, only on allowlisted version-field paths, a part-way failure restores the repository, and a failed edit is never reported ready (FR-007, SC-004). Include the existing `updateAllVersions` partial-write behaviour (finding A-6); atomicity is tested, not assumed. +- [ ] T019 [P] [US1] Write Bats cases in `agents/release-agent/tests/release-readiness.bats` that run the agent entry point from a different working directory against each fixture and assert exit status and zero writes. + +### Implementation for User Story 1 + +- [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. +- [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. +- [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. +- [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Depends on T017, T020, T021, T022. +- [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval reference required, backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. +- [ ] T025 [US1] Emit the readiness report defined in `.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md` (fields `status`, `repoRoot`, `componentType`, `versionSources[]`, `findings[]`, `writes`) from `agents/release-agent/scripts/readiness.operation.cjs`. Depends on T023. +- [ ] T026 [US1] Make the release-agent Bats and Jest suites pass and record results in the R1 PR body; do not claim `ready` acceptance for the full flow until US3 (T044) has changelog evidence. Depends on T019, T024, T025. + +**Checkpoint**: Release readiness works standalone, read-only by default, and fails closed. + +--- + +## Phase 4: User Story 2 - Standalone changelog preparation (Priority: P2) + +**Goal**: A maintainer inspects, drafts, validates and prepares release entries without any release workflow, and applies only separately approved bounded edits. + +**Independent Test**: Run the agent against well-formed, malformed, repeated and empty-Unreleased fixtures in inspect and draft modes, then apply one approved edit ([quickstart.md](./quickstart.md) changelog scenarios). + +### Tests for User Story 2 + +- [ ] T027 [P] [US2] Create changelog fixtures under `agents/changelog-agent/tests/fixtures/`: `valid-unreleased/`, `invalid-category/`, `empty-unreleased/`, `already-released/`, `hand-edited-between-draft-and-apply/`, `long-entry/`, `no-workflows/` (no `changelog.yml` or `release.yml`). +- [ ] T028 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/draft.test.cjs`: drafting changes no file; an entry in a category outside "Added, Changed, Deprecated, Removed, Fixed, Security" is reported with those six allowed categories listed; entries are checked against the repository's length rule ("entries ≤250 characters", constitution principle IX) and link rule (FR-009, FR-011). +- [ ] T029 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/apply.test.cjs`: apply requires a separate approval; historic sections and links are byte-identical after apply; a second run with no new entries changes nothing; a hand edit between draft and apply is detected and refused (SC-006, SC-007). +- [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no second validation implementation is reachable (FR-010). +- [ ] T031 [P] [US2] Write Bats cases in `agents/changelog-agent/tests/changelog-standalone.bats` that run with neither `.github/workflows/changelog.yml` nor `.github/workflows/release.yml` present (FR-012, SC-006). + +### Implementation for User Story 2 + +- [ ] T032 [US2] Read issue [#2653](https://github.com/lightspeedwp/.github/issues/2653) body and comments and list the five-operation shared-skill obligations it carries, then record them as the acceptance list in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (FR-013). Not inferred from the title. +- [ ] T033 [US2] Implement the engine-resolution decision confirmed in T003 in `agents/changelog-agent/scripts/engineResolver.cjs`: how a copied package finds the shipped engine without a governance checkout, with recorded engine identity and version, and a clear error when it cannot be found. Depends on T003, T030. +- [ ] T034 [US2] Replace or wrap the duplicate validator modules in `agents/changelog-agent/includes/` (finding A-7) so validation goes through the shipped engine; remove nothing until its callers are inventoried. Depends on T033. +- [ ] T035 [US2] Implement the inspect, draft and validate operations in `agents/changelog-agent/scripts/changelog.operations.cjs` with the six allowed categories, historic preservation and idempotent Unreleased handling (FR-011). Depends on T028, T034. +- [ ] T036 [US2] Implement the approved bounded apply operation in `agents/changelog-agent/scripts/apply.operation.cjs`: move Unreleased entries into a versioned section only, keep historic entries and links byte-identical, refuse if the file changed since the draft (research R-08: only this agent edits `CHANGELOG.md`). Depends on T029, T035. +- [ ] T037 [US2] Implement the read-only verification operation in `agents/changelog-agent/scripts/verify.operation.cjs` that returns validation outcome, categories found, Unreleased entry count and the engine identity and version used, and changes no file. Depends on T035. +- [ ] T038 [US2] Make the changelog Jest and Bats suites pass and record results in the C2 PR body. Depends on T027, T031, T036, T037. + +**Checkpoint**: The changelog agent works standalone with no unbuilt workflows. + +--- + +## Phase 5: User Story 3 - Blocking release-to-changelog handoff (Priority: P1) + +**Goal**: The release agent reports ready only on recorded changelog verification success; every other outcome fails closed. + +**Independent Test**: Simulate verified, failed, missing, malformed and unavailable responses and confirm only `verified` with evidence yields ready ([quickstart.md](./quickstart.md) handoff scenarios). + +**Depends on**: US1 (T026) and US2 (T038). This is why the release PR's final ready state is blocked on changelog evidence even though release is delivery priority 1. + +### Tests for User Story 3 + +- [ ] T039 [P] [US3] Write failing Jest tests in `agents/release-agent/scripts/__tests__/handoff.test.cjs` for the request and response in `.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md`: `verified` with evidence allows ready; `failed`, no response, malformed response and unavailable responder each yield `not-ready` with `changelog-unverified`; no silent fallback or skipped gate (FR-014, SC-005). +- [ ] T040 [P] [US3] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/handoffResponder.test.cjs`: the responder refuses a request whose `readiness.status` is not `ready` or whose required fields are missing and replies `failed` with a reason; `evidence` is required when `verified`. + +### Implementation for User Story 3 + +- [ ] T041 [US3] Implement the verification request builder in `agents/release-agent/scripts/handoff.request.cjs` carrying `contractVersion`, `repoRoot`, `targetVersion`, `readiness` and `changelogPath`. Depends on T025, T039. +- [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than `verified` with evidence. Depends on T041. +- [ ] T043 [US3] Implement the responder in `agents/changelog-agent/scripts/handoff.responder.cjs` using the verification operation from T037. Depends on T037, T040. +- [ ] T044 [US3] Wire the final ready decision in `agents/release-agent/scripts/readiness.operation.cjs` so ready requires recorded verification success, and confirm the handoff needs no new labels, event services, `changelog.yml` or `release.yml` (FR-015). Depends on T042, T043. +- [ ] T045 [US3] If the integration does not fit either independent slice, prepare the exact follow-on integration PR preview from `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` (branch `aiops/release-agent-changelog-handoff`, base `develop`, `pr_aiops.md`, label set A) for approval. Do not create it automatically. + +**Checkpoint**: Release plus changelog works end to end with a blocking, fail-closed gate. + +--- + +## Phase 6: User Story 4 - Portable, self-contained packaging (Priority: P2) + +**Goal**: Each agent is a coherent package that works when copied outside the governance checkout. + +**Independent Test**: Place both packages in a clean location with no `~/.github` checkout and confirm they resolve all resources and run. + +### Tests for User Story 4 + +- [ ] T046 [P] [US4] Write a Bats test in `agents/release-agent/tests/portable-install.bats` that copies the package to a temporary directory with no governance checkout on the path and runs readiness against a fixture. +- [ ] T047 [P] [US4] Write the same clean-location Bats test in `agents/changelog-agent/tests/portable-install.bats`, including the engine resolution from T033. + +### Implementation for User Story 4 + +- [ ] T048 [US4] Write one canonical `agents/release-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md` (safety defaults, dry run, approval boundaries, portability notes) per `contracts/agent-package-layout.md`, preserving the AGENTS.md versus AGENT.md roles (FR-017, FR-018). Depends on T002, T026. +- [ ] T049 [US4] Write one canonical `agents/changelog-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md`, preserving the existing five-operation shared-skill obligations (T032). Depends on T002, T038. +- [ ] T050 [P] [US4] Create namespaced `agents/release-agent/skills//SKILL.md` files only for real capabilities (readiness, preparation) and validate with `scripts/validation/validate-skills.js`; create no empty placeholders. +- [ ] T051 [P] [US4] Create namespaced `agents/changelog-agent/skills//SKILL.md` files only for real capabilities (inspect, draft, validate, prepare, apply) and validate with `scripts/validation/validate-skills.js`. +- [ ] T052 [US4] Add the small Claude adapters in `agents/release-agent/claude/` and `agents/changelog-agent/claude/` that resolve resources outside any governance checkout, and run `scripts/agents/generate-agent-defs.cjs` and `.github/scripts/generate-agent-index.js` to refresh generated definitions. Thin relative references alone are not accepted as proof of portability. Depends on T046, T047, T048, T049. +- [ ] T053 [US4] Migrate each caller found in T004 to the release adapter, then remove or archive `agents/wordpress-release-utilities-agent/` only after every reference, export and test is migrated; skip removal and record the reason if any remains (FR-016). Depends on T004, T012, T026. +- [ ] T054 [US4] Validate frontmatter and package manifests: `npm run validate:frontmatter`, `npm run lint:pkg-json`, and confirm no `references` frontmatter field is used. Depends on T048, T049, T050, T051. + +**Checkpoint**: Both agents install and run outside the governance checkout. + +--- + +## Phase 7: User Story 5 - Verified delivery plan and governance (Priority: P3) + +**Goal**: Existing issues are reused, nothing changes without approval, and PRs follow verified profiles. + +**Independent Test**: Review `issue-map.md` and `delivery-plan.md` against live Linear and GitHub records: every entry has a URL, current state, proposed change and approval preview, and no fabricated numbers. + +- [ ] T055 [US5] Re-read the live GitHub and Linear records listed in `.github/specs/020-portable-changelog-release-agents/issue-map.md` immediately before any proposal is acted on and update the table where a record changed; keep unread items marked UNREAD. +- [ ] T056 [US5] Present the approval preview A1 to A11 in `.github/specs/020-portable-changelog-release-agents/issue-map.md` to the owner and apply only the ones explicitly approved, one at a time, with the exact target, title, body, native type and label. Nothing is applied by default; specification approval does not imply this approval. +- [ ] T057 [US5] Decide whether GIT-1310, GIT-1744 and GIT-2623 are linked under GIT-1293 and record the decision in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (A9). No automatic reparenting. +- [ ] T058 [US5] Resolve the overlap between Linear LS-4233 and GIT-2306 for GitHub [#3468](https://github.com/lightspeedwp/.github/issues/3468) and record the disposition in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (A11). +- [ ] T059 [P] [US5] Prepare each implementation PR body from the live template for its branch type (`.github/PULL_REQUEST_TEMPLATE/pr_aiops.md` for R1 and C2, `pr_docs.md` for DEC and DOC), omitting frontmatter, using full issue URLs, `Closes` only for fully delivered scope, and exactly one changelog disposition. Surface the legacy-label conflict for maintainer resolution; edit no locked file. +- [ ] T060 [P] [US5] Record in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` the final ready-state rule for R1: it is not marked ready until C2 evidence from US3 exists. + +**Checkpoint**: Delivery is governed, traceable and approval-gated. + +--- + +## Phase 8: Polish and cross-cutting + +- [ ] T061 [P] Make minimal code-adjacent README and runbook updates for changed behaviour only (`agents/release-agent/README.md`, `agents/changelog-agent/README.md`); broad documentation moves wait for the DOC slice. +- [ ] T062 Run the repository checks before each implementation PR: `npm test`, `npm run lint:js`, `npm run lint:md`, `npm run typecheck`, `npm run validate:branch-name -- --current`; fix only what the change caused. +- [ ] T063 [P] Add the agent `CHANGELOG.md` entries for user-visible changes, within the repository length rule and linked to the PR or issue, and validate them with the shipped engine. +- [ ] T064 Run `/speckit-analyze` for a consistency and coverage report across `spec.md`, `plan.md` and this file, and request approval before any remediation beyond the permitted spec artefacts. +- [ ] T065 Run the [quickstart.md](./quickstart.md) scenarios end to end against the fixtures and record actual results only; claim no result that was not observed. + +--- + +## Dependencies and execution order + +### Phase dependencies + +- **Phase 1** has no dependency; T001 then T002 are sequential, T003, T004, T005 are independent, T006 is an owner decision. +- **Phase 2** depends on Phase 1 (T002 for paths). It blocks every story. +- **US1 (Phase 3)** depends on Phase 2. **US2 (Phase 4)** depends on Phase 1 (T003 for engine resolution) and Phase 2 only for shared conventions, so US1 and US2 can proceed in parallel as sibling PRs if files and contracts permit. +- **US3 (Phase 5)** depends on US1 (T026) and US2 (T038). This is the real dependency behind "release first, changelog second, no false ready acceptance". +- **US4 (Phase 6)** depends on US1, US2 and T002; T053 also depends on T004. +- **US5 (Phase 7)** is governance and can start once Phase 1 decisions exist; it never gates code. +- **Polish (Phase 8)** depends on the stories being delivered. + +### Within a story + +Fixtures, then failing tests, then implementation, then integration. A failing test must exist before the code it covers. + +### Parallel opportunities + +- Phase 1: T004 and T005. +- Phase 2: T007, T008, T011 together; then T009, T010 and T012. +- US1: T013 to T019 are different files and can be written together. +- US2: T027 to T031 together. +- US3: T039 and T040 together. +- US4: T046, T047, T050 and T051 together. +- US5: T059 and T060 together. + +### Parallel example: User Story 1 tests + +```text +T013 fixtures agents/release-agent/tests/fixtures/ +T014 detect tests agents/release-agent/scripts/__tests__/detect.test.cjs +T015 version tests agents/release-agent/scripts/__tests__/versionEvidence.test.cjs +T016 blocker tests agents/release-agent/scripts/__tests__/blockers.test.cjs +T017 dry-run tests agents/release-agent/scripts/__tests__/dryRun.test.cjs +``` + +## Implementation strategy + +### MVP first + +1. Phase 1 and Phase 2 (decisions, explicit root, fail-closed core). +2. US1 alone is a viable, safe first value: a read-only readiness report that cannot write. It fails closed on the changelog gate until US3. +3. US2 delivers the standalone changelog agent. +4. US3 joins them with the blocking handoff; only then may the release agent report ready. +5. US4 packaging, then US5 governance and documentation slices. + +### Incremental delivery + +Delivery follows [delivery-plan.md](./delivery-plan.md): S, then F, then R1 and C2 as siblings from refreshed `develop` (stack on #3881 only if R1 needs layout available solely there), then the optional integration PR, then DEC, DOC, SETUP, with DIST, WFLOW and ROLLBACK deferred. + +## Traceability + +| Story | Requirements | Tasks | +|-------|--------------|-------| +| US1 | FR-001 to FR-008, FR-016, FR-022 | T007 to T026 | +| US2 | FR-009 to FR-013, FR-021, FR-022 | T027 to T038 | +| US3 | FR-014, FR-015 | T039 to T045 | +| US4 | FR-016 to FR-020 | T046 to T054 | +| US5 | FR-025 to FR-027 | T055 to T060 | +| Release-process contract (FR-023, FR-024) | Documentation only; owned by the DOC slice, not an executable task here | none | + +## Notes + +- Mark a task complete only when its stated check passes; record only observed results. +- Do not start any implementation task from the specification PR. +- Commit and PR actions need explicit approval; record changes, tags, releases and deployments are never implied by task completion. From ee4cc5db4dc4970d6b832be99ce8d771f3c7d0a5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:10:08 +0000 Subject: [PATCH 05/24] docs: release-agents - Add spec 020 safety and handoff checklist Add a reviewer-owned requirements-quality checklist (37 items, all unchecked) covering release safety, the fail-closed handoff and delivery traceability, with three candidate findings noted for review. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../checklists/safety-and-handoff.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/specs/020-portable-changelog-release-agents/checklists/safety-and-handoff.md diff --git a/.github/specs/020-portable-changelog-release-agents/checklists/safety-and-handoff.md b/.github/specs/020-portable-changelog-release-agents/checklists/safety-and-handoff.md new file mode 100644 index 0000000000..f9e4a0ba27 --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/checklists/safety-and-handoff.md @@ -0,0 +1,79 @@ +# Release Safety and Handoff Requirements Quality Checklist: Portable Changelog and WordPress Release Preparation Agents + +**Purpose**: Validate that the release-safety, fail-closed handoff and delivery-governance requirements are complete, clear, consistent and measurable before implementation begins +**Created**: 2026-10-09 +**Feature**: [spec.md](../spec.md) + +**Note**: This custom checklist is generated by the `/speckit-checklist` command based on feature context and requirements. +**Review Ownership**: This checklist is a reviewer-owned requirements-quality review artifact. Mark an item `[x]` only when the reviewer determines the requirements-quality criterion is satisfied. +**Marker Semantics**: `[x]` means the criterion has been reviewed and satisfied for requirements quality. It does not mean implementation work is complete. + +**Focus and depth** (defaults applied because the request gave no focus): standard depth, reviewer audience (spec PR review before `/speckit-analyze`), two focus areas: release safety (fail-closed, dry run, recovery, path safety) and the release-to-changelog handoff with delivery traceability. + +## Requirement Completeness + +- [ ] CHK001 Is the "allowlist" for approved preparation edits defined, including which files and which fields it covers? [Gap, Spec §FR-007] +- [ ] CHK002 Is the approval mechanism for preparation and apply operations specified (who approves, in what form, how it is recorded and referenced)? [Gap, Spec §FR-007, Spec §FR-009] +- [ ] CHK003 Are the "required checks" whose absence blocks readiness enumerated, or is their source named? [Gap, Spec §FR-005] +- [ ] CHK004 Is the target "enhancement" component type defined well enough to be detected, rather than only named? [Gap, Spec §FR-003] +- [ ] CHK005 Are non-functional requirements stated for portability beyond Claude (offline use, supported Node versions, path handling on macOS and Linux)? [Gap, Spec §FR-019] +- [ ] CHK006 Are requirements defined for how the agent behaves when `git` itself is unavailable or the repository is not a git repository? [Gap, Edge Case] +- [ ] CHK007 Is the "recoverability" of an approved edit defined (what state is restored, how it is verified, and what is reported if recovery fails)? [Gap, Spec §FR-007, Spec §SC-004] + +## Requirement Clarity + +- [ ] CHK008 Is "meaningful errors" defined with required content (cause, affected path, next step)? [Ambiguity, Spec §FR-007] +- [ ] CHK009 Is "conflicting version or tag evidence" defined precisely enough to distinguish a conflict from a note? [Ambiguity, Spec §FR-005] +- [ ] CHK010 Is "bounded" in "bounded edits" quantified (which sections or lines may change)? [Ambiguity, Spec §FR-009] +- [ ] CHK011 Is the repository "length rule" for changelog entries stated in the spec rather than only referenced from the constitution? [Ambiguity, Spec §FR-011] +- [ ] CHK012 Is "unavailable" for the changelog agent defined, including how long a missing response is awaited before it counts as not received? [Ambiguity, Spec §FR-014] +- [ ] CHK013 Is "unsafe path" defined consistently between the spec, the readiness contract and the data model? [Clarity, Spec §FR-006] +- [ ] CHK014 Is "authoritative" version source defined for the case where a target's instructions designate more than one? [Ambiguity, Spec §FR-004] + +## Requirement Consistency + +- [ ] CHK015 Does User Story 3 (priority P1) conflict with its dependence on User Story 2 (priority P2), given the handoff requires a working changelog agent? [Conflict, Spec §US2, Spec §US3] +- [ ] CHK016 Do the spec's statements that release preparation is "priority 1" and that its final ready state is blocked on changelog evidence read consistently? [Consistency, Spec §Scope, Spec §FR-014] +- [ ] CHK017 Are the readiness blocker codes in the readiness contract consistent with the failure conditions listed in the functional requirements? [Consistency, Spec §FR-005] +- [ ] CHK018 Is the rule that only the changelog agent edits `CHANGELOG.md` consistent with the release agent's preparation scope? [Consistency, Spec §FR-008, Spec §FR-009] +- [ ] CHK019 Do the requirements that the agents "fail closed" and that dry run is the default apply equally to both agents? [Consistency, Spec §FR-001, Spec §FR-014] +- [ ] CHK020 Is the claim that no new labels or event services are needed consistent with the labels and routing the delivery plan relies on? [Consistency, Spec §FR-015] + +## Acceptance Criteria Quality + +- [ ] CHK021 Can "every required fixture scenario" in the dry-run success criterion be objectively checked, given the fixture list lives in another requirement? [Measurability, Spec §SC-001, Spec §FR-022] +- [ ] CHK022 Is "runs in a clean location" measurable, with the definition of clean stated? [Measurability, Spec §SC-008] +- [ ] CHK023 Is "zero replacement issues are proposed where an existing issue fits" verifiable without subjective judgement of fit? [Measurability, Spec §SC-009] +- [ ] CHK024 Are acceptance criteria defined for the ESM-to-CommonJS boundary and the migration of existing callers? [Gap, Spec §FR-016] +- [ ] CHK025 Does each user story have acceptance scenarios covering its failure paths, not only its success path? [Coverage, Spec §US1, Spec §US2, Spec §US3] + +## Scenario and Edge Case Coverage + +- [ ] CHK026 Are requirements defined for a hand edit to the changelog or version files between draft and approved apply? [Gap, Edge Case, Spec §US2] +- [ ] CHK027 Are requirements defined for a repeated or concurrent invocation against the same target? [Gap, Edge Case] +- [ ] CHK028 Are recovery requirements defined when an approved edit fails part-way across several version files? [Coverage, Recovery, Spec §FR-007] +- [ ] CHK029 Are requirements defined for a repository with both plugin and theme markers, or with neither? [Coverage, Edge Case, Spec §Edge Cases] +- [ ] CHK030 Is the behaviour defined when the explicit `repoRoot` itself contains symlinks or resolves outside the intended tree? [Coverage, Exception Flow, Spec §FR-002, Spec §FR-006] + +## Dependencies, Assumptions and Traceability + +- [ ] CHK031 Is the assumption that the in-flight consolidation (issue 3880, PR 3881) will land before the release MVP validated, and is the fallback stated? [Assumption, Spec §Assumptions] +- [ ] CHK032 Is the dependency on the shipped validation engine's location documented against the requirement that copied adapters work without a governance checkout? [Dependency, Conflict, Spec §FR-010, Spec §FR-019] +- [ ] CHK033 Is the dependency on the 019 numbering reservation and its effect on the spec audit recorded as a requirement-level risk? [Dependency, Spec §FR-025] +- [ ] CHK034 Does every functional requirement map to at least one user story and one success criterion, or is the gap stated? [Traceability, Spec §Requirements] +- [ ] CHK035 Is a requirement ID scheme established that tasks, contracts and the issue map reference consistently? [Traceability, Spec §Requirements] + +## Ambiguities and Open Decisions + +- [ ] CHK036 Are the three open decisions (authoritative version source when instructions are silent, who stamps the changelog, one adapter module or two) tied to the requirements each one changes? [Ambiguity, Spec §Open Decisions] +- [ ] CHK037 Are the provisional answers recorded in research clearly distinguished from decided requirements in the spec? [Ambiguity, Spec §Open Decisions] + +## Notes + +- Mark items `[x]` only after review confirms the requirement-quality criterion is satisfied +- Leave items unchecked when they still require clarification, correction, or reviewer evaluation +- `/speckit-implement` reads checklist checkbox state as a gate and must not modify markers +- `checklists/requirements.md` has a separate built-in lifecycle maintained by `/speckit-specify` and `/speckit-clarify` +- Add comments or findings inline +- Candidate findings noticed while writing this checklist, for the reviewer to confirm: CHK015 (priority conflict between US2 and US3), CHK032 (engine location versus portability) and CHK011 (length rule not stated in the spec) +- Items are numbered sequentially for easy reference From 4903188248e300df69abb0152c055ff9dce3808d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:13:24 +0000 Subject: [PATCH 06/24] docs: release-agents - Apply spec 020 analysis remediations Sequence US3 after US2, add the release process contract section, split install behaviour out of FR-019 into roadmap FR-028, define FR-007's allowlist and recovery, state the changelog length rule, gate and narrow Phase 2, and add a locked-files verification task. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../spec.md | 19 +++++++++++++++---- .../tasks.md | 14 ++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 196f9eb3c6..a8283cf939 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -31,6 +31,16 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Any change to locked governance files (labels, issue types, issue/PR templates, branch routing). - Changes to GitHub or Linear records, commits, PRs, tags, releases or deployments, without separate approval. +## Release Process Contract (guidance, not execution permission) + +This section states the contract the agents are built around. It does not authorise any agent to tag, push, publish or deploy; those are outside the executable MVP. + +- **Invariant**: no tag is created before reviewed release changes are merged into the authoritative main release commit. +- **Typical flow**: clean validated preparation; an approved preparation PR into the integration branch if required; a release branch from the accepted integration state; a reviewed release PR to main; verification of the merged main SHA and version; one immutable annotated version tag; approved publication; a reviewed main-to-develop backmerge that retains legitimate develop work. +- **Not forced**: targets are not required to share one branch flow. Each target's own instructions and owner decision determine its actual branching and gates. +- **Never**: push a tag during preparation and retag later, bypass protected branches, force-reset, equate "no drift" with identical branch tips, or equate GitHub publication with live deployment. Required checks and maintainer reviews stay required where configured. +- **Existing contradiction**: current release documentation describes both a single-PR and a two-PR flow. The documentation slice resolves this by stating the invariant above once and allowing target-specific flow; this specification does not edit those documents. + ## User Scenarios & Testing *(mandatory)* ### User Story 1 - Release preparation readiness (Priority: P1) @@ -76,7 +86,7 @@ A maintainer uses the changelog agent on its own, without any release workflow, When release preparation reaches the changelog step, the release agent explicitly asks the changelog agent to verify the changelog. The release agent treats the verification result as blocking evidence and only proceeds on recorded success. -**Why this priority**: Without a fail-closed handoff, preparation could be reported ready while the changelog is unverified. This is the integration point that makes the two MVPs one safe flow. +**Why this priority**: Without a fail-closed handoff, preparation could be reported ready while the changelog is unverified. This is the integration point that makes the two MVPs one safe flow. Sequencing: this story depends on the changelog verification operation delivered by User Story 2, so it is built after US2 even though its safety value ranks it P1. **Independent Test**: Simulate success, failure, missing and timed-out verification responses and confirm the release agent reports ready only on recorded success. @@ -144,14 +154,14 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. - **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. - **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. -- **FR-007**: Approved preparation edits MUST be limited to an allowlist, MUST be recoverable on failure, and MUST return meaningful errors; a partial version update MUST NOT be presented as ready. +- **FR-007**: Approved preparation edits MUST be limited to files the target's own instructions designate as version fields (for example the plugin header Version, readme Stable tag, theme stylesheet Version, package version, `VERSION`), and MUST NOT touch `CHANGELOG.md`, workflows or any other file. Before any write the agent MUST capture the original contents of every file it will edit. On any failure it MUST restore all of them and report per-file restored or failed. If restoration fails it MUST report `unrecoverable` naming the files and MUST NOT report ready; a partial version update MUST NOT be presented as ready. Every error MUST state a cause code, the repository-relative path and the next action. - **FR-008**: The agent MUST treat preparation and readiness as its default purpose and MUST NOT perform automatic release execution, tagging or publication. **Changelog** - **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved and bounded. - **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. -- **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. +- **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. - **FR-013**: The five-operation shared-skill obligations carried by the existing changelog MVP issue MUST be preserved. @@ -165,7 +175,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-016**: Exactly two user-facing orchestration agents exist; the WordPress utilities become reused and hardened release adapter functionality after callers, exports and tests are migrated, with no speculative deletion. - **FR-017**: Each agent package MUST contain one canonical `AGENT.md`, a `README.md`, an agent `CHANGELOG.md`, `package.json` and lockfile where the project convention requires, `scripts/`, namespaced `skills//SKILL.md`, and a small Claude adapter; `references/` and `assets/` only for actual content, with no gratuitous includes, gates, shared, results, manifest or example trees and no invented dependencies. - **FR-018**: The specification MUST resolve explicitly the distinct roles of working-instructions `AGENTS.md` and the definition `AGENT.md`, reuse the in-flight canonical-source migration, and keep module boundaries (no incidental CommonJS-to-ESM or TypeScript migration). -- **FR-019**: Copied adapters MUST resolve resources outside the governance checkout; installation MUST default to dry run, refuse name collisions, preserve user and project overrides, pin source and version, and never copy secrets, hooks or cloud configuration wholesale. +- **FR-019**: Copied agent packages MUST resolve all resources without a governance checkout and MUST NOT read secrets, hooks or cloud configuration. - **FR-020**: Compatibility claims for Gemini, OpenAI and Copilot adapters MUST be backed by independent current documentation and tests; none is assumed. **Testing** @@ -183,6 +193,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-025**: Spec artefacts MUST be Markdown/design only, limited to the permitted allowlist, with a draft entry in the spec catalog that follows its actual schema; feature number 019 MUST NOT be allocated. - **FR-026**: `issue-map.md` MUST map each existing issue to a bounded role with full URLs, current state, proposed repurpose, preserved history, task/story/path mapping, owner and decision gaps, native-type versus label distinction, and an exact approval preview; `delivery-plan.md` MUST give one profile per slice (branch, base, title, template, labels, assignee, closure rule, prerequisites), existing PR reuse, conditional stack plan, merge order and deferred phases; neither may contain fabricated issue/PR numbers or test results. - **FR-027**: Locked governance files MUST NOT be edited; template and label conflicts MUST be presented for maintainer resolution. +- **FR-028** (roadmap, owned by the setup and distribution slices, not an MVP task): Installation MUST default to dry run, refuse name collisions, preserve user and project overrides, pin source and version, define upgrade and uninstall ownership, and never copy secrets, hooks or cloud configuration wholesale. ### Key Entities diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 9a24c3eb44..0df94960c2 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -44,7 +44,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p --- -## Phase 2: Foundational (blocks all user stories) +## Phase 2: Foundational (blocks US1 and US3; US2 needs only T003) **Purpose**: Shared guarantees every story relies on: explicit root, safe paths, fail-closed results, interop. @@ -155,8 +155,8 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Implementation for User Story 4 -- [ ] T048 [US4] Write one canonical `agents/release-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md` (safety defaults, dry run, approval boundaries, portability notes) per `contracts/agent-package-layout.md`, preserving the AGENTS.md versus AGENT.md roles (FR-017, FR-018). Depends on T002, T026. -- [ ] T049 [US4] Write one canonical `agents/changelog-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md`, preserving the existing five-operation shared-skill obligations (T032). Depends on T002, T038. +- [ ] T048 [US4] Write one canonical `agents/release-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md` (safety defaults, dry run, approval boundaries, portability notes) per `contracts/agent-package-layout.md`, preserving the AGENTS.md versus AGENT.md roles (FR-017, FR-018). Depends on T002, T026. The README states that no Gemini, OpenAI or Copilot compatibility is claimed (FR-020). +- [ ] T049 [US4] Write one canonical `agents/changelog-agent/AGENT.md`, `README.md` and agent `CHANGELOG.md`, preserving the existing five-operation shared-skill obligations (T032). Depends on T002, T038. The README states that no Gemini, OpenAI or Copilot compatibility is claimed (FR-020). - [ ] T050 [P] [US4] Create namespaced `agents/release-agent/skills//SKILL.md` files only for real capabilities (readiness, preparation) and validate with `scripts/validation/validate-skills.js`; create no empty placeholders. - [ ] T051 [P] [US4] Create namespaced `agents/changelog-agent/skills//SKILL.md` files only for real capabilities (inspect, draft, validate, prepare, apply) and validate with `scripts/validation/validate-skills.js`. - [ ] T052 [US4] Add the small Claude adapters in `agents/release-agent/claude/` and `agents/changelog-agent/claude/` that resolve resources outside any governance checkout, and run `scripts/agents/generate-agent-defs.cjs` and `.github/scripts/generate-agent-index.js` to refresh generated definitions. Thin relative references alone are not accepted as proof of portability. Depends on T046, T047, T048, T049. @@ -191,6 +191,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T063 [P] Add the agent `CHANGELOG.md` entries for user-visible changes, within the repository length rule and linked to the PR or issue, and validate them with the shipped engine. - [ ] T064 Run `/speckit-analyze` for a consistency and coverage report across `spec.md`, `plan.md` and this file, and request approval before any remediation beyond the permitted spec artefacts. - [ ] T065 Run the [quickstart.md](./quickstart.md) scenarios end to end against the fixtures and record actual results only; claim no result that was not observed. +- [ ] T066 Verify that `git diff --name-only origin/develop` lists no locked governance file (`.github/labels.yml`, `.github/issue-types.yml`, issue and PR templates, `.github/branch-types.yml`), no package manifest, no root `VERSION` and no root `CHANGELOG.md` for each implementation PR (SC-010). --- @@ -199,8 +200,8 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Phase dependencies - **Phase 1** has no dependency; T001 then T002 are sequential, T003, T004, T005 are independent, T006 is an owner decision. -- **Phase 2** depends on Phase 1 (T002 for paths). It blocks every story. -- **US1 (Phase 3)** depends on Phase 2. **US2 (Phase 4)** depends on Phase 1 (T003 for engine resolution) and Phase 2 only for shared conventions, so US1 and US2 can proceed in parallel as sibling PRs if files and contracts permit. +- **Phase 2** depends on T002 (paths), on T003 (open decisions confirmed) and on the reviewer pass of both checklists (constitution Principle VII). It blocks US1 and US3; US2 needs only T003. +- **US1 (Phase 3)** depends on Phase 2. **US2 (Phase 4)** depends on Phase 1 (T003 for engine resolution) and not on Phase 2, so US1 and US2 can proceed in parallel as sibling PRs if files and contracts permit. - **US3 (Phase 5)** depends on US1 (T026) and US2 (T038). This is the real dependency behind "release first, changelog second, no false ready acceptance". - **US4 (Phase 6)** depends on US1, US2 and T002; T053 also depends on T004. - **US5 (Phase 7)** is governance and can start once Phase 1 decisions exist; it never gates code. @@ -253,7 +254,8 @@ Delivery follows [delivery-plan.md](./delivery-plan.md): S, then F, then R1 and | US3 | FR-014, FR-015 | T039 to T045 | | US4 | FR-016 to FR-020 | T046 to T054 | | US5 | FR-025 to FR-027 | T055 to T060 | -| Release-process contract (FR-023, FR-024) | Documentation only; owned by the DOC slice, not an executable task here | none | +| Release-process contract (FR-023, FR-024) | Stated in the spec section "Release Process Contract"; the DOC slice finalises wording in release documentation | none | +| Install behaviour (FR-028) | Roadmap, owned by the setup and distribution slices | none | ## Notes From 8f5a2f21fd9dd5fc7283616e4d6b3c43da050c82 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:17:45 +0000 Subject: [PATCH 07/24] docs: release-agents - Record spec 020 approval clarification Clarify that edit approval is a digest of the exact proposed edit, rechecked before any write. Add FR-029, SC-011, an edge case, a data model and task update, research R-13 and a quickstart scenario. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../data-model.md | 2 +- .../quickstart.md | 1 + .../research.md | 6 ++++++ .../020-portable-changelog-release-agents/spec.md | 13 +++++++++++-- .../020-portable-changelog-release-agents/tasks.md | 6 +++--- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 5cc98d3e11..ca4a034c8b 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -41,7 +41,7 @@ not-run -> ready | not-ready |-------|---------| | `path` | Allowlisted version-field file. | | `from`, `to` | Current and target version. | -| `approval` | Reference to the separate approval. Absent means the edit must not run. | +| `approval` | Digest of the exact proposed edit, supplied by the maintainer (FR-029). Absent or non-matching means the edit must not run. | | `backup` | Recovery point captured before the edit. | States: `proposed -> approved -> applied | failed-recovered`. A `failed` edit that cannot be recovered is never reported as ready. diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index fea1ed7270..d5c1fed8cd 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -27,6 +27,7 @@ This guide describes how a reviewer proves the specification and, later, the imp | Drift or ambiguity | `not-ready` with `version-drift` or `version-ambiguous`, sources named. | | Dirty tree, unsafe path, tag conflict | `not-ready` with the matching blocker; nothing staged or stashed. | | Interrupted approved edit | Repository recoverable; not reported ready. | +| Approval digest does not match the edit about to be applied | Zero files written; mismatch reported. | ## Changelog scenarios (C2 slice) diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index ae10816170..95bb02dc40 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -80,6 +80,12 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Finding**: `.specify/scripts/bash/audit-specs.sh` fails on gaps; 019 is reserved on an unmerged branch. - **Decision**: owner-decided. Either merge the 019 spec first, or approve a separate change allowing reserved numbers. Neither is performed by this plan. +### R-13 Approval is a digest of the exact proposed edit + +- **Decision** (clarify session 2026-10-09, option A): the agent displays the exact proposed edit and a short digest; the maintainer returns the digest; the agent recomputes it immediately before writing and writes only on a match (FR-029). +- **Rationale**: machine-checkable, bound to one edit, and cannot be reused for a different change or after a hand edit. +- **Alternatives**: an explicit approve flag with no per-edit binding, conversational approval, and a committed approval file were rejected as weaker or heavier. + ### R-12 Preparation path forbids remote and tag effects - **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index a8283cf939..d3315a3816 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -31,6 +31,12 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Any change to locked governance files (labels, issue types, issue/PR templates, branch routing). - Changes to GitHub or Linear records, commits, PRs, tags, releases or deployments, without separate approval. +## Clarifications + +### Session 2026-10-09 + +- Q: How should a maintainer's approval of a preparation or changelog edit be recorded so the agent can prove an edit was approved before it writes anything? → A: Option A - a digest of the exact proposed edit, shown by the agent, supplied by the maintainer and rechecked before any write. + ## Release Process Contract (guidance, not execution permission) This section states the contract the agents are built around. It does not authorise any agent to tag, push, publish or deploy; those are outside the executable MVP. @@ -140,6 +146,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - Changelog edited by hand between draft and apply. - Approved edit interrupted part-way (some files updated, others not). - Repository access denied for a target (for example a permission boundary on a pilot repository): affected checks remain blocked, not skipped. +- The proposed edit changes between the digest being shown and the write (for example a hand edit to a version file or the changelog): the digests no longer match and the agent writes nothing. - Spec directory number 019 is reserved on an unmerged branch and must not be allocated. ## Requirements *(mandatory)* @@ -154,12 +161,12 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. - **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. - **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. -- **FR-007**: Approved preparation edits MUST be limited to files the target's own instructions designate as version fields (for example the plugin header Version, readme Stable tag, theme stylesheet Version, package version, `VERSION`), and MUST NOT touch `CHANGELOG.md`, workflows or any other file. Before any write the agent MUST capture the original contents of every file it will edit. On any failure it MUST restore all of them and report per-file restored or failed. If restoration fails it MUST report `unrecoverable` naming the files and MUST NOT report ready; a partial version update MUST NOT be presented as ready. Every error MUST state a cause code, the repository-relative path and the next action. +- **FR-007**: Approved preparation edits (approval as defined in FR-029) MUST be limited to files the target's own instructions designate as version fields (for example the plugin header Version, readme Stable tag, theme stylesheet Version, package version, `VERSION`), and MUST NOT touch `CHANGELOG.md`, workflows or any other file. Before any write the agent MUST capture the original contents of every file it will edit. On any failure it MUST restore all of them and report per-file restored or failed. If restoration fails it MUST report `unrecoverable` naming the files and MUST NOT report ready; a partial version update MUST NOT be presented as ready. Every error MUST state a cause code, the repository-relative path and the next action. - **FR-008**: The agent MUST treat preparation and readiness as its default purpose and MUST NOT perform automatic release execution, tagging or publication. **Changelog** -- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved and bounded. +- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. - **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. - **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. @@ -194,6 +201,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-026**: `issue-map.md` MUST map each existing issue to a bounded role with full URLs, current state, proposed repurpose, preserved history, task/story/path mapping, owner and decision gaps, native-type versus label distinction, and an exact approval preview; `delivery-plan.md` MUST give one profile per slice (branch, base, title, template, labels, assignee, closure rule, prerequisites), existing PR reuse, conditional stack plan, merge order and deferred phases; neither may contain fabricated issue/PR numbers or test results. - **FR-027**: Locked governance files MUST NOT be edited; template and label conflicts MUST be presented for maintainer resolution. - **FR-028** (roadmap, owned by the setup and distribution slices, not an MVP task): Installation MUST default to dry run, refuse name collisions, preserve user and project overrides, pin source and version, define upgrade and uninstall ownership, and never copy secrets, hooks or cloud configuration wholesale. +- **FR-029**: An edit is approved only when the maintainer supplies the digest of the exact proposed edit that the agent displayed. The agent MUST recompute the digest of the edit it is about to apply immediately before writing, MUST write only if the two digests match, MUST write nothing and report the mismatch otherwise, and MUST record the digest in its report. ### Key Entities @@ -219,6 +227,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **SC-008**: A copied agent package runs in a clean location with no governance checkout present. - **SC-009**: Each existing issue in scope is either repurposed in the issue map or explicitly dispositioned; zero replacement issues are proposed where an existing issue fits, and zero entries contain fabricated numbers. - **SC-010**: No locked governance file, source code, package manifest, root version or root changelog is modified by this specification's pull request. +- **SC-011**: In every fixture where the supplied approval digest does not match the edit about to be applied, zero files are written. ## Assumptions diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 0df94960c2..a3983e7d80 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -72,7 +72,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T015 [P] [US1] Write failing Jest tests for version evidence in `agents/release-agent/scripts/__tests__/versionEvidence.test.cjs`: drift reports every differing source and file; ambiguous headers return `version-ambiguous`; no authoritative field designated means stop and report every detected value, never a silent choice (FR-004, R-07). - [ ] T016 [P] [US1] Write failing Jest tests for blockers in `agents/release-agent/scripts/__tests__/blockers.test.cjs`: `dirty-tree`, `unsafe-path`, `tag-conflict`, `missing-check`, and that no staging, stashing, tagging, push or remote call occurs on any blocker (FR-005, FR-006). - [ ] T017 [P] [US1] Write failing Jest tests for dry run in `agents/release-agent/scripts/__tests__/dryRun.test.cjs`: filesystem hash and git state identical before and after, `writes` equals `0`, and the working directory differs from `repoRoot` (FR-001, FR-002, SC-001, SC-002). -- [ ] T018 [P] [US1] Write failing Jest tests for preparation edits in `agents/release-agent/scripts/__tests__/prepareEdit.test.cjs`: edits run only with an approval reference, only on allowlisted version-field paths, a part-way failure restores the repository, and a failed edit is never reported ready (FR-007, SC-004). Include the existing `updateAllVersions` partial-write behaviour (finding A-6); atomicity is tested, not assumed. +- [ ] T018 [P] [US1] Write failing Jest tests for preparation edits in `agents/release-agent/scripts/__tests__/prepareEdit.test.cjs`: edits run only with a matching approval digest (FR-029) and only on allowlisted version-field paths; a mismatching or missing digest writes nothing (SC-011), a part-way failure restores the repository, and a failed edit is never reported ready (FR-007, SC-004). Include the existing `updateAllVersions` partial-write behaviour (finding A-6); atomicity is tested, not assumed. - [ ] T019 [P] [US1] Write Bats cases in `agents/release-agent/tests/release-readiness.bats` that run the agent entry point from a different working directory against each fixture and assert exit status and zero writes. ### Implementation for User Story 1 @@ -81,7 +81,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. - [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. - [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Depends on T017, T020, T021, T022. -- [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval reference required, backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. +- [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval digest required and rechecked immediately before writing (FR-029), backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. - [ ] T025 [US1] Emit the readiness report defined in `.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md` (fields `status`, `repoRoot`, `componentType`, `versionSources[]`, `findings[]`, `writes`) from `agents/release-agent/scripts/readiness.operation.cjs`. Depends on T023. - [ ] T026 [US1] Make the release-agent Bats and Jest suites pass and record results in the R1 PR body; do not claim `ready` acceptance for the full flow until US3 (T044) has changelog evidence. Depends on T019, T024, T025. @@ -99,7 +99,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T027 [P] [US2] Create changelog fixtures under `agents/changelog-agent/tests/fixtures/`: `valid-unreleased/`, `invalid-category/`, `empty-unreleased/`, `already-released/`, `hand-edited-between-draft-and-apply/`, `long-entry/`, `no-workflows/` (no `changelog.yml` or `release.yml`). - [ ] T028 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/draft.test.cjs`: drafting changes no file; an entry in a category outside "Added, Changed, Deprecated, Removed, Fixed, Security" is reported with those six allowed categories listed; entries are checked against the repository's length rule ("entries ≤250 characters", constitution principle IX) and link rule (FR-009, FR-011). -- [ ] T029 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/apply.test.cjs`: apply requires a separate approval; historic sections and links are byte-identical after apply; a second run with no new entries changes nothing; a hand edit between draft and apply is detected and refused (SC-006, SC-007). +- [ ] T029 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/apply.test.cjs`: apply requires a matching approval digest (FR-029) and writes nothing on mismatch (SC-011); historic sections and links are byte-identical after apply; a second run with no new entries changes nothing; a hand edit between draft and apply is detected and refused (SC-006, SC-007). - [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no second validation implementation is reachable (FR-010). - [ ] T031 [P] [US2] Write Bats cases in `agents/changelog-agent/tests/changelog-standalone.bats` that run with neither `.github/workflows/changelog.yml` nor `.github/workflows/release.yml` present (FR-012, SC-006). From 5f09d581d6810834e16a387be0a9ce1ef87eeabc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:20:47 +0000 Subject: [PATCH 08/24] docs: release-agents - Record spec 020 changelog engine clarification Clarify that a copied changelog agent validates with a bundled copy of the shipped engine pinned to a recorded version and reports that version in every result. Update FR-010, add SC-012, rewrite T033, and resolve R-05. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../020-portable-changelog-release-agents/plan.md | 2 +- .../020-portable-changelog-release-agents/research.md | 10 ++++++---- .../020-portable-changelog-release-agents/spec.md | 4 +++- .../020-portable-changelog-release-agents/tasks.md | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index a688046723..e9428eacad 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -44,7 +44,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI **Language/Version**: Node.js with CommonJS (`.cjs`) for the release and changelog agent modules, matching existing agents; no incidental migration to ESM or TypeScript. `wordpress.agent.js` is currently ESM and needs an explicit interop boundary (research R-04). -**Primary Dependencies**: none new. Existing: the shipped changelog validation engine at `.github/validation/changelog/` (ESM package, `bin/validate.js`), Node built-ins, `git`. No Python, no new test framework. +**Primary Dependencies**: none new. Existing: the shipped changelog validation engine at `.github/validation/changelog/` (ESM package, `bin/validate.js`); copied agents carry a bundled copy pinned to a recorded version (research R-05), Node built-ins, `git`. No Python, no new test framework. **Storage**: files only (version fields, `CHANGELOG.md`); no database. Handoff evidence is a structured JSON document passed between agents. diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 95bb02dc40..e76192211d 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -42,10 +42,12 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Decision**: provide a thin CommonJS-facing adapter that calls the existing logic, keeping function behaviour and exports (`detectWordPressComponent`, `validateVersionConsistency`, `updateAllVersions`) intact; no ESM-to-CJS rewrite of the logic. - **Rationale**: preserves tested logic and avoids incidental migration (FR-018). **Alternatives**: convert the utilities to CommonJS (rejected as unrequested migration); keep a separate agent (rejected: FR-016 forbids a second release agent). -### R-05 Changelog validation reuse and portability tension +### R-05 Changelog validation reuse and portability -- **Decision**: the changelog agent invokes the shipped engine for validation and does not add another engine. -- **Unresolved tension**: the engine lives under `.github/`, but FR-019 requires copied adapters to work without a governance checkout. Candidate resolutions: resolve the engine from the target repository if present, else from a pinned bundled copy with recorded source and version. This is a design choice with portability and drift consequences and needs owner confirmation; it is carried into `/speckit-tasks` as a decision task, not assumed. +- **Decision** (clarify session 2026-10-09, option B): the changelog agent validates with the shipped engine and does not add another. A copied agent package carries a bundled copy of that engine pinned to a recorded version and source commit, and reports the engine version in every result. +- **Rationale**: predictable and portable with no governance checkout. A version-pinned copy of the same engine is not a second engine, because it is produced by a refresh script from `.github/validation/changelog/` and checked against its pin. +- **Consequences**: drift is handled by the pin and a test that fails when the bundled copy differs from it; upgrades are an explicit refresh. Results always name the engine version (FR-010, SC-012). +- **Alternatives rejected**: preferring the target repository's own copy (versions vary), requiring a governance checkout (breaks portability), and refusing until installed separately (poor first-run experience). ### R-06 Plugin and theme adapter: one module or two slices (open decision 3) @@ -94,6 +96,6 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). 2. Read PR #3881 diff and checks (R-02). -3. Owner confirmation of R-05, R-06, R-07, R-08. +3. Owner confirmation of R-06, R-07, R-08. 4. 019 numbering gap resolution (R-11). 5. Approval decisions on the previews in `issue-map.md` (A1 to A11). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index d3315a3816..da147b1588 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -36,6 +36,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP ### Session 2026-10-09 - Q: How should a maintainer's approval of a preparation or changelog edit be recorded so the agent can prove an edit was approved before it writes anything? → A: Option A - a digest of the exact proposed edit, shown by the agent, supplied by the maintainer and rechecked before any write. +- Q: When a changelog agent is copied into another repository, where should it find the shared changelog checker it validates with? → A: Option B - always use a bundled copy pinned to a recorded version, and report that version in every result. ## Release Process Contract (guidance, not execution permission) @@ -167,7 +168,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Changelog** - **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. -- **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. +- **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. A copied agent package MUST validate with a bundled copy of that engine pinned to a recorded version, and every validation result MUST state the engine version it used. - **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. - **FR-013**: The five-operation shared-skill obligations carried by the existing changelog MVP issue MUST be preserved. @@ -228,6 +229,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **SC-009**: Each existing issue in scope is either repurposed in the issue map or explicitly dispositioned; zero replacement issues are proposed where an existing issue fits, and zero entries contain fabricated numbers. - **SC-010**: No locked governance file, source code, package manifest, root version or root changelog is modified by this specification's pull request. - **SC-011**: In every fixture where the supplied approval digest does not match the edit about to be applied, zero files are written. +- **SC-012**: Every changelog validation result, including each verification response, states the engine version used, and that version matches the recorded pin of the bundled copy. ## Assumptions diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index a3983e7d80..49e9a70265 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -35,7 +35,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. -- [ ] T003 Obtain owner confirmation of the provisional decisions R-05 (engine resolution outside a governance checkout), R-06 (one adapter module or two slices), R-07 (no default version-source hierarchy; stop as ambiguous) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. +- [ ] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 (no default version-source hierarchy; stop as ambiguous) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. - [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. @@ -100,13 +100,13 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T027 [P] [US2] Create changelog fixtures under `agents/changelog-agent/tests/fixtures/`: `valid-unreleased/`, `invalid-category/`, `empty-unreleased/`, `already-released/`, `hand-edited-between-draft-and-apply/`, `long-entry/`, `no-workflows/` (no `changelog.yml` or `release.yml`). - [ ] T028 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/draft.test.cjs`: drafting changes no file; an entry in a category outside "Added, Changed, Deprecated, Removed, Fixed, Security" is reported with those six allowed categories listed; entries are checked against the repository's length rule ("entries ≤250 characters", constitution principle IX) and link rule (FR-009, FR-011). - [ ] T029 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/apply.test.cjs`: apply requires a matching approval digest (FR-029) and writes nothing on mismatch (SC-011); historic sections and links are byte-identical after apply; a second run with no new entries changes nothing; a hand edit between draft and apply is detected and refused (SC-006, SC-007). -- [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no second validation implementation is reachable (FR-010). +- [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no second validation implementation is reachable (FR-010) and that every result states the engine version (SC-012). - [ ] T031 [P] [US2] Write Bats cases in `agents/changelog-agent/tests/changelog-standalone.bats` that run with neither `.github/workflows/changelog.yml` nor `.github/workflows/release.yml` present (FR-012, SC-006). ### Implementation for User Story 2 - [ ] T032 [US2] Read issue [#2653](https://github.com/lightspeedwp/.github/issues/2653) body and comments and list the five-operation shared-skill obligations it carries, then record them as the acceptance list in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (FR-013). Not inferred from the title. -- [ ] T033 [US2] Implement the engine-resolution decision confirmed in T003 in `agents/changelog-agent/scripts/engineResolver.cjs`: how a copied package finds the shipped engine without a governance checkout, with recorded engine identity and version, and a clear error when it cannot be found. Depends on T003, T030. +- [ ] T033 [US2] Bundle a copy of the shipped validation engine inside `agents/changelog-agent/` pinned to a recorded version and source commit (research R-05, option B), with a refresh script that copies it from `.github/validation/changelog/` and rewrites the pin, and implement `agents/changelog-agent/scripts/engineResolver.cjs` so it always loads the bundled copy and reports the engine version in every result (FR-010, SC-012). Add a Jest check that fails when the bundled copy no longer matches its recorded pin. Depends on T030. - [ ] T034 [US2] Replace or wrap the duplicate validator modules in `agents/changelog-agent/includes/` (finding A-7) so validation goes through the shipped engine; remove nothing until its callers are inventoried. Depends on T033. - [ ] T035 [US2] Implement the inspect, draft and validate operations in `agents/changelog-agent/scripts/changelog.operations.cjs` with the six allowed categories, historic preservation and idempotent Unreleased handling (FR-011). Depends on T028, T034. - [ ] T036 [US2] Implement the approved bounded apply operation in `agents/changelog-agent/scripts/apply.operation.cjs`: move Unreleased entries into a versioned section only, keep historic entries and links byte-identical, refuse if the file changed since the draft (research R-08: only this agent edits `CHANGELOG.md`). Depends on T029, T035. From b906f58b6a88d4744cc1a625c2d6c9789fe7d5b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:21:57 +0000 Subject: [PATCH 09/24] docs: release-agents - Record spec 020 missing-response clarification Define a missing verification response as none returned within the same invocation, with no timer. Update FR-014, an edge case, the handoff contract, data model and tasks, and add research R-14. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/verification-handoff.md | 2 +- .../020-portable-changelog-release-agents/data-model.md | 2 ++ .../specs/020-portable-changelog-release-agents/research.md | 6 ++++++ .github/specs/020-portable-changelog-release-agents/spec.md | 4 +++- .../specs/020-portable-changelog-release-agents/tasks.md | 4 ++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md index f8b68250d9..84ad9ef2dc 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md @@ -28,6 +28,6 @@ The changelog agent refuses a request whose `readiness.status` is not `ready` fo |-----------|---------| | `verified` with evidence | Readiness may be reported complete. | | `failed` | `not-ready`, `changelog-unverified`, reason surfaced. | -| No response, malformed response, or changelog agent unavailable | `not-ready`, `changelog-unverified`. Never a silent fallback or skipped gate. | +| No response (none returned within the same invocation; no timer), malformed response, or changelog agent unavailable | `not-ready`, `changelog-unverified`. Never a silent fallback or skipped gate. | Verification is read-only. Applying changelog edits is a separate operation requiring its own approval. diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index ca4a034c8b..69e3434355 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -63,6 +63,8 @@ See [contracts/verification-handoff.md](./contracts/verification-handoff.md). St ```text requested -> verified | failed | missing + +`missing` means no response was returned within the same invocation; no timer applies (FR-014). ``` Only `verified` with evidence allows the release agent to report ready. `failed`, `missing` and no response all yield not-ready. diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index e76192211d..27d5969c60 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -88,6 +88,12 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Rationale**: machine-checkable, bound to one edit, and cannot be reused for a different change or after a hand edit. - **Alternatives**: an explicit approve flag with no per-edit binding, conversational approval, and a committed approval file were rejected as weaker or heavier. +### R-14 A missing handoff response is defined by the invocation, not a timer + +- **Decision** (clarify session 2026-10-09, option A): a verification response not returned within the same invocation counts as not received, and the release agent reports not ready with `changelog-unverified`. +- **Rationale**: the agents are manually invoked, so there is no background wait to time out; the rule is simple and testable. +- **Alternatives**: a configurable timeout and a per-run maintainer decision were rejected as unnecessary for the MVP. + ### R-12 Preparation path forbids remote and tag effects - **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index da147b1588..bcf29a7ed4 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -37,6 +37,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Q: How should a maintainer's approval of a preparation or changelog edit be recorded so the agent can prove an edit was approved before it writes anything? → A: Option A - a digest of the exact proposed edit, shown by the agent, supplied by the maintainer and rechecked before any write. - Q: When a changelog agent is copied into another repository, where should it find the shared changelog checker it validates with? → A: Option B - always use a bundled copy pinned to a recorded version, and report that version in every result. +- Q: When the other agent gives no answer to a verification request, how long should the release agent wait before counting it as not received? → A: Option A - not received means no response was returned within the same invocation; there is no timer. ## Release Process Contract (guidance, not execution permission) @@ -148,6 +149,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - Approved edit interrupted part-way (some files updated, others not). - Repository access denied for a target (for example a permission boundary on a pilot repository): affected checks remain blocked, not skipped. - The proposed edit changes between the digest being shown and the write (for example a hand edit to a version file or the changelog): the digests no longer match and the agent writes nothing. +- The changelog agent returns no verification response within the same invocation: the release agent treats it as not received and reports not ready with `changelog-unverified`. - Spec directory number 019 is reserved on an unmerged branch and must not be allocated. ## Requirements *(mandatory)* @@ -175,7 +177,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Handoff** -- **FR-014**: The release agent MUST send an explicit verification request to the changelog agent and MUST treat the response as blocking evidence; missing, failed or unreceived verification MUST yield not-ready (fail closed). +- **FR-014**: The release agent MUST send an explicit verification request to the changelog agent and MUST treat the response as blocking evidence; missing, failed or unreceived verification MUST yield not-ready (fail closed). A response is "not received" when none is returned within the same invocation; no timer applies. - **FR-015**: The handoff MUST require no new labels or event services for the MVP. **Packaging and architecture** diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 49e9a70265..c64651749d 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -127,13 +127,13 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Tests for User Story 3 -- [ ] T039 [P] [US3] Write failing Jest tests in `agents/release-agent/scripts/__tests__/handoff.test.cjs` for the request and response in `.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md`: `verified` with evidence allows ready; `failed`, no response, malformed response and unavailable responder each yield `not-ready` with `changelog-unverified`; no silent fallback or skipped gate (FR-014, SC-005). +- [ ] T039 [P] [US3] Write failing Jest tests in `agents/release-agent/scripts/__tests__/handoff.test.cjs` for the request and response in `.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md`: `verified` with evidence allows ready; `failed`, no response, malformed response and unavailable responder each yield `not-ready` with `changelog-unverified`; no silent fallback or skipped gate (FR-014, SC-005). "No response" means none was returned within the same invocation; no timer is used (FR-014). - [ ] T040 [P] [US3] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/handoffResponder.test.cjs`: the responder refuses a request whose `readiness.status` is not `ready` or whose required fields are missing and replies `failed` with a reason; `evidence` is required when `verified`. ### Implementation for User Story 3 - [ ] T041 [US3] Implement the verification request builder in `agents/release-agent/scripts/handoff.request.cjs` carrying `contractVersion`, `repoRoot`, `targetVersion`, `readiness` and `changelogPath`. Depends on T025, T039. -- [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than `verified` with evidence. Depends on T041. +- [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than `verified` with evidence. Depends on T041. A response not returned within the same invocation is treated as not received (FR-014). - [ ] T043 [US3] Implement the responder in `agents/changelog-agent/scripts/handoff.responder.cjs` using the verification operation from T037. Depends on T037, T040. - [ ] T044 [US3] Wire the final ready decision in `agents/release-agent/scripts/readiness.operation.cjs` so ready requires recorded verification success, and confirm the handoff needs no new labels, event services, `changelog.yml` or `release.yml` (FR-015). Depends on T042, T043. - [ ] T045 [US3] If the integration does not fit either independent slice, prepare the exact follow-on integration PR preview from `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` (branch `aiops/release-agent-changelog-handoff`, base `develop`, `pr_aiops.md`, label set A) for approval. Do not create it automatically. From c9c2ad9132ace7f582869505f2187f10fc0b4758 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:23:17 +0000 Subject: [PATCH 10/24] docs: release-agents - Record spec 020 required-checks clarification Define required checks as those named in the target's own instructions or CI configuration, with none named reporting not ready as missing-check. Update FR-005, an edge case, the readiness contract, tasks and quickstart, and add research R-15. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/readiness-report.md | 2 +- .../020-portable-changelog-release-agents/quickstart.md | 1 + .../specs/020-portable-changelog-release-agents/research.md | 6 ++++++ .github/specs/020-portable-changelog-release-agents/spec.md | 4 +++- .../specs/020-portable-changelog-release-agents/tasks.md | 4 ++-- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md index 23975d9c80..b55fb6383b 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md @@ -30,7 +30,7 @@ The readiness operation is read-only. Producing this report must not write files | `version-drift` | Detected versions differ. Findings name each source and file. | | `version-ambiguous` | Authoritative field cannot be determined from the target's instructions. | | `unsafe-path` | A path escapes `repoRoot` or is absolute where relative is required. | -| `missing-check` | A required check could not run; it is never skipped silently. | +| `missing-check` | A required check named in the target's own instructions or CI configuration could not run, or none are named so nothing can be verified. It is never skipped silently. | | `tag-conflict` | Local and remote tag evidence disagree, or the target tag exists. | | `component-unknown` | No plugin, theme or enhancement could be identified. | | `changelog-unverified` | Handoff verification is missing, failed or not received. | diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index d5c1fed8cd..436cc2e1a9 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -26,6 +26,7 @@ This guide describes how a reviewer proves the specification and, later, the imp | Ordinary repo with `.github`, `package.json`, `VERSION` | Not classified as governance. | | Drift or ambiguity | `not-ready` with `version-drift` or `version-ambiguous`, sources named. | | Dirty tree, unsafe path, tag conflict | `not-ready` with the matching blocker; nothing staged or stashed. | +| Target names no required checks | `not-ready` with `missing-check`. | | Interrupted approved edit | Repository recoverable; not reported ready. | | Approval digest does not match the edit about to be applied | Zero files written; mismatch reported. | diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 27d5969c60..1535fd7d7f 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -94,6 +94,12 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Rationale**: the agents are manually invoked, so there is no background wait to time out; the rule is simple and testable. - **Alternatives**: a configurable timeout and a per-run maintainer decision were rejected as unnecessary for the MVP. +### R-15 Required checks come from the target, and none named means not ready + +- **Decision** (clarify session 2026-10-09, option A): required checks are those named in the target repository's own instructions or CI configuration; if none are named, readiness is not ready with `missing-check`. +- **Rationale**: stays fail-closed without imposing one check list on every repository, consistent with deriving version sources from the target's own instructions (R-07). +- **Alternatives**: treating "none named" as a note, and a fixed built-in set, were rejected as weaker or too prescriptive. + ### R-12 Preparation path forbids remote and tag effects - **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index bcf29a7ed4..c28154b8db 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -38,6 +38,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Q: How should a maintainer's approval of a preparation or changelog edit be recorded so the agent can prove an edit was approved before it writes anything? → A: Option A - a digest of the exact proposed edit, shown by the agent, supplied by the maintainer and rechecked before any write. - Q: When a changelog agent is copied into another repository, where should it find the shared changelog checker it validates with? → A: Option B - always use a bundled copy pinned to a recorded version, and report that version in every result. - Q: When the other agent gives no answer to a verification request, how long should the release agent wait before counting it as not received? → A: Option A - not received means no response was returned within the same invocation; there is no timer. +- Q: What counts as the required checks that must be present before the release agent reports a repository ready? → A: Option A - the checks named in the target repository's own instructions or CI configuration; if none are named, readiness is not ready with `missing-check`, because nothing can be verified. ## Release Process Contract (guidance, not execution permission) @@ -150,6 +151,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - Repository access denied for a target (for example a permission boundary on a pilot repository): affected checks remain blocked, not skipped. - The proposed edit changes between the digest being shown and the write (for example a hand edit to a version file or the changelog): the digests no longer match and the agent writes nothing. - The changelog agent returns no verification response within the same invocation: the release agent treats it as not received and reports not ready with `changelog-unverified`. +- A target repository names no required checks in its instructions or CI configuration: readiness reports not ready with `missing-check` rather than assuming success. - Spec directory number 019 is reserved on an unmerged branch and must not be allocated. ## Requirements *(mandatory)* @@ -162,7 +164,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-002**: An explicit repository root MUST be propagated to every filesystem and git operation, independent of the process working directory. - **FR-003**: The agent MUST detect plugin, theme and enhancement targets without requiring an optional `VERSION` file, and MUST NOT classify a repository as governance merely because it contains `.github`, `package.json` and `VERSION`. - **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. -- **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. +- **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. Required checks are those named in the target repository's own instructions or CI configuration; if none are named the agent MUST report not ready with `missing-check`, because nothing can be verified. - **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. - **FR-007**: Approved preparation edits (approval as defined in FR-029) MUST be limited to files the target's own instructions designate as version fields (for example the plugin header Version, readme Stable tag, theme stylesheet Version, package version, `VERSION`), and MUST NOT touch `CHANGELOG.md`, workflows or any other file. Before any write the agent MUST capture the original contents of every file it will edit. On any failure it MUST restore all of them and report per-file restored or failed. If restoration fails it MUST report `unrecoverable` naming the files and MUST NOT report ready; a partial version update MUST NOT be presented as ready. Every error MUST state a cause code, the repository-relative path and the next action. - **FR-008**: The agent MUST treat preparation and readiness as its default purpose and MUST NOT perform automatic release execution, tagging or publication. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index c64651749d..cf9a9ce7aa 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -70,7 +70,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T013 [P] [US1] Create fixture repositories under `agents/release-agent/tests/fixtures/`: `plugin/`, `theme/`, `enhancement/`, `ordinary-github-target/` (has `.github/`, `package.json`, `VERSION`), `optional-version/` (no `VERSION`), `ambiguous-headers/`, `drift/`, `repeat-run/`, `invalid-paths/`, `tag-conflict/`. No fake placeholder content beyond what each case needs. - [ ] T014 [P] [US1] Write failing Jest tests for detection in `agents/release-agent/scripts/__tests__/detect.test.cjs`: plugin, theme, enhancement, no `VERSION`, and the ordinary `.github` target not classified as governance (FR-003). - [ ] T015 [P] [US1] Write failing Jest tests for version evidence in `agents/release-agent/scripts/__tests__/versionEvidence.test.cjs`: drift reports every differing source and file; ambiguous headers return `version-ambiguous`; no authoritative field designated means stop and report every detected value, never a silent choice (FR-004, R-07). -- [ ] T016 [P] [US1] Write failing Jest tests for blockers in `agents/release-agent/scripts/__tests__/blockers.test.cjs`: `dirty-tree`, `unsafe-path`, `tag-conflict`, `missing-check`, and that no staging, stashing, tagging, push or remote call occurs on any blocker (FR-005, FR-006). +- [ ] T016 [P] [US1] Write failing Jest tests for blockers in `agents/release-agent/scripts/__tests__/blockers.test.cjs`: `dirty-tree`, `unsafe-path`, `tag-conflict`, `missing-check`, and that no staging, stashing, tagging, push or remote call occurs on any blocker (FR-005, FR-006). Include a target that names no required checks, which must yield `missing-check` (FR-005). - [ ] T017 [P] [US1] Write failing Jest tests for dry run in `agents/release-agent/scripts/__tests__/dryRun.test.cjs`: filesystem hash and git state identical before and after, `writes` equals `0`, and the working directory differs from `repoRoot` (FR-001, FR-002, SC-001, SC-002). - [ ] T018 [P] [US1] Write failing Jest tests for preparation edits in `agents/release-agent/scripts/__tests__/prepareEdit.test.cjs`: edits run only with a matching approval digest (FR-029) and only on allowlisted version-field paths; a mismatching or missing digest writes nothing (SC-011), a part-way failure restores the repository, and a failed edit is never reported ready (FR-007, SC-004). Include the existing `updateAllVersions` partial-write behaviour (finding A-6); atomicity is tested, not assumed. - [ ] T019 [P] [US1] Write Bats cases in `agents/release-agent/tests/release-readiness.bats` that run the agent entry point from a different working directory against each fixture and assert exit status and zero writes. @@ -79,7 +79,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. - [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. -- [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. +- [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. Read the required checks from the target's own instructions or CI configuration and block with `missing-check` when none are named or one cannot run (FR-005). - [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Depends on T017, T020, T021, T022. - [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval digest required and rechecked immediately before writing (FR-029), backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. - [ ] T025 [US1] Emit the readiness report defined in `.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md` (fields `status`, `repoRoot`, `componentType`, `versionSources[]`, `findings[]`, `writes`) from `agents/release-agent/scripts/readiness.operation.cjs`. Depends on T023. From 3ef65c7b71a592221c9bdb964782fbc54caed351 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:24:29 +0000 Subject: [PATCH 11/24] docs: release-agents - Record spec 020 enhancement detection clarification Recognise an enhancement only when the target's own instructions declare it and name its version fields, otherwise stop as component-unknown. Update FR-003, an edge case, the data model, readiness contract, tasks and quickstart, and add research R-16. Completes the clarification session. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/readiness-report.md | 2 +- .../020-portable-changelog-release-agents/data-model.md | 2 +- .../020-portable-changelog-release-agents/quickstart.md | 1 + .../specs/020-portable-changelog-release-agents/research.md | 6 ++++++ .github/specs/020-portable-changelog-release-agents/spec.md | 4 +++- .../specs/020-portable-changelog-release-agents/tasks.md | 6 +++--- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md index b55fb6383b..0ec167b13d 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md @@ -32,7 +32,7 @@ The readiness operation is read-only. Producing this report must not write files | `unsafe-path` | A path escapes `repoRoot` or is absolute where relative is required. | | `missing-check` | A required check named in the target's own instructions or CI configuration could not run, or none are named so nothing can be verified. It is never skipped silently. | | `tag-conflict` | Local and remote tag evidence disagree, or the target tag exists. | -| `component-unknown` | No plugin, theme or enhancement could be identified. | +| `component-unknown` | No plugin or theme could be identified, or the repository looks like an enhancement but its own instructions do not declare it and name its version fields. | | `changelog-unverified` | Handoff verification is missing, failed or not received. | `status` is `ready` only when no `blocker` finding exists. diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 69e3434355..49dd0c19c0 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -9,7 +9,7 @@ Entities are conceptual. They describe what each agent must know and the states | Field | Meaning | |-------|---------| | `repoRoot` | Explicit absolute path supplied by the caller. Never defaulted from the process working directory. | -| `componentType` | `plugin`, `theme`, `enhancement` or `unknown`. `unknown` is a stop, not a guess. | +| `componentType` | `plugin`, `theme`, `enhancement` or `unknown`. `unknown` is a stop, not a guess. An enhancement is recognised only when the target's own instructions declare it and name its version fields. | | `instructionsFound` | Whether the target's own instructions name authoritative version fields. | **Rules**: an ordinary repository that merely contains `.github/`, `package.json` and `VERSION` is not a governance repository (FR-003). Detection must never require `VERSION`. diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index 436cc2e1a9..80a30cfb3b 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -27,6 +27,7 @@ This guide describes how a reviewer proves the specification and, later, the imp | Drift or ambiguity | `not-ready` with `version-drift` or `version-ambiguous`, sources named. | | Dirty tree, unsafe path, tag conflict | `not-ready` with the matching blocker; nothing staged or stashed. | | Target names no required checks | `not-ready` with `missing-check`. | +| Enhancement whose instructions do not declare it | `not-ready` with `component-unknown`. | | Interrupted approved edit | Repository recoverable; not reported ready. | | Approval digest does not match the edit about to be applied | Zero files written; mismatch reported. | diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 1535fd7d7f..b43168d59b 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -100,6 +100,12 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Rationale**: stays fail-closed without imposing one check list on every repository, consistent with deriving version sources from the target's own instructions (R-07). - **Alternatives**: treating "none named" as a note, and a fixed built-in set, were rejected as weaker or too prescriptive. +### R-16 Enhancements are recognised only from the target's own declaration + +- **Decision** (clarify session 2026-10-09, option C): an enhancement is recognised only when the target's own instructions declare it and name its version fields; otherwise the agent stops as `component-unknown`. +- **Rationale**: no verified sample of enhancement packaging exists and access to one pilot repository was previously denied, so the agent does not guess; consistent with R-07 and R-15. +- **Alternatives**: treating an enhancement as a plugin by header, and detecting only plugins and themes in the MVP, were rejected as guessing or as dropping a stated target. + ### R-12 Preparation path forbids remote and tag effects - **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index c28154b8db..0c6bfc315f 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -39,6 +39,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Q: When a changelog agent is copied into another repository, where should it find the shared changelog checker it validates with? → A: Option B - always use a bundled copy pinned to a recorded version, and report that version in every result. - Q: When the other agent gives no answer to a verification request, how long should the release agent wait before counting it as not received? → A: Option A - not received means no response was returned within the same invocation; there is no timer. - Q: What counts as the required checks that must be present before the release agent reports a repository ready? → A: Option A - the checks named in the target repository's own instructions or CI configuration; if none are named, readiness is not ready with `missing-check`, because nothing can be verified. +- Q: How should the release agent recognise a repository as an enhancement rather than a plugin or theme? → A: Option C - only when the target's own instructions declare it and name its version fields; otherwise it stops as `component-unknown`. ## Release Process Contract (guidance, not execution permission) @@ -152,6 +153,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - The proposed edit changes between the digest being shown and the write (for example a hand edit to a version file or the changelog): the digests no longer match and the agent writes nothing. - The changelog agent returns no verification response within the same invocation: the release agent treats it as not received and reports not ready with `changelog-unverified`. - A target repository names no required checks in its instructions or CI configuration: readiness reports not ready with `missing-check` rather than assuming success. +- A repository looks like an enhancement but its instructions do not declare it: the agent stops as `component-unknown` rather than guessing its packaging. - Spec directory number 019 is reserved on an unmerged branch and must not be allocated. ## Requirements *(mandatory)* @@ -162,7 +164,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-001**: The release agent MUST operate in readiness (dry-run) mode by default and MUST NOT write files or change git state in that mode. - **FR-002**: An explicit repository root MUST be propagated to every filesystem and git operation, independent of the process working directory. -- **FR-003**: The agent MUST detect plugin, theme and enhancement targets without requiring an optional `VERSION` file, and MUST NOT classify a repository as governance merely because it contains `.github`, `package.json` and `VERSION`. +- **FR-003**: The agent MUST detect plugin, theme and enhancement targets without requiring an optional `VERSION` file, and MUST NOT classify a repository as governance merely because it contains `.github`, `package.json` and `VERSION`. An enhancement is recognised only when the target's own instructions declare it and name its version fields; otherwise the agent MUST stop as `component-unknown`. - **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. - **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. Required checks are those named in the target repository's own instructions or CI configuration; if none are named the agent MUST report not ready with `missing-check`, because nothing can be verified. - **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index cf9a9ce7aa..66cfc2f017 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -67,8 +67,8 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Fixtures and tests for User Story 1 -- [ ] T013 [P] [US1] Create fixture repositories under `agents/release-agent/tests/fixtures/`: `plugin/`, `theme/`, `enhancement/`, `ordinary-github-target/` (has `.github/`, `package.json`, `VERSION`), `optional-version/` (no `VERSION`), `ambiguous-headers/`, `drift/`, `repeat-run/`, `invalid-paths/`, `tag-conflict/`. No fake placeholder content beyond what each case needs. -- [ ] T014 [P] [US1] Write failing Jest tests for detection in `agents/release-agent/scripts/__tests__/detect.test.cjs`: plugin, theme, enhancement, no `VERSION`, and the ordinary `.github` target not classified as governance (FR-003). +- [ ] T013 [P] [US1] Create fixture repositories under `agents/release-agent/tests/fixtures/`: `plugin/`, `theme/`, `enhancement/`, `ordinary-github-target/` (has `.github/`, `package.json`, `VERSION`), `optional-version/` (no `VERSION`), `ambiguous-headers/`, `drift/`, `repeat-run/`, `invalid-paths/`, `tag-conflict/`. No fake placeholder content beyond what each case needs. The `enhancement/` fixture includes an instructions file that declares it and names its version fields, and an `enhancement-undeclared/` fixture that does not (FR-003). +- [ ] T014 [P] [US1] Write failing Jest tests for detection in `agents/release-agent/scripts/__tests__/detect.test.cjs`: plugin, theme, enhancement, no `VERSION`, and the ordinary `.github` target not classified as governance (FR-003). An enhancement is recognised only when its own instructions declare it; the undeclared fixture yields `component-unknown` (FR-003). - [ ] T015 [P] [US1] Write failing Jest tests for version evidence in `agents/release-agent/scripts/__tests__/versionEvidence.test.cjs`: drift reports every differing source and file; ambiguous headers return `version-ambiguous`; no authoritative field designated means stop and report every detected value, never a silent choice (FR-004, R-07). - [ ] T016 [P] [US1] Write failing Jest tests for blockers in `agents/release-agent/scripts/__tests__/blockers.test.cjs`: `dirty-tree`, `unsafe-path`, `tag-conflict`, `missing-check`, and that no staging, stashing, tagging, push or remote call occurs on any blocker (FR-005, FR-006). Include a target that names no required checks, which must yield `missing-check` (FR-005). - [ ] T017 [P] [US1] Write failing Jest tests for dry run in `agents/release-agent/scripts/__tests__/dryRun.test.cjs`: filesystem hash and git state identical before and after, `writes` equals `0`, and the working directory differs from `repoRoot` (FR-001, FR-002, SC-001, SC-002). @@ -77,7 +77,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Implementation for User Story 1 -- [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. +- [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. Recognise an enhancement only from a declaration in the target's own instructions (FR-003). - [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. - [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. Read the required checks from the target's own instructions or CI configuration and block with `missing-check` when none are named or one cannot run (FR-005). - [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Depends on T017, T020, T021, T022. From eab3ce84e7f76cea5532b5aad39a6f0128d93da5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:30:54 +0000 Subject: [PATCH 12/24] docs: release-agents - Address spec 020 review findings Add the missing-check blocker to the readiness predicate, keep the R1 quickstart rows fail-closed until the handoff verifies, separate the canonical engine from the bundled pinned copy and name its location, and replace the timed-out case with the defined no-response case. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../020-portable-changelog-release-agents/data-model.md | 2 +- .github/specs/020-portable-changelog-release-agents/plan.md | 6 +++++- .../020-portable-changelog-release-agents/quickstart.md | 4 ++-- .github/specs/020-portable-changelog-release-agents/spec.md | 2 +- .../specs/020-portable-changelog-release-agents/tasks.md | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 49dd0c19c0..2d3225a623 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -33,7 +33,7 @@ See [contracts/readiness-report.md](./contracts/readiness-report.md). States: not-run -> ready | not-ready ``` -`ready` requires: component detected, no drift, no ambiguity, clean tree, safe paths, no conflicting tag evidence, and (when the handoff is in play) recorded changelog verification success. +`ready` requires: component detected, no drift, no ambiguity, clean tree, safe paths, no conflicting tag evidence, no `missing-check` blocker, and (when the handoff is in play) recorded changelog verification success. ## Preparation edit diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index e9428eacad..eaf6d8241c 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -127,12 +127,16 @@ agents/changelog-agent/ ├── CHANGELOG.md ├── package.json ├── scripts/ +│ ├── engineResolver.cjs # always loads the bundled engine and reports its version +│ ├── refreshEngine.cjs # copies the canonical engine into vendor/ and rewrites the pin │ └── __tests__/ +├── vendor/changelog-validation/ # generated pinned copy of the engine, plus engine.pin.json (version, source commit) ├── skills//SKILL.md # five-operation shared-skill obligations preserved ├── claude/ └── tests/ -.github/validation/changelog/ # shipped engine: reused, not copied or forked +.github/validation/changelog/ # canonical engine source: reused, never forked or edited by the agent; the + # bundled copy above is generated from it and pinned (research R-05) ``` **Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent, no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. Whether the adapter lands as one module or two reviewed slices is open decision 3 (research R-06). diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index 80a30cfb3b..058754ea8a 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -21,8 +21,8 @@ This guide describes how a reviewer proves the specification and, later, the imp | Scenario | Expected | |----------|----------| -| Consistent plugin, working directory elsewhere | `ready`; operations applied to the requested root; zero writes. | -| Theme with no `VERSION` file | Detected and `ready` using authoritative fields. | +| Consistent plugin, working directory elsewhere | Readiness checks pass with no blocker other than `changelog-unverified`; operations applied to the requested root; zero writes. Overall `ready` only after the US3 handoff records verification success; until then `not-ready` with `changelog-unverified`. | +| Theme with no `VERSION` file | Detected, and readiness checks pass using authoritative fields; overall `ready` follows the same US3 rule. | | Ordinary repo with `.github`, `package.json`, `VERSION` | Not classified as governance. | | Drift or ambiguity | `not-ready` with `version-drift` or `version-ambiguous`, sources named. | | Dirty tree, unsafe path, tag conflict | `not-ready` with the matching blocker; nothing staged or stashed. | diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 0c6bfc315f..c030862622 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -98,7 +98,7 @@ When release preparation reaches the changelog step, the release agent explicitl **Why this priority**: Without a fail-closed handoff, preparation could be reported ready while the changelog is unverified. This is the integration point that makes the two MVPs one safe flow. Sequencing: this story depends on the changelog verification operation delivered by User Story 2, so it is built after US2 even though its safety value ranks it P1. -**Independent Test**: Simulate success, failure, missing and timed-out verification responses and confirm the release agent reports ready only on recorded success. +**Independent Test**: Simulate success, failure, and no response within the same invocation; confirm the release agent reports ready only on recorded success. **Acceptance Scenarios**: diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 66cfc2f017..9c537cc64f 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -106,7 +106,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Implementation for User Story 2 - [ ] T032 [US2] Read issue [#2653](https://github.com/lightspeedwp/.github/issues/2653) body and comments and list the five-operation shared-skill obligations it carries, then record them as the acceptance list in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (FR-013). Not inferred from the title. -- [ ] T033 [US2] Bundle a copy of the shipped validation engine inside `agents/changelog-agent/` pinned to a recorded version and source commit (research R-05, option B), with a refresh script that copies it from `.github/validation/changelog/` and rewrites the pin, and implement `agents/changelog-agent/scripts/engineResolver.cjs` so it always loads the bundled copy and reports the engine version in every result (FR-010, SC-012). Add a Jest check that fails when the bundled copy no longer matches its recorded pin. Depends on T030. +- [ ] T033 [US2] Bundle a copy of the shipped validation engine at `agents/changelog-agent/vendor/changelog-validation/` with `engine.pin.json` recording its version and source commit (research R-05, option B), add `agents/changelog-agent/scripts/refreshEngine.cjs` that copies it from `.github/validation/changelog/` and rewrites the pin, and implement `agents/changelog-agent/scripts/engineResolver.cjs` so it always loads the bundled copy and reports the engine version in every result (FR-010, SC-012). Add a Jest check that fails when the bundled copy no longer matches its recorded pin. Depends on T030. - [ ] T034 [US2] Replace or wrap the duplicate validator modules in `agents/changelog-agent/includes/` (finding A-7) so validation goes through the shipped engine; remove nothing until its callers are inventoried. Depends on T033. - [ ] T035 [US2] Implement the inspect, draft and validate operations in `agents/changelog-agent/scripts/changelog.operations.cjs` with the six allowed categories, historic preservation and idempotent Unreleased handling (FR-011). Depends on T028, T034. - [ ] T036 [US2] Implement the approved bounded apply operation in `agents/changelog-agent/scripts/apply.operation.cjs`: move Unreleased entries into a versioned section only, keep historic entries and links byte-identical, refuse if the file changed since the draft (research R-08: only this agent edits `CHANGELOG.md`). Depends on T029, T035. From 648386d7ed2e55e864770277dace8f87795c74c4 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2026 19:34:49 +0000 Subject: [PATCH 13/24] docs: release-agents - Remove spec 020 from the specification catalogue --- .github/specs/CATALOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/specs/CATALOG.md b/.github/specs/CATALOG.md index cd8af09a1a..f1af55fd7d 100644 --- a/.github/specs/CATALOG.md +++ b/.github/specs/CATALOG.md @@ -59,7 +59,6 @@ All specification catalog entries MUST follow this exact column order and naming | 014 | agents-restructure-consolidate | Agent Structure Standardization & Skill Consolidation | Draft | 2026-09-18 | [./014-agents-restructure-consolidate/spec.md](./014-agents-restructure-consolidate/spec.md) | | 015 | pr-agent-consolidation | PR Agent Consolidation & Portability | Draft | 2026-09-18 | [./015-pr-agent-consolidation/spec.md](./015-pr-agent-consolidation/spec.md) | | 016 | changelog-agent-quality | Changelog Agent Quality & Validation Framework | Draft | 2026-09-18 | [./016-changelog-agent-quality/spec.md](./016-changelog-agent-quality/spec.md) | -| 020 | portable-changelog-release-agents | Portable Changelog and WordPress Release Preparation Agents | Draft | 2026-10-09 | [./020-portable-changelog-release-agents/spec.md](./020-portable-changelog-release-agents/spec.md) | --- From 1656078bc47a84fcd0e3b8dff1edaade17d9eedf Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 19:35:26 +0000 Subject: [PATCH 14/24] docs: release-agents - Restore spec 020 catalogue entry Restore the Draft catalogue row removed by the autofix commit. Removing it does not clear the numbering audit, because the 020 directory itself leaves the 019 gap, and it leaves the specification uncatalogued. The 019 gap is for the maintainer to resolve. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .github/specs/CATALOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/specs/CATALOG.md b/.github/specs/CATALOG.md index f1af55fd7d..cd8af09a1a 100644 --- a/.github/specs/CATALOG.md +++ b/.github/specs/CATALOG.md @@ -59,6 +59,7 @@ All specification catalog entries MUST follow this exact column order and naming | 014 | agents-restructure-consolidate | Agent Structure Standardization & Skill Consolidation | Draft | 2026-09-18 | [./014-agents-restructure-consolidate/spec.md](./014-agents-restructure-consolidate/spec.md) | | 015 | pr-agent-consolidation | PR Agent Consolidation & Portability | Draft | 2026-09-18 | [./015-pr-agent-consolidation/spec.md](./015-pr-agent-consolidation/spec.md) | | 016 | changelog-agent-quality | Changelog Agent Quality & Validation Framework | Draft | 2026-09-18 | [./016-changelog-agent-quality/spec.md](./016-changelog-agent-quality/spec.md) | +| 020 | portable-changelog-release-agents | Portable Changelog and WordPress Release Preparation Agents | Draft | 2026-10-09 | [./020-portable-changelog-release-agents/spec.md](./020-portable-changelog-release-agents/spec.md) | --- From ec6a25ed9cf41c5e1bd12cda2e1601b6d0e974c2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 02:00:22 +0000 Subject: [PATCH 15/24] docs: release-agents - Record applied issue-map previews Mark A1 to A7 and A10 as applied on 2026-10-10, A8 as needing no change, and A9 and A11 as still open decisions. Note that the release agent already exists at agents/release-agent/ on develop and is extended in place, and that #1563's body still names the obsolete agents/release/ path. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../issue-map.md | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/issue-map.md b/.github/specs/020-portable-changelog-release-agents/issue-map.md index 41041036b2..3e7815a0a1 100644 --- a/.github/specs/020-portable-changelog-release-agents/issue-map.md +++ b/.github/specs/020-portable-changelog-release-agents/issue-map.md @@ -2,7 +2,7 @@ **Spec**: [spec.md](./spec.md) | **Plan**: [plan.md](./plan.md) | **Delivery plan**: [delivery-plan.md](./delivery-plan.md) -**Read on**: 2026-10-09 from GitHub (`lightspeedwp/.github`) and Linear. Records were read by this session and by a read-only research agent. Nothing in this file has been applied: no GitHub or Linear record, title, body, label, native issue type, parent or assignee was changed. Every proposal needs the separate approval described in [Approval preview](#approval-preview). +**Read on**: 2026-10-09 from GitHub (`lightspeedwp/.github`) and Linear. Records were read by this session and by a read-only research agent. **Updated 2026-10-10**: the maintainer approved the previews A1 to A11. A1 to A7 and A10 were applied; A8 needed no change; A9 and A11 were not applied because they are decisions with no outcome chosen (see [Approval preview](#approval-preview)). The "Current labels" and "Native type" columns below show values as read on 2026-10-09, before the applied changes; the preview table records what changed. No issue was closed, reopened, reparented or reassigned. Linear is the planning system of record. Where GitHub and Linear disagree, both are shown and the disagreement is listed in [Gaps and mismatches](#gaps-and-mismatches). @@ -28,7 +28,7 @@ Linear is the planning system of record. Where GitHub and Linear disagree, both | GitHub | Linear | Native type | Current labels (prefixed) | State | Proposed bounded role | Proposed delta | Delivery slice | Story / FR / path | |--------|--------|-------------|---------------------------|-------|-----------------------|----------------|----------------|-------------------| -| [#1563](https://github.com/lightspeedwp/.github/issues/1563) | [GIT-1310](https://linear.app/lightspeedwp/issue/GIT-1310/aiops-release-agent-build-portable-agent) "Build portable agent", In Progress, Ash Shaw, no parent | Documentation | `area:automation`, `area:release`, `priority:normal`, `status:ready`, `status:needs-triage`; no `type:` label | Open (reopened 2026-09-23); no GitHub parent | Release preparation MVP, priority 1 | Title: `aiops: release-agent - Deliver portable preparation MVP`; correct obsolete `agents/release/` to `agents/release-agent/` in the preview; add `type:aiops`; native type to AI Ops. | R1 | US1, US3, US4, FR-001 to FR-008, FR-014 to FR-022; `agents/release-agent/` | +| [#1563](https://github.com/lightspeedwp/.github/issues/1563) | [GIT-1310](https://linear.app/lightspeedwp/issue/GIT-1310/aiops-release-agent-build-portable-agent) "Build portable agent", In Progress, Ash Shaw, no parent | Documentation | `area:automation`, `area:release`, `priority:normal`, `status:ready`, `status:needs-triage`; no `type:` label | Open (reopened 2026-09-23); no GitHub parent | Release preparation MVP, priority 1 | Title: `aiops: release-agent - Deliver portable preparation MVP`; correct obsolete `agents/release/` to `agents/release-agent/` in the preview; add `type:aiops`; native type to AI Ops. | R1 | US1, US3, US4, FR-001 to FR-008, FR-014 to FR-022; `agents/release-agent/` (see [Release agent location](#release-agent-location)) | | [#2653](https://github.com/lightspeedwp/.github/issues/2653) | [GIT-1744](https://linear.app/lightspeedwp/issue/GIT-1744/aiops-changelog-automation-create-portable-shared-skill) "Create portable shared skill", Todo, Chris, no parent | Task | `type:aiops`, `area:automation`, `priority:high`, `status:needs-triage` | Open; GitHub assignees eleshar and ashleyshaw | Standalone changelog MVP, priority 2 | Title: `aiops: changelog-agent - Deliver portable changelog MVP`; preserve the five-operation shared-skill obligations (FR-013). | C2 | US2, US3, FR-009 to FR-015; `agents/changelog-agent/` | | [#1565](https://github.com/lightspeedwp/.github/issues/1565) | [GIT-1312](https://linear.app/lightspeedwp/issue/GIT-1312/automation-wordpress-plugins-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Plugin version adapter acceptance, traced to R1 | Trace to reused utilities, not a second implementation. Optional separate slice only if independently reviewable. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | | [#1566](https://github.com/lightspeedwp/.github/issues/1566) | [GIT-1313](https://linear.app/lightspeedwp/issue/GIT-1313/automation-wordpress-themes-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Theme version adapter acceptance, traced to R1 | As #1565, with theme fixtures. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | @@ -46,6 +46,10 @@ Linear is the planning system of record. Where GitHub and Linear disagree, both | [#1560](https://github.com/lightspeedwp/.github/issues/1560) | [GIT-1307](https://linear.app/lightspeedwp/issue/GIT-1307/automation-release-workflow-update-workflow-configuration) Todo | Security | Open | Portable release workflow validation (deferred) | Review the archived workflow and its tests first; automation classification to be confirmed. | WFLOW (later) | | [#1562](https://github.com/lightspeedwp/.github/issues/1562) | [GIT-1309](https://linear.app/lightspeedwp/issue/GIT-1309/automation-release-workflow-create-rollback-automation) Todo | Security | Open | Rollback automation (deferred) | Bounded rollback outcome after the workflow contract. | ROLLBACK (later) | +### Release agent location + +The release agent already exists on `develop` at [`agents/release-agent/`](https://github.com/lightspeedwp/.github/tree/develop/agents/release-agent). Spec 020 extends and hardens that package in place; it does not rebuild it. Issue [#1563](https://github.com/lightspeedwp/.github/issues/1563) still describes the path as `agents/release/` in its body, which is obsolete. That body correction was not one of the approved previews and has not been made. + **Historical, no reopening by default**: [#1559](https://github.com/lightspeedwp/.github/issues/1559) (closed completed, PR 1637), [#1561](https://github.com/lightspeedwp/.github/issues/1561) (closed completed, PR 1658), [#1567](https://github.com/lightspeedwp/.github/issues/1567) (closed completed, PR 2272). [#1564](https://github.com/lightspeedwp/.github/issues/1564) is closed `not_planned` and superseded; it is not active changelog delivery. **Existing PRs**: PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) is open, not a draft, mergeable state `blocked`, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, base `develop`, 27 files (+111, -406), body `Closes #3880`. Merged PR [#3820](https://github.com/lightspeedwp/.github/pull/3820) delivered the changelog spec, skill and index alignment and is reused. PR [#2655](https://github.com/lightspeedwp/.github/pull/2655) is closed unmerged and is not delivery proof. The spec PR for this work is [#3883](https://github.com/lightspeedwp/.github/pull/3883). @@ -74,20 +78,22 @@ These are links, not spec 020 tasks, and are not reparented. Linear children of ## Approval preview -**Nothing below is applied.** Approval for the spec PR does not imply approval for any of these. Each line is an exact, independently approvable change; approving one does not approve the others. Native issue type, `type:*` label, parent and assignee are listed separately because they are separate fields. - -| ID | Target | Field | Current | Proposed | -|----|--------|-------|---------|----------| -| A1 | GitHub #1555 | Title | `aiops: release-agent - Specify portable multi-repo support` | `docs: release-agents - Specify portable changelog and release agents` | -| A2 | GitHub #1555 | Native type, label | AI Ops, `type:aiops` | Documentation, `type:docs` (only after independent checks) | -| A3 | GitHub #1563 | Title | `aiops: release-agent - Build portable agent` | `aiops: release-agent - Deliver portable preparation MVP` | -| A4 | GitHub #1563 | Native type, label | Documentation, no `type:` label | AI Ops, `type:aiops` | -| A5 | GitHub #2653 | Title | `aiops: changelog-automation - Create portable shared skill` | `aiops: changelog-agent - Deliver portable changelog MVP` | -| A6 | GitHub #3470 | Title | `task: resolve spec 016 changelog-agent design findings` | `docs: changelog-agent - Document specification decisions` | -| A7 | GitHub #1558 | Title | `docs: release-process - Plan documentation reorganisation` | `docs: portable-agents - Restructure and complete guidance` | -| A8 | GitHub #1546 | Body | Current epic body | Remove stale completion or deadline claims; keep Linear link | -| A9 | Linear GIT-1310, GIT-1744, GIT-2623 | Parent | none | Decision needed: GIT-1293 or leave as is | -| A10 | Linear GIT-1302, GIT-1310, GIT-1744 | Title | Linear titles as above | Match the GitHub titles after A1, A3 and A5 | -| A11 | Linear LS-4233 versus GIT-2306 | Disposition | Two records for #3468 | Decision needed: merge, link or keep both | - -No issue is closed, reopened, reparented or reassigned by this map. Replacement issues are not proposed because existing records fit every role. +**Status as of 2026-10-10.** The maintainer approved A1 to A11. Each line below records what was done. Approval of the spec PR did not imply approval of any of these, and each line was approved independently. Native issue type, `type:*` label, parent and assignee are listed separately because they are separate fields. + +| ID | Target | Field | Current | Proposed | Status | +|----|--------|-------|---------|----------|--------| +| A1 | GitHub #1555 | Title | `aiops: release-agent - Specify portable multi-repo support` | `docs: release-agents - Specify portable changelog and release agents` | Applied 2026-10-10 | +| A2 | GitHub #1555 | Native type, label | AI Ops, `type:aiops` | Documentation, `type:docs` (only after independent checks) | Applied 2026-10-10: native type Documentation, label `type:docs`; other labels kept | +| A3 | GitHub #1563 | Title | `aiops: release-agent - Build portable agent` | `aiops: release-agent - Deliver portable preparation MVP` | Applied 2026-10-10 | +| A4 | GitHub #1563 | Native type, label | Documentation, no `type:` label | AI Ops, `type:aiops` | Applied 2026-10-10: native type AI Ops, `type:aiops` added; other labels kept | +| A5 | GitHub #2653 | Title | `aiops: changelog-automation - Create portable shared skill` | `aiops: changelog-agent - Deliver portable changelog MVP` | Applied 2026-10-10 | +| A6 | GitHub #3470 | Title | `task: resolve spec 016 changelog-agent design findings` | `docs: changelog-agent - Document specification decisions` | Applied 2026-10-10 | +| A7 | GitHub #1558 | Title | `docs: release-process - Plan documentation reorganisation` | `docs: portable-agents - Restructure and complete guidance` | Applied 2026-10-10 | +| A8 | GitHub #1546 | Body | Current epic body | Remove stale completion or deadline claims; keep Linear link | No change needed: the epic body already states its earlier phase status and "no blockers" claims are historical and carries no stale completion or deadline claims | +| A9 | Linear GIT-1310, GIT-1744, GIT-2623 | Parent | none | Decision needed: GIT-1293 or leave as is | Not applied: no outcome chosen; needs a decision | +| A10 | Linear GIT-1302, GIT-1310, GIT-1744 | Title | Linear titles as above | Match the GitHub titles after A1, A3 and A5 | Applied 2026-10-10 for GIT-1302, GIT-1310 and GIT-1744. Linear also received the new `type:docs` and `type:aiops` labels from GitHub on its own | +| A11 | Linear LS-4233 versus GIT-2306 | Disposition | Two records for #3468 | Decision needed: merge, link or keep both | Not applied: no outcome chosen (merge, link or keep both); needs a decision | + +No issue was closed, reopened, reparented or reassigned. Replacement issues are not proposed because existing records fit every role. + +**Still open**: A9 (whether GIT-1310, GIT-1744 and GIT-2623 are linked under GIT-1293) and A11 (the disposition of LS-4233 against GIT-2306). Neither is applied until the maintainer chooses an outcome. From d1989b4f7bcc7175a0eee9477b57f1978d210f45 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 02:04:48 +0000 Subject: [PATCH 16/24] docs: release-agents - Record spec 020 numbering decision Record the maintainer decision of 2026-10-10 that this specification keeps number 020 and does not take 019, in the spec assumptions and research R-11. The audit gap is still cleared only by merging 019 or approving an audit change, which remains open. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .github/specs/020-portable-changelog-release-agents/research.md | 2 +- .github/specs/020-portable-changelog-release-agents/spec.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index b43168d59b..41ca629820 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -80,7 +80,7 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 ### R-11 Spec numbering gap blocks the spec PR check - **Finding**: `.specify/scripts/bash/audit-specs.sh` fails on gaps; 019 is reserved on an unmerged branch. -- **Decision**: owner-decided. Either merge the 019 spec first, or approve a separate change allowing reserved numbers. Neither is performed by this plan. +- **Decision (2026-10-10)**: the maintainer decided this specification keeps number 020 and does not take 019, so renumbering is not an option. The failing audit is therefore cleared only by the maintainer either merging the 019 Qodo spec first or approving a separate change that lets the audit script accept reserved numbers. Neither is performed by this plan, and the choice between them is still open. ### R-13 Approval is a digest of the exact proposed edit diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index c030862622..18aac396fc 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -239,7 +239,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue ## Assumptions -- Feature number 020 is correct: 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. +- Feature number 020 is final. Maintainer decision 2026-10-10: this specification keeps number 020 and does not take 019. Number 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. - Existing work is reused: the in-flight consolidation (issue 3880 / PR 3881, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, open and blocked, not merged), merged PR 3820, and spec 016 with the shipped `.github/validation/changelog/` engine. - Default delivery is S independent, existing consolidation finished, then release MVP and changelog MVP branched from refreshed develop; stacking the release MVP on PR 3881 happens only if it needs layout available exclusively there, and never on the Qodo reservation. - Pilot repositories, installer behaviour, marketplace distribution, workflow restoration and rollback are later work owned by existing issues; no pilot architecture or code transfer is decided here. From 7258d7dd27b4331b9019debdc7a07cd141fde4f8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 05:04:23 +0000 Subject: [PATCH 17/24] docs: release-agents - Record spec 020 version-source clarification With no designated version field the release agent stops as ambiguous and lists every version found; no fallback order exists. Update FR-004, the open decisions, research R-07, T003 and the plan constitution row, and open a 2026-10-10 clarification session. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../020-portable-changelog-release-agents/plan.md | 2 +- .../020-portable-changelog-release-agents/research.md | 10 +++++----- .../020-portable-changelog-release-agents/spec.md | 8 ++++++-- .../020-portable-changelog-release-agents/tasks.md | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index eaf6d8241c..41b7a8b392 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -72,7 +72,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI | IV Technology-agnostic guidance | Pass with note. WordPress-specific behaviour lives in the release adapter and agent docs, not in central guidance. | | V and VIII Branch naming | Pass. `docs/portable-changelog-release-agents`; later slices use `aiops/` per the delivery profiles. | | VI UK English, accessibility, security | Pass. Path-safety and no-secrets requirements are explicit (FR-006, FR-019). | -| VII Specification quality | Pass for the spec checklist; three open decisions remain and are carried into research as provisional, not closed. | +| VII Specification quality | Pass for the spec checklist; two open decisions remain and are carried into research as provisional, not closed. | | IX Changelog compliance | Pass. Entries must stay within the length rule and link to PRs/issues; the agent validates using the shipped engine. | | X Metrics-driven governance | Pass. No new dashboards; reuses existing validation output. | diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 41ca629820..f3f128df50 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -54,11 +54,11 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Provisional recommendation**: one coherent adapter module with both acceptance mappings (#1565 plugin, #1566 theme), splitting only if independently reviewable. - **Status**: provisional; owner confirmation required. -### R-07 Authoritative version source when instructions are silent (open decision 1) +### R-07 Authoritative version source when instructions are silent -- **Provisional recommendation**: when a target's own instructions do not name an authoritative field, the agent refuses to choose, reports every detected value and source, and stops as ambiguous (FR-004). No default hierarchy is invented. -- **Rationale**: the first draft of the spec invented a hierarchy; the brief says to derive sources from target instructions. -- **Status**: provisional; owner confirmation required. +- **Decision** (clarify session 2026-10-10, option A): when a target's own instructions do not name an authoritative field, the agent refuses to choose, reports every detected value and source, and stops as ambiguous (FR-004). No default hierarchy exists, and the allowed edit set is empty in that case. +- **Rationale**: a wrong guess could stamp the wrong version into a release; the brief says to derive sources from the target's own instructions and fail closed. +- **Alternatives**: a fixed built-in order of preference, and "use the only source if exactly one exists", were rejected as guessing. ### R-08 Who stamps the changelog (open decision 2) @@ -114,6 +114,6 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). 2. Read PR #3881 diff and checks (R-02). -3. Owner confirmation of R-06, R-07, R-08. +3. Owner confirmation of R-06 and R-08. 4. 019 numbering gap resolution (R-11). 5. Approval decisions on the previews in `issue-map.md` (A1 to A11). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 18aac396fc..723f25fc2f 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -41,6 +41,10 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Q: What counts as the required checks that must be present before the release agent reports a repository ready? → A: Option A - the checks named in the target repository's own instructions or CI configuration; if none are named, readiness is not ready with `missing-check`, because nothing can be verified. - Q: How should the release agent recognise a repository as an enhancement rather than a plugin or theme? → A: Option C - only when the target's own instructions declare it and name its version fields; otherwise it stops as `component-unknown`. +### Session 2026-10-10 + +- Q: When a repository's own instructions don't say which version field is authoritative, should the release agent stop and list every version it found, or fall back to a built-in order? → A: Option A - stop as ambiguous and report every version found with its source; no fallback order exists. + ## Release Process Contract (guidance, not execution permission) This section states the contract the agents are built around. It does not authorise any agent to tag, push, publish or deploy; those are outside the executable MVP. @@ -165,7 +169,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-001**: The release agent MUST operate in readiness (dry-run) mode by default and MUST NOT write files or change git state in that mode. - **FR-002**: An explicit repository root MUST be propagated to every filesystem and git operation, independent of the process working directory. - **FR-003**: The agent MUST detect plugin, theme and enhancement targets without requiring an optional `VERSION` file, and MUST NOT classify a repository as governance merely because it contains `.github`, `package.json` and `VERSION`. An enhancement is recognised only when the target's own instructions declare it and name its version fields; otherwise the agent MUST stop as `component-unknown`. -- **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. +- **FR-004**: The agent MUST determine authoritative version sources (plugin header, readme, theme stylesheet, package, `VERSION`) from the target's own instructions, and MUST handle ambiguity and drift deterministically by stopping and naming the conflict rather than choosing silently. No built-in order of preference exists: when no field is designated, or sources disagree, the agent MUST stop as ambiguous and report every version found with its source, and the set of files it may edit is empty. - **FR-005**: The agent MUST stop on a dirty working tree, missing required checks, unsafe paths, or conflicting version or tag evidence. Required checks are those named in the target repository's own instructions or CI configuration; if none are named the agent MUST report not ready with `missing-check`, because nothing can be verified. - **FR-006**: The agent MUST NOT use broad staging, silent gate fallback, automatic stashing, or any remote effect. - **FR-007**: Approved preparation edits (approval as defined in FR-029) MUST be limited to files the target's own instructions designate as version fields (for example the plugin header Version, readme Stable tag, theme stylesheet Version, package version, `VERSION`), and MUST NOT touch `CHANGELOG.md`, workflows or any other file. Before any write the agent MUST capture the original contents of every file it will edit. On any failure it MUST restore all of them and report per-file restored or failed. If restoration fails it MUST report `unrecoverable` naming the files and MUST NOT report ready; a partial version update MUST NOT be presented as ready. Every error MUST state a cause code, the repository-relative path and the next action. @@ -251,6 +255,6 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue These are recorded as decisions for the clarify stage rather than guessed: -1. Which source is authoritative when a target's own instructions are silent on version fields. +1. Resolved 2026-10-10 (option A): when a target's own instructions are silent on version fields, the agent stops as ambiguous and reports every version found; there is no fallback order (FR-004). 2. Whether any release-preparation edit beyond version fields (for example changelog stamping) belongs to the release agent or only to the changelog agent. 3. Whether a plugin/theme adapter ships as one coherent module or two separately reviewed slices. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 9c537cc64f..e41e998179 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -35,7 +35,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. -- [ ] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 (no default version-source hierarchy; stop as ambiguous) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. +- [ ] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. - [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. From 15fc7bff1b3876395c5e1786422d1bd86551e0cc Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 13:25:47 +0000 Subject: [PATCH 18/24] docs: release-agents - Record spec 020 changelog ownership clarification Only the changelog agent edits CHANGELOG.md; the release agent edits version fields only and requests verification through the handoff. Update FR-009, the open decisions, research R-08, T003 and the plan constitution row. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../specs/020-portable-changelog-release-agents/plan.md | 2 +- .../020-portable-changelog-release-agents/research.md | 9 +++++---- .../specs/020-portable-changelog-release-agents/spec.md | 5 +++-- .../specs/020-portable-changelog-release-agents/tasks.md | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index 41b7a8b392..e4f3afa239 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -72,7 +72,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI | IV Technology-agnostic guidance | Pass with note. WordPress-specific behaviour lives in the release adapter and agent docs, not in central guidance. | | V and VIII Branch naming | Pass. `docs/portable-changelog-release-agents`; later slices use `aiops/` per the delivery profiles. | | VI UK English, accessibility, security | Pass. Path-safety and no-secrets requirements are explicit (FR-006, FR-019). | -| VII Specification quality | Pass for the spec checklist; two open decisions remain and are carried into research as provisional, not closed. | +| VII Specification quality | Pass for the spec checklist; one open decision remains (adapter module shape) and is carried into research as provisional, not closed. | | IX Changelog compliance | Pass. Entries must stay within the length rule and link to PRs/issues; the agent validates using the shipped engine. | | X Metrics-driven governance | Pass. No new dashboards; reuses existing validation output. | diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index f3f128df50..abc2dc9379 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -60,10 +60,11 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Rationale**: a wrong guess could stamp the wrong version into a release; the brief says to derive sources from the target's own instructions and fail closed. - **Alternatives**: a fixed built-in order of preference, and "use the only source if exactly one exists", were rejected as guessing. -### R-08 Who stamps the changelog (open decision 2) +### R-08 Who stamps the changelog -- **Provisional recommendation**: only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff. -- **Rationale**: keeps the changelog agent standalone and avoids two writers. **Status**: provisional. +- **Decision** (clarify session 2026-10-10, option A): only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff. +- **Rationale**: one writer for one file keeps the changelog agent standalone and keeps the release agent's edit allowlist limited to version fields, so a half-updated changelog cannot come from two writers. +- **Alternatives**: letting the release agent stamp the changelog, and having it ask the changelog agent to apply a stamp during the handoff, were rejected as widening the release agent's write scope. ### R-09 Handoff mechanism needs no new infrastructure @@ -114,6 +115,6 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). 2. Read PR #3881 diff and checks (R-02). -3. Owner confirmation of R-06 and R-08. +3. Owner confirmation of R-06. 4. 019 numbering gap resolution (R-11). 5. Approval decisions on the previews in `issue-map.md` (A1 to A11). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 723f25fc2f..79dadc3867 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -44,6 +44,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP ### Session 2026-10-10 - Q: When a repository's own instructions don't say which version field is authoritative, should the release agent stop and list every version it found, or fall back to a built-in order? → A: Option A - stop as ambiguous and report every version found with its source; no fallback order exists. +- Q: Should only the changelog agent ever edit `CHANGELOG.md`, with the release agent changing version fields only and asking the changelog agent to verify, or may the release agent also stamp it? → A: Option A - only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff. ## Release Process Contract (guidance, not execution permission) @@ -177,7 +178,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Changelog** -- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. +- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. The changelog agent is the only agent that edits `CHANGELOG.md`; the release agent never does and only requests verification through the handoff (FR-014). - **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. A copied agent package MUST validate with a bundled copy of that engine pinned to a recorded version, and every validation result MUST state the engine version it used. - **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. @@ -256,5 +257,5 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue These are recorded as decisions for the clarify stage rather than guessed: 1. Resolved 2026-10-10 (option A): when a target's own instructions are silent on version fields, the agent stops as ambiguous and reports every version found; there is no fallback order (FR-004). -2. Whether any release-preparation edit beyond version fields (for example changelog stamping) belongs to the release agent or only to the changelog agent. +2. Resolved 2026-10-10 (option A): only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff (FR-007, FR-009). 3. Whether a plugin/theme adapter ships as one coherent module or two separately reviewed slices. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index e41e998179..ef1b067862 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -35,7 +35,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. -- [ ] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices) and R-08 (only the changelog agent edits `CHANGELOG.md`) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. +- [ ] T003 Obtain owner confirmation of the provisional decision R-06 (one adapter module or two slices) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. - [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. From bb2ab8473bdc9275f245f3d3d6c432e3a9eed620 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 10 Oct 2026 13:32:34 +0000 Subject: [PATCH 19/24] docs: release-agents - Record spec 020 adapter shape clarification The plugin and theme version handling ships as one coherent adapter module in a single pull request, mapping both #1565 and #1566. Update FR-016, the open decisions, research R-06, the plan, delivery plan and issue map, mark T003 done, and drop the optional separate adapter branches. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../delivery-plan.md | 2 +- .../issue-map.md | 4 ++-- .../020-portable-changelog-release-agents/plan.md | 4 ++-- .../research.md | 12 ++++++------ .../020-portable-changelog-release-agents/spec.md | 7 ++++--- .../020-portable-changelog-release-agents/tasks.md | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/delivery-plan.md b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md index fe9593e56c..29e57b4680 100644 --- a/.github/specs/020-portable-changelog-release-agents/delivery-plan.md +++ b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md @@ -43,7 +43,7 @@ Preserved from the source brief: delivery priority is release preparation first | WFLOW | [#1560](https://github.com/lightspeedwp/.github/issues/1560) | `automation/release-workflow-portable-validation` | `develop` | `automation: release-workflow - Validate portable release gates` | `pr_aiops.md` | Confirm the primary automation classification and routing before metadata; no incompatible two-type set | To be confirmed | `Ref` | Later scope, not spec 020 implementation; archived workflow reviewed and tested first | | ROLLBACK | [#1562](https://github.com/lightspeedwp/.github/issues/1562) | `automation/release-workflow-safe-rollback` | `develop` | `automation: release-workflow - Add approved rollback safeguards` | `pr_aiops.md` | Confirm automation type, routing and actual release impact | To be confirmed | `Ref` | Later; workflow contract first | -**Optional adapter slices** (only if the plugin and theme adapters are independently reviewable; prefer one coherent R1 adapter with both acceptance mappings): `aiops/release-agent-plugin-version-adapter` titled `aiops: release-agent - Validate plugin version fields` for #1565, and `aiops/release-agent-theme-version-adapter` titled `aiops: release-agent - Validate theme version fields` for #1566, both `pr_aiops.md` with label set A and impact checks. Split to make a unit reviewable, not to create more PRs. +**Adapter shape (decided 2026-10-10)**: the plugin and theme version handling ships as one coherent adapter module inside R1, with both acceptance mappings (#1565 plugin, #1566 theme). The separate adapter branches originally considered (`aiops/release-agent-plugin-version-adapter` and `aiops/release-agent-theme-version-adapter`) are not used. ### Roadmap-only agent slices (not spec 020 tasks) diff --git a/.github/specs/020-portable-changelog-release-agents/issue-map.md b/.github/specs/020-portable-changelog-release-agents/issue-map.md index 3e7815a0a1..81ba3664f3 100644 --- a/.github/specs/020-portable-changelog-release-agents/issue-map.md +++ b/.github/specs/020-portable-changelog-release-agents/issue-map.md @@ -30,8 +30,8 @@ Linear is the planning system of record. Where GitHub and Linear disagree, both |--------|--------|-------------|---------------------------|-------|-----------------------|----------------|----------------|-------------------| | [#1563](https://github.com/lightspeedwp/.github/issues/1563) | [GIT-1310](https://linear.app/lightspeedwp/issue/GIT-1310/aiops-release-agent-build-portable-agent) "Build portable agent", In Progress, Ash Shaw, no parent | Documentation | `area:automation`, `area:release`, `priority:normal`, `status:ready`, `status:needs-triage`; no `type:` label | Open (reopened 2026-09-23); no GitHub parent | Release preparation MVP, priority 1 | Title: `aiops: release-agent - Deliver portable preparation MVP`; correct obsolete `agents/release/` to `agents/release-agent/` in the preview; add `type:aiops`; native type to AI Ops. | R1 | US1, US3, US4, FR-001 to FR-008, FR-014 to FR-022; `agents/release-agent/` (see [Release agent location](#release-agent-location)) | | [#2653](https://github.com/lightspeedwp/.github/issues/2653) | [GIT-1744](https://linear.app/lightspeedwp/issue/GIT-1744/aiops-changelog-automation-create-portable-shared-skill) "Create portable shared skill", Todo, Chris, no parent | Task | `type:aiops`, `area:automation`, `priority:high`, `status:needs-triage` | Open; GitHub assignees eleshar and ashleyshaw | Standalone changelog MVP, priority 2 | Title: `aiops: changelog-agent - Deliver portable changelog MVP`; preserve the five-operation shared-skill obligations (FR-013). | C2 | US2, US3, FR-009 to FR-015; `agents/changelog-agent/` | -| [#1565](https://github.com/lightspeedwp/.github/issues/1565) | [GIT-1312](https://linear.app/lightspeedwp/issue/GIT-1312/automation-wordpress-plugins-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Plugin version adapter acceptance, traced to R1 | Trace to reused utilities, not a second implementation. Optional separate slice only if independently reviewable. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | -| [#1566](https://github.com/lightspeedwp/.github/issues/1566) | [GIT-1313](https://linear.app/lightspeedwp/issue/GIT-1313/automation-wordpress-themes-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Theme version adapter acceptance, traced to R1 | As #1565, with theme fixtures. | R1 (optional adapter slice) | US1, US4, FR-004, FR-016 | +| [#1565](https://github.com/lightspeedwp/.github/issues/1565) | [GIT-1312](https://linear.app/lightspeedwp/issue/GIT-1312/automation-wordpress-plugins-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Plugin version adapter acceptance, traced to R1 | Trace to reused utilities, not a second implementation. Optional separate slice only if independently reviewable. | R1 | US1, US4, FR-004, FR-016 | +| [#1566](https://github.com/lightspeedwp/.github/issues/1566) | [GIT-1313](https://linear.app/lightspeedwp/issue/GIT-1313/automation-wordpress-themes-add-version-handling) Todo, Ash Shaw, parent GIT-1293 | Documentation | `type:automation`, `area:release`, `status:ready` | Open | Theme version adapter acceptance, traced to R1 | As #1565, with theme fixtures. | R1 | US1, US4, FR-004, FR-016 | | [#3880](https://github.com/lightspeedwp/.github/issues/3880) | [GIT-2623](https://linear.app/lightspeedwp/issue/GIT-2623/aiops-release-agents-consolidate-release-and-changelog-agent-guidance) In Review, Zared, no parent | not set | `type:dependency`, `area:instructions`, `priority:normal`, `status:needs-triage` | Open; assignee ZaredRogers | Canonical source migration verification | Reuse the existing work and PR 3881; do not duplicate the migration. | F (existing) | FR-017, FR-018; prerequisite for R1 and C2 | ## Decisions, documentation and later slices diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index e4f3afa239..59c34a07d3 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -72,7 +72,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI | IV Technology-agnostic guidance | Pass with note. WordPress-specific behaviour lives in the release adapter and agent docs, not in central guidance. | | V and VIII Branch naming | Pass. `docs/portable-changelog-release-agents`; later slices use `aiops/` per the delivery profiles. | | VI UK English, accessibility, security | Pass. Path-safety and no-secrets requirements are explicit (FR-006, FR-019). | -| VII Specification quality | Pass for the spec checklist; one open decision remains (adapter module shape) and is carried into research as provisional, not closed. | +| VII Specification quality | Pass for the spec checklist; all three originally open decisions were resolved in clarification sessions (2026-10-09, 2026-10-10). | | IX Changelog compliance | Pass. Entries must stay within the length rule and link to PRs/issues; the agent validates using the shipped engine. | | X Metrics-driven governance | Pass. No new dashboards; reuses existing validation output. | @@ -139,7 +139,7 @@ agents/changelog-agent/ # bundled copy above is generated from it and pinned (research R-05) ``` -**Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent, no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. Whether the adapter lands as one module or two reviewed slices is open decision 3 (research R-06). +**Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent, no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. The adapter lands as one module in a single pull request (research R-06, decided 2026-10-10). ## Phase 0 and Phase 1 Outputs diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index abc2dc9379..8683288279 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -49,10 +49,11 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Consequences**: drift is handled by the pin and a test that fails when the bundled copy differs from it; upgrades are an explicit refresh. Results always name the engine version (FR-010, SC-012). - **Alternatives rejected**: preferring the target repository's own copy (versions vary), requiring a governance checkout (breaks portability), and refusing until installed separately (poor first-run experience). -### R-06 Plugin and theme adapter: one module or two slices (open decision 3) +### R-06 Plugin and theme adapter ships as one module -- **Provisional recommendation**: one coherent adapter module with both acceptance mappings (#1565 plugin, #1566 theme), splitting only if independently reviewable. -- **Status**: provisional; owner confirmation required. +- **Decision** (clarify session 2026-10-10, option A): one coherent adapter module in a single pull request, covering plugin and theme, with both acceptance mappings (#1565 plugin, #1566 theme). +- **Rationale**: both adapters share the same detection and version-field logic, so one module avoids two reviews of overlapping code. +- **Alternatives**: two separate slices, and one module reviewed in two stages inside one pull request, were rejected as unnecessary for the MVP. ### R-07 Authoritative version source when instructions are silent @@ -115,6 +116,5 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). 2. Read PR #3881 diff and checks (R-02). -3. Owner confirmation of R-06. -4. 019 numbering gap resolution (R-11). -5. Approval decisions on the previews in `issue-map.md` (A1 to A11). +3. 019 numbering gap resolution (R-11). +4. Decisions A9 and A11 in `issue-map.md` (A1 to A8 and A10 were applied or needed no change on 2026-10-10). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 79dadc3867..0a42281a11 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -45,6 +45,7 @@ This specification defines a bounded, manually invoked **release-preparation MVP - Q: When a repository's own instructions don't say which version field is authoritative, should the release agent stop and list every version it found, or fall back to a built-in order? → A: Option A - stop as ambiguous and report every version found with its source; no fallback order exists. - Q: Should only the changelog agent ever edit `CHANGELOG.md`, with the release agent changing version fields only and asking the changelog agent to verify, or may the release agent also stamp it? → A: Option A - only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff. +- Q: Should the plugin and theme version handling ship as one module reviewed in a single pull request, or as two separate slices? → A: Option A - one coherent adapter module in a single pull request, covering plugin and theme with both acceptance mappings (#1565 and #1566). ## Release Process Contract (guidance, not execution permission) @@ -191,7 +192,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Packaging and architecture** -- **FR-016**: Exactly two user-facing orchestration agents exist; the WordPress utilities become reused and hardened release adapter functionality after callers, exports and tests are migrated, with no speculative deletion. +- **FR-016**: Exactly two user-facing orchestration agents exist; the WordPress utilities become reused and hardened release adapter functionality after callers, exports and tests are migrated, with no speculative deletion. The plugin and theme version handling ships as one coherent adapter module in a single pull request that maps both the plugin (#1565) and theme (#1566) acceptance criteria; it is not split into separate slices. - **FR-017**: Each agent package MUST contain one canonical `AGENT.md`, a `README.md`, an agent `CHANGELOG.md`, `package.json` and lockfile where the project convention requires, `scripts/`, namespaced `skills//SKILL.md`, and a small Claude adapter; `references/` and `assets/` only for actual content, with no gratuitous includes, gates, shared, results, manifest or example trees and no invented dependencies. - **FR-018**: The specification MUST resolve explicitly the distinct roles of working-instructions `AGENTS.md` and the definition `AGENT.md`, reuse the in-flight canonical-source migration, and keep module boundaries (no incidental CommonJS-to-ESM or TypeScript migration). - **FR-019**: Copied agent packages MUST resolve all resources without a governance checkout and MUST NOT read secrets, hooks or cloud configuration. @@ -254,8 +255,8 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue ## Open Decisions for `/speckit-clarify` -These are recorded as decisions for the clarify stage rather than guessed: +These were recorded as decisions for the clarify stage rather than guessed. All three are now resolved (clarification sessions of 2026-10-09 and 2026-10-10): 1. Resolved 2026-10-10 (option A): when a target's own instructions are silent on version fields, the agent stops as ambiguous and reports every version found; there is no fallback order (FR-004). 2. Resolved 2026-10-10 (option A): only the changelog agent edits `CHANGELOG.md`; the release agent edits version fields only and requests verification through the handoff (FR-007, FR-009). -3. Whether a plugin/theme adapter ships as one coherent module or two separately reviewed slices. +3. Resolved 2026-10-10 (option A): the plugin and theme adapter ships as one coherent module in a single pull request, mapping both #1565 and #1566 (FR-016). diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index ef1b067862..7bc74e86f9 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -35,7 +35,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. -- [ ] T003 Obtain owner confirmation of the provisional decision R-06 (one adapter module or two slices) by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. +- [X] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 and R-08 by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. Done 2026-10-10: R-06, R-07 and R-08 are all decided. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. - [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. From 365e0d6ed95fe0cf4ba2bc3feff1c4ba3fcaa545 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 08:14:58 +0000 Subject: [PATCH 20/24] spec(020-portable-changelog-release-agents): Apply spec analysis remediation edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses all five HIGH/MEDIUM findings from /speckit-analyze: 1. FR-025 (catalog entry): Add T000 task to create draft spec catalog entry as part of this PR; update Assumptions to document. 2. FR-013 (five operations): Add new "Shared-Skill Obligations" subsection to spec.md referencing issue #2653, making the spec self-contained with placeholder for extraction. 3. FR-029/SC-011 (approval digest): Create new contracts/approval-digest.md defining SHA-256 algorithm, workflow (display → approve → recheck), error handling, and test scenarios. Reference in plan.md Technical Context. 4. FR-001/FR-008 (dry-run invocation): Add "Agent Invocation Modes" section to data-model.md documenting release agent modes (readiness default, --approve-digest for preparation), changelog modes (inspect, draft, apply, verify), and exit codes. Update T023 task to reference data-model contract. 5. Test isolation (T046/T047): Add "Test Environment Setup" section to quickstart.md with fixture directory structure, portable-install test example, idempotency test, and digest-mismatch scenario with bash scripts. All artifacts now properly cross-referenced. Implementation slices have clear, formal guidance on approval mechanisms, invocation interfaces, and test setup. Co-Authored-By: Claude Haiku 4.5 Claude-Session: https://claude.ai/code/session_01JpxvYZmshbjebF3zvS1Feq --- .../contracts/approval-digest.md | 190 ++++++++++++++++++ .../data-model.md | 91 +++++++++ .../plan.md | 2 +- .../quickstart.md | 161 +++++++++++++++ .../spec.md | 12 ++ .../tasks.md | 3 +- 6 files changed, 457 insertions(+), 2 deletions(-) create mode 100644 .github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md b/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md new file mode 100644 index 0000000000..c9328bb9ce --- /dev/null +++ b/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md @@ -0,0 +1,190 @@ +# Approval Digest Contract + +## Purpose + +An approval digest is a cryptographic proof that the maintainer explicitly approved a specific set of changes before the agent applies them to the repository. Digests prevent silent file changes and ensure maintainers retain control over all edits. + +## Digest Algorithm + +- **Hash function**: SHA-256 +- **Input**: Canonical JSON representation of files to be changed and their new values +- **Encoding**: Hexadecimal (lowercase, 64 characters) +- **Scope**: Version-field files only (plugin header, readme, theme stylesheet, package.json, VERSION file) for the release agent; version fields or CHANGELOG.md for the changelog agent + +### Example Input (JSON canonical form for release agent) + +```json +{ + "files": { + "package.json": { + "action": "update", + "key": "version", + "oldValue": "1.1.0", + "newValue": "1.2.0" + }, + "readme.txt": { + "action": "update", + "key": "Stable tag", + "oldValue": "1.1.0", + "newValue": "1.2.0" + } + } +} +``` + +### Digest Computation Example + +Canonical JSON (sorted keys, no extra whitespace) is hashed: + +``` +Input: {"files":{"package.json":{"action":"update","key":"version","newValue":"1.2.0","oldValue":"1.1.0"},"readme.txt":{"action":"update","key":"Stable tag","newValue":"1.2.0","oldValue":"1.1.0"}}} + +Digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +## Workflow + +### Step 1: Agent Displays Proposed Changes + +When the agent has computed the changes it would apply, it displays them to the maintainer with the digest: + +``` +Release Agent Ready for Approval + +Target: /path/to/plugin +Component: plugin +Version: 1.1.0 → 1.2.0 + +Changes: + - package.json: version → 1.2.0 + - readme.txt: Stable tag → 1.2.0 + +Digest (to approve): +a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f + +--- +Copy the digest exactly and supply it to approve: +npx release.agent.cjs --repoRoot /path/to/plugin \ + --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +### Step 2: Maintainer Supplies Digest for Approval + +The maintainer copies the digest exactly and passes it as a flag: + +```bash +npx release.agent.cjs --repoRoot /path/to/plugin \ + --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +Or for the changelog agent: + +```bash +npx changelog.agent.cjs apply /path/to/changelog.md \ + --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +### Step 3: Agent Rechecks Before Writing + +Immediately before writing files: + +1. Agent recalculates the digest from the current repository state +2. Compares: `calculatedDigest` vs `suppliedDigest` +3. **If match**: Write files, record digest in result +4. **If mismatch**: Write nothing, return error with both digests + +## Error Handling + +### Digest Mismatch + +Files have changed since the digest was displayed (e.g., maintainer hand-edited, or concurrent change): + +``` +Error: approval-digest-mismatch +Message: Approval digest does not match the current state + +Displayed digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +Calculated digest: x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0f9e8d7c6b5a4z3y2x1w0v + +Reason: Files changed between display and approval + - package.json: modified by hand-edit + - Possible concurrent edit from another process + +Action: Run the readiness/draft operation again to get an updated digest. +``` + +### Missing Approval Digest + +Maintainer runs the agent without the `--approve-digest` flag when one is required: + +``` +Error: approval-required-not-supplied +Message: Edits require explicit approval + +Changes would affect: + - package.json: version → 1.2.0 + - readme.txt: Stable tag → 1.2.0 + +Digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f + +Action: Supply the digest with --approve-digest flag to approve these changes. +``` + +### Malformed Digest + +Digest is not 64 hexadecimal characters: + +``` +Error: approval-digest-invalid +Message: Supplied digest is not valid + +Supplied: "not-a-valid-digest" +Expected: 64 lowercase hexadecimal characters (SHA-256) + +Action: Copy the digest exactly from the agent's display. +``` + +## Design Rationale + +**Why require explicit digest approval?** + +1. **Prevents silent changes**: Maintainers see exactly what will change before it happens +2. **Detects concurrent edits**: If the digest changes between display and apply, an edit occurred—catch it +3. **No ambiguity**: Digest proves the maintainer approved THIS specific change, not a similar one +4. **Fail-closed**: Any doubt → no write. Better to require re-approval than to silently proceed + +**Why SHA-256?** + +- Standard cryptographic hash +- Collision-resistant +- Already available in Node.js built-ins +- Easy to verify: any tool can recompute and check + +**Why hex encoding?** + +- Human-readable and copyable (no special characters) +- Unambiguous (no 0/O or 1/l confusion) + +## Implementation References + +- **FR-029**: Maintainer supplies digest of exact proposed edit; agent rechecks before writing +- **SC-011**: In every fixture where supplied digest does not match, zero files are written +- **Task T018**: Jest tests for release edits (digest match → write, mismatch → no write) +- **Task T024**: Implement approved preparation operation (capture digest, recompute, compare) +- **Task T029**: Jest tests for changelog edits (same digest logic) +- **Task T036**: Implement changelog apply operation (digest-gated write) + +## Testing Scenarios + +| Scenario | Setup | Expected | +|----------|-------|----------| +| **Digest match** | Display digest D1, maintainer supplies D1 | Files written; digest recorded in result | +| **Digest mismatch** | Display digest D1, file edited, calculated digest D2 | Zero files written; error returned | +| **Missing digest** | No `--approve-digest` flag | Edits refused; error shows digest to approve | +| **Invalid digest** | Malformed hex string | Rejected with format error | +| **Repeated run with no changes** | Run twice with same digest | Second run unchanged (idempotent) | +| **Hand-edit between display and apply** | Display digest, user edits file, supply original digest | Mismatch detected; no write | + +--- + +**Version**: 1.0.0 | **Date**: 2026-10-12 | **Related**: FR-029, SC-011, T018, T024, T029, T036 diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 2d3225a623..0a051d45ab 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -77,3 +77,94 @@ Only `verified` with evidence allows the release agent to report ready. `failed` | `issues` | Full GitHub issue URLs, and the Linear identifier once confirmed. | | `branch`, `base`, `template` | As recorded in `delivery-plan.md` once written. | | `closure` | Which issues the slice may close; partial work uses reference-only wording. | + +## Agent Invocation Modes + +### Release Agent + +**Readiness mode (default / explicit)**: + +Readiness mode is the default and requires no approval. The agent outputs a readiness report and makes zero file or git-state changes. + +```bash +# Default - no approval supplied → readiness check only +npx release.agent.cjs --repoRoot /path/to/target + +# Or explicit flag (same effect, for clarity) +npx release.agent.cjs --repoRoot /path/to/target --dry-run +``` + +**Output**: Readiness report with component type, version evidence, blockers, and zero writes. + +**Preparation mode (approval required)**: + +Preparation mode requires an approval digest (see [contracts/approval-digest.md](./contracts/approval-digest.md)). The agent applies allowlisted version-field edits only if the supplied digest matches the computed digest of those changes. + +```bash +npx release.agent.cjs --repoRoot /path/to/target \ + --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +**Output**: Readiness report with applied edits (if digest matches) or error (if mismatch or digest invalid). + +### Changelog Agent + +**Inspect mode (read-only)**: + +Inspects the changelog and reports its structure without changing any file. + +```bash +npx changelog.agent.cjs inspect /path/to/changelog.md +``` + +**Output**: Analysis report of current entries, categories, Unreleased count, and validation results. + +**Draft mode (read-only)**: + +Proposes release entries based on Unreleased section without changing any file. + +```bash +npx changelog.agent.cjs draft /path/to/changelog.md +``` + +**Output**: Proposed release entries, digest for approval, and zero writes. + +**Apply mode (approval required)**: + +Applies bounded changelog edits (moves Unreleased entries into a versioned section) only when the supplied digest matches. + +```bash +npx changelog.agent.cjs apply /path/to/changelog.md \ + --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +``` + +**Output**: Applied edits (if digest matches) or error (if mismatch). + +**Verify mode (read-only)**: + +Validates the changelog against the shipped validation engine and returns verification evidence (for the release agent's handoff). + +```bash +npx changelog.agent.cjs verify /path/to/changelog.md +``` + +**Output**: Validation result, categories found, Unreleased count, engine version, and zero writes. + +### Environment Variable Alternative (Optional) + +For shell scripts that prefer environment variables: + +```bash +export RELEASE_DRY_RUN=true # Readiness only (default) +export RELEASE_DRY_RUN=false # Preparation (requires --approve-digest flag) + +npx release.agent.cjs --repoRoot /path/to/target --approve-digest $DIGEST +``` + +**Note**: CLI flags take precedence over environment variables. Explicit flags are the primary interface; environment variables are optional for convenience. + +### Exit Codes + +- `0`: Success (readiness complete, edits applied, validation passed) +- `1`: Error (blockers, digest mismatch, validation failed, invalid input) +- `2`: Partial success or warning (e.g., recovery from edit failure succeeded, but repo state may not be fully ready) diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index 59c34a07d3..c7919c1011 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -46,7 +46,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI **Primary Dependencies**: none new. Existing: the shipped changelog validation engine at `.github/validation/changelog/` (ESM package, `bin/validate.js`); copied agents carry a bundled copy pinned to a recorded version (research R-05), Node built-ins, `git`. No Python, no new test framework. -**Storage**: files only (version fields, `CHANGELOG.md`); no database. Handoff evidence is a structured JSON document passed between agents. +**Storage**: files only (version fields, `CHANGELOG.md`); no database. Handoff evidence is a structured JSON document passed between agents. Approval digests use SHA-256; see [contracts/approval-digest.md](./contracts/approval-digest.md) for the complete algorithm and implementation contract (FR-029, SC-011). **Testing**: Jest 30.x via `.jest.config.cjs` for JavaScript (`scripts/__tests__/` or `scripts/adapters/__tests__/` per agent); Bash/Bats under agent-root `tests/` with fixtures. Existing Node-test, PHP and Playwright tests stay where they are. Discovery and package commands must be verified before any test moves. diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index 058754ea8a..2f63f1041d 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -10,6 +10,167 @@ This guide describes how a reviewer proves the specification and, later, the imp - Node.js and the repository's installed dependencies (`npm ci`). - Fixture repositories for: plugin, theme, enhancement, ordinary `.github` target, optional `VERSION`, ambiguous headers, drift, repeated runs, invalid paths. +## Test Environment Setup + +All test fixtures are persistent, committed files under each agent's `tests/fixtures/` directory and are reused across test runs. + +### Fixture Directory Structure + +```text +agents/release-agent/tests/fixtures/ +├── plugin/ +│ ├── plugin-file.php # Plugin with minimal header +│ ├── readme.txt # Plugin readme with Stable tag +│ ├── package.json # Optional package.json +│ ├── .github/ # Optional governance files +│ └── (no VERSION file needed) +├── theme/ +│ ├── style.css # Theme with version header +│ ├── package.json +│ ├── readme.txt +│ └── .github/ +├── enhancement/ +│ ├── .github/ +│ │ └── instructions.md # Declares component: "enhancement" + version-fields +│ └── package.json +├── enhancement-undeclared/ # Enhancement without instructions declaration +│ └── package.json +├── ordinary-github-target/ # Has .github/, package.json, VERSION (not governance) +├── optional-version/ # No VERSION file; detectable without it +├── ambiguous-headers/ # Both plugin and theme markers present +├── drift/ # Version fields with conflicting values +├── repeat-run/ # For idempotent testing (run twice, expect no change) +├── invalid-paths/ # Symlinks, ../ escape attempts, special characters +├── tag-conflict/ # Existing tag that conflicts +└── (other scenarios per FR-022) + +agents/changelog-agent/tests/fixtures/ +├── valid-unreleased/ # Well-formed Unreleased section +├── invalid-category/ # Entry outside the 6 allowed categories +├── empty-unreleased/ # No entries under Unreleased +├── already-released/ # Only released sections, no Unreleased +├── hand-edited-between-draft-and-apply/ # For testing digest mismatch +├── long-entry/ # Entry exceeding 250-character limit +├── no-workflows/ # No changelog.yml or release.yml present +└── (other scenarios per FR-022) +``` + +### Portable Install Test (T046, T047 — Clean Location) + +The portable-install fixtures verify that agents run in isolation without relying on the governance checkout. + +**Setup**: + +```bash +#!/bin/bash +set -e + +# Create isolated temp directory +CLEAN_DIR=$(mktemp -d) +trap "rm -rf $CLEAN_DIR" EXIT + +# Copy agent package only (no governance checkout on path) +cp -r agents/release-agent "$CLEAN_DIR/agent" +cd "$CLEAN_DIR/agent" + +# Verify NO governance checkout is accessible +if [ -d ~/.github ]; then + echo "ERROR: ~/.github exists; test environment not clean" + exit 1 +fi + +# Verify NO spec directory reachable +if [ -f ./.github/specs/020-portable-changelog-release-agents/spec.md ]; then + echo "ERROR: Spec directory found; not properly isolated" + exit 1 +fi + +# Run agent from isolated location +npx release.agent.cjs --repoRoot /path/to/fixture --dry-run +exit_code=$? + +if [ $exit_code -eq 0 ]; then + echo "SUCCESS: Agent resolved all resources in clean location" +else + echo "FAILURE: Agent failed to run without governance checkout" + exit 1 +fi +``` + +**Expected**: Agent resolves all resources (bundled engine, skills, adapters) without reaching beyond the copied package. + +### Repeated-Run Idempotency (Changelog) + +Verifies changelog operations are idempotent: running twice with no new changes produces identical output. + +**Setup**: + +```bash +#!/bin/bash +CHANGELOG_PATH="agents/changelog-agent/tests/fixtures/repeat-run/CHANGELOG.md" + +# Run 1: Inspect the changelog +RUN1=$(npx changelog.agent.cjs inspect "$CHANGELOG_PATH" 2>&1) + +# Small delay to ensure different timestamps if any time-based logic exists +sleep 1 + +# Run 2: Inspect again with no changes to CHANGELOG.md +RUN2=$(npx changelog.agent.cjs inspect "$CHANGELOG_PATH" 2>&1) + +# Verify output is identical +if [ "$RUN1" = "$RUN2" ]; then + echo "SUCCESS: Repeated run produces identical output" +else + echo "FAILURE: Repeated run output differs" + echo "Run 1: $RUN1" + echo "Run 2: $RUN2" + exit 1 +fi +``` + +**Expected**: `run1` equals `run2`. No file changes occur. + +### Hand-Edited Between Draft and Apply + +Verifies that digest mismatch is detected when a file changes between draft and apply. + +**Setup**: + +```bash +#!/bin/bash +CHANGELOG_PATH="agents/changelog-agent/tests/fixtures/hand-edited-between-draft-and-apply/CHANGELOG.md" + +# Step 1: Draft the changelog to get digest +DRAFT=$(npx changelog.agent.cjs draft "$CHANGELOG_PATH" 2>&1) +DIGEST=$(echo "$DRAFT" | grep -oP 'Digest: \K[a-f0-9]+') + +# Step 2: Maintainer hand-edits CHANGELOG.md (simulate by modifying a line) +sed -i 's/example/MODIFIED_EXAMPLE/g' "$CHANGELOG_PATH" + +# Step 3: Try to apply with the old digest +OUTPUT=$(npx changelog.agent.cjs apply "$CHANGELOG_PATH" \ + --approve-digest "$DIGEST" 2>&1) + +# Verify: +# - Command failed (non-zero exit) +# - File was NOT modified (no write occurred) +if echo "$OUTPUT" | grep -q "approval-digest-mismatch"; then + echo "SUCCESS: Digest mismatch detected" + if ! grep -q "MODIFIED_EXAMPLE" "$CHANGELOG_PATH"; then + echo "SUCCESS: File unchanged (no write on mismatch)" + exit 0 + fi +fi + +echo "FAILURE: Digest mismatch not properly handled" +exit 1 +``` + +**Expected**: Mismatch detected, zero files written, clear error returned. + +--- + ## Specification checks (this PR) 1. Lint the changed Markdown: `npm run lint:md`. diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 0a42281a11..701e889309 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -226,6 +226,17 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **Verification handoff**: the request and blocking response between the release and changelog agents. - **Delivery slice**: one independently reviewable issue-to-PR unit (spec, consolidation, release MVP, changelog MVP, decisions, documentation, setup, distribution, workflows, rollback). +### Shared-Skill Obligations (Existing Changelog MVP — FR-013) + +The changelog agent MUST preserve and reuse the five shared-skill operations carried by the existing changelog MVP. These operations are defined in issue #2653 and are: + +1. **TODO: Extract from issue #2653** — (List will be populated from issue body/comments; ref. task T032) +2. (Operations 2–5 to be documented from same source) + +**Reference**: [#2653 – aiops: changelog-automation - Create portable shared skill](https://github.com/lightspeedwp/.github/issues/2653) + +**Note**: Task T032 (Phase 4, User Story 2) formally inventories these five operations from the issue and confirms they are preserved during changelog agent implementation. The spec records them here for completeness. + ## Success Criteria *(mandatory)* ### Measurable Outcomes @@ -245,6 +256,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue ## Assumptions +- Specification catalog entry. The draft entry for this specification will be created as task T000 and added to `.github/specs/CATALOG.md` as part of this specification PR, not deferred to implementation slices. The catalog entry is pure metadata (numbering, status, summary, decision links) and is zero-risk. - Feature number 020 is final. Maintainer decision 2026-10-10: this specification keeps number 020 and does not take 019. Number 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. - Existing work is reused: the in-flight consolidation (issue 3880 / PR 3881, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, open and blocked, not merged), merged PR 3820, and spec 016 with the shipped `.github/validation/changelog/` engine. - Default delivery is S independent, existing consolidation finished, then release MVP and changelog MVP branched from refreshed develop; stacking the release MVP on PR 3881 happens only if it needs layout available exclusively there, and never on the Qodo reservation. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 7bc74e86f9..19e339d01e 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -33,6 +33,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p **Purpose**: Close the gaps that would otherwise cause rework. No implementation yet. +- [ ] T000 [US5] Create draft entry in `.github/specs/CATALOG.md` following the numbering scheme and status format from `.github/specs/MAINTENANCE.md`. Mark status as "Draft – Ready for Review". Include one-line title ("Portable changelog and WordPress release preparation agents"), scope summary, decision links (R-06, R-07, R-08 resolved), and link to issue #1555. This administrative task is zero-risk metadata only and completes alongside the specification PR. - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. - [X] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 and R-08 by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. Done 2026-10-10: R-06, R-07 and R-08 are all decided. @@ -80,7 +81,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. Recognise an enhancement only from a declaration in the target's own instructions (FR-003). - [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. - [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. Read the required checks from the target's own instructions or CI configuration and block with `missing-check` when none are named or one cannot run (FR-005). -- [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Depends on T017, T020, T021, T022. +- [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Design must follow the invocation contract in `.github/specs/020-portable-changelog-release-agents/data-model.md` Agent Invocation Modes section (readiness by default, explicit `--dry-run` flag supported). Depends on T017, T020, T021, T022. - [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval digest required and rechecked immediately before writing (FR-029), backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. - [ ] T025 [US1] Emit the readiness report defined in `.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md` (fields `status`, `repoRoot`, `componentType`, `versionSources[]`, `findings[]`, `writes`) from `agents/release-agent/scripts/readiness.operation.cjs`. Depends on T023. - [ ] T026 [US1] Make the release-agent Bats and Jest suites pass and record results in the R1 PR body; do not claim `ready` acceptance for the full flow until US3 (T044) has changelog evidence. Depends on T019, T024, T025. From c85125b68558ef86412a6897f4ce303ebac11fbb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 15:20:13 +0000 Subject: [PATCH 21/24] docs: release-agents - Fix spec 020 remediation review findings Replace the TODO in Shared-Skill Obligations with the five operations read from issue 2653, drop the redundant T000 catalog task and its assumption (the catalog row already exists), restrict the approval-digest scope per FR-009, use a real computed example digest, and move invented CLI flags, env vars and exit codes out of data-model, quickstart and the digest contract into tasks T023 and T036. Remove the stale Closes 1555 clause from T006. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/approval-digest.md | 211 ++++-------------- .../data-model.md | 99 +------- .../quickstart.md | 170 ++------------ .../spec.md | 16 +- .../tasks.md | 7 +- 5 files changed, 83 insertions(+), 420 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md b/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md index c9328bb9ce..7ff5e20e8e 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/approval-digest.md @@ -1,190 +1,65 @@ # Approval Digest Contract -## Purpose - -An approval digest is a cryptographic proof that the maintainer explicitly approved a specific set of changes before the agent applies them to the repository. Digests prevent silent file changes and ensure maintainers retain control over all edits. - -## Digest Algorithm - -- **Hash function**: SHA-256 -- **Input**: Canonical JSON representation of files to be changed and their new values -- **Encoding**: Hexadecimal (lowercase, 64 characters) -- **Scope**: Version-field files only (plugin header, readme, theme stylesheet, package.json, VERSION file) for the release agent; version fields or CHANGELOG.md for the changelog agent - -### Example Input (JSON canonical form for release agent) - -```json -{ - "files": { - "package.json": { - "action": "update", - "key": "version", - "oldValue": "1.1.0", - "newValue": "1.2.0" - }, - "readme.txt": { - "action": "update", - "key": "Stable tag", - "oldValue": "1.1.0", - "newValue": "1.2.0" - } - } -} -``` - -### Digest Computation Example - -Canonical JSON (sorted keys, no extra whitespace) is hashed: - -``` -Input: {"files":{"package.json":{"action":"update","key":"version","newValue":"1.2.0","oldValue":"1.1.0"},"readme.txt":{"action":"update","key":"Stable tag","newValue":"1.2.0","oldValue":"1.1.0"}}} +**Feature**: [spec.md](./../spec.md) | Related: FR-029, SC-011, T018, T024, T029, T036 -Digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -## Workflow - -### Step 1: Agent Displays Proposed Changes - -When the agent has computed the changes it would apply, it displays them to the maintainer with the digest: - -``` -Release Agent Ready for Approval - -Target: /path/to/plugin -Component: plugin -Version: 1.1.0 → 1.2.0 - -Changes: - - package.json: version → 1.2.0 - - readme.txt: Stable tag → 1.2.0 - -Digest (to approve): -a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f - ---- -Copy the digest exactly and supply it to approve: -npx release.agent.cjs --repoRoot /path/to/plugin \ - --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -### Step 2: Maintainer Supplies Digest for Approval - -The maintainer copies the digest exactly and passes it as a flag: - -```bash -npx release.agent.cjs --repoRoot /path/to/plugin \ - --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -Or for the changelog agent: - -```bash -npx changelog.agent.cjs apply /path/to/changelog.md \ - --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -### Step 3: Agent Rechecks Before Writing - -Immediately before writing files: - -1. Agent recalculates the digest from the current repository state -2. Compares: `calculatedDigest` vs `suppliedDigest` -3. **If match**: Write files, record digest in result -4. **If mismatch**: Write nothing, return error with both digests - -## Error Handling - -### Digest Mismatch - -Files have changed since the digest was displayed (e.g., maintainer hand-edited, or concurrent change): - -``` -Error: approval-digest-mismatch -Message: Approval digest does not match the current state - -Displayed digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -Calculated digest: x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0f9e8d7c6b5a4z3y2x1w0v - -Reason: Files changed between display and approval - - package.json: modified by hand-edit - - Possible concurrent edit from another process - -Action: Run the readiness/draft operation again to get an updated digest. -``` - -### Missing Approval Digest - -Maintainer runs the agent without the `--approve-digest` flag when one is required: - -``` -Error: approval-required-not-supplied -Message: Edits require explicit approval +## Purpose -Changes would affect: - - package.json: version → 1.2.0 - - readme.txt: Stable tag → 1.2.0 +An approval digest binds the maintainer's approval to one exact proposed edit. The agent writes only when the digest it recomputes immediately before writing matches the digest the maintainer supplied. Command names, flag names and exit codes are decided in the implementation tasks (T023, T036); this contract fixes only the algorithm and behaviour. -Digest: a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f +## Digest algorithm -Action: Supply the digest with --approve-digest flag to approve these changes. -``` +- **Hash function**: SHA-256. +- **Input**: canonical JSON (sorted keys, no extra whitespace) of the files to change, with the action, key, old value and new value for each. +- **Encoding**: 64 lowercase hexadecimal characters. +- **Scope by agent** (FR-009): + - Release agent: allowlisted version-field files only (plugin header, readme stable tag, theme stylesheet, `package.json`, `VERSION`). It never edits `CHANGELOG.md`. + - Changelog agent: `CHANGELOG.md` only. It never edits version fields. -### Malformed Digest +### Worked example (release agent) -Digest is not 64 hexadecimal characters: +Canonical input: +```text +{"files":{"package.json":{"action":"update","key":"version","newValue":"1.2.0","oldValue":"1.1.0"},"readme.txt":{"action":"update","key":"Stable tag","newValue":"1.2.0","oldValue":"1.1.0"}}} ``` -Error: approval-digest-invalid -Message: Supplied digest is not valid -Supplied: "not-a-valid-digest" -Expected: 64 lowercase hexadecimal characters (SHA-256) +SHA-256 of that exact string: -Action: Copy the digest exactly from the agent's display. +```text +885ad763e69ae46f458a8df321a5fdf0510a7c50766ef42c3089c43d2f126fca ``` -## Design Rationale +## Behaviour -**Why require explicit digest approval?** +1. **Display**: the agent shows the exact proposed edit and its digest. It writes nothing. +2. **Supply**: the maintainer returns the digest through the agent's approval input. +3. **Recheck**: immediately before writing, the agent recomputes the digest from the current repository state. +4. **Match**: write only the approved edit and record the digest in the result. +5. **Mismatch, missing or malformed digest**: write nothing and report which condition occurred, with both digests on a mismatch. -1. **Prevents silent changes**: Maintainers see exactly what will change before it happens -2. **Detects concurrent edits**: If the digest changes between display and apply, an edit occurred—catch it -3. **No ambiguity**: Digest proves the maintainer approved THIS specific change, not a similar one -4. **Fail-closed**: Any doubt → no write. Better to require re-approval than to silently proceed +A hand edit between display and approval changes the recomputed digest, so the approval cannot be reused for a different change. -**Why SHA-256?** +## Failure results -- Standard cryptographic hash -- Collision-resistant -- Already available in Node.js built-ins -- Easy to verify: any tool can recompute and check +| Condition | Result | Writes | +|-----------|--------|--------| +| Supplied digest differs from the recomputed digest | `approval-digest-mismatch`, both digests shown | None | +| No digest supplied where one is required | `approval-required`, digest to approve shown | None | +| Supplied value is not 64 lowercase hex characters | `approval-digest-invalid` | None | -**Why hex encoding?** - -- Human-readable and copyable (no special characters) -- Unambiguous (no 0/O or 1/l confusion) - -## Implementation References - -- **FR-029**: Maintainer supplies digest of exact proposed edit; agent rechecks before writing -- **SC-011**: In every fixture where supplied digest does not match, zero files are written -- **Task T018**: Jest tests for release edits (digest match → write, mismatch → no write) -- **Task T024**: Implement approved preparation operation (capture digest, recompute, compare) -- **Task T029**: Jest tests for changelog edits (same digest logic) -- **Task T036**: Implement changelog apply operation (digest-gated write) - -## Testing Scenarios +## Test scenarios | Scenario | Setup | Expected | |----------|-------|----------| -| **Digest match** | Display digest D1, maintainer supplies D1 | Files written; digest recorded in result | -| **Digest mismatch** | Display digest D1, file edited, calculated digest D2 | Zero files written; error returned | -| **Missing digest** | No `--approve-digest` flag | Edits refused; error shows digest to approve | -| **Invalid digest** | Malformed hex string | Rejected with format error | -| **Repeated run with no changes** | Run twice with same digest | Second run unchanged (idempotent) | -| **Hand-edit between display and apply** | Display digest, user edits file, supply original digest | Mismatch detected; no write | - ---- - -**Version**: 1.0.0 | **Date**: 2026-10-12 | **Related**: FR-029, SC-011, T018, T024, T029, T036 +| Digest match | Display digest D1, maintainer supplies D1 | Edit written; digest recorded | +| Digest mismatch | Display D1, file edited by hand, recomputed D2 | Zero files written | +| Missing digest | No approval supplied | Edit refused; digest shown | +| Invalid digest | Malformed value | Rejected | +| Repeat after a successful apply | Run again with the same digest | Recomputed digest differs or the change is already applied; nothing is written twice | + +## Traceability + +- **FR-029**: the maintainer supplies the digest of the exact proposed edit; the agent rechecks before writing. +- **SC-011**: in every fixture where the supplied digest does not match, zero files are written. +- **T018 / T024**: release-agent tests and the approved preparation operation. +- **T029 / T036**: changelog-agent tests and the approved apply operation. diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 0a051d45ab..43f07dbc86 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -78,93 +78,18 @@ Only `verified` with evidence allows the release agent to report ready. `failed` | `branch`, `base`, `template` | As recorded in `delivery-plan.md` once written. | | `closure` | Which issues the slice may close; partial work uses reference-only wording. | -## Agent Invocation Modes +## Invocation modes (conceptual) -### Release Agent +Concrete flag names, command shape and exit codes are decided in tasks T023 and T036, not here. Every mode takes an explicit `repoRoot` (FR-002). -**Readiness mode (default / explicit)**: +| Agent | Mode | Writes | Approval | +|-------|------|--------|----------| +| Release | Readiness (default) | None | None | +| Release | Approved preparation (version fields only) | Allowlisted version fields | Digest of the exact proposed edit (FR-029) | +| Changelog | Inspect | None | None | +| Changelog | Draft | None | None | +| Changelog | Validate (verification evidence for the handoff) | None | None | +| Changelog | Prepare release | None until approved | Digest of the exact proposed edit | +| Changelog | Approved apply (`CHANGELOG.md` only, FR-009) | `CHANGELOG.md` | Digest of the exact proposed edit (FR-029) | -Readiness mode is the default and requires no approval. The agent outputs a readiness report and makes zero file or git-state changes. - -```bash -# Default - no approval supplied → readiness check only -npx release.agent.cjs --repoRoot /path/to/target - -# Or explicit flag (same effect, for clarity) -npx release.agent.cjs --repoRoot /path/to/target --dry-run -``` - -**Output**: Readiness report with component type, version evidence, blockers, and zero writes. - -**Preparation mode (approval required)**: - -Preparation mode requires an approval digest (see [contracts/approval-digest.md](./contracts/approval-digest.md)). The agent applies allowlisted version-field edits only if the supplied digest matches the computed digest of those changes. - -```bash -npx release.agent.cjs --repoRoot /path/to/target \ - --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -**Output**: Readiness report with applied edits (if digest matches) or error (if mismatch or digest invalid). - -### Changelog Agent - -**Inspect mode (read-only)**: - -Inspects the changelog and reports its structure without changing any file. - -```bash -npx changelog.agent.cjs inspect /path/to/changelog.md -``` - -**Output**: Analysis report of current entries, categories, Unreleased count, and validation results. - -**Draft mode (read-only)**: - -Proposes release entries based on Unreleased section without changing any file. - -```bash -npx changelog.agent.cjs draft /path/to/changelog.md -``` - -**Output**: Proposed release entries, digest for approval, and zero writes. - -**Apply mode (approval required)**: - -Applies bounded changelog edits (moves Unreleased entries into a versioned section) only when the supplied digest matches. - -```bash -npx changelog.agent.cjs apply /path/to/changelog.md \ - --approve-digest a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f -``` - -**Output**: Applied edits (if digest matches) or error (if mismatch). - -**Verify mode (read-only)**: - -Validates the changelog against the shipped validation engine and returns verification evidence (for the release agent's handoff). - -```bash -npx changelog.agent.cjs verify /path/to/changelog.md -``` - -**Output**: Validation result, categories found, Unreleased count, engine version, and zero writes. - -### Environment Variable Alternative (Optional) - -For shell scripts that prefer environment variables: - -```bash -export RELEASE_DRY_RUN=true # Readiness only (default) -export RELEASE_DRY_RUN=false # Preparation (requires --approve-digest flag) - -npx release.agent.cjs --repoRoot /path/to/target --approve-digest $DIGEST -``` - -**Note**: CLI flags take precedence over environment variables. Explicit flags are the primary interface; environment variables are optional for convenience. - -### Exit Codes - -- `0`: Success (readiness complete, edits applied, validation passed) -- `1`: Error (blockers, digest mismatch, validation failed, invalid input) -- `2`: Partial success or warning (e.g., recovery from edit failure succeeded, but repo state may not be fully ready) +Dry run is the default for both agents; no environment variable or flag may widen it without a matching approval digest. See [contracts/approval-digest.md](./contracts/approval-digest.md). diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index 2f63f1041d..7761fd93d4 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -10,166 +10,30 @@ This guide describes how a reviewer proves the specification and, later, the imp - Node.js and the repository's installed dependencies (`npm ci`). - Fixture repositories for: plugin, theme, enhancement, ordinary `.github` target, optional `VERSION`, ambiguous headers, drift, repeated runs, invalid paths. -## Test Environment Setup - -All test fixtures are persistent, committed files under each agent's `tests/fixtures/` directory and are reused across test runs. - -### Fixture Directory Structure - -```text -agents/release-agent/tests/fixtures/ -├── plugin/ -│ ├── plugin-file.php # Plugin with minimal header -│ ├── readme.txt # Plugin readme with Stable tag -│ ├── package.json # Optional package.json -│ ├── .github/ # Optional governance files -│ └── (no VERSION file needed) -├── theme/ -│ ├── style.css # Theme with version header -│ ├── package.json -│ ├── readme.txt -│ └── .github/ -├── enhancement/ -│ ├── .github/ -│ │ └── instructions.md # Declares component: "enhancement" + version-fields -│ └── package.json -├── enhancement-undeclared/ # Enhancement without instructions declaration -│ └── package.json -├── ordinary-github-target/ # Has .github/, package.json, VERSION (not governance) -├── optional-version/ # No VERSION file; detectable without it -├── ambiguous-headers/ # Both plugin and theme markers present -├── drift/ # Version fields with conflicting values -├── repeat-run/ # For idempotent testing (run twice, expect no change) -├── invalid-paths/ # Symlinks, ../ escape attempts, special characters -├── tag-conflict/ # Existing tag that conflicts -└── (other scenarios per FR-022) - -agents/changelog-agent/tests/fixtures/ -├── valid-unreleased/ # Well-formed Unreleased section -├── invalid-category/ # Entry outside the 6 allowed categories -├── empty-unreleased/ # No entries under Unreleased -├── already-released/ # Only released sections, no Unreleased -├── hand-edited-between-draft-and-apply/ # For testing digest mismatch -├── long-entry/ # Entry exceeding 250-character limit -├── no-workflows/ # No changelog.yml or release.yml present -└── (other scenarios per FR-022) -``` - -### Portable Install Test (T046, T047 — Clean Location) - -The portable-install fixtures verify that agents run in isolation without relying on the governance checkout. - -**Setup**: - -```bash -#!/bin/bash -set -e - -# Create isolated temp directory -CLEAN_DIR=$(mktemp -d) -trap "rm -rf $CLEAN_DIR" EXIT - -# Copy agent package only (no governance checkout on path) -cp -r agents/release-agent "$CLEAN_DIR/agent" -cd "$CLEAN_DIR/agent" - -# Verify NO governance checkout is accessible -if [ -d ~/.github ]; then - echo "ERROR: ~/.github exists; test environment not clean" - exit 1 -fi - -# Verify NO spec directory reachable -if [ -f ./.github/specs/020-portable-changelog-release-agents/spec.md ]; then - echo "ERROR: Spec directory found; not properly isolated" - exit 1 -fi - -# Run agent from isolated location -npx release.agent.cjs --repoRoot /path/to/fixture --dry-run -exit_code=$? - -if [ $exit_code -eq 0 ]; then - echo "SUCCESS: Agent resolved all resources in clean location" -else - echo "FAILURE: Agent failed to run without governance checkout" - exit 1 -fi -``` - -**Expected**: Agent resolves all resources (bundled engine, skills, adapters) without reaching beyond the copied package. - -### Repeated-Run Idempotency (Changelog) - -Verifies changelog operations are idempotent: running twice with no new changes produces identical output. - -**Setup**: - -```bash -#!/bin/bash -CHANGELOG_PATH="agents/changelog-agent/tests/fixtures/repeat-run/CHANGELOG.md" - -# Run 1: Inspect the changelog -RUN1=$(npx changelog.agent.cjs inspect "$CHANGELOG_PATH" 2>&1) - -# Small delay to ensure different timestamps if any time-based logic exists -sleep 1 - -# Run 2: Inspect again with no changes to CHANGELOG.md -RUN2=$(npx changelog.agent.cjs inspect "$CHANGELOG_PATH" 2>&1) - -# Verify output is identical -if [ "$RUN1" = "$RUN2" ]; then - echo "SUCCESS: Repeated run produces identical output" -else - echo "FAILURE: Repeated run output differs" - echo "Run 1: $RUN1" - echo "Run 2: $RUN2" - exit 1 -fi -``` - -**Expected**: `run1` equals `run2`. No file changes occur. - -### Hand-Edited Between Draft and Apply - -Verifies that digest mismatch is detected when a file changes between draft and apply. - -**Setup**: - -```bash -#!/bin/bash -CHANGELOG_PATH="agents/changelog-agent/tests/fixtures/hand-edited-between-draft-and-apply/CHANGELOG.md" +## Test environment (for the implementation slices) -# Step 1: Draft the changelog to get digest -DRAFT=$(npx changelog.agent.cjs draft "$CHANGELOG_PATH" 2>&1) -DIGEST=$(echo "$DRAFT" | grep -oP 'Digest: \K[a-f0-9]+') +Fixtures are committed files under each agent's `tests/fixtures/`. Names below are placeholders; the slices decide the final layout. -# Step 2: Maintainer hand-edits CHANGELOG.md (simulate by modifying a line) -sed -i 's/example/MODIFIED_EXAMPLE/g' "$CHANGELOG_PATH" +- **Release agent fixtures**: plugin, theme, enhancement with a declaration in the target's own instructions, enhancement without one (expect `component-unknown`), ordinary `.github` target that is not governance, no `VERSION` file, ambiguous headers, version drift, repeated run, invalid paths (symlink, `..` escape, special characters), tag conflict. +- **Changelog agent fixtures**: valid Unreleased section, entry outside the allowed categories, empty Unreleased, only released sections, entry over the length limit, no workflow files present, hand edit between draft and apply. -# Step 3: Try to apply with the old digest -OUTPUT=$(npx changelog.agent.cjs apply "$CHANGELOG_PATH" \ - --approve-digest "$DIGEST" 2>&1) +### Portable-install check (T046, T047) -# Verify: -# - Command failed (non-zero exit) -# - File was NOT modified (no write occurred) -if echo "$OUTPUT" | grep -q "approval-digest-mismatch"; then - echo "SUCCESS: Digest mismatch detected" - if ! grep -q "MODIFIED_EXAMPLE" "$CHANGELOG_PATH"; then - echo "SUCCESS: File unchanged (no write on mismatch)" - exit 0 - fi -fi +1. Copy only the agent package into a fresh temporary directory outside the repository checkout. +2. Run the readiness (release) or verify (changelog) operation against a copied fixture, with an explicit `repoRoot`. +3. Expected: every resource (bundled engine, skills, adapters) resolves from inside the copied package, and the result names the engine version where one is used. -echo "FAILURE: Digest mismatch not properly handled" -exit 1 -``` +### Repeated-run check -**Expected**: Mismatch detected, zero files written, clear error returned. +1. Run the same read-only operation twice against an unchanged fixture. +2. Expected: identical output and no file changes. ---- +### Hand edit between draft and apply (SC-011) + +1. Run the draft operation on a copied fixture and record the digest it shows. +2. Edit the copied `CHANGELOG.md` by hand. +3. Attempt the approved apply with the recorded digest. +4. Expected: digest mismatch is reported and the copy is byte-identical to its state after the hand edit. Always work on a temporary copy, never the committed fixture. ## Specification checks (this PR) diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 701e889309..8f71c90c97 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -226,16 +226,17 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **Verification handoff**: the request and blocking response between the release and changelog agents. - **Delivery slice**: one independently reviewable issue-to-PR unit (spec, consolidation, release MVP, changelog MVP, decisions, documentation, setup, distribution, workflows, rollback). -### Shared-Skill Obligations (Existing Changelog MVP — FR-013) +### Shared-Skill Obligations (FR-013) -The changelog agent MUST preserve and reuse the five shared-skill operations carried by the existing changelog MVP. These operations are defined in issue #2653 and are: +The five operations carried by [#2653 – aiops: changelog-agent - Deliver portable changelog operations](https://github.com/lightspeedwp/.github/issues/2653) (read 2026-10-12) are preserved by the changelog agent: -1. **TODO: Extract from issue #2653** — (List will be populated from issue body/comments; ref. task T032) -2. (Operations 2–5 to be documented from same source) +1. **Inspect** changelog state. +2. **Draft** an entry. +3. **Validate** formatting and type, with the engine version recorded in the result. +4. **Prepare** release changes. +5. **Report or safely apply** approved updates, separated from read-only analysis, with the exact approved change rechecked before writing and recovery on failure. -**Reference**: [#2653 – aiops: changelog-automation - Create portable shared skill](https://github.com/lightspeedwp/.github/issues/2653) - -**Note**: Task T032 (Phase 4, User Story 2) formally inventories these five operations from the issue and confirms they are preserved during changelog agent implementation. The spec records them here for completeness. +Dry runs write nothing, and a verification response never authorises an edit. Task T032 confirms this list against the issue before implementation. ## Success Criteria *(mandatory)* @@ -256,7 +257,6 @@ The changelog agent MUST preserve and reuse the five shared-skill operations car ## Assumptions -- Specification catalog entry. The draft entry for this specification will be created as task T000 and added to `.github/specs/CATALOG.md` as part of this specification PR, not deferred to implementation slices. The catalog entry is pure metadata (numbering, status, summary, decision links) and is zero-risk. - Feature number 020 is final. Maintainer decision 2026-10-10: this specification keeps number 020 and does not take 019. Number 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. - Existing work is reused: the in-flight consolidation (issue 3880 / PR 3881, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, open and blocked, not merged), merged PR 3820, and spec 016 with the shipped `.github/validation/changelog/` engine. - Default delivery is S independent, existing consolidation finished, then release MVP and changelog MVP branched from refreshed develop; stacking the release MVP on PR 3881 happens only if it needs layout available exclusively there, and never on the Qodo reservation. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 19e339d01e..f8c507b83b 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -33,13 +33,12 @@ description: "Task list for spec 020: portable changelog and WordPress release p **Purpose**: Close the gaps that would otherwise cause rework. No implementation yet. -- [ ] T000 [US5] Create draft entry in `.github/specs/CATALOG.md` following the numbering scheme and status format from `.github/specs/MAINTENANCE.md`. Mark status as "Draft – Ready for Review". Include one-line title ("Portable changelog and WordPress release preparation agents"), scope summary, decision links (R-06, R-07, R-08 resolved), and link to issue #1555. This administrative task is zero-risk metadata only and completes alongside the specification PR. - [ ] T001 Read the actual diff, checks and reviews of PR [#3881](https://github.com/lightspeedwp/.github/pull/3881) (head `7e0bcaab55703f0866d1c063c0b6e7530b97b747` at last read) and record the cause of its `blocked` state and the canonical layout it introduces in `.github/specs/020-portable-changelog-release-agents/research.md` under R-02. Claim no test results that were not rerun. - [ ] T002 Reconcile the target layout with T001: confirm exact paths for `AGENT.md`, `scripts/`, `skills//SKILL.md` and `claude/` for both agents, keep working-instructions `AGENTS.md` distinct from definition `AGENT.md`, and update the source tree in `.github/specs/020-portable-changelog-release-agents/plan.md` and `.github/specs/020-portable-changelog-release-agents/contracts/agent-package-layout.md`. Depends on T001. - [X] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 and R-08 by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. Done 2026-10-10: R-06, R-07 and R-08 are all decided. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. -- [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers) and decide whether `Closes #1555` is acceptable for the "AI Feedback Validation" check on PR [#3883](https://github.com/lightspeedwp/.github/pull/3883). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. +- [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. **Checkpoint**: Paths, decisions and test discovery are confirmed. @@ -81,7 +80,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T020 [US1] Fix detection order and criteria in `agents/release-agent/includes/repoDetector.cjs` (path per T002): remove the control-plane-first classification (finding A-1) so an ordinary WordPress repository with `.github/`, `package.json` and `VERSION` is not misidentified, and never require `VERSION`. Depends on T014. Recognise an enhancement only from a declaration in the target's own instructions (FR-003). - [ ] T021 [US1] Implement version-evidence discovery in `agents/release-agent/scripts/versionEvidence.cjs`: read the target's own instructions for designated authoritative fields, list every detected source with kind, repository-relative path, value and authoritative flag (data-model `Version source`), and return `ambiguous` or `drift` rather than choosing. Depends on T012, T015. - [ ] T022 [US1] Turn a dirty working tree into a blocking `dirty-tree` result in `agents/release-agent/release.agent.js` (it is currently only a warning, finding A-3), and add read-only tag-conflict detection (local and remote evidence compared without fetching or pushing). Depends on T009, T011, T016. Read the required checks from the target's own instructions or CI configuration and block with `missing-check` when none are named or one cannot run (FR-005). -- [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Design must follow the invocation contract in `.github/specs/020-portable-changelog-release-agents/data-model.md` Agent Invocation Modes section (readiness by default, explicit `--dry-run` flag supported). Depends on T017, T020, T021, T022. +- [ ] T023 [US1] Implement the separate read-only readiness operation in `agents/release-agent/scripts/readiness.operation.cjs` (research R-01) so that it cannot import or call any git mutation, and make `tag`, `push`, `deleteTag`, `deleteRemoteTag` and publish functions unreachable from the preparation entry point (FR-006, FR-008, finding A-4). Choose the invocation interface (flag names, exit codes) here; `data-model.md` Invocation modes lists only the conceptual modes, with readiness as the default. Depends on T017, T020, T021, T022. - [ ] T024 [US1] Implement the approved preparation operation in `agents/release-agent/scripts/prepare.operation.cjs`: allowlisted version-field paths only, approval digest required and rechecked immediately before writing (FR-029), backup captured before edit, recovery on failure, meaningful errors, no broad staging. Depends on T018, T023. - [ ] T025 [US1] Emit the readiness report defined in `.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md` (fields `status`, `repoRoot`, `componentType`, `versionSources[]`, `findings[]`, `writes`) from `agents/release-agent/scripts/readiness.operation.cjs`. Depends on T023. - [ ] T026 [US1] Make the release-agent Bats and Jest suites pass and record results in the R1 PR body; do not claim `ready` acceptance for the full flow until US3 (T044) has changelog evidence. Depends on T019, T024, T025. @@ -106,7 +105,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Implementation for User Story 2 -- [ ] T032 [US2] Read issue [#2653](https://github.com/lightspeedwp/.github/issues/2653) body and comments and list the five-operation shared-skill obligations it carries, then record them as the acceptance list in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (FR-013). Not inferred from the title. +- [ ] T032 [US2] Read issue [#2653](https://github.com/lightspeedwp/.github/issues/2653) body and comments and confirm the five-operation list recorded in `spec.md` Shared-Skill Obligations against it, then record them as the acceptance list in `.github/specs/020-portable-changelog-release-agents/issue-map.md` (FR-013). Not inferred from the title. - [ ] T033 [US2] Bundle a copy of the shipped validation engine at `agents/changelog-agent/vendor/changelog-validation/` with `engine.pin.json` recording its version and source commit (research R-05, option B), add `agents/changelog-agent/scripts/refreshEngine.cjs` that copies it from `.github/validation/changelog/` and rewrites the pin, and implement `agents/changelog-agent/scripts/engineResolver.cjs` so it always loads the bundled copy and reports the engine version in every result (FR-010, SC-012). Add a Jest check that fails when the bundled copy no longer matches its recorded pin. Depends on T030. - [ ] T034 [US2] Replace or wrap the duplicate validator modules in `agents/changelog-agent/includes/` (finding A-7) so validation goes through the shipped engine; remove nothing until its callers are inventoried. Depends on T033. - [ ] T035 [US2] Implement the inspect, draft and validate operations in `agents/changelog-agent/scripts/changelog.operations.cjs` with the six allowed categories, historic preservation and idempotent Unreleased handling (FR-011). Depends on T028, T034. From 6e392bfca7843e959efce76ede8108554a385147 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 15:44:00 +0000 Subject: [PATCH 22/24] docs: release-agents - Apply remaining spec 020 analysis fixes Add the missing scripts to the plan source tree and keep the existing release.agent.js name, define bounded edit, gratuitous tree and clean location, define when an integration does not fit an independent slice, and clarify that the pinned bundled engine copy is not a second engine. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../plan.md | 18 +++++++++++++++--- .../spec.md | 8 ++++---- .../tasks.md | 4 ++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index c7919c1011..531c3076e1 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -113,10 +113,18 @@ agents/release-agent/ ├── CHANGELOG.md # agent changelog ├── package.json # and lockfile only where convention requires ├── scripts/ -│ ├── release.agent.cjs # orchestration: readiness, approved preparation -│ ├── adapters/ # absorbed WordPress plugin/theme/readme adapters +│ ├── pathSafety.cjs # path-safety validator (T010) +│ ├── readiness.cjs # fail-closed result and blocker codes (T011) +│ ├── versionEvidence.cjs # version-source discovery (T021) +│ ├── readiness.operation.cjs # read-only readiness (T023) +│ ├── prepare.operation.cjs # approved preparation, version fields only (T024) +│ ├── handoff.request.cjs # verification request builder (T041) +│ ├── handoff.evaluate.cjs # handback evaluation (T042) +│ ├── adapters/ +│ │ ├── wordpressAdapter.cjs # one plugin/theme/readme adapter module (T012, R-06) │ │ └── __tests__/ │ └── __tests__/ +├── release.agent.js # existing entry point, kept under its current name (no incidental rename); T022 ├── skills//SKILL.md # namespaced skills ├── claude/ # small Claude adapter └── tests/ # Bats plus fixtures @@ -129,6 +137,10 @@ agents/changelog-agent/ ├── scripts/ │ ├── engineResolver.cjs # always loads the bundled engine and reports its version │ ├── refreshEngine.cjs # copies the canonical engine into vendor/ and rewrites the pin +│ ├── changelog.operations.cjs # inspect, draft, validate (T035) +│ ├── apply.operation.cjs # approved bounded apply (T036) +│ ├── verify.operation.cjs # read-only verification evidence (T037) +│ ├── handoff.responder.cjs # verification responder (T043) │ └── __tests__/ ├── vendor/changelog-validation/ # generated pinned copy of the engine, plus engine.pin.json (version, source commit) ├── skills//SKILL.md # five-operation shared-skill obligations preserved @@ -139,7 +151,7 @@ agents/changelog-agent/ # bundled copy above is generated from it and pinned (research R-05) ``` -**Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent, no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. The adapter lands as one module in a single pull request (research R-06, decided 2026-10-10). +**Structure Decision**: extend the two existing agent packages in place and fold `wordpress-release-utilities-agent` into the release agent's adapters after a caller, export and test inventory. No third orchestration agent (existing `includes/` and `gates/` are kept or relocated only per the T002 inventory), no gratuitous `includes/`, `gates/`, `shared/`, `results/` or `manifest/` trees, and no fake empty skills. The adapter lands as one module in a single pull request (research R-06, decided 2026-10-10). ## Phase 0 and Phase 1 Outputs diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 8f71c90c97..a888a389d6 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -121,7 +121,7 @@ A maintainer copies the two agents into another repository or user environment. **Why this priority**: Portability is the purpose of the work, but it is only valuable once the behaviour in Stories 1-3 is correct. -**Independent Test**: Install the packages into a clean location that has no `~/.github` checkout and confirm they resolve all needed resources and run. +**Independent Test**: Install the packages into a clean location (a directory outside any repository checkout that holds only the copied package, with no `~/.github` or governance checkout on any resolution path) and confirm they resolve all needed resources and run. **Acceptance Scenarios**: @@ -179,8 +179,8 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Changelog** -- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. The changelog agent is the only agent that edits `CHANGELOG.md`; the release agent never does and only requests verification through the handoff (FR-014). -- **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine. A copied agent package MUST validate with a bundled copy of that engine pinned to a recorded version, and every validation result MUST state the engine version it used. +- **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. A bounded edit touches only `CHANGELOG.md`, moves the Unreleased entries into one versioned section, adds a fresh Unreleased section, and leaves released sections and links byte-identical. The changelog agent is the only agent that edits `CHANGELOG.md`; the release agent never does and only requests verification through the handoff (FR-014). +- **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine, meaning no independently written validation logic. The pinned bundled copy is not a second engine: it is generated from the shipped engine by the refresh script and checked against its pin. A copied agent package MUST validate with a bundled copy of that engine pinned to a recorded version, and every validation result MUST state the engine version it used. - **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. - **FR-013**: The five-operation shared-skill obligations carried by the existing changelog MVP issue MUST be preserved. @@ -193,7 +193,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue **Packaging and architecture** - **FR-016**: Exactly two user-facing orchestration agents exist; the WordPress utilities become reused and hardened release adapter functionality after callers, exports and tests are migrated, with no speculative deletion. The plugin and theme version handling ships as one coherent adapter module in a single pull request that maps both the plugin (#1565) and theme (#1566) acceptance criteria; it is not split into separate slices. -- **FR-017**: Each agent package MUST contain one canonical `AGENT.md`, a `README.md`, an agent `CHANGELOG.md`, `package.json` and lockfile where the project convention requires, `scripts/`, namespaced `skills//SKILL.md`, and a small Claude adapter; `references/` and `assets/` only for actual content, with no gratuitous includes, gates, shared, results, manifest or example trees and no invented dependencies. +- **FR-017**: Each agent package MUST contain one canonical `AGENT.md`, a `README.md`, an agent `CHANGELOG.md`, `package.json` and lockfile where the project convention requires, `scripts/`, namespaced `skills//SKILL.md`, and a small Claude adapter; `references/` and `assets/` only for actual content, with no gratuitous includes, gates, shared, results, manifest or example trees and no invented dependencies. A tree is gratuitous when no script, skill or test of that agent uses it; existing `includes/` and `gates/` content is kept or relocated only per the T002 inventory, and no new such tree is created. - **FR-018**: The specification MUST resolve explicitly the distinct roles of working-instructions `AGENTS.md` and the definition `AGENT.md`, reuse the in-flight canonical-source migration, and keep module boundaries (no incidental CommonJS-to-ESM or TypeScript migration). - **FR-019**: Copied agent packages MUST resolve all resources without a governance checkout and MUST NOT read secrets, hooks or cloud configuration. - **FR-020**: Compatibility claims for Gemini, OpenAI and Copilot adapters MUST be backed by independent current documentation and tests; none is assumed. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index f8c507b83b..e18586368c 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -100,7 +100,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T027 [P] [US2] Create changelog fixtures under `agents/changelog-agent/tests/fixtures/`: `valid-unreleased/`, `invalid-category/`, `empty-unreleased/`, `already-released/`, `hand-edited-between-draft-and-apply/`, `long-entry/`, `no-workflows/` (no `changelog.yml` or `release.yml`). - [ ] T028 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/draft.test.cjs`: drafting changes no file; an entry in a category outside "Added, Changed, Deprecated, Removed, Fixed, Security" is reported with those six allowed categories listed; entries are checked against the repository's length rule ("entries ≤250 characters", constitution principle IX) and link rule (FR-009, FR-011). - [ ] T029 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/apply.test.cjs`: apply requires a matching approval digest (FR-029) and writes nothing on mismatch (SC-011); historic sections and links are byte-identical after apply; a second run with no new entries changes nothing; a hand edit between draft and apply is detected and refused (SC-006, SC-007). -- [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no second validation implementation is reachable (FR-010) and that every result states the engine version (SC-012). +- [ ] T030 [P] [US2] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/engineReuse.test.cjs` asserting validation delegates to the shipped engine in `.github/validation/changelog/` and that no independently written validation implementation is reachable (the pinned bundled copy is the same engine, FR-010) and that every result states the engine version (SC-012). - [ ] T031 [P] [US2] Write Bats cases in `agents/changelog-agent/tests/changelog-standalone.bats` that run with neither `.github/workflows/changelog.yml` nor `.github/workflows/release.yml` present (FR-012, SC-006). ### Implementation for User Story 2 @@ -136,7 +136,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than `verified` with evidence. Depends on T041. A response not returned within the same invocation is treated as not received (FR-014). - [ ] T043 [US3] Implement the responder in `agents/changelog-agent/scripts/handoff.responder.cjs` using the verification operation from T037. Depends on T037, T040. - [ ] T044 [US3] Wire the final ready decision in `agents/release-agent/scripts/readiness.operation.cjs` so ready requires recorded verification success, and confirm the handoff needs no new labels, event services, `changelog.yml` or `release.yml` (FR-015). Depends on T042, T043. -- [ ] T045 [US3] If the integration does not fit either independent slice, prepare the exact follow-on integration PR preview from `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` (branch `aiops/release-agent-changelog-handoff`, base `develop`, `pr_aiops.md`, label set A) for approval. Do not create it automatically. +- [ ] T045 [US3] If the integration needs code from the other agent's pull request beyond the handoff contract files, so it does not fit either independent slice, prepare the exact follow-on integration PR preview from `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` (branch `aiops/release-agent-changelog-handoff`, base `develop`, `pr_aiops.md`, label set A) for approval. Do not create it automatically. **Checkpoint**: Release plus changelog works end to end with a blocking, fail-closed gate. From e50551106556779f4f73d13866222e52947638aa Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Oct 2026 16:08:26 +0000 Subject: [PATCH 23/24] docs: release-agents - Adopt verification contract and validation policy Replace the circular request and response in the verification handoff with the changelog-verification/v1 Request and Handback, copying the supporting types with provenance. Align the readiness report, T039 to T042 and the data-model operation table, add the validation policy to the spec and the inspected engine baseline to research, and add blocking handoff examples to the quickstart. Re-slicing of the Release and changelog deliveries is not included. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../contracts/readiness-report.md | 3 +- .../contracts/verification-handoff.md | 117 +++++++++++++++--- .../data-model.md | 4 +- .../quickstart.md | 9 +- .../research.md | 15 +++ .../spec.md | 12 +- .../tasks.md | 8 +- 7 files changed, 141 insertions(+), 27 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md index 0ec167b13d..3ec2550cf7 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/readiness-report.md @@ -10,6 +10,7 @@ The readiness operation is read-only. Producing this report must not write files |-------|----------|-------| | `repoRoot` | Yes | Explicit path. Applied to every filesystem and git operation. | | `mode` | No | Defaults to `readiness`. Any other mode is a separate, approved operation. | +| `targetVersion`, `releaseDate` | Only to request changelog verification | Strict SemVer and a valid `YYYY-MM-DD` date, never inferred from the clock. Missing values prevent the verification request, not inspection. | ## Output fields @@ -35,4 +36,4 @@ The readiness operation is read-only. Producing this report must not write files | `component-unknown` | No plugin or theme could be identified, or the repository looks like an enhancement but its own instructions do not declare it and name its version fields. | | `changelog-unverified` | Handoff verification is missing, failed or not received. | -`status` is `ready` only when no `blocker` finding exists. +`status` is `ready` only when no `blocker` finding exists and changelog verification meets every rule in [verification-handoff.md](./verification-handoff.md). Passed prechecks are not readiness: the verification request carries `precheckStatus: "passed"`, and only the verified handback can lead to `ready`. diff --git a/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md index 84ad9ef2dc..f6139aaf8d 100644 --- a/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md +++ b/.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md @@ -1,33 +1,114 @@ # Contract: Release to Changelog Verification Handoff -**Requester**: release agent | **Responder**: changelog agent | **Transport**: structured document, no new labels or event services (FR-015) +**Requester**: release agent | **Responder**: changelog agent | **Transport**: structured document, no new labels or event services (FR-015) | **Contract version**: `changelog-verification/v1` + +**Provenance**: the notation below is copied from the [recorded Release handoff](https://linear.app/lightspeedwp/issue/GIT-1310/aiops-release-agent-deliver-portable-preparation#comment-be60c834) (GIT-1310, 2026-10-11) and adopted here on the maintainer's instruction of 2026-10-12. It is design notation, not a TypeScript migration, and this contract adds no separate schema file. Do not introduce competing definitions. + +## Supporting types + +```ts +type Status = "passed"|"failed"|"missing"|"skipped"|"not-applicable"; +type Hash = string; // lowercase 64-hex SHA-256 +type RelPath = string; // confined repository-relative path + +type Source = { + path: RelPath; sha256: Hash; + startLine: number; endLine: number; quote: string; +}; +type FileHash = { path: RelPath; sha256: Hash }; +type Snapshot = { + repository: string; root: string; branch: string|null; commit: string; + files: FileHash[]; digest: Hash; +}; +type Finding = { + code: string; severity: "blocker"|"note"; + message: string; paths: RelPath[]; nextAction: string; +}; +type CheckEvidence = { + id: string; source: Source; snapshotDigest: Hash; + producer: string; producerPin: string; + status: Status; artefacts: FileHash[]; +}; +``` ## Request -| Field | Description | -|-------|-------------| -| `contractVersion` | Version of this contract. | -| `repoRoot` | Explicit root the changelog agent must use. | -| `targetVersion` | Version the release is being prepared for. | -| `readiness` | Summary of the readiness report at request time, including its `status`. | -| `changelogPath` | Repository-relative path. | +```ts +type Request = { + contractVersion: "changelog-verification/v1"; + requestId: Hash; + target: Snapshot; + targetVersion: string; + releaseDate: string; + changelog: FileHash; + precheckStatus: "passed"; +}; +``` + +`precheckStatus: "passed"` means the release agent's pre-changelog checks passed. It is not final readiness: final readiness requires the handback, so a responder never needs `ready` to accept a request. + +## Handback + +```ts +type Handback = { + contractVersion: "changelog-verification/v1"; + requestId: Hash; + target: Snapshot; + targetVersion: string; + releaseDate: string; + changelog: FileHash; + result: "verified" | "failed"; + engine: { + identity: string; + version: string; + sourceCommit: string; + bundleDigest: Hash; + rulesDigest: Hash; + }; + checks: CheckEvidence[]; + entryCount: number; + categories: string[]; + historicalEntriesPreserved: boolean; + sourceLinksPreserved: boolean; + findings: Finding[]; +}; +``` + +## Validation of both documents -The changelog agent refuses a request whose `readiness.status` is not `ready` for the pre-changelog checks, or whose fields are missing, and replies `failed` with a reason. +- Every field is required. Reject unknown fields, duplicate paths or check IDs, and malformed values. +- Hash exact file bytes. Compute snapshot digests as SHA-256 of canonical JSON with lexically sorted keys and path-sorted file records. +- Versions use strict SemVer 2.0 (no `v`, whitespace or numeric leading zeros). Dates are valid `YYYY-MM-DD` and are never inferred from the clock. -## Response +## Readiness rules -| Field | Description | -|-------|-------------| -| `result` | `verified` or `failed`. | -| `evidence` | Required when `verified`: validation outcome, categories found, Unreleased entry count, and the validation engine identity and version used. | -| `reason` | Required when `failed`. | +Passed prechecks, entry validity and whole-document validity are distinct from final readiness. + +A successful handback (`verified`) must: + +- Match the request ID, target repository and root, branch and commit, snapshot, changelog, intended version and release date. +- Identify the expected engine, bundle and rules provenance. +- Provide independently verified evidence for every required check. +- Report a positive entry count, only the six permitted categories, preserved history and source links, and no blocker findings. + +Matching hashes bind content but do not prove authentic execution. Final `ready` requires independently trusted execution evidence and a final unchanged-snapshot check. Supplied success that cannot be verified stays blocking. ## Release-agent handling | Situation | Outcome | |-----------|---------| -| `verified` with evidence | Readiness may be reported complete. | -| `failed` | `not-ready`, `changelog-unverified`, reason surfaced. | +| `verified` meeting every rule above | Readiness may be reported complete. | +| `failed`, or `verified` that breaks any rule above | `not-ready`, `changelog-unverified`, findings surfaced. | | No response (none returned within the same invocation; no timer), malformed response, or changelog agent unavailable | `not-ready`, `changelog-unverified`. Never a silent fallback or skipped gate. | -Verification is read-only. Applying changelog edits is a separate operation requiring its own approval. +Verification is read-only. Applying changelog edits is a separate operation requiring its own approval, and a verification response never authorises an edit. + +## Required failure examples + +Fixtures cover: missing handback; wrong target, version or date; stale snapshot; unexpected engine, bundle or rules provenance; missing, failed or skipped check; forged success; warnings concealing blockers; zero entries; unsupported category; preservation failure; malformed input; concurrent change. + +Every failure keeps `not-ready` and leaves target bytes, index, refs and input objects unchanged, with: + +```json +{"proposedEdits":[],"writeSet":[],"writes":0} +``` diff --git a/.github/specs/020-portable-changelog-release-agents/data-model.md b/.github/specs/020-portable-changelog-release-agents/data-model.md index 43f07dbc86..139f9db860 100644 --- a/.github/specs/020-portable-changelog-release-agents/data-model.md +++ b/.github/specs/020-portable-changelog-release-agents/data-model.md @@ -88,8 +88,8 @@ Concrete flag names, command shape and exit codes are decided in tasks T023 and | Release | Approved preparation (version fields only) | Allowlisted version fields | Digest of the exact proposed edit (FR-029) | | Changelog | Inspect | None | None | | Changelog | Draft | None | None | -| Changelog | Validate (verification evidence for the handoff) | None | None | -| Changelog | Prepare release | None until approved | Digest of the exact proposed edit | +| Changelog | Validate (entry and document checks; does not imply readiness) | None | None | +| Changelog | Prepare release (read-only release proposal and verification request) | None | None | | Changelog | Approved apply (`CHANGELOG.md` only, FR-009) | `CHANGELOG.md` | Digest of the exact proposed edit (FR-029) | Dry run is the default for both agents; no environment variable or flag may widen it without a matching approval digest. See [contracts/approval-digest.md](./contracts/approval-digest.md). diff --git a/.github/specs/020-portable-changelog-release-agents/quickstart.md b/.github/specs/020-portable-changelog-release-agents/quickstart.md index 7761fd93d4..2a4158bbb3 100644 --- a/.github/specs/020-portable-changelog-release-agents/quickstart.md +++ b/.github/specs/020-portable-changelog-release-agents/quickstart.md @@ -70,7 +70,14 @@ Fixtures are committed files under each agent's `tests/fixtures/`. Names below a | Scenario | Expected | |----------|----------| -| `verified` with evidence | Readiness may complete. | +| `verified` handback meeting every contract rule, with independently trusted execution evidence | Readiness may complete. | | `failed`, missing, malformed or unavailable responder | `not-ready` with `changelog-unverified`. | +| Forged matching evidence (hashes match, execution not independently verified) | `not-ready`; matching hashes bind content but do not prove execution. | +| Stale snapshot (target changed after the request) | `not-ready`; no files change. | +| Missing or skipped required check | `not-ready`. | + +"Verified with evidence" alone does not establish readiness. Until required link verification and independently trusted execution are available, populated release candidates remain `not-ready`. Every failure leaves `proposedEdits` and `writeSet` empty and `writes` at `0`. + +Fixture expectations are not delivery evidence; record only observed results. Contracts: [readiness-report](./contracts/readiness-report.md), [verification-handoff](./contracts/verification-handoff.md), [agent-package-layout](./contracts/agent-package-layout.md). Entities: [data-model.md](./data-model.md). diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 8683288279..3242f54c5b 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -112,6 +112,21 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Decision**: tag creation, push, publication and backmerge are outside the executable MVP. They are documented only as the release-process contract (FR-023, FR-024) and require separately approved, target-specific flows. The single-PR versus two-PR contradiction in current release docs is resolved in the DOC slice by stating one invariant (no tag before reviewed changes reach the authoritative main release commit) and allowing target-specific branch flow. +## Canonical-engine baseline (inspected) + +| Property | Inspected value | +|----------|-----------------| +| Source commit | `65a013b25eb4f81806496965adad8e3f458a34e5` (matches `origin/develop` when checked 2026-10-12) | +| Engine | `@lightspeedwp/changelog-validation` | +| Package and rules version | `1.0.0` | +| Rules SHA-256 | `a1380ce9536e24a15d87f65a013467c44665ce04f64d6152f8483a30bfc0fd0f` (recomputed from `.github/validation/changelog/rules.json` on 2026-10-12) | + +These identify inspected source. They are not a portable-bundle digest and not proof of execution. + +Per the maintainer's inspection (not re-checked here), the current implementation counts UTF-16 units, skips or defers link verification, and can exit zero on empty-entry or warning outcomes. The proposed repin to version `2.0.0` with reviewed regression tests is a proposal, not a completed release. + +Portable redistribution still depends on a complete manifest, bundle digest, dependency verification and authoritative licence notices. The maintainer reported no engine-local licence text; that does not establish that no authoritative licence exists elsewhere. + ## Open items carried forward 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index a888a389d6..695a851137 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -181,7 +181,7 @@ A governance maintainer reviews a traceable plan that maps existing GitHub issue - **FR-009**: The changelog agent MUST work standalone to inspect, draft, validate and prepare release entries, and MUST apply edits only when separately approved (as defined in FR-029) and bounded. A bounded edit touches only `CHANGELOG.md`, moves the Unreleased entries into one versioned section, adds a fresh Unreleased section, and leaves released sections and links byte-identical. The changelog agent is the only agent that edits `CHANGELOG.md`; the release agent never does and only requests verification through the handoff (FR-014). - **FR-010**: The agent MUST reuse the shipped changelog validation engine and MUST NOT introduce a second engine, meaning no independently written validation logic. The pinned bundled copy is not a second engine: it is generated from the shipped engine by the refresh script and checked against its pin. A copied agent package MUST validate with a bundled copy of that engine pinned to a recorded version, and every validation result MUST state the engine version it used. -- **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 characters, user-focused and linked to a PR or issue (constitution Principle IX). +- **FR-011**: The agent MUST preserve historic entries and links, handle Unreleased idempotently, and accept only the categories Added, Changed, Deprecated, Removed, Fixed and Security. Entries MUST be at most 250 Unicode code points (counting rules in Validation Policy and Implementation Status), user-focused and linked to a PR or issue (constitution Principle IX). - **FR-012**: The local MVP MUST function without the unbuilt `changelog.yml` or `release.yml` workflows. - **FR-013**: The five-operation shared-skill obligations carried by the existing changelog MVP issue MUST be preserved. @@ -238,6 +238,16 @@ The five operations carried by [#2653 – aiops: changelog-agent - Deliver porta Dry runs write nothing, and a verification response never authorises an edit. Task T032 confirms this list against the issue before implementation. +### Validation Policy and Implementation Status + +The decisions recorded in [GIT-1303](https://linear.app/lightspeedwp/issue/GIT-1303/docs-changelog-agent-specify-operations-and-verification) specify intended behaviour, not capabilities already shipped: + +- **Counting**: maximum 250 Unicode code points, inclusive. Include Markdown punctuation, labels and inline URLs; exclude structural bullets and headings and standalone reference definitions. Join trimmed continuation lines with one space. Do not normalise Unicode; combining marks count separately. Historical 60 and 150 limits apply only where target policy requires them. +- **Links**: distinguish reference syntax from verified existence and accessibility. Resolve against the selected repository. Missing, denied, deferred or unavailable required verification blocks readiness. Require merged PR status only where target policy demands it. Networking needs separate approval. +- **Release structure**: allow structurally valid first releases without numbered history. Require exactly one real Unreleased heading and only Added, Changed, Deprecated, Removed, Fixed and Security categories. An empty Unreleased section may pass inspection, never readiness. +- **Fail-closed checks**: missing rules, implementations or required results cannot pass. Blocking or incomplete checks override aggregate scores and warning or exit-zero outcomes. +- **Preservation**: preserve historical entries, source links, Unicode and line endings. Permitted comparison-link transformations must be specified explicitly; never infer repository tag conventions. + ## Success Criteria *(mandatory)* ### Measurable Outcomes diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index e18586368c..912e35a749 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -127,13 +127,13 @@ description: "Task list for spec 020: portable changelog and WordPress release p ### Tests for User Story 3 -- [ ] T039 [P] [US3] Write failing Jest tests in `agents/release-agent/scripts/__tests__/handoff.test.cjs` for the request and response in `.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md`: `verified` with evidence allows ready; `failed`, no response, malformed response and unavailable responder each yield `not-ready` with `changelog-unverified`; no silent fallback or skipped gate (FR-014, SC-005). "No response" means none was returned within the same invocation; no timer is used (FR-014). -- [ ] T040 [P] [US3] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/handoffResponder.test.cjs`: the responder refuses a request whose `readiness.status` is not `ready` or whose required fields are missing and replies `failed` with a reason; `evidence` is required when `verified`. +- [ ] T039 [P] [US3] Write failing Jest tests in `agents/release-agent/scripts/__tests__/handoff.test.cjs` for the request and response in `.github/specs/020-portable-changelog-release-agents/contracts/verification-handoff.md`: a `verified` handback meeting every rule in the contract allows ready; `failed`, no response, malformed response and unavailable responder each yield `not-ready` with `changelog-unverified`; no silent fallback or skipped gate (FR-014, SC-005). "No response" means none was returned within the same invocation; no timer is used (FR-014). +- [ ] T040 [P] [US3] Write failing Jest tests in `agents/changelog-agent/scripts/__tests__/handoffResponder.test.cjs`: the responder refuses a request whose `precheckStatus` is not `passed`, or that has missing or unknown fields, duplicate paths or malformed values, and replies `failed` with findings; a `verified` handback carries every required field, including engine provenance. ### Implementation for User Story 3 -- [ ] T041 [US3] Implement the verification request builder in `agents/release-agent/scripts/handoff.request.cjs` carrying `contractVersion`, `repoRoot`, `targetVersion`, `readiness` and `changelogPath`. Depends on T025, T039. -- [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than `verified` with evidence. Depends on T041. A response not returned within the same invocation is treated as not received (FR-014). +- [ ] T041 [US3] Implement the verification request builder in `agents/release-agent/scripts/handoff.request.cjs` carrying the `changelog-verification/v1` Request fields: `contractVersion`, `requestId`, `target` snapshot, `targetVersion`, `releaseDate`, `changelog` file hash and `precheckStatus`. Depends on T025, T039. +- [ ] T042 [US3] Implement the handback evaluation in `agents/release-agent/scripts/handoff.evaluate.cjs` that maps every response state to a readiness outcome and sets the `changelog-unverified` blocker on anything other than a `verified` handback that meets every rule in the contract. Depends on T041. A response not returned within the same invocation is treated as not received (FR-014). - [ ] T043 [US3] Implement the responder in `agents/changelog-agent/scripts/handoff.responder.cjs` using the verification operation from T037. Depends on T037, T040. - [ ] T044 [US3] Wire the final ready decision in `agents/release-agent/scripts/readiness.operation.cjs` so ready requires recorded verification success, and confirm the handoff needs no new labels, event services, `changelog.yml` or `release.yml` (FR-015). Depends on T042, T043. - [ ] T045 [US3] If the integration needs code from the other agent's pull request beyond the handoff contract files, so it does not fit either independent slice, prepare the exact follow-on integration PR preview from `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` (branch `aiops/release-agent-changelog-handoff`, base `develop`, `pr_aiops.md`, label set A) for approval. Do not create it automatically. From 06f2675e8b9fe67b6a0a359fb110cf102e8e822d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 02:09:26 +0000 Subject: [PATCH 24/24] docs: release-agents - Record decision to keep spec number 020 The 019 Qodo spec merged and the duplicate 020 was cleared when the WordPress specs were renumbered to 023 and 024. The maintainer confirmed this specification keeps 020. Update research R-11, the spec assumption, plan gate risk, T006 and the delivery plan: the remaining audit failure is a gap at 021 and 022, reserved by specs not yet merged. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01XLxQdVHPM9myduXvRKyeDA --- .../020-portable-changelog-release-agents/delivery-plan.md | 4 ++-- .github/specs/020-portable-changelog-release-agents/plan.md | 2 +- .../specs/020-portable-changelog-release-agents/research.md | 3 ++- .github/specs/020-portable-changelog-release-agents/spec.md | 2 +- .github/specs/020-portable-changelog-release-agents/tasks.md | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/specs/020-portable-changelog-release-agents/delivery-plan.md b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md index 29e57b4680..8a7786db77 100644 --- a/.github/specs/020-portable-changelog-release-agents/delivery-plan.md +++ b/.github/specs/020-portable-changelog-release-agents/delivery-plan.md @@ -89,7 +89,7 @@ Documentation (DOC, SETUP) uses merged contracts and never stacks on unfinished ## Merge order -1. S (#3883), once the 019 numbering gap is resolved. It is independent of the rest. +1. S (#3883), once the numbering gap at 021 and 022 is resolved. It is independent of the rest. 2. F (#3881), after its diff, checks and reviews are read and its blocker is understood. 3. R1 and C2 as siblings from refreshed `develop`; R1 is not reported ready until C2 evidence exists. 4. Optional follow-on handoff integration PR, if needed, after R1 merges and depending on C2. @@ -100,7 +100,7 @@ Documentation (DOC, SETUP) uses merged contracts and never stacks on unfinished | Item | Detail | |------|--------| -| 019 numbering gap | The spec audit requires contiguous numbers and 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch, so S fails Specification Validation until the 019 spec merges or the owner approves another resolution. | +| Numbering gap at 021 and 022 | The spec audit requires contiguous numbers. 019 (Qodo) has merged and the duplicate 020 was cleared by #3962, but 021 and 022 are reserved by specs not yet on `develop`, so S fails Specification Validation until they merge or the owner approves another resolution. This specification keeps 020. | | "AI Feedback Validation" check | Requests a `Closes` or `Resolves` link and a `FEEDBACK_RESPONSE.md`. S currently uses `Relates to`. The owner decides whether `Closes #1555` is acceptable. | | PR #3881 blocker | Reviews and the cause of `blocked` were not read. | | Linear parenting | GIT-1310, GIT-1744 and GIT-2623 have no parent; reparenting is an approval item (A9 in the issue map). | diff --git a/.github/specs/020-portable-changelog-release-agents/plan.md b/.github/specs/020-portable-changelog-release-agents/plan.md index 531c3076e1..a3e567fee1 100644 --- a/.github/specs/020-portable-changelog-release-agents/plan.md +++ b/.github/specs/020-portable-changelog-release-agents/plan.md @@ -76,7 +76,7 @@ Children of the epic outside spec 020 (GIT-701 pr-agent, GIT-106 issue-agent, GI | IX Changelog compliance | Pass. Entries must stay within the length rule and link to PRs/issues; the agent validates using the shipped engine. | | X Metrics-driven governance | Pass. No new dashboards; reuses existing validation output. | -**Gate risk (not a violation)**: the Specification Validation check on the spec PR currently fails on the 019 numbering gap (reserved Qodo spec). Resolution is owner-decided; see the PR comment and [research.md](./research.md) R-11. +**Gate risk (not a violation)**: the Specification Validation check on the spec PR has failed on numbering: first the 019 gap (since resolved by the Qodo merge), then a duplicate 020 (cleared by #3962), and now a gap at 021 and 022, which are reserved by unmerged specs. This specification keeps 020; see [research.md](./research.md) R-11. **Post-design re-check**: no new violations. The Complexity Tracking table is not needed. diff --git a/.github/specs/020-portable-changelog-release-agents/research.md b/.github/specs/020-portable-changelog-release-agents/research.md index 3242f54c5b..a3f55617ed 100644 --- a/.github/specs/020-portable-changelog-release-agents/research.md +++ b/.github/specs/020-portable-changelog-release-agents/research.md @@ -83,6 +83,7 @@ Evidence base: repository at `origin/develop` `65a013b25eb4f81806496965adad8e3f4 - **Finding**: `.specify/scripts/bash/audit-specs.sh` fails on gaps; 019 is reserved on an unmerged branch. - **Decision (2026-10-10)**: the maintainer decided this specification keeps number 020 and does not take 019, so renumbering is not an option. The failing audit is therefore cleared only by the maintainer either merging the 019 Qodo spec first or approving a separate change that lets the audit script accept reserved numbers. Neither is performed by this plan, and the choice between them is still open. +- **Update (2026-10-22)**: the 019 Qodo spec has merged, and the duplicate 020 introduced by #3959 was cleared when #3962 renumbered the WordPress DB migration and schema audit specs to 024 and 023. The maintainer confirmed this specification keeps 020, so a comment asking for a rename to 022 is not applied. The audit now reports a gap (`expected 21 but found 23`) because 021 and 022 are reserved by specs not yet on `develop`. It clears when those specs merge or the owner approves an audit change allowing reserved numbers. Renaming this spec would not clear it. ### R-13 Approval is a digest of the exact proposed edit @@ -131,5 +132,5 @@ Portable redistribution still depends on a complete manifest, bundle digest, dep 1. Decide whether GIT-1310, GIT-1744 and GIT-2623 should be linked under GIT-1293 (R-10). 2. Read PR #3881 diff and checks (R-02). -3. 019 numbering gap resolution (R-11). +3. Numbering gap at 021 and 022 (R-11): clears when the reserved specs merge or the owner approves an audit change. This specification keeps 020. 4. Decisions A9 and A11 in `issue-map.md` (A1 to A8 and A10 were applied or needed no change on 2026-10-10). diff --git a/.github/specs/020-portable-changelog-release-agents/spec.md b/.github/specs/020-portable-changelog-release-agents/spec.md index 695a851137..58c5c3a4da 100644 --- a/.github/specs/020-portable-changelog-release-agents/spec.md +++ b/.github/specs/020-portable-changelog-release-agents/spec.md @@ -267,7 +267,7 @@ The decisions recorded in [GIT-1303](https://linear.app/lightspeedwp/issue/GIT-1 ## Assumptions -- Feature number 020 is final. Maintainer decision 2026-10-10: this specification keeps number 020 and does not take 019. Number 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. +- Feature number 020 is final. Maintainer decision 2026-10-10: this specification keeps number 020 and does not take 019. Number 019 is reserved on the unmerged `aiops/qodo-pr-agent-integration` branch and is not allocated here. Maintainer decision 2026-10-22: 020 is kept after the 019 Qodo spec merged and the duplicate 020 was renumbered away by #3962; the remaining audit gap at 021 and 022 does not change this. Develop was at `65a013b25eb4f81806496965adad8e3f458a34e5` at drafting; these refs are inspected facts, not permanent guarantees, and must be rechecked before the PR. - Existing work is reused: the in-flight consolidation (issue 3880 / PR 3881, head `7e0bcaab55703f0866d1c063c0b6e7530b97b747`, open and blocked, not merged), merged PR 3820, and spec 016 with the shipped `.github/validation/changelog/` engine. - Default delivery is S independent, existing consolidation finished, then release MVP and changelog MVP branched from refreshed develop; stacking the release MVP on PR 3881 happens only if it needs layout available exclusively there, and never on the Qodo reservation. - Pilot repositories, installer behaviour, marketplace distribution, workflow restoration and rollback are later work owned by existing issues; no pilot architecture or code transfer is decided here. diff --git a/.github/specs/020-portable-changelog-release-agents/tasks.md b/.github/specs/020-portable-changelog-release-agents/tasks.md index 912e35a749..b3dd3db16a 100644 --- a/.github/specs/020-portable-changelog-release-agents/tasks.md +++ b/.github/specs/020-portable-changelog-release-agents/tasks.md @@ -38,7 +38,7 @@ description: "Task list for spec 020: portable changelog and WordPress release p - [X] T003 Obtain owner confirmation of the provisional decisions R-06 (one adapter module or two slices), R-07 and R-08 by running `/speckit-clarify`, then update `.github/specs/020-portable-changelog-release-agents/research.md` and `spec.md` Open Decisions. Done 2026-10-10: R-06, R-07 and R-08 are all decided. - [ ] T004 [P] Inventory every caller, export and test of `agents/wordpress-release-utilities-agent/` (references found: `.github/dependabot.yml`, `tests/jest.working-tree-guard.cjs`, `.github/reports/audit/agent-specs-phase3-validation.json`, `scripts/validation/skills-baseline.json`) and write the inventory table into `.github/specs/020-portable-changelog-release-agents/research.md` finding A-8. No removal is planned from this task. - [ ] T005 [P] Verify Jest discovery and package commands before any test file moves: run `npx jest --config .jest.config.cjs --listTests` and confirm the new `scripts/__tests__/` and `scripts/adapters/__tests__/` locations for both agents are matched; record the result in `.github/specs/020-portable-changelog-release-agents/research.md` finding A-9. Existing Node-test, PHP and Playwright tests are not converted. -- [ ] T006 Owner decision, not executed by Claude: resolve the 019 numbering gap that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved 019 Qodo spec first, or approve a separate change allowing reserved numbers). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. +- [ ] T006 Owner decision, not executed by Claude: resolve the numbering gap at 021 and 022 that fails `.specify/scripts/bash/audit-specs.sh` (merge the reserved specs first, or approve a separate change allowing reserved numbers); this specification keeps 020 (019 Qodo has merged). Record the outcome in `.github/specs/020-portable-changelog-release-agents/delivery-plan.md` Blockers. **Checkpoint**: Paths, decisions and test discovery are confirmed.