Filing thresholds are duplicated between bin/boundary-classify and bin/ia_store.py — tuning one silently desynchronizes the FR-4.5 stability gate #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why:
MIN_SHARE_OF_SPEND = 0.02is defined independently in two places:bin/boundary-classify:23(withMIN_INVOCATIONS=3at :28 andMIN_ATTRIBUTED_TURNS=30at :29)bin/ia_store.py:27(withMIN_INVOCATIONS=3at :28)bin/boundary-classifyuses its copy to decideverdict: filevsboundary-question.bin/stability-classifyimportsMIN_SHARE_OF_SPENDfromia_storeand uses it to test whether two windows crossed the filing threshold (FR-4.5 stability gate).The gate's notion of "the filing threshold" and the classifier's actual filing threshold are now two separate constants that merely happen to be equal. Tuning one — which TASKS 2.5/4.5 explicitly anticipate — would silently desynchronize the other. The gate would test a threshold that no longer matches the classifier, and mis-gate without erroring.
ia_store.pywas created precisely to prevent divergences like this (dcec9ca: "so both scripts hash signatures identically. A divergence there would make the gate match nothing and fail open"). The threshold constants should have centralized too.Acceptance:
MIN_SHARE_OF_SPENDhas a single definition inia_store.pybin/boundary-classifyimports it fromia_storebin/stability-classifycontinues to use the same sourceRelated / proper fix: Per TASKS 2.3 design intent, all classification thresholds should live in
references/signals-catalog.mdwith runtime loading — tuning would be a reviewable diff, not scattered Python constants.Links: FR-4.5 commit
dcec9ca, TASKS 2.3 / 2.5 / 4.5, found during spec-quality review of design/spec.mdConfirmed real, fixed, pushed.
Root cause:
bin/boundary-classify:23andbin/ia_store.py:27each independently definedMIN_SHARE_OF_SPEND = 0.02.bin/boundary-classifyused its own copy (line 137/141) to decidefilevsboundary-question.bin/stability-classifyimportsMIN_SHARE_OF_SPENDfromia_store(not fromboundary-classify) to run the FR-4.5 stability gate. The two constants only agreed by coincidence — nothing enforced it, so tuning one (as TASKS 2.5/4.5 explicitly anticipate) would silently desync the gate from the classifier it's supposed to gate, exactly as the issue describes. Verified with:Issue body is accurate as filed and was not touched by any of today's other fixes to this repo (checked
git log --oneline -20before starting —boundary-classify/ia_store.pylast touched indcec9ca, well before today's session).Fix (commit
a218a31, pushed tomain):ia_store.pyis now the single definition;boundary-classifydoesfrom ia_store import MIN_SHARE_OF_SPENDinstead of keeping its own copy, matching howstability-classifyalready imports fromia_store. All three acceptance boxes are satisfied.Scope note:
MIN_INVOCATIONS/MIN_ATTRIBUTED_TURNSare still duplicated between the two files, but left alone —stability-classifynever imports or reads them, so their duplication doesn't create the same "fails silently mid-tune" risk the issue is about. The "Related / proper fix" (all thresholds centralized inreferences/signals-catalog.mdwith runtime loading) is a separate, larger change and out of scope here.Verification:
Both pass on the current tree, run after the fix and after push.
Note: this repo is not worktree-isolated for this session's fan-out, so
bin/plugin-inventory/tests/inventory.test.sh/.claude-plugin/plugin.jsonshow unrelated concurrent edits from a sibling agent working kotkan/claude-plugin-inference-arbitrage#10 — untouched by this fix, left for that agent to commit.