Skip to content

feat(hooks+eval): claim-scan detector fix + session-bound groundedness eval (Q-E1…Q-E4) - #98

Merged
artyhoo merged 3 commits into
mainfrom
feat/eot-detector-recall-precision
May 21, 2026
Merged

feat(hooks+eval): claim-scan detector fix + session-bound groundedness eval (Q-E1…Q-E4)#98
artyhoo merged 3 commits into
mainfrom
feat/eot-detector-recall-precision

Conversation

@artyhoo

@artyhoo artyhoo commented May 21, 2026

Copy link
Copy Markdown
Owner

Implements the maintainer's decisions on the instruction-compliance-empirical R-phase (#97, merged). Umbrella authorized 2026-05-21 («сделай всё как лучше»). Atomic commits, one concern each.

Decisions realised

Decision Verdict Commit
Q-E1 which gate DEFER clean A/B + FIX detector (whole PR)
Q-E4 detector fix recall ≤2 intervening tokens + precision strip citations/quotes/links fix(hooks)
Q-E2 fund longitudinal eval scorer → committed session-bound tool feat(eval)
Q-E3 §13.34 trigger ≥+15pp grounded-lift gate docs

Q-E4 — detector fix (.claude/hooks/end-of-turn-reminder.sh)

The R-phase measured the live detector: recall ~0.43 on natural numeric phrasings (adjacency-only regex missed "6 discipline rules", "11 distinct principles", and the pilot's one organic failure case); precision ~0.20–0.25 (over-fired on numbers/paths in fenced code, blockquotes, link targets).

  • Numeric regex now allows ≤2 intervening tokens.
  • Scan runs over a cleaned copy (fenced code + blockquotes + markdown link targets stripped); inline code kept so genuine file:line citations still fire.
  • tests/hooks/eot-claim-scan.test.sh9 sub-tests (recall intervening-token case + 2 precision cases + shape-robust mutation). All green.
  • Validated on 340 real transcripts: recall +~37% claim-turns detected, precision −~105 false-positive claim-turns. Noun-list extension deliberately left out of scope (separate axis).

Q-E2 — session-bound eval (tests/eval/)

claim-groundedness-scorer.py (deterministic, no-LLM) + README + committed baseline-2026-05-21. NOT a CI gate — needs the operator's private transcripts + no-paid-llm-in-ci; operator-run like template-audit/audit-self. Regexes + cleaning kept identical to the hook so the eval measures the same surface. SSOT #53 records the build-vs-reuse verdict (BUILD thin scorer; promptfoo/Inspect/METR REFERENCE — they host the grading half but not the no-paid-LLM generation half).

Q-E3 — §13.34 promotion gate

The claim-scan stays an interim until the eval shows ≥+15pp grounded-lift over baseline (≥50 fired instances); else candidate for removal or the H10-pair target. Clean A/B deferred to longitudinal accrual (≈no claim-scan-active data yet). Decisions recorded in patch §8.5 (mirrors #95 §10.5).

Recursive note

The detector fix was validated by re-running the eval the same R-phase designed — the eval is the test the fix had to pass («documents lie; tests don't»).

§1.7: hook fix + eval tool extend existing mechanisms / add session-bound tooling — no new .claude/rules/ rule introduced. Principle suite 81/81 green; markdownlint clean; capability gate not tripped (tool under tests/, not packages/).


§1.7 Forward-check applied

§1.7 Backward-check applied

artyhoo added 3 commits May 21, 2026 17:13
The instruction-compliance-empirical R-phase (#97) measured the live claim-scan
detector: recall ~0.43 on natural numeric phrasings (the adjacency-only regex
missed "6 discipline rules", "11 distinct principles" — and the one organic
failure case in the pilot), precision ~0.20-0.25 (over-fired on numbers/paths
inside fenced code, blockquotes, markdown link targets — cry-wolf).

Maintainer decision 2026-05-21 (Q-E1+Q-E4): fix the detector.
  - recall: numeric regex now allows <=2 intervening tokens between number and
    count-noun.
  - precision: scan runs over a cleaned copy (fenced code + blockquotes + markdown
    link targets stripped); inline `code` kept so genuine file:line citations fire.

Validated on 340 real transcripts (tests/eval baseline): recall +~37% claim-turns
detected, precision -~105 false-positive claim-turns. eot-claim-scan.test.sh
extended to 9 sub-tests (recall intervening-token + 2 precision cases + updated
mutation). Noun-list extension (sessions/agents/...) deliberately out of scope.

Prior-art: skipped — improves existing claim-scan detector (recall+precision), no new capability or dependency
Promotes the instruction-compliance-empirical R-phase scorer (#97) to a committed
session-bound tool (maintainer decision Q-E2, 2026-05-21: fund the longitudinal
eval). Deterministic, no-LLM: reads the operator's own CC transcripts and measures
the ungrounded-claim rate (claim present, no verification tool action in-cycle).

NOT a CI gate — needs the operator's private transcripts + no-paid-llm-in-ci; it
is operator-run (like template-audit / audit-self session-bound tooling). No
workflow globs tests/eval/. Regexes + cleaning kept identical to the live hook so
the eval measures the same surface.

Includes README (doc-authority header + the §13.34 >=+15pp gate) and a committed
baseline snapshot (2026-05-21) the gate compares future windows against. SSOT #53
records the build-vs-reuse verdict (REFERENCE promptfoo/Inspect/METR + BUILD thin
CC-jsonl scorer; T16 problem-class check in rationale).

Prior-art: prior-art-evaluations.md#53 (eval harness — BUILD; promptfoo/Inspect host the grading half via echo-provider/re-scoring but neither hosts the no-paid-LLM generation half; thin CC-jsonl scorer built, upstreams REFERENCE'd). Under tests/ not packages/ — not a capability-gate commit.
…Q-E3)

open-questions.md §13.34: the claim-scan interim graduates from interim ->
kept-mechanism only on an empirical ≥+15pp grounded-lift over the committed
tests/eval baseline (>=50 fired instances), else stays interim / candidate for
removal or the H10-pair target. Clean A/B DEFERRED to longitudinal accrual (Q-E1)
— ~no claim-scan-active data exists yet.

research-patches/2026-05-21-instruction-compliance-empirical.md: appended §8.5
recording the maintainer's explicit answers to Q-E1..Q-E4 (reviewer-discipline §2
step 3 closure; append to the patch that surfaced the options, mirroring #95
§10.5). Implementation landed in this same PR's other commits.

docs(research-patches) is §1.7-allowlisted; open-questions edit extends an existing
armed entry (no new rule introduced).
@artyhoo
artyhoo merged commit 426a61a into main May 21, 2026
24 of 26 checks passed
artyhoo added a commit that referenced this pull request May 21, 2026
Lands the maintainer's settings.json safety-hardening that was stranded
uncommitted on the superseded chore/ssot-karpathy-skills-ref branch (the only
non-superseded residue there — every other file already on main via #89/#92/#93/
#94/#96/#97/#98). Committed verbatim.

On-thesis: this is edit-time (earliest-channel) enforcement of project safety
rules that previously lived only as memory/prose — "no git reset hard ever",
no force-push, no skip-verify. The harness now blocks them before they run:
  - destructive git: force/mirror push, push to main/master, skip-verify commit,
    hard reset, checkout discard, branch force-delete, filter-branch, update-ref
  - destructive fs: recursive delete, shred, dd, mkfs, sudo
  - pipe-to-shell: curl-to-shell, wget-to-shell; raw netcat/socat
  - secret exfil: gh secret set/delete, gh auth logout, reads of credential dirs
    (ssh / aws / gnupg / gh config) and dotenv files
  - self-protection: .git/hooks, .husky, settings.json (Edit/Write deny)
Also: portable $CLAUDE_PROJECT_DIR hook paths + ask-question-reminder.sh permission.

Prior-art: skipped — harness config hardening (permission deny-list), no new capability code or dependency
artyhoo added a commit that referenced this pull request May 21, 2026
…efore #101 landed (#108)

The niche-strategy roadmap (#101, merged 2026-05-21 18:09) listed N6a (C-1 impl)
and N4a (claim-detector fix) as pending/urgent, but both had merged earlier the
same day: N6a via #79+#82+#83/#84/#85 (incl. live-probe DECISION-NEEDED #2 passed),
N4a via #98 (detector v2, validated against committed eval baseline). Adds a
post-merge STATUS RECONCILIATION banner + inline DONE markers across N4/N6/§5,
without rewriting the original analysis. Remaining N4 work = N4b (gate) only.

Prior-art: skipped — docs status-reconciliation only, no new capability or dependency introduced.
artyhoo added a commit that referenced this pull request May 22, 2026
…cation (#161)

Codifies 5 stage-0 memory conventions (DN-4 gaps #20/#23/#25/#26/#27):
- phase-research-coverage.md §1.12 — lead with reasoned recommendation (#27);
  act when best path clear, reserve questions for genuine forks (#20)
- ai-laziness-traps.md T17/T18/T19 — preserve-before-destructive (#25),
  preserve-unique-residue (#26), own-cold-QA-before-handoff (#23)
- tracker rows → CODIFIED (#27 prose-only; mechanization deferred per #97/#98)

Channel-selection: judgment rules → reuse 2 already-always-on rules, not new
files (#always-on-bloat). §1.7 self-review at
research-patches/2026-05-22-dn4-round2-codification.md.

Prior-art: skipped — prose discipline codification of existing memory conventions, no new capability or dependency
@artyhoo
artyhoo deleted the feat/eot-detector-recall-precision branch May 22, 2026 18:10
artyhoo added a commit that referenced this pull request May 31, 2026
…#99 multi-device (#324)

DeepWiki re-survey (maintainer runs CC through Superset). Corrects the
WebSearch-only false-negative in survey row #10 (Apache Superset != superset.sh):
Slack-agent is real. Adds the operator-vs-shipped two-axis frame to #86 so REJECT
is not misread as "operator may not use Superset". #99 = multi-device deviceId
dispatch (REFERENCE, not built today). Survey patch §9 correction appended.

Prior-art: skipped — append-only SSOT correction + research-patch correction note; no new capability, no dependency, no code.
artyhoo added a commit that referenced this pull request Jun 1, 2026
…lt.md §1.1 (#326)

Doc-authority correction: BFR is Authoritative-for "relationship to upstream
tools + default verdict", which is the doctrine's scope; CLAUDE.md owns only the
per-commit gate. PR #325 placement was a #contradicting-authority-claims slip.
CLAUDE.md reduced to a one-line pointer (also removes always-on bloat); BFR §1.1
adds own-stack-first (criterion zero) + two axes + mechanical cost=capability-commit gate.

§1.7: forward-check applied — doctrine relocated to its Authoritative-for home at .claude/rules/build-first-reuse-default.md:32 (doc-authority-hierarchy.md §4 #contradicting-authority-claims fix), CLAUDE.md reduced to pointer at CLAUDE.md:32 (removes always-on bloat per rule-enforcement-channel-selection); backward-check sweep — dual-implementation-discipline §3 still owns operator/shipped axis cross-ref at .claude/rules/build-first-reuse-default.md:40 (not duplicated), prior-art #86/#98/#99 cited unchanged.

Prior-art: skipped — doc relocation to correct authoritative home + refinement; no new capability, no dependency, no code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant