Skip to content

[Phase 3] Extend Fleet Monitor stub-drift coverage to the initiative-driver stub #886

Description

@github-actions

Story

As a fleet maintainer,
I want have Fleet Monitor track per-repo initiative-driver stub coverage/drift the same way it already tracks the planner stub,
so that an out-of-date or missing driver stub in an enrolled repo surfaces in the daily health signal instead of failing silently.

Acceptance Criteria

  1. scripts/fleet_monitor.sh detects drift for the driver stub .github/workflows/initiative-driver.yml against petry-projects/.github/standards/workflows/initiative-driver.yml, in ADDITION to the existing planner stub — generalized to iterate a list of (name, stub_path, canonical_path) entries rather than a single hardcoded STUB_PATH/CANONICAL_STUB_PATH.
  2. The fleet report renders a driver stub coverage/drift section (reusing fleet_stub_drift.sh's pure helpers), and drifted driver stubs feed the alert JSON / HAS_STUB_DRIFT path.
  3. The actions-fleet-monitor.yml stub-drift alert step covers the driver stub without regressing the planner-stub coverage (separate section/issue per stub kind, or a clearly-labelled combined section).
  4. Bats cover the multi-stub generalization (extend tests around fleet_stub_drift / fleet_monitor) and confirm the existing planner-stub behaviour is unchanged.
  5. If the canonical driver-stub SHA cannot be read (the template is not yet merged in petry-projects/.github), the driver registry entry is skipped with a ::warning:: (per-stub, non-fatal) — exactly as the existing single-stub path does when its canonical SHA is empty — so Fleet Monitor degrades gracefully before and after the cross-repo template lands.

Tasks / Subtasks

Dev Notes

  • fleet_stub_drift.sh is ALREADY pure and stub-agnostic (takes a canonical SHA + a per-repo SHA, classifies ALIGNED/DRIFTED/MISSING). The hardcoding lives in fleet_monitor.sh: STUB_PATH (:35), CANONICAL_STUB_PATH (:37), the comparison loop (:187-206), the report section (:239-243), and the alert export (~:309-319).
  • Generalize by looping over a small registry, e.g. [(initiative-planner, .github/workflows/initiative-planner.yml, standards/workflows/initiative-planner.yml), (initiative-driver, .github/workflows/initiative-driver.yml, standards/workflows/initiative-driver.yml)], calling the existing pure helpers per entry and accumulating per-stub drift files.
  • Keep it ADDITIVE: the planner stub section, its tracking issue, and HAS_STUB_DRIFT semantics must keep working — the Live idea:approved canary + Fleet Monitor coverage #822 behaviour is load-bearing.
  • The driver canonical path must match Story 2's exactly; this story is blocked_by Story 2 so the canonical template exists to compare against (otherwise every enrolled repo reads as MISSING/404).
  • Cross-repo merge ordering: this story needs Story 2's stub template MERGED to petry-projects/.github's default branch (not just authored) for a non-empty canonical SHA — blocked_by [2] captures the intra-plan edge, but the canonical read is cross-repo, so the generalized loop must keep the existing empty-canonical warn-and-skip per stub.

Project Structure Notes

All in .github-private — dev-lead-authorable. Net-new bats should be added to lint.yml's bats list per AGENTS.md.

References

  • scripts/fleet_monitor.sh#stub-coverage-and-drift
  • scripts/fleet_stub_drift.sh
  • .github/workflows/actions-fleet-monitor.yml#track-stub-drift
  • tests/ (fleet monitor / stub drift bats)

Likely target surface

  • scripts/fleet_monitor.sh
  • scripts/fleet_stub_drift.sh
  • .github/workflows/actions-fleet-monitor.yml
  • tests/

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    dev-leadFor dev-lead agent pickupinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions