Skip to content

test(build): enforce @ai specificity (denylist + duplication cap) - #314

Draft
netravnen wants to merge 1 commit into
fix/lifecycle-marker-stragglersfrom
test/conventions-ai-tags
Draft

test(build): enforce @ai specificity (denylist + duplication cap)#314
netravnen wants to merge 1 commit into
fix/lifecycle-marker-stragglersfrom
test/conventions-ai-tags

Conversation

@netravnen

@netravnen netravnen commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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: 589 pass, 1 skipped, 0 fail
    (585 baseline + 4 new).

Backwards Compatibility:

  • Test and docs only; no script behavior change.

Assisted-by: Claude:claude-opus-5


Stack created with GitHub Stacks CLIGive Feedback 💬

@netravnen
netravnen force-pushed the test/conventions-ai-tags branch from 9428f19 to bfac0d2 Compare August 20, 2026 20:19
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
netravnen force-pushed the test/conventions-ai-tags branch from bfac0d2 to 21d8fa9 Compare August 20, 2026 20:40
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