@caddis/cli 0.4.95 → 0.4.97
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.
- package/README.md +2 -0
- package/bundles/antigravity-plugin/plugin.json +1 -1
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_exit.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_file_lock.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_frontmatter.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_redact.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_roadmap.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_rows.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_status.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_tidy.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_todo.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_workstreams.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc +0 -0
- package/bundles/antigravity-plugin/scripts/caddis_fleet.py +31 -21
- package/bundles/antigravity-plugin/scripts/caddis_gate.py +19 -2
- package/bundles/antigravity-plugin/scripts/caddis_guide.json +2 -2
- package/bundles/antigravity-plugin/scripts/caddis_hub_collect.py +51 -10
- package/bundles/antigravity-plugin/scripts/caddis_lanes.py +154 -130
- package/bundles/antigravity-plugin/scripts/caddis_todo.py +180 -3
- package/bundles/antigravity-plugin/scripts/schemas/hub-collect.schema.json +57 -0
- package/bundles/antigravity-plugin/scripts/schemas/hub-plans.schema.json +57 -0
- package/bundles/antigravity-plugin/scripts/setup_project_ai.py +13 -1
- package/bundles/antigravity-plugin/scripts/templates/coordinator.md +3 -3
- package/bundles/antigravity-plugin/skills/coordinate/SKILL.md +4 -1
- package/bundles/antigravity-plugin/skills/handoff/SKILL.md +21 -8
- package/bundles/manifest.json +2 -2
- package/dist/cli.js +214 -71
- package/dist/export/assets/{export-CMtV-slT.css → export-B5Lzo-9e.css} +1 -1
- package/dist/export/assets/{export-DtlDFN4L.js → export-PF4z_ff4.js} +29 -29
- package/dist/export/index.html +2 -2
- package/dist/ui/assets/{Activity-BDjet2xd.js → Activity-DN1XBfsH.js} +1 -1
- package/dist/ui/assets/{Guide-Czn5sK0f.js → Guide-D-lZVEKf.js} +1 -1
- package/dist/ui/assets/{RoadmapTab-Bd8geyQx.js → RoadmapTab-tqQd2sYq.js} +7 -7
- package/dist/ui/assets/{index-CmngQ8Mk.js → index-CWslZIzV.js} +44 -44
- package/dist/ui/assets/{index-Bd0Z4jR8.css → index-CwgRPpjT.css} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,6 +141,8 @@ starts it in the background; `caddis hub stop` stops it.
|
|
|
141
141
|
|
|
142
142
|
**Timeline first, Board second.** Roadmaps and plans open on the Timeline view by default, with the Board view as the second option. Click any phase tile on the Timeline to open the phase panel and read its Tracker status, PR links and plan section text.
|
|
143
143
|
|
|
144
|
+
**Branch progress.** A plan that an open PR changes shows the PR branch's Tracker and `status:`, with the badge `on branch (PR #n)`. Done on main never goes back, and forks are not shown. The hub reads PR heads from GitHub and branch refs from the local origin refs, and never fetches. With no PR data, the line above the plans says `branch progress off (no PR data)`. `caddis hub export --prs <file>` takes the output of `gh pr list --json number,headRefName,isDraft,isCrossRepository,updatedAt`. The export never publishes a branch name, and a privacy hit only in branch content publishes main only.
|
|
145
|
+
|
|
144
146
|
**Guide Poster and Details.** The Guide page has a `Poster` tab (with `Workflow` and `Mind map` views, plus a `Print` button for a two-page A3 landscape wall poster) and a `Details` tab. Every item on the poster links to its entry in Details.
|
|
145
147
|
|
|
146
148
|
**Guide Wall poster.** A third tab, `Wall poster` (`#/guide/wall`), shows one A4 landscape sheet: the daily commands in order, a card per stage (plan, build, review, ship, continuity, knowledge, setup), and the agents. The `Print` button prints exactly that sheet on one page. It is built from the same installed guide data as the other tabs, so a new command, agent or count appears by itself after `caddis update` and a hub restart. The text shrinks (to 60% at most) when the guide grows, so nothing is cut off. Each line is the first clause of the description; the Details tab has the full text.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bundles/antigravity-plugin/scripts/__pycache__/caddis_worktree_safety.cpython-311.pyc
CHANGED
|
Binary file
|
|
@@ -204,10 +204,10 @@ def render_roster(acks: list[Ack], coordinator: str) -> str:
|
|
|
204
204
|
return "\n".join(lines) + "\n"
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
def _fenced(text: str) -> str:
|
|
207
|
+
def _fenced(text: str, lang: str = "text") -> str:
|
|
208
208
|
longest = max((len(r) for r in re.findall(r"`+", text)), default=0)
|
|
209
209
|
fence = "`" * max(3, longest + 1)
|
|
210
|
-
return f"{fence}
|
|
210
|
+
return f"{fence}{lang}\n{text}\n{fence}"
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
def start_line(ack: Ack, stamp: datetime) -> str:
|
|
@@ -475,11 +475,15 @@ def resume_prompt(relay_text: str) -> str:
|
|
|
475
475
|
return prompt
|
|
476
476
|
|
|
477
477
|
|
|
478
|
+
def one_line(text: str) -> str:
|
|
479
|
+
"""The text on one line, with no `'` and no `"`: a `'` would end a single-quoted word in bash and a `"` is dropped
|
|
480
|
+
by Windows PowerShell 5.1, so both become typographic."""
|
|
481
|
+
return " ".join(text.split()).replace("'", "’").replace('"', "”")
|
|
482
|
+
|
|
483
|
+
|
|
478
484
|
def shell_arg(text: str) -> str:
|
|
479
|
-
"""One word that PowerShell and bash read the same: one line, inside single quotes (no expansion in either).
|
|
480
|
-
|
|
481
|
-
one_line = " ".join(text.split())
|
|
482
|
-
return "'" + one_line.replace("'", "’").replace('"', "”") + "'"
|
|
485
|
+
"""One word that PowerShell and bash read the same: one line, inside single quotes (no expansion in either)."""
|
|
486
|
+
return "'" + one_line(text) + "'"
|
|
483
487
|
|
|
484
488
|
|
|
485
489
|
ANNOUNCE_ID = "<your session id>"
|
|
@@ -501,27 +505,33 @@ def announce_text(name: str, folder: str) -> str:
|
|
|
501
505
|
f"a reply. If the script is missing or lists no peer, skip this.")
|
|
502
506
|
|
|
503
507
|
|
|
508
|
+
RESUME_PROMPT_LABEL = "After /clear in this window, paste this:"
|
|
509
|
+
RESUME_LINE_LABEL = "In a new terminal, paste this:"
|
|
510
|
+
|
|
511
|
+
|
|
504
512
|
def render_resume(session: str, session_id: str, workstream: str, prompt: str, role: str, stamp: datetime,
|
|
505
513
|
fleet_mode: bool = False, announce: bool = False, folder: str = "",
|
|
506
514
|
root: Path | None = None) -> str:
|
|
507
|
-
"""The last output of `/caddis:handoff`. In a fleet close the restart sheet holds the only start line
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
515
|
+
"""The last output of `/caddis:handoff`. In a fleet close the restart sheet holds the only start line, so the
|
|
516
|
+
block keeps the relay's own prompt and says so.
|
|
517
|
+
|
|
518
|
+
Otherwise it ends with two labelled copy blocks. The model re-types this output in a Markdown reply, so colour
|
|
519
|
+
cannot reach the owner; a label and a fence can (owner, 5 Nov). Block 1 is the prompt on one line, to paste after
|
|
520
|
+
`/clear` in the same window. Block 2 is the full start line, to paste in a new terminal.
|
|
521
|
+
With `announce`, both end with the whoami + announce sentence: the new session receives it with its name.
|
|
522
|
+
With `root`, block 2 first changes to the repo, because the relay's paths are repo-relative. `;`, as in the
|
|
523
|
+
restart sheet: Windows PowerShell 5.1 has no `&&`."""
|
|
514
524
|
repo = f"Repo: {root.as_posix()}\n" if root is not None else ""
|
|
515
525
|
cd = f'cd "{root.as_posix()}"; ' if root is not None else ""
|
|
526
|
+
head = f"{model_line(role)}=== RESUME ===\nSession: {session} ({session_id})\nWorkstream: {workstream}\n{repo}"
|
|
516
527
|
if fleet_mode:
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
f"{repo}{_fenced(shown)}\n{start}\n")
|
|
528
|
+
return f"{head}{_fenced(prompt)}\nStart line: from the restart sheet\n"
|
|
529
|
+
name = new_name(role, stamp)
|
|
530
|
+
if announce:
|
|
531
|
+
prompt = f"{prompt}\n{announce_text(name, folder)}"
|
|
532
|
+
full = f"{cd}claude {_model_flags(role)} --name {name} {shell_arg(prompt)}"
|
|
533
|
+
return (f"{head}{RESUME_PROMPT_LABEL}\n{_fenced(one_line(prompt))}\n"
|
|
534
|
+
f"{RESUME_LINE_LABEL}\n{_fenced(full, 'bash')}\n")
|
|
525
535
|
|
|
526
536
|
|
|
527
537
|
def render_coordinator_resume(session: str, session_id: str, workstream: str) -> str:
|
|
@@ -747,10 +747,27 @@ def gate_review_tier(
|
|
|
747
747
|
return EXIT_OK
|
|
748
748
|
|
|
749
749
|
|
|
750
|
+
def _caddis_markdown(root: Path) -> list[Path]:
|
|
751
|
+
"""The .caddis/**/*.md files a clean checkout of `root` would hold: tracked or untracked, never gitignored.
|
|
752
|
+
|
|
753
|
+
CI checks a clean checkout, so a local ignored file (a relay under .caddis/relay/) must not fail the gate here.
|
|
754
|
+
Outside a git repo (or with no git) this falls back to walking the folder."""
|
|
755
|
+
try:
|
|
756
|
+
r = subprocess.run(
|
|
757
|
+
["git", "ls-files", "-z", "--cached", "--others", "--exclude-standard", "--", ".caddis"],
|
|
758
|
+
cwd=str(root), capture_output=True, stdin=subprocess.DEVNULL, timeout=60, check=False)
|
|
759
|
+
except (OSError, subprocess.SubprocessError):
|
|
760
|
+
r = None
|
|
761
|
+
if r is None or r.returncode != 0:
|
|
762
|
+
return sorted((root / ".caddis").rglob("*.md"))
|
|
763
|
+
names = {n for n in r.stdout.decode("utf-8", errors="surrogateescape").split("\0") if n.endswith(".md")}
|
|
764
|
+
return sorted(p for p in (root / n for n in names) if p.is_file()) # a tracked file deleted locally is skipped
|
|
765
|
+
|
|
766
|
+
|
|
750
767
|
def gate_docs_check(root: Path) -> int:
|
|
751
|
-
"""Report every typed .caddis Markdown document with an invalid header."""
|
|
768
|
+
"""Report every typed .caddis Markdown document with an invalid header. Gitignored files are not judged."""
|
|
752
769
|
failures = 0
|
|
753
|
-
for path in
|
|
770
|
+
for path in _caddis_markdown(root):
|
|
754
771
|
relative = path.relative_to(root).as_posix()
|
|
755
772
|
if not caddis_frontmatter.doc_in_scope(relative, root):
|
|
756
773
|
continue
|
|
@@ -70,13 +70,16 @@ def _fetch_time(common: Path) -> int | None:
|
|
|
70
70
|
return None
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
def _plans_json(root: Path) -> dict:
|
|
73
|
+
def _plans_json(root: Path, prs: list[dict] | None = None, off_reason: str | None = None) -> dict:
|
|
74
74
|
"""Plans from the origin ref the repo already has (R15: local git only), so a pushed Tracker edit shows with no
|
|
75
75
|
pull. A folder that is not a git checkout, or has no origin default branch, reads the working tree."""
|
|
76
76
|
branch = None
|
|
77
77
|
common = git_common_dir(Path(root))
|
|
78
78
|
if common is None:
|
|
79
|
-
|
|
79
|
+
out = _sibling("caddis_todo").plans_json(root, prs=prs)
|
|
80
|
+
if off_reason is not None and isinstance(out, dict):
|
|
81
|
+
out["overlay"] = {"state": "off", "reason": off_reason, "count": 0}
|
|
82
|
+
return out
|
|
80
83
|
try: # origin/HEAD is a one-line file; reading it saves a git process per repo
|
|
81
84
|
head = (common / "refs" / "remotes" / "origin" / "HEAD").read_text(encoding="utf-8").strip()
|
|
82
85
|
except (OSError, UnicodeDecodeError):
|
|
@@ -95,9 +98,11 @@ def _plans_json(root: Path) -> dict:
|
|
|
95
98
|
branch = None
|
|
96
99
|
finally:
|
|
97
100
|
roadmap.FETCH = saved
|
|
98
|
-
out = _sibling("caddis_todo").plans_json(root, branch=branch)
|
|
101
|
+
out = _sibling("caddis_todo").plans_json(root, branch=branch, prs=prs)
|
|
99
102
|
if common is not None and isinstance(out, dict):
|
|
100
103
|
out["fetched_at"] = _fetch_time(common)
|
|
104
|
+
if off_reason is not None and isinstance(out, dict):
|
|
105
|
+
out["overlay"] = {"state": "off", "reason": off_reason, "count": 0}
|
|
101
106
|
return out
|
|
102
107
|
|
|
103
108
|
|
|
@@ -219,7 +224,25 @@ def _runner_files(common: Path) -> list[Path]:
|
|
|
219
224
|
return _files(common / RUNNER_DIR, recurse=True)
|
|
220
225
|
|
|
221
226
|
|
|
222
|
-
def
|
|
227
|
+
def load_prs(path: str) -> dict[str, list[dict]] | None:
|
|
228
|
+
try:
|
|
229
|
+
data = json.loads(Path(path).read_text(encoding="utf-8"))
|
|
230
|
+
except (OSError, UnicodeDecodeError, json.JSONDecodeError):
|
|
231
|
+
return None
|
|
232
|
+
if not isinstance(data, dict) or data.get("schema") != 1:
|
|
233
|
+
return None
|
|
234
|
+
repos = data.get("repos")
|
|
235
|
+
if not isinstance(repos, dict):
|
|
236
|
+
return None
|
|
237
|
+
out: dict[str, list[dict]] = {}
|
|
238
|
+
for key, val in repos.items():
|
|
239
|
+
if not isinstance(key, str) or not isinstance(val, list):
|
|
240
|
+
return None
|
|
241
|
+
out[key] = [item for item in val if isinstance(item, dict)]
|
|
242
|
+
return out
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def fingerprint(repo: Path, prs: list[dict] | None = None) -> str:
|
|
223
246
|
"""sha256 over the sorted (name, mtime_ns, size) of every input file and origin ref file. Empty list: still a hash.
|
|
224
247
|
|
|
225
248
|
The roadmaps come from the origin refs (`git show origin/<default>:...`), so a fetch must change the hash."""
|
|
@@ -236,6 +259,8 @@ def fingerprint(repo: Path) -> str:
|
|
|
236
259
|
except OSError:
|
|
237
260
|
continue # the file went away while we looked
|
|
238
261
|
rows.append((name, info.st_mtime_ns, info.st_size))
|
|
262
|
+
if prs is not None:
|
|
263
|
+
rows.append((f"prs:{hashlib.sha256(json.dumps(prs, sort_keys=True).encode('utf-8')).hexdigest()}", 0, 0))
|
|
239
264
|
return hashlib.sha256(json.dumps(sorted(rows)).encode("utf-8")).hexdigest()
|
|
240
265
|
|
|
241
266
|
|
|
@@ -251,13 +276,22 @@ def parse_known(values: list[str]) -> dict[str, str]:
|
|
|
251
276
|
return known
|
|
252
277
|
|
|
253
278
|
|
|
254
|
-
def collect_repo(path: str, kinds: tuple[str, ...], known: dict[str, str] | None = None
|
|
279
|
+
def collect_repo(path: str, kinds: tuple[str, ...], known: dict[str, str] | None = None,
|
|
280
|
+
prs_map: dict[str, list[dict]] | None = None, overlay: bool = False) -> dict:
|
|
255
281
|
repo = Path(path)
|
|
256
282
|
if not repo.is_dir():
|
|
257
283
|
return {"path": path, "error": "not a folder"}
|
|
258
284
|
entry: dict = {"path": path}
|
|
285
|
+
repo_prs, off = None, None
|
|
286
|
+
if overlay:
|
|
287
|
+
if prs_map is None:
|
|
288
|
+
off = "PR data unreadable"
|
|
289
|
+
elif path not in prs_map: # `path` is the exact --repos string
|
|
290
|
+
off = "no PR data"
|
|
291
|
+
else:
|
|
292
|
+
repo_prs = prs_map[path]
|
|
259
293
|
try:
|
|
260
|
-
entry["fingerprint"] = fingerprint(repo)
|
|
294
|
+
entry["fingerprint"] = fingerprint(repo, repo_prs)
|
|
261
295
|
except Exception as exc: # a repo we cannot read must not stop the others
|
|
262
296
|
return {"path": path, **_error(exc)}
|
|
263
297
|
if known and known.get(path) == entry["fingerprint"]:
|
|
@@ -266,15 +300,19 @@ def collect_repo(path: str, kinds: tuple[str, ...], known: dict[str, str] | None
|
|
|
266
300
|
if kind not in kinds:
|
|
267
301
|
continue
|
|
268
302
|
try:
|
|
269
|
-
|
|
303
|
+
if kind == "plans":
|
|
304
|
+
entry[kind] = _plans_json(repo, prs=repo_prs, off_reason=off)
|
|
305
|
+
else:
|
|
306
|
+
entry[kind] = _REPO_COLLECTORS[kind](repo)
|
|
270
307
|
except Exception as exc:
|
|
271
308
|
entry[kind] = _error(exc)
|
|
272
309
|
return entry
|
|
273
310
|
|
|
274
311
|
|
|
275
|
-
def collect(repos: list[str], kinds: tuple[str, ...], known: dict[str, str] | None = None
|
|
312
|
+
def collect(repos: list[str], kinds: tuple[str, ...], known: dict[str, str] | None = None,
|
|
313
|
+
prs_map: dict[str, list[dict]] | None = None, overlay: bool = False) -> dict:
|
|
276
314
|
out: dict = {"schema": SCHEMA, "generated_at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
|
|
277
|
-
"repos": [collect_repo(path, kinds, known) for path in repos]}
|
|
315
|
+
"repos": [collect_repo(path, kinds, known, prs_map, overlay) for path in repos]}
|
|
278
316
|
for kind, call in (("spend", _spend_json), ("guide", _guide_json)):
|
|
279
317
|
if kind not in kinds:
|
|
280
318
|
continue
|
|
@@ -300,6 +338,7 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
300
338
|
parser.add_argument("--repos", nargs="+", required=True, metavar="PATH")
|
|
301
339
|
parser.add_argument("--only", default=",".join(KINDS), help="comma list of: " + ", ".join(KINDS))
|
|
302
340
|
parser.add_argument("--known", nargs="+", default=[], metavar="PATH=FP")
|
|
341
|
+
parser.add_argument("--prs-file", default=None, metavar="PATH")
|
|
303
342
|
parser.add_argument("--json", action="store_true", required=True)
|
|
304
343
|
args = parser.parse_args(argv)
|
|
305
344
|
kinds = tuple(k.strip() for k in args.only.split(",") if k.strip())
|
|
@@ -310,7 +349,9 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
310
349
|
known = parse_known(args.known)
|
|
311
350
|
except ValueError as exc:
|
|
312
351
|
parser.error(str(exc))
|
|
313
|
-
|
|
352
|
+
overlay = args.prs_file is not None
|
|
353
|
+
prs_map = load_prs(args.prs_file) if overlay else None
|
|
354
|
+
print(json.dumps(collect(args.repos, kinds, known, prs_map, overlay), ensure_ascii=False))
|
|
314
355
|
return 0
|
|
315
356
|
|
|
316
357
|
|