Skip to content

ci: add the lane-line check — every PR body opens with its lane (Amendment 1, Rule 8) - #15

Merged
brettheap merged 2 commits into
mainfrom
ci/lane-line-check
Sep 4, 2026
Merged

brettheap merged 2 commits into
mainfrom
ci/lane-line-check

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Lane: openxfactory-f2

What this is

Adds .github/workflows/lane-line.yml — a small GitHub Actions status check
named lane-line that fails a human-authored PR whose body does not open
with Lane: <name>. This is Lane Collision Protocol Amendment 1, Rule 8:
THE LANE LINE IS ENFORCED, NOT ASSUMED.

Ratification

Amendment 1 (~/.agents/protocols/lane-collision-protocol-amendment-1.md)
was ratified by Brett Heap 2026-09-04, in session, lane openxfactory-f2
(session session_01KeBPLWRL4rhgRbmjP8Li41), verbatim: "ratify amendment
1."
Rule 8's motivating finding: of eleven openxFactory PRs authored on
2026-09-03, four opened without the Lane: line — including #610 (which
also broke main's pytest suite) and #621 (its fix). The two PRs that made
the day's most expensive mess could not be attributed from their own
bodies. This PR is adoption step 4 of Amendment 1's adoption path — the
lane-line workflow PR, last of the three sibling repos (after openxFactory,
PR #631 b1d492a3, and codexFactory/xFactory).

What the check does

  • Reads the PR body's first non-empty line via github.event.pull_request.body,
    passed through env: (never inlined into run: — a PR body is untrusted
    input).
  • Passes if that line matches ^Lane: [a-z0-9-]+( \(.*\))?$ (a bare
    Lane: <name>, optionally with a parenthetical annotation such as
    (second window)).
  • Fails otherwise, with an ::error:: annotation naming the offending first
    line (or <empty>).
  • Triggers on pull_request: [opened, edited, synchronize, reopened] — the
    edited type means a PR that adds the line after opening re-runs the
    check without needing an empty push.
  • Runs on pull_request, never pull_request_target: no secrets, no
    network, permissions: contents: read only.

What the check does NOT do

  • Bots are exempt by ACTOR, never by body. The job is gated on
    github.event.pull_request.user.type != 'Bot' — dependabot and the
    app/openxfactory intents bot skip the job entirely. A human PR never
    reaches that branch, and nothing lets a human PR claim bot exemption by
    spoofing the body.
  • It validates the lane line only. Rule 5's second line, Claim: <url>,
    is deliberately not resolved — doing so needs a token and a comment
    lookup, and a check that can fail for network reasons is a check lanes
    learn to ignore. The claim URL stays convention until it has its own
    change.
  • Commit trailers (Lane:, Co-Authored-By:) stay unenforced. Squash
    merges rewrite commit bodies at merge time, so a pre-merge trailer check
    would gate on text GitHub is about to discard, and a post-merge check
    gates nothing. The PR body is the durable carrier.

Byte identity

.github/workflows/lane-line.yml in this PR is byte-identical to the
appendix in lane-collision-protocol-amendment-1.md and to the file already
landed in openxFactory (b1d492a3, PR #631) — verified with diff before
committing.

Adoption note

This PR does not make lane-line a required status check. Per Rule 8:
"Making it REQUIRED is Brett's act, in the console, and no agent's." The
adoption sequence is: land this workflow, let it run advisory (non-blocking)
on a few PRs, then Brett adds lane-line to the branch ruleset as required.
No agent edits a ruleset.

This PR is itself subject to Rule 5 — its body opens with the lane line
above, which is the cheapest possible first test of the check it adds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeBPLWRL4rhgRbmjP8Li41

Copilot AI lite review requested due to automatic review settings September 4, 2026 02:09

@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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-f2

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI 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.

🟡 Changes recommended

The workflow currently embeds untrusted PR-body content into a GitHub Actions ::error command without escaping, which is a security-hardening issue for workflow-command parsing.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a lightweight GitHub Actions check to enforce the Lane Collision Protocol requirement that human-authored PR bodies begin with a Lane: <name> line, improving attribution and reducing lane-collision risk across contributions.

Changes:

  • Introduces a new lane-line workflow that runs on PR open/edit/sync/reopen events.
  • Extracts the first non-empty PR body line and validates it against the expected Lane: format.
  • Emits a GitHub Actions error annotation when the lane line is missing or malformed.
File summaries
File Description
.github/workflows/lane-line.yml Adds the lane-line CI check to enforce PR body lane-line formatting for human PRs.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/lane-line.yml Resolved
Comment thread .github/workflows/lane-line.yml Resolved
Copilot AI review requested due to automatic review settings September 4, 2026 02:15
Copilot review finding on this PR: the ::error annotation interpolated
the untrusted PR-body first line ($first) directly into the workflow
command message, which GitHub Actions percent-decodes — a crafted body
line could inject additional workflow commands into the runner log.
The annotation is now fully static; the offending line is still surfaced,
via a plain echo before the annotation instead of inside it.

Also fixes the exemption comment: it said "bots are exempt by ACTOR" but
the condition keys on github.event.pull_request.user.type, the PR AUTHOR,
not the actor. Reworded to say PR AUTHOR type explicitly.

Lane: openxfactory-f2
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBPLWRL4rhgRbmjP8Li41
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

Copilot AI 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.

🟢 Approval recommended

The workflow matches the stated enforcement behavior and prior feedback has been addressed, with only a minor reliability nit suggested.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/workflows/lane-line.yml:17

  • Consider adding timeout-minutes to this job for consistency with other required checks in this repo and to avoid a stuck runner blocking the check indefinitely (even though this script is small).
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openxfactory-f2

Provenance for the admin merge. RULING for lane openxfactory-f2's PR #15 (head 898a8d37): Brett Heap, 2026-09-04 ~02:2xZ, in-session, verbatim: "roll out lane-line" — adoption step 4 of Lane Collision Protocol Amendment 1 (ratified by him 2026-09-04). Merge basis: lane-line PASSED on this PR's own body; pytest-suite, wallet-validation, SonarCloud SUCCESS on 898a8d37; Copilot's two findings TAKEN (static annotation; author-type comment), threads resolved; Codex rate-limited (provider non-review). Making lane-line REQUIRED here remains Brett's ruleset act. --admin satisfies only the review rule. Merged at 2026-09-04T02:26Z. Session: https://claude.ai/code/session_013f11Yb8DF5FTL6NuV7xWYb

@brettheap
brettheap merged commit 05007e2 into main Sep 4, 2026
5 checks passed
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.

2 participants