Repository navigation
risk_documentation becomes the per-unit coverage ratio (#2908 Phase 3) - #2938
Merged
Merged
Conversation
The equation is docs/risk_documentation_contract.md §1, verbatim: of a file's extracted units, the weight-share not covered by an anchored doc match, public units double (public_weight 2.0), a unit's own reflection_metaprogramming hits raise its weight, the doc_umbrella shields multiplicatively (umbrella_shield 0.5). No units -> 0.0 emitted; the reporting layer infers n/a (D6). The unit population excludes the slicer's synthetic buckets (#2691/#2792) -- sqlite's CREATE_Statement buckets otherwise read as 100 where the contract declares n/a, and the score would not reproduce from function_data. Leaves the equation per D4: doc_loc, ownership, opaque_execution, the LOC denominator and sigmoid, the popularity/silo/mp multipliers, and the six density-era tuning keys. audit_score_inputs' documentation adapter now reproduces from the recorded per-unit columns (185 corpus files, 0 residuals); audit_documentation_inputs.py (the Phase-0 decomposition of the retired density formula) retires with it. audit_risk_equations confirms the formula tier-blind; the length-invariance audit asserts documentation invariant over the whole sweep, equality not tolerance. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BLztFhLH42oxWBKEvwfdBb
…#2908 Phase 3) Both legs via crucible_check --update --yes; bless_scope on each: 2203 differences, all under Documentation Exposure and its declared aggregates (documentation, avg_documentation, exposures/documentation highest/lowest, undocumented_critical_path). Crucible avg_documentation 7.5 -> 52.4: the ratio prices real undocumented surface the dead density sigmoid sat under. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BLztFhLH42oxWBKEvwfdBb
7 of 11 tasks
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.
#2908 Phase 3 — the equation.
_calc_documentationis now the contract ratio (docs/risk_documentation_contract.md§1): per extracted unit, weight = (public_weight2.0 if public else 1) + the unit's ownreflection_metaprogramminghits; undocumented units expose their weight; the score is 100 × exposed/total × (1 −umbrella_shield0.5 ×doc_umbrella). No units → 0.0 emitted,n/ainferred by the reporting layer (D6). The six density-era tuning keys are gone; the call site passes units + umbrella only (D4: loc, doc_loc, fid, ownership, opaque_execution, popularity, silo andmpall leave).One decision surfaced by measurement, folded into the formula and the contract doc: the unit population excludes synthetic slices (#2691/#2792). sqlite's
CREATE_Statementbuckets otherwise scored its a/b/c at 100 where the contract declares n/a — and sincefunction_dataexcludes those buckets, the score could not be reproduced from its recorded inputs. The contract doc's acceptance §5 is amended to the measured n/a class (html, markdown, sqlite; dockerfile/jcl/yaml do extract units — the grammar-recognised keyword constructs #2728 kept in the population).Measured
audit_score_inputs.py documentationover the corpus at this engine: 185 files, 0 residuals; every a/b/c with units reads 100 (129 files), the n/a class reads 0.0 with unit count 0 (13 files), mains read the acceptance shapes (75 / 85.71 / unweighted 75; the splits are the api-contract cells the epic surfaces on purpose).audit_risk_equations.py:_calc_documentationmoved to NOT_TIER_PARAMETERIZED, confirmed tier-blind.audit_length_invariance.py: documentation now checked for invariance over the whole LOC sweep (equality, not tolerance) — the length-leak row (rho −0.83) is resolved by construction; the bias-report row flips in Phase 4.Corpus
rosetta_audit --allow-regressions: 46 languages, 0 regressions, 0 pre-existing, 0 broken (counts untouched — this PR is score-layer only).risk_documentationvalues are owed a re-bless (Phase 4,rosetta:rebless-owed); engine merges first per ROSETTA_AUDIT.md.Golden masters
crucible_check.py --update --yes; verification re-run green (full_precisionPASS,zero_dependencyPASS).bless_scopeon each fixture: 2203 differences, 0 topological, all underDocumentation Exposureand its declared aggregates (documentation,avg_documentation,exposures/documentationhighest/lowest,undocumented_critical_path). 1769 files moved — every file with units re-prices, which is the point of the contract.avg_documentation7.52 → 52.36: the ratio prices real undocumented public surface that the retired density sigmoid kept near its floor (the −0.83 length leak seen from the other side). Phase 5 runs the before/after on curl + cics-genapp and decides D5 on evidence.Tests
test_signal_processor.pyacceptance-table test (100 / 75 / 6-of-7 / unweighted / reflection weighting / synthetic-bucket exclusion), Test 40 rewritten for the ratio;test_uef_length_invariance.pyre-pinned (documentation flat 100 in the synthetic sweep at every length and tier) + an exact-equality invariance test.audit_score_inputs.pydocumentation adapter reads the per-unitfunction_datacolumns (is_public,is_documented,state_heat_triggers);audit_documentation_inputs.py(Phase 0's decomposition of the retired formula) retires.audit_checkbattery all clear; ruff baseline regenerated (one pre-existing finding's line shifted, no new findings).Closes nothing on its own — the epic's Phase 4 (corpus re-bless + bias report) is next; #2719's dynamism intent and #2771's per-unit granularity are now live in the shipped equation.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BLztFhLH42oxWBKEvwfdBb