feat(arigraph): 100%+ Python transcode — prompts, NARS, normalization, spatial#57
Merged
Merged
Conversation
…, spatial Production prompts ported verbatim from Python AriGraph: - EXTRACTION_PROMPT: 590 words with examples and edge cases - REFINING_PROMPT: 400 words with 4 worked examples - SYSTEM_PLAN_AGENT, SYSTEM_ACTION_AGENT, EXPLORATION_CHECK_PROMPT - REFLEX_PROMPT for learning from mistakes Triplet normalization (utils.py:163-172): - clear_triplet(): I→inventory, P→player, lowercase, strip punctuation - process_triplets(): digit strip, colon-delimited subject parsing - parse_triplets_removing(): [[old→new]] format from refinement output Spatial graph (parent_graph.py:131-203): - compute_spatial_graph(): auto-extract edges from directional relations - find_path_directions(): BFS returning movement commands, not locations - find_direction()/find_opposite_direction(): cardinal direction mapping - is_spatial_connection(): north/south/east/west detection - find_unexplored_exits(): identify unvisited directions Full update cycle (contriever_graph.py:26-84): - TripletGraph::update(): extract→exclude→refine→delete→spatial - exclude(): filter known triplets before sending to LLM - delete_with_location_protection(): won't soft-delete spatial triplets NARS inference (from adaworldapi/ndarray hpc/nars.rs): - infer_deductions(): A→B, B→C ⟹ A→C with f=f1*f2, c=f1*f2*c1*c2 - detect_contradictions(): same S+O, different relation, both confident - revise_with_evidence(): repeated observation increases confidence Fix compilation: collect-before-mutate in compute_spatial_graph, fix hex literal suffix in nsm_word.rs. 16 new tests for all ported functionality. https://claude.ai/code/session_01Y69Vnw751w75iVSBRws7o7
AdaWorldAPI
pushed a commit
that referenced
this pull request
Jul 7, 2026
#57 loop closed Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
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.
Production prompts ported verbatim from Python AriGraph:
Triplet normalization (utils.py:163-172):
Spatial graph (parent_graph.py:131-203):
Full update cycle (contriever_graph.py:26-84):
NARS inference (from adaworldapi/ndarray hpc/nars.rs):
Fix compilation: collect-before-mutate in compute_spatial_graph,
fix hex literal suffix in nsm_word.rs.
16 new tests for all ported functionality.
https://claude.ai/code/session_01Y69Vnw751w75iVSBRws7o7