Skip to content

ci: run comment-hygiene locally in check-affected so a comment violation fails before push #9648

Description

@kyle-sexton

Problem

The comment-hygiene check is CI-only (scripts/check-affected-gates.txt:32, "comment-hygiene ci-only ci-workflows composite"). Neither the pre-push hook nor check-affected.sh runs it, so a PR that adds an issue number, run id or date to a code comment finds out only after a full CI round. The lint-repo annotation then says only "Hygiene check comment-hygiene finished with outcome: failure", because the composite action's output is not captured, so finding the line takes another step.

On 2026-10-24 this happened three times:

Fix

Run the same patterns locally in check-affected.sh, against the changed files' comment lines. Read them from the pinned ci-workflows check-comment-markers/comment-hygiene-patterns.sh, not from a copy, so the local and CI checks cannot drift. Optionally, have the composite action print the offending file:line to the job log, so the CI annotation points at it.

Who uses it: every builder that pushes, before CI spends a run on it.

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 24, 2026
  2. github-actions commented on Oct 24, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Understood: run the comment-hygiene patterns locally in check-affected.sh, fetched from the pinned ci-workflows SHA, so comment violations fail before push. A fetch failure is a SKIP, and the gates file moves comment-hygiene from ci-only to a run row.

    Decision (#9648 (comment)), quoted from its opening lines:

    Decision recorded. The owner answered in the Refinement and Issue Triage sessions (2026-10-25), deciding the open items below on the facts:
    [quote truncated; the full decision is at the link]

    That decision settles the open questions (pattern source, fetch failure, out-of-scope composite output). Nothing further is asked.

    Automated triage, applied by the lanes App.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 24, 2026
  4. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    status: needs-decisionAwaiting a human or maintainer judgment call.
    and removed
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    on Oct 24, 2026
  5. melodic-automation-lanes commented on Oct 24, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  7. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    status: needs-decisionAwaiting a human or maintainer judgment call.
    and removed
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    on Oct 25, 2026
  8. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  9. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: check-affected.sh runs the pinned ci-workflows comment-hygiene patterns over the changed files' comment lines and fails before push, and the gate row moves from ci-only to run.

    Related work

    Open questions

    1. How should check-affected.sh obtain comment-hygiene-patterns.sh from the pinned ci-workflows ref when ci-workflows is not in this checkout: a network fetch at the pinned SHA with a cache, a sparse clone, or a local path override?
      RECOMMENDED: Fetch the one file at the pinned SHA, read from the workflow's uses line, into a cache directory. That keeps the local and CI pins from drifting. Basis: .github/workflows/pr-require-checks.yml:1037
    2. Should a failed fetch or an offline machine fail check-affected.sh, or only warn and skip?
      RECOMMENDED: Warn and skip, printing CI only: comment-hygiene, so an offline push is not blocked. CI stays the enforcing gate. Basis: judgment
    3. Is the optional file:line output from the composite action in scope here?
      RECOMMENDED: No. That change lives in the separate ci-workflows repo, so track it as its own issue and keep this one to the local check. Basis: scripts/check-affected-gates.txt:32

    Sources read

    • scripts/check-affected-gates.txt:32: comment-hygiene is listed as ci-only, ci-workflows composite
    • scripts/check-affected-gates.txt:10-26: gates with run rows are the ones check-affected.sh executes
    • scripts/check-affected-gates.txt:30: the machine-specific-paths row cites a README section 'Running machine-specific-paths locally' that a repo-wide search for that title did not find
    • pr-require-checks.yml:1034-1037: the comment_hygiene step uses ci-workflows check-comment-markers pinned at SHA 5e18f3d6 (v0.58.0)
    • scripts/check-affected.sh: a search found no existing fetch of ci-workflows files, so no precedent for reading a pinned external script

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  10. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner answered in the Refinement and Issue Triage sessions (2026-10-25), deciding the open items below on the facts:

    go with whatever the facts/data/metrics + /discovery:research says and ensure we're aligned with SOLID, DRY/SSOT principles

    I should only ever be in the loop ONLY when necessary (intent/vision changed, something came up during implementation that impacts trajectory/alignment, OR a high security risk) - I've covered this all before

    No owner ledger (.work/*/interview-checklist.md, .work/gh-monitor-owner-decisions/) names this issue.

    Questions from intake's refinement (2026-10-25):

    1. How does check-affected.sh get comment-hygiene-patterns.sh?
      Decided: Fetch that one file from public melodic-software/ci-workflows at the SHA in this repo's check-comment-markers uses line (.github/workflows/pr-require-checks.yml:1037, 5e18f3d6, v0.58.0). It is fetched on each run, as check-affected.sh already fetches the base on each run (scripts/check-affected.sh:214-215); no cache. The pin stays the single source, so the local and CI checks cannot drift (DRY/SSOT). The file is .github/actions/check-comment-markers/comment-hygiene-patterns.sh at that SHA.
    2. A failed fetch or an offline machine?
      Decided: SKIP with its reason, never a failure. check-affected.sh already says so for every check: "A missing tool, a failed fetch, or a check that exits 2 (could not run) is a SKIP with its reason, never a failure" (scripts/check-affected.sh:69-70). CI stays the enforcing gate.
    3. The composite action's file:line output?
      Decided: Out of scope here. It is a ci-workflows change.

    Acceptance criteria:

    • check-affected.sh runs the comment-hygiene patterns from the pinned ci-workflows SHA over the changed files' comment lines and fails on a match, with the matching file:line.
    • The SHA comes from the check-comment-markers uses line in .github/workflows/pr-require-checks.yml; no copy of the patterns is committed here.
    • With the fetch failing, the check prints a SKIP with its reason and does not fail.
    • scripts/check-affected-gates.txt lists comment-hygiene as a run row, not ci-only.
  11. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed on Oct 26, 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

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.status: readyTriaged, unblocked, and fully specified; eligible to pick up.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions