Skip to content

[Phase 3] Integrate the linter into the compliance audit (informational) + org-repo import consistency #645

Description

@don-petry

Story

As a compliance-audit maintainer,
I want wire the structural linter into the Standards Sync compliance scan and add a cross-repo import-consistency check, both informational,
so that structural drift and broken canonical-import links are surfaced org-wide each audit cycle without blocking any repo.

Acceptance Criteria

  1. aw-standards-sync.sh runs scripts/agents-md-lint.sh against each scanned repo's AGENTS.md and records structural findings in the summary issue as a clearly-labelled informational (non-blocking) section — no PRs are opened and no CI is failed on structural findings in this phase.
  2. A cross-repo import-consistency check verifies each downstream repo's AGENTS.md correctly references/imports the canonical petry-projects/.github AGENTS.md, and reports mismatches informationally.
  3. Repos missing AGENTS.md entirely remain handled by the existing presence check with no regression; the linter runs only when the file exists.
  4. The new behavior is covered by bats tests with mocked gh/API calls (no network), consistent with the existing standards-sync test style, and shellcheck --severity=warning -x stays clean.
  5. The summary issue labels structural findings as informational and links to docs/initiatives/agents-md-validation.md.

Tasks / Subtasks

Dev Notes

  • aw-standards-sync.sh already enumerates active repos, fetches template content via the contents API (base64-decoded), loops REQUIRED_FILES checking 200/404, applies security settings, and accumulates summary_rows into a final issue — extend that flow; do NOT restructure it.
  • Keep structural findings strictly informational this phase: append to the summary issue only; do not add them to the missing_files/PR path and do not fail the workflow (the discussion mandates starting non-blocking).
  • Presence check must not regress: only run the linter for repos where the AGENTS.md contents fetch returns content; a 404 stays on the existing missing-file path.
  • The canonical import target is petry-projects/.github/AGENTS.md; a compliant downstream AGENTS.md references it (see this repo's AGENTS.md lines 3-4 as the reference shape). Report, do not auto-fix, in this phase.
  • Standards Sync runs monthly (first-Monday guard) with a 30-minute timeout in .github/workflows/standards-sync.yml — the added per-repo linting must stay within that budget; the linter is pure shell so cost is negligible.
  • Follow the existing standards-sync test approach (mock gh/API, no network) — mirror the style used by other scripts' bats suites in tests/.

Project Structure Notes

Edits to scripts/aw-standards-sync.sh; new tests under tests/ mirroring existing standards-sync-style suites. No workflow trigger changes to .github/workflows/standards-sync.yml.

References

  • scripts/aw-standards-sync.sh
  • .github/workflows/standards-sync.yml
  • AGENTS.md
  • scripts/run-bats.sh

Likely target surface

  • scripts/aw-standards-sync.sh
  • tests/agents_md_audit.bats (new)

Story prepared by the BMAD Scrum Master (Bob) for epic #642. Status: ready-for-dev.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions