feat(trip-cluster): cluster orchestration (seed derivation + coverage) + CLI

This commit is contained in:
2026-06-27 17:28:27 +02:00
parent a9b443cd53
commit 5256df4117
3 changed files with 131 additions and 1 deletions
+13 -1
View File
@@ -31,6 +31,16 @@ def cmd_ingest(deps, *, date_from, date_to, tag, subset, full) -> int:
return 0
def cmd_cluster(deps, *, gap_factor) -> int:
cfg = deps["config"]
store = _store(cfg)
from app.cluster_run import run_cluster
res = run_cluster(store, gap_factor=gap_factor)
store.close()
print(f"Built {res['clusters']} candidate cluster(s). Run 'categorize serve' to review.")
return 0
def cmd_serve(deps) -> int:
from app import create_app
create_app(deps["config"]).run(host="0.0.0.0", port=8084)
@@ -67,7 +77,9 @@ def main(argv=None) -> int:
if args.command == "ingest":
return cmd_ingest(deps, date_from=args.date_from, date_to=args.date_to,
tag=args.tag, subset=args.subset, full=args.full)
# cluster / apply are wired in later tasks.
if args.command == "cluster":
return cmd_cluster(deps, gap_factor=args.gap_factor)
# apply is wired in a later task.
print(f"Command '{args.command}' is not implemented yet.")
return 1