Repository navigation
fix(standards): css args is a stated absence -- CSS declares no callable (#2893) - #2894
Merged
Merged
Conversation
…ble (#2893) `args` has a stated contract ("the parameters a callable declares", #2773) and css was the one language knowingly violating it: the rule matched value-function CALLS (calc|var|url|rgba|clamp|...). The contract doc said so outright -- "the one place in this document where the contract is deliberately not met" -- and kept it because "the honest alternatives are this approximation or 0 forever, and 0 says a stylesheet full of computed values has no coupling at all". Both halves of that were wrong. There is a third alternative, and the sheet already mandated it: COUNT_CONTRACT corollary 3 -- a language that cannot express the construct records "a contract-level absence (`None` rule + a ledgered intended-morphology entry) rather than a manufactured construct. The two answers cannot coexist inside one signal." None is not 0; an n/a cell leaves the median. Same answer solidity's io: None records (io_rule_contract.md C3). And a stylesheet's coupling IS measured, by the rules that own it. Of the 3855 crucible hits: 2521 var( (safety already counts 512 of them, the guarded var(x, fallback) read), 931 colour literals that were never coupling, 321 calc( (226 already containing a var()), 77 url( that io owns since #2752, 5 clamp(/min( that safety owns. On the same files api counts 3597 --custom-property: DECLARATIONS -- the definitions those var()s read, a larger surface than the reads. Three of those five rules postdate the sentence they disprove. It was also a live measurement defect. css gets no args_search_text, so _calculate_block_metrics searched the whole block BODY and took the first match: 6 at-rules carried 13 phantom parameters borrowed from their own bodies (preflight.css:291's @supports has no parenthesised call in its prelude at all and read arity 3 off a color-mix() three lines inside the block). args_exact_match 19/25 -> 25/25. Named residual, stated not hidden: the UNGUARDED var(--x) read (2521 - 512 = 2009 occurrences) is now unmeasured. No stated contract owns "reads a document-lifetime binding by name" (globals C2 excludes an ordinary read); it earns its own signal or it stays unmeasured. Reopen condition: css.py claims .scss/.sass/.less/.styl/.pcss, and Sass/Less DO declare parameters (@mixin b($size, $color), @function f($a, $b), .mixin(@A; @b)). Narrowing to those forms would satisfy the contract rather than except it, and was rejected only on measurability -- zero such files in either corpus or on the box. Recorded in the rule comment and the contract doc. Also corrected: tree_sitter_accuracy_audit.py's docstring attributed the gap to a non-existent "at-rule prelude tokens" mechanism and called it "not a GitGalaxy defect", telling three baseline reviews not to look. css joins ARGS_GRANULARITY as "none", which docs/language_status/css.md had already asserted in prose. Bless: 53 differences per master (14 topological), nothing newly parsed or excluded. The Testing Exposure leaves move because _calc_verification is impact-weighted and per-function impact carries sqrt(args+1) -- the movers are exactly the files with phantom arities, 1:1, and no other risk exposure moved. Closes #2893 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
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.
What this does
Makes css
argsa stated absence (None). CSS declares no callable, so it declares no parameter surface; every parenthesis in a stylesheet is a call into a builtin.argshas a stated contract — "the parameters a callable declares" (#2773) — and css was the one language knowingly violating it.docs/args_rule_contract.mdsaid so in as many words: "It is the one place in this document where the contract is deliberately not met." It was kept because "the honest alternatives are this approximation or 0 forever, and 0 says a stylesheet full of computed values has no coupling at all."Both halves of that turned out to be wrong.
1. There is a third alternative, and the sheet already mandated it.
signal_contracts.py'sCOUNT_CONTRACTcorollary 3: a language that cannot express the construct records "a contract-level absence (Nonerule + a ledgeredintended-morphologyentry) rather than a manufactured construct. The two answers cannot coexist inside one signal."Noneis not0— an n/a cell leaves the median instead of being compared against it. Same answer solidity'sio: Nonerecords (io_rule_contract.mdC3).2. A stylesheet's coupling is measured — by the rules that own it. Composition of all 3855 hits the rule made on the crucible's 38 css files (code stream):
var(safetyalready counts 512 of them (the guardedvar(x, fallback)read)rgba(rgb(oklch(color-mix(calc(var()url(ioowns it since #2752clamp(min(safetyownsclamp()On those same files:
apicounts 3597--custom-property:declarations — the definitions of the very tokensvar()reads, a larger surface than the reads — plussafety515,io14,reflection_metaprogramming24,import9. Three of those five rules postdate the sentence they disprove.3. It was also a live measurement defect. css receives no
args_search_text, so_calculate_block_metricssearched the whole block body and took the first match. Six at-rules carried 13 phantom parameters borrowed from their own bodies:preflight.css:291's@supportsprelude contains no parenthesised call at all; the arity 3 came from acolor-mix(in oklab, currentcolor 50%, transparent)three lines inside the block.args_exact_matchgoes 19/25 → 25/25.The named residual (stated, not hidden)
The unguarded
var(--x)read — 2521 − 512 = 2009 crucible occurrences — is now unmeasured. Deliberate: no stated contract owns "reads a document-lifetime binding by name" (theglobalscontract's C2 explicitly excludes an ordinary read by name), and inventing a home for it to preserve a number is the failure mode the absence exists to end. If it earns measurement, it earns its own signal.Reopen condition (important)
css.pyclaims.scss,.sass,.less,.styl,.pcss, and Sass/Less genuinely declare parameters (@mixin b($size, $color),@function f($a, $b), Less.mixin(@a; @b)). So "CSS has no callable of any kind" is false at the scope this definition claims, and the doc no longer says it. Narrowing the rule to those declaration forms — which would satisfy the contract rather than except it — was considered and rejected on measurability: zero.scss/.sass/.lessfiles in the language-crucible, zero in keyword-rosetta, zero on the build box. The reopen condition is recorded in both the rule comment and the contract doc.Also fixed: an audit docstring that documented the defect as a non-defect
tests/tools/tree_sitter_accuracy_audit.pytold three baseline reviews in a row not to look here: it claimed GitGalaxy read the count "from the at-rule prelude tokens" and concluded "This is not a GitGalaxy defect". No such prelude mechanism exists, and the gap was not confined to the informational column — the gatedargs_exact_matchread 19/25 and those 6 were the misses. Rewritten with the real mechanism.cssalso joinsARGS_GRANULARITYas"none"("no parameter-list concept exists for this language", beside dockerfile/yaml/jcl) —docs/language_status/css.mdhad asserted "CSS has no parameter-list construct, so there is no args panel" long before the rule agreed.Verification
rule_probe.py args --compareover both corpora: css is the only language that moves, on both.tree_sitter_accuracy_audit.py --lang css:args_exact_match19 → 25, zero remaining mismatches, every other metric unchanged. Baseline regenerated (a one-line diff;corpus_pathunchanged).rosetta_audit.py: 46 languages, 0 regressions against the companion corpus PR.tri_comparison_chart.py --all --ci: 3 languages, all OK.audit_check.py: ruff/mypy/dead-key/ast-accuracy all clear.Bless scope — including the one leaf that needed explaining
Leaf keys:
Function Parameters(13),Testing Exposure(7),Structural Magnitude(5),5. Function Analysis(5),Directory Group Magnitude(3),total_mass(3),verification(2),impact(1). Languages: css 25, html 2, php 1.<style>blocks reached by the polyglot lens —functions.php:3937contains exactly 4 css value-function calls, matching its 256 → 252 delta exactly.Testing Exposureis a risk leaf, andargsfeeds norisk_*formula — so this one got checked rather than waved through._calc_verificationis impact-weighted (it sumsfunc.get("impact")per function), and per-functionimpactcarriesarg_multiplier = sqrt(args_count + 1). Dropping the phantom parameters correctly shrinks those functions' impact. The mapping is exactly 1:1: the only files whoseTesting Exposuremoved arepreflight.css,editor_main.cssand the three*.module.css— precisely the files carrying phantom arities, and no others. No other risk exposure type moved anywhere in the corpus.Cross-repo
Companion corpus PR: squid-protocol/keyword-rosetta#108 (
rebless/gitgalaxy-2893-css-args). This PR merges first; the corpus PR then re-blesses against engine main, per the no-pins flow. Itsverify.ymlis expected red until then.rosetta-auditon this PR will flag css as moved — that is intended and is what therosetta:rebless-owedlabel is for.Closes #2893
🤖 Generated with Claude Code