fix(hybrid-gate): make the inline attribution pattern a superset - #37
Merged
Conversation
The embedded ai-attribution job hardcodes its regex while the standalone no-ai-attribution.yml reads the caller's pattern file, so the two enforce the same policy from different sources and the embedded one is weaker. Against a real caller's pattern file it missed moonshot, openai, a second robot glyph, and the product URL. Two markers were missed by both, found by reading what the harness emits: the Claude-Session trailer key, which sits beside rather than inside the co-authored-by line, and a bare session URL on its own line -- that line carries neither glyph nor generated-with text, so scrubbing the line above it leaves this one standing. Direction matters here: deleting a repo's local copy in favour of the shared job would have REDUCED coverage, because the local copy is a superset rather than a duplicate. The shared floor rises first. Verified against both directions: 8 of 8 real markers matched, and 4 of 4 legitimate prose lines still ignored, including one discussing a co-authored-by trailer. The line-anchoring that makes that work is preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Finding
hybrid-gate.yml's embeddedai-attributionjob and the standaloneno-ai-attribution.ymlenforce the same policy through two different sources of truth, and theembedded one is the weaker of the two. Repos that rely on hybrid-gate alone are enforcing a smaller
pattern set than repos calling the standalone workflow.
Evidence
The standalone workflow reads the caller's
.github/no-ai-attribution-patterns.txt(
no-ai-attribution.yml:9-12,41). The embedded job does not read that file at all — it hardcodes aninline regex (
hybrid-gate.yml:471):Compared against a real caller's pattern file (aletheia's
.github/no-ai-attribution-patterns.txt),the inline pattern misses:
Moonshotin a co-authored-by trailerOpenAIin a co-authored-by trailer🧠claude.com/claude-codeTwo further markers are missed by both, found by reading what the harness actually emits rather
than by inferring:
Claude-Session: https://claude.ai/code/session_…— a trailer key sitting beside, not inside, theco-authored-by line, so the trailer alternate never sees it.
https://claude.ai/code/session_…on its own line. It carries no🤖and nogenerated with, so removing the marker line above it leaves this one standing — which is exactlywhat a partial scrub produces.
Why this matters
This is a reusable workflow, so the weaker of the two implementations is what most adopting repos
run.
WORKFLOW/no-ai-attributionis akanon gateError and the operator's standing rule is thatno forkwright repo carries AI attribution, so a marker the shared gate does not match is a marker
that reaches
main.The direction of the fix matters too. The obvious cleanup — delete a repo's local duplicate and rely
on the shared job — would have reduced coverage here, because the local copy is a superset rather
than a duplicate. The shared floor has to rise first; only then is the local copy genuinely
redundant.
Desired correction
Make the inline pattern a superset of what any caller's pattern file holds, with each alternate
justified at the site by an observed marker rather than by guessing at vendor names.
Verified by running the new pattern against both directions:
Claude-Session:, thegenerated-with line, a bare session URL,
Generated with Codex, and moonshot/openai/🧠 variants.Co-authored-by: Claudetrailer and one containinghttps://example.com/claude-code. Theline-anchoring that makes that possible is preserved.
Done when:a repo enforcing attribution through hybrid-gate alone catches every marker a repo usingthe standalone workflow catches.