fix(cache): drop wall-clock timestamp from program.yaml metadata#32
Open
dastin-sentient wants to merge 1 commit into
Open
fix(cache): drop wall-clock timestamp from program.yaml metadata#32dastin-sentient wants to merge 1 commit into
dastin-sentient wants to merge 1 commit into
Conversation
Two write paths embedded a fresh `created_at` timestamp into every program.yaml: - src/registry/sdk_utils.py:options_to_config — for the base program - src/registry/models.py:ProgramConfig.child — for mutated programs The run-cache (src/cache/run_cache.py) keys on the workspace's git tree SHA. Tree SHAs are content-addressed and were chosen specifically so identical content produces the same hash across `--fresh` launches. But the embedded timestamp byte-changes program.yaml on every launch / iteration, which busts the cache key and forces full re-inference even when nothing else has changed. Net effect on a fresh re-run of the same dataset: 100% cache miss on base eval (~$5–$15 per re-run depending on dataset size and config). Fix: drop the `created_at` field. Git's commit timestamp already records when each program was created, so the metadata field is redundant and only serves to defeat caching. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dastin-sentient
pushed a commit
to dastin-sentient/EvoSkill
that referenced
this pull request
May 7, 2026
… cleanup Three cache-correctness bugs that caused stale or wrong results: 1. **Tree-hash didn't include the LIVE skills directory.** When workspace ≠ project source root, the cache key hashed the workspace's .claude/skills/ (which has only stub .disabled files) instead of the project's. Result: same cache key across iterations even as evolved skills changed → cache returned responses generated under DIFFERENT skill conditions → mid-gate produced bogus "fixed=0, regressed=0, same=N" artifacts. Adds `live_skills_dir` and `project_source_root` to CacheConfig and threads them through. 2. **`program.yaml` embedded a wall-clock timestamp.** Per-run `created_at` field made every fresh run produce a different yaml blob, busting the run-cache key on every `--fresh`. Drop `created_at` from base_metadata in options_to_config + ProgramConfig.child. (Same fix as PR sentient-agi#32, intentionally duplicated here so this bundle stands alone if sentient-agi#32 is merged separately.) 3. **Workspace branches left over from GATE-rejected mutations.** When mid-gate or val GATE discarded an iter, the workspace's program/iter-skill-N branch remained, crashing the next iter's `git checkout -b program/iter-skill-N` with "branch already exists". Adds defensive cleanup in ProgramManager._git_checkout_new plus skill-tree snapshot/restore so historical iters reproduce. Files: src/cache/run_cache.py, src/registry/{models,sdk_utils,manager}.py Co-Authored-By: Claude Opus 4.7 (1M context) <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
Two write paths embed a fresh
created_attimestamp into everyprogram.yaml:src/registry/sdk_utils.py:options_to_config— for the base programsrc/registry/models.py:ProgramConfig.child— for mutated programsThe run-cache (
src/cache/run_cache.py) keys on the workspace's git tree SHA. Tree SHAs are content-addressed and were chosen specifically so identical content produces the same hash across--freshlaunches. But the embedded timestamp byte-changesprogram.yamlon every launch / iteration, which busts the cache key and forces full re-inference even when nothing else has changed.Net effect on a fresh re-run of the same dataset: 100% cache miss on base eval (~$5–$15 per re-run depending on dataset size and config).
Fix: drop the
created_atfield. Git's commit timestamp already records when each program was created, so the metadata field is redundant and only serves to defeat caching.Test plan
--fresh true→ second run's tree-hash matches the first run's; cache hits would now apply.program.yaml—metadata: { sdk: claude }(timestamp removed;sdkfield preserved).metadata.created_at(grep -r "metadata.*created_at"on the codebase returns no usages).🤖 Generated with Claude Code