Skip to content

app-malt: fix add ground truth and compare graphs with edge direction and type - #23

Open
konstde00 wants to merge 4 commits into
Froot-NetSys:a2a-agentxfrom
konstde00:malt-add-ground-truth
Open

konstde00 wants to merge 4 commits into
Froot-NetSys:a2a-agentxfrom
konstde00:malt-add-ground-truth

Conversation

@konstde00

@konstde00 konstde00 commented Nov 4, 2026 •

Copy link
Copy Markdown

Fixes #21.

  1. Add ground truth follows the prompt: a new node's type is a list, and the port created with a new switch is <switch name>.p1. The prompt now says how that port is named and that new ports get physical_capacity_bps 1000. I also fixed RK_CONTROL -> RK_CONTROLS in the prompt (the graph has no RK_CONTROL edges) and added the missing name to the few-shot add example.
  2. Graphs are compared as directed graphs with edge types, so a reversed edge or a wrong edge type no longer passes. An edge type written as a list still matches.
  3. The prompt's hierarchy line adds CONTROL_DOMAIN contains PACKET_SWITCH (133 of the 500 level-1 add queries add a switch to a domain).

With these, the reference answer from #21 passes all 5,000 queries in sampled_500_benchmark_malt.jsonl, and one reversed or mistyped edge fails all 500 level-1 remove queries. 4 new tests (8 cases), all passing:

uv run --with pytest pytest app-malt/test_solid_step_helper.py app-malt/test_text_utils.py

Old and new MALT scores aren't directly comparable, since the prompt and scoring change for every query. main has the same code if you want the fix there too. And if you'd prefer 1e9 over 1000 for new port capacity, it's a small change.

The add helper stored a new node's 'type' as a string while the graph and
the prompt use a list, and named a new switch's port after the dict repr.
Store 'type' as a list, name the port '<switch name>.p1', and state the new
port and its capacity (1000) in the prompt. Also fix the RK_CONTROLS edge
type name in the prompt and add the missing name attribute in the add
example.
The graph comparison ignored edge direction and edge type, so a remove
answer with reversed edges passed. Compare as directed graphs and match
edge 'type'.
Graph answers are compared with edge types since the previous commit,
but the prompt did not say which edge joins a CONTROL_DOMAIN to a
PACKET_SWITCH, and 133 of the 500 level-1 add queries add a switch to a
domain. State 'CONTROL_DOMAIN contains PACKET_SWITCH', as in the graph
(the 8 domains contain all 320 switches through RK_CONTAINS edges) and
in error_check.py, and test that the hierarchy covers the parent of
every level-1 add query.
The three check_graph_equal tests built the same kind of graph pair and
one of them mixed a negative and a positive case. Use one parametrized
test with a case per variant: copy, extra node, reversed edge, wrong
edge type and list edge type.
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.

MALT: some add queries can't be solved by following the prompt

1 participant