One rebuild list for the refresh, the bot cycle and the daily workflows; graph.json rebuilt
CI / test (pull_request) Canceled after 0s
CI / test (pull_request) Canceled after 0s
- python -m collection rebuild: graph, route model, experiment plan, the Black evidence, the screen tree, statistics, build. refresh, cycle and both update-sources workflows use it, so the morning update also rebuilds the reports the tests check (it rebuilt only graph, model and stats before) - graph.json had not been rebuilt since the played-steps fix (no Node on the Mac) - docs: the branch is pushed; README mentions rebuild Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f8e4f575f4
commit
93bdfcd4da
+23
-22
@@ -73,6 +73,27 @@ def _step(label, cmd):
|
||||
subprocess.run(cmd, cwd=ROOT, check=True)
|
||||
|
||||
|
||||
def rebuild():
|
||||
"""Everything built from the runs, in order. The one list the local refresh, the bot cycle and the daily
|
||||
workflows all use (`python -m collection rebuild`), so a new report only needs adding here."""
|
||||
py = sys.executable
|
||||
if shutil.which("node"):
|
||||
_step("route graph", ["node", "analysis/network/build-graph.js"])
|
||||
else:
|
||||
print("\n(node is not installed: data/public/graph.json is not rebuilt; everything else is)")
|
||||
_step("route model (a few minutes)", [py, "planner/build_policy.py"])
|
||||
_step("experiment plan", [py, "planner/build_experiments.py"])
|
||||
_step("what the runs show about the Black", [py, "analysis/black/evidence.py"])
|
||||
_step("screen tree", [py, "analysis/tree/build_tree.py"])
|
||||
try:
|
||||
import scipy # noqa: F401
|
||||
_step("statistics", [py, "analysis/stats/site_stats.py"])
|
||||
except ImportError:
|
||||
print("\n(scipy is not installed: data/public/stats.json is not rebuilt)")
|
||||
_step("runs, generated files and metadata", [py, "-m", "collection", "build"])
|
||||
return 0
|
||||
|
||||
|
||||
def refresh(update_main, bots=()):
|
||||
"""update -> (graph, policy, stats, build) when something changed. Returns 0 on success."""
|
||||
py = sys.executable
|
||||
@@ -81,16 +102,7 @@ def refresh(update_main, bots=()):
|
||||
rc = update_main(args)
|
||||
for i, b in enumerate(bots):
|
||||
rc |= update_main(["update", "--source", "bot", "--file", f"bot={b}", "--report", str(path(f"exports/last-report-bot{i + 1}.md"))])
|
||||
if shutil.which("node"):
|
||||
_step("route graph", ["node", "analysis/network/build-graph.js"])
|
||||
else:
|
||||
print("\n(node is not installed: data/public/graph.json is not rebuilt; everything else is)")
|
||||
_step("route model (about 2 minutes)", [py, "planner/build_policy.py"])
|
||||
_step("experiment plan", [py, "planner/build_experiments.py"])
|
||||
_step("what the runs show about the Black", [py, "analysis/black/evidence.py"])
|
||||
_step("screen tree", [py, "analysis/tree/build_tree.py"])
|
||||
_step("statistics", [py, "analysis/stats/site_stats.py"])
|
||||
_step("runs, generated files and metadata", [py, "-m", "collection", "build"])
|
||||
rebuild()
|
||||
print(f"\nDone. What changed: exports/last-report.md. Send the bot its files with: {py} -m collection export-bot-kit")
|
||||
return rc
|
||||
|
||||
@@ -169,18 +181,7 @@ def cycle(update_main, bots, deliver_to=None, community=False, force=False):
|
||||
built = all(path(src).exists() for src in KIT.values())
|
||||
changed = force or not built or _fingerprint() != before
|
||||
if changed:
|
||||
if shutil.which("node"):
|
||||
_step("route graph", ["node", "analysis/network/build-graph.js"])
|
||||
_step("route model (a few minutes)", [py, "planner/build_policy.py"])
|
||||
_step("experiment plan", [py, "planner/build_experiments.py"])
|
||||
_step("what the runs show about the Black", [py, "analysis/black/evidence.py"])
|
||||
_step("screen tree", [py, "analysis/tree/build_tree.py"])
|
||||
try:
|
||||
import scipy # noqa: F401
|
||||
_step("statistics", [py, "analysis/stats/site_stats.py"])
|
||||
except ImportError:
|
||||
print("\n(scipy is not installed: data/public/stats.json is not rebuilt; the bot does not use it)")
|
||||
_step("runs, generated files and metadata", [py, "-m", "collection", "build"])
|
||||
rebuild()
|
||||
else:
|
||||
print("\nNo new runs: the route model and the plan are unchanged.")
|
||||
now = _headline()
|
||||
|
||||
Reference in New Issue
Block a user