Use explicit fresh hosted capability snapshots for plan checks

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-08 12:10:17 +02:00
parent 5501b8bb56
commit 2621cf2752
6 changed files with 353 additions and 11 deletions

View file

@ -22,6 +22,7 @@ from reuse_surface.hub_sync import (
)
from reuse_surface.overlaps import find_overlaps
from reuse_surface.statehub_bridge import list_open_capability_requests
from reuse_surface.plan_snapshot import SnapshotUnavailable
from reuse_surface.plan_check import (
format_plan_check_json,
format_plan_check_markdown,
@ -661,13 +662,19 @@ def cmd_plan_check(args: argparse.Namespace) -> int:
print("error: provide a workplan file or --intent", file=sys.stderr)
return 1
result = run_plan_check(
query,
reuse_threshold=args.reuse_threshold,
extend_threshold=args.extend_threshold,
use_llm=not args.no_llm,
llm_url=args.llm_url,
)
try:
result = run_plan_check(
query,
reuse_threshold=args.reuse_threshold,
extend_threshold=args.extend_threshold,
use_llm=not args.no_llm,
llm_url=args.llm_url,
hub_url=args.hub_url,
max_index_age_hours=args.max_index_age_hours,
)
except SnapshotUnavailable as exc:
print(f"error: {exc}", file=sys.stderr)
return 2
recorded = None
if args.record_outcome:
@ -941,6 +948,13 @@ def main(argv: list[str] | None = None) -> int:
"workplan", nargs="?", help="path to a workplan file (frontmatter + body)"
)
plan_check.add_argument("--intent", help="free-text intent instead of a workplan file")
plan_check.add_argument(
"--hub-url", help="read the hosted /v1/federated index; fail on unavailable, stale or warned composition",
)
plan_check.add_argument(
"--max-index-age-hours", type=float, default=24,
help="maximum hosted composition age in hours (default: 24); requires --hub-url",
)
plan_check.add_argument(
"--format", choices=["markdown", "json"], default="markdown"
)
@ -1210,4 +1224,4 @@ def main(argv: list[str] | None = None) -> int:
if __name__ == "__main__":
raise SystemExit(main())
raise SystemExit(main())