Skip to content

fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types - #1422

Open
ZaredRogers wants to merge 5 commits into
developfrom
feat/playwright-testing-agent-update-fix
Open

fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types#1422
ZaredRogers wants to merge 5 commits into
developfrom
feat/playwright-testing-agent-update-fix

Conversation

@ZaredRogers

Copy link
Copy Markdown
Contributor

Linked issues

Closes #1421

Follows the merged #1392. Independent of #1394, #1395 and #1398.

Why this branch exists

A rebase on feat/playwright-testing-agent-updates went wrong and the reported conclusion was that the PR and its work had been destroyed. Verification first: almost nothing was lost, and the diagnosis was incorrect.

"Absorbed into develop" is not a git mechanism. #1392 merged into develop, making its six commits ancestors of it — so the PR then displayed almost no diff, because develop...branch is empty for work already in the base. Nothing was destroyed by that.

I compared aea71a0f against develop file-by-file across all 11 differing files rather than trusting markers. develop's agent folder is healthy. Every difference is an improvement or cosmetic:

file change verdict
SKILL.md persistence step made portability-aware fixes a real inconsistency with core-prompt.md
core-prompt.md a11y Explore bullet strengthened — findings are gaps/proposed by default improvement
claude/agent.md clearer pre-flight wording improvement
README.md five 404ing workflow badges removed fix
AGENT.md, hooks README version bump, footer collapsed cosmetic

So this PR is deliberately small. That is the correct outcome, not evidence of further loss.

What this changes

1. Restores a destroyed file

.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md was cut from 117 lines to 22 — only frontmatter and a footer survived, the entire body gone. Restored from aea71a0f. Restored from the commit rather than a working tree, because local copies were damaged too.

2. Recovers a commit that existed in no shared location

233b1b21fix(ci): support cross-repo issue references in validate-pr-template (@copilot-swe-agent) — was absent from develop and from the remote branch. hasIssueReference matched only bare same-repo #123, so bodies using the standard owner/repo#123 form or full GitHub URLs were wrongly flagged as missing a linked issue. Cherry-picked with its tests before it could be lost.

3. Extends the content-parity invariant from five types to all eight

The invariant added in #1392 declared only a five-type prefix, so drift in the remaining three went undetected. The blocker was that the three files restating the taxonomy phrased it three different ways — slash-vs-word forms and an inconsistent trailing "or" — making the five-type prefix the maximal common substring:

file tail, before
core-prompt.md …integration rule, **or** error **or** empty state
AGENT.md …integration rule, error **or** empty state
SKILL.md …analytics**/**conversion rule, integration rule, **or** error**/**empty state

Unified on core-prompt.md's wording. Safe because the word form was already the house standard (3 of 4 occurrences) and the slash form appeared in exactly one line — so no internal inconsistency is introduced. agent/instructions/AGENTS.md also carries a type list but is deliberately untouched: it is the preserved pre-migration export snapshot, not live source.

Two traps deliberately avoided

The old remote branch eb4c0184 is not a recovery source. It sits behind develop — applying it would be 71 insertions against 3842 deletions — and it silently removes the test "a symlink pointing outside is rejected after resolution", which exists to prove the path-traversal oracle stays closed against symlinks. That test is verified present here.

Local 14ae0dff is not carried. It extends the taxonomy string but deletes a "files": [ line, leaving consistency.json invalid JSON. The working tree was clean, so the breakage was committed.

Neither the old branch nor PR #1392 has been touched, and nothing was force-pushed — aea71a0f and 233b1b21 remain reachable if anything else surfaces.

Verification

The parity hook is its own oracle, so this was tested empirically rather than by inspection — including negatively in both ranges:

# passes clean
node hooks/multi-provider-consistency-checker/index.js agents/playwright-testing-agent   #

# and fails on drift — original prefix, and newly covered types
sed -i.bak 's/accessibility rule, performance rule/accessibility rule/' "$WORK/agent/AGENT.md"
# → ❌ 'requirement-type-taxonomy' out of sync: AGENT.md

sed -i.bak 's/integration rule, or error or empty state/integration rule/' "$WORK/agent/…/SKILL.md"
# → ❌ 'requirement-type-taxonomy' out of sync: …/SKILL.md

Drift tests run against a cp -R throwaway copy with a trap cleanup — never git checkout to undo, which would discard unrelated uncommitted work.

check result
consistency.json valid JSON
parity check ✅ passes; fails on drift in both ranges
symlink-containment test present ✅ 1 occurrence
npx jest hooks/ ✅ 44/44
template-helpers suite ✅ 48/48
npm run validate:agent-hooks
audit report restored ✅ 117 lines
markdownlint ✅ 0 issues across 227 files
validate:changelog 2 pre-existing errors, warnings 50 → 42
diff vs develop only these changes; no deletions of newer work

CHANGELOG entries are written to the repo's own changelog-rules limits — title ≤ 60 chars, description ≤ 150, ≤ 2 sentences — rather than the file's prevailing verbose style, which is why warnings fell.

Changelog

Added

  • Content-parity invariant covers all eight requirement types.

Changed

  • Taxonomy wording unified across core-prompt.md, AGENT.md and the test-pack-builder SKILL.

Fixed

  • Restored the Keep a Changelog conformance audit destroyed during a rebase.
  • validate-pr-template no longer rejects valid cross-repo issue references.

Removed

  • Nothing.

Checklist (Global DoD / PR)

Why three boxes remain unticked

Deliberately, because ticking them would state something untrue. Two are genuinely outstanding — CI is red for reasons that predate this branch, and review has just been requested — and one does not apply to a diff with no user interface. They will be ticked when they become true.

This makes validate-pr-template fail, and in its current design that is correct: the DoD is not met. The gate is not satisfiable honestly either, since hasCompletedChecklist() requires zero unchecked boxes with no way to express N/A, and includes rows that cannot be true when a PR is opened for review. Tracked as #1398.

🤖 Generated with Claude Code

Copilot AI and others added 3 commits July 30, 2026 14:03
The hasIssueReference regex only matched bare #123 same-repo references.
PR bodies that use the standard GitHub cross-repo format (owner/repo#123)
or full GitHub URLs were incorrectly flagged as missing linked issues.

Update the regex to optionally allow an owner/repo prefix before #number,
and add a secondary URL match for https://github.com/.../issues/NNN and
.../pull/NNN patterns. Add corresponding test cases.

Fixes the validate-pr-template failure on PR #1392 whose body opens with:
  Closes #1393
…l taxonomy invariant

Recovery branch off develop after a rebase on feat/playwright-testing-agent-updates
went wrong. Verification first, so the scope here is deliberately small.

What was NOT lost. The claim that commits were "absorbed into develop" is not a
git mechanism — the branch was merged into develop, making ab9b51e, 190d2a7,
3dbf776, 4f55091, dd43fc4 and aea71a0 ancestors of it. The PR then showed
almost no diff because develop...branch is empty for work already in the base.
A file-by-file diff of aea71a0 against develop across all 11 differing files
confirms nothing was lost: SKILL.md's persistence step was made portability-aware
(fixing a real inconsistency), core-prompt's a11y Explore bullet was
strengthened, README's five 404ing workflow badges were removed, and the rest is
version/footer cosmetics.

Restores the one genuine casualty:

- .github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md was gutted
  from 117 lines to 22 — body destroyed, only frontmatter and a footer left.
  Restored from aea71a0. The local worktree copy was damaged too, so it was
  restored from the commit rather than the working tree.

Strengthens the taxonomy invariant from five types to all eight:

- The three files that restate the requirement types phrased the tail three
  different ways (slash vs word forms, and an inconsistent trailing "or"), which
  is why the declaration covered only the five-type common prefix — that prefix
  was the maximal common substring.
- Unified SKILL.md and AGENT.md onto core-prompt's wording. The word form was
  already the house standard (3 of 4 occurrences) and the slash form appeared in
  exactly one line, so this creates no internal inconsistency.
- consistency.json now declares all eight types. Verified negatively in both
  ranges: breaking `performance rule` in AGENT.md and breaking `integration rule`
  in SKILL.md each fail the check and name the offending file.

Note agent/instructions/AGENTS.md also carries a type list but is deliberately
untouched — it is the preserved pre-migration export snapshot, not live source.

Deliberately not taken from the old remote branch (eb4c018): it is behind
develop (applying it would be 71 insertions against 3842 deletions) and it
removes the test "a symlink pointing outside is rejected after resolution",
which exists to prove the path-traversal oracle stays closed against symlinks.
That test is verified present here. Also not taken: local 14ae0df, which left
consistency.json as invalid JSON.

Verified: parity hook passes; symlink test present; hooks 44/44;
template-helpers 48/48; validate:agent-hooks passes; audit report 117 lines;
markdownlint clean across 227 files. Diff against develop contains only these
changes and the cherry-picked CI fix, with no deletions of newer work.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ler invariant

Adds the CHANGELOG.md entries this branch requires. The changelog-validation
workflow needs an actual CHANGELOG.md commit — a Changelog section in the PR body
does not satisfy it, which is what failed on #1392.

All three entries are written to the repo's own changelog-rules limits (title
<= 60 chars, description <= 150, <= 2 sentences) rather than the file's prevailing
verbose style. Detail belongs in the PR body. Warnings drop 50 -> 42; the 2
errors are pre-existing and unrelated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ZaredRogers ZaredRogers self-assigned this Jul 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚫 This PR description is missing required template content.

Missing required section(s): Global DoD checklist

Please update the PR body using one of the repository PR templates:

Empty placeholders, unchecked checklist boxes, and stub issue references do not count.

The issue claimed #1421, so the three entries cited the wrong number.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

⏱️ Aging and SLA annotation

  • Age: 0 day(s)
  • SLA state: Within SLA
  • Thresholds: warn at 7 days, breach at 14 days
  • Last updated: 2026-07-31T07:13:46.774Z

Maintained by project-meta-sync workflow.

@github-actions github-actions Bot added status:needs-review Awaiting code review type:feature Feature or enhancement priority:normal Default priority area:documentation Docs & guides area:tests Test suites & harnesses area:scripts Scripts & tooling lang:js JavaScript/TypeScript lang:md Markdown content/docs lang:json JSON config/content type:chore Chore / small hygiene change labels Jul 30, 2026
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Updated the changelog with recent consistency improvements and corrected issue references.
    • Added an audit report documenting alignment with Keep a Changelog standards and outstanding follow-up items.
    • Clarified requirement classification terminology across testing guidance and documentation.
  • Bug Fixes

    • Improved detection of cross-repository issue references and full GitHub issue or pull-request links.
  • Tests

    • Added coverage for the newly supported issue-reference formats.

Walkthrough

The PR adds a Keep a Changelog audit report, records related changelog entries, aligns an eight-type requirement taxonomy across agent files, and extends hasIssueReference to support cross-repository references and GitHub issue or pull-request URLs.

Changes

Changelog audit restoration

Layer / File(s) Summary
Audit findings and verification
.github/reports/audits/...
The report records eleven divergences, applied structural and reference fixes, deferred release-history decisions, remaining validator errors, and validation commands.

Requirement taxonomy consistency

Layer / File(s) Summary
Eight-type taxonomy alignment
agents/playwright-testing-agent/AGENT.md, agents/playwright-testing-agent/consistency.json, agents/playwright-testing-agent/skills/..., CHANGELOG.md
The requirement taxonomy now lists eight types and uses consistent “or” wording across the rule, agent guidance, and changelog.

Issue-reference validation

Layer / File(s) Summary
Cross-repository reference matching
scripts/validation/template-helpers.cjs, scripts/validation/__tests__/template-helpers.test.js, CHANGELOG.md
hasIssueReference now matches cross-repository shorthand and full GitHub issue or pull-request URLs. Tests cover the new formats, and the changelog records the change.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • lightspeedwp/.github issue 1421: Directly covers the audit restoration, cross-repository hasIssueReference fix, and eight-type taxonomy expansion.

Possibly related PRs

Suggested labels: area:ci, area:ai, type:automation

Suggested reviewers: ashleyshaw

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the audit recovery, CI fix, and expansion of the parity invariant to all eight types.
Description check ✅ Passed The description is detailed and covers linked issues, changes, testing, changelog entries, risks, checklist status, and known limitations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/playwright-testing-agent-update-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added type:bug Bug or defect meta:needs-changelog Requires a changelog entry before merge labels Jul 30, 2026
@ZaredRogers ZaredRogers removed type:bug Bug or defect type:chore Chore / small hygiene change meta:needs-changelog Requires a changelog entry before merge labels Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores an accidentally truncated audit report, fixes PR-template validation to recognise cross-repo issue references, and strengthens the Playwright Testing Agent’s content-parity invariant by extending the requirement taxonomy from five types to all eight.

Changes:

  • Widened hasIssueReference() to detect owner/repo#123 and full GitHub issue/PR URLs, with Jest coverage.
  • Extended the multi-provider consistency taxonomy phrase to cover all eight requirement types and unified the wording across the three restatement locations.
  • Restored the full Keep a Changelog conformance audit content and recorded the work in CHANGELOG.md.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/validation/template-helpers.cjs Update issue-reference detection logic to accept cross-repo references and URLs.
scripts/validation/tests/template-helpers.test.js Add tests covering cross-repo references and full GitHub URLs.
CHANGELOG.md Document the restored audit, the validator fix, and the taxonomy/parity extension.
agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md Align taxonomy wording to the unified eight-type list.
agents/playwright-testing-agent/consistency.json Extend the shared phrase to include all eight requirement types for parity enforcement.
agents/playwright-testing-agent/AGENT.md Align taxonomy wording to match the shared phrase and core prompt.
.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md Restore the audit report body content that was lost during rebase/merge.

Comment thread scripts/validation/template-helpers.cjs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #1422

CI Status:success
Files changed: 7
Risk Distribution: 0 critical, 1 high, 1 medium, 5 low

Recommendations

  • Ready to proceed pending human review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zared Rogers <zared@lightspeedwp.agency>
@github-actions github-actions Bot added the meta:needs-changelog Requires a changelog entry before merge label Jul 31, 2026
@coderabbitai coderabbitai Bot added area:ai AI and automation systems area:ci Build and CI pipelines type:automation Automation labels Jul 31, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md:
- Around line 53-57: Update the preservation invariant in the audit entry to
state that all 462 non-placeholder list items were preserved, while three
placeholder items were intentionally removed. Keep the surrounding item counts
and scripted-pass details consistent, and use clear UK English.

In
`@agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md`:
- Line 81: Update the list introduction in the classification guidance to
replace “classify it as one of:” with “classify it as one of the following:”,
preserving the existing eight taxonomy categories unchanged.

In `@CHANGELOG.md`:
- Line 31: Add issue links to the three specified Unreleased changelog entries
in CHANGELOG.md: the taxonomy entry at lines 31-31 and both new Fixed entries at
lines 120-123. Preserve their existing PR links and ensure each entry includes
an issue link as required by the changelog conventions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 1888adb6-4769-44e5-8f5e-de662e12f4a7

📥 Commits

Reviewing files that changed from the base of the PR and between e6cd1eb and 823d72b.

📒 Files selected for processing (7)
  • .github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md
  • CHANGELOG.md
  • agents/playwright-testing-agent/AGENT.md
  • agents/playwright-testing-agent/consistency.json
  • agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md
  • scripts/validation/__tests__/template-helpers.test.js
  • scripts/validation/template-helpers.cjs
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
⚠️ CI failures not shown inline (4)

GitHub Actions: reviewer / coderabbit-gate: fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   github-***REDACTED_SECRET_ASSIGNMENT***
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const sha = context.payload.pull_request.head.sha;
const maxAttempts = 20;
const delayMs = 15000;
for (let i = 1; i <= maxAttempts; i++) {
  const { data } = await github.rest.repos.getCombinedStatusForRef({
    owner,
    repo,
    ref: sha,
  });
  const coderabbit = (data.statuses || []).find((s) => s.context === "CodeRabbit");
  if (coderabbit && coderabbit.state === "success") {
    core.info(`CodeRabbit is successful on attempt ${i}.`);
    return;
  }
  if (coderabbit && coderabbit.state === "failure") {
    core.setFailed("CodeRabbit failed; reviewer job is blocked until fixed.");
    return;
  }
  core.info(`Waiting for CodeRabbit success (${i}/${maxAttempts})...`);
  await new Promise((resolve) => setTimeout(resolve, delayMs));
}
core.setFailed("Timed out waiting for CodeRabbit success; reviewer job blocked.");
   debug: false
   user-agent: actions/github-script
   result-encoding: json
   retries: 0
   retry-exempt-status-codes: 400,401,403,404,422
 ##[endgroup]
 Waiting for CodeRabbit success (1/20)...
 Waiting for CodeRabbit success (2/20)...
 Waiting for CodeRabbit success (3/20)...
 Waiting for CodeRabbit success (4/20)...
 Waiting for CodeRabbit success (5/20)...
 Waiting for CodeRabbit success (6/20)...
 Waiting for CodeRabbit success (7/20)...
 Waiting for CodeRabbit success (8/20)...
 Waiting for CodeRabbit success (9/20)...
 Waiting for CodeRabbit success (10/20)...
 Waiting for CodeRabbit success (11/20)...
 Waiting for CodeRabbit success (12/20)...
 Waiting for CodeRabbit success (13/20)...
 Waiting for CodeRabbit success (14/20)...
 Waiting for CodeRabbit success (15/20)...
 Waiting for CodeRabbit success (16/20)...
 Waiting for CodeRabbit success (17/20)...
 Waiting for CodeRabbit success (18/20)...
 Waiting for CodeRabbit success (19/20)...
 Waiting for CodeRabbit success (20...

GitHub Actions: reviewer / 1_coderabbit-gate.txt: fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   github-***REDACTED_SECRET_ASSIGNMENT***
   script: const owner = context.repo.owner;
const repo = context.repo.repo;
const sha = context.payload.pull_request.head.sha;
const maxAttempts = 20;
const delayMs = 15000;
for (let i = 1; i <= maxAttempts; i++) {
  const { data } = await github.rest.repos.getCombinedStatusForRef({
    owner,
    repo,
    ref: sha,
  });
  const coderabbit = (data.statuses || []).find((s) => s.context === "CodeRabbit");
  if (coderabbit && coderabbit.state === "success") {
    core.info(`CodeRabbit is successful on attempt ${i}.`);
    return;
  }
  if (coderabbit && coderabbit.state === "failure") {
    core.setFailed("CodeRabbit failed; reviewer job is blocked until fixed.");
    return;
  }
  core.info(`Waiting for CodeRabbit success (${i}/${maxAttempts})...`);
  await new Promise((resolve) => setTimeout(resolve, delayMs));
}
core.setFailed("Timed out waiting for CodeRabbit success; reviewer job blocked.");
   debug: false
   user-agent: actions/github-script
   result-encoding: json
   retries: 0
   retry-exempt-status-codes: 400,401,403,404,422
 ##[endgroup]
 Waiting for CodeRabbit success (1/20)...
 Waiting for CodeRabbit success (2/20)...
 Waiting for CodeRabbit success (3/20)...
 Waiting for CodeRabbit success (4/20)...
 Waiting for CodeRabbit success (5/20)...
 Waiting for CodeRabbit success (6/20)...
 Waiting for CodeRabbit success (7/20)...
 Waiting for CodeRabbit success (8/20)...
 Waiting for CodeRabbit success (9/20)...
 Waiting for CodeRabbit success (10/20)...
 Waiting for CodeRabbit success (11/20)...
 Waiting for CodeRabbit success (12/20)...
 Waiting for CodeRabbit success (13/20)...
 Waiting for CodeRabbit success (14/20)...
 Waiting for CodeRabbit success (15/20)...
 Waiting for CodeRabbit success (16/20)...
 Waiting for CodeRabbit success (17/20)...
 Waiting for CodeRabbit success (18/20)...
 Waiting for CodeRabbit success (19/20)...
 Waiting for CodeRabbit success (20...

GitHub Actions: Validate PR Template / 0_validate-pr-template.txt: fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   script: const { validatePullRequestBody } = require('./scripts/validation/template-helpers.cjs');
const marker = '<!-- template-enforcement -->';
const pr = context.payload.pull_request;
const author = pr.user?.login || '';
const isDependabot = author === 'dependabot[bot]' || author === 'app/dependabot';
const isImgbot = author === 'imgbot[bot]' || author === 'app/imgbot';
if (isDependabot || isImgbot) {
  core.info(`Skipping PR template validation for bot author ${author}.`);
  return;
}
const validation = validatePullRequestBody(pr.body || '', pr.labels || [], pr.head?.ref || '');
const comments = await github.paginate(github.rest.issues.listComments, {
  owner: context.repo.owner,
  repo: context.repo.repo,
  issue_number: pr.number,
  per_page: 100
});
const previous = comments.find((comment) =>
  comment.user?.type === 'Bot' && comment.body?.includes(marker)
);
if (validation.missing.length === 0) {
  if (previous) {
    await github.rest.issues.updateComment({
      owner: context.repo.owner,
      repo: context.repo.repo,
      comment_id: previous.id,
      body: `${marker}\n✅ Template check passed after update. Thanks for fixing the PR description.`
    });
  }
  return;
}
const message = [
  marker,
  '🚫 This PR description is missing required template content.',
  '',
  `Missing required section(s): ${validation.missing.join(', ')}`,
  '',
  'Please update the PR body using one of the repository PR templates:',
  '- https://github.com/lightspeedwp/.github/blob/develop/.github/pull_request_template.md',
  '- https://github.com/lightspeedwp/.github/tree/develop/.github/PULL_REQUEST_TEMPLATE',
  '',
  'Empty placeholders, unchecked checklist boxes, and stub issue references do not count.'
].join('\n');
if (previous) {
  await github.rest.issues.updateComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    comment_id: previous.id,
    body: message
  });
} else {
  await github.rest.issues....

GitHub Actions: Validate PR Template / validate-pr-template: fix(playwright-testing-agent): recover audit report and CI fix lost in rebase; extend parity invariant to all eight types

Conclusion: failure

View job details

##[group]Run actions/github-script@v7
 with:
   script: const { validatePullRequestBody } = require('./scripts/validation/template-helpers.cjs');
const marker = '<!-- template-enforcement -->';
const pr = context.payload.pull_request;
const author = pr.user?.login || '';
const isDependabot = author === 'dependabot[bot]' || author === 'app/dependabot';
const isImgbot = author === 'imgbot[bot]' || author === 'app/imgbot';
if (isDependabot || isImgbot) {
  core.info(`Skipping PR template validation for bot author ${author}.`);
  return;
}
const validation = validatePullRequestBody(pr.body || '', pr.labels || [], pr.head?.ref || '');
const comments = await github.paginate(github.rest.issues.listComments, {
  owner: context.repo.owner,
  repo: context.repo.repo,
  issue_number: pr.number,
  per_page: 100
});
const previous = comments.find((comment) =>
  comment.user?.type === 'Bot' && comment.body?.includes(marker)
);
if (validation.missing.length === 0) {
  if (previous) {
    await github.rest.issues.updateComment({
      owner: context.repo.owner,
      repo: context.repo.repo,
      comment_id: previous.id,
      body: `${marker}\n✅ Template check passed after update. Thanks for fixing the PR description.`
    });
  }
  return;
}
const message = [
  marker,
  '🚫 This PR description is missing required template content.',
  '',
  `Missing required section(s): ${validation.missing.join(', ')}`,
  '',
  'Please update the PR body using one of the repository PR templates:',
  '- https://github.com/lightspeedwp/.github/blob/develop/.github/pull_request_template.md',
  '- https://github.com/lightspeedwp/.github/tree/develop/.github/PULL_REQUEST_TEMPLATE',
  '',
  'Empty placeholders, unchecked checklist boxes, and stub issue references do not count.'
].join('\n');
if (previous) {
  await github.rest.issues.updateComment({
    owner: context.repo.owner,
    repo: context.repo.repo,
    comment_id: previous.id,
    body: message
  });
} else {
  await github.rest.issues....
🧰 Additional context used
📓 Path-based instructions (12)
**/*

📄 CodeRabbit inference engine (CLAUDE.md)

**/*: Do not use claude/ as a branch prefix. Branches must use {type}/{scope}-{short-title} with lowercase kebab-case and an approved type prefix.
Feature, fix, chore, documentation, and similar branches must target develop; only release/* and hotfix/* branches may merge to main.
After a successful squash merge, delete the remote and local branch.
Never reuse a branch name after it has been merged; create a unique replacement name.
Reusable assets must be placed in the appropriate top-level portable folder rather than under .github/.
Do not move existing agents, instructions, or schemas without a migration issue recording the source path, target path, and validation plan.
Do not commit node_modules/, build/, or other generated artefacts.
Do not add WordPress plugin- or theme-specific code to the organisation .github control-plane repository.
Do not place reports or task trackers in docs/ or the repository root; use the designated reports and project directories.
Do not enqueue editor-only WordPress assets on the front end, or front-end-only assets in the editor.

**/*: Never output secrets, treat production and customer data as sensitive, and follow the OWASP Top 10 for web security.
Before editing, validate the branch with npm run validate:branch-name -- --branch <name>; use {type}/{scope}-{short-title}, never use a claude/ prefix, and ensure feature/fix/chore branches target develop while only release/hotfix branches target main.
Prefer minimal, modular solutions; justify heavier tools based on return on investment and maintenance cost.
When requirements are uncertain, propose safe defaults and ask one focused clarifying question.
Use the canonical coding, linting, quality-assurance, documentation-format, automation and community-standards instruction indexes when applying project standards.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
  • CHANGELOG.md
  • agents/playwright-testing-agent/consistency.json
  • agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md
  • agents/playwright-testing-agent/AGENT.md
  • scripts/validation/template-helpers.cjs
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use ESLint and Prettier for JavaScript and TypeScript code.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
**/*.{php,js,ts,jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Validate all input, escape all output, use nonces where applicable, and never commit secrets.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
**/*.{js,ts,jsx,tsx,php,html,htm}

📄 CodeRabbit inference engine (CLAUDE.md)

Avoid unnecessary JavaScript, defer or lazy-load where possible, and prefer native blocks.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
**/*.{js,cjs,mjs}

📄 CodeRabbit inference engine (CLAUDE.md)

Schema references in validation scripts must use paths relative to the script location; scripts under .github/scripts/validation/ should use ../../../.schemas/.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
  • scripts/validation/template-helpers.cjs
**/*.{css,html,js,jsx,php}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{css,html,js,jsx,php}: Follow WordPress Coding Standards for CSS, HTML, JavaScript and PHP, including inline documentation standards.
Identify and address accessibility and performance issues during code reviews.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
**/*.{js,ts}

⚙️ CodeRabbit configuration file

**/*.{js,ts}: Review JavaScript/TypeScript:

  • Ensure code is linted and follows project style guides.
  • Check for dead code, unused variables, and clear function naming.
  • Validate accessibility and performance optimisations.
  • Ensure tests are isolated and do not depend on external state.
  • Check for descriptive test names and clear test structure.

Files:

  • scripts/validation/__tests__/template-helpers.test.js
**/*.{md,mdx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use UK English throughout documentation and Markdown content, including spellings such as optimise, organisation, colour, and behaviour.

Use UK English and optimise written content for clarity, scalability, maintainability and profitable outcomes.

Files:

  • CHANGELOG.md
  • agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md
  • agents/playwright-testing-agent/AGENT.md
**/*.{md,mdx,yml,yaml,json}

📄 CodeRabbit inference engine (CLAUDE.md)

Do not use a references frontmatter field; use inline links or footer sections instead.

Files:

  • CHANGELOG.md
  • agents/playwright-testing-agent/consistency.json
  • agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md
  • agents/playwright-testing-agent/AGENT.md
CHANGELOG.md

⚙️ CodeRabbit configuration file

CHANGELOG.md: Review CHANGELOG.md:

  • Confirm entries follow Keep a Changelog 1.1.0 format.
  • Each entry under [Unreleased] must include a PR link and issue link.
  • Verify entries use the correct section headings (Added, Changed, Fixed, Deprecated, Removed, Security, Documentation, Performance).
  • Check UK English spelling throughout.

Files:

  • CHANGELOG.md
**/*.json

📄 CodeRabbit inference engine (CLAUDE.md)

Portable JSON schemas must be stored under the root .schemas/ directory.

Validate JSON files against the applicable schema when a schema is provided; the frontmatter schema is referenced at schema/frontmatter.schema.json.

Files:

  • agents/playwright-testing-agent/consistency.json
agents/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Portable, multi-file agents belong under root agents/; each agent should use an {name}-agent/ directory with AGENT.md and provider-specific subdirectories such as claude/, copilot/ and openai/.

Files:

  • agents/playwright-testing-agent/consistency.json
  • agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md
  • agents/playwright-testing-agent/AGENT.md
🪛 GitHub Actions: Meta Agent / 2_front-matter-validate.txt
CHANGELOG.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-30).

agents/playwright-testing-agent/AGENT.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-30).


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (2.1.0).

.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-29). Command: npm run validate:frontmatter:changed -- --base e6cd1eb --head 823d72b.

🪛 GitHub Actions: Meta Agent / front-matter-validate
CHANGELOG.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-30). Command: npm run validate:frontmatter:changed.

agents/playwright-testing-agent/AGENT.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-30). Command: npm run validate:frontmatter:changed.


[error] 1-1: Frontmatter freshness validation failed: body changed but version was not updated (2.1.0). Command: npm run validate:frontmatter:changed.

.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md

[error] 1-1: Frontmatter freshness validation failed: body changed but last_updated was not updated (2026-07-29). Command: npm run validate:frontmatter:changed.

🪛 LanguageTool
agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md

[typographical] ~81-~81: Do not use a colon (:) before a series that is introduced by a preposition (‘of’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...uirement statement - classify it as one of: functional flow, content rule, visual r...

(RP_COLON)

.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md

[style] ~41-~41: To make your writing clearer, consider a shorter, more direct phrase.
Context: ...extract-pr-entries.cjs` | — | Fixed as a consequence of D6 | | D8 | PR references carried no ti...

(AS_A_CONSEQUENCE_OF)


[typographical] ~44-~44: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ... were never tagged: 0.6.0, 0.1.0; and two dates disagree with their tags | "The r...

(CONJUNCTION_AFTER_SEMICOLON)


[uncategorized] ~77-~77: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...mmits. Documented predecessors were used so the ranges match the document's own nar...

(COMMA_COMPOUND_SENTENCE_2)


[grammar] ~100-~100: Probably a preposition is missing after ‘references’.
Context: ... PR at all and that its description and references do not match each other. The single candid...

(ATD_VERBS_TO_COLLOCATION)


[uncategorized] ~106-~106: Possible missing comma found.
Context: ...xt steps 1. Decide D3 — reclassify, or document the extension. 2. Reconcile D9/D10 with...

(AI_HYDRA_LEO_MISSING_COMMA)

🔇 Additional comments (5)
.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md (1)

19-52: LGTM!

Also applies to: 58-117

scripts/validation/template-helpers.cjs (1)

24-27: LGTM!

scripts/validation/__tests__/template-helpers.test.js (1)

116-137: LGTM!

agents/playwright-testing-agent/consistency.json (1)

6-7: LGTM!

agents/playwright-testing-agent/AGENT.md (1)

91-91: LGTM!

Comment on lines +53 to +57
Applied as two scripted passes rather than hand edits, each with an invariant check:

1. **Structural** — merged duplicate type sections, ordered canonically, dropped empty/placeholder sections, moved non-version `##` sections below the version list.
*Invariant:* every list item preserved. 462 items in, 462 out, zero lost, zero invented. Total list items went 465 → 462, exactly the three `- [placeholder]` items removed. The two `(none identified)` lines were not list items.
2. **References** — injected 160 PR titles, corrected 6 mislabelled issue URLs, appended 5 version link definitions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clarify the preservation invariant.

“Every list item preserved” conflicts with the stated change from 465 to 462 items and the removal of three placeholder items. State that all 462 non-placeholder items were preserved, and that three placeholders were removed intentionally.

As per coding guidelines, Markdown content must use UK English and optimise written content for clarity, scalability, maintainability and profitable outcomes.

Suggested wording
-   *Invariant:* every list item preserved. 462 items in, 462 out, zero lost, zero invented. Total list items went 465 → 462, exactly the three `- [placeholder]` items removed.
+   *Invariant:* all 462 non-placeholder list items were preserved: 462 retained items in, 462 retained items out, zero lost, zero invented. Total list items went 465 → 462 because exactly the three `- [placeholder]` items were removed.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Applied as two scripted passes rather than hand edits, each with an invariant check:
1. **Structural** — merged duplicate type sections, ordered canonically, dropped empty/placeholder sections, moved non-version `##` sections below the version list.
*Invariant:* every list item preserved. 462 items in, 462 out, zero lost, zero invented. Total list items went 465 → 462, exactly the three `- [placeholder]` items removed. The two `(none identified)` lines were not list items.
2. **References** — injected 160 PR titles, corrected 6 mislabelled issue URLs, appended 5 version link definitions.
Applied as two scripted passes rather than hand edits, each with an invariant check:
1. **Structural** — merged duplicate type sections, ordered canonically, dropped empty/placeholder sections, moved non-version `##` sections below the version list.
*Invariant:* all 462 non-placeholder list items were preserved: 462 retained items in, 462 retained items out, zero lost, zero invented. Total list items went 465 → 462 because exactly the three `- [placeholder]` items were removed. The two `(none identified)` lines were not list items.
2. **References** — injected 160 PR titles, corrected 6 mislabelled issue URLs, appended 5 version link definitions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/reports/audits/changelog-keepachangelog-audit-2026-07-29.md around
lines 53 - 57, Update the preservation invariant in the audit entry to state
that all 462 non-placeholder list items were preserved, while three placeholder
items were intentionally removed. Keep the surrounding item counts and
scripted-pass details consistent, and use clear UK English.

Source: Coding guidelines

- assign a requirement ID
- write one short requirement statement
- classify it as one of: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics/conversion rule, integration rule, or error/empty state
- classify it as one of: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics or conversion rule, integration rule, or error or empty state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the list introduction.

classify it as one of: uses a colon after the preposition of. Change it to classify it as one of the following:. This keeps the eight-type taxonomy unchanged and clears the reported RP_COLON finding.

Suggested wording
- - classify it as one of: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics or conversion rule, integration rule, or error or empty state
+ - classify it as one of the following: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics or conversion rule, integration rule, or error or empty state
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- classify it as one of: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics or conversion rule, integration rule, or error or empty state
- classify it as one of the following: functional flow, content rule, visual rule, accessibility rule, performance rule, analytics or conversion rule, integration rule, or error or empty state
🧰 Tools
🪛 LanguageTool

[typographical] ~81-~81: Do not use a colon (:) before a series that is introduced by a preposition (‘of’). Remove the colon or add a noun or a noun phrase after the preposition.
Context: ...uirement statement - classify it as one of: functional flow, content rule, visual r...

(RP_COLON)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@agents/playwright-testing-agent/skills/agent-attached/hermes/test-pack-builder/SKILL.md`
at line 81, Update the list introduction in the classification guidance to
replace “classify it as one of:” with “classify it as one of the following:”,
preserving the existing eight taxonomy categories unchanged.

Source: Linters/SAST tools

Comment thread CHANGELOG.md

### Added

- **Content-parity invariant covers all eight requirement types** — `consistency.json` declares the full taxonomy so any type change breaks the check, which required unifying the list's phrasing across three files. ([PR #1422](https://github.com/lightspeedwp/.github/pull/1422))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add issue links to the new Unreleased entries.

Each affected entry has a PR link but no issue link.

  • CHANGELOG.md#L31-L31: add an issue link to the taxonomy entry.
  • CHANGELOG.md#L120-L123: add an issue link to both new Fixed entries.

As per path instructions, each entry under [Unreleased] must include a PR link and issue link.

📍 Affects 1 file
  • CHANGELOG.md#L31-L31 (this comment)
  • CHANGELOG.md#L120-L123
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 31, Add issue links to the three specified Unreleased
changelog entries in CHANGELOG.md: the taxonomy entry at lines 31-31 and both
new Fixed entries at lines 120-123. Preserve their existing PR links and ensure
each entry includes an issue link as required by the changelog conventions.

Source: Path instructions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai AI and automation systems area:ci Build and CI pipelines area:documentation Docs & guides area:scripts Scripts & tooling area:tests Test suites & harnesses lang:js JavaScript/TypeScript lang:json JSON config/content lang:md Markdown content/docs meta:needs-changelog Requires a changelog entry before merge priority:normal Default priority status:needs-review Awaiting code review type:automation Automation type:feature Feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recover audit report and CI fix lost in a rebase; extend content-parity invariant to all eight requirement types

3 participants