-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsumd.json
More file actions
102 lines (102 loc) · 37.4 KB
/
Copy pathsumd.json
File metadata and controls
102 lines (102 loc) · 37.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
"project_name": "swop",
"description": "SUMD - Structured Unified Markdown Descriptor for AI-aware project refactorization",
"sections": [
{
"name": "contents",
"type": "unknown",
"content": "- [Metadata](#metadata)\n- [Architecture](#architecture)\n- [Workflows](#workflows)\n- [Dependencies](#dependencies)\n- [Call Graph](#call-graph)\n- [Refactoring Analysis](#refactoring-analysis)\n- [Intent](#intent)",
"level": 2
},
{
"name": "metadata",
"type": "metadata",
"content": "- **name**: `swop`\n- **version**: `0.2.6`\n- **python_requires**: `>=3.8`\n- **license**: Apache-2.0\n- **ai_model**: `openrouter/qwen/qwen3-coder-next`\n- **ecosystem**: SUMD + DOQL + testql + taskfile\n- **generated_from**: pyproject.toml, app.doql.less, goal.yaml, .env.example, project/(5 analysis files)",
"level": 2
},
{
"name": "architecture",
"type": "architecture",
"content": "```\nSUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)\n```",
"level": 2
},
{
"name": "# doql application declaration (`app.doql.less`)",
"type": "unknown",
"content": "```less markpact:doql path=app.doql.less\n// LESS format — define @variables here as needed\n// Generated by sumd for swop\n\napp {\n name: swop;\n version: 0.2.6;\n}\n\ninterface[type=\"cli\"] {\n framework: click;\n}\n\nworkflow[name=\"install\"] {\n trigger: manual;\n step-1: run cmd=pip install -e .;\n}\n\nworkflow[name=\"dev\"] {\n trigger: manual;\n step-1: run cmd=pip install -e \".[dev]\";\n}\n\nworkflow[name=\"build\"] {\n trigger: manual;\n step-1: run cmd=python -m build;\n}\n\nworkflow[name=\"test\"] {\n trigger: manual;\n step-1: run cmd=pytest -q;\n}\n\nworkflow[name=\"lint\"] {\n trigger: manual;\n step-1: run cmd=ruff check .;\n}\n\nworkflow[name=\"fmt\"] {\n trigger: manual;\n step-1: run cmd=ruff format .;\n}\n\nworkflow[name=\"clean\"] {\n trigger: manual;\n step-1: run cmd=rm -rf build/ dist/ *.egg-info;\n}\n\nworkflow[name=\"help\"] {\n trigger: manual;\n step-1: run cmd=task --list;\n}\n\ndeploy {\n target: pip;\n}\n\nenvironment[name=\"local\"] {\n runtime: python;\n}\n```",
"level": 2
},
{
"name": "workflows",
"type": "workflows",
"content": "",
"level": 2
},
{
"name": "dependencies",
"type": "dependencies",
"content": "",
"level": 2
},
{
"name": "# runtime",
"type": "unknown",
"content": "```text markpact:deps python\npyyaml>=6.0\n```",
"level": 2
},
{
"name": "# development",
"type": "unknown",
"content": "```text markpact:deps python scope=dev\npytest>=7.0\npytest-cov>=4.0\ngoal>=2.1.0\ncosts>=0.1.20\npfix>=0.1.60\n```",
"level": 2
},
{
"name": "call graph",
"type": "unknown",
"content": "*124 nodes · 138 edges · 22 modules · CC̄=1.5*",
"level": 2
},
{
"name": "# hubs (by degree)",
"type": "unknown",
"content": "| Function | CC | in | out | total |\n|----------|----|----|-----|-------|\n| `_build_parser` *(in swop.cli)* | 1 | 1 | 115 | **116** |\n| `print` *(in examples.manifest)* | 0 | 67 | 0 | **67** |\n| `render_proto_for_context` *(in swop.proto.generator)* | 12 ⚠ | 1 | 43 | **44** |\n| `_diff_fields` *(in swop.resolve.resolver)* | 11 ⚠ | 1 | 43 | **44** |\n| `_map_python_type` *(in swop.proto.generator)* | 15 ⚠ | 3 | 25 | **28** |\n| `_from_dict` *(in swop.config)* | 8 | 1 | 25 | **26** |\n| `render_html` *(in swop.scan.render)* | 8 | 1 | 25 | **26** |\n| `init_project` *(in swop.tools.init)* | 14 ⚠ | 1 | 25 | **26** |\n\n```toon markpact:analysis path=project/calls.toon.yaml\n# code2llm call graph | /home/tom/github/semcod/inspect\n# nodes: 124 | edges: 138 | modules: 22\n# CC̄=1.5\n\nHUBS[20]:\n swop.cli._build_parser\n CC=1 in:1 out:115 total:116\n examples.manifest.print\n CC=0 in:67 out:0 total:67\n swop.proto.generator.render_proto_for_context\n CC=12 in:1 out:43 total:44\n swop.resolve.resolver._diff_fields\n CC=11 in:1 out:43 total:44\n swop.proto.generator._map_python_type\n CC=15 in:3 out:25 total:28\n swop.config._from_dict\n CC=8 in:1 out:25 total:26\n swop.scan.render.render_html\n CC=8 in:1 out:25 total:26\n swop.tools.init.init_project\n CC=14 in:1 out:25 total:26\n swop.tools.doctor_deep._check_proto_vs_python\n CC=15 in:1 out:25 total:26\n swop.tools.doctor_deep._check_manifests_vs_proto\n CC=15 in:1 out:24 total:25\n swop.proto.compiler.compile_proto_typescript\n CC=10 in:1 out:23 total:24\n swop.commands._generate_build_graph\n CC=14 in:1 out:22 total:23\n swop.tools.doctor_deep._check_manifests_vs_services\n CC=15 in:1 out:22 total:23\n swop.proto.compiler.compile_proto_python\n CC=8 in:1 out:21 total:22\n swop.resolve.resolver._index_from_manifests\n CC=15 in:1 out:21 total:22\n swop.config.load_config\n CC=6 in:9 out:12 total:21\n swop.proto.generator.generate_proto_from_manifests\n CC=8 in:1 out:20 total:21\n swop.services.generator._write_context_package\n CC=7 in:1 out:20 total:21\n swop.scan.scanner._scan_file\n CC=13 in:1 out:20 total:21\n swop.commands._cmd_scan\n CC=14 in:0 out:20 total:20\n\nMODULES:\n SUMD [1 funcs]\n build_project_graph CC=0 out:0\n examples.manifest [1 funcs]\n print CC=0 out:0\n swop.cli [2 funcs]\n _build_parser CC=1 out:115\n main CC=1 out:3\n swop.commands [24 funcs]\n _build_runtime CC=1 out:4\n _cmd_diff CC=2 out:3\n _cmd_doctor CC=3 out:6\n _cmd_export CC=2 out:4\n _cmd_gen_grpc_python CC=7 out:11\n _cmd_gen_grpc_ts CC=7 out:11\n _cmd_gen_manifests CC=8 out:11\n _cmd_gen_proto CC=7 out:13\n _cmd_gen_services CC=12 out:16\n _cmd_generate CC=7 out:11\n swop.config [7 funcs]\n _expand_env CC=6 out:10\n _from_dict CC=8 out:25\n _parse_bus CC=3 out:9\n _parse_context CC=3 out:8\n _parse_read_models CC=3 out:9\n _pop_known CC=3 out:1\n load_config CC=6 out:12\n swop.core [1 funcs]\n run_sync CC=1 out:8\n swop.cqrs.decorators [4 funcs]\n _collect_source CC=3 out:2\n _make_decorator CC=1 out:11\n _normalize_emits CC=4 out:5\n handler CC=7 out:12\n swop.manifests.generator [10 funcs]\n _camel_to_dot CC=5 out:9\n _handler_index CC=4 out:1\n _render_bus CC=6 out:3\n _render_entry CC=10 out:7\n _render_field CC=3 out:0\n _render_handler CC=2 out:0\n _render_manifest CC=2 out:3\n _render_source CC=2 out:0\n _safe_dirname CC=2 out:3\n generate_manifests CC=10 out:11\n swop.markpact.sync_engine [2 funcs]\n check CC=7 out:11\n _hash CC=1 out:3\n swop.proto.compiler [4 funcs]\n _iter_proto_files CC=1 out:3\n _run CC=2 out:3\n compile_proto_python CC=8 out:21\n compile_proto_typescript CC=10 out:23\n swop.proto.generator [7 funcs]\n _iter_contexts CC=6 out:7\n _load_manifest CC=4 out:4\n _map_python_type CC=15 out:25\n _render_message CC=8 out:10\n _safe_ident CC=3 out:3\n generate_proto_from_manifests CC=8 out:20\n render_proto_for_context CC=12 out:43\n swop.reconcile [2 funcs]\n _auto_heal CC=4 out:2\n _log_drift CC=1 out:6\n swop.refactor.pipeline [2 funcs]\n _link_models_to_ui CC=8 out:7\n _tokenize CC=4 out:4\n swop.resolve.resolver [9 funcs]\n _diff_entry CC=3 out:4\n _diff_fields CC=11 out:43\n _diff_metadata CC=9 out:16\n _handler_shape CC=3 out:0\n _handler_sig CC=8 out:4\n _index_from_detections CC=10 out:6\n _index_from_manifests CC=15 out:21\n apply_resolution CC=3 out:2\n resolve_schema_drift CC=4 out:14\n swop.scan.render [3 funcs]\n render_html CC=8 out:25\n render_json CC=2 out:2\n write_report CC=3 out:8\n swop.scan.scanner [18 funcs]\n _base_name CC=3 out:2\n _classify CC=18 out:15\n _context_for_path CC=8 out:4\n _decorator_name CC=4 out:4\n _extract_detections CC=7 out:7\n _extract_fields CC=15 out:18\n _handler_method_name CC=4 out:1\n _handler_target_from_method CC=11 out:5\n _iter_python_files CC=10 out:11\n _kind_by_base CC=3 out:0\n swop.services.generator [11 funcs]\n _camel CC=4 out:3\n _default_bus_url CC=1 out:1\n _render_compose CC=6 out:8\n _render_dockerfile CC=1 out:0\n _render_init CC=1 out:0\n _render_publisher CC=1 out:0\n _render_requirements CC=4 out:4\n _render_server CC=7 out:9\n _render_worker CC=2 out:0\n _safe_ident CC=3 out:3\n swop.tools.doctor [4 funcs]\n _check_binary CC=4 out:5\n _first_version CC=3 out:2\n _run_version CC=5 out:3\n run_doctor CC=2 out:17\n swop.tools.doctor_deep [6 funcs]\n _check_manifests_vs_proto CC=15 out:24\n _check_manifests_vs_services CC=15 out:22\n _check_proto_vs_python CC=15 out:25\n _check_scan_vs_manifests CC=8 out:10\n _latest_mtime CC=6 out:4\n run_deep_doctor CC=1 out:9\n swop.tools.init [1 funcs]\n init_project CC=14 out:25\n swop.versioning [1 funcs]\n commit CC=1 out:4\n swop.watch.engine [4 funcs]\n poll_once CC=5 out:7\n run CC=9 out:5\n _diff_snapshots CC=5 out:6\n rebuild_once CC=2 out:6\n\nEDGES:\n swop.config._parse_context → swop.config._pop_known\n swop.config._parse_bus → swop.config._pop_known\n swop.config._parse_read_models → swop.config._pop_known\n swop.config.load_config → swop.config._from_dict\n swop.config.load_config → swop.config._expand_env\n swop.reconcile.ResyncEngine._auto_heal → examples.manifest.print\n swop.reconcile.ResyncEngine._log_drift → examples.manifest.print\n swop.cli.main → swop.cli._build_parser\n swop.versioning.Versioning.commit → examples.manifest.print\n swop.commands._cmd_sync → swop.commands._build_runtime\n swop.commands._cmd_inspect → swop.commands._build_runtime\n swop.commands._cmd_inspect → examples.manifest.print\n swop.commands._cmd_diff → swop.commands._build_runtime\n swop.commands._cmd_state → swop.commands._build_runtime\n swop.commands._cmd_state → examples.manifest.print\n swop.commands._cmd_export → swop.commands._build_runtime\n swop.commands._cmd_export → examples.manifest.print\n swop.commands._cmd_doctor → swop.tools.doctor.run_doctor\n swop.commands._cmd_doctor → examples.manifest.print\n swop.commands._cmd_init → swop.tools.init.init_project\n swop.commands._cmd_init → examples.manifest.print\n swop.commands._cmd_scan → swop.scan.scanner.scan_project\n swop.commands._cmd_scan → swop.config.load_config\n swop.commands._cmd_scan → swop.scan.render.write_report\n swop.commands._cmd_scan → examples.manifest.print\n swop.commands._cmd_gen_manifests → swop.scan.scanner.scan_project\n swop.commands._cmd_gen_manifests → swop.manifests.generator.generate_manifests\n swop.commands._cmd_gen_manifests → examples.manifest.print\n swop.commands._cmd_gen_manifests → swop.config.load_config\n swop.commands._cmd_gen_proto → swop.proto.generator.generate_proto_from_manifests\n swop.commands._cmd_gen_proto → examples.manifest.print\n swop.commands._cmd_gen_proto → swop.config.load_config\n swop.commands._cmd_gen_grpc_python → swop.proto.compiler.compile_proto_python\n swop.commands._cmd_gen_grpc_python → examples.manifest.print\n swop.commands._cmd_gen_grpc_python → swop.config.load_config\n swop.commands._cmd_gen_grpc_ts → swop.proto.compiler.compile_proto_typescript\n swop.commands._cmd_gen_grpc_ts → examples.manifest.print\n swop.commands._cmd_gen_grpc_ts → swop.config.load_config\n swop.commands._cmd_gen_services → examples.manifest.print\n swop.commands._cmd_gen_services → swop.config.load_config\n swop.commands._cmd_watch → examples.manifest.print\n swop.commands._cmd_watch → swop.watch.engine.rebuild_once\n swop.commands._cmd_watch → swop.config.load_config\n swop.commands._cmd_resolve → swop.scan.scanner.scan_project\n swop.commands._cmd_resolve → swop.resolve.resolver.resolve_schema_drift\n swop.commands._cmd_resolve → swop.config.load_config\n swop.commands._cmd_resolve → examples.manifest.print\n swop.commands._cmd_resolve → swop.resolve.resolver.apply_resolution\n swop.commands._cmd_refactor → examples.manifest.print\n swop.commands._generate_parse_manifest → examples.manifest.print\n```",
"level": 2
},
{
"name": "refactoring analysis",
"type": "unknown",
"content": "*Pre-refactoring snapshot — use this section to identify targets. Generated from `project/` toon files.*",
"level": 2
},
{
"name": "# call graph & complexity (`project/calls.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/calls.toon.yaml\n# code2llm call graph | /home/tom/github/semcod/inspect\n# nodes: 124 | edges: 138 | modules: 22\n# CC̄=1.5\n\nHUBS[20]:\n swop.cli._build_parser\n CC=1 in:1 out:115 total:116\n examples.manifest.print\n CC=0 in:67 out:0 total:67\n swop.proto.generator.render_proto_for_context\n CC=12 in:1 out:43 total:44\n swop.resolve.resolver._diff_fields\n CC=11 in:1 out:43 total:44\n swop.proto.generator._map_python_type\n CC=15 in:3 out:25 total:28\n swop.config._from_dict\n CC=8 in:1 out:25 total:26\n swop.scan.render.render_html\n CC=8 in:1 out:25 total:26\n swop.tools.init.init_project\n CC=14 in:1 out:25 total:26\n swop.tools.doctor_deep._check_proto_vs_python\n CC=15 in:1 out:25 total:26\n swop.tools.doctor_deep._check_manifests_vs_proto\n CC=15 in:1 out:24 total:25\n swop.proto.compiler.compile_proto_typescript\n CC=10 in:1 out:23 total:24\n swop.commands._generate_build_graph\n CC=14 in:1 out:22 total:23\n swop.tools.doctor_deep._check_manifests_vs_services\n CC=15 in:1 out:22 total:23\n swop.proto.compiler.compile_proto_python\n CC=8 in:1 out:21 total:22\n swop.resolve.resolver._index_from_manifests\n CC=15 in:1 out:21 total:22\n swop.config.load_config\n CC=6 in:9 out:12 total:21\n swop.proto.generator.generate_proto_from_manifests\n CC=8 in:1 out:20 total:21\n swop.services.generator._write_context_package\n CC=7 in:1 out:20 total:21\n swop.scan.scanner._scan_file\n CC=13 in:1 out:20 total:21\n swop.commands._cmd_scan\n CC=14 in:0 out:20 total:20\n\nMODULES:\n SUMD [1 funcs]\n build_project_graph CC=0 out:0\n examples.manifest [1 funcs]\n print CC=0 out:0\n swop.cli [2 funcs]\n _build_parser CC=1 out:115\n main CC=1 out:3\n swop.commands [24 funcs]\n _build_runtime CC=1 out:4\n _cmd_diff CC=2 out:3\n _cmd_doctor CC=3 out:6\n _cmd_export CC=2 out:4\n _cmd_gen_grpc_python CC=7 out:11\n _cmd_gen_grpc_ts CC=7 out:11\n _cmd_gen_manifests CC=8 out:11\n _cmd_gen_proto CC=7 out:13\n _cmd_gen_services CC=12 out:16\n _cmd_generate CC=7 out:11\n swop.config [7 funcs]\n _expand_env CC=6 out:10\n _from_dict CC=8 out:25\n _parse_bus CC=3 out:9\n _parse_context CC=3 out:8\n _parse_read_models CC=3 out:9\n _pop_known CC=3 out:1\n load_config CC=6 out:12\n swop.core [1 funcs]\n run_sync CC=1 out:8\n swop.cqrs.decorators [4 funcs]\n _collect_source CC=3 out:2\n _make_decorator CC=1 out:11\n _normalize_emits CC=4 out:5\n handler CC=7 out:12\n swop.manifests.generator [10 funcs]\n _camel_to_dot CC=5 out:9\n _handler_index CC=4 out:1\n _render_bus CC=6 out:3\n _render_entry CC=10 out:7\n _render_field CC=3 out:0\n _render_handler CC=2 out:0\n _render_manifest CC=2 out:3\n _render_source CC=2 out:0\n _safe_dirname CC=2 out:3\n generate_manifests CC=10 out:11\n swop.markpact.sync_engine [2 funcs]\n check CC=7 out:11\n _hash CC=1 out:3\n swop.proto.compiler [4 funcs]\n _iter_proto_files CC=1 out:3\n _run CC=2 out:3\n compile_proto_python CC=8 out:21\n compile_proto_typescript CC=10 out:23\n swop.proto.generator [7 funcs]\n _iter_contexts CC=6 out:7\n _load_manifest CC=4 out:4\n _map_python_type CC=15 out:25\n _render_message CC=8 out:10\n _safe_ident CC=3 out:3\n generate_proto_from_manifests CC=8 out:20\n render_proto_for_context CC=12 out:43\n swop.reconcile [2 funcs]\n _auto_heal CC=4 out:2\n _log_drift CC=1 out:6\n swop.refactor.pipeline [2 funcs]\n _link_models_to_ui CC=8 out:7\n _tokenize CC=4 out:4\n swop.resolve.resolver [9 funcs]\n _diff_entry CC=3 out:4\n _diff_fields CC=11 out:43\n _diff_metadata CC=9 out:16\n _handler_shape CC=3 out:0\n _handler_sig CC=8 out:4\n _index_from_detections CC=10 out:6\n _index_from_manifests CC=15 out:21\n apply_resolution CC=3 out:2\n resolve_schema_drift CC=4 out:14\n swop.scan.render [3 funcs]\n render_html CC=8 out:25\n render_json CC=2 out:2\n write_report CC=3 out:8\n swop.scan.scanner [18 funcs]\n _base_name CC=3 out:2\n _classify CC=18 out:15\n _context_for_path CC=8 out:4\n _decorator_name CC=4 out:4\n _extract_detections CC=7 out:7\n _extract_fields CC=15 out:18\n _handler_method_name CC=4 out:1\n _handler_target_from_method CC=11 out:5\n _iter_python_files CC=10 out:11\n _kind_by_base CC=3 out:0\n swop.services.generator [11 funcs]\n _camel CC=4 out:3\n _default_bus_url CC=1 out:1\n _render_compose CC=6 out:8\n _render_dockerfile CC=1 out:0\n _render_init CC=1 out:0\n _render_publisher CC=1 out:0\n _render_requirements CC=4 out:4\n _render_server CC=7 out:9\n _render_worker CC=2 out:0\n _safe_ident CC=3 out:3\n swop.tools.doctor [4 funcs]\n _check_binary CC=4 out:5\n _first_version CC=3 out:2\n _run_version CC=5 out:3\n run_doctor CC=2 out:17\n swop.tools.doctor_deep [6 funcs]\n _check_manifests_vs_proto CC=15 out:24\n _check_manifests_vs_services CC=15 out:22\n _check_proto_vs_python CC=15 out:25\n _check_scan_vs_manifests CC=8 out:10\n _latest_mtime CC=6 out:4\n run_deep_doctor CC=1 out:9\n swop.tools.init [1 funcs]\n init_project CC=14 out:25\n swop.versioning [1 funcs]\n commit CC=1 out:4\n swop.watch.engine [4 funcs]\n poll_once CC=5 out:7\n run CC=9 out:5\n _diff_snapshots CC=5 out:6\n rebuild_once CC=2 out:6\n\nEDGES:\n swop.config._parse_context → swop.config._pop_known\n swop.config._parse_bus → swop.config._pop_known\n swop.config._parse_read_models → swop.config._pop_known\n swop.config.load_config → swop.config._from_dict\n swop.config.load_config → swop.config._expand_env\n swop.reconcile.ResyncEngine._auto_heal → examples.manifest.print\n swop.reconcile.ResyncEngine._log_drift → examples.manifest.print\n swop.cli.main → swop.cli._build_parser\n swop.versioning.Versioning.commit → examples.manifest.print\n swop.commands._cmd_sync → swop.commands._build_runtime\n swop.commands._cmd_inspect → swop.commands._build_runtime\n swop.commands._cmd_inspect → examples.manifest.print\n swop.commands._cmd_diff → swop.commands._build_runtime\n swop.commands._cmd_state → swop.commands._build_runtime\n swop.commands._cmd_state → examples.manifest.print\n swop.commands._cmd_export → swop.commands._build_runtime\n swop.commands._cmd_export → examples.manifest.print\n swop.commands._cmd_doctor → swop.tools.doctor.run_doctor\n swop.commands._cmd_doctor → examples.manifest.print\n swop.commands._cmd_init → swop.tools.init.init_project\n swop.commands._cmd_init → examples.manifest.print\n swop.commands._cmd_scan → swop.scan.scanner.scan_project\n swop.commands._cmd_scan → swop.config.load_config\n swop.commands._cmd_scan → swop.scan.render.write_report\n swop.commands._cmd_scan → examples.manifest.print\n swop.commands._cmd_gen_manifests → swop.scan.scanner.scan_project\n swop.commands._cmd_gen_manifests → swop.manifests.generator.generate_manifests\n swop.commands._cmd_gen_manifests → examples.manifest.print\n swop.commands._cmd_gen_manifests → swop.config.load_config\n swop.commands._cmd_gen_proto → swop.proto.generator.generate_proto_from_manifests\n swop.commands._cmd_gen_proto → examples.manifest.print\n swop.commands._cmd_gen_proto → swop.config.load_config\n swop.commands._cmd_gen_grpc_python → swop.proto.compiler.compile_proto_python\n swop.commands._cmd_gen_grpc_python → examples.manifest.print\n swop.commands._cmd_gen_grpc_python → swop.config.load_config\n swop.commands._cmd_gen_grpc_ts → swop.proto.compiler.compile_proto_typescript\n swop.commands._cmd_gen_grpc_ts → examples.manifest.print\n swop.commands._cmd_gen_grpc_ts → swop.config.load_config\n swop.commands._cmd_gen_services → examples.manifest.print\n swop.commands._cmd_gen_services → swop.config.load_config\n swop.commands._cmd_watch → examples.manifest.print\n swop.commands._cmd_watch → swop.watch.engine.rebuild_once\n swop.commands._cmd_watch → swop.config.load_config\n swop.commands._cmd_resolve → swop.scan.scanner.scan_project\n swop.commands._cmd_resolve → swop.resolve.resolver.resolve_schema_drift\n swop.commands._cmd_resolve → swop.config.load_config\n swop.commands._cmd_resolve → examples.manifest.print\n swop.commands._cmd_resolve → swop.resolve.resolver.apply_resolution\n swop.commands._cmd_refactor → examples.manifest.print\n swop.commands._generate_parse_manifest → examples.manifest.print\n```",
"level": 2
},
{
"name": "# code analysis (`project/analysis.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/analysis.toon.yaml\n# code2llm | 74f 15989L | python:54,yaml:8,md:7,shell:2,toml:1,json:1,txt:1 | 2026-04-23\n# CC̄=1.5 | critical:8/945 | dups:0 | cycles:0\n\nHEALTH[8]:\n 🟡 CC _classify CC=18 (limit:15)\n 🟡 CC _extract_fields CC=15 (limit:15)\n 🟡 CC _map_python_type CC=15 (limit:15)\n 🟡 CC _cluster_to_spec CC=23 (limit:15)\n 🟡 CC _index_from_manifests CC=15 (limit:15)\n 🟡 CC _check_manifests_vs_proto CC=15 (limit:15)\n 🟡 CC _check_proto_vs_python CC=15 (limit:15)\n 🟡 CC _check_manifests_vs_services CC=15 (limit:15)\n\nREFACTOR[1]:\n 1. split 8 high-CC methods (CC>15)\n\nPIPELINES[186]:\n [1] Src [list_devices]: list_devices\n PURITY: 100% pure\n [2] Src [create_reading]: create_reading\n PURITY: 100% pure\n [3] Src [iter_source_roots]: iter_source_roots\n PURITY: 100% pure\n [4] Src [exists]: exists\n PURITY: 100% pure\n [5] Src [compute]: compute\n PURITY: 100% pure\n\nLAYERS:\n swop/ CC̄=4.4 ←in:1 →out:83 !! split\n │ !! generator 686L 2C 17m CC=11 ←1\n │ !! scanner 559L 0C 23m CC=18 ←3\n │ !! doql_bridge 506L 2C 28m CC=13 ←0\n │ commands 472L 0C 24m CC=14 ←0\n │ cli 459L 0C 2m CC=1 ←0\n │ !! resolver 456L 3C 15m CC=15 ←2\n │ !! generator 413L 3C 11m CC=15 ←1\n │ !! doctor_deep 369L 3C 10m CC=15 ←0\n │ !! pipeline 284L 2C 10m CC=23 ←0\n │ generator 244L 2C 12m CC=10 ←3\n │ engine 212L 2C 7m CC=9 ←1\n │ spec_models 212L 20C 0m CC=0.0 ←0\n │ config 209L 5C 9m CC=8 ←2\n │ report 209L 4C 11m CC=7 ←1\n │ compiler 207L 1C 6m CC=10 ←1\n │ sync_engine 201L 2C 7m CC=11 ←0\n │ doctor 193L 2C 10m CC=7 ←1\n │ init 160L 1C 3m CC=14 ←1\n │ decorators 158L 0C 4m CC=7 ←0\n │ clustering 158L 3C 8m CC=12 ←0\n │ backend 156L 4C 7m CC=11 ←0\n │ __init__ 149L 0C 0m CC=0.0 ←0\n │ render 141L 0C 3m CC=8 ←1\n │ parser 141L 2C 11m CC=11 ←0\n │ frontend 128L 2C 8m CC=10 ←0\n │ reconcile 111L 4C 7m CC=7 ←0\n │ cache 111L 2C 10m CC=7 ←1\n │ core 105L 1C 8m CC=3 ←0\n │ registry 105L 2C 12m CC=3 ←1\n │ graph 100L 3C 7m CC=4 ←0\n │ db 53L 2C 3m CC=5 ←0\n │ graph 49L 6C 0m CC=0.0 ←0\n │ yaml 48L 1C 2m CC=5 ←0\n │ sync 47L 1C 3m CC=7 ←0\n │ __init__ 43L 0C 0m CC=0.0 ←0\n │ frontend 40L 1C 2m CC=4 ←0\n │ __init__ 34L 0C 0m CC=0.0 ←0\n │ docker 32L 1C 2m CC=3 ←0\n │ backend 32L 1C 4m CC=3 ←0\n │ __init__ 32L 0C 0m CC=0.0 ←0\n │ __init__ 30L 0C 0m CC=0.0 ←0\n │ __init__ 30L 0C 0m CC=0.0 ←0\n │ __init__ 28L 0C 0m CC=0.0 ←0\n │ __init__ 27L 0C 0m CC=0.0 ←0\n │ versioning 25L 1C 1m CC=1 ←0\n │ utils 23L 0C 3m CC=1 ←0\n │ __init__ 23L 0C 0m CC=0.0 ←0\n │ __init__ 17L 0C 0m CC=0.0 ←0\n │ __init__ 12L 0C 0m CC=0.0 ←0\n │ __init__ 12L 0C 0m CC=0.0 ←0\n │ __init__ 11L 0C 0m CC=0.0 ←0\n │ __init__ 7L 0C 0m CC=0.0 ←0\n │\n examples/ CC̄=0.4 ←in:67 →out:0\n │ manifest.md 387L 2C 3m CC=0.0 ←5\n │ models 16L 2C 0m CC=0.0 ←0\n │ api 12L 0C 2m CC=1 ←0\n │\n ./ CC̄=0.0 ←in:0 →out:0\n │ !! SUMD.md 1031L 0C 315m CC=0.0 ←1\n │ !! SUMR.md 871L 0C 0m CC=0.0 ←0\n │ !! goal.yaml 512L 0C 0m CC=0.0 ←0\n │ CHANGELOG.md 236L 0C 0m CC=0.0 ←0\n │ sumd.json 102L 0C 0m CC=0.0 ←0\n │ pyproject.toml 76L 0C 0m CC=0.0 ←0\n │ README.md 60L 0C 0m CC=0.0 ←0\n │ project.sh 36L 0C 0m CC=0.0 ←0\n │ tree.sh 1L 0C 0m CC=0.0 ←0\n │\n project/ CC̄=0.0 ←in:0 →out:0\n │ !! calls.yaml 2252L 0C 0m CC=0.0 ←0\n │ !! map.toon.yaml 625L 0C 315m CC=0.0 ←0\n │ !! context.md 574L 0C 0m CC=0.0 ←0\n │ README.md 339L 0C 0m CC=0.0 ←0\n │ calls.toon.yaml 218L 0C 0m CC=0.0 ←0\n │ analysis.toon.yaml 127L 0C 0m CC=0.0 ←0\n │ evolution.toon.yaml 74L 0C 0m CC=0.0 ←0\n │ duplication.toon.yaml 73L 0C 0m CC=0.0 ←0\n │ project.toon.yaml 51L 0C 0m CC=0.0 ←0\n │ prompt.txt 47L 0C 0m CC=0.0 ←0\n │\n\nCOUPLING:\n swop examples swop.scan swop.watch swop.resolve swop.tools swop.manifests swop.proto SUMD swop.services\n swop ── 66 5 2 2 2 1 3 1 1 !! fan-out\n examples ←66 ── ←1 hub\n swop.scan 1 ── ←1 ←1 hub\n swop.watch ←2 1 1 ── 1 \n swop.resolve ←2 ── ←1 1 \n swop.tools ←2 1 1 ── \n swop.manifests ←1 ←1 ←1 ── \n swop.proto ←3 ── \n SUMD ←1 ── \n swop.services ←1 ──\n CYCLES: none\n HUB: swop.scan/ (fan-in=7)\n HUB: examples/ (fan-in=67)\n SMELL: swop/ fan-out=83 → split needed\n\nEXTERNAL:\n validation: run `vallm batch .` → validation.toon\n duplication: run `redup scan .` → duplication.toon\n```",
"level": 2
},
{
"name": "# duplication (`project/duplication.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/duplication.toon.yaml\n# redup/duplication | 6 groups | 57f 9169L | 2026-04-23\n\nSUMMARY:\n files_scanned: 57\n total_lines: 9169\n dup_groups: 6\n dup_fragments: 12\n saved_lines: 72\n scan_ms: 4564\n\nHOTSPOTS[7] (files with most duplication):\n swop/markpact/graph_builder.py dup=54L groups=1 frags=2 (0.6%)\n swop/config.py dup=24L groups=1 frags=2 (0.3%)\n swop/commands.py dup=18L groups=1 frags=2 (0.2%)\n swop/proto/generator.py dup=15L groups=2 frags=2 (0.2%)\n swop/services/generator.py dup=11L groups=2 frags=2 (0.1%)\n swop/tools/doctor.py dup=10L groups=1 frags=1 (0.1%)\n swop/tools/doctor_deep.py dup=10L groups=1 frags=1 (0.1%)\n\nDUPLICATES[6] (ranked by impact):\n [efccf54f46437221] STRU _build_environments L=27 N=2 saved=27 sim=1.00\n swop/markpact/graph_builder.py:261-287 (_build_environments)\n swop/markpact/graph_builder.py:290-316 (_build_infrastructures)\n [74019da8a30208a6] STRU _parse_bus L=11 N=2 saved=11 sim=1.00\n swop/config.py:135-145 (_parse_bus)\n swop/config.py:148-160 (_parse_read_models)\n [f8704ba8fb938ef5] STRU format L=10 N=2 saved=10 sim=1.00\n swop/tools/doctor.py:64-73 (format)\n swop/tools/doctor_deep.py:98-107 (format)\n [1615571e1d3ba70f] STRU _generate_update_from_disk L=9 N=2 saved=9 sim=1.00\n swop/commands.py:415-423 (_generate_update_from_disk)\n swop/commands.py:426-434 (_generate_sync_files)\n [24a81bc8467ea7c4] STRU _render_query_response L=8 N=2 saved=8 sim=1.00\n swop/proto/generator.py:388-395 (_render_query_response)\n swop/services/generator.py:232-235 (_render_init)\n [ad43bea74422d1bd] STRU _safe_ident L=7 N=2 saved=7 sim=1.00\n swop/proto/generator.py:407-413 (_safe_ident)\n swop/services/generator.py:675-681 (_safe_ident)\n\nREFACTOR[6] (ranked by priority):\n [1] ○ extract_function → swop/markpact/utils/_build_environments.py\n WHY: 2 occurrences of 27-line block across 1 files — saves 27 lines\n FILES: swop/markpact/graph_builder.py\n [2] ○ extract_function → swop/utils/_parse_bus.py\n WHY: 2 occurrences of 11-line block across 1 files — saves 11 lines\n FILES: swop/config.py\n [3] ○ extract_function → swop/tools/utils/format.py\n WHY: 2 occurrences of 10-line block across 2 files — saves 10 lines\n FILES: swop/tools/doctor.py, swop/tools/doctor_deep.py\n [4] ○ extract_function → swop/utils/_generate_update_from_disk.py\n WHY: 2 occurrences of 9-line block across 1 files — saves 9 lines\n FILES: swop/commands.py\n [5] ○ extract_function → swop/utils/_render_query_response.py\n WHY: 2 occurrences of 8-line block across 2 files — saves 8 lines\n FILES: swop/proto/generator.py, swop/services/generator.py\n [6] ○ extract_function → swop/utils/_safe_ident.py\n WHY: 2 occurrences of 7-line block across 2 files — saves 7 lines\n FILES: swop/proto/generator.py, swop/services/generator.py\n\nQUICK_WINS[6] (low risk, high savings — do first):\n [1] extract_function saved=27L → swop/markpact/utils/_build_environments.py\n FILES: graph_builder.py\n [2] extract_function saved=11L → swop/utils/_parse_bus.py\n FILES: config.py\n [3] extract_function saved=10L → swop/tools/utils/format.py\n FILES: doctor.py, doctor_deep.py\n [4] extract_function saved=9L → swop/utils/_generate_update_from_disk.py\n FILES: commands.py\n [5] extract_function saved=8L → swop/utils/_render_query_response.py\n FILES: generator.py, generator.py\n [6] extract_function saved=7L → swop/utils/_safe_ident.py\n FILES: generator.py, generator.py\n\nEFFORT_ESTIMATE (total ≈ 2.4h):\n medium _build_environments saved=27L ~54min\n easy _parse_bus saved=11L ~22min\n easy format saved=10L ~20min\n easy _generate_update_from_disk saved=9L ~18min\n easy _render_query_response saved=8L ~16min\n easy _safe_ident saved=7L ~14min\n\nMETRICS-TARGET:\n dup_groups: 6 → 0\n saved_lines: 72 lines recoverable\n```",
"level": 2
},
{
"name": "# evolution / churn (`project/evolution.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/evolution.toon.yaml\n# code2llm/evolution | 940 func | 38f | 2026-04-23\n\nNEXT[10] (ranked by impact):\n [1] !! SPLIT swop/scan/scanner.py\n WHY: 559L, 0 classes, max CC=18\n EFFORT: ~4h IMPACT: 10062\n\n [2] !! SPLIT swop/services/generator.py\n WHY: 686L, 2 classes, max CC=11\n EFFORT: ~4h IMPACT: 7546\n\n [3] ! SPLIT-FUNC _check_manifests_vs_proto CC=15 fan=18\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 270\n\n [4] ! SPLIT-FUNC _check_proto_vs_python CC=15 fan=18\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 270\n\n [5] ! SPLIT-FUNC _check_manifests_vs_services CC=15 fan=17\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 255\n\n [6] ! SPLIT-FUNC _index_from_manifests CC=15 fan=15\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 225\n\n [7] ! SPLIT-FUNC _classify CC=18 fan=11\n WHY: CC=18 exceeds 15\n EFFORT: ~1h IMPACT: 198\n\n [8] ! SPLIT-FUNC RefactorPipeline._cluster_to_spec CC=23 fan=8\n WHY: CC=23 exceeds 15\n EFFORT: ~1h IMPACT: 184\n\n [9] ! SPLIT-FUNC _map_python_type CC=15 fan=12\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 180\n\n [10] ! SPLIT-FUNC _extract_fields CC=15 fan=10\n WHY: CC=15 exceeds 15\n EFFORT: ~1h IMPACT: 150\n\n\nRISKS[3]:\n ⚠ Splitting swop/services/generator.py may break 17 import paths\n ⚠ Splitting swop/scan/scanner.py may break 23 import paths\n ⚠ Splitting swop/markpact/graph_builder.py may break 0 import paths\n\nMETRICS-TARGET:\n CC̄: 1.5 → ≤1.0\n max-CC: 23 → ≤11\n god-modules: 4 → 0\n high-CC(≥15): 8 → ≤4\n hub-types: 0 → ≤0\n\nPATTERNS (language parser shared logic):\n _extract_declarations() in base.py — unified extraction for:\n - TypeScript: interfaces, types, classes, functions, arrow funcs\n - PHP: namespaces, traits, classes, functions, includes\n - Ruby: modules, classes, methods, requires\n - C++: classes, structs, functions, #includes\n - C#: classes, interfaces, methods, usings\n - Java: classes, interfaces, methods, imports\n - Go: packages, functions, structs\n - Rust: modules, functions, traits, use statements\n\n Shared regex patterns per language:\n - import: language-specific import/require/using patterns\n - class: class/struct/trait declarations with inheritance\n - function: function/method signatures with visibility\n - brace_tracking: for C-family languages ({ })\n - end_keyword_tracking: for Ruby (module/class/def...end)\n\n Benefits:\n - Consistent extraction logic across all languages\n - Reduced code duplication (~70% reduction in parser LOC)\n - Easier maintenance: fix once, apply everywhere\n - Standardized FunctionInfo/ClassInfo models\n\nHISTORY:\n prev CC̄=1.4 → now CC̄=1.5\n```",
"level": 2
},
{
"name": "intent",
"type": "intent",
"content": "Bi-directional runtime reconciler and drift-aware state graph for full-stack systems",
"level": 2
}
]
}