Repository navigation
refactor(refs): one resolver for the repo cache; the retired override is deleted - #396
Merged
Merged
Conversation
… is deleted D-STORE-1 (DESIGN.md:2482) is the roots resolved by ONE resolver on the contract surface, single override CHARLY_CACHE_DIR. RepoCacheDir read a SECOND override, CHARLY_REPO_CACHE, and hand-built ~/.cache/charly/repos when it was unset. Both are gone: the function now returns storeroot.Dir(storeroot.RootCache) joined with repos. THE RED is an equivalence claim, not an assertion. refs/cache_root_test.go carries two arms: with CHARLY_CACHE_DIR set and CHARLY_REPO_CACHE ALSO set, RepoCacheDir must return the CHARLY_CACHE_DIR/repos path -- before the change it returned the retired variable directory; and with XDG_CACHE_HOME unset, its default must equal what storeroot.Dir(RootCache) returns. The second is the one that needs an instrument. THE FIXTURES NEEDED A LEVEL, AND THAT IS THE INTERESTING PART. Three test files set the retired variable, which meant THE REPOS DIRECTORY; the new one means THE CACHE ROOT. A mechanical rename therefore put every derived expectation one level off, and two tests failed on absolute paths rather than on the resolver. Each fixture now measures from the repos level under the cache root, and the cache_test.go mk helper writes there too. The instrument that saw it was the full go test ./..., not the new test. Measured at spec origin/main f26ee24: go build clean, go vet clean, gofmt -l refs empty, go test ./... with no failures. Agent: lead Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
cache_test.go:79's TestIsRepoCached_LegacyProvenanceIsNotCached builds its cache path the same way mk() did -- at the cache root -- and the entries now live one level down, under repos/. The first fix patched mk() and left this one, which is the same defect in a second instance. Swept: grep -rn 'filepath.Join(cacheDir,' refs/*_test.go | grep -v repos returns nothing, and GOWORK=off go test ./... passes. Agent: lead Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…etired variable The cache.go header still read "$CHARLY_REPO_CACHE / ~/.cache/charly/repos" after the function stopped reading either. It now names the repos entry of the ONE cache root that storeroot resolves (D-STORE-1), which is where the bytes actually go. The one remaining mention of the retired name is the deliberate sentence below RepoCacheDir that records what it used to do -- present tense about the present, and a reason, not a history of what is gone. Gate: go build clean, go vet clean, gofmt -l refs empty, go test ./... no failures. Agent: lead Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
…ed override The line documented the override as CHARLY_REPO_CACHE; D-STORE-1 admits exactly one, CHARLY_CACHE_DIR, and the entries live under <cache root>/repos/. Found by sweeping the non-Go surface the .go-only grep missed. Agent: lead Assisted-by: DeepSeek Harness deepseek-v4.1-flash (documentation reviewed)
…into feat/repo-cache-one-resolver
…hing referred to it It said the variable was never named in DESIGN.md so nothing outside this file's own history referred to it. The second half was false: three consumer sites named it and are filed at charly#1213 and marketplace#629. DESIGN.md never named the variable -- that part holds -- but the conclusion drawn from it did not. Agent: lead Assisted-by: DeepSeek Harness deepseek-v4.1-flash (documentation reviewed)
Review — PASSHead SHA: Security screen: PASS — no injection, no secrets/egress, no guardrail weakening; the change removes a second resolver and aligns to Notes (non-blocking, tool-limited): the override arm is a genuine RED (pasted); the default arm is a delegation/regression guard rather than a second RED; Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
This was referenced Nov 20, 2026
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.
Summary
refs.RepoCacheDirread a second override,CHARLY_REPO_CACHE, and hand-built$HOME/.cache/charly/reposwhen it was unset.
D-STORE-1(DESIGN.md:2482) admits exactly one override:It now returns
storeroot.Dir(storeroot.RootCache)joined withrepos.How tested
The reader, at both refs — a zero with its control:
The RED, which must fail without the change:
The gate, on the committed tree:
The name survives; the reader does not
Two comments and three lines of the test that asserts the resolver ignores it. No line reads the variable.
Three entries, all
CHANGELOG/, which is whereD-CODE-4sends history.Consumers, measured
One code path calls the resolver, and
logicalRepoMountappliesfilepath.Rel(cacheDir, rootDir)— correct for every path the resolver produces.Three consumer sites set the retired variable and are filed in the repos that own them:
charly/main_repo_test.go:55,60andcheck/docs-sources/main.go:135,158at opencharly/charly#1213; three corpus skill files at opencharly/marketplace#629. Producer-first: this PR is the producer and touches neither repo.Rulebook compliance
git-workflow,go,designloaded before the first git action.spec's own.agents/skills/image/SKILL.md:99named the retired override, and this PR fixes it.## How tested.git statusread; worktree off freshorigin/main; the commit list is pasted below; no amend after the first push, no force-push.Five authored repairs and two
update-branchmerges.charlybinary is rebuilt, but the resolution behaviour changes: the retired variable is ignored and entries go to the pathD-STORE-1names. Stated rather than answered with "no runtime change".speccarries no per-repo candy gate; the module suite is pasted above.D-STORE-1. The change removes a second override the row forbids and a hand-built path that bypassed the contract resolver. No amendment is owed. The residual gap isD-STORE-3's (a plain directory, not a store entry), tracked at#569; this PR does not touch that leg.Change classification
Kind:
speccontract-module Go — one function's resolution, plus its fixtures.Breaking change + rollback: a consumer that set
CHARLY_REPO_CACHEloses that override and falls back to$XDG_CACHE_HOME/charly/repos— the pathD-STORE-1names and the one the contract resolver already returns. No wire shape changes; no generated code changes. Rollback restores the function and its fixtures together.Filed issues
sdkleg is the residualD-STORE-3gap.Agent:
lead· DeepSeek Harness session0d9af4c2ae6eAssisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)