From 5a18e3aa1afb3428cb647f788cc0eeea33478199 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 22 Apr 2026 18:49:26 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20#170=20=E2=80=94=20bootstrap-graph=20now?= =?UTF-8?q?=20accepts=20--output-format;=20diagnostic=20surface=20parity?= =?UTF-8?q?=20complete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Final diagnostic surface in the JSON parity sweep: bootstrap-graph (the runtime bootstrap/prefetch visualization) now supports --output-format. Concrete addition: - bootstrap-graph: --output-format {text,json} JSON envelope: {stages: [str], note: 'bootstrap-graph is markdown-only in this version'} Envelope explanation: bootstrap-graph's Markdown output is rich and textual; raw JSON embedding maintains the markdown format (split into lines array) rather than attempting lossy structural extraction that would lose information. This is an honest limitation in this cycle; full JSON schema can be added in a future audit if claws require structured bootstrap data (dependency graphs, prefetch timing, etc.). Backward compatibility: - Default is 'text' (Markdown unchanged) Closes ROADMAP #170. Related: #167, #168, #169. Diagnostic/inventory surface family is now uniformly JSON-capable. Summary, manifest, parity-audit, setup-report, command-graph, tool-pool, bootstrap-graph all accept --output-format. --- src/main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 364fa4f..e4c0504 100644 --- a/src/main.py +++ b/src/main.py @@ -36,7 +36,8 @@ def build_parser() -> argparse.ArgumentParser: command_graph_parser.add_argument('--output-format', choices=['text', 'json'], default='text') tool_pool_parser = subparsers.add_parser('tool-pool', help='show assembled tool pool with default settings') tool_pool_parser.add_argument('--output-format', choices=['text', 'json'], default='text') - subparsers.add_parser('bootstrap-graph', help='show the mirrored bootstrap/runtime graph stages') + bootstrap_graph_parser = subparsers.add_parser('bootstrap-graph', help='show the mirrored bootstrap/runtime graph stages') + bootstrap_graph_parser.add_argument('--output-format', choices=['text', 'json'], default='text') list_parser = subparsers.add_parser('subsystems', help='list the current Python modules in the workspace') list_parser.add_argument('--limit', type=int, default=32) @@ -230,7 +231,13 @@ def main(argv: list[str] | None = None) -> int: print(pool.as_markdown()) return 0 if args.command == 'bootstrap-graph': - print(build_bootstrap_graph().as_markdown()) + graph = build_bootstrap_graph() + if args.output_format == 'json': + import json + envelope = {'stages': graph.as_markdown().split('\n'), 'note': 'bootstrap-graph is markdown-only in this version'} + print(json.dumps(envelope)) + else: + print(graph.as_markdown()) return 0 if args.command == 'subsystems': for subsystem in manifest.top_level_modules[: args.limit]: