Skip to content

Only-t27 local hook reads no owner label: a protected file authorized on the PR cannot be pushed from a lane #13063

Open

Description

@gHashTag

Measured 2026-11-01 on branch lane/ci-pin-ubuntu-2404-13058 (PR #13061, label owner-approved-foreign
present on the PR). Commit 320bed6517 changes one line of .github/workflows/own-language.yml (the runs-on
pin of #13058), a change the owner authorized in words the same day. A plain git push from the lane, hooks on,
ends with exit 1: the lefthook pre-push own-language command prints

.github/workflows/own-language.yml: the Only-t27 gate itself is owner-only (owner rule 2026-10-05):
it needs the owner's label owner-approved-foreign; see AGENTS.md 'Only t27'

The label the message asks for is on the PR. The hook cannot see it: lefthook.yml compiles
gen/c/policy/own_language.c and calls check_all() with the exception list from
origin/master:tools/policy/foreign-exceptions.txt and nothing else; reason() in specs/policy/own_language.t27
returns R_PROTECTED before the exception list is consulted, and no label, environment variable or note is read.
The CI side does read the label (.github/workflows/own-language.yml skips the Only-t27 check step when the PR
carries it), so the two copies of the gate disagree by design: the spec header calls the label "the only override",
and that override exists only in CI. Consequences measured today: a protected file can be neither committed nor
pushed from a lane through the hooks; while the protected commit sits on a branch, every push from that branch is
denied, unrelated commits included; the only route left is a push from the owner's own terminal, and LEFTHOOK=0
or --no-verify are forbidden for agents (owner, 2026-11-01). This is not a request to weaken the gate. A protected
change should still reach master only under the owner's label. The question is how a lane carries an
owner-authorized line of a protected file to its PR with the hooks on. Three shapes, for the owner to pick:
(a) the pre-push hook looks the label up on the open PR of the branch through gh, failing closed when gh or the
network is unavailable; (b) protected files stay owner-only locally and AGENTS.md names the exact owner procedure
(the lane leaves a patch, the owner commits and pushes it); (c) a protected change travels as a separate PR opened
by the owner. Related: #13058 (the pin that hit this), #10201 (label scope 2026-10-18).

Boundary

  • specs/policy/own_language.t27
  • gen/c/policy/own_language.c
  • lefthook.yml

User Scenarios

  • Given an open PR that carries the label owner-approved-foreign and a lane commit that changes one
    PROTECTED_PATHS file, when the lane runs a plain git push with the hooks on, then the pre-push hook
    either passes on evidence it verified itself or prints the exact owner action, and never asks for a label that
    is already there.
  • Given the same branch and no network, when the hook cannot verify the label, then it fails closed
    with a message that says so.
  • Given shape (b) or (c) is chosen, when a lane meets a protected file, then AGENTS.md names the
    procedure in one place and the hook message points at it.

Requirements

  • FR-001: The chosen shape MUST be recorded as a decision in the header of specs/policy/own_language.t27, with a
    test that names the label path, and the hook MUST keep denying a protected change on a branch whose PR has no
    label.
  • FR-002: If the hook gains a label lookup, it MUST fail closed when gh, the network or the PR lookup is
    unavailable, and MUST read the label from the open PR of the pushed branch only.
  • FR-003: lefthook.yml MUST NOT gain a bypass variable; LEFTHOOK=0 and --no-verify stay forbidden for agents.
  • FR-004: Any foreign-line change MUST add no more hand-written lines than it deletes.

Success Criteria

  • t27c test-report specs/policy/own_language.t27 ends with FAIL 0 and 1 new test for the label path.
  • On a branch whose PR carries the label and whose only extra commit changes .github/workflows/own-language.yml,
    a plain git push ends with exit 0 (shape a), or AGENTS.md names the owner procedure and the hook message
    cites it (shapes b, c): 1 procedure, in 1 place.
  • On a branch whose PR carries no label, the same push still ends with exit 1: 1 denial.

Activity

  1. gHashTag commented on Nov 1, 2026

    @gHashTag
    CollaboratorAuthor

    Measured 2026-11-01 10:30Z on the same branch, from the owner's own terminal in the lane worktree: LEFTHOOK=0 git commit -am "ci(own-language): pin the gate job to ubuntu-24.04 (Refs #13058)" && git push. The commit landed locally as 320bed6517 (the variable covered the first command only). git push then ran with the pre-push hook on and was denied with the same text:

    .github/workflows/own-language.yml: the Only-t27 gate itself is owner-only (owner rule 2026-10-05): it needs the owner's label owner-approved-foreign; see AGENTS.md 'Only t27'
    exit status 1
    

    foreign-budget and secret-gate passed on that push (1 commit scanned, no leaks). So the denial depends neither on the account nor on the label on the PR (owner-approved-foreign is on #13061): the local gate has no owner input at all, which is the gap this issue names. Shape (b) therefore has to say how the owner's own push of a protected file passes the hook; shapes (a) and (c) do not have this problem.

  2. gHashTag commented on Nov 1, 2026

    @gHashTag
    CollaboratorAuthor

    Owner decision, 2026-11-01 (translated, the original is not quoted here): remove the mandatory owner-approval requirement for protected-file changes. This is a policy change, not a one-time exception for PR #13061. Shapes (a), (b) and (c) above are therefore replaced by a fourth one, (d): the gate's own files stop being owner-only; they are judged like any other file by kind, and every ordinary safeguard stays.

    Receipt correction for #13061: commit 320bed6517 was created in the owner's own terminal with LEFTHOOK=0 on the commit command, so pre-commit did not run for it; pre-push ran and denied the push. That chain is not hook-compliant end to end and its skipped pre-commit is not evidence. It is rerun in full once this policy change is effective.

    Approval-mechanism blocker, recorded once: the local hooks require an owner approval that they have no input path to recognise (no label, variable or note is read). Repeating the push or re-applying the label cannot change that, so neither is repeated.

    Scope of (d), as the lane will implement it in a separate pull request that Refs this issue:

    • PROTECTED_PATHS no longer makes a modification of the four gate files a denial by itself; they are judged by kind (spec, generated, workflow) and by the foreign-line budget.
    • Deleting a gate file, changing tools/policy/foreign-exceptions.txt in CI, adding a NEW foreign file, secret scanning, the 40/80 line caps and added <= deleted all stay.
    • The CI Only-t27 step compiles the BASE branch copy of the gate, so a pull request cannot judge itself by a loosened checker.
    • MSG_PROTECTED, the spec header, AGENTS.md, lefthook.yml and own-language.yml comments are updated to match; gen/c/policy/own_language.c is regenerated by t27c gen-c, never hand-edited.
  3. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/policy/only_t27_hook.t27 (typecheck OK, 1 test pass).

  4. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 specification/test scaffold exists, but the required production implementation, integration test, and CI verification are absent. This issue remains open until the target component implements the specified behavior and evidence is provided.

  5. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec exists and passes typecheck + tests. M4 milestone complete.

  6. gHashTag commented on Nov 18, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 spec was created but no production implementation, integration test, or CI verification exists. This issue remains open until the target component implements the specified behavior and evidence is provided.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions