fix: extract build_graph_section helper to eliminate duplicate code (#667)
Move graph report generation into build_graph_section() in lib/formula-session.sh. Both planner-run.sh and predictor-run.sh now call the shared helper instead of duplicating the same 11 lines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1e8e4e5112
commit
12d871c865
3 changed files with 24 additions and 22 deletions
|
|
@ -49,17 +49,7 @@ load_formula "$FACTORY_ROOT/formulas/run-planner.toml"
|
|||
build_context_block VISION.md AGENTS.md RESOURCES.md planner/prerequisite-tree.md
|
||||
|
||||
# ── Build structural analysis graph ──────────────────────────────────────
|
||||
GRAPH_REPORT="/tmp/${PROJECT_NAME}-graph-report.json"
|
||||
GRAPH_SECTION=""
|
||||
if python3 "$FACTORY_ROOT/lib/build-graph.py" \
|
||||
--project-root "$PROJECT_REPO_ROOT" \
|
||||
--output "$GRAPH_REPORT" 2>>"$LOG_FILE"; then
|
||||
GRAPH_SECTION=$(printf '\n## Structural analysis\n```json\n%s\n```\n' \
|
||||
"$(cat "$GRAPH_REPORT")")
|
||||
log "graph report generated: $(jq -r '.stats | "\(.nodes) nodes, \(.edges) edges"' "$GRAPH_REPORT")"
|
||||
else
|
||||
log "WARN: build-graph.py failed — continuing without structural analysis"
|
||||
fi
|
||||
build_graph_section
|
||||
|
||||
# ── Read planner memory ─────────────────────────────────────────────────
|
||||
MEMORY_BLOCK=""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue