Repository navigation
Conversation
This branch has not been deployed
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.
The cycle check in the recursive causal-chain query used
chain.path NOT LIKE '%' || ce.to_memory_id || '%', which is a substring match on the path string. A node id that is a substring of an id already on the path (for example node2against path1->12) was treated as a cycle and the edge was dropped, so valid chains were missing from the results.The path is built by joining ids with
->, so the check now wraps the path in the same separator and matches the whole id token:AND ('->' || chain.path || '->') NOT LIKE '%->' || ce.to_memory_id || '->%'Applied to all four copies:
getCausalChainandgetCausalChainWithAttentioninCausalMemoryGraph.ts, thecausal_chainsview infrontier-schema.sql, and the generatedinline.ts(regenerated withscripts/inline-schemas.mjs, one line changed).Checked against a throwaway SQLite database with edges 1->12, 12->2, 2->1 and the real CTE text from before and after the change:
1->12; the1->12->2chain is dropped1->12and1->12->2; the real cycle back to node 1 is still blockedcausal_chainsview from the schema file returns1->12->2,12->2->1and2->1->12after the changeFixes #69