Skip to content

Preserve dream lineage across manifest parent fallbacks - #28

Merged
Xingdi (Eric) Yuan (xingdi-eric-yuan) merged 9 commits into
mainfrom
copilot/update-index-parent-branch-fix
Aug 11, 2026
Merged

Xingdi (Eric) Yuan (xingdi-eric-yuan) merged 9 commits into
mainfrom
copilot/update-index-parent-branch-fix

Conversation

Copilot AI commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Dream reconciliation crashed on null parent_branch values and silently indexed children as roots when lineage used alternate metadata. The repair path inherited the same gaps.

  • Parent resolution

    • Resolve lineage in order:
      parent_branch → base_branch → parent_dream_id/builds_on → report.md → main
      
    • Resolve dream IDs to unambiguous remote branch refs.
    • Treat explicit null values as absent.
  • Index repair

    • Apply the same fallback chain to existing mis-rooted rows.
    • Rewrite only when the parent resolves to an indexed dream.
    • Preserve existing non-root parent relationships.
  • Regression coverage

    • Cover null metadata, alternate lineage keys, report fallback, true roots, and unconfirmed parents.

Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix update_index method to handle null parent_branch Preserve dream lineage across manifest parent fallbacks Aug 10, 2026
Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
Copilot AI and others added 3 commits August 10, 2026 23:28
Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
@xingdi-eric-yuan

Copy link
Copy Markdown
Collaborator

Copilot
The Windows CI failure here isn't caused by this PR — it's inherited. The
windows-latest matrix was added in aee5f04 (Aug 6), but main hasn't run
tests.yml since Jun 25, so the job has never been green on main.

That said, the latest commit (63451f3) takes this PR into someone else's
lane. #26 "[Windows port] Make windows-latest CI green" is already open,
non-draft, mergeable, and green as of 364fe94.

Both PRs add a file named tests/_shell.py (#26: 128 lines, this one: 95)
and both modify 7 of the same shell-test files, so whichever lands second
conflicts.

This PR's port is also incomplete. It moved Windows from 209 failures to 24,
but the 24 that remain are exactly the files #26 patches and this one doesn't:

failures file covered by #26
15 test_dream_gc_sh.py yes (+44/-5 vs +6/-2 here)
3 test_dream_setup_sh.py yes — #26 also patches dream-setup.sh itself
2 test_pre_tool_sh.py yes
2 test_worktree_safety.py yes — not touched here
1 test_dream_reconcile.py yes (worktree-gc unsafe-base, not lineage)
1 test_shadow_init.py yes — not touched here

Suggestion: drop the Windows changes from this PR and keep it to the lineage
fix, then land #26 and rebase. The lineage change itself looks good — Ubuntu is
green, all 8 new lineage tests pass on Windows too, and I verified
_resolve_parent_branch against a corpus of real manifests: it resolves the
base_branch / parent_dream_id / builds_on cases to the correct parent
branch, keeps a bare manifest at main, and no longer raises on
parent_branch: null.

Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>
Co-authored-by: xingdi-eric-yuan <4028684+xingdi-eric-yuan@users.noreply.github.com>

Copilot AI commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Copilot
The Windows CI failure here isn't caused by this PR — it's inherited. The
windows-latest matrix was added in aee5f04 (Aug 6), but main hasn't run
...

Dropped the Windows CI changes in af4d5d6. The PR now differs from main only in the four lineage implementation/test files. The targeted suites pass (224 tests), as does the full Linux suite (1,075 passed, 8 skipped).

@xingdi-eric-yuan Xingdi (Eric) Yuan (xingdi-eric-yuan) changed the title Preserve dream lineage across manifest parent fallbacks Preserve dream lineage across manifest parent fallbacks (after #26) Aug 10, 2026
@chisingh Chinmay Singh (chisingh) changed the title Preserve dream lineage across manifest parent fallbacks (after #26) Preserve dream lineage across manifest parent fallbacks Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xingdi-eric-yuan
Xingdi (Eric) Yuan (xingdi-eric-yuan) merged commit 5e1adc0 into main Aug 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update_index records a genuine child dream as a root, and crashes on parent_branch: null

3 participants