You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The per-tool-call hot path lost its byte-identity pin and the replacement can be walked around #330
cohort-1Open at the v0.22.0 tag. Frozen: nothing joins. Closure accounting, not a work order.priority:lowReal, but neither blocking nor compounding fast
Found by the /code-review pass on #329, scored 60 — real, but not a reason to block that PR, since some loosening was genuinely required.
What changed
tests/test_case_divergence_298.py::test_the_per_tool_call_path_is_not_touched used to assert post-tool-hook.sh was byte-identical to origin/main. #299's body cited exactly that as the evidence for its zero-cost claim about the per-tool-call path.
The byte check blocked every edit to post-tool-hook.sh, including #329's own one-character octal fix. It was over-strict by construction: it could not distinguish "someone added cost to the hot path" from "someone fixed a bug in it". Keeping it was not an option.
Why the replacement is too weak
It pattern-matches three literals, so the invariant is now "the file does not mention these three strings" rather than "the hot path costs nothing". Things that reintroduce the #298/#299 defect and stay green:
GIT=git; "$GIT" -C ... — or any wrapper function, or command git
a divergence check inlined without the literal case_divergence
an extra subprocess spawn of anything that is not git
an extra file read, or a loop, on the per-tool-call path
The last two are not even in the substring set's vocabulary. #299 exists because cost on this path is paid on every tool call, and the failure is silent — it shows up as latency, not as a red test.
What would actually pin it
Not a byte compare. The property #299 cares about is cost, so measure cost: count subprocess spawns and file reads on the hot path in a harness, and assert the count, the way test_case_divergence_298.py already stubs the environment. A number that has to be edited deliberately is the pin; a substring set is a reminder.
Prior art in this repo: the fork-throttle tests already drive the hook with real marker files and assert on observable behaviour rather than on source text.
Not urgent
Nothing is broken today — the hot path is currently clean, and #329 verified that. This is about what the next PR to touch this file can do without anyone noticing.
cohort-1Open at the v0.22.0 tag. Frozen: nothing joins. Closure accounting, not a work order.priority:lowReal, but neither blocking nor compounding fast
Activity
Bound the marker's range, not just its syntax — and let a check do th…
fix: eliminate the same-second cache-tie race in test_hot_path_cost_p…
test: pin the per-tool-call hot path's cost with spawn + read-builtin…
fix(#843): invalidate the config-flatten and env caches when a layer …
test(#900): source-text pins skip a compiled hook; harness pins see t…
test(#900): source-text pins skip a compiled hook; harness pins see t…
test(#900): source-text pins skip a compiled hook; harness pins see t…
test(#900): source-text pins skip a compiled hook; harness pins see t…
Fix #1086 review round: confirm and harden 4 findings on #1079/#1060
Fix #1079, #1060: stop re-bootstrapping config on every SessionStart …