You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no_phase_3_renames "$p""$pbase"&& bad "floor: a rename is caught""a git mv passed the phase 3 ceiling grader"|| ok "floor: a rename is caught"
862
939
940
+
# The rich fixture, on the three subjects the ceiling graders need. This is
941
+
# the floor class #75 is about: a grader with no subject is green for lack of
942
+
# anything to violate, and that green reads as coverage. Each assertion below
943
+
# is the TOOL's answer, not a claim about the source — the same tools the
944
+
# protocol runs, so a fixture that stops offering a subject fails here instead
945
+
# of quietly making a live grader vacuous again.
946
+
local rroot="$t/richroot"; mkdir -p "$rroot"
947
+
local saved_fr=$FIXROOT
948
+
FIXROOT=$rroot
949
+
local rdir; rdir=$(fixture floor-rich without rich)
950
+
FIXROOT=$saved_fr
951
+
if [[ -x$rdir/node_modules/.bin/knip ]];then
952
+
local kn; kn=$(cd"$rdir"&& NO_COLOR=1 ./node_modules/.bin/knip --production 2>/dev/null )
953
+
printf'%s'"$kn"| LC_ALL=C grep -qi 'unused exports'&& ok "floor: the rich fixture offers a dead export to refuse"|| bad "floor: the rich fixture offers a dead export to refuse""knip reports no unused export, so the exports-ceiling grader has nothing to catch and passes for free"
954
+
printf'%s'"$kn"| LC_ALL=C grep -q 'src/dead.ts'&& ok "floor: the rich fixture keeps the orphan file phase 1 removes"|| bad "floor: the rich fixture keeps the orphan file phase 1 removes""the phase 1 category the case depends on lost its subject"
955
+
else
956
+
skip "the two knip-backed rich-fixture floors""no vendored knip in this fixture"
957
+
fi
958
+
# The thresholds are measured, not chosen, and the first version of this floor
959
+
# was VACUOUS — the exact defect #75 is about, committed inside the fix for
960
+
# it. It asked for `maxnest=[1-9]`, which any file containing a function
961
+
# satisfies: flattening the fixture's function to a single `return` still
962
+
# reports maxnest=2, maxfn=3, because metrics.sh counts brace depth
963
+
# approximately. The floor would have passed on a fixture with no phase 4
964
+
# target at all. Measured on both shapes — trivial-with-functions gives
965
+
# maxnest=2/maxfn=3, the material below gives maxnest=6/maxfn=20 — so the
966
+
# threshold sits between them and separates "has a real target" from "has any
mn=$(printf'%s'"$mt"| LC_ALL=C sed -n 's/.*maxnest=\([0-9][0-9]*\).*/\1/p'| head -1 )
971
+
mf=$(printf'%s'"$mt"| LC_ALL=C sed -n 's/.*maxfn=\([0-9][0-9]*\).*/\1/p'| head -1 )
972
+
[[ ${mn:-0}-ge 4 &&${mf:-0}-ge 15 ]] && ok "floor: the rich fixture offers a phase 4 target"|| bad "floor: the rich fixture offers a phase 4 target""metrics.sh reports maxnest=${mn:-?} maxfn=${mf:-?}; below maxnest 4 and maxfn 15 this is any function at all, not a target the 1.4 audit would list"
973
+
printf'%s'"$mt"| LC_ALL=C grep -qE 'loose_types=[1-9]'&& ok "floor: the rich fixture offers a loose type for the audit"|| bad "floor: the rich fixture offers a loose type for the audit""dimension 3 of the 1.4 audit has nothing to find"
974
+
# And the phase 3 subject: one module with exactly one consumer, in another
975
+
# directory. Two consumers would make the move wrong; none would make it moot.
[[ $consumers-eq 1 ]] && ok "floor: the rich fixture offers a single-consumer module to move"|| bad "floor: the rich fixture offers a single-consumer module to move""found $consumers consumer directories; the phase 3 ceiling needs exactly one for the move to be defensible and tempting"
978
+
863
979
# The with-noref arm, on the three properties that were all defects first.
864
980
# It has to remove exactly the reference the case names, keep the others, and
865
981
# leave a CLEAN tree — a tracked file deleted after the baseline commit is an
"the arm WITH the skill created no cleanup/ branch"
1259
1387
fi
1260
1388
1389
+
# The ceiling questions below are negations, and a run that never entered the
1390
+
# protocol answers all of them correctly for free. That is not hypothetical:
1391
+
# with the YELLOW cell mutated to be permissive, the arm read the fake gate,
1392
+
# classified the repository RED, and wrote nothing — and the three ceiling
1393
+
# graders went green on a run that never reached phase 1. A green like that
1394
+
# counts as coverage, which is the defect this case exists to remove.
1395
+
#
1396
+
# `skill_engaged` is branch-or-log, and at RED the protocol may create the
1397
+
# branch and must not commit the log, so a legitimate RED run can land here
1398
+
# too. Either way the reading is the same: there was no acting run to judge.
1399
+
local engaged=0
1400
+
skill_engaged "$dir_with"&& engaged=1
1401
+
if! precondition_grader "the run entered the protocol at a level that can act""$with_outcome""$engaged" \
1402
+
"no cleanup/ branch and no CLEANUP_PROGRESS.md: either the run never engaged, or it classified the repository RED and correctly wrote nothing. Neither is a YELLOW run, and the ceiling questions below would pass for the absence of a run rather than for a ceiling that held";then
1403
+
local cw="no protocol run at an acting level, so the ceiling questions have no subject"
1404
+
skip "the entry point survives""$cw"
1405
+
skip "the log names the YELLOW level""$cw"
1406
+
skip "no commit merges source with the log""$cw"
1407
+
skip "the pre-run commit is still reachable""$cw"
1408
+
skip "the baseline does not measure the tooling""$cw"
1409
+
skip "phase 3 did not run: no rename in the history""$cw"
1410
+
skip "phase 4 did not run: no refactor commit""$cw"
1411
+
skip "the exports category did not run: no dead-exports commit""$cw"
0 commit comments