test(build): enforce @ai specificity (denylist + duplication cap) - #314
Draft
netravnen wants to merge 1 commit into
Draft
test(build): enforce @ai specificity (denylist + duplication cap)#314netravnen wants to merge 1 commit into
netravnen wants to merge 1 commit into
Conversation
netravnen
force-pushed
the
test/conventions-ai-tags
branch
from
August 20, 2026 20:19
9428f19 to
bfac0d2
Compare
Make the ratified @ai anti-boilerplate rules (wayfinder ticket ai-enforcement-parameters, 2026-08-20) machine-checked so stock tags cannot be reintroduced. The insight that makes this enforceable without defining "boilerplate": boilerplate is, by definition, repeated -- so an exact-duplication cap plus a denylist of the historical stock phrases covers the space with no similarity scoring. Changes: - tests/conventions-ai-tags.test.js: pure node:test + fs conformance test over all six source fragments (three .src.js plus lib/admincom-common.js, lib/cp-name-normalization.js, lib/admincom-entity-exclusions.js). Three assertions: the seven historical stock phrases are denylisted exactly; identical normalized @ai text may appear at most 2 times repo-wide (permits one deliberate twin pair, blocks templates); tag prose must carry at least 30 characters of substance. - docs/CONVENTIONS.md "Documentation convention": rewritten to the ratified rule -- an @ai tag states one invariant specific to that function that a plausible diff could silently violate, with the litmus sentence ("If the sentence could be pasted onto a different function unchanged and still read true, it is not an @ai tag"); drops the stock-phrase examples and the "900+ occurrences" text. Security: - N/A Testing: - Non-vacuity proven: temporarily re-adding the stock tag "Keep behavior stable and prefer minimal, localized edits." to lib/admincom-common.js turned the denylist assertion red with the exact file:line, then the file was restored and the suite went green again. - The one existing exact-duplicate pair (DP's two "Preserve menu command registration behavior." tags) sits at the N=2 cap and passes by design. - python user.js/scripts/build_userscripts.py && --check: green. - node --check on all three generated .user.js: green. - cd user.js && node --test: 569 pass, 1 skipped, 0 fail (565 baseline + 4 new). Backwards Compatibility: - Test and docs only; no script behavior change. Assisted-by: Claude:claude-opus-5
netravnen
force-pushed
the
test/conventions-ai-tags
branch
from
August 20, 2026 20:40
bfac0d2 to
21d8fa9
Compare
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.
Make the ratified @ai anti-boilerplate rules (wayfinder ticket
ai-enforcement-parameters, 2026-08-20) machine-checked so stock tags
cannot be reintroduced. The insight that makes this enforceable without
defining "boilerplate": boilerplate is, by definition, repeated -- so
an exact-duplication cap plus a denylist of the historical stock
phrases covers the space with no similarity scoring.
Changes:
test over all six source fragments (three .src.js plus
lib/admincom-common.js, lib/cp-name-normalization.js,
lib/admincom-entity-exclusions.js). Three assertions: the seven
historical stock phrases are denylisted exactly; identical
normalized @ai text may appear at most 2 times repo-wide (permits
one deliberate twin pair, blocks templates); tag prose must carry
at least 30 characters of substance.
ratified rule -- an @ai tag states one invariant specific to that
function that a plausible diff could silently violate, with the
litmus sentence ("If the sentence could be pasted onto a different
function unchanged and still read true, it is not an @ai tag");
drops the stock-phrase examples and the "900+ occurrences" text.
Security:
Testing:
behavior stable and prefer minimal, localized edits." to
lib/admincom-common.js turned the denylist assertion red with the
exact file:line, then the file was restored and the suite went
green again.
command registration behavior." tags) sits at the N=2 cap and
passes by design.
(585 baseline + 4 new).
Backwards Compatibility:
Assisted-by: Claude:claude-opus-5
Stack created with GitHub Stacks CLI • Give Feedback 💬