task_graph__node_link__edge_text_count¶
Program Contract¶
Program: count(filter(edge_labels(graph), text=target_edge_label)); scene=node_link; scope=edge_text_count
Candidate set: the visible graph, tree, network, route, matrix, table, node, edge, label, weight, path, and option elements inside the edge_text_count objective scope.
Operands: visible scene state and prompt-bound operands named by filter, edge_labels, graph, text, target_edge_label, node_link, edge_text_count.
Operation: evaluate count over the candidate set using the visible graph structure, labels, weights, directions, reachability, paths, connectivity, or option-selection constraints encoded in the program expression; generation enforces a unique final answer.
Output binding: answer uses the integer schema; the count of matching visible edge-label boxes.
Annotation witnesses: annotation uses the bbox_set schema; the bbox_set of all visible edge-label text boxes whose text equals the queried label.
Query ids: single.
Reasoning Operations¶
Families: filtering, counting
1) Identity¶
- Domain:
graph - Scene:
node_link - Scene id:
node_link - Task id:
task_graph__node_link__edge_text_count - Objective: count how many visible edge-label text boxes show one queried label.
2) Scene + task contract¶
- Branch metadata:
query_id query_id:single- Supported
graph_directionalityvalues:undirected answer_gt.type:integerannotation_gt.type:bbox_set- Scene contract:
- one single-panel labeled node-link graph,
- every edge or arrow has a visible boxed text label,
- no self-loops or multi-edges,
- visible node labels use one whole-image label format (
letters,numbers, ornamed), - node count is sampled from
5..8, - visible labeled edge count is capped at
12. - Query contract:
- prompt asks for the count of edge-label boxes whose text exactly matches the queried label,
- default answer support is
1..5, - answer is the count of matching visible edge-label boxes.
- Default visible edge labels are sampled from the shared label manifest with per-instance support size
16. - Edge labels are lowercase text of
3..5characters and are filtered so they do not duplicate any visible node label.
3) Prompt contract¶
- Bundle:
graph_node_link_counting_v1 scene_key:single_graph_countingtask_key:edge_text_label_count_query- Modes:
answer_only,answer_and_annotation - Answer JSON shape:
{"answer":2} - Answer+annotation JSON shape:
{"annotation":[[248,190,300,214],[420,238,472,262]],"answer":2} - Prompt-facing annotation uses pixel-space boxes around every matching visible edge-label text box.
4) Annotation + trace contract¶
- Prompt-facing annotation is the
bbox_setof all visible edge-label text boxes whose text equals the queried label. answer_gt.value == len(annotation_gt.value)by construction.execution_trace.target_edge_labelrecords the queried visible label.execution_trace.edge_attribute_labels_by_label_pairrecords every rendered edge label.execution_trace.matching_edgesrecords the symbolic witness edge-label pairs in deterministic order.scene_ir.entitiesstores node geometry, edge geometry, edge-label bboxes, and edge-label values.projected_annotationincludesbbox_setand edge-label bbox projections.
5) Visual policy¶
- Rendering uses the shared graph light-panel style from
src/trace_tasks/resources/configs/domains/graph/base.yaml. - Edge-label boxes are placed by the shared node-link renderer and must avoid nodes and other edge-label boxes.
- Node label format, edge routing, glyph style, named node color, layout transform, and layout remain visual variation only.
- Edge-label task rendering uses a
960x720canvas and keeps node labels at20pxwhile drawing edge-label text at22px. - Post-render graph noise follows the graph-domain coordinate-preserving noise policy.
6) Determinism + constraints¶
- Deterministic sampling/rendering from
instance_seed. - Answers and annotation come from the same finalized edge-label assignment and rendered bboxes.
- Generation assigns exactly the requested number of edges to the queried label, and all other edges receive non-target labels.
- No semantic auto-relaxation: failures do not weaken the graph, directionality, label support, or count contract.
7) Complexity + tests¶
- Complexity components:
topology_reasoning,visual_scan,ambiguity,clutter - Tests:
tests/test_graph_counting_edge_text_label_count_tasks.py,tests/test_prompt_system.py,tests/test_scene_config.py