From 1a8f99c2ea80e01d133b3877f563b713aac1f19d Mon Sep 17 00:00:00 2001 From: graphlemon Date: Sat, 15 Aug 2026 10:30:29 +0800 Subject: [PATCH] graphlemon: auto-commit uncommitted changes for judgment-e93a0c64d8fe-main-checkout-drift --- src/task_query.py | 25 +++++++++++++++++++++++++ src/test_e2e_pipeline.py | 8 ++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/task_query.py b/src/task_query.py index 9723ef7..0a3d8f5 100644 --- a/src/task_query.py +++ b/src/task_query.py @@ -13,6 +13,8 @@ forcing the frontend to make N more round trips. import json +from src import work_graph_plan + _SORT_COLUMNS = ("created_at", "updated_at", "goal_text", "status") @@ -274,6 +276,29 @@ def _loop_back_events_for_run(conn, run_id): return events +def _display_graph_manifest(graph_manifest, nodes): + """v_task_detail's to-do tree/DAG (renderTodoTree/renderGraphVisualizerPanel + in frontend/app.js) render straight off graph_manifest.nodes, in array + order -- but work_graph_run.graph_manifest itself deliberately never + includes the planning call that produced it (work_graph_plan.py's + _record_planning_node docstring: run_graph()/fork/append-mode all read + that column too and must only ever see real, executable nodes). This + prepends a display-only node for that planning call -- sourced from the + real work_node_execution row _record_planning_node already wrote (same + node_exec_id, same log, same output_payload every other node gets) -- + so it shows up as the first, clickable entry in both views without the + persisted manifest itself ever changing. Runs from before this feature + existed have no such row and come back unchanged.""" + if graph_manifest is None: + return None + if not any(n["node_id"] == work_graph_plan.PLANNING_NODE_ID for n in nodes): + return graph_manifest + planning_node = { + "node_id": work_graph_plan.PLANNING_NODE_ID, "artifact_type": "graph_manifest", "depends_on": [], + } + return {"nodes": [planning_node] + graph_manifest["nodes"], "edges": graph_manifest.get("edges", [])} + + def _work_nodes_for_run(conn, run_id): # input_schema_ref/output_schema_ref/quota_limit_type/quota_wait_started_at # added for U-026's hover tooltip + waiting_for_quota display (02-V ยง2.7: diff --git a/src/test_e2e_pipeline.py b/src/test_e2e_pipeline.py index d27c442..340ec0f 100644 --- a/src/test_e2e_pipeline.py +++ b/src/test_e2e_pipeline.py @@ -775,13 +775,17 @@ class ReviewPlannerOutputWithRetriesTest(PipelineTestBase): # Both attempts' nodes exist in the SAME run's work_node_execution, # and the first attempt's already-'done' node was skipped (not # re-executed) the second time around -- exactly 2 trigger_org_ - # node_structured calls total, not 3. + # node_structured calls total, not 3. "__planning__" is the fresh + # (first) plan_work_graph() call's own synthetic node + # (work_graph_plan._record_planning_node) -- only the fresh branch + # records one, so the re-plan (append_to_run_id) doesn't add a + # second. node_ids = { row[0] for row in self.conn.execute( "SELECT node_id FROM work_node_execution WHERE run_id = ?", (shared_run_id,) ).fetchall() } - self.assertEqual(node_ids, {"sdd", "sdd_v2"}) + self.assertEqual(node_ids, {"__planning__", "sdd", "sdd_v2"}) self.assertEqual(mock_trigger_structured.call_count, 2) # The final PASS'd artifact is the SECOND attempt's content. -- libgit2 0.21.4