Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
F2 made a session owner-only (`*`) whenever any tool input contained `subsystem-store`. The 2026-11-11 re-census found all 13 derived-`*` sessions in the fresh cohort got it from F2, overwhelmingly from named reads of one cache file, plus false positives that are not cache reads at all (a kubectl namespace, a repo path, a script name, ~/.config/...). Now a tool input naming `<...cache...>/subsystem-store/<valid scope>/...` adds THAT scope (folded into R_header, so the capture agent and the pod's re-derivation both carry it through the existing paths). Still `*`: the bare root, an invalid/glob/$VAR component, another instance's `subsystem-store-<alias>` root (derived scopes carry no instance), a sync staging sibling, a relative root, a root under an unreadable parent spelling (`$C/subsystem-store`), and any input with a `..` component or a `cd` into the cache. Adds nothing: a non-cache mention (namespace, literal repo/config parent, longer word, the `.lock` sibling). Tests: f2_test.go (named, fail-closed, non-cache tables; the client's own CacheRootFor; a linearity test that caught a 52 s quadratic in an intermediate version). Mutant battery: the F2 row is re-pointed and five rows added (bare-substring, bare-root-not-star, component-not-validated, other-instance-scope-trusted, unknown-parent-not-a-cache), each KILLED. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
leakscan refused 8 denied identifiers (real project, cluster and host names) in the new F2 tests and doc comment. Replaced with synthetic ones; no behaviour change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded by #314 (same final tree, single commit). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Re-census 2026-11-11: in the fresh handoff-writer cohort, all 13
*sessions got*from the derived set, none from the ledger. The inputs that set off F2 were mostly named reads of one cache file (sed -n … ~/.cache/subsystem-store/<scope>/x.md). The rest were not cache reads at all: akubectl -n subsystem-storenamespace flag, a script named…-subsystem-store-….sh, a repo path…/apps/subsystem-store/…, and~/.config/subsystem-store/. The operator chose "narrow F2 to the cache-root path; stay fail-closed".The rule (
eachCacheReadininternal/transcript/scopeuse/scopeuse.go)Each
subsystem-store(case-insensitive) in a tool input is checked as a path name:cache(~/.cache,/home/<u>/.cache,$HOME/.cache,"${HOME}/.cache",$XDG_CACHE_HOME,${XDG_CACHE_HOME:-…}). There is no-<alias>suffix. A/follows the root. The next component (up to/or a shell separator) passesValidScope. The input has no..path component and nocd/pushdinto the cache.*(fail-closed): every other cache root:S=~/.cache/subsystem-store;,ls ~/.cache/subsystem-store)$VAR,{a,b}, quoted, empty or dotted componentsubsystem-store-<alias>.new-…staging siblingssubsystem-store/…,./subsystem-store/…$C/subsystem-store,"$C"/subsystem-store). An unrecognised spelling is*and never counts as "not a cache".check-subsystem-store-x.sh,subsystem-stores)apps/,.config/,deploy/)/after it (-n subsystem-store)subsystem-store[-alias].locksiblingThe named scopes are folded into R_header, as R_memo already is. The capture agent (
Declare/V,Evidenceround-trip) and the pod's re-derivation (archive.go, which unionsres.Headers) therefore both carry them with no change at either call site.F2now means "F2 contributed*".Instances (requirement 3)
Derived scopes are bare names.
capture.DecideRunroutes each one byrouting.AliasFor(scope), and nothing carries(instance, scope). So a named read undersubsystem-store-<alias>/<scope>/cannot be attributed: routing would send that scope by name to whichever instance the table names. Every non-default-instance cache path therefore fails closed to*. This is deliberate and pinned by test and mutant. The cross-instance*from #308 is unchanged.Not seen (T3, in the package doc)
$S/notes1/x.md). The call that sets a bare root orcds into the cache is itself*. A call that setsS=…/subsystem-store/notes1adds onlynotes1, and a later$S/../alphais not seen.subsystem-storewith no/(it looks the same as the namespace).The client does not honour
XDG_CACHE_HOMEfor the store cache (client.DefaultCacheRootis$HOME/.cache/subsystem-store; the Python oracle matches). The XDG spellings are caught only to fail closed.TestCacheScopesMatchesTheClientsCacheRootchecks the parser againstclient.CacheRootFor.Existing data
names_cacheevidence andV/Derivedare grow-only, so sessions already marked*stay*. The fix applies to sessions derived from now on.Tests
f2_test.gohas literal tables for every case, with pairwise-distinct scope names. The F2 fixture test is nowTestF2CacheReadAddsItsScope([alpha-notes], was[*]).Red at
origin/main(d000023) / green at HEAD. For base, a test-only adapter mapsCacheScopes(s)to base's F2 answer ([*]ifToolInputset F2, else none):[*])*)TestCacheScopesIsLinearalso caught a real quadratic in an intermediate version of this PR: 52.6 s on a 2 MiBsubsystem-store-run. After the fix the same run takes 0.44 ms, about 8× growth for 8× the input.Mutants. Rows are in
tests/control_mutants.py. Each was run with--onlyand is KILLED, positive control GREEN:scopeuse-cache-path-read-ignored(re-pointed): killed by TestF2CacheReadAddsItsScope (+ Named, Unattributable)scopeuse-f2-bare-substring(a): Named (F2=true V=[* ember_7]), plus NonCache and the fixture testscopeuse-f2-bare-root-not-star(b): Unattributable. The bare-root rows return[]and the Deriver assertion fails:bare root: F2=false V=[] Declare=[]scopeuse-f2-component-not-validated(c): Unattributable (bad.name1,{alder1,birch1},no"tes1",.sync-stamp,$SC1were each taken as a scope)scopeuse-f2-other-instance-scope-trusted: Unattributable (other-instance rows), plus ClientsCacheRootscopeuse-f2-unknown-parent-not-a-cache: Unattributable ($C/…rows)Hand-run extras, not in the battery: turning off the
..check, turning off thecdcheck, or both, each turns Unattributable red. Widening..to "anywhere" orcdto "any cd" turns Named red through themain..HEAD/cd /work/repocontrols.Run locally:
go test+go veton./internal/transcript/scopeuse/... ./internal/capture/... ./internal/transcript/archive/..., all ok. Whole suite left to CI.A second commit replaces real identifiers in the fixtures with synthetic names, after the first CI run's
leakscanrefused them.leakscanwas run locally afterwards: 0 findings, controls PASS.Also updated
claudedocs/plan-cairn-plugins.md: a dated note under the F2 definition, superseding O18's "F2 is not narrowed".🤖 Generated with Claude Code