fix(refresh): preserve add sequence through continuity - #710
Merged
Conversation
11 tasks
Owner
Author
Independent review — no blocking findingsReviewed PR head
GitHub does not allow the repository author to submit an approving review on their own PR, so this conversation comment records the review result. Merge is authorized by the owner in the current session. |
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.
Closes #660
User before → after
Before: a routine holdings refresh for a position that had never been sold preserved its
cycle_id, but rebuilt the adopted snapshot anchor withadd_count: 0. The deriveddecision_cursortherefore became null and a previously captured add reason could be asked again.After: only the existing #539 proven-continuity branch carries a positive engine-known
add_count. The ledger remains the single reader that derivesdecision_cursor; the next canonical BUY advances that count, while a sell/rebuy starts at zero.Root cause and scope
The #539 relink path carried cycle start and sequence but omitted the existing active cycle's add sequence. The fix threads the same internal metadata through:
book_refresh.carry_recorded_startsafter its continuity proof;prepareprojection that feeds the existing question deduplicator.It does not replay pre-anchor history, add a memory object/event stream, or change weights, cost basis, valuation, concentration, or other investment arithmetic.
Compatibility and recovery
add_countis engine-assigned: caller-suppliedadd_countanddecision_cursorfail closed.Evidence
python3 tests/run_all.py— pass.python3 tests/persona_sweep.py --baseline /tmp/fomo-kernel-660-baseline/skills/fomo-kernel/engine— pass; Markdown and HTML are byte-identical for all 156 rendered persona cards.refreshadoption → realreview.py prepare, confirming the carried cursor is retained and the existing question reader marks italready_captured._carry_add_countmakestest_a_continuous_cycle_keeps_its_engine_known_add_sequence_through_refreshfail with the adopted holding atadd_count: 0and no cursor; the implementation was restored before the passing suite.Non-goals
No owner-live M1 acceptance is claimed here, and this PR does not touch #610/#683, rationale memory, #590 research, weekly/news/scheduler work, ETF look-through, or card redesign.