Skip to content

ci: guard against attribution trailers and raw control bytes in PR commits/diffs #240

Open

Description

@Ambisphaeric

Problem

Two classes of repo-hygiene defect have repeatedly escaped into main history, and neither is caught by any current CI check, build step, or drift guard:

1. Attribution trailers on commits. The recorded 2026-07-08 owner policy is that commit messages carry no Co-Authored-By / "Generated with" attribution trailers. Four commits from the recent batches nonetheless landed on main carrying Co-Authored-By: Claude … <noreply@anthropic.com> trailers:

(Older trailered commits from 2026-07-13/14 — e.g. the 0.0.18 cut, #175, #206 — confirm this is a recurring escape, not a one-off. PR #237's trailer was caught and stripped pre-merge this batch, which shows the only thing standing between the policy and a violation today is a human remembering to look.) Merged history is not rewritten; the point is to stop the NEXT one.

2. Raw control bytes in text source. Raw NUL (and other C0 control bytes) have appeared in authored text/source files three times now: one shipped (#213), two self-caught by authoring agents pre-commit (#218, #239). A raw NUL in a source file is invisible in most diffs and can silently corrupt parsing, string handling, or downstream tooling. The self-catch ritual is a standing tax that a guard should retire.

Both are cheap to detect mechanically and expensive to catch by eye.

Scope

  • Add a CI check (a new job, or an extension of the existing schema-drift-guard job) that runs on every PR and scans:
    • PR commit messages for attribution trailers (Co-Authored-By:, Generated with, and the emoji-robot signature), failing red when present.
    • the PR diff / changed text-source files for raw C0 control bytes (NUL \x00 and other non-tab/newline control bytes), failing red when present. Scope to text source (skip known-binary extensions) to avoid false positives on legitimate binary assets.
  • Keep the guard fast and self-contained (no network), mirroring the existing drift-guard job shape.
  • Do not rewrite existing history; the guard is forward-looking.

Acceptance criteria

  • The check goes red on a PR commit whose message carries a Co-Authored-By (or other attribution) trailer.
  • The check goes red on a PR that introduces a raw NUL (or other C0 control byte) into a text-source file — proven by a negative probe (a deliberately-seeded NUL fails the guard).
  • The check goes green on a clean PR (no trailer, no control bytes).
  • The guard is documented (CODE_MAP / the CI workflow) and runs under the existing Node 22 CI, adding no meaningful wall-clock cost.

Refs #213 (shipped NUL), #218/#239 (self-caught NULs), #214/#225/#233 (escaped trailers), #87 (schema-drift-guard lineage this can extend).

Activity

  1. added
    enhancement
    on Jul 17, 2026
  2. Ambisphaeric commented on Jul 18, 2026

    @Ambisphaeric
    OwnerAuthor

    Evidence for machine enforcement — two more near-misses this wave (both caught only by fresh-eyes review)

    The "perfect the note-taker pad" wave produced two more instances of exactly the classes this guard would catch, neither surfaced by CI:

    • Attribution-trailer near-miss (5th). The human-voice summary PR (Human note-taking voice for the summary family; silence for empty windows #249) carried a Co-Authored-By attribution trailer on its commit; it was stripped pre-merge via amend + force-push. Notably the reviewer initially misread the trailer as required — human review is not a reliable gate for this, which is the argument for enforcing the ban in CI rather than by convention.
    • Raw control-byte near-miss (4th). The sovereign-corrections PR (Make summary prose correctable in place (sovereign user revisions) #251) introduced 5 raw NUL bytes into apps/engine/src/store/workspaces.ts. CI stayed green because no source-byte guard exists; the bytes were found only in fresh-eyes review and replaced with escapes (byte-identical, proven by an identical correction-id hash before/after).

    Running tally: attribution-trailer escapes/near-misses now 5; raw-NUL-byte near-misses now 4. Both classes remain undetected by the current pipeline.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions