strategy, trailers, clusterdiscovery: delete dead code and its tests · Entire
Strategy, Trailers, Cluster Discovery: Delete Dead Code and Its Tests
bc8585c·Soph·2w ago·13 files·+9 added/-1,133 removed
Everything here is unreachable from the CLI entry points (verified with x/tools deadcode + reference grep) and exercised only by tests dedicated to it:
- strategy/common.go: the checkpoint-lite decode cluster (ReadCheckpointMetadata, ReadCheckpointMetadataFromSubtree, decodeCheckpointInfo, decodeSessionMetadataLite, decodeSummaryLiteFromTree, plus the private lite types) along with the bench file that was its only consumer; IsInsideWorktree and GetMainRepoRoot.
- strategy: extractUserPrompts/extractUserPromptsFromLines (prod uses splitPromptContent/readPromptsFromFilesystem), subtractFiles.
- trailers: ParseBaseCommit, ParseAllSessions, FormatTaskMetadata (prod uses FormatShadowTaskCommit) and the now-orphaned baseCommitTrailerRegex. FormatMetadata/FormatCheckpoint stay — live test infrastructure.
- clusterdiscovery: exported RenderLoginHint wrapper (the private renderLoginHint stays, used by resolve.go); reword the auth/refresh.go comment that pointed at it.
Test helpers still exercising live code (hasCheckpointURL, IsAncestorOf, ManagedGitHookNames, sessionStateFile, tokenstore fault seams, OPF config seams, contexts.Save) are kept.
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Sessions
e64c28c66fb4View transcript
Changes
13
cmd/entire/cli
auth
Mrefresh.go+5/-4
strategy
Mcommon.go-234
Mcommon_test.go-97
Mmanual_commit_condensation.go-131
Mmanual_commit_condensation_test.go-34
Mmanual_commit_hooks.go-11
Mmanual_commit_test.go-158
Mphase_postcommit_test.go-52
Dreadcheckpoint_bench_test.go-233
trailers
Mtrailers.go-41
Mtrailers_test.go-113
internal/entireclient/clusterdiscovery
Mdiscovery.go+4/-12
Mdiscovery_test.go-13
150 unmodified lines
// contextReauthError maps the two re-auth sentinels a per-context manager can return into a friendly message that names the context and its core (so a multi-core user logs back into the right one — matching clusterdiscovery.RenderLoginHint's idiom), preserving the sentinel for errors.Is. Returns nil when err is neither sentinel, leaving the caller to wrap the residual error in its own terms (refresh vs exchange).
// multi-core user logs back into the right one — matching the "no auth context, run `entire login`" hint style used by clusterdiscovery), preserving the sentinel for errors.Is. Returns nil when err is neither sentinel, leaving the caller to wrap the residual error in its own terms (refresh vs exchange).
func contextReauthError(c *contexts.Context, err error) error {
coreURL := strings.TrimRight(c.CoreURL, "/")
switch {
}
}
Mcmd/entire/cli/auth/refresh.go+5/-4
593 unmodified lines
// ReadCheckpointMetadata reads metadata.json from a checkpoint path on entire/checkpoints/v1. With the new format, root metadata.json is a CheckpointSummary with Agents array. This function reads the summary and extracts relevant fields into CheckpointInfo, also reading session-level metadata for IsTask/ToolUseID fields.
// Uses streaming json.Decoder and minimal structs to avoid loading large nested objects (Summary, Attribution, TokenUsage) into memory. func ReadCheckpointMetadata(tree checkpoint.FileReader, checkpointPath string) (*CheckpointInfo, error) { metadataPath := checkpointPath + "/metadata.json" file, err := tree.File(metadataPath) if err != nil { return nil, fmt.Errorf("failed to find metadata at %s: %w", metadataPath, err) }
// ...
return info, nil }
// GetMetadataRefTree returns the tree object at the given committed-metadata ref. func GetMetadataRefTree(repo *git.Repository, ref plumbing.ReferenceName) (*object.Tree, error) { resol...}
// IsInsideWorktree returns true if the current directory is inside a git worktree (as opposed to the main repository). Worktrees have .git as a file pointing to the main repo, while the main repo has .git as a directory. func IsInsideWorktree(ctx context.Context) bool { // ... }
// ... (more content)