Repository navigation
Chains may walk a named path pattern (#371) - #372
Merged
Merged
Conversation
Proposed. A scheme declares a composed relation as the reference fields it follows in order; a chain names it where it names a field. Read-only, single-scheme legs, steps name their intermediate, partial paths shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
Chains walk a named Cypher-syntax path pattern, parsed by GraphGlot and lowered to clingo over held/4, replacing the composed field list. Devlog records the design path and the Cypher-to-Datalog tool survey. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
GraphGlot moves to the rejected alternatives: luria writes the lowering either way, and a 15-line grammar accepts only the subset. Firing a scratch grammar corrected the node-label rule (a bare back reference is allowed); the devlog carries the grammar and its known gaps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
A `patterns:` family declares paths in Cypher's pattern syntax. luria's own lark grammar accepts only the subset and names the constructs it refuses; pattern_rules lowers a parse to clingo over held/4, so the logic core stays the one engine. Labels, hops, properties and chain endpoints are checked at load in consistency.lp. A chain names a pattern in `relation` or `sibling`; its page shows what each step went through and lists paths that stop partway, and a chain invariant covers pattern steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
examples/argument-map fires the feature on a real shape: two chains over patterns through inference documents, one dropping challenged steps with WHERE NOT, both listing an unfinished inference as open. The ADR now matches the implementation (reading direction, open ends from both ends, closures within one scheme, the name-clash rule); the devlog records what building it corrected; the changelog fragment and project-memory describe the feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
dmarx
marked this pull request as ready for review
October 13, 2026 03:41
This was referenced Oct 13, 2026
Tried on dmarx/nucleation, the Open list named six complete arguments: they rest only on `grounds`, which the record's field group allows. Whether a partial match is unfinished depends on the schema, so a record states it as a pattern of its own; rendering one is #373. pattern_open, its rules, the page section and their tests go. The ADR records the trial as the reason, and the devlog records parity on nucleation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
Conflict in chains.py resolved by keeping both sides: #359's per-edge relation tracking beside the pattern-aware `_edges`, and a step's tail carries "through" before #359's `_also`. A pattern has no label, so its name reads there ("also follows from"); the chain test pins it, and the ADR and devlog say #359 merged first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks
dmarx
added a commit
to dmarx/nucleation
that referenced
this pull request
Oct 13, 2026
The `argument` chain walks `argued_from` beside `rests_on`: a claim and the claims an argument that is not Rejected draws it from, through the ARG's `concludes` and `rests_on`. Steps through ARG-006, ARG-007 and ARG-008 now render, each naming its argument. CI moves to luria 1.1.0, which carries path patterns (dmarx/luria#372) and names a step's other parents by their relation (dmarx/luria#359). Claude-Session: https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks Co-authored-by: Claude <noreply@anthropic.com>
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 #371. Decision: ADR-tmpfdvjo, A chain may walk a named path pattern (Proposed).
What it does
A record may declare named path patterns in Cypher's pattern syntax, and a chain may walk one wherever it walks a field:
held/4reads it (converse side included).|between fields, variable length (*,*2..,*..3), property maps, andWHERE NOTfollowed by a fixed path.MATCH,RETURN,OPTIONAL MATCH, undirected or named edges, shortest paths and writes are refused by name.luria/patterns.lark) and lowers them to clingo over the record's facts (luria/pattern_rules.py), so the logic core stays the one engine. Every program is stratified, so there is one answer set.consistency.lp):invariantcovers pattern steps, and cycles are the existing finding;Removed during review: built-in "Open"
An earlier commit listed partial matches that couldn't be completed under Open on each chain page. Tried on dmarx/nucleation, it named six arguments, all of them complete. They rest only on
grounds, which nucleation'spremisesfield group allows. Whether a partial match is unfinished depends on the schema, so a record states it as a pattern of its own:Rendering such a pattern as a list of its matches is #373.
Files
luria/patterns.py,luria/patterns.lark,luria/pattern_rules.py,examples/argument-map/.config.py: thepatternsfamily,NamedPattern;consistency.pyand.lp;chains.py;invariants.pyand.lp;logic/__init__.py:derive(extra=..., families=...)for generated programs;facts.py:pattern/1;config_doc.py;tools/wheel_smoke.py: proves the wheel carries the grammar;pyproject.toml:lark>=1.2,<2.docs/project-memory.md.Verification
python -m pytest tests -qafter mergingmain(with Name a chain step's other parents by the relation that holds them #359): 1769 passed, 33 skipped.luria lint: clean at the root (which includesexamples/*) and inexamples/argument-mapon its own.luria indexwrites are byte-identical betweenmainand this branch, and so isluria lintwithlint.network: neverset in both copies.argued_from: (c:CLAIM)<-[:concludes]-(g:ARG)-[:rests_on]->(p:CLAIM) WHERE NOT (g {status: 'Rejected'})on itsargumentchain draws the steps through ARG-006, ARG-007 and ARG-008, each "through" its argument. They were invisible to a chain overrests_on.examples/argument-map: steps render "through" their inference, anduncontested.mddrops the step OBJ-001 challenges.tools/wheel_smoke.pypasses;luria/patterns.larkis in the wheel.Merge with #359
#359 merged first. The conflict in
chains._loadand_line_blockwas resolved by keeping both sides: #359's per-edge relation tracking runs beside the pattern-aware_edges, and a step's tail carries "through" before #359's_also. A pattern has nolabel, so its name reads in that place, andtests/test_pattern_chains.pypins it.🤖 Generated with Claude Code
https://claude.ai/code/session_016xS6nL8ZZpTh1jMSvaTRks