Skip to content

Correct a wrong shebang claim in the attestation launcher, and bring the canonical auditor up to date - #112

Merged
unbraind merged 1 commit into
mainfrom
fix/correct-the-shebang-claim-and-reproduce-it
Sep 7, 2026
Merged

Correct a wrong shebang claim in the attestation launcher, and bring the canonical auditor up to date#112
unbraind merged 1 commit into
mainfrom
fix/correct-the-shebang-claim-and-reproduce-it

Conversation

@unbraind

@unbraind unbraind commented Sep 7, 2026

Copy link
Copy Markdown
Owner

The claim was wrong, not just unreproduced

The launcher's docstring said the auditor "treats any file whose first two bytes are a shebang as executable shell". Written into a throwaway git repository under four shebangs and run through the real verify():

shebang file reported by name?
#!/bin/bash yes — scanned as shell
#!/usr/bin/env sh yes
#!/usr/bin/env node no
none no — which is why this file has none

A shebang says a file executes; it does not say it executes as shell.

Why the two changes belong in one PR

The claim was true for pm-ops 2026.9.5 — which this repository was still pinned to, two releases behind the canonical auditor and therefore missing every fail-open construction closed since. Bumping to ^2026.9.7 is what makes the corrected claim correct. Fixing the prose alone would have documented a version this repository does not run.

Measured, before and after the bump, with scripts/attest-corpus/check.sh from the companion repository:

corpus
before (2026.9.5) unreadable by the harness — see below
after (2026.9.7) the same 7 every converged repository reports

The launcher now re-exports the gate by reference

It previously exported only runIfMain, with two consequences: the fleet's bypass-corpus harness read this repository as broken rather than as converged, and nothing asserted that what the launcher exposes is the package's function rather than a local wrapper. Both fixed; the identity assertion is the one that matters over time, since a wrapper is how a re-fork starts.

Where the error came from

The identical wrong sentence is in all seven repositories carrying this launcher. It was propagated by copying the reference file, so the error travelled with the text — the same failure mode the convergence itself exists to end, showing up in prose instead of in code. Corrected in the six sibling convergence branches at the same time (unbraind/pm-web#135, unbraind/pm-github#77, unbraind/pm-slack#99, unbraind/pm-starter#98, unbraind/pm-linear#103, unbraind/pm-graph#88).

Found by Greptile's unreproduced-claim rule on unbraind/pm-graph#88.

Gates

typecheck pass · docstring 71/71 · coverage thresholds met · 7 tests pass / 0 fail · changelog up to date

pm items

  • pm-csv-rioq — Correct a wrong shebang claim in the attestation launcher, and bring the canonical auditor up to date

Summary by Sourcery

Align the release attestation launcher with the current canonical auditor and correct its shebang guidance.

New Features:

  • Expose the canonical attestation and verification gates directly from the release attestation launcher.

Bug Fixes:

  • Correct the launcher documentation to distinguish shell shebangs from non-shell interpreter shebangs.

Enhancements:

  • Add identity checks ensuring the launcher uses the package-provided attestation functions.
  • Add coverage for the auditor’s shell-shebang detection behavior.

Build:

  • Update the pm-ops dependency to the current compatible release and refresh the lockfile.

Tests:

  • Add tests covering launcher export identity and shell-specific shebang scanning.

Chores:

  • Record the change in the changelog and project task history.

Summary by cubic

Corrects the attestation launcher's shebang docstring — a shebang says a file executes, not that it executes as shell — and bumps pm-ops to ^2026.9.7, the release where the corrected claim holds. The launcher also re-exports pm-ops's verify and auditPublishAttestation by reference so the fleet's bypass-corpus harness reads this repository as converged.

Bug Fixes

  • Only shebangs naming a shell interpreter (like #!/bin/bash) pull a file into the audit scan; #!/usr/bin/env node and no shebang do not.
  • The old wording was accurate for the previously pinned pm-ops 2026.9.5; the bump is required for the correction to match the auditor actually run.
  • The same wrong sentence exists in all seven repositories carrying this launcher and is corrected in the six sibling convergence branches.

Refactors

  • Identity tests assert the launcher exposes the package's own functions, catching any re-fork that wraps them.

Written for commit 7736690. Summary will update on new commits.

Review in cubic

…date

The launcher docstring said the auditor treats any file whose first two bytes
are a shebang as executable shell. Reproduced, that is false: a shebang says a
file executes, not that it executes AS shell, so only a shebang naming a shell
interpreter makes the body shell input.

The claim was TRUE for pm-ops 2026.9.5, which this repository was still pinned
to - two releases behind the canonical auditor and therefore missing every
fail-open construction closed since. The bump to ^2026.9.7 is what makes the
corrected claim correct, so the two changes belong together.

The same sentence is in all seven repositories carrying this launcher: it was
propagated by copying the reference file, so the error travelled with the text.

Also re-exports auditPublishAttestation and verify by reference. The launcher
exported only runIfMain, so the fleet's bypass-corpus harness read this
repository as broken rather than as converged, and nothing asserted that what
the launcher exposes IS the package's function rather than a wrapper.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @unbraind, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 minute by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 6c517a5a-ee83-4b5c-bdd4-ce5e59180fac


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR corrects the launcher’s shebang claim, adds regression coverage for the auditor’s shell-detection behavior, upgrades pm-ops to the canonical 2026.9.7 implementation, and re-exports its audit gates by reference with identity tests.

Sequence diagram for attestation audit delegation

sequenceDiagram
    participant Consumer
    participant Launcher as verify-release-publish-attestation
    participant Auditor as pm-ops/attestation

    Consumer->>Launcher: auditPublishAttestation()
    Launcher->>Auditor: auditPublishAttestation()
    Auditor-->>Consumer: audit result
    Consumer->>Launcher: verify()
    Launcher->>Auditor: verify()
    Auditor-->>Consumer: verification result
Loading

Flow diagram for shebang-based shell detection

flowchart TD
    A[File starts with shebang] --> B{Interpreter is shell?}
    B -->|Yes: bash or sh| C[Auditor scans file as shell]
    B -->|No: node| D[Auditor leaves file unscanned]
    E[No shebang] --> D
Loading

File-Level Changes

Change Details Files
Correct the attestation launcher documentation to distinguish shell shebangs from non-shell interpreters, and add executable reproduction tests for the documented behavior.
  • Update the docstring to state that bash/sh shebangs trigger shell scanning while node does not.
  • Exercise bash, env-sh, env-node, and no-shebang cases against temporary git repositories.
scripts/verify-release-publish-attestation.ts
test/verify-release-publish-attestation.test.ts
Update the launcher to expose the canonical auditor implementation directly and verify that the exports retain package-function identity.
  • Upgrade pm-ops from the pinned 2026.9.5 release to ^2026.9.7 and refresh the lockfile.
  • Re-export auditPublishAttestation and verify without wrappers.
  • Assert reference identity between launcher and package exports.
package.json
package-lock.json
scripts/verify-release-publish-attestation.ts
test/verify-release-publish-attestation.test.ts
Record the security-related maintenance work in project tracking and release documentation.
  • Add the chore entry and history record.
  • Add an Unreleased Security changelog entry.
.agents/pm/chores/pm-csv-rioq.toon
.agents/pm/history/pm-csv-rioq.jsonl
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@greptile-apps

greptile-apps Bot commented Sep 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR updates the canonical publish-attestation auditor to the lockfile-resolved 2026.9.7 release, corrects the launcher's shebang documentation, and exposes the package's auditor functions by reference.

  • Adds identity assertions for the canonical verify and auditPublishAttestation exports.
  • Reproduces shell, env sh, Node, and absent-shebang classification using temporary Git repositories.
  • Records the security maintenance work in the changelog and project tracker.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations remain.

The release-critical launcher still invokes the canonical verifier, clean CI and release installs resolve the reviewed lockfile version, the new exports preserve package function identity, and the regression tests cover the corrected shebang behavior.

Important Files Changed

Filename Overview
scripts/verify-release-publish-attestation.ts Corrects the shebang explanation and re-exports the canonical attestation functions without wrapping them.
test/verify-release-publish-attestation.test.ts Adds reference-identity coverage and reproduces four shebang-classification states.
package.json Raises the pm-ops requirement to 2026.9.7 while the release environment remains lockfile-controlled.
package-lock.json Resolves pm-ops exactly to 2026.9.7 with updated registry integrity metadata.
.agents/pm/chores/pm-csv-rioq.toon Records the completed attestation-auditor maintenance work with matching history state.

Reviews (1): Last reviewed commit: "Correct a wrong shebang claim, and bring..." | Re-trigger Greptile

@unbraind

unbraind commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Merging. Measured result for this repository, with the harness at scripts/attest-corpus/check.sh in the companion:

The vendored scanner is deleted and the gate is now the canonical pm-ops/attestation export. The corpus verdict drops to the same seven every converged repository reports — and that identity is the point, not the number. Those seven are open in the canonical implementation itself, not here, and unbraind/pm-ops#100 (merged) closes all seven, so one pm-ops release moves every consumer at once. Before convergence each repository carried its own set of nine to fifteen, no two alike, which no release could reach.

Two review findings changed the shape of this PR and are worth naming, because both were cases where the guard did not do what it claimed:

  • The consumer test did not test consumption. It asserted the package's exports are functions while its own comment claimed reference identity. A launcher that imported the package and re-exported a local wrapper would have passed — the exact re-fork the test exists to catch. Now asserted by reference, and proven non-vacuous: substituting a pass-through wrapper makes it fail.
  • The launcher docstring stated a wrong fact. It said any shebang makes a file shell input. Reproduced against the real auditor, only a shebang naming a shell interpreter does; #!/usr/bin/env node does not. The same wrong sentence was in all seven repositories carrying this launcher — propagated by copying the reference file, so the error travelled with the text. Corrected everywhere and now reproduced in the suite rather than asserted.

Thank you to the reviewers on this wave; both of the above came from review, not from the change's author.

@unbraind
unbraind merged commit d37d519 into main Sep 7, 2026
11 checks passed
@unbraind
unbraind deleted the fix/correct-the-shebang-claim-and-reproduce-it branch September 7, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant