Skip to content

The push hook runs every *.repo.test.ts, so a bug/<n>-repro branch cannot push a failing repo test #1817

Done

Description

@V3RON

`lefthook.yml:58-61` runs `pnpm exec vitest run --project unit .repo.test.ts` on every push, with no exception for `bug/-repro` branches. A triage whose reproduction reads repository files is a `*.repo.test.ts` (toolchain.md, Commit hook / Push hook), and by design it fails, so the push is refused:

🥊 repo-tests: A test of the repository's own files fails (a size cap, the ADR index, a doc's audience)
error: failed to push some refs

`--no-verify` is refused by the tool guard, so the triager has to give the test another name to push it. Either skip the triage's own failing test on a `bug/-repro` push, or say in the triage-bug skill what a repo-file reproduction is named.

Found while triaging #1815.

Written by an agent.

Activity

  1. added
    bug:new
    on Nov 24, 2026
  2. self-assigned this
    on Nov 24, 2026
  3. V3RON commented on Nov 24, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    Confirmed. src/push-hook.test.ts on bug/1817-repro, "does not run the repo tests on %s, whose reproduction fails by design", for bug/7-repro and wip/7-repro (the skill's fallback branch that pushes to bug/<n>-repro). It runs the real repo-tests job in a scratch repo with a failing stand-in pnpm. The control, "runs every repo test on any other branch and refuses the push when one fails" (task/7), passes. This is a gap: the expectation, skip on those two branches, is a proposal.

    pnpm exec vitest run --project unit src/push-hook.test.ts
    
    -   "pnpm": null,
    -   "status": 0,
    +   "pnpm": "exec vitest run --project unit .repo.test.ts\n",
    +   "status": 1,
     ❯ src/push-hook.test.ts:61:37
          Tests  2 failed | 1 passed (3)
    

    Checked live too: a throwaway failing src/zz-1817-probe.repo.test.ts made lefthook run pre-push --command repo-tests --force print 🥊 repo-tests: A test of the repository's own files fails.

    Root cause

    Gap. lefthook.yml:58-61 runs every *.repo.test.ts on every push, as toolchain.md (Push hook) describes. Nothing exempts the branch where delivery rule 8 requires a failing test. So a reproduction that reads repository files, named *.repo.test.ts per toolchain.md, can only be pushed under another name, as #1815's was.

    Simplest fix

    Skip the job on the two triage branches. CI still runs every repo test on every push.

        repo-tests:
          priority: 1
          skip:
            - ref: bug/*-repro
            - ref: wip/*-repro

    Also change toolchain.md's Push hook line to say the job is skipped there, and rename the test to src/push-hook.repo.test.ts, since it reads lefthook.yml.

    pnpm exec vitest run --project unit src/push-hook.test.ts src/commit-msg-check.test.ts .repo.test.ts
     Test Files  11 passed (11)   Tests  112 passed (112)
    

    Alternatives rejected

    • Have the triage-bug skill name repo-file reproductions *.test.ts: this breaks toolchain.md's naming, and the fix PR has to rename the test.
    • Exclude only the test files the branch adds against origin/main: this needs a script for a branch that only adds one test, which is more than the case needs.

    Risk

    • Lefthook matches ref against the checked-out branch, not the ref being pushed. A push from any other local branch to bug/<n>-repro still runs the job.
    • A triage test that breaks another repo test (a size cap, hygiene) is now caught only by CI.

    Fast track

    • Defect: no — a gap, the skip is a proposal
    • Fix tried: yes
    • Nothing public added or broken: yes
    • No ADR or rule changed: no — toolchain.md's Push hook text changes
    • One fix: no — the skill-naming alternative is another fix

    Written by an agent.

  4. removed their assignment
    on Nov 24, 2026
  5. added
    bug:ready
    and removed
    bug:new
    on Nov 24, 2026
  6. self-assigned this
    on Nov 24, 2026
  7. V3RON commented on Nov 24, 2026

    @V3RON
    ContributorAuthor

    Delivery run

    Merged: #1821 (#1817)
    Parked: none
    Waiting: none
    Decided: none

    Written by an agent.

  8. added a commit that references this issue on Nov 25, 2026
    605087c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug:ready

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions