feat(core-engine): per-file dynamism replaces the flat language irc in four risk equations (#2719) - #2723
Merged
Merged
Conversation
…he language irc (#2719) Undocumented runtime-decided behaviour -- eval/exec and reflection, counted in THIS file -- is what the flat per-language irc stood in for in _calc_documentation. One definition, SignalProcessor._dynamism(), read where the term used to be, at tuning key documentation.dynamism_weight (1.0; the dead irc_mult key is removed). The #2655 zero-evidence guard is unchanged: no public surface -> 0 in every language. Pins at 51 LOC re-pinned for documentation and for the tier-2/3 safety values #2718 had exempted (its exemption block is gone). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…; language irc term removed (#2719) Reflection and eval are the same opacity to a reader -- you cannot follow what runs -- so heat_density now reads _dynamism() (reflection + high_risk_execution) at its existing 5x weight, and the flat per-language `irc / mass_loc` pseudo-hit is gone. Counting eval here AND in safety is not double counting: two risk dimensions. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`density += irc * 0.1` corresponded to nothing: no strictness column is about concurrency and dynamism is not concurrency. The inputs are the file's own spawns and locks. Tuning key concurrency.irc_mult removed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`density += irc * 0.15` was documented as "implicit mutability defaults", which no strictness column measures and dynamism does not describe. The inputs are the file's own writes and immutability locks. Tuning key state_flux.irc_mult removed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… after #2719 08-05 and 08-09 read per-file dynamism (reflection + high_risk_execution); 08-15 and 08-16 no longer carry a language term; 08-03's third input row is marked done and names which equations still read the strictness Irc (safety, tech debt) and why. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5,269 substantive diffs, 0 topological, confined to the four changed columns and their aggregates: Cognitive Load (dynamism in heat_density, language irc gone), Documentation (per-file dynamism replaces irc), Concurrency and State Flux (language term removed -- every cell moves down). Safety, Tech Debt and Testing are untouched, as intended. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…count alone (#2719) Attribution of the first cut showed high_risk_execution is the safety ATTACK vocabulary across the registry -- panic!/todo!, os.Exit/log.Fatal, System.exit, STOP RUN, rm -rf/sudo -- carrying eval/exec only in the dynamic languages. Summing it into dynamism imported aborts and destructive commands into cognitive load and documentation (three STOP RUNs in a 31-line COBOL file: +33 cognitive load). It is already read at 4x by _calc_safety, where it belongs. reflection_metaprogramming is consistent across all 46 languages: getattr, Reflect/Proxy, method_missing, AUTOLOAD, Class.forName, transmute, macro_rules!. Shell's reflection rule over-matches plain ${var} and every $(...): #2722. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5,231 substantive diffs, 0 topological, confined to the four changed columns and their aggregates. Cognitive Load, Concurrency and State Flux move only DOWN (a language term was removed; dynamism replaces reflection in the heat term at the same weight). Documentation moves both ways: down where the language irc exceeded the file's reflection count, up where the file is reflection-heavy -- the large shell moves are the rule over-match filed as #2722, not the formula. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
6 tasks
Contributor
27 tasks
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.
Child of #2716; stacked on #2721 (PR 1). After PR 1 the per-language
ircwas still a flat integer summed into six formulas in six different units. This PR gives each of those formulas the term it can justify, one commit per formula.Per formula
46890c5dirc→ per-file dynamism (reflection_metaprogramming, tuningdocumentation.dynamism_weight1.0)3263483dheat_densityreads dynamism at its existing 5× weight; theirc / mass_locpseudo-hit is removedevalare the same opacity to a reader; one definition. Counting eval here and in safety is two risk dimensions, not a double count266dff79irc × 0.1, tuning key deleted)d4d17b07irc × 0.15, tuning key deleted)irchigh_risk_executionis already the ×4 attack termirc × 0.5SignalProcessor._dynamism()is the single definition: the file'sreflection_metaprogrammingcount. The first cut also summedhigh_risk_execution; attribution showed that signal is the safety attack vocabulary across the registry —panic!/todo!,os.Exit/log.Fatal,System.exit,STOP RUN,rm -rf/sudo— carryingeval/execonly in the dynamic languages, and it was importing aborts and destructive commands into cognitive load (threeSTOP RUNs in a 31-line COBOL file: +33). It is read at ×4 by safety, where it belongs; python'seval/exectherefore do not count as dynamism until a dedicated signal exists. Pointer arithmetic, macros and type bypasses stay in their own equations too.Net: the language-level
ircis read by exactly two formulas, each with a written reason a reviewer can disagree with; four formulas lost a constant that corresponded to nothing measurable. keyword-rosetta'stier_sensitiveset shrinks to those two rows on its own (it AST-reads which formulas takeirc).Tests and tools
test_uef_length_invariance.py: the 51-LOC pins are re-pinned per commit for exactly the equation that commit changed (the re-pin script refuses to run if any other equation moved); the engine PR 1: language-strictness table + measured fidelity coefficient replace _get_tier (child of #2716) #2718 exemption block is gone. The strictness-direction test still passes — equations that no longer readircare equal across profiles.audit_risk_equations.py:_calc_concurrencyand_calc_state_fluxmove toNOT_TIER_PARAMETERIZED(the tool asserts on this).audit_length_invariance.pyupdated. Both run clean.documentation.irc_mult(never read) replaced bydynamism_weight;concurrency.irc_multandstate_flux.irc_multremoved.What moved
Golden master regenerated in both venvs and attributed with
golden_diff.deep_compareagainst PR 1's fixture: 5,231 substantive diffs, 0 topological, confined to the four changed columns and their aggregates — Safety, Tech Debt, Testing and everything structural are untouched, as intended.irc / mass_locpseudo-hit is gone and reflection was already in the heat termircexceeded the file's reflection count (jcl −4.7, livecode −4.3, assembly −2.9 means); up where the file is reflection-heavyThe upward Documentation tail is shell: 15 of the crucible's 46 shell files jump ≥ 25 points because the shell
reflection_metaprogrammingrule counts every$(...), backtick and plain${var}(configure-helper.sh: 1,019 hits in 2,823 lines) — filed as #2722. That is the per-file term doing its job: it made a vocabulary over-match visible that the flat language constant had hidden. The fix belongs to the rule, not the formula.The first cut of this PR summed
high_risk_executioninto dynamism; its attribution showed Cognitive Load moving up by +33 on a 31-line COBOL file with threeSTOP RUNs. That is what led to narrowing the definition (bec8522b).Gauntlet
audit_check.py: all clear at every commit (ruff baseline regenerated for line-shifts; mypy 2-error baseline; dead-key; ast-accuracy).tree_sitter_accuracy_audit.py --ci --all: 30/30.tri_comparison_chart.py --all --ci: 3/3.rosetta_audit.py: 46/46, 0 regressions — §2 signals untouched, so no corpus re-bless owed; therisk_*rows move on the nextbias-historyregen andtier_sensitiveshrinks to safety + tech debt on its own.audit_risk_equations.pyandaudit_length_invariance.py: no direction or invariance flags.crucible_check.py --update --yes), scoped diff above.Closes #2719
🤖 Generated with Claude Code