@caddis/cli 0.4.64 → 0.4.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "caddis",
3
- "version": "1.3.150",
3
+ "version": "1.3.151",
4
4
  "description": "caddis — agent-agnostic dev harness as an Antigravity (agy) plugin: TDD skills + commands, single-sourced with the Claude Code plugin."
5
5
  }
@@ -295,8 +295,8 @@ def check_sheet(sheet_text: str, roster_text: str) -> list[str]:
295
295
 
296
296
  # ---- session presence -------------------------------------------------------------------------
297
297
 
298
- def whoami(session_id: str, name: str, root: Path) -> Path:
299
- """Write `<artifacts>/session-state/<sid>.name`: one tab-separated line `name repo root branch`."""
298
+ def _name_file(session_id: str, root: Path) -> Path:
299
+ """`<artifacts>/session-state/<sid>.name`, the file `whoami` writes."""
300
300
  slug = "".join(c for c in session_id if c.isalnum() or c in "-_")[:64]
301
301
  if not slug:
302
302
  raise ValueError("empty session id")
@@ -305,6 +305,21 @@ def whoami(session_id: str, name: str, root: Path) -> Path:
305
305
  art = Path(artifact_root(str(root)))
306
306
  except Exception:
307
307
  art = root / ".caddis"
308
+ return art / "session-state" / f"{slug}.name"
309
+
310
+
311
+ def session_name(session_id: str, root: Path) -> tuple[str, bool]:
312
+ """The session's display name and whether `whoami` recorded it; else the first 8 characters of the id."""
313
+ try:
314
+ line = _name_file(session_id, root).read_text(encoding="utf-8").split("\n", 1)[0].split("\t")[0].strip()
315
+ except (OSError, UnicodeDecodeError, ValueError):
316
+ line = ""
317
+ return (line, True) if line else (session_id[:8], False)
318
+
319
+
320
+ def whoami(session_id: str, name: str, root: Path) -> Path:
321
+ """Write `<artifacts>/session-state/<sid>.name`: one tab-separated line `name repo root branch`."""
322
+ out = _name_file(session_id, root)
308
323
  branch = "-"
309
324
  for cmd in (["symbolic-ref", "--short", "-q", "HEAD"], ["rev-parse", "--short", "HEAD"]): # branch, else detached
310
325
  proc = subprocess.run(["git", "-C", str(root), *cmd], capture_output=True, text=True,
@@ -312,12 +327,64 @@ def whoami(session_id: str, name: str, root: Path) -> Path:
312
327
  if proc.returncode == 0 and proc.stdout.strip():
313
328
  branch = proc.stdout.strip()
314
329
  break
315
- out = art / "session-state" / f"{slug}.name"
316
330
  out.parent.mkdir(parents=True, exist_ok=True)
317
331
  out.write_text(f"{name}\t{root}\t{branch}\n", encoding="utf-8")
318
332
  return out
319
333
 
320
334
 
335
+ # ---- resume block -----------------------------------------------------------------------------
336
+
337
+ class ResumeError(ValueError):
338
+ """The relay has no usable `## Resume prompt`."""
339
+
340
+
341
+ _RESUME_SECTION = re.compile(r"^## Resume prompt[^\n]*\n(.*?)(?=^## |\Z)", re.MULTILINE | re.DOTALL)
342
+ _FENCE_OPEN = re.compile(r"^(`{3,}|~{3,})[^\n`]*$")
343
+
344
+
345
+ def resume_prompt(relay_text: str) -> str:
346
+ """The text inside the first fenced block of the relay's `## Resume prompt` section, verbatim."""
347
+ m = _RESUME_SECTION.search(relay_text)
348
+ if not m:
349
+ raise ResumeError("relay has no ## Resume prompt section")
350
+ body: list[str] = []
351
+ fence: str | None = None
352
+ for line in m.group(1).splitlines():
353
+ if fence is None:
354
+ opened = _FENCE_OPEN.match(line.strip())
355
+ if opened:
356
+ fence = opened.group(1)
357
+ continue
358
+ if line.strip().startswith(fence) and not line.strip().strip(fence[0]):
359
+ break # the closing fence
360
+ body.append(line)
361
+ else:
362
+ if fence is None:
363
+ raise ResumeError("## Resume prompt section has no fenced block")
364
+ raise ResumeError("## Resume prompt fenced block is not closed")
365
+ prompt = "\n".join(body).strip("\n")
366
+ if not prompt.strip():
367
+ raise ResumeError("## Resume prompt fenced block is empty")
368
+ return prompt
369
+
370
+
371
+ def shell_arg(text: str) -> str:
372
+ """One word that PowerShell and bash read the same: one line, inside single quotes (no expansion in either).
373
+ A `'` would end the word in bash and a `"` is dropped by Windows PowerShell 5.1, so both become typographic."""
374
+ one_line = " ".join(text.split())
375
+ return "'" + one_line.replace("'", "’").replace('"', "”") + "'"
376
+
377
+
378
+ def render_resume(session: str, session_id: str, workstream: str, prompt: str, role: str, stamp: datetime,
379
+ fleet_mode: bool = False) -> str:
380
+ """The last output of `/caddis:handoff`. In a fleet close the restart sheet holds the only start line."""
381
+ if fleet_mode:
382
+ start = "Start line: from the restart sheet"
383
+ else:
384
+ start = f"Start line:\nclaude --name {new_name(role, stamp)} {shell_arg(prompt)}"
385
+ return (f"=== RESUME ===\nSession: {session} ({session_id})\nWorkstream: {workstream}\n"
386
+ f"{_fenced(prompt)}\n{start}\n")
387
+
321
388
  # ---- CLI --------------------------------------------------------------------------------------
322
389
 
323
390
  def _load_acks(fleet_dir: Path) -> list[Ack]:
@@ -327,6 +394,32 @@ def _load_acks(fleet_dir: Path) -> list[Ack]:
327
394
  return [parse_ack(p.read_text(encoding="utf-8")) for p in sorted(acks_dir.glob("*.md"))]
328
395
 
329
396
 
397
+ def _resume_block_cli(args: argparse.Namespace) -> int:
398
+ try:
399
+ import caddis_workstreams
400
+ except ModuleNotFoundError as exc:
401
+ if exc.name != "caddis_workstreams":
402
+ raise
403
+ sys.path.insert(0, str(Path(__file__).resolve().parent))
404
+ import caddis_workstreams
405
+ root = args.root.resolve()
406
+ try:
407
+ text, digest = caddis_workstreams.read_relay(root, args.name)
408
+ if digest is None:
409
+ raise ResumeError(f"relay {args.name!r} not found")
410
+ prompt = resume_prompt(text)
411
+ except (ValueError, OSError) as exc: # ResumeError is a ValueError; a bad relay name is one too
412
+ sys.stderr.write(f"resume-block failed: {exc}\n")
413
+ return caddis_exit.BLOCKED
414
+ session, known = session_name(args.session_id, root)
415
+ role = args.role or (role_of(session) if known else args.name)
416
+ if not _SAFE_NAME.match(role): # the role goes unquoted into the start line
417
+ sys.stderr.write(f"resume-block failed: bad role {role!r}\n")
418
+ return caddis_exit.BLOCKED
419
+ print(render_resume(session, args.session_id, args.name, prompt, role, datetime.now(), args.fleet), end="")
420
+ return caddis_exit.CLEAN
421
+
422
+
330
423
  def main(argv: list[str] | None = None) -> int:
331
424
  parser = argparse.ArgumentParser(prog="caddis_fleet.py", description=__doc__.splitlines()[0])
332
425
  sub = parser.add_subparsers(dest="cmd", required=True)
@@ -353,6 +446,12 @@ def main(argv: list[str] | None = None) -> int:
353
446
  p.add_argument("--session-id", required=True)
354
447
  p.add_argument("--name", required=True)
355
448
  p.add_argument("--root", default=".", type=Path)
449
+ p = sub.add_parser("resume-block", help="print the session name and the relay's resume prompt (last step of handoff)")
450
+ p.add_argument("--name", required=True, help="the relay's workstream name")
451
+ p.add_argument("--session-id", required=True)
452
+ p.add_argument("--root", default=".", type=Path)
453
+ p.add_argument("--role", help="role for the new session's name (default: the session name's role, else the relay name)")
454
+ p.add_argument("--fleet", action="store_true", help="fleet close: print no start line (the restart sheet has it)")
356
455
  args = parser.parse_args(argv)
357
456
 
358
457
  if args.cmd == "role-of":
@@ -419,6 +518,8 @@ def main(argv: list[str] | None = None) -> int:
419
518
  return caddis_exit.BLOCKED
420
519
  print("[FLEET] sheet ok")
421
520
  return caddis_exit.CLEAN
521
+ if args.cmd == "resume-block":
522
+ return _resume_block_cli(args)
422
523
  # whoami
423
524
  try:
424
525
  out = whoami(args.session_id, args.name, args.root.resolve())
@@ -3,14 +3,15 @@
3
3
 
4
4
  A different vendor's model has different blind spots, so a second model reviewing your diff
5
5
  catches bugs a same-vendor reviewer misses. This tool is provider-agnostic: point it at
6
- DeepSeek (default — cheapest + most architecturally distinct from Claude), GLM, OpenRouter,
7
- or any OpenAI-compatible `/chat/completions` endpoint via three env vars.
6
+ agy Argon (default since 2026-10-21; needs no key), DeepSeek (cheap, architecturally distinct from
7
+ Claude), GLM, OpenRouter, or any OpenAI-compatible `/chat/completions` endpoint via three env vars.
8
8
 
9
9
  Config precedence (highest wins): explicit CLI flag > env var > provider preset.
10
- REVIEW_PROVIDER preset name: deepseek | glm | openrouter (default deepseek)
10
+ REVIEW_PROVIDER preset name: agy-argon | deepseek | glm | openrouter (default agy-argon)
11
+ precedence: --provider flag, process env, then REVIEW_PROVIDER in ~/.caddis/keys.env
11
12
  REVIEW_BASE_URL base URL, no trailing /chat/completions (overrides the preset's URL)
12
13
  REVIEW_MODEL model id (overrides the preset's model)
13
- REVIEW_API_KEY bearer token (REQUIRED — no key ⇒ exit 3)
14
+ REVIEW_API_KEY bearer token (REQUIRED for an HTTP provider; agy-argon needs none)
14
15
 
15
16
  Future-proofing: model ids and endpoints churn. Two layers protect against that — (1) the PROVIDERS
16
17
  table below is the ONE place a renamed model/URL is edited; (2) REVIEW_MODEL / REVIEW_BASE_URL env
@@ -37,8 +38,9 @@ Exit codes (fail-closed):
37
38
  4 error — no diff verdict parsed, git failure, other endpoint/parse failure, or the diff
38
39
  exceeds REVIEW_MAX_DIFF_CHARS (see below — never silently downgraded to CLEAN)
39
40
 
40
- Provider chain (owner policy, 2026-10-16): deepseek -> agy-argon -> glm. A named --provider goes first,
41
- then the rest in policy order; a provider with no key (or no agy on PATH) is skipped. A provider failure
41
+ Provider chain (owner policy, 2026-10-21; was deepseek first from 2026-10-16): agy-argon -> deepseek -> glm.
42
+ A named --provider goes first, then the rest in policy order; a provider with no key (or no agy on PATH)
43
+ is skipped. With no provider named, the chain starts at the first provider that is available. A provider failure
42
44
  moves to the next provider and never splits the diff. On HTTP 429 a `Retry-After` is honoured ONCE per
43
45
  provider (capped at 60 s), then the next provider is tried. A provider that failed gets no more calls in
44
46
  the same run. agy runs through `caddis_spend.py run` (the EUR spend cap), in plan mode, with the diff in
@@ -99,9 +101,12 @@ PROVIDERS: dict[str, dict[str, str]] = {
99
101
  "glm": {"base_url": "https://api.z.ai/api/coding/paas/v4", "model": "glm-5.3"},
100
102
  "openrouter": {"base_url": "https://openrouter.ai/api/v1", "model": "deepseek/deepseek-v4-flash"},
101
103
  }
102
- DEFAULT_PROVIDER = "deepseek"
104
+ # The HTTP preset used when nobody names a provider but an HTTP endpoint is still needed: a custom
105
+ # endpoint (REVIEW_BASE_URL / REVIEW_MODEL) with no --provider, and resolve_config's own default. It is
106
+ # a key-lookup and label default only; it is NOT the review order (see REVIEW_ORDER).
107
+ HTTP_DEFAULT_PROVIDER = "deepseek"
103
108
 
104
- # The review chain, in owner-policy order (2026-10-16): DeepSeek, then agy Argon, then GLM. A named
109
+ # The review chain, in owner-policy order (2026-10-21): agy Argon, then DeepSeek, then GLM. A named
105
110
  # provider goes first and the rest follow in this order; a custom endpoint (REVIEW_BASE_URL /
106
111
  # REVIEW_MODEL) never falls back, because its owner named exactly who reviews.
107
112
  #
@@ -112,12 +117,14 @@ DEFAULT_PROVIDER = "deepseek"
112
117
  # sessions recorded "cross-review inconclusive" and moved on. A review that silently does not
113
118
  # happen is the same failure class as a diff that silently is not read.
114
119
  #
115
- # Order matters: DeepSeek leads because it has actually found real bugs (a date-boundary bug
116
- # two same-vendor passes missed, an anchor bug, an orphaned-permission-rows bug). GLM is the
117
- # spare tyre, not a co-equal — an alternation policy that sends half the phases to a provider
118
- # that times out buys variety it never actually collects.
120
+ # Order matters: agy Argon leads since 2026-10-21 (owner decision) because DeepSeek ran out of credit,
121
+ # so every unnamed review tried DeepSeek first and failed before it reached Argon. DeepSeek stays
122
+ # second: it has actually found real bugs (a date-boundary bug two same-vendor passes missed, an
123
+ # anchor bug, an orphaned-permission-rows bug). GLM is the spare tyre, not a co-equal — an alternation
124
+ # policy that sends half the phases to a provider that times out buys variety it never actually collects.
119
125
  AGY_PROVIDER = "agy-argon"
120
- REVIEW_ORDER: tuple[str, ...] = ("deepseek", AGY_PROVIDER, "glm")
126
+ DEFAULT_PROVIDER = AGY_PROVIDER
127
+ REVIEW_ORDER: tuple[str, ...] = (AGY_PROVIDER, "deepseek", "glm")
121
128
 
122
129
  # agy runs headless through the spend cap: plan mode (it needs no tools, the diff is in the prompt).
123
130
  AGY_MODEL = "gemini-4-argon-high"
@@ -239,8 +246,14 @@ def _parse_keys_file(path: str) -> dict[str, str]:
239
246
  p = Path(path).expanduser()
240
247
  if not p.is_file():
241
248
  return {}
249
+ try:
250
+ text = p.read_text(encoding="utf-8")
251
+ except (OSError, UnicodeDecodeError):
252
+ # Unreadable or not UTF-8 (PowerShell writes UTF-16). agy needs no key, so this file must not
253
+ # stop a review; a provider that needs a key then reports "no API key" as usual.
254
+ return {}
242
255
  out: dict[str, str] = {}
243
- for raw in p.read_text(encoding="utf-8").splitlines():
256
+ for raw in text.splitlines():
244
257
  line = raw.strip()
245
258
  if not line or line.startswith("#") or "=" not in line:
246
259
  continue
@@ -249,6 +262,15 @@ def _parse_keys_file(path: str) -> dict[str, str]:
249
262
  return out
250
263
 
251
264
 
265
+ def named_provider(args: argparse.Namespace, env: dict[str, str]) -> str:
266
+ """The provider the caller chose, or "". Order: --provider flag, process env REVIEW_PROVIDER,
267
+ REVIEW_PROVIDER in the keys file (~/.caddis/keys.env), so a default is switched with one line there."""
268
+ chosen = args.provider or env.get("REVIEW_PROVIDER")
269
+ if not chosen:
270
+ chosen = _parse_keys_file(env.get("CADDIS_KEYS_FILE") or DEFAULT_KEYS_FILE).get("REVIEW_PROVIDER")
271
+ return (chosen or "").strip().lower()
272
+
273
+
252
274
  def resolve_config(
253
275
  args: argparse.Namespace,
254
276
  env: dict[str, str],
@@ -265,9 +287,7 @@ def resolve_config(
265
287
  provider: pointing DeepSeek's model id at GLM's endpoint would turn a clean fallback into
266
288
  a confusing 404.
267
289
  """
268
- provider = (
269
- provider or args.provider or env.get("REVIEW_PROVIDER") or DEFAULT_PROVIDER
270
- ).strip().lower()
290
+ provider = (provider or named_provider(args, env) or HTTP_DEFAULT_PROVIDER).strip().lower()
271
291
  preset = PROVIDERS.get(provider, {})
272
292
  if use_overrides:
273
293
  base_url = (args.base_url or env.get("REVIEW_BASE_URL") or preset.get("base_url") or "").rstrip("/")
@@ -735,15 +755,16 @@ def main(argv: list[str] | None = None, env: dict[str, str] | None = None) -> in
735
755
  parser.add_argument("--cwd", default=".", help="repo directory (default: cwd)")
736
756
  parser.add_argument("--provider", default=None,
737
757
  help=f"preset: {', '.join(sorted(PROVIDERS))} or {AGY_PROVIDER} (default "
738
- f"{DEFAULT_PROVIDER}); env REVIEW_PROVIDER. A provider failure falls back in "
739
- f"the order {' -> '.join(REVIEW_ORDER)}")
758
+ f"{DEFAULT_PROVIDER}, then the next available provider); env REVIEW_PROVIDER "
759
+ f"or REVIEW_PROVIDER in the keys file. "
760
+ f"A provider failure falls back in the order {' -> '.join(REVIEW_ORDER)}")
740
761
  parser.add_argument("--base-url", dest="base_url", default=None, help="override REVIEW_BASE_URL / the preset")
741
762
  parser.add_argument("--model", default=None, help="override REVIEW_MODEL / the preset")
742
763
  parser.add_argument("--max-diff-chars", type=int, default=None,
743
764
  help=f"override REVIEW_MAX_DIFF_CHARS (default {DEFAULT_MAX_DIFF_CHARS})")
744
765
  parser.add_argument("--check-config", action="store_true",
745
- help="report whether a usable key exists and exit — no diff, no LLM call. "
746
- "Exit 0 = ready, 3 = nothing configured.")
766
+ help="report whether a usable reviewer exists (agy on PATH, or an API key) and "
767
+ "exit — no diff, no LLM call. Exit 0 = ready, 3 = nothing configured.")
747
768
  parser.add_argument("--allow-path", dest="allow_path", action="append", default=[],
748
769
  metavar="GLOB",
749
770
  help="re-admit a file the secret-filter deny list would otherwise drop "
@@ -756,16 +777,18 @@ def main(argv: list[str] | None = None, env: dict[str, str] | None = None) -> in
756
777
  # that can actually talk to a human. This half just answers "is it configured?" cheaply enough
757
778
  # to call before you need it, instead of finding out mid-commit.
758
779
  if args.check_config:
759
- available = configured_providers(env)
780
+ # agy Argon is the default reviewer and needs no key: agy on PATH plus caddis_spend.py is enough.
781
+ available = ([AGY_PROVIDER] if agy_launcher() is not None else []) + configured_providers(env)
760
782
  if not available:
761
783
  sys.stderr.write(
762
- "no second-vendor API key is configured anywhere.\n"
784
+ "no second-vendor reviewer is configured: no API key anywhere, and no agy on PATH\n"
785
+ " (with caddis_spend.py) for the default agy-argon reviewer.\n"
763
786
  " Cross-review needs one — the whole point is a reviewer that does not share this\n"
764
787
  " model's blind spots, so a same-vendor fallback would be no review at all.\n"
765
788
  f" Add a key to {env.get('CADDIS_KEYS_FILE') or DEFAULT_KEYS_FILE}, e.g.\n"
766
- " DEEPSEEK_API_KEY=<your-key>\n")
789
+ " GLM_API_KEY=<your-key>\n")
767
790
  return EXIT_CONFIG
768
- print(f"cross-review is ready. Providers with a key: {', '.join(available)}")
791
+ print(f"cross-review is ready. Providers available: {', '.join(available)}")
769
792
  return EXIT_CLEAN
770
793
 
771
794
  try:
@@ -804,13 +827,14 @@ def main(argv: list[str] | None = None, env: dict[str, str] | None = None) -> in
804
827
  return EXIT_CONFIG
805
828
  diff_text = filter_result.kept_diff
806
829
 
807
- primary_provider = (
808
- args.provider or env.get("REVIEW_PROVIDER") or DEFAULT_PROVIDER
809
- ).strip().lower()
830
+ named = named_provider(args, env)
810
831
  # A custom ENDPOINT names exactly who reviews (REVIEW_BASE_URL/REVIEW_MODEL, the documented
811
832
  # future-proofing path): it never falls back. A named preset falls back on a provider failure,
812
833
  # and the switch is printed, so the reviewer is never misreported.
813
834
  custom = bool(args.base_url or env.get("REVIEW_BASE_URL") or args.model or env.get("REVIEW_MODEL"))
835
+ # With nothing named, the default is agy Argon. A custom endpoint with no provider named is an HTTP
836
+ # call (never agy), keyed and labelled as before.
837
+ primary_provider = named or (HTTP_DEFAULT_PROVIDER if custom else DEFAULT_PROVIDER)
814
838
  agy_cmd = agy_launcher()
815
839
 
816
840
  def _http_entry(name: str, url: str, key: str, mdl: str):
@@ -821,12 +845,35 @@ def main(argv: list[str] | None = None, env: dict[str, str] | None = None) -> in
821
845
 
822
846
  try:
823
847
  if primary_provider == AGY_PROVIDER and not custom:
824
- if agy_cmd is None:
848
+ if agy_cmd is not None:
849
+ chain = [_agy_entry(agy_cmd)]
850
+ elif named:
825
851
  raise ConfigError(f"provider {AGY_PROVIDER!r} needs agy on PATH and caddis_spend.py "
826
852
  "(beside this script or in the repo's scripts/ folder).")
827
- chain = [_agy_entry(agy_cmd)]
853
+ else:
854
+ # The default degrades: no agy here, so the chain starts at the next provider with a key.
855
+ chain = []
828
856
  else:
829
857
  chain = [_http_entry(primary_provider, *resolve_config(args, env))]
858
+ # The rest of the chain in policy order (agy Argon -> DeepSeek -> GLM). A provider with no key, or
859
+ # agy with no agy on PATH, is skipped: not an error, just nothing to fall back to.
860
+ if not custom:
861
+ for name in REVIEW_ORDER:
862
+ if chain and name == chain[0][0]:
863
+ continue
864
+ if name == AGY_PROVIDER:
865
+ if agy_cmd is not None:
866
+ chain.append(_agy_entry(agy_cmd))
867
+ continue
868
+ try:
869
+ chain.append(_http_entry(name, *resolve_config(args, env, provider=name, use_overrides=False)))
870
+ except ConfigError:
871
+ continue
872
+ if not chain:
873
+ raise ConfigError(
874
+ "no reviewer is available: agy is not on PATH (with caddis_spend.py) and no provider has an "
875
+ "API key. Set $REVIEW_API_KEY, or add a key such as DEEPSEEK_API_KEY or GLM_API_KEY to "
876
+ f"{env.get('CADDIS_KEYS_FILE') or DEFAULT_KEYS_FILE}, or install agy.")
830
877
  except ConfigError as exc:
831
878
  sys.stderr.write(f"{exc}\n")
832
879
  return EXIT_CONFIG
@@ -897,21 +944,6 @@ def main(argv: list[str] | None = None, env: dict[str, str] | None = None) -> in
897
944
 
898
945
  branch = current_branch(args.cwd)
899
946
 
900
- # The rest of the chain in policy order (DeepSeek -> agy Argon -> GLM). A provider with no key, or
901
- # agy with no agy on PATH, is skipped: not an error, just nothing to fall back to.
902
- if not custom:
903
- for name in REVIEW_ORDER:
904
- if name == chain[0][0]:
905
- continue
906
- if name == AGY_PROVIDER:
907
- if agy_cmd is not None:
908
- chain.append(_agy_entry(agy_cmd))
909
- continue
910
- try:
911
- chain.append(_http_entry(name, *resolve_config(args, env, provider=name, use_overrides=False)))
912
- except ConfigError:
913
- continue
914
-
915
947
  # Per run: a provider that failed (429, 5xx, timeout, empty reply, cap refusal) gets no more calls,
916
948
  # and each provider waits for a 429 Retry-After at most once. Hammering a throttled provider with
917
949
  # more, smaller calls is the 18-19 Oct 2026 failure.
@@ -15,7 +15,7 @@
15
15
  | Backend Development | `backend-development/` | Backend API design, database schemas, microservices and TDD. Use for backend system architecture. |
16
16
  | Code Review | `code-review/` | Automated code review for quality, security, performance and best practices. Use when reviewing code changes, PRs, or doing code audits. |
17
17
  | Codebase Audit | `codebase-audit/` | Audit an unfamiliar codebase before architecture or implementation work. Use for a new codebase, pre-implementation audit, codebase review, technical due diligence or onboarding. Produces AUDIT-FINDINGS.md and QUESTIONS.md. |
18
- | Cross Review | `cross-review/` | Cross-vendor code review of the current diff — a second-vendor model (DeepSeek/GLM/any OpenAI-compatible endpoint) reviews your changes to catch bugs a same-vendor reviewer misses |
18
+ | Cross Review | `cross-review/` | Cross-vendor code review of the current diff — a second-vendor model (agy Argon by default; DeepSeek, GLM or any OpenAI-compatible endpoint) reviews your changes to catch bugs a same-vendor reviewer misses |
19
19
  | Dashboard Perf Sweep | `dashboard-perf-sweep/` | Re-measure dashboard/API endpoints for load-time regressions and decide by checklist if a slow one needs the rs-kit refresher, an index, keyset paging, gzip, or nothing. Use when the user says "sweep dashboard performance", "check if this app needs rs-kit", "re-measure the perf tracker", "is this endpoint a refresher candidate", or dashboard-performance-tracker.md is stale. Read-only. |
20
20
  | Error Handling | `error-handling/` | Error handling for Python and TypeScript: error hierarchies, custom exceptions, result types, retries, circuit breakers, error boundaries, logging, user-facing messages. |
21
21
  | Fastapi Dev | `fastapi-dev/` | Build FastAPI backends with standard patterns, error handling, and testing |
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: cross-review
3
- description: Cross-vendor code review of the current diff — a second-vendor model (DeepSeek/GLM/any OpenAI-compatible endpoint) reviews your changes to catch bugs a same-vendor reviewer misses
3
+ description: Cross-vendor code review of the current diff — a second-vendor model (agy Argon by default; DeepSeek, GLM or any OpenAI-compatible endpoint) reviews your changes to catch bugs a same-vendor reviewer misses
4
4
  ---
5
5
 
6
6
  # /caddis:cross-review — a second-vendor set of eyes on your diff
7
7
 
8
8
  Run a cross-vendor review of the current changes with a DIFFERENT model family than the one that wrote them
9
- (default **DeepSeek** — the cheapest + most architecturally distinct-from-Claude option). Use after a phase
9
+ (default **agy Argon** since 2026-10-21 — it needs no key; DeepSeek and GLM are fallbacks). Use after a phase
10
10
  is green and before you commit, or for a second opinion on a risky diff. This is the *cross-vendor*
11
11
  complement to `/caddis:code-review`, not a replacement.
12
12
 
@@ -16,7 +16,7 @@ complement to `/caddis:code-review`, not a replacement.
16
16
  python "$TOOL" --check-config # resolve $TOOL first, see "Run it" below
17
17
  ```
18
18
 
19
- Exit 0 means ready; it prints which providers have a key. **Exit 3 means nothing is configured —
19
+ Exit 0 means ready; it prints which providers are available (agy-argon needs no key, only agy on PATH and caddis_spend.py). **Exit 3 means nothing is configured —
20
20
  STOP and ask the user now.** Do not proceed to the review, and do not silently skip it.
21
21
 
22
22
  Ask with `AskUserQuestion`: which provider to set up (DeepSeek, GLM, or another OpenAI-compatible
@@ -65,7 +65,7 @@ fi
65
65
  > copied weeks earlier silently won. `caddis_gate.py vendor-drift` now fails on the same condition.
66
66
  ```
67
67
  python "$TOOL" $ARGUMENTS # pass the user's flags THROUGH, raw
68
- python "$TOOL" # no arguments: DeepSeek eyes on the working tree
68
+ python "$TOOL" # no arguments: agy Argon eyes on the working tree
69
69
  ```
70
70
 
71
71
  **`$ARGUMENTS` goes through raw, and must not be re-prefixed.** Callers are told to type the flag
@@ -74,7 +74,7 @@ writes. This line used to prefix the flag itself, which turned that into a doubl
74
74
  `--range --range main..HEAD` and made every plan-emitted call fail. Whatever the user typed is already a complete flag list:
75
75
 
76
76
  ```
77
- /caddis:cross-review -> the working tree, DeepSeek
77
+ /caddis:cross-review -> the working tree, agy Argon
78
78
  /caddis:cross-review --range main..HEAD -> that range
79
79
  /caddis:cross-review --provider glm -> GLM eyes
80
80
  ```
@@ -86,8 +86,8 @@ now means the narrower case — a **single file** too big to split, or more batc
86
86
  see it, the fix is usually to review that one file separately, not to narrow `--range`; don't raise
87
87
  `--max-diff-chars` blind.
88
88
 
89
- **Do not alternate providers on a schedule.** The order is the owner policy: **DeepSeek, then agy Argon,
90
- then GLM** (`REVIEW_ORDER` in `oss_review.py`). A named `--provider` goes first; on a provider failure
89
+ **Do not alternate providers on a schedule.** The order is the owner policy (21 Oct 2026): **agy Argon,
90
+ then DeepSeek, then GLM** (`REVIEW_ORDER` in `oss_review.py`). A named `--provider` goes first; on a provider failure
91
91
  (HTTP 429, any 5xx, a timeout, a connection error, an empty reply) the tool moves to the next one in
92
92
  that order and prints which provider gave the verdict. A provider with no key is skipped. agy runs
93
93
  through `caddis_spend.py run` (the spend cap); if the cap refuses, agy is skipped. On a 429 the tool
@@ -95,6 +95,9 @@ waits for `Retry-After` once (at most 60 s); it never splits the diff because of
95
95
  reply. A custom endpoint (`--base-url`/`--model`) never falls back. Name a provider only when you have
96
96
  a reason.
97
97
 
98
+ **Change the default.** The first provider comes from `--provider`, then the process env `REVIEW_PROVIDER`, then
99
+ `REVIEW_PROVIDER` in `~/.caddis/keys.env`, then agy Argon. The others follow in `REVIEW_ORDER`. To make DeepSeek the default again, add `REVIEW_PROVIDER=deepseek` to ~/.caddis/keys.env.
100
+
98
101
  ## Interpret the exit code
99
102
  - **0 — REVIEW: CLEAN** → no blocking issues. Proceed.
100
103
  - **1 — REVIEW: BLOCKING** → read the printed findings, then **FIX each blocking item** (or explicitly
@@ -72,7 +72,10 @@ FLEET CLOSE from <coordinator>: write your handoff and ack.
72
72
  Then these close rules, in the message:
73
73
  1. Run `/caddis:handoff` for **your own** relay only. Never touch another session's files. Skip its
74
74
  Step 7 (the `Push this note for another machine?` question): the restart sheet carries your prompt,
75
- and a question nobody answers would stop you before you ack.
75
+ and a question nobody answers would stop you before you ack. Run the handoff's Step 9 as
76
+ `resume-block ... --fleet`: it prints your Session, Workstream and prompt, and
77
+ `Start line: from the restart sheet`. The restart sheet holds the only start line. The ack stays a
78
+ separate reply (rule 5).
76
79
  2. In a shared checkout (its `AGENTS.md` says `Shared checkout: yes`, or `git status` shows changes you
77
80
  did not make), skip the steps the handoff checklist skips there.
78
81
  3. If you run watchers: copy each watcher script to `.caddis/relay/<your name>-files/watchers/`, and fill
@@ -132,7 +135,7 @@ remove that session from the `--no-ack` list before the next `write`.
132
135
 
133
136
  ## Step 6 — your own handoff and ack
134
137
 
135
- Run `/caddis:handoff` for this session (the coordinator's own relay). Then write your own ack (the
138
+ Run `/caddis:handoff` for this session (the coordinator's own relay), with Step 9 as `resume-block ... --fleet`. Then write your own ack (the
136
139
  `FLEET-ACK` block with your fields and your resume prompt) to a temp file and save it with
137
140
  `ack add`, as in Step 4. The coordinator's ack is never skipped. Then record this session's presence
138
141
  (your session id is printed at session start as `[caddis] this session's id: <id>`; never guess one):
@@ -162,6 +162,10 @@ history, and the relay has a 4,000-character budget (`caddis_budget.py`).
162
162
  > finished, by id and column name, never by hand:
163
163
  > `python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_rows.py" set --file .caddis/open-work.md --id <row id> --col Status=done --col Evidence=<evidence>`.
164
164
  > In a shared checkout (Step 0), use `--file <worktree>/.caddis/open-work.md` instead.
165
+ > When the file is missing or has no `type: open-work` frontmatter, report row 3 exactly as
166
+ > `skipped: no open-work.md with type: open-work (session tasks are saved by row 5)`, or, for a
167
+ > file without the frontmatter, `skipped: open-work.md has no type: open-work frontmatter (session
168
+ > tasks are saved by row 5)`. open-work.md is a repo backlog; this session's own tasks go to row 5.
165
169
  > **Order of work:** when the repo has a roadmap (`caddis_roadmap.py list` prints a slug), the
166
170
  > roadmap on origin is the order of work. Write the relay's "Next step (exact)" as
167
171
  > `next: top open item of roadmap <slug> (caddis_roadmap.py status --roadmap <slug>)`. Never copy a
@@ -350,7 +354,7 @@ index or staged files — after the secret filter passes. Report its one-line re
350
354
  On the other machine, `/catchup <name>` fetches it.
351
355
 
352
356
  ## Step 8 — the checklist report
353
- End the handoff with this block, every row filled with `done`, `skipped: <reason>` or `failed: <error>`:
357
+ Print this block, every row filled with `done`, `skipped: <reason>` or `failed: <error>`:
354
358
 
355
359
  ```
356
360
  === HANDOFF CHECKLIST ===
@@ -372,6 +376,32 @@ Shared checkout: yes|no <reason>
372
376
 
373
377
  Then, in a shared checkout, `Docs PR needed:` with the `PR:` line and the file list from Step 0.
374
378
 
379
+ Step 9 prints after this report. It is the last output of the handoff.
380
+
381
+ ## Step 9 — print the resume prompt (always the last output)
382
+ The owner should never have to ask for the resume prompt. After the checklist report, run:
383
+ ```
384
+ python "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_fleet.py" resume-block --name <name> --session-id <session-id> --root .
385
+ ```
386
+ `<name>` is the workstream name from Step 3. It reads the relay's `## Resume prompt` block verbatim, and
387
+ the session name (`session-state/<session-id>.name` when `whoami` wrote it, else the first 8 characters of
388
+ the id). It prints, and you print its output as it is, with nothing after it:
389
+ ```
390
+ === RESUME ===
391
+ Session: <session name> (<session id>)
392
+ Workstream: <name>
393
+ <the resume prompt, in a fenced block>
394
+ Start line:
395
+ claude --name <role>-<MMDD>-<HH> '<the resume prompt on one line>'
396
+ ```
397
+ - **Fleet close.** When this handoff runs because a peer sent `FLEET CLOSE from <coordinator>`, add
398
+ `--fleet`. The Start line is then `Start line: from the restart sheet`: the restart sheet is the only
399
+ start line in a fleet close. The `FLEET-ACK` reply is a separate message and does not change.
400
+ - **Exit 1** (no `## Resume prompt` block, or no relay) prints nothing on stdout. The handoff is not
401
+ complete: fix the relay (Step 3, point 5) and run the command again. Never write the block by hand.
402
+ - Workstream with no `whoami` record: the new name uses the workstream name as its role. Pass
403
+ `--role <role>` to set another.
404
+
375
405
  ## Rules
376
406
  - **One next action, by priority ladder.** `## Next step` names exactly ONE action — not a menu. Pick it in
377
407
  order: (1) interrupted mid-phase work → finish + commit it; else (2) the active plan's next not-started
@@ -17,7 +17,9 @@ command is the quick-reference + do-it-now version.
17
17
  | **Primary** | `claude` | your Anthropic plan |
18
18
  | **OSS lane** | `claude-oss <provider> [claude args…]` | the provider's plan/pay-per-token |
19
19
  | **Convenience alias** | `claude-glm [claude args…]` | same as `claude-oss glm` |
20
- | **Cross-vendor review** | `/caddis:cross-review` (`oss_review.py`) | the reviewer's plan |
20
+ | **Cross-vendor review** | `/caddis:cross-review` (`oss_review.py`; default reviewer agy Argon, then DeepSeek, then GLM) | the reviewer's plan |
21
+
22
+ To make DeepSeek the default again, add `REVIEW_PROVIDER=deepseek` to ~/.caddis/keys.env.
21
23
 
22
24
  `claude-oss` / `claude-glm` are launchers at `claude-harness/scripts/claude-oss.{sh,ps1}`. Each
23
25
  resolves the endpoint/model/key, sets `ANTHROPIC_BASE_URL` / `ANTHROPIC_MODEL` / `ANTHROPIC_AUTH_TOKEN`
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "caddis-extras",
3
- "version": "1.3.45",
3
+ "version": "1.3.46",
4
4
  "description": "caddis-extras — the long-tail skills for the Antigravity (agy) caddis plugin; install alongside caddis for the full set."
5
5
  }
@@ -30,7 +30,7 @@
30
30
  | Caching Patterns | `caching-patterns/` | Caching strategies for Streamlit and FastAPI applications |
31
31
  | Case Management | `case-management/` | >- |
32
32
  | Code Explainer | `code-explainer/` | Explain code with diagrams, analogies and step-by-step walkthroughs. Use when teaching a codebase or answering "how does this work?" |
33
- | Cross Review | `cross-review/` | Have a different vendor's model (DeepSeek, GLM, any OpenAI-compatible endpoint) review the current diff. Use after a phase is green and before commit/merge, or for a second opinion on a risky diff. |
33
+ | Cross Review | `cross-review/` | Have a different vendor's model (agy Argon by default; DeepSeek, GLM, any OpenAI-compatible endpoint) review the current diff. Use after a phase is green and before commit/merge, or for a second opinion on a risky diff. |
34
34
  | Llm Application Dev | `llm-application-dev/` | LLM applications: prompt engineering, RAG and LLM integration. Use for AI-powered features, chatbots or LLM automation. |
35
35
  | Mcp Builder | `mcp-builder/` | Build high-quality MCP (Model Context Protocol) servers that let LLMs use external APIs and services, in Python (FastMCP) or Node/TypeScript (MCP SDK). |
36
36
  | Observability | `observability/` | Structured logging, correlation IDs, PII redaction, OpenTelemetry tracing, metrics (RED), SLO alerting, health probes and Sentry, in Python and TypeScript. Use when adding logs, traces, metrics or error tracking. |
@@ -458,7 +458,7 @@ LiteLLM cutover. **This table is the single place the intent→model mapping liv
458
458
  | **deepest** | Subtle correctness, security invariants, novel architecture, judgment-heavy seams | `opus` | `/model opus`; `Agent(model: "opus")` | **High** — Anthropic plan quota |
459
459
  | **broad** | Wide parallel coverage of a large but not-subtle surface; the workhorse | `sonnet` | `/model sonnet`; `Agent(model: "sonnet")` | Medium — the default; budget for several |
460
460
  | **mechanical** | Fully-specced, repeat-of-a-known-pattern, no judgment required | `haiku` | `/model haiku`; `Agent(model: "haiku")` | Low |
461
- | **cross-vendor-reviewer** | A *different vendor's* blind spots on a diff — **code review only** | `deepseek` (default), `glm` | `/caddis:cross-review`, `/glm`, `/deepseek` | **Scarce** — separate starter-tier subscription, NOT Anthropic quota. Ration it. |
461
+ | **cross-vendor-reviewer** | A *different vendor's* blind spots on a diff — **code review only** | `agy-argon` (default), `deepseek`, `glm` | `/caddis:cross-review`, `/glm`, `/deepseek` | **Scarce** — separate starter-tier subscription, NOT Anthropic quota. Ration it. |
462
462
  | **synthesis / long-horizon** | Orchestrating many lanes, or work that can't self-verify across a large codebase | `fable` | `/model fable` | **Very high** — ~2× opus's rate-limit burn. RARE. |
463
463
 
464
464
  **Update this table, not the callers**, when a model is added, retired, or re-tiered. A plan that says
@@ -512,7 +512,7 @@ Invent no new machinery. Everything needed already ships:
512
512
  | Per-phase model + lane assignment in a plan | `/caddis:feature-plan` — every phase already carries **Model**, **Lane**, and a cross-review provider |
513
513
 
514
514
  **Reviewer rule (standing):** the reviewer is always a different vendor than whoever wrote the code.
515
- Claude or GLM implemented → DeepSeek reviews (or swap). Never same-vendor.
515
+ Claude or GLM implemented → agy Argon reviews by default (DeepSeek, then GLM, as fallbacks). Never same-vendor.
516
516
 
517
517
  Full command/billing decision table: `docs/guide/multi-model-workflow.md`.
518
518
 
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: cross-review
3
- description: Have a different vendor's model (DeepSeek, GLM, any OpenAI-compatible endpoint) review the current diff. Use after a phase is green and before commit/merge, or for a second opinion on a risky diff.
3
+ description: Have a different vendor's model (agy Argon by default; DeepSeek, GLM, any OpenAI-compatible endpoint) review the current diff. Use after a phase is green and before commit/merge, or for a second opinion on a risky diff.
4
4
  ---
5
5
 
6
6
  # Cross-Review — a second-vendor set of eyes on your diff
7
7
 
8
8
  A different vendor's model has different blind spots. Claude reviewing Claude's diff shares those
9
- blind spots; a **DeepSeek** (or GLM, or any OpenAI-compatible) reviewer catches a different class of
9
+ blind spots; an **agy Argon** (default), DeepSeek, GLM or other OpenAI-compatible reviewer catches a different class of
10
10
  issue. This skill runs that second reviewer over the current changes and acts on its verdict.
11
11
 
12
12
  ## When to use
@@ -20,7 +20,7 @@ issue. This skill runs that second reviewer over the current changes and acts on
20
20
  python "$TOOL" --check-config
21
21
  ```
22
22
 
23
- Exit 0 prints which providers have a key. **Exit 3 means nothing is configured — stop and ask the
23
+ Exit 0 prints which providers are available (agy-argon needs no key, only agy on PATH and caddis_spend.py). **Exit 3 means nothing is configured — stop and ask the
24
24
  user before reading any diff.** Do not proceed, and do not silently skip the review.
25
25
 
26
26
  Ask with `AskUserQuestion` which provider to set up, then write the key to `~/.caddis/keys.env` as
@@ -36,15 +36,16 @@ If a key exists for a *different* provider than the one requested, the error nam
36
36
  exact flag (`--provider glm`). Read the message before concluding anything is missing.
37
37
 
38
38
  ## Prerequisites (one-time)
39
- Only the key is mandatory — the tool ships **provider presets** (default `deepseek`, the cheapest + most
40
- architecturally distinct-from-Claude option; a review costs well under a cent):
39
+ The default reviewer is **agy Argon** (since 2026-10-21; no key, but agy and `caddis_spend.py` must be present). For an HTTP
40
+ provider only the key is mandatory — the tool ships **provider presets** (`deepseek`, `glm`, `openrouter`):
41
41
  ```
42
42
  REVIEW_API_KEY = <your provider key> # REQUIRED (exit 3 without it)
43
- REVIEW_PROVIDER = deepseek # optional: deepseek | glm | openrouter (default deepseek)
43
+ REVIEW_PROVIDER = deepseek # optional: agy-argon | deepseek | glm | openrouter (default agy-argon)
44
44
  REVIEW_BASE_URL = ... # optional: overrides the preset's URL
45
45
  REVIEW_MODEL = ... # optional: overrides the preset's model id
46
46
  ```
47
- Switch provider with one flag: `--provider glm` (or `REVIEW_PROVIDER=glm`). **Future-proofing:** model ids
47
+ Switch provider with one flag: `--provider glm` (or `REVIEW_PROVIDER=glm`, in the env or in `~/.caddis/keys.env`; flag, then env,
48
+ then keys file, then agy Argon). To make DeepSeek the default again, add `REVIEW_PROVIDER=deepseek` to ~/.caddis/keys.env. **Future-proofing:** model ids
48
49
  churn — the preset table in `oss_review.py` is the one place to edit a rename, and `REVIEW_MODEL` /
49
50
  `REVIEW_BASE_URL` always win, so you can point at any new id without touching code.
50
51
 
@@ -91,7 +92,7 @@ smaller chunks; don't just raise `--max-diff-chars` without knowing the endpoint
91
92
  Fix it, then re-review only the fix diff. After 3 rounds, ask the owner (rule 3).
92
93
  - **4 — error** → no verdict parsed, a git failure, or an endpoint/parse failure. Read stderr; do not
93
94
  treat this as CLEAN — investigate.
94
- - **3 — misconfigured** → `REVIEW_API_KEY` is unset. Set it (see Prerequisites) and re-run.
95
+ - **3 — could not run** → no reviewer is available (no agy on PATH and no API key), or every provider failed. Fix it (see Prerequisites) and re-run.
95
96
 
96
97
  ## Three rules: one attempt, one review
97
98
  1. **Think before you send.** Before a task goes to any coder, write its edge cases and check the facts it depends on (one query or one file read).
@@ -1,8 +1,8 @@
1
1
  {
2
- "poolVersion": "1.3.150",
2
+ "poolVersion": "1.3.151",
3
3
  "bundles": {
4
- "antigravity-plugin": "1.3.150",
5
- "antigravity-plugin-extras": "1.3.45",
4
+ "antigravity-plugin": "1.3.151",
5
+ "antigravity-plugin-extras": "1.3.46",
6
6
  "codex": "unknown"
7
7
  }
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caddis/cli",
3
- "version": "0.4.64",
3
+ "version": "0.4.65",
4
4
  "description": "Install, update and diagnose the caddis dev harness across every coding agent you use (Claude Code, agy/Antigravity, and more).",
5
5
  "keywords": [
6
6
  "caddis",