Skip to content

Compliance: dev-lead-stub-agent-ref #328

Closed

Description

@don-petry

Compliance Finding

Category: ci-workflows
Severity: error
Check: dev-lead-stub-agent-ref

Detail

The dev-lead.yml caller stub must pass with: agent_ref: dev-lead/<channel> (stable, next, or ring<N>) so the reusable checks out its own scripts/prompts from the same channel. Re-sync from standards/workflows/dev-lead.yml.

Standard Reference

standards/ci-standards.md#dev-lead-agent

Remediation

Copy the relevant workflow template from standards/workflows/ verbatim — do not generate from scratch:

gh api repos/petry-projects/.github/contents/standards/workflows/<template>.yml --jq '.content' | base64 -d > .github/workflows/<template>.yml

Available templates: agent-shield.yml, dev-lead.yml, dependabot-automerge.yml, dependabot-rebase.yml, dependency-audit.yml, feature-ideation.yml


This issue was automatically created by the weekly compliance audit.

Activity

  1. don-petry commented on Jul 17, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #328 — Compliance: dev-lead-stub-agent-ref

    Scope

    Repin the dev-lead.yml caller stub from the non-standard dev-lead/v1-stable channel to the canonical dev-lead/stable channel on both the uses: ref and the agent_ref input, resolving the dev-lead-stub-agent-ref (and companion dev-lead-stub-pin) compliance findings.

    Root Cause

    compliance-audit.sh:check_dev_lead_stub only accepts channels matching dev-lead/(stable|next|ring<N>). The committed stub pins @dev-lead/v1-stable with agent_ref: dev-lead/v1-stable; v1-stable is outside that set, so the uses: channel extracts as empty and the agent_ref fallback check fires dev-lead-stub-agent-ref. The canonical standards/workflows/dev-lead.yml uses dev-lead/stable.

    Implementation Checklist

    • .github/workflows/dev-lead.yml line 64: uses: …/dev-lead-reusable.yml@dev-lead/v1-stable → @dev-lead/stable (keep the inline # NOSONAR(githubactions:S7637) marker)
    • .github/workflows/dev-lead.yml line 66: agent_ref: dev-lead/v1-stable → agent_ref: dev-lead/stable
    • Leave secrets: inherit # NOSONAR(githubactions:S7635) untouched (added by ci: inline NOSONAR(S7635) markers on secrets:inherit caller stubs #321; out of scope; removing it risks a SonarCloud regression)
    • Leave on:, permissions:, concurrency: untouched (centrally owned, not repo-adjustable)

    Tests to Write

    This is a workflow-configuration change with no application-code behavior. The markets app test suite (Jest) does not cover CI YAML. Per the Phase 2 exception (configuration change, no observable app behavior), no app-level test is added. Instead the fix is verified by:

    • Re-running the exact check_dev_lead_stub regexes from compliance-audit.sh locally against the edited file (expect: no pin/agent_ref finding)
    • .dev-lead/scripts/dev-lead-lint.sh (shellcheck + agent frontmatter)
    • Repo lint/typecheck as available

    Test Command

    bash .dev-lead/scripts/dev-lead-lint.sh + local compliance-audit regex replay

  2. don-petry commented on Jul 17, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Root-caused the finding against standards/scripts/compliance-audit.sh:check_dev_lead_stub and the canonical standards/workflows/dev-lead.yml
    • Repinned .github/workflows/dev-lead.yml uses: ref @dev-lead/v1-stable → @dev-lead/stable
    • Repinned with: agent_ref: dev-lead/v1-stable → dev-lead/stable
    • Left secrets: inherit # NOSONAR(S7635) (added by ci: inline NOSONAR(S7635) markers on secrets:inherit caller stubs #321) and the on:/permissions:/concurrency: surfaces untouched
    • Verified via local replay of the audit regexes, dev-lead-lint.sh, and template diff

    Root Cause

    check_dev_lead_stub only accepts a channel matching dev-lead/(stable|next|ring<N>). The stub pinned @dev-lead/v1-stable, so the uses: channel extraction returned empty and the agent_ref fallback branch fired dev-lead-stub-agent-ref (and the pin regex fired dev-lead-stub-pin). v1-stable is not a valid channel — the canonical template pins the moving dev-lead/stable tag.

    Test Results

    Configuration change (workflow YAML); no application-code behavior, so the Phase 2 app-test step is covered by replaying the exact audit regexes plus repo lint.

    === PRE-FIX (red) ===
    uses_channel=''
      pin:         FINDING:dev-lead-stub-pin
      agent_ref:   FINDING:dev-lead-stub-agent-ref
      statuses:    PASS
      concurrency: PASS
    
    === POST-FIX (green) ===
    uses_channel='stable'
      pin:         PASS
      agent_ref:   PASS
      statuses:    PASS
      concurrency: PASS
    
    === diff vs canonical standards/workflows/dev-lead.yml ===
    67c67
    <     secrets: inherit
    ---
    >     secrets: inherit  # NOSONAR(githubactions:S7635) first-party trusted reusable
    (only the intentional #321 S7635 marker remains; all other lines byte-identical)
    
    === bash .dev-lead/scripts/dev-lead-lint.sh ===
      [lint] shellcheck: no .sh files found — skipping
      [lint] validating CODEOWNERS...
    OK: CODEOWNERS
      [lint] all checks passed
    EXIT=0
    
    YAML parse: OK
    

    Files Changed

    • .github/workflows/dev-lead.yml: repinned the reusable uses: ref and the agent_ref input from the non-standard dev-lead/v1-stable channel to the canonical dev-lead/stable channel.

    Notes

    • Scope kept minimal per the issue: only the channel pin was changed. The # NOSONAR(githubactions:S7635) marker on secrets: inherit (introduced by ci: inline NOSONAR(S7635) markers on secrets:inherit caller stubs #321) was deliberately preserved — it is out of scope for this finding, is not examined by check_dev_lead_stub or the surface-drift guard, and removing it would risk re-tripping the SonarCloud githubactions:S7635 gate.
    • The pre-existing comment lines that already referenced dev-lead/stable are now consistent with the actual pin.
    • Out of scope (separate reusables/checks, not touched): add-to-project.yml has a @add-to-project/stable vs agent_ref: add-to-project/v1-stable mismatch, and agent-shield.yml/dependency-audit.yml pin v2-stable. If those warrant compliance review, they should be tracked as their own findings.
  3. added
    dev-leadFor dev-lead agent pickup
    and removed
    dev-leadFor dev-lead agent pickup
    on Jul 21, 2026
  4. don-petry commented on Jul 21, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead Implementation Plan

    Issue: #328 — Compliance: dev-lead-stub-agent-ref

    Scope

    Re-sync .github/workflows/dev-lead.yml verbatim from standards/workflows/dev-lead.yml so the caller stub passes a valid with: agent_ref: dev-lead/<channel> and carries no drift.

    Root Cause

    The current stub is pinned to a non-standard channel token dev-lead/v1-stable on both the reusable uses: ref and the agent_ref input. The valid channels per the dev-lead-stub-agent-ref check are stable, next, or ring<N>. The stub also carries an extra # NOSONAR(githubactions:S7635) marker on the secrets: inherit line that is not present in the canonical template (drift).

    Implementation Checklist

    • Replace .github/workflows/dev-lead.yml with the verbatim canonical template from standards/workflows/dev-lead.yml (agent_ref + uses ref → dev-lead/stable; remove extra secrets NOSONAR marker)
    • Confirm no other tracked workflow references the old v1-stable token

    Tests to Write

    • Pure CI-workflow configuration change with no observable runtime behavior — no unit test is applicable. The change is verified by the repo lint (.dev-lead/scripts/dev-lead-lint.sh) and a byte-for-byte diff against the canonical template. (Phase 2 test-first exception noted per instructions.)

    Test Command

    bash .dev-lead/scripts/dev-lead-lint.sh

  5. don-petry commented on Jul 21, 2026

    @don-petry
    ContributorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Replaced .github/workflows/dev-lead.yml verbatim with the canonical template from standards/workflows/dev-lead.yml
    • Verified no other in-scope tracked file references the old dev-lead/v1-stable token (the only other v1-stable hit is add-to-project.yml, a different workflow — out of scope)

    Root Cause & Fix

    The stub was pinned to the non-standard channel token dev-lead/v1-stable, which is not one of the valid channels (stable, next, ring<N>) required by the dev-lead-stub-agent-ref check. Re-syncing from the canonical template:

    • uses: …dev-lead-reusable.yml@dev-lead/v1-stable → @dev-lead/stable
    • with: agent_ref: dev-lead/v1-stable → dev-lead/stable
    • Removed drift marker # NOSONAR(githubactions:S7635) from the secrets: inherit line (not present in the canonical template)

    The resulting file is now byte-for-byte identical to standards/workflows/dev-lead.yml.

    Test Results

    This is a pure CI-workflow configuration change with no observable runtime behavior, so no unit test applies (Phase 2 test-first exception per instructions). Verification performed:

    === byte-for-byte diff vs canonical (empty = identical) ===
    IDENTICAL
    === YAML parse check ===
    valid YAML
    === dev-lead lint (bash .dev-lead/scripts/dev-lead-lint.sh) ===
      [lint] shellcheck: no .sh files found — skipping
      [lint] validating CODEOWNERS...
    OK: CODEOWNERS
      [lint] all checks passed
    lint exit: 0
    

    Files Changed

    • .github/workflows/dev-lead.yml: pinned reusable uses: ref and agent_ref input to the valid dev-lead/stable channel and removed a non-canonical NOSONAR marker on the secrets: inherit line (3 lines changed).

    Notes

    • add-to-project.yml also uses a …/v1-stable token but for the separate add-to-project agent; it is unrelated to this issue and was intentionally left untouched.
  6. added a commit that references this issue on Jul 21, 2026
  7. added 2 commits that reference this issue on Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compliance-auditAutomated compliance audit findingdev-leadFor dev-lead agent pickup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions