@chrono-meta/fh-gate 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/README.ja.md +58 -28
- package/README.ko.md +201 -184
- package/README.md +59 -43
- package/README.zh.md +74 -47
- package/docs/USER_GUIDE.md +6 -6
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +98 -0
- package/package.json +2 -1
- package/plugins/fh-commons/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-meta/CHANGELOG.md +32 -0
- package/plugins/fh-meta/skills/salience-splitter/SKILL.md +26 -0
- package/scripts/degrade_direction_scan.sh +118 -0
- package/scripts/fh-goal.sh +22 -2
- package/scripts/fh_session_load.sh +14 -1
- package/scripts/package_coverage_check.sh +7 -4
- package/scripts/selfcheck.sh +3 -1
- package/scripts/session_close_check.sh +36 -3
- package/scripts/test_card_drift_probe.sh +27 -0
- package/scripts/test_degrade_scan_shell_probes.sh +130 -1
- package/scripts/test_dispatch_log_lanes.sh +54 -2
- package/scripts/test_fh_goal_change_detection_lanes.sh +89 -0
- package/scripts/test_session_close_chain_lanes.sh +27 -0
- package/scripts/test_session_close_lanes.sh +35 -1
- package/templates/degrade_direction_scan.sh +118 -0
|
@@ -57,6 +57,32 @@ measurement); they differ in cost because the surfaces differ:
|
|
|
57
57
|
| **Resident layer** — CLAUDE.md, a memory index (loaded every session, for every task) | **Ablation harness**: pre-registered question set · **isolated arm B** · `reps>=3` · runner precondition `bash scripts/ablation_calibrate.sh` exits 0 (canon = `scripts/probe_scope_check.sh` header) · verdict line → `.claude/regression/ablation_verdicts.md` | A wrong cut here degrades *every* session silently, and the cost is unattributable after the fact |
|
|
58
58
|
| **SKILL.md → SKILL_detail.md** (loaded only when the skill is invoked) | **Cold-start sim**: `sim-conductor` Area D-skill on SKILL.md alone must reach grade F (see Done When) | The failure is scoped to one skill's invocation and the sim reproduces exactly that condition |
|
|
59
59
|
|
|
60
|
+
🟥 **ON A CONSUMER INSTALL THE RESIDENT ROW CANNOT BE RUN — say so rather than let a reader
|
|
61
|
+
discover it.** `ablation_calibrate.sh` and `probe_scope_check.sh` are **deliberately not shipped**
|
|
62
|
+
(`package_coverage_check.sh` ACCEPTED_ABSENT): the procedure ablates *this hub's* resident
|
|
63
|
+
`CLAUDE.md`, so an installer has nothing to point it at, and every run spends `claude` CLI calls on
|
|
64
|
+
their account. So on an install:
|
|
65
|
+
|
|
66
|
+
| | |
|
|
67
|
+
|---|---|
|
|
68
|
+
| **Hub (this repo)** | Run the ablation. Verdict → `.claude/regression/ablation_verdicts.md`. |
|
|
69
|
+
| **Consumer install** | The harness is absent, so the measurement is **unavailable — not waived**. The floor holds in its degraded form: **KEEP is the default and a CUT is not available.** Record `UNMEASURED — no ablation runner on this install`; do not record a PASS. |
|
|
70
|
+
|
|
71
|
+
**The degrade direction is the whole point**: an unavailable measurement makes cutting *harder*,
|
|
72
|
+
never easier. A consumer who wants the resident row runs it against their own resident asset by
|
|
73
|
+
copying the two scripts out of the hub — that is a deliberate act, not a default. Concretely, that
|
|
74
|
+
means taking `scripts/ablation_calibrate.sh` and `scripts/probe_scope_check.sh` from the hub repo,
|
|
75
|
+
running the calibrator until it exits 0 **on your machine** (it is a known-pair, not a formality —
|
|
76
|
+
it is what proves the runner discriminates at all), and pointing the arms at YOUR resident file
|
|
77
|
+
rather than the hub's. The verdict lands in your own `.claude/regression/ablation_verdicts.md`.
|
|
78
|
+
🟡 **Named gap, surfaced by a blind floor-tier read of this very section (2026-08-27)**: two
|
|
79
|
+
questions this skill does not answer, and pretending otherwise would be worse than saying so —
|
|
80
|
+
(i) whether a section may ever be deleted OUTRIGHT rather than trimmed-with-a-pointer (every path
|
|
81
|
+
here assumes the pointer), and (ii) whether *verified* duplication — two files grep-confirmed to
|
|
82
|
+
carry the same text — is still subject to the full ablation, or whether that is the one case where
|
|
83
|
+
"redundant" is a measurement rather than an impression. Both are open; treat them as KEEP until
|
|
84
|
+
decided.
|
|
85
|
+
|
|
60
86
|
**Arm B answering confidently wrong is a KEEP, not a pass** — fluency is not recall, and that is the
|
|
61
87
|
whole reason the arm is isolated. The same reading applies to the sim: a consumer that improvises
|
|
62
88
|
plausibly without the moved rule is grade P, not F.
|
|
@@ -83,6 +83,13 @@ if ! command -v find >/dev/null 2>&1; then
|
|
|
83
83
|
echo "This is not 'clean' and not 'no targets'; nothing was measured. Fix PATH and re-run."
|
|
84
84
|
exit 2
|
|
85
85
|
fi
|
|
86
|
+
# `awk` is the S1b probe's only engine (line-continuation joining + bounded lookahead are not
|
|
87
|
+
# expressible in a line-oriented grep). Its absence must not render as clean — the same rule the
|
|
88
|
+
# `find` gate above states. Guarded rather than hard-exit: unlike `find`, a missing awk blinds ONE
|
|
89
|
+
# probe, not the whole discovery pass, so the honest degrade is "S1b NOT MEASURED" + non-clean rc.
|
|
90
|
+
_S1B_OK=1
|
|
91
|
+
command -v awk >/dev/null 2>&1 || { _S1B_OK=0; _FORCE_NONCLEAN=2; }
|
|
92
|
+
|
|
86
93
|
# cksum 도 미선언 의존성이다 — 첫 수리는 python3 만 가드하고 cksum 은 rc 미검사로 도입했다.
|
|
87
94
|
# 부재 시 유일성 토큰이 **빈 문자열**이 돼 shadow 이름 충돌(A-1)이 그대로 부활한다(실증).
|
|
88
95
|
# mktemp 실패 시 예측 가능한 경로(/tmp/degradescan.$$)로 폴백하던 것을 제거했다: 그 경로를 mkdir
|
|
@@ -318,6 +325,116 @@ for f in "${FILES[@]}"; do
|
|
|
318
325
|
| grep -vE '^[0-9]+:[[:space:]]*(if[[:space:]]+)?\[\[?[[:space:]]*(-[dznN][[:space:]]|[^]]*=~)' \
|
|
319
326
|
| grep -E '(\$\(|`|\[[[:space:]]*-[fx][[:space:]]|\b(scan|check|verify|validate|audit|grep|gate|assert|lint|test_)[A-Za-z_]*[[:space:](])')
|
|
320
327
|
|
|
328
|
+
# S1b — `|| true` INSIDE a command substitution: `V=$(git … 2>/dev/null | … || true)`.
|
|
329
|
+
# S1 above cannot see this shape at all: its regex closes on `(#|;|$)` after the permissive
|
|
330
|
+
# value, and here the next character is `)`. Measured 2026-08-26 by a full hand-census of the
|
|
331
|
+
# 132 `|| true)` sites in this repo (tracks/_meta/s1_true_paren_census_2026-08-26.md): 11 sit
|
|
332
|
+
# on a verdict path, and S1 saw 0 of them.
|
|
333
|
+
#
|
|
334
|
+
# WHY THIS SHAPE IS DIFFERENT FROM `|| true` AT END OF LINE. `|| true` on its own is NOT the
|
|
335
|
+
# defect — under `set -e` it is the prescribed way to let a legitimately-empty result through,
|
|
336
|
+
# and flagging it would push an author to delete the remedy (the same trap S3 and S5 already
|
|
337
|
+
# name). The measured defect is the CONJUNCTION the census isolated: the command's stderr is
|
|
338
|
+
# discarded (`2>/dev/null`) AND its non-zero exit is swallowed (`|| true`), so "git failed"
|
|
339
|
+
# and "git ran and matched nothing" arrive at the consumer as the same empty string. Every
|
|
340
|
+
# downstream `[ -n "$V" ]` then reads a broken repo as "nothing to check" and the gate skips
|
|
341
|
+
# itself in silence. Both halves are required by the rule below; either alone is not a smell.
|
|
342
|
+
#
|
|
343
|
+
# SCOPE — ORIGIN sites only, deliberately. The census's dominant pattern is that ONE git read
|
|
344
|
+
# feeds a dozen derived filters (`HEAVY=$(echo "$STAGED" | grep … || true)`). The derived
|
|
345
|
+
# filters inherit the origin's risk and add none of their own: their only failure mode is
|
|
346
|
+
# grep-no-match, which is what `|| true` is there for. Flagging them would turn 11 findings
|
|
347
|
+
# into 122 and bury the origin — this file already paid that price once (S5 shipped at 9/9 FP)
|
|
348
|
+
# and its own rule is that a probe which is mostly noise trains authors to dismiss it. So the
|
|
349
|
+
# substitution's LEADING command must be a real state read, never `echo`/`printf` on a value
|
|
350
|
+
# that is already in a shell variable.
|
|
351
|
+
#
|
|
352
|
+
# TWO RULES, because the two A-shapes have different tells:
|
|
353
|
+
# (1) git index/worktree read — `$(git … diff|log|ls-files|status|show …)`. Restricted to
|
|
354
|
+
# those five subcommands on purpose: `rev-parse`/`config`/`describe`/`merge-base` read
|
|
355
|
+
# identity or configuration, and in this corpus they are either fail-closed on the next
|
|
356
|
+
# line or feed a display string.
|
|
357
|
+
# (2) a substitution that FEEDS A LOOP — `done < <(cmd … || true)`, `done <<< "$(cmd …)"`.
|
|
358
|
+
# There is no variable to test here, so no `[ -z ]` can ever exist: an errored command
|
|
359
|
+
# yields zero iterations and the detector reports "found nothing". Any leading command
|
|
360
|
+
# counts except `echo`/`printf` (see SCOPE above).
|
|
361
|
+
#
|
|
362
|
+
# COUNTER DECONFLICTION: a pipeline ending in `grep -c` / `wc` is NOT flagged here — a counter
|
|
363
|
+
# always emits ("0") and exits 1 on no-match, so `|| true` there is the no-match idiom, and
|
|
364
|
+
# 🟥 RETRACTED 2026-08-26 — the sentence below said counters "belong to S5". MEASURED FALSE:
|
|
365
|
+
# S5's regex requires `|| echo 0` literally; `session_close_check.sh:395`/`:411` use
|
|
366
|
+
# `|| true`, so S5 never sees them. They are not "another probe's business" — they fall
|
|
367
|
+
# BETWEEN the two probes. Found by cross-family review (codex), confirmed by reading S5's
|
|
368
|
+
# own pattern at the S5 block below. The exclusion here stays (a counter genuinely is not
|
|
369
|
+
# S1b's shape and flagging it re-noises this probe to 74%); what changes is the CLAIM about
|
|
370
|
+
# where they land. Open, named, not silently carried: see §S5-COUNTER-GAP below.
|
|
371
|
+
# that class belongs to S5 (`|| echo 0` pipefail-fallback). Not flagging it twice is why S5's
|
|
372
|
+
# narrowing survives. Named cost: census A#10/A#11 (session_close_check.sh ④-e DISPATCHED /
|
|
373
|
+
# LOGGED) are counter-shaped and therefore NOT covered by S1b. They are not silently dropped —
|
|
374
|
+
# they are named here.
|
|
375
|
+
#
|
|
376
|
+
# SUPPRESSION (fail-closed handler): if the assigned variable is tested with `[ -z ]` within
|
|
377
|
+
# 14 lines and that branch exits non-zero / sets FAIL / reports ERROR|UNMEASURED, the emptiness
|
|
378
|
+
# IS distinguished and the site is clean. Note the direction matters: `[ -n "$V" ] && run the
|
|
379
|
+
# check` is NOT suppression — that is precisely the "empty ⇒ skip in silence" shape (census
|
|
380
|
+
# A#5, pre-commit SKILL_CHANGE), and it stays flagged.
|
|
381
|
+
#
|
|
382
|
+
# MEASURED PRECISION on this repo, hand-checked against the census, 2026-08-26: 11 hits,
|
|
383
|
+
# 9 true (census A), 2 false (scripts/fh-goal.sh:209,214 — a three-stage TARGET_FILES fallback
|
|
384
|
+
# whose terminal empty branch is `exit 0` "skipping fh-gate", which the census read as C).
|
|
385
|
+
# RECALL 9/11 of the census A set; the two misses are the counter-shaped pair named above.
|
|
386
|
+
# awk is the only new dependency and it is GUARDED (_S1B_OK) — a missing awk makes this probe
|
|
387
|
+
# blind, and blind must not render as clean (same rule as the `find` gate at the top).
|
|
388
|
+
if [ "${_S1B_OK:-1}" = 1 ]; then
|
|
389
|
+
while IFS= read -r ln; do
|
|
390
|
+
[ -n "$ln" ] || continue
|
|
391
|
+
emit "$f" "$ln" "S1b:||true-in-\$()" "a state-reading command has BOTH its stderr discarded (2>/dev/null) and its failure swallowed (|| true) inside a command substitution — 'the command failed' and 'the command matched nothing' become the same empty value, and the gate downstream skips itself in silence. Capture the status separately (out=\$(cmd 2>&1); rc=\$?) and branch on rc, or make the empty case fail closed"
|
|
392
|
+
done < <(awk '
|
|
393
|
+
{ raw[NR]=$0 }
|
|
394
|
+
END{
|
|
395
|
+
n=NR
|
|
396
|
+
for(i=1;i<=n;i++){
|
|
397
|
+
if(i<=skipto) continue
|
|
398
|
+
L=raw[i]; last=i
|
|
399
|
+
while(L ~ /\\[ \t]*$/ && last<n){ sub(/\\[ \t]*$/,"",L); last++; L=L " " raw[last] }
|
|
400
|
+
skipto=last # a continuation line is not its own finding
|
|
401
|
+
if(L ~ /^[ \t]*#/) continue
|
|
402
|
+
if(L ~ /#[ \t]*noqa[: \t]*degrade/) continue
|
|
403
|
+
if(L !~ /\|\|[ \t]*true[ \t]*\)/) continue
|
|
404
|
+
if(L !~ /2>\/dev\/null/) continue # stderr must actually be discarded
|
|
405
|
+
if(L ~ /\|[ \t]*(grep[ \t]+-[A-Za-z]*c|grep[ \t]+--count|wc[ \t])/) continue # counter: see §S5-COUNTER-GAP
|
|
406
|
+
r1 = (L ~ /[$<]\([ \t]*git[ \t]+(-[^ \t]+[ \t]+([^ \t]+[ \t]+)?)*(diff|log|ls-files|status|show)[ \t]/)
|
|
407
|
+
r2 = ((L ~ /<[ \t]*<\(/ || L ~ /<<<[ \t]*"?\$\(/) && L !~ /[$<]\([ \t]*(echo|printf)[ \t]/)
|
|
408
|
+
if(!r1 && !r2) continue
|
|
409
|
+
v=""
|
|
410
|
+
if(match(L,/^[ \t]*(local[ \t]+)?[A-Za-z_][A-Za-z0-9_]*=/)){
|
|
411
|
+
v=substr(L,RSTART,RLENGTH); sub(/^[ \t]*(local[ \t]+)?/,"",v); sub(/=$/,"",v)
|
|
412
|
+
}
|
|
413
|
+
supp=0
|
|
414
|
+
if(v!=""){
|
|
415
|
+
for(j=last+1;j<=last+14 && j<=n;j++){
|
|
416
|
+
if(raw[j] ~ ("-z[ \t]*\"?\\$\\{?" v "[\"}]")){
|
|
417
|
+
# 🟥 2026-08-26 (cross-family/codex): proximity alone suppressed on a COMMENT
|
|
418
|
+
# or on an unrelated later branch that merely sat within 6 lines. That is a
|
|
419
|
+
# false NEGATIVE — it hides a real fail-open — which is strictly worse than the
|
|
420
|
+
# distance constant being unmeasured. Two guards: comments are not remedies,
|
|
421
|
+
# and the search stops at the end of the `-z` branch.
|
|
422
|
+
for(k=j;k<=j+6 && k<=n;k++){
|
|
423
|
+
C=raw[k]
|
|
424
|
+
if(C ~ /^[ \t]*#/) continue
|
|
425
|
+
sub(/[ \t]#.*$/,"",C) # trailing comment is not code
|
|
426
|
+
if(k>j && C ~ /^[ \t]*(fi|else|elif|esac|;;|})([ \t]|$)/) break
|
|
427
|
+
if(C ~ /exit[ \t]+[1-9]|return[ \t]+[1-9]|FAIL|UNMEASURED|ERROR|die /){ supp=1; break }
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if(supp) break
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if(!supp) print i
|
|
434
|
+
}
|
|
435
|
+
}' "$f" 2>/dev/null)
|
|
436
|
+
fi
|
|
437
|
+
|
|
321
438
|
# S2 — `else` fall-through to a permissive exit/return within 2 lines (unenumerated case → allow).
|
|
322
439
|
while IFS= read -r ln; do
|
|
323
440
|
emit "$f" "$ln" "S2:else→PASS(sh)" "else/fall-through branch exits permissively — the unenumerated case should fail closed"
|
|
@@ -535,6 +652,7 @@ for f in "${FILES[@]}"; do
|
|
|
535
652
|
done
|
|
536
653
|
|
|
537
654
|
echo "----"
|
|
655
|
+
[ "${_S1B_OK:-1}" = 1 ] || echo "note: probe S1b NOT MEASURED (awk unavailable) — this run is not clean on that axis."
|
|
538
656
|
[ ${#UNSCANNABLE[@]} -gt 0 ] && printf 'note: %s changed file(s) outside py/sh — NOT covered by this scan (send to cross-family directly).\n' "${#UNSCANNABLE[@]}"
|
|
539
657
|
if [ "$hits" -gt 0 ]; then
|
|
540
658
|
echo "degrade-scan: $hits smell(s) — ADVISORY. Each = 'prove this is not default-toward-PASS'."
|
package/scripts/fh-goal.sh
CHANGED
|
@@ -205,13 +205,33 @@ if [[ -z "$TARGET_FILES" ]]; then
|
|
|
205
205
|
echo " The backend may well have changed code; fh-gate never ran. Pass --files explicitly." >&2
|
|
206
206
|
exit 10
|
|
207
207
|
fi
|
|
208
|
+
# 🟥 The GIT_OK branch above closed "no git at all"; these two closed NOTHING until
|
|
209
|
+
# 2026-08-26. `git` present + a real repo does not mean `diff`/`status` SUCCEEDS — a corrupt
|
|
210
|
+
# index, an unreadable object, a lock contention or an interrupted command all fail HERE, and
|
|
211
|
+
# `2>/dev/null … || true` folded that failure into an empty string indistinguishable from
|
|
212
|
+
# "nothing changed" → the `exit 0` below → **fh-gate never ran and the caller read it as a
|
|
213
|
+
# clean run**. Exactly the class the comment at the top of this block names; it was fixed in
|
|
214
|
+
# one branch and left open in the other two. Cross-family review (codex) found it; the same
|
|
215
|
+
# session's own lane had classified it "safe" (`C`).
|
|
216
|
+
# Capture the git rc SEPARATELY from the transform — `|| true` on the whole pipeline is what
|
|
217
|
+
# ate it, and `pipefail` had been faithfully propagating it right up to that point.
|
|
208
218
|
if [[ -n "$START_COMMIT" ]]; then
|
|
209
|
-
|
|
219
|
+
if ! _fg_raw=$(git -C "$WORK_ROOT" diff "$START_COMMIT"..HEAD --name-only 2>/dev/null); then
|
|
220
|
+
echo "ERROR: cannot detect changed files (git diff failed in ${WORK_ROOT})." >&2
|
|
221
|
+
echo " The backend may well have changed code; fh-gate never ran. Pass --files explicitly." >&2
|
|
222
|
+
exit 10
|
|
223
|
+
fi
|
|
224
|
+
TARGET_FILES=$(printf '%s\n' "$_fg_raw" | tr '\n' ' ' | xargs || true)
|
|
210
225
|
fi
|
|
211
226
|
if [[ -z "$TARGET_FILES" ]]; then
|
|
212
227
|
# `--porcelain` + strip the 2-char status field. `awk '{print $2}'` used to take the OLD
|
|
213
228
|
# path of a rename ("R old -> new") and split names containing spaces.
|
|
214
|
-
|
|
229
|
+
if ! _fg_raw=$(git -C "$WORK_ROOT" status --porcelain 2>/dev/null); then
|
|
230
|
+
echo "ERROR: cannot detect changed files (git status failed in ${WORK_ROOT})." >&2
|
|
231
|
+
echo " The backend may well have changed code; fh-gate never ran. Pass --files explicitly." >&2
|
|
232
|
+
exit 10
|
|
233
|
+
fi
|
|
234
|
+
TARGET_FILES=$(printf '%s\n' "$_fg_raw" \
|
|
215
235
|
| sed -e 's/^.\{3\}//' -e 's/^.* -> //' -e 's/^"\(.*\)"$/\1/' \
|
|
216
236
|
| tr '\n' ' ' | xargs || true)
|
|
217
237
|
fi
|
|
@@ -487,7 +487,20 @@ fi
|
|
|
487
487
|
|
|
488
488
|
# 5) Emit the freshness block (short + imperative). Only speak if there is something to say.
|
|
489
489
|
{
|
|
490
|
-
|
|
490
|
+
# 🟥 NODE NAME rides this line on purpose (2026-08-27, measured N=2). fh_node_check.sh computes
|
|
491
|
+
# NODE_ID and prints it — but only when something is WRONG or on the once-per-node identity event
|
|
492
|
+
# (its `[ -n "$MISS$...$IDENTITY$..." ] || exit 0` guard). That silence is the right call for a
|
|
493
|
+
# nag; the cost is that in the STEADY state the session cannot see which machine it is on.
|
|
494
|
+
# What that cost actually bought, same day: a session on the air node read three air-local
|
|
495
|
+
# absences and nearly published them as global — a "sealed corpus lost" (it is intact on pro), an
|
|
496
|
+
# M-tier "granted capability never fires" (all three files are on pro), and a 347-file hub/mirror
|
|
497
|
+
# gap. Recurrence 2 (2026-07-31 was the same shape, same node, already in memory as
|
|
498
|
+
# [[feedback_frontier_digest_auto_catch]]) — the rule was recorded and did not fire, because the
|
|
499
|
+
# trigger is "I observed an absence" and what a session checks at that moment is whether its
|
|
500
|
+
# INSTRUMENT is alive, not which NODE it is standing on. Those are different checks.
|
|
501
|
+
# So: no new hook, no new line, no nag — the node name is appended to a banner that already
|
|
502
|
+
# prints every single session. `hostname -s`, the same source fh_node_check.sh uses.
|
|
503
|
+
echo "🔄 [FH SessionStart] companion-store freshness — $PULL_NOTE. · node: $(hostname -s 2>/dev/null || echo unknown)"
|
|
491
504
|
if [ -n "$NEWER" ]; then
|
|
492
505
|
echo "⚠️ NEWER THAN SESSION CARD — READ THESE BEFORE ACTING (card may be stale):"
|
|
493
506
|
printf "%b" "$NEWER"
|
|
@@ -48,10 +48,6 @@ ACCEPTED_ABSENT=(
|
|
|
48
48
|
"scripts/outbound_query_guard.sh"
|
|
49
49
|
"scripts/test_outbound_query_lanes.sh"
|
|
50
50
|
".claude/registry/LOCAL_SKILL_REGISTRY.md"
|
|
51
|
-
# An INSTALL DESTINATION the user creates (`cp templates/local_fh_context.md
|
|
52
|
-
# .claude/rules/local_fh_context.md`), not a file FH ships. Shipping it would overwrite the
|
|
53
|
-
# user's own cross-context wiring — the template it is copied FROM is what ships.
|
|
54
|
-
".claude/rules/local_fh_context.md"
|
|
55
51
|
".claude/regression/probes.md"
|
|
56
52
|
# Its sibling, and absent for the same reason one layer up: this file records which sections of
|
|
57
53
|
# THIS repo's resident CLAUDE.md were measured load-bearing. A consumer's CLAUDE.md is their
|
|
@@ -203,6 +199,13 @@ ACCEPTED_ABSENT=(
|
|
|
203
199
|
# Its only input is `.claude/regression/probes.md`, itself ACCEPTED_ABSENT above (a consumer's
|
|
204
200
|
# regression run must not compare against this harness's probe set). Shipping the reader without
|
|
205
201
|
# its corpus would put a script in the package that can only ever report "instrument error".
|
|
202
|
+
# ④ 계측 채널(발화-유도 스킬 로깅). 배선이 **로컬 `.claude/settings.json`** 에 있고 그 파일은
|
|
203
|
+
# 출하물이 아니다 — 스크립트만 실으면 소비자 머신에서 아무것도 안 하는 죽은 파일이 된다.
|
|
204
|
+
# 게다가 이건 이 허브의 정체성 ④ 계측이라 소비자가 잴 대상 자체가 다르다.
|
|
205
|
+
"scripts/utterance_skill_probe.sh"
|
|
206
|
+
# 바로 위의 앵커. 주어가 안 실리는데 앵커만 싣는 것은 이 체커가 스스로 defect 라 부르는 형태다
|
|
207
|
+
# ("shipping an anchor whose subject is not in the package").
|
|
208
|
+
"scripts/test_utterance_skill_probe_lanes.sh"
|
|
206
209
|
"scripts/probe_scope_check.sh"
|
|
207
210
|
# The known-pair precondition for `probe_scope_check.sh`'s ablation procedure. Absent for the same
|
|
208
211
|
# reason as its subject — the procedure ablates THIS repo's resident CLAUDE.md, so a consumer has
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -593,7 +593,9 @@ for _pair in \
|
|
|
593
593
|
"plugins/fh-commons/skills/ko-tech-writer/SKILL.md|scripts/test_ko_tech_writer_lanes.sh" \
|
|
594
594
|
"scripts/script_caller_ratchet.sh|scripts/test_script_caller_ratchet_lanes.sh" \
|
|
595
595
|
"scripts/script_caller_ratchet.sh|scripts/test_runner_surface_index_lanes.sh" \
|
|
596
|
-
"scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh"
|
|
596
|
+
"scripts/mapped_tracks.sh|scripts/test_mapped_tracks_lanes.sh" \
|
|
597
|
+
"scripts/fh-goal.sh|scripts/test_fh_goal_change_detection_lanes.sh" \
|
|
598
|
+
"scripts/utterance_skill_probe.sh|scripts/test_utterance_skill_probe_lanes.sh"
|
|
597
599
|
do
|
|
598
600
|
_subj="${_pair%%|*}"; _anc="${_pair##*|}"; _lbl="${_anc##*/}"
|
|
599
601
|
if [ ! -f "$_subj" ]; then
|
|
@@ -392,7 +392,31 @@ fi
|
|
|
392
392
|
# Fix = no `|| echo`, plus integer sanitation. This is the documented prescription for this class
|
|
393
393
|
# ([[feedback_pipefail_fallback_disarms_guard]]) applied to the checker that cited it.
|
|
394
394
|
_int() { case "${1:-}" in (''|*[!0-9]*) echo 0 ;; (*) echo "$1" ;; esac; }
|
|
395
|
-
|
|
395
|
+
# 🟥 2026-08-26 (cross-family/codex) — the fix above closed the `0\n0` half and left the OTHER
|
|
396
|
+
# half open: `|| true` + `_int` folded a READ FAILURE into the same 0 as a genuine no-match, so an
|
|
397
|
+
# unreadable tally rendered as "✅ no sub-agent dispatches tallied today" — a green nobody measured.
|
|
398
|
+
# `grep -c` separates the three cleanly: rc 0 = matched, rc 1 = no match (a REAL zero), rc >= 2 =
|
|
399
|
+
# grep itself failed. Only the first two are counts; the third is UNMEASURED and must not be 0.
|
|
400
|
+
# ([[feedback_not_found_is_not_zero_family]] — `not found` != `0`, applied to this checker.)
|
|
401
|
+
# 🟥 Kept as a HELPER + a ONE-LINE assignment on purpose: test_dispatch_log_lanes.sh lifts the
|
|
402
|
+
# subject's own `^DISPATCHED=` / `^LOGGED=` line and evaluates it, precisely so the lane cannot go
|
|
403
|
+
# green on a needle that no longer matches real behaviour. A multi-line if/else defeats that lift.
|
|
404
|
+
_cnt() { # $1 = a path that must EXIST (or "" to skip that test); rest = the reader command.
|
|
405
|
+
# Three states, not two — the lane below pins all three:
|
|
406
|
+
# path absent -> 0 a tally that was never written IS zero dispatches;
|
|
407
|
+
# calling that UNMEASURED false-blocks every clean
|
|
408
|
+
# close on a fresh install, and an over-blocking close
|
|
409
|
+
# gate trains the --no-verify reflex that disarms the
|
|
410
|
+
# Destructive-Op gate sharing that hook.
|
|
411
|
+
# reader rc 0 or 1 -> the count (rc 1 = grep's honest "no match")
|
|
412
|
+
# reader rc >= 2 -> UNMEASURED the reader ITSELF failed; folding that into 0 printed
|
|
413
|
+
# "no dispatches tallied today" on something nobody read.
|
|
414
|
+
_c_f="$1"; shift
|
|
415
|
+
if [ -n "$_c_f" ] && [ ! -e "$_c_f" ]; then echo 0; return; fi
|
|
416
|
+
_c_out=$("$@" 2>/dev/null); _c_rc=$?
|
|
417
|
+
if [ "$_c_rc" -ge 2 ]; then echo UNMEASURED; else _int "$(printf '%s' "$_c_out" | tr -d ' ')"; fi
|
|
418
|
+
}
|
|
419
|
+
DISPATCHED=$(_cnt "$TALLY" grep -c "^$TODAY$" "$TALLY")
|
|
396
420
|
# Both quotings, because the file carries both: hand-written entries use `- date: 2026-08-02`
|
|
397
421
|
# while anything appended via yaml.dump renders `- date: '"'"'2026-08-02'"'"'`. Matching one form counted
|
|
398
422
|
# half the entries as absent — a divergent-normalizer miss inside the check that exists to catch
|
|
@@ -408,8 +432,17 @@ LOGDIR="$FH/knowledge/shared/learnings/subagent_invocations"
|
|
|
408
432
|
_cat_logs() { # 다중 파일에 grep -c 를 직접 걸면 파일별 `경로:개수` 를 찍어 합산이 깨진다(실측).
|
|
409
433
|
{ [ -f "$LOG" ] && cat "$LOG"; [ -d "$LOGDIR" ] && cat "$LOGDIR"/*.yaml; } 2>/dev/null
|
|
410
434
|
}
|
|
411
|
-
|
|
412
|
-
|
|
435
|
+
_log_grep() { # 🟥 MUST stay multi-line: the lane lifts defs with /^_name\(\) \{/,/^\}/ and a
|
|
436
|
+
# one-liner has no `}` at column 0, so the range never closes and the extraction
|
|
437
|
+
# silently swallows the rest of the file (measured 2026-08-26).
|
|
438
|
+
_cat_logs | grep -cE "^- date: *'?$TODAY'?"
|
|
439
|
+
}
|
|
440
|
+
LOGGED=$(_cnt "" _log_grep) # _cat_logs already renders absence as empty, not as an error
|
|
441
|
+
if [ "$DISPATCHED" = UNMEASURED ] || [ "$LOGGED" = UNMEASURED ]; then
|
|
442
|
+
echo "❌ ④-e dispatch log: COULD NOT MEASURE (tally=$DISPATCHED, log=$LOGGED) — a read error is"
|
|
443
|
+
echo " not a count of zero. Fix the read before closing; do not treat this as 'no dispatches'."
|
|
444
|
+
FAIL=1
|
|
445
|
+
elif [ "${DISPATCHED:-0}" -gt 0 ] && [ "${LOGGED:-0}" -eq 0 ]; then
|
|
413
446
|
echo "❌ ④-e $DISPATCHED sub-agent dispatch(es) today and ZERO invocation-log entries — the 60/40"
|
|
414
447
|
echo " promotion gate and the UAP loop both read that file; an unlogged session is invisible to"
|
|
415
448
|
echo " them. Append to knowledge/shared/learnings/subagent_invocations_log.yaml (consolidated"
|
|
@@ -16,6 +16,33 @@
|
|
|
16
16
|
|
|
17
17
|
set -uo pipefail
|
|
18
18
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
# 🟥 ENVIRONMENT ISOLATION (2026-08-27). `CLAUDE.local.md` INSTRUCTS this operator to export
|
|
20
|
+
# FH_COMPANION_STORE, so the suite inherited a REAL companion store and ⑤-C compared each FIXTURE
|
|
21
|
+
# card against the operator's actual prior card — reporting a carry-over loss that belongs to
|
|
22
|
+
# neither. Measured A/B on this file: exported → rc 1 with 6 exit-code lanes red · unset → rc 0.
|
|
23
|
+
# The verdict CONTENT was right every time (every `_line` assertion passed); only the exit code
|
|
24
|
+
# moved, which is what made it read like an over-blocking script rather than an ambient leak.
|
|
25
|
+
# 🟥 THIS IS THE SECOND FILE WITH THIS LEAK. The sibling test_session_close_lanes.sh was fixed
|
|
26
|
+
# earlier the same day and this one was not — a half-fix propagation boundary created by the same
|
|
27
|
+
# author who had just named that class. Fixed together now; the sweep that found it is
|
|
28
|
+
# grep -l session_close_check scripts/test_*.sh → check each for an FH_COMPANION_STORE guard.
|
|
29
|
+
# Lanes that genuinely exercise ⑤-C set their own fixture store ON the invocation and still win.
|
|
30
|
+
# 🟥 CLASS, NOT INSTANCE. The first draft of this guard unset FH_COMPANION_STORE alone — the one
|
|
31
|
+
# variable that had actually bitten. That is the same shape as the half-fix that put this guard in
|
|
32
|
+
# only ONE of two sibling lane files hours earlier. Every operator-settable override the subject
|
|
33
|
+
# reads is the same window, so all of them are closed here rather than one at a time:
|
|
34
|
+
# FH_COMPANION_STORE ⑤-C reads a REAL prior card and reports a carry-over loss on a fixture
|
|
35
|
+
# FH_SESSION_CLOSE flips advisory into blocking — every `expect exit 0` lane would go red
|
|
36
|
+
# FH_CARRYOVER_OK SKIPs ⑤-C — a lane asserting ⑤-C FIRES would go green for the wrong reason
|
|
37
|
+
# (note the direction: this one fails OPEN, which is the worse half)
|
|
38
|
+
# FH_PEER_SCAN_FORCE forces the ①-c peer scan on regardless of session shape
|
|
39
|
+
# FH_PEER_SOCK_DIR / FH_REPO_ID repoint peer discovery at the ambient machine
|
|
40
|
+
# CLAUDE_CODE_AGENT / CLAUDE_CODE_CHILD_SESSION are deliberately NOT in this list: the subject uses
|
|
41
|
+
# them to detect session shape and the lanes that care unset them per-case on purpose (see the
|
|
42
|
+
# subject's own "NEGATIVE ARM UNVERIFIED" note). Blanket-clearing them here would silently change
|
|
43
|
+
# which branch those lanes exercise.
|
|
44
|
+
unset FH_COMPANION_STORE FH_SESSION_CLOSE FH_CARRYOVER_OK FH_PEER_SCAN_FORCE FH_PEER_SOCK_DIR FH_REPO_ID
|
|
45
|
+
export FH_COMPANION_STORE=""
|
|
19
46
|
CHECK="$SCRIPT_DIR/session_close_check.sh"
|
|
20
47
|
FAILED=0
|
|
21
48
|
|
|
@@ -705,6 +705,135 @@ else
|
|
|
705
705
|
fi
|
|
706
706
|
fi
|
|
707
707
|
|
|
708
|
+
|
|
709
|
+
# ── S1b known pair — `|| true` INSIDE a command substitution ────────────────────────
|
|
710
|
+
# Added 2026-08-26 after a full hand-census of the 132 `|| true)` sites in this repo
|
|
711
|
+
# (tracks/_meta/s1_true_paren_census_2026-08-26.md). 11 sat on a verdict path and S1 saw ZERO of
|
|
712
|
+
# them: its regex closes on `(#|;|$)` after the permissive value, and in this shape the next
|
|
713
|
+
# character is `)`. Both directions are pinned, and so are the two deliberate NON-detections that
|
|
714
|
+
# keep the probe from becoming the 122-hit noise machine the census warned about.
|
|
715
|
+
s1b_hits() { bash "$SCAN" "$@" 2>&1 | grep -cE '\[S1b:'; }
|
|
716
|
+
|
|
717
|
+
# POSITIVE — the four census-A shapes, verbatim in structure:
|
|
718
|
+
# origin git read · multi-line continuation · process substitution feeding a detector loop ·
|
|
719
|
+
# here-string feeding the npm-publish leak loop.
|
|
720
|
+
cat > "$TMP/s1b_positive.sh" <<'EOF'
|
|
721
|
+
#!/usr/bin/env bash
|
|
722
|
+
STAGED=$(git -c core.quotePath=false diff --cached --name-only -z 2>/dev/null | tr '\0' '\n' || true)
|
|
723
|
+
HEAVY=$(echo "$STAGED" | grep -E 'SKILL\.md' || true)
|
|
724
|
+
SKILL_CHANGE=$(git diff --cached --name-status --diff-filter=ADR 2>/dev/null \
|
|
725
|
+
| grep -E 'skills/[^/]+/SKILL\.md' || true)
|
|
726
|
+
if [ -n "$SKILL_CHANGE" ]; then echo "count check"; fi
|
|
727
|
+
while IFS= read -r p; do _bad=1; done < <(git diff --cached --name-only -z 2>/dev/null || true)
|
|
728
|
+
while IFS= read -r h; do echo "$h"; done <<< "$(grep -aoiE "$re" "$path" 2>/dev/null | sort -u || true)"
|
|
729
|
+
EOF
|
|
730
|
+
|
|
731
|
+
# NEGATIVE — the same logic written so that "the command failed" and "the command matched nothing"
|
|
732
|
+
# are different values. Must stay silent or the probe is noise.
|
|
733
|
+
cat > "$TMP/s1b_negative.sh" <<'EOF'
|
|
734
|
+
#!/usr/bin/env bash
|
|
735
|
+
STAGED=$(git -c core.quotePath=false diff --cached --name-only -z 2>&1 | tr '\0' '\n'); _rc=$?
|
|
736
|
+
[ "$_rc" -ne 0 ] && { echo "git diff failed"; exit 1; }
|
|
737
|
+
HEAVY=$(echo "$STAGED" | grep -E 'SKILL\.md' || true)
|
|
738
|
+
_paths=$(git diff --cached --name-only -z 2>/dev/null || true)
|
|
739
|
+
if [ -z "$_paths" ]; then echo "ERROR: no path stream"; exit 1; fi
|
|
740
|
+
while IFS= read -r p; do _bad=1; done <<< "$_paths"
|
|
741
|
+
EOF
|
|
742
|
+
|
|
743
|
+
# NON-DETECTIONS, each pinned for a distinct reason:
|
|
744
|
+
# (a) a DERIVED filter over a value already in a shell variable — its only failure mode is
|
|
745
|
+
# grep-no-match, which is what `|| true` is for. The census counted the risk once, at the
|
|
746
|
+
# origin; flagging derivations turns 11 findings into 122 and buries the origin.
|
|
747
|
+
# (b) stderr NOT discarded — a real failure is still visible, so the conjunction is incomplete.
|
|
748
|
+
# (c) a COUNTER pipeline — `grep -c` always emits and exits 1 on no-match; that class is S5's.
|
|
749
|
+
# (d) `git rev-parse`/`config` — identity/config reads, not index/worktree state.
|
|
750
|
+
cat > "$TMP/s1b_nondetect.sh" <<'EOF'
|
|
751
|
+
#!/usr/bin/env bash
|
|
752
|
+
LIGHT=$(echo "$STAGED" | grep -E '^knowledge/' 2>/dev/null || true)
|
|
753
|
+
BODY=$(printf '%s\n' "$body" | grep -E '^\+' 2>/dev/null || true)
|
|
754
|
+
VISIBLE=$(git diff --cached --name-only || true)
|
|
755
|
+
N=$(git -C "$FH" ls-files -v 2>/dev/null | grep -c '^[a-z]' || true)
|
|
756
|
+
ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
|
|
757
|
+
EOF
|
|
758
|
+
|
|
759
|
+
n=$(s1b_hits "$TMP/s1b_positive.sh")
|
|
760
|
+
[ "$n" -eq 4 ] && ok "S1b-KP 4/4 census-A shapes detected (origin · continuation · <(…) · <<<)" \
|
|
761
|
+
|| bad "S1b-KP expected 4 S1b hits, got $n"
|
|
762
|
+
|
|
763
|
+
n=$(s1b_hits "$TMP/s1b_negative.sh")
|
|
764
|
+
[ "$n" -eq 0 ] && ok "S1b-KN fail-closed spelling stays silent (the probe discriminates)" \
|
|
765
|
+
|| bad "S1b-KN expected 0 S1b hits, got $n"
|
|
766
|
+
|
|
767
|
+
n=$(s1b_hits "$TMP/s1b_nondetect.sh")
|
|
768
|
+
[ "$n" -eq 0 ] && ok "S1b-ND derived filters / visible stderr / counters / rev-parse stay silent (5/5)" \
|
|
769
|
+
|| bad "S1b-ND expected 0 S1b hits, got $n (the SCOPE narrowing regressed)"
|
|
770
|
+
|
|
771
|
+
# The 2>/dev/null conjunct is LOAD-BEARING, not decoration: removing it from the fixture must flip
|
|
772
|
+
# the verdict. Without this, "the probe fires" could be true for the wrong reason.
|
|
773
|
+
printf '#!/usr/bin/env bash\nS=$(git diff --cached --name-only 2>/dev/null || true)\n' > "$TMP/s1b_conj.sh"
|
|
774
|
+
a=$(s1b_hits "$TMP/s1b_conj.sh")
|
|
775
|
+
printf '#!/usr/bin/env bash\nS=$(git diff --cached --name-only || true)\n' > "$TMP/s1b_conj.sh"
|
|
776
|
+
b=$(s1b_hits "$TMP/s1b_conj.sh")
|
|
777
|
+
if [ "$a" -eq 1 ] && [ "$b" -eq 0 ]; then
|
|
778
|
+
ok "S1b-CONJ the 2>/dev/null half is load-bearing (1 with, 0 without)"
|
|
779
|
+
else
|
|
780
|
+
bad "S1b-CONJ expected 1/0 across the mutant, got $a/$b — the conjunct proves nothing"
|
|
781
|
+
fi
|
|
782
|
+
|
|
783
|
+
# The fail-closed suppression must SUPPRESS, and must not suppress the `-n` skip direction.
|
|
784
|
+
printf '#!/usr/bin/env bash\nV=$(git diff --cached --name-only 2>/dev/null || true)\nif [ -z "$V" ]; then echo ERROR; exit 1; fi\n' > "$TMP/s1b_supp.sh"
|
|
785
|
+
a=$(s1b_hits "$TMP/s1b_supp.sh")
|
|
786
|
+
printf '#!/usr/bin/env bash\nV=$(git diff --cached --name-only 2>/dev/null || true)\nif [ -n "$V" ]; then run_the_check; fi\n' > "$TMP/s1b_supp.sh"
|
|
787
|
+
b=$(s1b_hits "$TMP/s1b_supp.sh")
|
|
788
|
+
if [ "$a" -eq 0 ] && [ "$b" -eq 1 ]; then
|
|
789
|
+
ok "S1b-SUPP [-z]→exit 1 suppresses; [-n]→run-the-check (empty ⇒ silent skip) still fires"
|
|
790
|
+
else
|
|
791
|
+
bad "S1b-SUPP expected 0/1, got $a/$b — the suppression lost its direction"
|
|
792
|
+
fi
|
|
793
|
+
|
|
708
794
|
echo "----"
|
|
709
|
-
echo "degrade-scan shell probes: $pass passed, $fail failed"
|
|
710
795
|
[ "$fail" -eq 0 ] || exit 1
|
|
796
|
+
# ── S1b-SUPP-COMMENT — the suppression must not be fooled by a COMMENT (2026-08-26) ──────────
|
|
797
|
+
# Cross-family (codex) finding: the `-z`-branch remedy search was raw proximity, so the word
|
|
798
|
+
# ERROR sitting in a COMMENT (or in an unrelated later branch) within 6 lines suppressed a REAL
|
|
799
|
+
# fail-open. That is a false NEGATIVE — strictly worse than the unmeasured distance constant.
|
|
800
|
+
# 🟥 POS arm is mandatory: without it, "0 firings" cannot be told apart from "S1b is dead".
|
|
801
|
+
_s1bc=$(mktemp -d)
|
|
802
|
+
cat > "$_s1bc/pos.sh" <<'P1'
|
|
803
|
+
#!/usr/bin/env bash
|
|
804
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
805
|
+
echo "proceeding with $STAGED"
|
|
806
|
+
P1
|
|
807
|
+
cat > "$_s1bc/mut.sh" <<'P2'
|
|
808
|
+
#!/usr/bin/env bash
|
|
809
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
810
|
+
if [ -z "$STAGED" ]; then
|
|
811
|
+
# ERROR appears only in this comment; nothing is actually blocked
|
|
812
|
+
:
|
|
813
|
+
fi
|
|
814
|
+
echo "proceeding"
|
|
815
|
+
P2
|
|
816
|
+
cat > "$_s1bc/ctl.sh" <<'P3'
|
|
817
|
+
#!/usr/bin/env bash
|
|
818
|
+
STAGED=$(git diff --cached --name-only 2>/dev/null | tr '\n' ' ' || true)
|
|
819
|
+
if [ -z "$STAGED" ]; then
|
|
820
|
+
echo "ERROR: cannot read index" >&2
|
|
821
|
+
exit 1
|
|
822
|
+
fi
|
|
823
|
+
echo "proceeding"
|
|
824
|
+
P3
|
|
825
|
+
_s1bc_n(){ bash "$SCAN" "$1" 2>/dev/null | grep -c 'S1b' || true; }
|
|
826
|
+
_p=$(_s1bc_n "$_s1bc/pos.sh"); _m=$(_s1bc_n "$_s1bc/mut.sh"); _c=$(_s1bc_n "$_s1bc/ctl.sh")
|
|
827
|
+
if [ "$_p" -ge 1 ]; then
|
|
828
|
+
ok "S1b-SUPP-COMMENT POS: probe is ALIVE on a bare origin ($_p hit) — 0-results below are readable"
|
|
829
|
+
if [ "$_m" -ge 1 ]; then ok "S1b-SUPP-COMMENT MUT: a comment does not suppress a real fail-open"
|
|
830
|
+
else bad "S1b-SUPP-COMMENT MUT: comment-only ERROR suppressed a real fail-open (false negative)"; fi
|
|
831
|
+
if [ "$_c" -eq 0 ]; then ok "S1b-SUPP-COMMENT CTL: a genuine fail-closed branch is still suppressed"
|
|
832
|
+
else bad "S1b-SUPP-COMMENT CTL: over-blocked a legitimate fail-closed remedy ($_c)"; fi
|
|
833
|
+
else
|
|
834
|
+
bad "S1b-SUPP-COMMENT: POS arm dead (probe fired 0 on a bare origin) — MUT/CTL UNINTERPRETABLE"
|
|
835
|
+
fi
|
|
836
|
+
rm -rf "$_s1bc"
|
|
837
|
+
|
|
838
|
+
echo "degrade-scan shell probes: $pass passed, $fail failed"
|
|
839
|
+
|
|
@@ -39,10 +39,37 @@ if [ -z "$CATLOGS_DEF" ]; then
|
|
|
39
39
|
echo "FAIL subject 에 _cat_logs 가 없다 — 전환 설계(레거시 ∪ 디렉터리)가 사라졌거나 이름이 바뀌었다."
|
|
40
40
|
exit 1
|
|
41
41
|
fi
|
|
42
|
+
# 🟥 2026-08-26 — 주어가 read-error 를 UNMEASURED 로 가르기 시작했고 그 로직이 `_cnt` 에 산다.
|
|
43
|
+
# 이걸 안 들여오면 대입줄 평가가 «command not found → rc 127 → UNMEASURED» 로 **틀린 이유로**
|
|
44
|
+
# 답을 낸다. 이 파일이 이미 _cat_logs 에 대해 경고한 장식-앵커 함정의 같은 얼굴이다.
|
|
45
|
+
CNT_DEF=$(awk '/^_cnt\(\) \{/,/^\}/' "$CHECK")
|
|
46
|
+
LOGGREP_DEF=$(awk '/^_log_grep\(\) \{/,/^\}/' "$CHECK")
|
|
47
|
+
if [ -z "$CNT_DEF" ]; then
|
|
48
|
+
echo "FAIL subject 에 _cnt 가 없다 — read-error↔zero 분리(UNMEASURED)가 사라졌거나 이름이 바뀌었다."
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
if [ -z "$LOGGREP_DEF" ]; then
|
|
52
|
+
echo "FAIL subject 에 _log_grep 가 없다 — LOGGED 의 리더가 사라졌거나 이름이 바뀌었다."
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
42
55
|
echo "── matcher located in the subject"
|
|
43
56
|
echo "── _cat_logs lifted from the subject ($(printf '%s' "$CATLOGS_DEF" | grep -c '') lines)"
|
|
44
57
|
|
|
45
58
|
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
|
|
59
|
+
# 🟥 정의를 `bash -c "..."` 안에 인라인하면 **바깥 셸이 먼저 확장**한다 — `_cnt` 본문의 `"$@"` 가
|
|
60
|
+
# 빈 문자열로 치환돼 리더가 조용히 죽고, 레인은 «틀린 이유로» 판정을 낸다(2026-08-26 실측).
|
|
61
|
+
# 파일로 떨궈 source 하면 그 창이 아예 없다.
|
|
62
|
+
SUBJ_DEFS="$T/subject_defs.sh"
|
|
63
|
+
printf '%s\n%s\n%s\n' "$CATLOGS_DEF" "$CNT_DEF" "$LOGGREP_DEF" > "$SUBJ_DEFS"
|
|
64
|
+
bash -n "$SUBJ_DEFS" || { echo "FAIL subject 정의 3종을 들어왔으나 구문이 깨진다"; exit 1; }
|
|
65
|
+
# 🟥 크기 가드 — awk 범위가 안 닫히면(한 줄 함수라 `}` 가 column 0 에 없으면) 파일 나머지를
|
|
66
|
+
# 통째로 끌고 오고, 그래도 `bash -n` 은 통과한다. 그러면 정의가 아니라 스크립트를 source 하게
|
|
67
|
+
# 되어 «unbound variable» 같은 엉뚱한 이유로 판정이 난다(2026-08-26 실측).
|
|
68
|
+
_SD_LINES=$(grep -c '' "$SUBJ_DEFS")
|
|
69
|
+
if [ "$_SD_LINES" -gt 40 ]; then
|
|
70
|
+
echo "FAIL 들어온 정의가 ${_SD_LINES}줄 — awk 범위가 안 닫혔다(한 줄 함수?). 정의만 와야 한다."
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
46
73
|
D=2026-08-02
|
|
47
74
|
|
|
48
75
|
echo "── date-spelling lanes (the shipped miscount) ──"
|
|
@@ -132,7 +159,7 @@ _eval_subject_assign() { # $1 = variable name; echoes what the SUBJECT computes
|
|
|
132
159
|
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
133
160
|
# ★ LOGGED 는 주어의 _cat_logs 에 의존한다. 이걸 안 들여오면 «함수 없음 → 빈 입력 → 0»
|
|
134
161
|
# 으로 **틀린 이유로 통과**한다 — 이 파일이 경고하는 장식 앵커 그 자체다.
|
|
135
|
-
$
|
|
162
|
+
. '$SUBJ_DEFS'
|
|
136
163
|
TODAY=NOSUCHDATE; TALLY='$CHECK'; LOG='$CHECK'; LOGDIR='$CHECK.nodir'
|
|
137
164
|
$line
|
|
138
165
|
printf %s \"\$$var\"" 2>/dev/null
|
|
@@ -150,7 +177,7 @@ LOGGED_LINE=$(grep -E "^LOGGED=" "$CHECK" | head -1)
|
|
|
150
177
|
_count_in() { # $1=LOG 경로(없으면 빈문자) $2=LOGDIR 경로(없으면 빈문자)
|
|
151
178
|
bash -c "set -uo pipefail
|
|
152
179
|
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
153
|
-
$
|
|
180
|
+
. '$SUBJ_DEFS'
|
|
154
181
|
TODAY='$D'; LOG='$1'; LOGDIR='$2'
|
|
155
182
|
$LOGGED_LINE
|
|
156
183
|
printf %s \"\$LOGGED\"" 2>/dev/null
|
|
@@ -167,6 +194,31 @@ printf -- "- date: %s\n" "$D" > "$LT/dir/b.yaml" # 1건
|
|
|
167
194
|
_naive=$(grep -cE "^- date: *'?$D'?" "$LT/dir"/*.yaml 2>/dev/null | tr -d ' \n')
|
|
168
195
|
[ "$_naive" != 3 ] ; chk $? "컨트롤: naive grep -c 다중파일은 3을 못 낸다 (실제='$_naive' — 경로:개수 형태)"
|
|
169
196
|
|
|
197
|
+
echo ""
|
|
198
|
+
echo "── read-error ≠ zero 레인 (2026-08-26, cross-family/codex) ──"
|
|
199
|
+
# 주어가 «0건» 과 «못 읽었다» 를 가르는가. 가르기 전에는 읽기 실패가 0 으로 접혀
|
|
200
|
+
# "✅ ④-e no sub-agent dispatches tallied today" 라는 **안 잰 초록**이 나갔다.
|
|
201
|
+
DISP_LINE=$(grep -E "^DISPATCHED=" "$CHECK" | head -1)
|
|
202
|
+
_disp_with() { # $1 = TALLY 로 쓸 경로
|
|
203
|
+
bash -c "set -uo pipefail
|
|
204
|
+
_int() { case \"\${1:-}\" in (''|*[!0-9]*) echo 0 ;; (*) echo \"\$1\" ;; esac; }
|
|
205
|
+
. '$SUBJ_DEFS'
|
|
206
|
+
TODAY='$D'; TALLY='$1'
|
|
207
|
+
$DISP_LINE
|
|
208
|
+
printf %s \"\$DISPATCHED\"" 2>/dev/null
|
|
209
|
+
}
|
|
210
|
+
RE="$T/readerr"; mkdir -p "$RE/as_dir"
|
|
211
|
+
printf '%s\n' "$D" > "$RE/real_hit" # 오늘 1건
|
|
212
|
+
: > "$RE/real_zero" # 진짜 0건
|
|
213
|
+
_p=$(_disp_with "$RE/real_hit")
|
|
214
|
+
[ "$_p" = "1" ] ; chk $? "POS 계기 생존: 정상 tally 1건 → '$_p' (1 이어야 아래 판정이 읽힌다)"
|
|
215
|
+
_z=$(_disp_with "$RE/real_zero")
|
|
216
|
+
[ "$_z" = "0" ] ; chk $? "진짜 0건 → '$_z' (UNMEASURED 아님 — 부재가 아니라 실측된 0)"
|
|
217
|
+
_u=$(_disp_with "$RE/as_dir")
|
|
218
|
+
[ "$_u" = "UNMEASURED" ] ; chk $? "읽기 실패(디렉터리) → '$_u' (0 으로 접히면 안 잰 초록이 나간다)"
|
|
219
|
+
_n=$(_disp_with "$RE/nosuchfile")
|
|
220
|
+
[ "$_n" = "0" ] ; chk $? "파일 부재 → '$_n' — 세 번째 상태다. 안 쓰인 tally 는 «0 디스패치»이지 «못 읽음»이 아니다. UNMEASURED 로 두면 새 install 의 깨끗한 마감을 전부 false-block 하고, 과차단 close 게이트는 같은 훅의 Destructive-Op 게이트까지 무장해제시키는 --no-verify 반사를 훈련시킨다"
|
|
221
|
+
|
|
170
222
|
echo ""
|
|
171
223
|
if [ "$FAILED" -ne 0 ]; then echo "DISPATCH-LOG LANES: FAIL"; exit 1; fi
|
|
172
224
|
echo "DISPATCH-LOG LANES: PASS ($PASS/$PASS)"
|