@caddis/cli 0.4.95 → 0.4.96

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.179",
3
+ "version": "1.3.180",
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
  }
@@ -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 sorted((root / ".caddis").rglob("*.md")):
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "1.3.178",
4
- "generated": "2026-11-05 01:42 UTC",
3
+ "version": "1.3.179",
4
+ "generated": "2026-11-05 13:49 UTC",
5
5
  "commands": [
6
6
  {
7
7
  "name": "add-rules",
@@ -774,6 +774,14 @@ def _is_zero(sha: str) -> bool:
774
774
  return set(sha) == {"0"}
775
775
 
776
776
 
777
+ def is_delete_only(stdin_text: str) -> bool:
778
+ """True when every pre-push stdin line deletes a remote ref (local sha all zeros): nothing is pushed to check.
779
+
780
+ False for empty stdin (unknown: the dry-run proof uses it) and for any line that is not a ref line."""
781
+ lines = [line.split() for line in stdin_text.splitlines() if line.strip()]
782
+ return bool(lines) and all(len(parts) == 4 and _is_zero(parts[1]) for parts in lines)
783
+
784
+
777
785
  def changed_paths(stdin_text: str, root: Path) -> set | None:
778
786
  """The files a push changes, from git's pre-push stdin (`<local ref> <local sha> <remote ref> <remote sha>`).
779
787
 
@@ -1015,6 +1023,10 @@ def main(argv: list | None = None) -> int:
1015
1023
  parser.add_argument("--root", help="repo root (default: git rev-parse --show-toplevel, else the cwd)")
1016
1024
  parser.add_argument("--config", help="config file (default: <root>/.caddis/config.toml)")
1017
1025
  args = parser.parse_args(argv)
1026
+ stdin_text = _read_stdin()
1027
+ if is_delete_only(stdin_text): # git push --delete: no commit is pushed, so there is nothing to check
1028
+ print("[caddis] delete-only push - nothing to check", flush=True)
1029
+ return 0
1018
1030
  print("[caddis] pre-push quality gate", flush=True)
1019
1031
  if tomllib is None:
1020
1032
  print(f"[gate] this gate needs Python 3.11 or later (found {sys.version.split()[0]}) - nothing checked here, "
@@ -1053,7 +1065,7 @@ def main(argv: list | None = None) -> int:
1053
1065
  budget = 30
1054
1066
  budget = _env_number("CADDIS_GATE_BUDGET_S", float(budget), float)
1055
1067
  jobs = _env_number("CADDIS_GATE_JOBS", 3, int)
1056
- changed = changed_paths(_read_stdin(), root)
1068
+ changed = changed_paths(stdin_text, root)
1057
1069
  return run_checks(root, checks, budget, jobs, changed=changed, start=start)
1058
1070
 
1059
1071
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "poolVersion": "1.3.179",
2
+ "poolVersion": "1.3.180",
3
3
  "bundles": {
4
- "antigravity-plugin": "1.3.179",
4
+ "antigravity-plugin": "1.3.180",
5
5
  "antigravity-plugin-extras": "1.3.51",
6
6
  "codex": "unknown"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caddis/cli",
3
- "version": "0.4.95",
3
+ "version": "0.4.96",
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",