fix: code review issues + rename files/sidecars to shards#65
Merged
greynewell merged 2 commits intomainfrom Apr 8, 2026
Merged
fix: code review issues + rename files/sidecars to shards#65greynewell merged 2 commits intomainfrom
greynewell merged 2 commits intomainfrom
Conversation
- analyze/handler: resolve dir to absolute path before writing sidecar cache
(relative "." would write to wrong location)
- daemon: bound Ctrl+C sidecar cleanup to 5s timeout to prevent shutdown hang
on large repos or slow filesystems
- cache/PutJSON: clean up .tmp file on rename failure to prevent accumulation
- deadcode: include MinConfidence and Limit in cache key so different option
combinations don't share the same cache entry
- setup/wizard: prefer $PATH lookup over os.Executable() for hook path
(survives symlinks, go run, and dev builds)
- files/hook: remove dead-code UDP dial warning (net.Dial("udp") always
succeeds for localhost — connectionless protocol, no listener needed)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- internal/files/ → internal/shards/ (package renamed files→shards) - api types: SidecarIR → ShardIR, SidecarGraph → ShardGraph, SidecarDomain → ShardDomain, SidecarSubdomain → ShardSubdomain, GraphFromSidecarIR → GraphFromShardIR - api method: AnalyzeSidecars → AnalyzeShards - internal identifiers: SidecarExt → ShardExt, SidecarFilename → ShardFilename, WriteSidecar → WriteShard, isSidecarFile → isShardFile, isSidecarPath → isShardPath - config: Files *bool → Shards *bool, FilesEnabled() → ShardsEnabled(), SUPERMODEL_FILES env var → SUPERMODEL_SHARDS - CLI flag: --no-files → --no-shards - cache file: .supermodel/graph.json → .supermodel/shards.json - all user-facing strings: "sidecar" → "shard", "file mode" → "shard mode" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Bug fixes (from code review)
analyze/handler.go—dirwas not resolved to absolute path before writing shard cache; relative "." would write to wrong locationClean()now runs in a goroutine with a 5s timeout to prevent hanging on large reposcache.PutJSON— clean up.tmpfile on rename failure to prevent accumulationMinConfidence+Limitso different option combinations don't share a cache entrysetup/wizardhook path now prefers$PATHlookup (exec.LookPath) overos.Executable()— survives symlinks,go run, dev buildshook.go(UDPnet.Dialalways succeeds locally — connectionless)Rename: files/sidecars → shards
internal/files/→internal/shards/(packagefiles→shards)SidecarIR→ShardIR,SidecarGraph→ShardGraph,SidecarDomain→ShardDomain,GraphFromSidecarIR→GraphFromShardIRAnalyzeSidecars→AnalyzeShardsSidecarExt→ShardExt,SidecarFilename→ShardFilename,WriteSidecar→WriteShard, etc.Files *bool→Shards *bool,FilesEnabled()→ShardsEnabled(),SUPERMODEL_FILES→SUPERMODEL_SHARDS--no-files→--no-shards.supermodel/graph.json→.supermodel/shards.jsonNote: The cache file rename (
.supermodel/graph.json→.supermodel/shards.json) invalidates existing local caches. Users will re-fetch on first run after upgrading.Test plan
go build ./...— cleango test ./...— all pass (auth failures are pre-existing)supermodel watch— verify shards written next to source filessupermodel analyze— verify.supermodel/shards.jsoncreatedsupermodel analyze --no-shards— verify no shard files writtenSUPERMODEL_SHARDS=false supermodel analyze— verify shard mode disabled🤖 Generated with Claude Code