fix(sleep): stage only documents changed by an accepted cycle - #277
Open
Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Open
fix(sleep): stage only documents changed by an accepted cycle#277Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
Conversation
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.
What Problem This Solves
Fixes an issue where a cycle with one accepted document change would also stage enabled documents that were unchanged. For example, a memory-only edit produced a
proposed_SKILL.mdidentical to the live skill and marked that skill as present in the manifest, adding an unrelated artifact to review and adoption.Why This Change Was Made
The cycle already retains the exact skill and memory text read before consolidation. It now compares each accepted result with that baseline and passes only changed documents to staging. The comparison is exact, so visible whitespace or text changes still stage normally.
Project Fit
User Impact
Memory-only nights stage only the memory proposal, and skill-only nights stage only the skill proposal. Users no longer need to inspect or adopt a second document that the optimizer did not change.
Proof
The regression supplies an accepted memory-only consolidation result through the real cycle and staging path. With only that regression applied to upstream
79124b37e9a6371e13b753f8bcd7adb1e493ade1, it fails becausehas_managed_skillis true. With this change, the manifest reportshas_managed_skill: falseandhas_managed_memory: true,proposed_SKILL.mdis absent, andproposed_CLAUDE.mdremains present.Local pre-publication receipt at
d115799aa7e627b702ee955f74d86993dcf1a0ee, based on that upstream commit:Academic Support
Testing
test_cycle_stages_only_documents_that_changedexercises the full cycle-to-staging boundary and checks the manifest plus both artifact paths.test_cycle_pins_the_exact_managed_skill_and_memory_bytes_it_readprotects byte fidelity, andtest_cycle_stage_then_adopt_with_backupprotects the surrounding adoption path.79124b37e9a6: failed atassertFalse(manifest["has_managed_skill"])because the value was true.git diff --check: passed.Limitations & Negative Results
This change does not rename staged memory files or alter which edits the gate accepts. It removes only exact no-op document proposals from an otherwise accepted cycle.
Reproduce It Yourself
Linux or macOS, shell from the SkillOpt repository root:
python3 -m pytest -q tests/test_sleep_engine.py -k 'cycle_stages_only_documents_that_changed or cycle_pins_the_exact_managed_skill_and_memory_bytes_it_read or cycle_stage_then_adopt_with_backup' python3 -m pytest -q