Skip to content

CI never runs on main: shipped trees are untested #608

Backlog

Description

@ocsi-architect

Problem

CI never tests what we ship. .github/workflows/ci.yml triggers on pull_request and workflow_dispatch only — there is no push trigger — so every green check in this repository describes a pull request head computed against an older base, and the merged result on main is never run at all.

Measured on the live repo: GET /repos/abogartz/opencode-self-improvement/commits/main/check-runs returns zero runs. The last fifteen ci workflow runs are all event=pull_request against branches: docs/adapter-arch-banner, fix/recall-fractional-limit, docs/recall-evidence-viewer-auth, feat/public-adapter-api, feat/554-pi-adapter. Nothing for main, and nothing for the release commits semantic-release pushes.

The published package therefore ships a tree that no CI has ever executed. Four releases today — 0.38.2 through 0.40.1 — were cut from main commits whose checks are empty.

This is not hypothetical for a project whose whole claim is host cooperation. A pull request whose base is three merges behind passes against code that no longer exists, and two pull requests that are each green against the same base can still combine into a failure. Nothing here catches that, because the combined state is exactly the ref nobody tests.

Required

  • Add a push trigger on main to the CI workflow, so the merged result is a tested object with its own check runs.
  • Keep the pull-request checks as they are; the point is that the merge commit gets checked after the fact, not before, and a red main is a stop-the-line signal rather than a mystery.
  • Make the difference legible: the main run reports the same job set, so a reader can tell "PR green, merged green" from "PR green, merged never run".

Acceptance

GET /repos/abogartz/opencode-self-improvement/commits/main/check-runs returns a completed run for the newest main commit. A deliberate break merged to main turns that run red — demonstrated once with a throwaway commit and reverted. The workflow file and docs/internals/development.md say the same thing about what gets tested, and a test reads the triggers out of the workflow so the claim cannot drift again.

Non-goals

Not a request to block merges on this. The current process — merge, then verify — stays workable; this makes the "then verify" step automatic instead of something a person remembers to do locally.

Activity

  1. added
    bug
    test-integrity
    severity:high
    on Nov 29, 2026
  2. ocsi-architect commented on Dec 1, 2026

    @ocsi-architect
    Author

    Architect

    Decision: main gets a push trigger, with the Windows matrix job held back to pull requests.

    ci.yml currently triggers on pull_request and workflow_dispatch only, so the claim in this ticket is correct as written: nothing has ever tested main as a whole. Tonight is the evidence, not just an argument — v0.41.2 and v0.41.3 both shipped from merge commits whose checks ran against a PR head or, in #626's case, against a head that land had itself moved onto main and proven tree-identical to a trial merge. Tree-identity is good evidence about a tree; it is not a test run, and release.yml publishes on push regardless of whether anything looked at that commit.

    Ruling, and the reason for the asymmetry: a full run is 11–14 minutes dominated by oh-my-pi (windows-latest), and the merge train produced five merges in four hours. Running Windows on main as well doubles runner minutes for signal that is mostly the same job re-executed. So:

    • on: gains push: branches: [main].
    • A push to main runs lint, test and coverage; the windows-latest legs run only on pull_request.
    • A pull request keeps every job it has today, unchanged. This must not silently narrow PR coverage — a PR that stops getting Windows is how CI never runs on main: shipped trees are untested #608 came to exist in the first place.

    The trap a naive fix walks into. lint sets COMMENT_LINT_BASE: ${{ github.event.pull_request.base.sha }}, and the comment policy deliberately refuses to report green on an empty diff — that is the behaviour its own comment documents. On a push event github.event.pull_request is absent, so the variable arrives empty and the first push to main goes red for a reason that has nothing to do with the tree. The fix has to say what the comment policy means with no pull request underneath it: either the comment-lint step is skipped on push (the merge already carried the review), or the base becomes the previous main revision so added lines are still measured. Pick one and make it explicit; do not let it fall through to the empty-diff path.

    Acceptance, in the order a reviewer will check it:

    • Open a PR and confirm the job list is what it is today, windows-latest included — the change must not reduce PR coverage.
    • Trigger a push to main (a merge will do) and confirm: lint, test and coverage run and go green on the merged tree, and no windows-latest job is created.
    • Show the lint job passing on push because of a decision, not because the empty COMMENT_LINT_BASE happened to be tolerated — if it is skipped on push, say so in the workflow itself so the next reader knows it was deliberate.
    • Header ci: — this ships no product behaviour, so it must not fire a release.

    Keep this pull to the trigger and the job conditions. Getting the availability bench into CI is #629's subject matter, already ruling'd there, and the two changes stay easier to review apart.

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

    bugseverity:hightest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions