Skip to content

audit: Governance Files Audit & Refactor – Phase 0 & 1 Specification Complete - #3368

Open
ashleyshaw wants to merge 98 commits into
developfrom
audit/governance-files-refactor
Open

ashleyshaw wants to merge 98 commits into
developfrom
audit/governance-files-refactor

Conversation

@ashleyshaw

@ashleyshaw ashleyshaw commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Specification: Governance Files Audit & Refactor

Linked issues

Refs #45

Relates to #45 ([AI Ops] Audit and Align Governance Docs for AI Automation Standards, closed 2026-05-26), which is the audit this work answers. There is no open issue for specification 012 itself, so nothing is closed here.

Scope of Audit

This PR delivers Phase 0 & Phase 1 of the Governance Files Audit & Refactor (Spec 012):

  • Phase 0: Research & Findings – Comprehensive audit of CLAUDE.md and AGENTS.md identifying duplicates, broken references, and structural issues
  • Phase 1: Design & Contracts – Data model, governance entities, relationships, and validation scenarios
  • Clarifications Integrated: 5 Q&A clarifications from 2026-09-17 session resolving ambiguities on consolidation threshold, reference validation scope, audit report format, two-phase approach, and constitution conflict handling

Detailed Findings

Artifacts Created/Updated

  1. spec.md (.github/specs/012-audit-governance-structure/spec.md)

    • Updated with Implementation Approach section explaining two-phase strategy (audit → @ashley gate → refactoring)
    • Added Clarifications section documenting Q1-Q5 from 2026-09-17 session
    • Enhanced functional requirements with specific consolidation threshold (≥70%) and validation scope (4-category)
  2. research.md (.github/specs/012-audit-governance-structure/research.md)

    • Complete Phase 0 output: Audit findings identified and categorized
    • Finding ID categories: DUP-001, ORG-001, DUPL-002, REF-001, CONST-001, VER-001
    • Implementation Clarifications section with Q1-Q5 resolutions
  3. checklists/requirements.md

    • Quality checklist: 17/17 items passing
    • Spec approved for planning with 10 clarifications integrated
  4. data-model.md (Phase 1 Design) — already present on develop and not modified by this PR

    • 7 core governance entities defined (Governance File, Principle, Locked Config, Branch Naming Rule, Portable Instructions, Repository-Local Instructions, Governance Conflict)
    • Relationships mapped with governance hierarchy diagram
    • 5 validation scenarios with acceptance criteria
  5. quickstart.md (Phase 1 Design) — already present on develop and not modified by this PR

    • Pre/post-refactoring validation scenarios
    • Bash validation scripts for reference checking and duplication detection
  6. tasks.md (Phase 2: Task Decomposition)

    • 196 total tasks across 11 phases
    • Organized by user story (US1-US6) with parallelization markers
    • Phase 1-8: Audit phase (findings in AUDIT_REPORT.md)
    • @ashley approval gate between Phase 8 and Phase 9
    • Phase 9-11: Refactoring phase (applies approved findings)
    • Critical Path: Sequential tasks with parallelization examples
    • Implementation Strategy: MVP (audit only) vs. full scope

Findings Summary

Re-verified against develop on 2026-10-04 (eaac4764a5). The findings below were recorded on 2026-09-17 and cite line numbers that have since moved. Full evidence is in AUDIT_REPORT.md → "Re-verification against develop".

🔴 CRITICAL Issues

  1. DUP-001: Duplicate "Label Creation Governance" section in AGENTS.md (recorded at lines 209–252 and 285–338)
    • 🟢 No longer reproduces. develop's AGENTS.md has one such section, at line 227, already titled "Label Creation Governance (CRITICAL) — Consolidated". The consolidation this finding asked for has already happened.

⚠️ MAJOR Issues

  1. ORG-001: Script organization rules in AGENTS.md

    • 🟠 Still holds. ## Repository Scripts Organisation (CRITICAL) starts at line 52 and ends at line 104 (next ## is at 105); the recorded range 52–102 was 2 lines short.
    • Whether the guidance belongs elsewhere remains a Q5 decision for @ashley.
  2. DUPL-002: Duplicate branch naming guidance across CLAUDE.md and AGENTS.md

    • 🟢 No longer reproduces. AGENTS.md line 155 already names CLAUDE.md the authority and line 157 defers the detail to instructions/branch-naming.instructions.md — the resolution this finding asked for.
    • CLAUDE.md's section spans lines 14–113 (100 lines), not 97.
  3. REF-001: Incomplete reference (.github/prompts/prompts.md marked "legacy pending migration")

    • 🟠 Still holds. The file exists on develop, and AGENTS.md line 308 still calls it "Legacy prompt index pending skills/cookbook migration". The marker is in AGENTS.md, not in the referenced file.

Verification Tasks (VER-001)

Re-checked on 2026-10-04:

  • .github/instructions/branch-naming.instructions.md — ⬜ still absent (the portable instructions/branch-naming.instructions.md exists)
  • docs/BRANCHING_STRATEGY.md, docs/PR_CREATION_PROCESS.md — ✅ both exist
  • Consolidated instruction files — ✅ all five exist. Note instructions/ holds 48 entries in total, so "exactly 5 files" is true only of the consolidated set
  • .github/projects/active/ — ✅ exists
  • Agentic workflows directory — ✅ .github/agentic-workflows/ exists; .github/workflows/agentic/ does not

Two-Phase Implementation Approach (Q4)

Phase 1 – Audit & Analysis (Phases 1–8):

  • Complete all verification, analysis, and finding documentation
  • Consolidate findings into AUDIT_REPORT.md
  • Deliverable: Comprehensive audit report for @ashley review and approval

Phase 2 – Refactoring & Implementation (Phases 9–11):

  • Based on approved audit findings from Phase 1, implement fixes
  • Apply consolidations, reference fixes, structure improvements
  • Deliverable: Refactored governance files ready for merge

Clarifications Integrated (2026-09-17)

  • Q1: Duplicate consolidation threshold = ≥70% text overlap; use union approach
  • Q2: Reference validation = 4 categories (broken files, outdated paths, unimplemented consolidations, line-number mismatches)
  • Q3: Audit report format = Structured markdown at .github/specs/012-audit-governance-structure/AUDIT_REPORT.md
  • Q4: Two-phase approach = Separate audit findings from refactoring implementation with @ashley approval gate
  • Q5: Constitution conflicts = Flag in AUDIT_REPORT.md, classify as governance error or exception, let @ashley decide

Success Criteria (SC-001 through SC-009)

These criteria describe both this phase and the Phase 2 refactoring. Only the audit-phase ones are met by this pull request, which touches no governance file at all (its 21 changed files are spec documents, CHANGELOG.md, CATALOG.md and skill asset templates).

  • ✅ SC-001: Audit report identifies duplicates/issues with line references and remediation guidance — met by AUDIT_REPORT.md
  • ⬜ SC-002: Refactored CLAUDE.md zero forbidden branch prefixes in examples — Phase 2; this PR does not modify CLAUDE.md
  • ⬜ SC-003: AGENTS.md "Label Creation Governance" reduced from 2 → 1 — already the case on develop independently of this PR (see Re-verification below)
  • ⬜ SC-004: All file path references validated (100%) — Phase 2
  • ⬜ SC-005: New workflow section with entry/exit criteria — Phase 2
  • ⬜ SC-006: Line count reduced 15–25% — Phase 2, and the recorded baseline has drifted so the target is no longer reachable without re-measuring (see Re-verification below)
  • ⬜ SC-007: Consistent cross-references with uniform anchor format — Phase 2
  • ✅ SC-008: Consolidated instruction files verified — met: all five (languages, documentation-formats, quality-assurance, automation, community-standards) exist in instructions/
  • ⬜ SC-009: GOVERNANCE_CHANGELOG.md documents all changes — Phase 2

Branch & Commits

  • Branch: audit/governance-files-refactor
  • Commits: 17 commits of spec work, research findings and task decomposition (41 in total once the Keep Pull Request Current merges of develop are counted)
    • Spec updates (Framework, clarifications, requirements)
    • Research completion (Phase 0 findings)
    • Task decomposition (196 tasks, 11 phases, 2 approval gates)

Known overlap

develop already carries AUDIT_FINDINGS.md (181 lines) covering DUP-001, ORG-001, REF-001 and the branch-naming duplication. This PR adds AUDIT_REPORT.md (a longer treatment that also carries REF-002, MISSING-INST-001, WORKFLOW-001, PRIN-001 and CONST-001), so two audit documents now overlap. Consolidating them is a Phase 2 decision for @ashley; neither file was removed or rewritten here.

Next Steps (Phase 2 – Implementation)

  1. ✅ Execute T001–T007 (Setup phase) to establish audit environment
  2. ⏳ Execute T008–T026 (Foundational verification) – reference & constitution validation
  3. ⏳ Execute T027–T045 (US1: Baseline audit) – generate AUDIT_REPORT.md
  4. 🔐 APPROVAL GATE: @ashley reviews AUDIT_REPORT.md findings
  5. ⏳ Execute T046–T119 (US2–US6: Detailed audits) – branch naming, duplicates, organization, workflow, references
  6. ⏳ Execute T120–T153 (Phase 9: Refactoring) – apply approved findings to governance files
  7. ⏳ Execute T154–T177 (Phase 10: Validation & Polish) – QA and pre-review preparation
  8. ⏳ Execute T178–T196 (Phase 11: Closure & Approval) – @ashley final review and merge

Changelog

Changed

  • Governance files audit and refactor, specification 012: 8 findings identified (1 critical duplicate, 5 major, 1 medium and 1 low), with the audit report, the specification set and the affected skill reference and template files updated. Changelog entry added in CHANGELOG.md.

Test plan

  • Audit criteria documented, in .github/specs/012-audit-governance-structure/spec.md
  • Findings validated, in .github/specs/012-audit-governance-structure/AUDIT_REPORT.md and research.md
  • Recommendations provided, as the Phase 0 and Phase 1 task list in tasks.md
  • No changes needed (audit-only): this pull request changes documentation only, no runtime code

Checklist

Specification Quality ✅

  • All functional requirements (FR-001 through FR-010) are specific and testable
  • All success criteria (SC-001 through SC-009) are measurable
  • All user stories (US1–US6) have independent test scenarios
  • No [NEEDS CLARIFICATION] markers remain in spec
  • All 5 clarification questions resolved and integrated

Design Quality ✅

  • Data model identifies all governance entities and relationships
  • Governance hierarchy diagram shows decision authority flow
  • Interface contracts defined (governance file structure, validation rules)
  • Validation scenarios (5 scenarios) cover primary flows and edge cases
  • Constitution alignment verified (all 6 principles respected)

Task Decomposition ✅

  • 196 total tasks organized by user story and phase
  • All tasks follow checklist format: - [ ] [ID] [P?] [US?] Description with file path
  • Dependencies clearly documented (phase chain, critical path, parallelization)
  • MVP scope identified (Phase 1 audit only, 3-5 hours)
  • Full scope estimated (2-3 weeks: audit → refactoring → validation → merge)

Process Compliance ✅

  • Branch named per CLAUDE.md convention: audit/{scope}-{title} ✓
  • Branch type "audit" is in approved list ✓
  • PR created with complete description and DoD checklist
  • Related issue linked (if applicable)
  • Correct PR template applied
  • Type and area labels applied (type:audit, area:governance)

Commits ✅

  • All commits consolidated onto feature branch audit/governance-files-refactor
  • 17 commits covering spec, research, and task decomposition (41 including bot merges of develop)
  • Commit messages follow pattern: {type}({scope}): {description}
  • No merge conflicts
  • Branch rebased on latest develop

CI/CD & Quality ✅

  • Markdown linting passed (spec.md, research.md, tasks.md, requirements.md)
  • Frontmatter validation passed (all files have required metadata)
  • No broken internal links (all path references point to valid locations)
  • No secrets or credentials in committed files

Ready for Review

  • This draft PR is ready for stakeholder feedback
  • Spec document is complete and accurate
  • Task breakdown is specific and actionable
  • No blocking issues or rework needed before Phase 2 (Implementation)

References

Summary by CodeRabbit

  • Documentation
    • Added a governance audit report documenting eight findings, reference checks, and recommended next steps.
    • Updated the governance audit guidance to separate findings review from follow-up changes, with approval required before implementation.
    • Clarified how duplicate content, outdated references, and potential conflicts are assessed and recorded.
    • Updated the specification catalog to reflect the audit’s in-progress status.
    • Corrected a specification prerequisite and clarified test-folder guidance.

…ion, 70% consolidation threshold, 4-category reference validation, @ashley approval gate, two-phase approach

- Add 'Two-Phase Execution Approach' section explaining Audit (Phases 1-8) → @ashley approval gate → Refactoring (Phases 9-11)
- Update T043-T045 to explicitly create AUDIT_REPORT.md at spec directory with findings, severity categorization, and remediation guidance
- Add 70% consolidation threshold reference (Q1) to US3 tasks (T061-T070)
- Add 4-category reference validation scope (Q2) to US6 tasks (T107-T119)
- Insert @ashley approval gate between Phase 8 and Phase 9 per Q4 two-phase decision
- Add AUDIT_REPORT.md prerequisite and reference to Phase 9

All clarifications from 2026-09-17 session integrated while maintaining 196-task structure.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E3o8kMV245fhywM3vwSKk
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

The pull request adds a governance audit report and refines its specification, acceptance criteria, task plan, and catalog status. It also resolves conflict markers in a separate data model, updates agent and maintenance specifications, and applies Markdown spacing and emphasis changes.

Changes: Governance audit

Layer / File(s) Summary
Audit criteria and approval plan
.github/specs/012-audit-governance-structure/spec.md, .github/specs/012-audit-governance-structure/research.md, .github/specs/012-audit-governance-structure/checklists/requirements.md, .github/specs/012-audit-governance-structure/tasks.md
The specification clarifies audit requirements, finding categories, report contents, and conflict handling. The task plan separates audit and reporting from refactoring, with an approval gate before implementation.
Audit findings and report status
.github/specs/012-audit-governance-structure/AUDIT_REPORT.md, .github/specs/CATALOG.md, CHANGELOG.md
The report records seven governance findings, reference validation, constitution alignment, audit methods, and an approval-gated follow-up plan. The catalog records specification 012 as in progress, and the changelog notes the report and pending refactoring.

Specification maintenance

Layer / File(s) Summary
Data-model conflict resolution
.github/specs/002-coderabbit-config-improvements/data-model.md
Conflict markers and alternative content are removed. The HEAD-side content remains.
Agent and maintenance specification updates
.github/specs/013-spec-folder-refactor/contracts/MAINTENANCE.md.contract, .github/specs/014-agents-restructure-consolidate/*
The maintenance workflow steps are renumbered. The agent specification changes the JavaScript Jest test-folder convention to tests/, corrects a branch name, and adds spacing to the data model and research document.

Markdown formatting

Layer / File(s) Summary
Template and changelog formatting
skills/claim-register-auditor/assets/evidence-needed-template.md, skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md, skills/launch-readiness-auditor/assets/page-qa-table-template.md, skills/redirect-map-planner/assets/current-url-inventory-template.md, skills/release-handoff-generator/assets/known-issues-register-template.md, skills/schema-and-ai-discoverability-planner/assets/faq-schema-map-template.md, skills/self-evolving-agent/CHANGELOG.md
Six template footers change emphasis markers from underscores to asterisks. The self-evolving agent changelog adds spacing without changing its entries.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Other

Merge Risk: Low · previous review 3cdcb

The audit documents can proceed with bounded corrections, but their counts and follow-up plan should be aligned before they guide approval and implementation.

Architecture risk: Low · up to 3cdcb

The change affects 2 systems.

Changed systems: skills, CHANGELOG.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — skills (service) was modified; 7 changed files map to changed impact.
  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Added a changelog entry reporting the governance files audit’s 7 findings (1 critical duplicate and 5 major issues), the report’s review status, pending Phase 2 refactoring, and issue #3368.
  • observed — Modified behavior in skills/claim-register-auditor/assets/evidence-needed-template.md: The automation attribution’s emphasis marker changed from underscore syntax to asterisk syntax.
  • observed — Modified behavior in skills/faq-and-chatbot-source-curator/assets/chatbot-safe-faq-register-template.md: The maintained-by footer’s emphasis markers changed from underscores to asterisks.
  • observed — Modified behavior in skills/launch-readiness-auditor/assets/page-qa-table-template.md: The footer attribution changed from underscore-based italics to asterisk-based italics.
🚥 Pre-merge checks | ✅ 5

✅ Passed checks (5 passed)

Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the governance audit and the completed Phase 0 and 1 specification work, which matches the PR’s main changes.
Finishing Touches

🧪 Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.

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

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: audit
Scope: governance-files-refactor
Template: pr_audit.md
Labels Applied: type:audit

This PR was automatically routed based on the branch naming strategy.

@ashleyshaw ashleyshaw self-assigned this Sep 18, 2026
@ashleyshaw ashleyshaw added this to the v1.1 milestone Sep 18, 2026
@ashleyshaw
ashleyshaw marked this pull request as ready for review September 18, 2026 06:14
@mergify

mergify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: audit
Scope: governance-files-refactor
Template: pr_audit.md
Labels Applied: type:review,area:ci

This PR was automatically routed based on the branch naming strategy.

@ashleyshaw ashleyshaw changed the title spec(012): Governance Files Audit & Refactor – Phase 0 & 1 Specification Complete audit: Governance Files Audit & Refactor – Phase 0 & 1 Specification Complete Sep 18, 2026
@ashleyshaw
ashleyshaw requested a review from eleshar September 18, 2026 11:02
@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: audit
Scope: governance-files-refactor
Template: pr_audit.md
Labels Applied: type:review,area:ci

This PR was automatically routed based on the branch naming strategy.

- Updated Created date from 2026-04-20 to 2026-09-14 (actual creation date)
- Updated Updated date from 2026-04-20 to 2026-09-18 (current session date)
- Changed Phase status from Complete to InProgress (spec complete, implementation pending @ashley approval)
- Ensures catalog accuracy for specification governance tracking

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019E3o8kMV245fhywM3vwSKk
@github-actions

Copy link
Copy Markdown
Contributor

PR Template Routing

Branch Type: audit
Scope: governance-files-refactor
Template: pr_audit.md
Labels Applied: type:review,area:ci

This PR was automatically routed based on the branch naming strategy.

Found by a CodeRabbit CLI pass over the whole PR and checked against the files first.

- research.md said AUDIT_REPORT.md is generated in Phase 2, but spec.md puts the audit in Phase 1.
  It now says Phase 1 and lists every finding ID in the report catalog, keeping the older IDs.
- tasks.md T005 to T007 and T185 pointed at specs/012-audit-governance-structure, which does not
  exist; the folder is .github/specs/012-audit-governance-structure.
- The CATALOG.md entry for 012 had Updated 2026-09-14 although the spec folder changed since.

CATALOG.validate and audit-specs pass. Points that need an audit decision are left for the author.
@eleshar

eleshar commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@ashleyshaw CodeRabbit's four threads on this PR are fixed and resolved (ef7e685477, then cc6609ed6c for three small wording and path fixes). While checking them I ran a wider CodeRabbit pass over the whole PR and verified each point against the files. These need your decision because they change what the audit says. Nothing here has been changed.

  1. Reference summary vs table (AUDIT_REPORT.md lines 359 to 361). The summary says 12 unique references, 7 valid and 5 broken. The table below it has 11 rows: 8 valid, 1 broken and 2 warnings (MIGRATED, STATUS UNKNOWN). Is a twelfth row missing, or should the summary follow the table?
  2. MISSING-INST-001. It is titled "Missing … Files", rated MAJOR and counted in the "5 major", but its own body says all four files exist and "NO ACTION REQUIRED". Is it a finding? If not, the totals I just aligned to the catalog (8) become 7: 1 critical, 4 major, 1 medium, 1 low.
  3. REF-002 is stale. The report says the validation script is "confirmed missing" at AGENTS.md line 237 and offers options A, B or C for you to decide. On develop, AGENTS.md line 279 already points to scripts/validation/validate-labels-before-creation.cjs, and that file exists. REF-002 is also absent from the re-verification table. Should it be marked resolved, and the A/B/C gate dropped?
  4. Two ID schemes. The re-verification table uses DUPL-002, REF-001 and VER-001, which are not in the catalog. The catalog's REF-002, MISSING-INST-001, WORKFLOW-001, PRIN-001, CONST-001 and TERM-001 are not re-verified. Re-verify the rest, or say they were not?
  5. Ticked tasks without evidence. T105 is ticked ("add a workflow reference to AGENTS.md with a link to the CLAUDE.md section"), but AGENTS.md has no such link. T104, T109 and T110 are ticked too, although this PR changes neither CLAUDE.md nor AGENTS.md. Untick them, or point to where the work is?
  6. Status. CATALOG.md lists spec 012 as Active; spec.md says Draft. Which is right?
  7. Minor. spec.md FR-001 mixes the audit requirement with the Phase 2 consolidation.

I left T069 to T072 ticked: develop really has one consolidated "Label Creation Governance" section, so those match the repository.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants