Skip to content

Guard trajectory readers against fork cycles - #199

Merged
nickjalbert merged 3 commits into
laude-institute:mainfrom
dajiaohuang:fix/guard-cyclic-trajectory-reads
Oct 6, 2026
Merged

nickjalbert merged 3 commits into
laude-institute:mainfrom
dajiaohuang:fix/guard-cyclic-trajectory-reads

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Recursive trajectory readers can recurse indefinitely through cyclic fork or parent metadata. Track the current ancestry in each recursive reader while allowing a shared child through independent branches. Canonicalize paths before comparing ancestry: relative references such as ./trajectory.jsonl or ../parent/trajectory.jsonl otherwise produce a different pathname on each recursive visit and bypass the guard.

Closes #198.

Validation: a new real traj cat -r --raw regression checks a relative self-cycle, a two-node relative cycle and shared-child branches, with bounded timeouts. The earlier PR times out on the self-cycle; the completed fix terminates both cycles and preserves the shared child in both branches. Existing recursive-tree (15 checks) and explore-report (7 checks) scripts pass on Ubuntu; Bash syntax and git diff --check pass. New regression is picked up by the existing shell CI harness. Current-commit CI is pending. Cyclic explore/list/render paths were inspected but not separately executed; macOS and live identity behavior were not tested locally.

@nickjalbert nickjalbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks!!

@nickjalbert
nickjalbert merged commit d2e62f9 into laude-institute:main Oct 6, 2026
12 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.

Recursive trajectory readers can loop on cyclic fork references

2 participants