@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.
- 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_gate.py +19 -2
- package/bundles/antigravity-plugin/scripts/caddis_guide.json +2 -2
- package/bundles/antigravity-plugin/scripts/setup_project_ai.py +13 -1
- package/bundles/manifest.json +2 -2
- package/package.json +1 -1
|
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
|
|
@@ -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
|
|
@@ -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(
|
|
1068
|
+
changed = changed_paths(stdin_text, root)
|
|
1057
1069
|
return run_checks(root, checks, budget, jobs, changed=changed, start=start)
|
|
1058
1070
|
|
|
1059
1071
|
|
package/bundles/manifest.json
CHANGED
package/package.json
CHANGED