Skip to content

Add BusCommandRouter#1123

Open
ccgsnet wants to merge 7 commits into
masterfrom
bus-command-router
Open

Add BusCommandRouter#1123
ccgsnet wants to merge 7 commits into
masterfrom
bus-command-router

Conversation

@ccgsnet
Copy link
Copy Markdown
Collaborator

@ccgsnet ccgsnet commented May 26, 2026

Summary

Adds a bus-command-router service that routes client commands (get, set, query, evolution) to downstream DAS agents while keeping per-client router parameters.

  • Router commands: get params, set param <key> <value>, query, and evolution with labeled MeTTa ARGs (q/query, ff, cq, cr, cm).
  • Evolution parsing: uses MettaParser to build an atoms tree; cr/cm require the strict 3-level form (((X Y) ...) ...).
  • Parameter safety: set only updates existing keys and enforces the current value type.
  • Client fixes: router client exits cleanly on errors; get params prints key: value lines.

Examples

# Run the BusCommandRouter service
make run-busnode OPTIONS="--service=bus-command-router --config=config/das.json"

# ---- Client

# Get params
make run-client OPTIONS="--service=bus-command-router --config=config/client.json --cmd=get --arg='params'"

# Set param
make run-client OPTIONS="--service=bus-command-router --config=config/client.json --cmd=set --arg='param max_answers 0'"

# Query
make run-client OPTIONS="--service=bus-command-router --config=config/client.json --cmd=query --arg='(Contains (Sentence \"ede ebe cbe dca cbd fae fce fce add eae\") (Word %W))'"

# Evolution
make run-client OPTIONS="--service=bus-command-router --config=config/client.json --cmd=evolution --arg='((q (Contains %sentence1 (Word \"bbb\"))) (ff count_letter) (cq ((Contains %placeholder1 %word1))) (cr (((placeholder1 sentence1)))) (cm (((sentence1 word1)))))'"

Test plan

make bazel 'test --cache_test_results=no //tests/cpp:bus_command_router_test'
Manual smoke test: get / set / query / evolution via run-client against a running bus node

@ccgsnet ccgsnet requested a review from andre-senna May 26, 2026 23:19
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.

1 participant