Skip to content

babysit gate reads trusted actors and admission rules by branch name, not a resolved commit #10648

Closed

Description

@kyle-sexton

Problem

The babysit merge gate reads trust and policy files from the base branch by name, not by a resolved commit:

  • plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:1400 reads contents/.github/standards/trusted-actors/trusted-actors.json?ref={self.branch}.
  • babysit_verify_evidence.py:1465 reads ADMISSION_RULES_PATH with ?ref={default}.

GitHub resolves a ref that names both a branch and a tag in a way this code does not control (UNVERIFIED which wins for the contents API). If a tag named like the default branch can be created, it could stand in for the branch and supply a different trusted-actor list or admission rules. #10596 closed the same class in the approval-carry and cost-carry compares by resolving the base once to its tip SHA (baseTip / base_tip); these reads were outside that PR.

Fix

Resolve the default branch to its tip SHA once (GET /repos/{repo}/git/ref/heads/{branch}, require a 40-hex object.sha, fail closed otherwise) and read both files at that SHA. Reuse base_tip from babysit_merge_policy.py rather than adding a second resolver.

Optional hardening, a settings change for the owner: a tag ruleset that blocks tags named like protected branches would close this class repository-wide.

Acceptance

  • Both reads name a 40-hex SHA, never a branch name; a test asserts the request paths.
  • An unreadable or non-commit ref fails closed (no trusted actors, admission refused), with a test.

Refs: #10596

Activity

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

    @github-actions
    Contributor

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

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

    Understood: the babysit gate reads the trusted-actors file and the admission rules by branch name. You want it to resolve the default branch to its tip SHA once, reusing base_tip, and read both files at that SHA. An unresolvable ref should fail closed. Acceptance is tests that assert the request paths and the fail-closed behavior. The tag-ruleset hardening is a separate owner settings decision and isn't part of this change. I found no likely duplicate among the open issues.

    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 28, 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: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
    and removed
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    on Oct 28, 2026
  5. melodic-automation-lanes commented on Oct 28, 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. melodic-automation-lanes commented on Oct 28, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: admission moved the issue to status: confirmed; its comment says why.

  7. melodic-automation-lanes commented on Oct 28, 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: Both babysit_verify_evidence.py reads (trusted actors, admission rules) name a 40-hex tip SHA resolved via git/ref/heads, failing closed when it cannot be resolved.

    Related work

    Open questions

    1. Which resolver should be reused? The issue names base_tip in babysit_merge_policy.py, but no such function exists there.
      RECOMMENDED: Add one small tip resolver in babysit_merge_policy.py, modeled on PostMerge._branch_tip, that uses git/ref/heads, requires a 40-hex object.sha and raises PolicyReadError. Call it from babysit_verify_evidence.py. Do not reuse _default_branch_head, which reads commits/{branch} (still by name). Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:4100 and babysit_postmerge.py:1752
    2. Should the trusted-actors read use the default branch or the Reader's branch? The issue says default branch, but line 1400 reads self.branch, which comes from --branch (default main).
      RECOMMENDED: Resolve self.branch to its tip for the trusted-actors read, and the default branch via merge_policy._default_branch for the admission-rules read. Keep each at its current branch semantics. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:1400, 1450-1465, 2949
    3. The run cache keys trusted-humans, trusted-logins and task-list by repo@​branch. Should keys change to the SHA?
      RECOMMENDED: Keep the branch-name keys, since entries only live for run_cache.MAX_AGE. Resolve the SHA only on a cache miss, and test that a cache hit makes no extra request. Basis: plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:1392, 1431, 1453

    Sources read

    • plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:1400: trusted-actors read uses ?ref={self.branch}
    • plugins/source-control/skills/babysit-prs/scripts/babysit_verify_evidence.py:1465: admission rules read uses ?ref={default}
    • plugins/source-control/skills/babysit-prs/scripts/babysit_merge_policy.py:4100: _default_branch_head reads commits/{branch}; no base_tip function found
    • plugins/source-control/skills/babysit-prs/scripts/babysit_postmerge.py:1752: _branch_tip resolves git/ref/heads and requires a 40-hex sha

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

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

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

    priority: mediumReal value, no hard deadline; normal backlog flow.status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.status: needs-decisionAwaiting a human or maintainer judgment call.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions