From 960403dca7ba4f40c53d81b5e2444b4aceb6e328 Mon Sep 17 00:00:00 2001 From: rctruta <17259677+rctruta@users.noreply.github.com> Date: Mon, 6 Jul 2026 11:40:45 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20--output=20FILE.md=20on=20multi=5Fagent?= =?UTF-8?q?.py=20=E2=80=94=20write=20the=20final=20analysis/answer=20to=20?= =?UTF-8?q?a=20markdown=20file,=20stamped=20with=20model=20+=20run=20id=20?= =?UTF-8?q?+=20a=20verify-before-publication=20note?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/multi_agent.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/multi_agent.py b/scripts/multi_agent.py index af5e6a1..adfc07e 100644 --- a/scripts/multi_agent.py +++ b/scripts/multi_agent.py @@ -50,6 +50,9 @@ def main(): help="Resume a SUSPENDED run: skip config_builder, poll " "this experiment_id, then run the analyzer. The " "goal is still required (the analyzer needs it).") + parser.add_argument("--output", metavar="FILE.md", + help="Write the final analysis/answer to this markdown file " + "(in addition to printing it).") parser.add_argument("--poll-budget-seconds", type=float, default=180.0, help="How long the poll stage waits before suspending.") args = parser.parse_args() @@ -75,6 +78,15 @@ def main(): for stage, sub_id in result.sub_run_ids.items(): console.print(f"[dim] {stage}: {sub_id}[/dim]") + if args.output and result.analysis: + with open(args.output, "w", encoding="utf-8") as f: + f.write(result.analysis + "\n\n---\n" + f"*Generated by {args.model} | orchestrator run " + f"{result.orchestrator_run_id} | outcome: {result.outcome}. " + "Agent-drafted from sealed capsules — verify numbers with " + "scripts/tools/grade_analyses.py before publication.*\n") + console.print(f"[dim]Analysis written to {args.output}[/dim]") + if result.outcome in ("complete", "answered", "needs_experiment") and result.analysis: console.print(Panel(Markdown(result.analysis), title="📊 Analysis", border_style="green"))