Skip to content

fix(pr-pipeline): strip YAML comments without cutting quoted or block-scalar text #10910

Closed

Description

@kyle-sexton

Problem

Two readers in plugins/source-control/skills/babysit-prs/scripts/babysit_risk.py drop YAML comments by cutting each line at the first #: gated_workflow, which decides whether a workflow is a person-held gate floor path, and _code_lines, which the permission, trigger and secret backstops read. A # can sit inside a quoted string (run: echo "a #b ${{ secrets.X }}") or a block scalar (run: | followed by shell with a # before a secrets expression on the same line). Cutting there hides the rest of the line, so a credential reference after it is not seen.

The independent security review of #10743 rated this P4. PyYAML parses the full text where it is installed, and the main-run review reads the whole diff. The text-only readers are the backstop, and this cut is the gap in them.

Proposed fix

Strip a comment only where YAML treats # as one: outside single- and double-quoted scalars, and never inside a block scalar (| or >) body. Alternatively, fail closed: when a line cut at # has quotes before the cut, or sits inside a block scalar, read the whole line.

Acceptance criteria

  • run: echo "a #b ${{ secrets.DEPLOY }}" gates the workflow (gated_workflow) and holds as secret-exposure-review when added.
  • A block-scalar line echo a #b ${{ secrets.DEPLOY }} under run: | does the same.
  • A real comment (# ${{ secrets.DEPLOY }} on its own line, or after # outside quotes) still gates nothing.

Refs: #10743

Activity

  1. added
    needs-triage
    on Oct 29, 2026
  2. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

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

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

    Understood: the text-only YAML readers in babysit_risk.py (gated_workflow and _code_lines) cut each line at the first #. That hides a secrets reference that follows a # inside a quoted string or a block-scalar body. The proposed fix is to strip comments only outside quotes and block scalars, or to fail closed and read the whole line. The three acceptance criteria are checkable. No likely duplicates found among open issues.

    Automated triage, applied by the lanes App.

  3. added and removed
    needs-triage
    on Oct 29, 2026
  4. added
    status: ready
    admission-deferred
    agent-ready
    needs-human
    and removed
    admission-deferred
    agent-ready
    on Oct 29, 2026
  5. melodic-automation-lanes commented on Oct 29, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped partway through this issue and needs a person.

    Why, in the run's own words:

    The code this issue fixes is not on main. #10743, the pull request that adds babysit_risk.gated_workflow (the gate floor reader) and the _code_lines backstop reader, is still open. Neither function exists at bd37cee. What main has instead does not match the issue: _cost_reasons checks the whole added line against _SECRET_REF with no comment strip, so acceptance criteria 1 and 2 already hold for secret-exposure-review, and criterion 3 fails the other way (a commented-out # ${{ secrets.DEPLOY }} still holds). Someone needs to decide whether to fix this on #10743's branch or wait for #10743 to merge and then re-label this issue agent-ready.

    What the run says it did not do:

    • No fix made: the target functions exist only on the unmerged #10743 branch.
    • tidy skipped: no change to tidy.
    • review, build/test and lint skipped: no change was made.

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40852694535

    To retry, remove needs-human and add agent-ready again.

  6. added
    agent-ready
    and removed
    needs-human
    on Oct 29, 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

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions