Repository navigation
Description
Summary
args is a stated contract — "The parameters a callable declares" (signal_contracts.py, #2773, docs/args_rule_contract.md). Every language now satisfies it except css, whose rule matches value-function calls:
"args": re.compile(
r"\b(?:calc|clamp|min|max|var|env|url|rgba?|hsla?|lch|oklch|color-mix|light-dark)"
r"\s*\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\)",
re.I,
),docs/args_rule_contract.md:194-200 names this as the exception in as many words — "It is the one place in this document where the contract is deliberately not met" — and keeps it because "CSS has no callable of any kind, so 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 justification are now false. This issue proposes css args become a stated absence (None), the answer the count contract already mandates.
1. The sheet already decided this
signal_contracts.py, COUNT_CONTRACT corollary 3:
Where the language makes the property the default, say which side counts. Either the declaration itself is the marker (api corollary 3: public-by-default languages count
def), or the language records a contract-level absence (Nonerule + a ledgeredintended-morphologyentry) rather than a manufactured construct. The two answers cannot coexist inside one signal.
docs/io_rule_contract.md C3 applies it, and names css in the same breath:
solidity is the stated absence: the EVM cannot reach outside itself,
io: Nonewith manifest 0 … the absence answer and the rule answer cannot coexist in one language (count contract corollary 3).
css args is a manufactured construct living inside a stated contract. The third alternative is None, not 0 — and None is not scored at all.
2. The counter-argument has expired — measured, not asserted
Composition of all 3,857 css args hits over the 38 crucible css files (live compiled rule, finditer):
| head | hits | share | is it coupling? |
|---|---|---|---|
var( |
2,522 | 65.4% | yes — the real residual |
rgba( rgb( oklch( color-mix( |
932 | 24.2% | no — a colour written longhand |
calc( |
321 | 8.3% | partly — 226 of them already contain a var(), i.e. double-counted |
url( |
77 | 2.0% | io owns it since #2752 |
clamp( min( |
5 | 0.1% | safety owns clamp() |
Nearly a quarter of the signal was never coupling. Meanwhile, on those same 38 files, css coupling is measured — by the rules that own it:
| signal | hits | what it is |
|---|---|---|
api |
3,618 | 3,597 are --custom-property: declarations (+21 :root) — the definitions of the very tokens var() reads. Larger than the read side. |
safety |
516 | 513 are var(x, fallback) (+2 clamp, +1 @supports) — the guarded read, already counted |
io |
14 | the real external fetches (#2752) |
reflection_metaprogramming |
24 | nested calc( — computation depth |
import |
9 | the @import DAG |
So "0 says a stylesheet has no coupling at all" was true when written, and is not true now: three of those five rules postdate it.
The named residual, stated plainly: the unguarded var(--x) read — 2,522 − 513 = 2,009 occurrences — becomes unmeasured. Nothing else counts it and nothing should be stretched to: the globals contract's C2 explicitly excludes an ordinary read of a binding by name. If it ever earns measurement it earns its own signal; smuggling it into a signal that means something else is the failure mode this change exists to end.
3. It is a live measurement defect, not only a mislabel
css does not receive args_search_text (only objective-c, c, cpp, dart do), so _calculate_block_metrics searches the whole block body and takes the first match. Six css at-rule blocks therefore carry a parameter count borrowed from their own body — the exact failure args_rule_contract.md:38-53 describes:
tailwind/preflight.css:291— an@supportswhose prelude is(not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px)reads arity 3, off acolor-mix(in oklab, currentcolor 50%, transparent)three lines inside the block.threejs/editor_main.css:720@media→ arity 4; a second@media→ 3; threegutenberg/*.module.css@layer→ 1 each.
tree-sitter reads 0 for every one. args_exact_match for css is 19 of 25; a stated absence takes it to 25 of 25 — higher_is_better, so this is an accuracy improvement.
Separately: tests/tools/tree_sitter_accuracy_audit.py (~L299-312) documents this defect as a non-defect. It tells the next reviewer the gap is fine because "GitGalaxy assigns them a param count read from the at-rule prelude tokens". That mechanism does not exist — the count comes from the block body. That docstring is wrong on main today regardless of what is decided here.
4. Scope caveat — the doc must not repeat "CSS has no callable of any kind"
css.py:24 claims [".css", ".scss", ".sass", ".less", ".styl", ".pcss"], and Sass genuinely declares parameters: @mixin button($size, $color), @function foo($a, $b); Less has .mixin(@a; @b). So the sweeping sentence in the contract doc is wrong at the scope this definition claims.
The route of narrowing the rule to those declaration forms — which would satisfy the contract rather than except it — was considered and rejected on measurability: there are 0 .scss/.sass/.less files in the language-crucible, 0 in keyword-rosetta, and 0 anywhere on the build box. A rule that cannot be measured on either corpus is not one this project ships.
So: None today, with an explicit reopen condition recorded in both the rule comment and the contract doc — if .scss/.less enters the crucible, @function/@mixin/.mixin(@a; @b) is a real declared parameter surface and this absence must be revisited.
5. Corpus consequence (keyword-rosetta)
args/css reads 6 vs median 13 (−54%) and avg_func_args/css 0.05 vs 1. No plant targets either — all 6 hits are byproducts of other plants (3 @import url() + 3 @keyframes probe-io url() steps). It is the only open-defect cell left in the whole args family ("args — 1 of 45").
Two ledger edits are owed, and one of them is a trap:
args-no-parameter-surface-morphology— css STAYS inlanguages_seenfor BOTH tokens, verdict rewritten from "reads low by morphology" to "records a stated absence". Removing it does not leave the cells clean:unmeasurable_risk_cells()coversrisk_*columns only;explain_out_of_band()'sPER_FUNCTION_METRICSpath fires only whenfunctions_foundis 0 (css reads 14); and thederivedfallback readsargsfromoob, which an n/a cell has left.avg_func_args/csswould landunexplained— the one verdict--gatefails on — andargs/csswould become an unreviewed absence failingna_check --ci. This is the arrangement yaml already has inside that same entry, reached from the opposite direction.batch5-tier2-morphology-shapes— drop theargstoken. Its only itemised css args shape is "args tracks @import url", the identical claim the morphology entry makes in far more detail; the cross-product is what marks the cellkeyword-overlap/extraction instead ofintended-morphology/inherency. This edit is forced, not optional: once the cell is n/a,ledger_orphan_checkskips it and jcl 13 / yaml 13 are both in band, so the token becomes a new orphan failing--ci. Third token retired from that entry afterfunc_start(func_start & class_start have no stated contract: 5 open cells are all collective-entry cross-product mis-marks, not rule defects #2856) andownership(ownership has no stated contract: solidity counts the SPDX license line on every file, five languages count copyright notices and license prose, three count the phrase 'created by' in sentences, and five doc rules still double-count the author tag #2882), same cross-product reason each time.
6. Expected movement
| before | after | |
|---|---|---|
struct_args css (crucible) |
3,857 | 0 |
args/css (rosetta) |
6, red (extraction) | n/a |
avg_func_args/css |
0.05 | 0.0, ledgered (inherency) |
args_exact_match css |
19 / 25 | 25 / 25 |
| open-defect share | 13 of ~2636 | 12 of ~2635 |
| "metrics carrying the most open defect" | args — 1 of 45 |
args row gone |
No risk_* formula consumes args, so no risk leaf may move — that is the go/no-go on the golden-master bless. Expected leaves: Function Parameters (6), Structural Magnitude (~5), Directory Group Magnitude (4), composition.css.impact, and the corpus-wide X/Y/Z topological ripple.
Out of scope
class_start/css— Extend #1264's per-language class_start named-entity extraction to the remaining 13 languages #1295 ruled named extraction out of scope and classes_found[css] red on a 0 median: a CSS class is a selector, and #1295 already ruled it out of scope on the other two charts #2798 enforced it, but deliberately kept the numeric signal; classes_found: five red cells on a 0 median are language morphology, not extraction — the row needs a declaration-requirement stratum #2796 is open on exactly those cells.func_start/css— in band (14 vs 13), tree-sitter agrees since raw_state_unreferenced: the undefined family — six markup/config languages record 0 on a census with no population to count #2866, anddetector.py:926-943measured and rejected the alternative (found_functions25 → 0).
Roadmap: #2812 Phase 3, corollary follow-up on an already-stated contract (beside #2824, #2817, #2832, #2827).
Activity
squid-protocol commentedon Sep 8, 2026
Correction to the composition table above: measure the code stream, not the raw file.
The tables in the issue body were measured over raw file text and read 3857 total. The engine hands rules the Prism code stream (comments blanked), and
rule_probe.pyconfirms cssargsat 3855 — the figuredocs/args_rule_contract.mdalready carried. Two hits sat inside comments.Re-measured on the code stream, which is what the PR and the rule comment use:
var(rgba(rgb(oklch(color-mix(calc(var())url(clamp(min(And the owners:
api3618 (3597--custom-property:declarations),safety515 (of which 512 are the guardedvar(x, fallback)read),io14,reflection_metaprogramming24,import9.The named residual is unchanged either way: 2521 − 512 = 2009 unguarded
var()reads. No part of the argument moves; recording it so the numbers in the issue, the rule comment and the contract doc all agree.fix(standards): css args is a stated absence -- CSS declares no calla…