Skip to content

fix(ci): no gate enforces the workflow policies — PR triggers, workflow_dispatch, and per-job timeouts are convention only #1406

Closed

Description

@dezren39

Problem

Two workflow policies in this repo are enforced by nothing but memory:

  1. No-PR-trigger policy (Drew, 2026-11-02; commit 0c4ea315ed, PR ci: add workflow_dispatch where missing (no-PR-trigger policy) #1401): "CI never runs on pull requests; workflows run on push to main, on schedule, or by manual dispatch." That change only added workflow_dispatch to the four workflows that lacked it — it added no check that the policy stays true.
  2. Per-job timeout-minutes rule (CI: add timeout-minutes caps to every job in every workflow #61): already regressed twice and caught manually both times — fix(ci): test.yml's ci-fix job has no timeout-minutes — per-job gap the file-level check cannot see (#61 rule) #1326 (test.yml's ci-fix job, "per-job gap the file-level check cannot see") and fix(ci): branch-cleanup workflow job has no timeout-minutes — the one runnable job that regressed #61's cap rule #1184 (branch-cleanup job, "the one runnable job that regressed CI: add timeout-minutes caps to every job in every workflow #61's cap rule").

The repo's other house rules all have regression gates for exactly this reason (script/check-bounded-http.ts, check-proto-reads.ts, check-numeric-boundaries.ts, check-doc-env-vars.ts, wired as steps in .github/workflows/test.yml — "or the class regrows one call at a time"). None of them looks at .github/workflows/ at all: grep -rn "timeout-minutes|workflow_dispatch|pull_request" script/*.ts returns no hits.

Evidence (verified 2026-11-02 on main 424c8d6f18)

All 29 workflows currently comply — this is a missing regression net, not a live violation:

A new or edited workflow that adds a PR trigger, omits workflow_dispatch, or omits a job timeout would pass every existing gate and ship silently.

Acceptance criteria

  • A new gate in the house shape — script/check-workflows.ts + script/check-workflows.test.ts + a check:workflows package.json script + test.yml steps mirroring the other gates — fails (exit 1, naming workflow + job/rule) when any workflow:
    • declares a pull_request or pull_request_target trigger,
    • lacks workflow_dispatch, or
    • has a job without timeout-minutes (jobs using a reusable workflow via uses: exempt).
  • The gate passes clean on the current 29 workflows.
  • Trigger matching is exact-key: pull_request_review_comment (opencode.yml) and issue_comment are comment triggers, not PR CI triggers — the ci: add workflow_dispatch where missing (no-PR-trigger policy) #1401 policy commit counted the repo as compliant with those present, and the gate must not flag them.
  • The YAML handling copes with the real files: on: is boolean-true under YAML 1.1 parsers, and triggers appear in string, list, and map forms across the 29 files (tests pin at least the map and list forms plus the on: quirk).
  • Gate tests cover one synthetic violation of each rule and the compliant-tree case.

Out of scope (possible follow-on dispositions, not this gate unless triage disagrees): concurrency queue: max rules (#151/#156/#179 family) and top-level permissions: (#118).

Related: #1401 (policy), #61 / #1326 / #1184 (timeout rule and its manual catches), #1127 / #865 / #995 (the gate pattern this follows).

Activity

  1. added
    kind/ciCI/CD pipelines, workflows, and build automation
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    area/ciCI, workflows, and build infrastructure
    app/scriptPackage: script (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    on Nov 2, 2026
  2. dezren39 commented on Nov 2, 2026

    @dezren39
    Author

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-opencode)
    • Session / ID: cron job new-issue-creator-opencode, run 2026-11-02T16:35Z
    • Found via: filed this run
    • Task: Filed after verifying on main 424c8d6 that all 29 workflows currently comply with the no-PR-trigger / workflow_dispatch / per-job timeout policies, while no existing gate script checks .github/workflows/ at all — the missing regression net is the issue.
    • Expectation: effort/m; done = a check:workflows gate in the house gate shape (script + tests + test.yml wiring) that fails on any of the three violations and passes on today's tree.
    • Links: evidence ~/workspace/goals/keep-the-four-repos-healthy/hidden_files/issue-opencode-workflow-policy-gate.md (fleet bookkeeping); policy commit 0c4ea31 (PR ci: add workflow_dispatch where missing (no-PR-trigger policy) #1401)
  3. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  4. 3 remaining items

  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    and removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 2, 2026
  6. added a commit that references this issue on Nov 2, 2026
  7. dezren39 commented on Nov 2, 2026

    @dezren39
    Author

    Implemented and merged in PR #1415 (merge commit a8762eb1ad354f260e5840409db66e728038a39d, head 1a2f3a201b0193004877d36923c22b23a69a2467).

    • New gate script/check-workflows.ts + script/check-workflows.test.ts in the house gate shape: fails naming workflow + job/rule on a pull_request/pull_request_target trigger (exact-key matching — pull_request_review_comment/issue_comment are not flagged), a missing workflow_dispatch, or a non-reusable job without timeout-minutes. YAML handling covers string/list/map trigger forms and the on:-as-boolean-true quirk.
    • Wiring: check:workflows in root package.json; gate test + gate steps in .github/workflows/test.yml mirroring the other gates.
    • Verification on the laptop before merge: bun test check-workflows.test.ts — 12 pass, 0 fail; bun run check:workflows — exits 0 on all 29 workflows. Codex review on the merged head: completed, has_any_findings=false, has_unresolved_findings=false. CodeRabbit was rate-limited (NEUTRAL, no findings).

    Closing as completed by #1415.

  8. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 2, 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

    app/scriptPackage: script (pkgs/ or apps/ in this repo)area/ciCI, workflows, and build infrastructureeffort/mMedium: expected under 1 day of workkind/ciCI/CD pipelines, workflows, and build automationpriority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions