Skip to content

fix(standards): css args is a stated absence -- CSS declares no callable (#2893) - #2894

Merged
squid-protocol merged 1 commit into
mainfrom
fix/2893-css-args-absence
Sep 8, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/2893-css-args-absence

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

What this does

Makes css args a stated absence (None). CSS declares no callable, so it declares no parameter surface; every parenthesis in a stylesheet is a call into a builtin.

args has a stated contract — "the parameters a callable declares" (#2773) — and css was the one language knowingly violating it. docs/args_rule_contract.md said 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's 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 instead of being compared against it. Same answer solidity's io: None records (io_rule_contract.md C3).

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):

head hits share is it coupling?
var( 2521 65.4% yes — safety already counts 512 of them (the guarded var(x, fallback) read)
rgba( rgb( oklch( color-mix( 931 24.2% no — a colour written longhand
calc( 321 8.3% partly — 226 already contained a var()
url( 77 2.0% io owns it since #2752
clamp( min( 5 0.1% safety owns clamp()

On those same files: api counts 3597 --custom-property: declarations — the definitions of the very tokens var() reads, a larger surface than the reads — plus safety 515, io 14, reflection_metaprogramming 24, import 9. 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_metrics searched the whole block body and took the first match. Six at-rules carried 13 phantom parameters borrowed from their own bodies:

gutenberg_css_modules/button.module.css::layer     real=0 got=1
gutenberg_css_modules/card.module.css::layer       real=0 got=1
gutenberg_css_modules/tabs.module.css::layer       real=0 got=1
tailwindcss_atrules/preflight.css::supports        real=0 got=3   <- line 291
threejs_app_ui/editor_main.css::media              real=0 got=3   <- line 660
threejs_app_ui/editor_main.css::media              real=0 got=4   <- line 720

preflight.css:291's @supports prelude contains no parenthesised call at all; the arity 3 came from a color-mix(in oklab, currentcolor 50%, transparent) three lines inside the block. args_exact_match goes 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" (the globals contract'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.py claims .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/.less files 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.py told 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 gated args_exact_match read 19/25 and those 6 were the misses. Rewritten with the real mechanism.

css also joins ARGS_GRANULARITY as "none" ("no parameter-list concept exists for this language", beside dockerfile/yaml/jcl) — docs/language_status/css.md had asserted "CSS has no parameter-list construct, so there is no args panel" long before the rule agreed.

Verification

  • rule_probe.py args --compare over both corpora: css is the only language that moves, on both.
  • tree_sitter_accuracy_audit.py --lang css: args_exact_match 19 → 25, zero remaining mismatches, every other metric unchanged. Baseline regenerated (a one-line diff; corpus_path unchanged).
  • 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.
  • Golden masters re-blessed. 53 differences on each (14 topological, 39 substantive), nothing newly parsed or excluded.

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.

  • html/php are embedded <style> blocks reached by the polyglot lens — functions.php:3937 contains exactly 4 css value-function calls, matching its 256 → 252 delta exactly.
  • Testing Exposure is a risk leaf, and args feeds no risk_* formula — so this one got checked rather than waved through. _calc_verification is impact-weighted (it sums func.get("impact") per function), and per-function impact carries arg_multiplier = sqrt(args_count + 1). Dropping the phantom parameters correctly shrinks those functions' impact. The mapping is exactly 1:1: the only files whose Testing Exposure moved are preflight.css, editor_main.css and 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. Its verify.yml is expected red until then.

rosetta-audit on this PR will flag css as moved — that is intended and is what the rosetta:rebless-owed label is for.

Closes #2893

🤖 Generated with Claude Code

…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]>
@squid-protocol squid-protocol added metrics Heuristics, risk exposures, and topological math updates core-engine Modifications to the central physics and parsing engine rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 3b58de7 into main Sep 8, 2026
69 of 71 checks passed
@squid-protocol
squid-protocol deleted the fix/2893-css-args-absence branch September 8, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-engine Modifications to the central physics and parsing engine data-quality metrics Heuristics, risk exposures, and topological math updates rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

args contract: css is a stated absence, not an approximate fallback (count contract corollary 3)

1 participant