@chrono-meta/fh-gate 3.29.0 β 3.31.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 +4 -4
- package/AGENTS.md +7 -2
- package/CLAUDE.md +1 -1
- package/README.ja.md +6 -5
- package/README.ko.md +6 -5
- package/README.md +15 -5
- package/README.zh.md +6 -5
- package/docs/REFERENCE.md +6 -5
- package/docs/USER_GUIDE.md +3 -0
- package/knowledge/shared/harness-core/claude_md_gate_details.md +1 -1
- package/knowledge/shared/harness-core/dispatch_conditional_prohibition.md +42 -0
- package/knowledge/shared/harness-core/sonnet_floor_doctrine.md +7 -0
- package/knowledge/shared/learnings/subagent_invocations_log.yaml +161 -0
- package/package.json +6 -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 +35 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL.md +25 -0
- package/plugins/fh-meta/skills/install-wizard/SKILL_detail.md +24 -6
- package/plugins/fh-meta/skills/phantom-quench/SKILL.md +1 -1
- package/plugins/fh-preprep/.claude-plugin/plugin.json +1 -1
- package/plugins/fh-qp/.claude-plugin/plugin.json +1 -1
- package/scripts/abstract_consult_check.py +573 -0
- package/scripts/fh_detach.py +444 -0
- package/scripts/mapped_tracks.sh +20 -13
- package/scripts/memory_gc_report.py +55 -5
- package/scripts/pr_merge_verified.sh +56 -8
- package/scripts/selfcheck.sh +85 -6
- package/scripts/session_checklist.py +3 -2
- package/scripts/session_close_check.sh +1 -1
- package/scripts/sim_isolated_run.sh +62 -0
- package/scripts/stale_ref_scan.py +47 -3
- package/scripts/test_abstract_consult_check_lanes.sh +201 -0
- package/scripts/test_fh_detach_lanes.sh +252 -0
- package/scripts/test_hook_source_gate_lanes.sh +16 -2
- package/scripts/test_mapped_tracks_lanes.sh +55 -1
- package/scripts/test_memory_gc_report_lanes.sh +91 -1
- package/scripts/test_mutation_probe_lanes.sh +86 -10
- package/scripts/test_ollama_panel_lanes.sh +107 -11
- package/scripts/test_pr_merge_verified_lanes.sh +48 -1
- package/scripts/test_prepush_real_fire_lanes.sh +215 -0
- package/scripts/test_selfcheck_state_lanes.sh +73 -1
- package/scripts/test_session_checklist_lanes.sh +34 -0
- package/scripts/test_sim_isolated_run_lanes.sh +88 -0
- package/scripts/test_stale_ref_scan_lanes.sh +11 -1
- package/templates/.git-hooks/pre-push +82 -1
- package/templates/CLAUDE.md +16 -0
|
@@ -16,7 +16,14 @@
|
|
|
16
16
|
# π₯ This script does not decide whether to merge. Approval is still yours β it only makes the
|
|
17
17
|
# verification impossible to forget once you do.
|
|
18
18
|
#
|
|
19
|
-
# USAGE bash scripts/pr_merge_verified.sh <pr-number> --rerun '<command>' [--repo <path>]
|
|
19
|
+
# USAGE bash scripts/pr_merge_verified.sh <pr-number> --rerun '<command>' [--repo <path>] [--lease '<label>']
|
|
20
|
+
# RECEIPT once GitHub has accepted the merge request (every outcome from there: verified Β· verify failed Β· queued/not completed Β·
|
|
21
|
+
# merged from another head Β· not fetchable β never for a refusal or a merge GitHub did not take) one JSON line goes to
|
|
22
|
+
# ${PMV_RECEIPTS:-<git common dir>/fh-merge-receipts.jsonl} β local, never pushed: pr Β· head Β· merge Β· outcome Β·
|
|
23
|
+
# actor (agent-session:claude-code when CLAUDECODE is set, else human-or-unknown β a human cannot be proven) Β·
|
|
24
|
+
# lease (the --lease label of the standing approval the caller merges under, else NONE β recorded, not enforced) Β· rerun.
|
|
25
|
+
# Why: arXiv:2610.28683 β 27% of merges that passed a Β«non-author reviewΒ» gate rested on an agent approving under a
|
|
26
|
+
# human account; who decided must be on the record, not inferred later (frontier digest 2026-10-23).
|
|
20
27
|
# EXIT 0 merged + verified Β· 1 merged but verify FAILED (the merge stands β act on it)
|
|
21
28
|
# 2 usage (nothing merged) Β· 3 trivial --rerun refused (nothing merged)
|
|
22
29
|
# 4 harness error (see message: before or after the merge)
|
|
@@ -26,13 +33,14 @@
|
|
|
26
33
|
# (gh non-zero but GitHub says MERGED β continue to verify; state unreadable β 4, outcome UNKNOWN)
|
|
27
34
|
|
|
28
35
|
set -uo pipefail
|
|
29
|
-
PR=""; RERUN=""; RERUN_SET=0; REPO="."
|
|
36
|
+
PR=""; RERUN=""; RERUN_SET=0; REPO="."; LEASE="NONE"
|
|
30
37
|
_need() { [ $# -ge 2 ] || { echo "π₯ $1 needs a value" >&2; exit 2; }; }
|
|
31
38
|
while [ $# -gt 0 ]; do
|
|
32
39
|
case "$1" in
|
|
33
40
|
--rerun) _need "$@"; RERUN="${2-}"; RERUN_SET=1; shift 2 ;;
|
|
34
41
|
--repo) _need "$@"; REPO="${2:-}"; shift 2 ;;
|
|
35
|
-
|
|
42
|
+
--lease) _need "$@"; LEASE="${2-}"; [ -n "$LEASE" ] || { echo "π₯ --lease needs a non-empty label" >&2; exit 2; }; shift 2 ;;
|
|
43
|
+
-h|--help) sed -n '2,30p' "$0"; exit 0 ;;
|
|
36
44
|
-*) echo "unknown arg: $1" >&2; exit 2 ;;
|
|
37
45
|
*) [ -z "$PR" ] || { echo "π₯ one PR number only" >&2; exit 2; }; PR="$1"; shift ;;
|
|
38
46
|
esac
|
|
@@ -48,6 +56,23 @@ bash "$PSV" --precheck --rerun "$RERUN" >/dev/null; _pc=$?
|
|
|
48
56
|
|
|
49
57
|
cd "$REPO" || { echo "π₯ HARNESS-ERROR (before merge): cannot cd $REPO" >&2; exit 4; }
|
|
50
58
|
|
|
59
|
+
# receipt (after GitHub accepted the merge request β a queued merge counts: the request was made under this actor/lease). Best-effort: a receipt that cannot be written is said, never silently skipped,
|
|
60
|
+
# and never changes the exit code β the merge already happened.
|
|
61
|
+
_receipt() { # outcome merge_oid
|
|
62
|
+
local f="${PMV_RECEIPTS:-}"
|
|
63
|
+
if [ -z "$f" ]; then local gd; gd=$(git rev-parse --git-common-dir 2>/dev/null) || gd=""; [ -n "$gd" ] && f="$gd/fh-merge-receipts.jsonl"; fi
|
|
64
|
+
local actor="human-or-unknown"; [ -n "${CLAUDECODE:-}" ] && actor="agent-session:claude-code"
|
|
65
|
+
if [ -z "$f" ] || ! PMV_R_PR="$PR" PMV_R_HEAD="$HEAD_OID" PMV_R_MERGE="${2:-}" PMV_R_OUT="$1" PMV_R_ACTOR="$actor" PMV_R_LEASE="$LEASE" \
|
|
66
|
+
PMV_R_RERUN="$RERUN" python3 -c 'import json,os,time
|
|
67
|
+
e=os.environ
|
|
68
|
+
print(json.dumps({"at":time.strftime("%Y-%m-%dT%H:%M:%S%z"),"pr":int(e["PMV_R_PR"]),"head":e["PMV_R_HEAD"],"merge":e["PMV_R_MERGE"] or None,
|
|
69
|
+
"outcome":e["PMV_R_OUT"],"actor":e["PMV_R_ACTOR"],"lease":e["PMV_R_LEASE"],"rerun":e["PMV_R_RERUN"]},ensure_ascii=False))' >> "$f" 2>/dev/null; then
|
|
70
|
+
echo "β οΈ merge receipt NOT written (${f:-no git dir}) β record by hand: PR #$PR $1 actor=$actor lease=$LEASE" >&2
|
|
71
|
+
else
|
|
72
|
+
echo "ββ receipt: $f (actor=$actor Β· lease=$LEASE Β· $1)"
|
|
73
|
+
fi
|
|
74
|
+
}
|
|
75
|
+
|
|
51
76
|
# 1. head before merge
|
|
52
77
|
HEAD_OID=$(gh pr view "$PR" --json headRefOid -q .headRefOid < /dev/null) || HEAD_OID=""
|
|
53
78
|
[ -n "$HEAD_OID" ] || { echo "π₯ HARNESS-ERROR (before merge): could not read PR #$PR head" >&2; exit 4; }
|
|
@@ -56,6 +81,28 @@ git cat-file -e "$HEAD_OID^{commit}" 2>/dev/null \
|
|
|
56
81
|
|| { echo "π₯ HARNESS-ERROR (before merge): PR head $HEAD_OID not fetchable β not merging" >&2; exit 4; }
|
|
57
82
|
echo "ββ PR #$PR head recorded: $HEAD_OID"
|
|
58
83
|
|
|
84
|
+
# 1b. coverage advisory β WARNING ONLY (never changes rc, never merges or refuses). post_squash_verify's precheck rejects a
|
|
85
|
+
# command that is trivially empty; it cannot see a command that is real but never touches this PR's files. Static, pre-merge,
|
|
86
|
+
# no execution: does any word of --rerun (or a tracked script it names) mention a path/basename this PR changes?
|
|
87
|
+
_changed=$(git -c core.quotepath=off diff --name-only "$(git merge-base origin/main "$HEAD_OID" 2>/dev/null || echo "$HEAD_OID^")" "$HEAD_OID" < /dev/null 2>/dev/null) || _changed=""
|
|
88
|
+
if [ -n "$_changed" ]; then
|
|
89
|
+
_hay="$RERUN"
|
|
90
|
+
set -f # split --rerun into words WITHOUT globbing it against the checkout (cross-family R1: `echo *` listed dirs)
|
|
91
|
+
for _w in $RERUN; do # unquoted on purpose: split into words; a word naming a tracked FILE adds that file's text (a runner script)
|
|
92
|
+
_w="${_w//[\"\';|&()]/}"
|
|
93
|
+
[ -n "$_w" ] && [ "$(git cat-file -t "$HEAD_OID:$_w" < /dev/null 2>/dev/null)" = blob ] \
|
|
94
|
+
&& _wc=$(git show "$HEAD_OID:$_w" < /dev/null 2>/dev/null) && _hay="$_hay $_wc"
|
|
95
|
+
done
|
|
96
|
+
set +f
|
|
97
|
+
_hay=" $(printf '%s' "$_hay" | tr -s '[:space:]"'"'"';|&()' ' ') "
|
|
98
|
+
_hit=0
|
|
99
|
+
while IFS= read -r _f; do
|
|
100
|
+
[ -n "$_f" ] || continue
|
|
101
|
+
case "$_hay" in *" $_f "*|*" $(basename "$_f") "*) _hit=1; break ;; esac
|
|
102
|
+
done <<< "$_changed"
|
|
103
|
+
[ "$_hit" -eq 1 ] || echo "β οΈ --rerun mentions none of this PR's $(printf '%s\n' "$_changed" | wc -l | tr -d ' ') changed file(s) (nor any script it names) β it may not exercise the change. Advisory only; merging continues." >&2
|
|
104
|
+
fi
|
|
105
|
+
|
|
59
106
|
# 2. merge
|
|
60
107
|
# π₯ cross-family W1: pin the merge to the head we RECORDED. Without it, a push landing between the
|
|
61
108
|
# record and the merge gets squashed in unverified, and Β«merged and verifiedΒ» describes a commit
|
|
@@ -76,7 +123,7 @@ if ! gh pr merge "$PR" --squash --delete-branch --admin --match-head-commit "$HE
|
|
|
76
123
|
MERGED)
|
|
77
124
|
# MERGED alone does not say WHICH head merged β someone may have pushed and merged after we
|
|
78
125
|
# recorded (codex A2). Only the recorded head may continue to verification.
|
|
79
|
-
[ "$HO" = "$HEAD_OID" ] || { echo "π₯ HARNESS-ERROR: gh pr merge failed, and PR #$PR is MERGED from head ${HO:-?}, not the recorded $HEAD_OID β NOT verified" >&2; exit 4; }
|
|
126
|
+
[ "$HO" = "$HEAD_OID" ] || { _receipt "merged-other-head-not-verified" ""; echo "π₯ HARNESS-ERROR: gh pr merge failed, and PR #$PR is MERGED from head ${HO:-?}, not the recorded $HEAD_OID β NOT verified" >&2; exit 4; }
|
|
80
127
|
echo "β οΈ gh pr merge exited non-zero; GitHub reports MERGED from the recorded head β continuing to verify" >&2
|
|
81
128
|
echo " the head branch may still exist on origin β delete it by hand if so" >&2 ;;
|
|
82
129
|
# π₯ a persistent OPEN cannot prove nothing merged (state may still be stale) β say what was seen
|
|
@@ -94,19 +141,20 @@ MC=$(gh pr view "$PR" --json mergeCommit -q .mergeCommit.oid < /dev/null) || MC=
|
|
|
94
141
|
if [ "$ST" != "MERGED" ] || [ -z "$MC" ] || [ "$MC" = "null" ]; then
|
|
95
142
|
echo "π₯ merge ACCEPTED but not completed (state=${ST:-?} mergeCommit=${MC:-none}) β queued or lagging." >&2
|
|
96
143
|
echo " NOT verified. When it lands: bash $PSV --tip $HEAD_OID --merge <merge commit> --rerun '<cmd>'" >&2
|
|
144
|
+
_receipt "accepted-not-completed" ""
|
|
97
145
|
exit 6
|
|
98
146
|
fi
|
|
99
147
|
git fetch -q origin < /dev/null 2>/dev/null || true
|
|
100
148
|
# W2 (B): a narrow/single-branch refspec may not bring the merge commit β ask for it by oid too
|
|
101
149
|
git cat-file -e "$MC^{commit}" 2>/dev/null || git fetch -q origin "$MC" < /dev/null 2>/dev/null || true
|
|
102
150
|
git cat-file -e "$MC^{commit}" 2>/dev/null \
|
|
103
|
-
|| { echo "π₯ HARNESS-ERROR (AFTER merge): merge commit $MC not fetchable β run post_squash_verify by hand with --tip $HEAD_OID --merge $MC" >&2; exit 4; }
|
|
151
|
+
|| { _receipt "merged-not-fetchable" "$MC"; echo "π₯ HARNESS-ERROR (AFTER merge): merge commit $MC not fetchable β run post_squash_verify by hand with --tip $HEAD_OID --merge $MC" >&2; exit 4; }
|
|
104
152
|
echo "ββ merged as $MC"
|
|
105
153
|
|
|
106
154
|
# 4. verify
|
|
107
155
|
bash "$PSV" --repo . --tip "$HEAD_OID" --merge "$MC" --rerun "$RERUN"; rc=$?
|
|
108
156
|
case "$rc" in
|
|
109
|
-
0) echo "β
PR #$PR merged and verified"; exit 0 ;;
|
|
110
|
-
1) echo "π₯ PR #$PR IS MERGED but verification FAILED β the merge stands; fix forward or revert" >&2; exit 1 ;;
|
|
111
|
-
*) echo "π₯ HARNESS-ERROR (AFTER merge): post_squash_verify rc=$rc β PR #$PR is merged, verification did not complete" >&2; exit 4 ;;
|
|
157
|
+
0) _receipt "verified" "$MC"; echo "β
PR #$PR merged and verified"; exit 0 ;;
|
|
158
|
+
1) _receipt "verify-failed" "$MC"; echo "π₯ PR #$PR IS MERGED but verification FAILED β the merge stands; fix forward or revert" >&2; exit 1 ;;
|
|
159
|
+
*) _receipt "verify-incomplete" "$MC"; echo "π₯ HARNESS-ERROR (AFTER merge): post_squash_verify rc=$rc β PR #$PR is merged, verification did not complete" >&2; exit 4 ;;
|
|
112
160
|
esac
|
package/scripts/selfcheck.sh
CHANGED
|
@@ -970,8 +970,12 @@ fi
|
|
|
970
970
|
# `SELFCHECK: FAIL` with no FAIL line in 6,236 lines β the killed suite fell into a bare `*)`
|
|
971
971
|
# that set fail and printed nothing (fh_signal_2026-10-18_selfcheck-timeout-unlabelled). The
|
|
972
972
|
# catch-all now names the suite and its rc, so no exit code can fail without a line.
|
|
973
|
-
_pair_rc_verdict() { # $1=label $2=subject $3=rc Β· return 1 = counts as a failure
|
|
974
|
-
|
|
973
|
+
_pair_rc_verdict() { # $1=label $2=subject $3=rc $4=budget seconds (optional) Β· return 1 = counts as a failure
|
|
974
|
+
# $4 defaults to the table's default rather than being required: the lane suite lifts this
|
|
975
|
+
# function and calls it with three arguments, and so does any future caller that has no budget
|
|
976
|
+
# of its own. A hardcoded "300" in the message below was wrong the moment budgets stopped being
|
|
977
|
+
# one number β a verdict line that names a limit the run did not use is a confident wrong fact.
|
|
978
|
+
local _lbl="$1" _subj="$2" _rc="$3" _bud="${4:-${_LANE_BUDGET_DEFAULT:-300}}"
|
|
975
979
|
case "$_rc" in
|
|
976
980
|
0) ;;
|
|
977
981
|
# The suite could not MEASURE. Distinguished from "the lane failed" because the two send a
|
|
@@ -990,9 +994,11 @@ _pair_rc_verdict() { # $1=label $2=subject $3=rc Β· return 1 = counts as a failu
|
|
|
990
994
|
echo " prove nothing about $_subj. Not a lane failure, and not a pass either."
|
|
991
995
|
return 1 ;;
|
|
992
996
|
124)
|
|
993
|
-
echo "TIMEOUT $_lbl: exited 124, the code \`timeout\` uses when it kills a suite (
|
|
997
|
+
echo "TIMEOUT $_lbl: exited 124, the code \`timeout\` uses when it kills a suite (budget ${_bud} s) β"
|
|
994
998
|
echo " not measured, not a pass. A suite that itself exits 124 lands here too."
|
|
995
999
|
echo " Re-run that suite alone to see whether it hangs or is only slow under load."
|
|
1000
|
+
echo " If it needs longer than ${_bud} s on a healthy host, raise ITS budget in"
|
|
1001
|
+
echo " _lane_budget() with the measurement that set the number β do not raise the default."
|
|
996
1002
|
return 1 ;;
|
|
997
1003
|
*)
|
|
998
1004
|
echo "FAIL $_lbl (rc=$_rc) β see that suite's output above; subject: $_subj"
|
|
@@ -1000,7 +1006,44 @@ _pair_rc_verdict() { # $1=label $2=subject $3=rc Β· return 1 = counts as a failu
|
|
|
1000
1006
|
esac
|
|
1001
1007
|
return 0
|
|
1002
1008
|
}
|
|
1003
|
-
|
|
1009
|
+
# Per-suite lane budget (2026-10-26). Until today every suite in the loop below ran under one
|
|
1010
|
+
# global `timeout 300`, and that number was invisible: nothing printed how long a suite took, so
|
|
1011
|
+
# the only way to learn a suite was near the limit was for it to cross it.
|
|
1012
|
+
#
|
|
1013
|
+
# MEASURED, in a clean cloud container on 2026-10-26: test_mutation_probe_lanes.sh takes 318β322 s
|
|
1014
|
+
# standalone (3 reps, 122 lanes, all green) and selfcheck killed it at 300. Neither the suite nor
|
|
1015
|
+
# its subject (scripts/mutation_probe.py) had changed since the run where it last passed β the host
|
|
1016
|
+
# got slower, the margin was never managed, and the result was one TIMEOUT line standing in for 122
|
|
1017
|
+
# known-pair lanes that went UNMEASURED. Timestamping the suite showed the cost is spread across it
|
|
1018
|
+
# (largest single block +40 s), so "make it faster" is not a small fix and would not be this one.
|
|
1019
|
+
#
|
|
1020
|
+
# So: the budget is per suite, declared next to the measurement that set it, and the loop prints an
|
|
1021
|
+
# advisory line BEFORE the kill when a run eats most of its budget. The default stays 300 β a suite
|
|
1022
|
+
# that needs more says so by name, which is the record a reader can argue with.
|
|
1023
|
+
_LANE_BUDGET_DEFAULT=300
|
|
1024
|
+
_LANE_BUDGET_WARN_PCT=80 # advisory at β₯80% of budget; advisory only, never a verdict
|
|
1025
|
+
_lane_budget() { # $1=label β budget in seconds
|
|
1026
|
+
case "$1" in
|
|
1027
|
+
# 318β322 s measured standalone (above). 600 is ~1.9Γ the measured cost: enough head-room for a
|
|
1028
|
+
# host slower than this one, and still a bound β not "no timeout", which is how the suite that
|
|
1029
|
+
# detects a broken watchdog would inherit a hang (see the loop's own comment below).
|
|
1030
|
+
test_mutation_probe_lanes.sh) echo 600 ;;
|
|
1031
|
+
*) echo "${_LANE_BUDGET_DEFAULT}" ;;
|
|
1032
|
+
esac
|
|
1033
|
+
}
|
|
1034
|
+
# A run that finished INSIDE its budget but close to it is the state nobody saw last week. It is an
|
|
1035
|
+
# advisory, printed and not counted: a suite at 85% of budget has measured everything it claims to,
|
|
1036
|
+
# and folding "nearly ran out" into FAIL would be the same untyped-verdict defect in the other
|
|
1037
|
+
# direction. `date` only β /usr/bin/time is absent in some containers (measured rc=127 here).
|
|
1038
|
+
_lane_margin_note() { # $1=label $2=elapsed s $3=budget s
|
|
1039
|
+
local _lbl="$1" _el="$2" _bud="$3" _pct
|
|
1040
|
+
[ "$_bud" -gt 0 ] 2>/dev/null || return 0
|
|
1041
|
+
_pct=$(( _el * 100 / _bud ))
|
|
1042
|
+
[ "$_pct" -ge "${_LANE_BUDGET_WARN_PCT:-80}" ] || return 0
|
|
1043
|
+
echo "NOTE $_lbl took ${_el} s of its ${_bud} s budget (${_pct}%) β it PASSED; this is margin,"
|
|
1044
|
+
echo " not a failure. A slower host crosses the limit and the suite's lanes go UNMEASURED."
|
|
1045
|
+
}
|
|
1046
|
+
_LANE_TO=""; command -v timeout >/dev/null 2>&1 && _LANE_TO="timeout ${_LANE_BUDGET_DEFAULT}"
|
|
1004
1047
|
for _pair in \
|
|
1005
1048
|
`# μ¬μ© μμ₯ (2026-09-13 μ μ€). SUBJECT λ₯Ό μμ₯ λͺ¨λλ‘ μ‘λλ€ β λ°°μ μ΄ λκΈ°λ μ리λ preprep.py μ __main__ ν μ€μ΄ μλλΌ λͺ¨λμ΄ μ¬λΌμ§λ μͺ½μ΄κ³ , import κ° try/except λΌ λͺ¨λμ΄ μμΌλ©΄ μ‘°μ©ν 무λμμΌλ‘ λμκ°λ€. κ·Έ 무μμ΄ μ΄ λ μΈμ΄ μ‘μ κ²μ΄λ€.` \
|
|
1006
1049
|
"plugins/fh-preprep/skills/preprep/usage_ledger.py|scripts/test_usage_ledger_lanes.sh" \
|
|
@@ -1014,6 +1057,8 @@ for _pair in \
|
|
|
1014
1057
|
"scripts/destructive_pre_gate.sh|scripts/test_destructive_pre_gate_lanes.sh" \
|
|
1015
1058
|
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_lanes.sh" \
|
|
1016
1059
|
"templates/.git-hooks/pre-push|scripts/test_prepush_destructive_liveness.sh" \
|
|
1060
|
+
`# μ€μ git push λ°ν λ μΈ (2026-10-24, νμ νλ€μ€ νμ ). ν©μ± stdin λ μΈμ Β«νμ Β» λ§ μ°λ€ β μ΄ λ μΈμ git μ΄ κ·Έ λμμμ ν
μ Β«λΆλ₯΄λκ° Β· κ·Έ μ€μ λκΈ°λκ°Β» λ₯Ό μ°λ€. --mirror λ μμ μ€μ μ λκΈ΄λ€(μ€μΈ‘).` \
|
|
1061
|
+
"templates/.git-hooks/pre-push|scripts/test_prepush_real_fire_lanes.sh" \
|
|
1017
1062
|
`# ββ μ¦κ±° vs νμ ν ν° μΆ©λ(2026-09-19). SUBJECT λ ν
μ΄ μλλΌ Β«λλλ¦Ό νλ‘λΈ μμ Β»μ΄λ€ β μ΄ λ μΈμ΄ μ¬λ κ²μ κ²μ΄νΈμ λμμ΄ μλλΌ κ·Έ νλ‘λΈμ Β«μΆλ ₯ κ³μ½Β»(μκΈ°κ° authored ν μ€μλ§ β λ₯Ό μ΄λ€)μ΄κ³ , μ΄ μ§κ³κΈ°κ° β λ‘ μ€ν¨λ₯Ό νμ νλ―λ‘ λμ΄ κ°μ μ±λμ 곡μ νλ€. μ€μΈ‘: run 35426860480 μ λ‘κ·Έλ₯Ό μ¬λμ΄ λ λ² μ°μ μ€κ·μνλ€ ββ` \
|
|
1018
1063
|
"scripts/test_prepush_destructive_liveness.sh|scripts/test_liveness_echo_token_lanes.sh" \
|
|
1019
1064
|
"templates/.git-hooks/pre-push|scripts/test_push_zone_lanes.sh" \
|
|
@@ -1151,8 +1196,16 @@ do
|
|
|
1151
1196
|
# --self-test loop below, because `timeout` is GNU coreutils and stock macOS has neither it nor
|
|
1152
1197
|
# a substitute; without it `< /dev/null` is the whole defence and a suite that reads stdin ends
|
|
1153
1198
|
# immediately instead of waiting forever.
|
|
1154
|
-
|
|
1155
|
-
|
|
1199
|
+
# The budget is resolved per suite into a LOCAL variable; `$_LANE_TO` keeps the default and is
|
|
1200
|
+
# read again by two blocks far below this loop (relay_channel, directional_diff_gate), so
|
|
1201
|
+
# reassigning it here would silently hand one suite's budget to unrelated dispatches.
|
|
1202
|
+
_bud="$(_lane_budget "$_lbl")"
|
|
1203
|
+
_lane_to=""; command -v timeout >/dev/null 2>&1 && _lane_to="timeout $_bud"
|
|
1204
|
+
_t0=$(date +%s 2>/dev/null || echo 0)
|
|
1205
|
+
$_lane_to bash "$_anc" < /dev/null; _rc=$?
|
|
1206
|
+
_t1=$(date +%s 2>/dev/null || echo 0)
|
|
1207
|
+
[ "$_t0" -gt 0 ] 2>/dev/null && _lane_margin_note "$_lbl" "$(( _t1 - _t0 ))" "$_bud"
|
|
1208
|
+
_pair_rc_verdict "$_lbl" "$_subj" "$_rc" "$_bud" || fail=1
|
|
1156
1209
|
elif _pkg_accepted_absent "$_anc"; then
|
|
1157
1210
|
# DECLARED legitimately unshipped β the single source for that answer, not a guess from the
|
|
1158
1211
|
# environment. The first draft printed "this package predates it", which is a WRONG DIAGNOSIS
|
|
@@ -2259,6 +2312,32 @@ else
|
|
|
2259
2312
|
fail=1
|
|
2260
2313
|
fi
|
|
2261
2314
|
|
|
2315
|
+
# κ°λ¦° μ§λ¬Έ μ‘μ μ κ²μ¬(κ±°μ£Ό μμΉ μΈ λ²μ§Έ κΈΈ, D1) β λ ν¬ μλ³μ Β· μμ±μ Β· μλ¬Έ μ‘°κ° Β· μ΄μμ 리ν°λ΄(μ κ°λ μ¬μ¬μ©).
|
|
2316
|
+
# λ μΈμ΄ κ±Έλ¦Ό/ν΅κ³Ό μλ μκ³Ό λ―ΈμΈ‘μ 6κ°λ(μ¬μ Β· κ°λ Β· λ ν¬ Β· λΉ λͺ©λ‘ Β· λΉ μ§λ¬Έ Β· κ³΅κ° λ§λμΉ)λ₯Ό κ°μ΄ μ°λ€. νΈμΆμ 0 β κΈ°λ³Έ κΊΌμ§.
|
|
2317
|
+
if [ ! -f scripts/abstract_consult_check.py ]; then
|
|
2318
|
+
_absent_subject_verdict "test_abstract_consult_check_lanes.sh" "scripts/abstract_consult_check.py" || fail=1
|
|
2319
|
+
elif [ -f scripts/test_abstract_consult_check_lanes.sh ]; then
|
|
2320
|
+
if ! bash scripts/test_abstract_consult_check_lanes.sh; then
|
|
2321
|
+
fail=1
|
|
2322
|
+
fi
|
|
2323
|
+
else
|
|
2324
|
+
echo "FAIL test_abstract_consult_check_lanes.sh: abstract_consult_check.py present but its anchor is missing"
|
|
2325
|
+
fail=1
|
|
2326
|
+
fi
|
|
2327
|
+
|
|
2328
|
+
# λΌκΈ° β install-wizard κ° μ΄ νμ λ§ λλλ¦°λ€. λ μΈμ λ§λ²μ¬ λ¬Έμμ μ€μΉ λΈλ‘μ κ·Έλλ‘ λ½μ μμ HOME μμ λλ¦¬κ³ ,
|
|
2329
|
+
# λΌκΈ° λ€ νΈλ¦¬κ° μ€μΉ μ κ³Ό λ°μ΄νΈκΉμ§ κ°μμ§ λ³Έλ€(μ¬μ©μ μκΈ° ν
Β· κ³ μΉ λ³΅μ¬λ³Έ Β· μ ν ν
μ λ¨κΈ°κ³ LEFT).
|
|
2330
|
+
if [ ! -f scripts/fh_detach.py ]; then
|
|
2331
|
+
_absent_subject_verdict "test_fh_detach_lanes.sh" "scripts/fh_detach.py" || fail=1
|
|
2332
|
+
elif [ -f scripts/test_fh_detach_lanes.sh ]; then
|
|
2333
|
+
if ! bash scripts/test_fh_detach_lanes.sh; then
|
|
2334
|
+
fail=1
|
|
2335
|
+
fi
|
|
2336
|
+
else
|
|
2337
|
+
echo "FAIL test_fh_detach_lanes.sh: fh_detach.py present but its anchor is missing"
|
|
2338
|
+
fail=1
|
|
2339
|
+
fi
|
|
2340
|
+
|
|
2262
2341
|
# outbound-query PreToolUse ν
β μ CLI κ°λμ **λ°°μ **(WebSearch|WebFetch). λ μΈμ΄ λ μΈ΅ νμ
|
|
2263
2342
|
# (overrideβdeny Β· defaultsβadvisory), λ―ΈμΈ‘μ 4κ°μ§βdeny, N/A 무μ, κ·Έλ¦¬κ³ π₯ Β«μΆλ ₯μ ν ν° κ°μ΄
|
|
2264
2343
|
# μλ€Β»(H10)λ₯Ό κ°κ° μ§μΌλ‘ μ‘λλ€. λ§μ§λ§ κ²μ΄ μ΄ ν
μ μ‘΄μ¬ μ΄μ λ₯Ό μ§ν€λ λ μΈμ΄λ€.
|
|
@@ -962,7 +962,8 @@ def do_unblocked(file_path):
|
|
|
962
962
|
rid = re.sub(r"[^A-Za-z0-9]", "", cells[idx_num]).upper()
|
|
963
963
|
if not rid:
|
|
964
964
|
continue
|
|
965
|
-
|
|
965
|
+
# an empty/invalid status cell classifies to None β that row is open (idle), never a crash
|
|
966
|
+
keys = classify_status(cells[idx_status] if idx_status < len(cells) else "") or set()
|
|
966
967
|
status_by_id[rid] = keys
|
|
967
968
|
rows_flat.append((rid, keys, cells))
|
|
968
969
|
|
|
@@ -973,7 +974,7 @@ def do_unblocked(file_path):
|
|
|
973
974
|
# open rows collapsed two different nothings into the same rc=4: "every dependency was
|
|
974
975
|
# resolved and closed" and "nobody ever wrote a dependency". The first is a clean run; the
|
|
975
976
|
# second is an unread channel. (Β«not foundΒ» is not Β«0Β» β the named family in this repo.)
|
|
976
|
-
idle = not ("DONE" in keys or "
|
|
977
|
+
idle = not ("DONE" in keys or "N/A" in keys) # classify_status returns the key "N/A", never "n/a"
|
|
977
978
|
joined = " | ".join(cells)
|
|
978
979
|
for m in DEP_RE.finditer(joined):
|
|
979
980
|
dep = m.group(1).upper()
|
|
@@ -967,7 +967,7 @@ else
|
|
|
967
967
|
_sr_uns=$(printf '%s' "$_sr_v" | sed -n 's/.*UNSCANNABLE=\([0-9]*\).*/\1/p')
|
|
968
968
|
if [ "${_sr_sup:-0}" -gt 0 ] 2>/dev/null; then
|
|
969
969
|
echo "β οΈ β -g stale-ref: ${_sr_sup} κ° id κ° νκΈ°λ λ²μ μ κ°λ¦¬ν¨λ€ β advisory, λ§μ§ μλλ€."
|
|
970
|
-
echo " π₯ μλν pin μΌ μ μλ€ β λμΌλ‘ νμΈνκ³ κ³ μ³λΌ(
|
|
970
|
+
echo " π₯ μλν pin μΌ μ μλ€ β λμΌλ‘ νμΈνκ³ κ³ μ³λΌ(λ°ν μ€λ
μ·μ΄λ©΄ νμΌ μ²«λ¨Έλ¦¬μ '<!-- stale-ref: pinned -->', μ νμ μΌλΆλ¬ κ°λ¦¬ν€λ ν μ€μ΄λ©΄ κ·Έ μ€μ '<!-- stale-ref: pinned-line=<id> -->'). μΌλΆλ¬ λΉ¨κ°κ² λ κ²(μ: replace μ arXiv ν)μ κ·Έλλ‘ λλ€."
|
|
971
971
|
printf '%s\n' "$_sr_out" | grep -E '^ +π₯ SUPERSEDED' | sed 's/^/ /'
|
|
972
972
|
fi
|
|
973
973
|
if [ "${_sr_unr:-0}" -gt 0 ] 2>/dev/null || [ "${_sr_uns:-0}" -gt 0 ] 2>/dev/null; then
|
|
@@ -532,6 +532,67 @@ fh_timeout() {
|
|
|
532
532
|
OUTDIR="${OUTDIR:-$(mktemp -d "${TMPDIR:-/tmp}/fh-sim-XXXXXX")}"
|
|
533
533
|
mkdir -p "$OUTDIR"
|
|
534
534
|
|
|
535
|
+
# ββ ancestor-instruction guard (2026-10-23) βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
536
|
+
# π₯ Every arm's clone lives under $OUTDIR, and `claude -p` loads CLAUDE.md / CLAUDE.local.md / .claude/rules
|
|
537
|
+
# from EVERY ancestor of its cwd. An --out inside a checkout (e.g. tracks/_meta/<exp>/out) therefore hands
|
|
538
|
+
# every arm the LIVE repo's instructions on top of the clone's own β measured 2026-10-23 with a known pair:
|
|
539
|
+
# under the FH checkout 3 instruction files, under /private/tmp NONE. A whole experiment series
|
|
540
|
+
# (P8/P8b/P9) ran that way; agents then edited the live repos by absolute path. Refuse before any arm
|
|
541
|
+
# starts (and again per rep for the wrapper the clone actually lands in β a pre-existing w_* can carry
|
|
542
|
+
# its own CLAUDE.md, codex R1). A bare .git is NOT an instruction source and is not refused (codex R1).
|
|
543
|
+
# FH_SIM_ALLOW_INHERIT=1 is the logged override for a run that WANTS the inheritance.
|
|
544
|
+
# --out is resolved to an absolute physical path once, so the walk below and every later `$OUTDIR/...`
|
|
545
|
+
# (including redirects made from inside `cd "$WORK"`) see the same place (Gemini R1: relative --out,
|
|
546
|
+
# logical vs physical symlink paths). An unresolvable --out stops here instead of looping on `dirname ""`.
|
|
547
|
+
OUTDIR=$(cd "$OUTDIR" 2>/dev/null && pwd -P) || { echo "FAIL: --out could not be resolved" >&2; exit 2; }
|
|
548
|
+
[ -n "$OUTDIR" ] || { echo "FAIL: --out resolved to an empty path" >&2; exit 2; }
|
|
549
|
+
# π₯ μ¬μ©μ μ€μ λλ ν°λ¦¬(${CLAUDE_CONFIG_DIR:-$HOME/.claude})λ λͺ¨λ νμ΄ μ΄μ°¨νΌ μ£λλ€ β μν¬κ° κ·Έ .claude μ λΆλͺ¨(λ³΄ν΅ $HOME)μ
|
|
550
|
+
# λΏμμ λ κ·Έ μμ CLAUDE.md/CLAUDE.local.md/AGENTS.md/rules λ hit κ° μλλ€(μλ μ 보 μ€μ΄ ν λ² μ°λλ€). $HOME μ μ§μ λμΈ
|
|
551
|
+
# CLAUDE.md λ μ¬μ ν hit. 물리 κ²½λ‘(pwd -P)λ‘ λΉκ΅ν΄ μ¬λ³Όλ¦ HOME/μ€μ λλ ν°λ¦¬λ κ°κ² λμνλ€.
|
|
552
|
+
_user_cfg="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
|
|
553
|
+
_user_cfg_phys=$(cd "$_user_cfg" 2>/dev/null && pwd -P) || _user_cfg_phys=""
|
|
554
|
+
FH_SIM_REPORTED_HITS=" " # μ΄λ―Έ κ²½κ³ ν hit β --reps N μμ κ°μ κ²½κ³ λ₯Ό λ§€ rep λ°λ³΅νμ§ μλλ€
|
|
555
|
+
fh_sim_instr_hits() { # $1=absolute dir β prints instruction sources in $1 and every ancestor (space-separated)
|
|
556
|
+
local d="$1" n hits="" skipclaude cp
|
|
557
|
+
while [ -n "$d" ]; do
|
|
558
|
+
skipclaude=0
|
|
559
|
+
if [ -n "$_user_cfg_phys" ] && [ -d "$d/.claude" ]; then
|
|
560
|
+
cp=$(cd "$d/.claude" 2>/dev/null && pwd -P) && [ "$cp" = "$_user_cfg_phys" ] && skipclaude=1
|
|
561
|
+
fi
|
|
562
|
+
for n in CLAUDE.md CLAUDE.local.md .claude/CLAUDE.md .claude/CLAUDE.local.md AGENTS.md .claude/AGENTS.md; do # not GEMINI.md: Claude does not load it (codex R2)
|
|
563
|
+
case "$n" in .claude/*) [ "$skipclaude" = 1 ] && continue ;; esac
|
|
564
|
+
[ -e "$d/$n" ] && hits="$hits $d/$n"
|
|
565
|
+
done
|
|
566
|
+
if [ "$skipclaude" = 0 ] && [ -d "$d/.claude/rules" ] && [ -n "$(find -L "$d/.claude/rules" -name '*.md' -print 2>/dev/null | head -1)" ]; then # -L: symlinked rules dirs load too (codex R2)
|
|
567
|
+
hits="$hits $d/.claude/rules/"
|
|
568
|
+
fi
|
|
569
|
+
[ "$d" = "/" ] && break
|
|
570
|
+
d=$(dirname "$d")
|
|
571
|
+
done
|
|
572
|
+
printf '%s' "$hits"
|
|
573
|
+
}
|
|
574
|
+
fh_sim_refuse_inherit() { # $1=dir $2=what β returns 0 to proceed, exits 2 on refusal
|
|
575
|
+
local hits h newhits=""; hits=$(fh_sim_instr_hits "$1")
|
|
576
|
+
[ -z "$hits" ] && return 0
|
|
577
|
+
if [ "${FH_SIM_ALLOW_INHERIT:-0}" = 1 ]; then
|
|
578
|
+
for h in $hits; do
|
|
579
|
+
case "$FH_SIM_REPORTED_HITS" in *" $h "*) ;; *) newhits="$newhits $h"; FH_SIM_REPORTED_HITS="$FH_SIM_REPORTED_HITS$h " ;; esac
|
|
580
|
+
done
|
|
581
|
+
[ -n "$newhits" ] && echo "β οΈ FH_SIM_ALLOW_INHERIT=1 β arms WILL inherit ($2):$newhits" >&2
|
|
582
|
+
return 0
|
|
583
|
+
fi
|
|
584
|
+
echo "π₯ REFUSED: $2 ($1) sits under instruction files β every arm would load them:$hits" >&2
|
|
585
|
+
echo " use an --out outside any checkout and outside \$HOME (default: mktemp under \$TMPDIR), or FH_SIM_ALLOW_INHERIT=1 if inheritance is the point" >&2
|
|
586
|
+
exit 2
|
|
587
|
+
}
|
|
588
|
+
fh_sim_refuse_inherit "$OUTDIR" "--out"
|
|
589
|
+
# User-level instructions load for every project whatever the cwd β not refused (identical for every arm),
|
|
590
|
+
# but printed so a reader of the run knows they were there (codex R1).
|
|
591
|
+
_user_instr=""
|
|
592
|
+
[ -e "$_user_cfg/CLAUDE.md" ] && _user_instr="$_user_instr $_user_cfg/CLAUDE.md"
|
|
593
|
+
[ -d "$_user_cfg/rules" ] && [ -n "$(find -L "$_user_cfg/rules" -name '*.md' -print 2>/dev/null | head -1)" ] && _user_instr="$_user_instr $_user_cfg/rules/"
|
|
594
|
+
[ -n "$_user_instr" ] && echo "βΉοΈ user-level instructions load in every arm (same for all, not refused):$_user_instr" >&2
|
|
595
|
+
|
|
535
596
|
# ββ machine-surface snapshot ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
536
597
|
# Enumerated, not guessed. Each line is a surface a past run actually touched or plausibly could.
|
|
537
598
|
# `not found` is written as `ABSENT`, never as an empty string β an unreadable surface and an
|
|
@@ -581,6 +642,7 @@ for r in $(seq 1 "$REPS"); do
|
|
|
581
642
|
# isolated, but their EXISTENCE leaked into the arm's reasoning, which is enough to change an
|
|
582
643
|
# answer about "what projects are around". Isolation has to hold for the parent too.
|
|
583
644
|
WRAP="$OUTDIR/w_${ARM}_r${r}"; mkdir -p "$WRAP"
|
|
645
|
+
fh_sim_refuse_inherit "$(cd "$WRAP" && pwd -P)" "rep wrapper" # a pre-existing w_* may carry its own instructions
|
|
584
646
|
WORK="$WRAP/repo"
|
|
585
647
|
# A disposable clone per REP, not per arm: two reps of the same arm contaminate each other
|
|
586
648
|
# exactly as two different arms do. That was the measured failure β reps 1 and 2 of build_cron.
|
|
@@ -95,7 +95,16 @@ CHANGELOG_WORD_RE = re.compile(_CL_WORDS, re.IGNORECASE)
|
|
|
95
95
|
#: λλ―λ‘ κ΅¬μ‘°μ μΌλ‘ μ리 λΆκ°λ₯ν SUPERSEDED λ₯Ό μꡬν λΈλ€(μ λκ²μ¦ A-5: μ΄ λ ν¬μλ§ μ
).
|
|
96
96
|
#: λ§μ‘± λΆκ°λ₯ν μꡬλ override λ₯Ό νλ ¨μν€λ―λ‘, νμΌμ΄ μ€μ€λ‘ Β«μ΄κ±΄ μ€λ
μ·μ΄λ€Β» λΌκ³
|
|
97
97
|
#: λ§ν μλ¨μ μ€λ€. π₯ **νμΌλͺ
μΆλ‘ μ΄ μλλΌ Β«νμΌμ΄ μ μΈν κ²Β»** μ΄λ€ β μΆλ‘ μ μ‘°μ©ν νλ¦°λ€.
|
|
98
|
-
|
|
98
|
+
#: π₯ (2026-10-23) μ μΈμ **HTML μ£Όμ μμμλ§**, λ±λ§μ **κ²½κ³κΉμ§**: μ°λ¬Έμ΄ λ§μ»€ λ¬Έλ²μ μΈκΈλ§ ν΄λ
|
|
99
|
+
#: νμΌμ΄ ν΅μ§Έλ‘ κΊΌμ§λ κ²(Argon R1 #4)κ³Ό `pinned-off` Β· `pinned_line` κ°μ μ λ μΌμΉ(#2)λ₯Ό λ«λλ€.
|
|
100
|
+
PIN_MARKER_RE = re.compile(r"<!--\s*stale-ref:\s*pinned(?=\s|-->)", re.IGNORECASE)
|
|
101
|
+
#: π₯ **μ€ λ¨μ pin (2026-10-23).** μ΄μ μλ λ¬Έμ μμμ Β«v1 λ
Όλ¬Έμ μ μ΄λ¦μ μ΄λ€Β» μ²λΌ μ νμ
|
|
102
|
+
#: μΌλΆλ¬ κ°λ¦¬ν€λ ν μ€ λλ¬Έμ νμΌ μ 체λ₯Ό pin νλ©΄, κ·Έ νμΌμ λ€μ μκΈ°λ μ§μ§ λ‘μ μΈμ©κΉμ§ 묻νλ€.
|
|
103
|
+
#: νμ `<!-- stale-ref: pinned-line=<id>[,<id>] -->` β **μ΄λ¦ λΆμΈ id λ§** κ·Έ μ€μμ κΈ°λ‘μΌλ‘ μΉλ€.
|
|
104
|
+
#: κ°μ μ€(νμ ν ν)μ λ€λ₯Έ DOI λ μ΄μ μλ€(Argon R1 #3). id μλ νμ Β· `pinned-lines` Β·
|
|
105
|
+
#: `pinned-line-disabled` λ μ μΈμ΄ μλλ€(μ λ μΌμΉλ λ‘μ μΈμ©μ μ‘°μ©ν μ¨κΈ΄λ€, codex R1). `-->`
|
|
106
|
+
#: μ 곡백μ μμ΄λ λλ€(Argon R1 #1). μ€ pin μ `pinned` λ€κ° `-` λΌ νμΌ pin μΌλ‘ λ²μ§μ§ μλλ€(β-3).
|
|
107
|
+
LINE_PIN_RE = re.compile(r"<!--\s*stale-ref:\s*pinned-line=(\d+(?:,\d+)*)\s*-->", re.IGNORECASE)
|
|
99
108
|
|
|
100
109
|
#: λͺ» μ½μ μ
λ ₯μ νλ³ β NUL λ°μ΄νΈ λλ λμ½λ μ€ν¨μ¨. μ λκ²μ¦ S-1.
|
|
101
110
|
UNSCANNABLE_REPLACEMENT_RATIO = 0.02
|
|
@@ -143,7 +152,8 @@ def scan_body(path, lines):
|
|
|
143
152
|
for the printed snippet. `in_changelog` reflects the flag's state AFTER this line is checked for a
|
|
144
153
|
heading, so a heading line itself and everything after it (same file) are marked True."""
|
|
145
154
|
in_changelog = False
|
|
146
|
-
pinned
|
|
155
|
+
# μ 40μ€μ ν©μ³μ μ°Ύλλ€ β μ£Όμμ΄ `<!--` / `stale-ref: pinned` / `-->` λ‘ μ¬λ¬ μ€μ κ±Έμ³λ μ μΈμ΄λ€(codex R2)
|
|
156
|
+
pinned = bool(PIN_MARKER_RE.search("\n".join(lines[:40])))
|
|
147
157
|
sites = []
|
|
148
158
|
for i, line in enumerate(lines, 1):
|
|
149
159
|
if is_changelog_heading(line):
|
|
@@ -151,9 +161,11 @@ def scan_body(path, lines):
|
|
|
151
161
|
if pinned:
|
|
152
162
|
in_changelog = True # μ€λ
μ· νμΌ μ 체λ₯Ό Β«κΈ°λ‘Β» μΌλ‘ μ·¨κΈ
|
|
153
163
|
flat = TAG_RE.sub("", line)
|
|
164
|
+
# μλ¬Έ μ€μμ μ°Ύλλ€ β λ§μ»€κ° HTML μ£Όμμ΄λΌ TAG_RE κ° μ§μ΄λ€
|
|
165
|
+
line_pinned = {x for m in LINE_PIN_RE.finditer(line) for x in m.group(1).split(",")}
|
|
154
166
|
for m in ZID_RE.finditer(flat):
|
|
155
167
|
snippet = line.strip()[:140]
|
|
156
|
-
sites.append((i, m.group(1), snippet, in_changelog))
|
|
168
|
+
sites.append((i, m.group(1), snippet, in_changelog or m.group(1) in line_pinned))
|
|
157
169
|
return sites
|
|
158
170
|
|
|
159
171
|
|
|
@@ -355,6 +367,38 @@ def run_self_check():
|
|
|
355
367
|
got = [(r, inc) for _, r, _, inc in scan_body("x.html", pin)]
|
|
356
368
|
lane("exclude: 'stale-ref: pinned' marks the whole file a record", got == [("20397566", True)], str(got))
|
|
357
369
|
|
|
370
|
+
# β-2 μ€ pin β κ·Έ μ€μ Β«μ΄λ¦ λΆμΈ idΒ» λ§ κΈ°λ‘, κ°μ νμΌμ λ€λ₯Έ μΈμ©μ μ΄μ μλ€
|
|
371
|
+
lp = ['The v1 paper (Zenodo 10.5281/zenodo.20397566) cites the old name <!-- stale-ref: pinned-line=20397566 -->',
|
|
372
|
+
'cite 10.5281/zenodo.22542168 for the method']
|
|
373
|
+
got = [(r, inc) for _, r, _, inc in scan_body("x.md", lp)]
|
|
374
|
+
lane("exclude: 'pinned-line=<id>' excludes only that id on its own line",
|
|
375
|
+
got == [("20397566", True), ("22542168", False)], str(got))
|
|
376
|
+
|
|
377
|
+
# β-3 π₯ known-NEGATIVE β μ 40μ€ μμ μ€ pin μ΄ νμΌ pin μΌλ‘ λ²μ§μ§ μλλ€(κ°μ id κ° μλ μ€μ λ€μ)
|
|
378
|
+
got = [inc for _, _, _, inc in scan_body("x.md", lp[:1] + ['later 10.5281/zenodo.20397566 again'])]
|
|
379
|
+
lane("exclude NEG: a line pin is not a file pin", got == [True, False], str(got))
|
|
380
|
+
|
|
381
|
+
# β-4 π₯ known-NEGATIVE β μ μΈμ΄ μλ κ²λ€: κΈ΄ λ±λ§ Β· id μμ Β· μ°λ¬Έ μΈκΈ Β· νμΌ pin μ λ
|
|
382
|
+
near = ['a 10.5281/zenodo.20397566 <!-- stale-ref: pinned-line-disabled -->',
|
|
383
|
+
'b 10.5281/zenodo.20397566 <!-- stale-ref: pinned-lines=20397566 -->',
|
|
384
|
+
'c 10.5281/zenodo.20397566 <!-- stale-ref: pinned-line -->',
|
|
385
|
+
'd 10.5281/zenodo.20397566 write `stale-ref: pinned-line=20397566` to pin a line']
|
|
386
|
+
got = [inc for _, _, _, inc in scan_body("x.md", near)]
|
|
387
|
+
lane("exclude NEG: near-miss / id-less / prose markers are not line pins", got == [False] * 4, str(got))
|
|
388
|
+
for fp in ('<!-- stale-ref: pinned-off -->', '<!-- stale-ref: pinned_line -->', 'see `stale-ref: pinned` in prose'):
|
|
389
|
+
got = [inc for _, _, _, inc in scan_body("x.md", [fp, 'cite 10.5281/zenodo.20397566'])]
|
|
390
|
+
lane("exclude NEG: %r is not a file pin" % fp, got == [False], str(got))
|
|
391
|
+
|
|
392
|
+
# β-4b μ¬λ¬ μ€ μ£Όμμ νμΌ pin λ μ μΈμ΄λ€(codex R2 β μ€λ§λ€ μ°ΎμΌλ©΄ λμΉλ€)
|
|
393
|
+
got = [inc for _, _, _, inc in scan_body("x.html", ['<!--', 'stale-ref: pinned', '-->', 'cite 10.5281/zenodo.20397566'])]
|
|
394
|
+
lane("exclude: a multi-line comment file pin is honoured", got == [True], str(got))
|
|
395
|
+
|
|
396
|
+
# β-5 κ°μ μ€ λ DOI β μ΄λ¦ λΆμΈ μͺ½λ§ λΉ μ§λ€ Β· `-->` μ 곡백 μμ΄λ λλ€ Β· 40μ€ λ°μμλ λλ€
|
|
397
|
+
row = [''] * 60 + ['| a | 10.5281/zenodo.20397566 | 10.5281/zenodo.22542168 |<!-- stale-ref: pinned-line=20397566-->']
|
|
398
|
+
got = [(r, inc) for _, r, _, inc in scan_body("x.md", row)]
|
|
399
|
+
lane("exclude: line pin names one id of two, no space before -->, past line 40",
|
|
400
|
+
got == [("20397566", True), ("22542168", False)], str(got))
|
|
401
|
+
|
|
358
402
|
# β π₯ λͺ» μ½μ μ
λ ₯ β μ΄ νμΌ μμ μ λ°μ΄λλ¦¬λ‘ λ§λ€μ΄ λ³Έλ€(μμ νμΌ)
|
|
359
403
|
import tempfile
|
|
360
404
|
with tempfile.NamedTemporaryFile(suffix=".bin", delete=False) as tf:
|