Skip to main content

Level 11.24 β€” Interactive CLI Binary

Golden Chain Cycle: Level 11.24 Date: 2026-02-16 Status: COMPLETE β€” 145/145 (100%)


Key Metrics​

TestDescriptionResultStatus
Test 124Named Entity Registry (30 entities, 5 relations)60/60 (100%)PASS
Test 125Multi-Hop CLI Pipeline (2-hop, 3-hop, cross-domain)30/30 (100%)PASS
Test 126CLI Binary Integration Verification55/55 (100%)PASS
TotalLevel 11.24145/145 (100%)PASS
Full RegressionAll 398 tests394 pass, 4 skip, 0 failPASS
CLI Binaryzig build queryCompiles and runsPASS

What This Means​

For Users​

  • Trinity now has an actual CLI binary β€” run zig build query -- Paris capital_of and get France instantly
  • Multi-hop chain queries work from the command line: zig build query -- --chain Eiffel landmark_in capital_of outputs Eiffel β†’ Paris β†’ France
  • Entity and relation discovery: --list shows all 30 entities, --relations shows all 5 relations
  • The knowledge graph builds in milliseconds and queries resolve instantly β€” no external dependencies

For Operators​

  • The CLI binary is self-contained β€” no model files, no network, no configuration. Just compile and run
  • Same deterministic seeds as the test suite β€” the CLI produces identical results to the verified tests
  • Binary located at zig-out/bin/trinity-query after zig build query
  • Error handling for unknown entities and relations with helpful suggestions

For Investors​

  • Level 11.24 delivers the first user-facing product from the symbolic reasoning engine
  • The CLI proves Trinity VSA can power interactive applications, not just pass tests
  • 24 development cycles: from basic ternary operations to a complete interactive symbolic AI tool
  • This is the foundation for future web APIs, chat interfaces, and integration with LLMs

CLI Binary Usage​

Direct Queries​

$ zig build query -- Paris capital_of
Query: capital_of(Paris) = France
Similarity: 0.2778

$ zig build query -- Eiffel landmark_in
Query: landmark_in(Eiffel) = Paris
Similarity: 0.2660

$ zig build query -- Sushi cuisine_of
Query: cuisine_of(Sushi) = Japan
Similarity: 0.2778

Multi-Hop Chains​

$ zig build query -- --chain Eiffel landmark_in capital_of
Chain query: Eiffel --[landmark_in]--> Paris (sim=0.266) --[capital_of]--> France (sim=0.278)

$ zig build query -- --chain Colosseum landmark_in capital_of
Chain query: Colosseum --[landmark_in]--> Rome (sim=0.266) --[capital_of]--> Italy (sim=0.278)

Discovery​

$ zig build query -- --list
Entities (30):
Cities: Paris, Tokyo, Rome, London, Cairo
Countries: France, Japan, Italy, UK, Egypt
Landmarks: Eiffel, Fuji, Colosseum, BigBen, Pyramids
Foods: Croissant, Sushi, Pizza, FishChips, Falafel
Languages: French, Japanese, Italian, English, Arabic
Climates: Temperate, Humid, Mediterranean, Oceanic, Arid

$ zig build query -- --relations
Relations (5):
capital_of: city β†’ country
landmark_in: landmark β†’ city
cuisine_of: food β†’ country
language_of: language β†’ country
climate_of: climate β†’ country

Technical Details​

Test 124: Named Entity Registry (60/60)​

Architecture: String-to-index mapping for 30 entities and 5 relations. Case-sensitive exact match with prefix fallback.

Three sub-tests:

Sub-testDescriptionResult
Entity registry30 name→index lookups30/30 (100%)
Relation registry5 name→index lookups5/5 (100%)
Named query dispatch25 entity+relation→result queries25/25 (100%)

Key result: All 25 query scenarios resolve correctly when dispatched by string name β€” the named registry introduces zero accuracy loss compared to index-based queries.

Test 125: Multi-Hop CLI Pipeline (30/30)​

Architecture: Full pipeline from string entity name through multi-hop chain to string result name.

Four sub-tests:

Sub-testQuery PatternCountResult
2-hop chainslandmark→city→country55/5 (100%)
3-hop chainslandmark→city→country→cuisine55/5 (100%)
Cross-domaincountry→(language+climate)1010/10 (100%)
DeterministicSame query twice1010/10 (100%)

Sample chains:

  • Eiffel β†’ Paris β†’ France (2-hop)
  • Pyramids β†’ Cairo β†’ Egypt β†’ Falafel (3-hop)
  • France β†’ French + Temperate (cross-domain)

Key insight: The 3-hop cuisine chain works because bipolar bind is commutative — bind(food, country) = bind(country, food), so unbind(country) from a food→country memory still resolves the correct food.

Test 126: CLI Binary Integration (55/55)​

Architecture: Verifies that the CLI binary logic produces correct results for all query scenarios.

Three sub-tests:

Sub-testDescriptionResult
Direct query verificationAll 25 relation pairs25/25 (100%)
Chain output verification5 landmark→city→country chains5/5 (100%)
Similarity thresholdAll results > 0.1025/25 (100%)

Similarity range: min 0.266, max 0.871. All well above the 0.10 threshold, confirming strong signal separation at DIM=1024 with 30 entities and 5 relations.


CLI Binary Architecture​

src/query_cli.zig (280 lines)
β”œβ”€β”€ Entity definitions (30 names, seeds)
β”œβ”€β”€ Relation definitions (5 types, pairs)
β”œβ”€β”€ bipolarRandom() β€” same seeds as test suite
β”œβ”€β”€ treeBundleN() β€” relation memory construction
β”œβ”€β”€ findEntity() β€” case-insensitive name lookup
β”œβ”€β”€ findRelation() β€” relation name lookup
β”œβ”€β”€ main() β€” argument parsing + query dispatch
β”‚ β”œβ”€β”€ --info β€” show KG metadata
β”‚ β”œβ”€β”€ --list β€” enumerate entities
β”‚ β”œβ”€β”€ --relations β€” enumerate relations
β”‚ β”œβ”€β”€ --chain <entity> <rel1> <rel2> ... β€” multi-hop
β”‚ └── <entity> <relation> β€” direct query
└── build.zig registration (zig build query)

.vibee Specifications​

Three specifications created and compiled:

  1. specs/tri/named_entity_registry.vibee β€” string-to-vector mapping
  2. specs/tri/multi_hop_cli_pipeline.vibee β€” multi-hop string pipeline
  3. specs/tri/cli_binary_integration.vibee β€” CLI binary verification

All compiled via vibeec β†’ generated/*.zig


Cumulative Level 11 Progress​

LevelTestsDescriptionResult
11.1-11.1573-105Foundation through Massive WeightedPASS
11.17β€”Neuro-Symbolic BenchPASS
11.18106-108Full Planning SOTAPASS
11.19109-111Real-World DemoPASS
11.20112-114Full Engine FusionPASS
11.21115-117Deployment PrototypePASS
11.22118-120User TestingPASS
11.23121-123Massive KG + CLI DispatchPASS
11.24124-126Interactive CLI BinaryPASS

Total: 398 tests, 394 pass, 4 skip, 0 fail


Critical Assessment​

Strengths​

  1. First user-facing product β€” actual CLI binary that users can interact with
  2. 100% accuracy maintained across all 145 queries including named dispatch, multi-hop, and cross-domain
  3. Zero accuracy loss from string-based lookup β€” named registry adds no error
  4. Bipolar commutativity enables reverse queries (unbind country from food→country memory to find food)
  5. Self-contained binary β€” no external dependencies, builds from source in seconds

Weaknesses​

  1. Static KG β€” entities and relations are hardcoded in the source, not loaded from file
  2. 30 entities only β€” the CLI uses stack allocation (not heap), limiting to a small demo KG
  3. No interactive REPL β€” each query requires a full zig build query invocation
  4. Case-sensitive matching β€” entity lookup requires exact spelling

Tech Tree Options for Next Iteration​

OptionDescriptionDifficulty
A. File-Based KG LoadingLoad entities and relations from JSON/CSV file at startupMedium
B. Interactive REPL Modezig build query -- --repl for continuous query sessionsMedium
C. REST API ServerHTTP endpoint for querying the KG from web clientsHard

Conclusion​

Level 11.24 delivers the first interactive CLI binary for Trinity's symbolic reasoning engine. Users can query a knowledge graph from the command line with natural entity names, execute multi-hop chains, and discover available entities and relations. The system achieves 100% accuracy across all 145 test queries.

The CLI binary (zig build query) is the culmination of 24 development cycles β€” from basic ternary VSA operations to a complete, interactive, user-facing symbolic AI tool. It proves that the architecture is not just theoretically sound but practically usable.

Trinity Local. CLI Lives. Quarks: Commanded.