From 6ec25cdd58579abbf70811a08c0a12603a3fe341 Mon Sep 17 00:00:00 2001 From: cheshirecode Date: Sun, 9 Aug 2026 03:30:52 -0400 Subject: [PATCH] fix: ship-hygiene dead pairings, evidence-gate check prefix, council ballot-file contract gap, bin quoting safety Cycle 1: - ship-hygiene/SKILL.md: remove dead budget-mode and systematic-debugging pairings - evidence-gate/SKILL.md: fix bare 'check --gate' to include python3 /scripts prefix - worklog/bin/.gitignore: add __pycache__/ to prevent stale .pyc noise Cycle 2: - council/SKILL.md: fix validate-ballot.py path for consistency (bin/ -> /bin/) - council/SKILL.md: add step 6a to Recipe for explicit save-ballots-to-file before validation Cycle 3: - worklog/bin/refactor.sh: quote ALL_HITS in printf, for loop, and git add - worklog/bin/pre-commit-scan.sh: quote HITS to preserve secret-pattern output - worklog/bin/cache-purge.sh: quote HITS in printf display - worklog/bin/git-hooks/commit-msg: remove unused DRIFT variable - worklog/bin/project.sh: remove unused HB from local declaration --- skills/council/SKILL.md | 5 +++-- skills/evidence-gate/SKILL.md | 2 +- skills/ship-hygiene/SKILL.md | 2 -- skills/worklog/bin/.gitignore | 1 + skills/worklog/bin/cache-purge.sh | 2 +- skills/worklog/bin/git-hooks/commit-msg | 1 - skills/worklog/bin/pre-commit-scan.sh | 2 +- skills/worklog/bin/project.sh | 2 +- skills/worklog/bin/refactor.sh | 6 +++--- 9 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 skills/worklog/bin/.gitignore diff --git a/skills/council/SKILL.md b/skills/council/SKILL.md index 1338c40..d6edecf 100644 --- a/skills/council/SKILL.md +++ b/skills/council/SKILL.md @@ -81,7 +81,7 @@ The full ballot per item is one of: Before tallying, validate every ballot: -- Save each returned ballot verbatim and run `python3 bin/validate-ballot.py --items --unresolved ` from this skill directory. Treat a non-zero exit as malformed and retry once; do not tally an unvalidated ballot. +- Save each returned ballot verbatim and run `python3 /bin/validate-ballot.py --items --unresolved ` from this skill directory. Treat a non-zero exit as malformed and retry once; do not tally an unvalidated ballot. - Invalid criterion name, missing item, or malformed vote -> retry that voter once. - `APPROVE` on an `UNRESOLVED MATERIAL` candidate is malformed -> retry that voter once. - Still invalid after retry -> mark that item ballot `INVALID`, exclude it from support/reject counts, keep the full odd `M_returned` denominator, and mark the item `UNVERIFIED` if fewer than 3 valid item ballots remain. @@ -215,7 +215,8 @@ Voter : 4. **Run discussion** (Stage 3). Use the Stage 3 template, assign every candidate a counterexample survival status, and record additional `D-iN` candidates only when tied to a cross-angle gap. 5. **Run candidate collation** (Stage 4). Use the Stage 4 template. Drop collator-invented, untagged, or evidence-incomplete items before voting. 6. **Run voting** (Stage 5). Use at least 3 odd-count independent voters. Use the Stage 5 template. Retry malformed voters, including forbidden approvals over unresolved material counterexamples, once. -7. **Tally + conclude** (Stage 6). Validate ballots per item, resolve QUALIFY conditions, enforce majority-plus-one support, apply hard-reject vetoes, and produce the final report. +6a. **Save ballots to files.** For each returned voter, write its ballot output to a temp file (e.g. `/tmp/council-ballot-.txt`). +7. **Tally + conclude** (Stage 6). Validate each ballot file with `python3 /bin/validate-ballot.py`, resolve QUALIFY conditions, enforce majority-plus-one support, apply hard-reject vetoes, and produce the final report. ## Run-until-completion behavior diff --git a/skills/evidence-gate/SKILL.md b/skills/evidence-gate/SKILL.md index 0a284b1..bdc4d4f 100644 --- a/skills/evidence-gate/SKILL.md +++ b/skills/evidence-gate/SKILL.md @@ -45,7 +45,7 @@ state, non-empty diff, and merged target before recording it. ## Gate completion -Run `check --gate `. Exit `1` means criteria remain uncovered; do not +Run `python3 /scripts/evidence_gate.py check --gate `. Exit `1` means criteria remain uncovered; do not claim completion. Exit `0` returns a `verification` value containing the gate-file path and SHA-256 digest. Pass that value to the parent workflow's completion record. diff --git a/skills/ship-hygiene/SKILL.md b/skills/ship-hygiene/SKILL.md index c9640a4..b8215d3 100644 --- a/skills/ship-hygiene/SKILL.md +++ b/skills/ship-hygiene/SKILL.md @@ -82,9 +82,7 @@ Skip if: only one PR open, body is short, no recent worklog activity. Overhead n ## Pairings -- `budget-mode` — apply during the worklog compress step. Terse prose, code untouched. - `karpathy-guidelines` — apply during the PR title/body audit step. "Don't refactor what isn't broken" — most PRs need nothing. -- `systematic-debugging` — apply when CI red is per-PR (not systemic) to actually root-cause each failure. - For brittle outputs, invoke `$example-led-instructions`: 0/1/few-shot gate, max 1-3 examples, skip if obvious. ## Examples diff --git a/skills/worklog/bin/.gitignore b/skills/worklog/bin/.gitignore new file mode 100644 index 0000000..ba0430d --- /dev/null +++ b/skills/worklog/bin/.gitignore @@ -0,0 +1 @@ +__pycache__/ \ No newline at end of file diff --git a/skills/worklog/bin/cache-purge.sh b/skills/worklog/bin/cache-purge.sh index e59faf4..c0e19a4 100755 --- a/skills/worklog/bin/cache-purge.sh +++ b/skills/worklog/bin/cache-purge.sh @@ -59,7 +59,7 @@ if [[ -z "$HITS" ]]; then fi echo "Files ever under .cache/ in history:" -printf ' %s\n' $HITS +printf '%s\n' "$HITS" | sed 's/^/ /' echo "" echo "Commits that touch .cache/: $COMMITS" echo "" diff --git a/skills/worklog/bin/git-hooks/commit-msg b/skills/worklog/bin/git-hooks/commit-msg index 3bfd829..ded6927 100755 --- a/skills/worklog/bin/git-hooks/commit-msg +++ b/skills/worklog/bin/git-hooks/commit-msg @@ -91,7 +91,6 @@ STATUS_COUNT="$(printf '%s' "$STATUSES" | grep -c .)" || true [[ "$SLUG_COUNT" -ne "$STATUS_COUNT" ]] && exit 0 [[ -z "$STATUSES" ]] && exit 0 -DRIFT=0 paste <(printf '%s\n' "$SLUGS") <(printf '%s\n' "$STATUSES") | \ while IFS=$'\t' read -r slug trailer_status; do [[ -z "$slug" || -z "$trailer_status" ]] && continue diff --git a/skills/worklog/bin/pre-commit-scan.sh b/skills/worklog/bin/pre-commit-scan.sh index a2474c9..80830d1 100755 --- a/skills/worklog/bin/pre-commit-scan.sh +++ b/skills/worklog/bin/pre-commit-scan.sh @@ -61,7 +61,7 @@ HITS="$(printf '%s\n' "$ADDED" | perl -ne ' [[ -z "$HITS" ]] && exit 0 echo "pre-commit-scan: typed-prefix secret patterns found in staged additions:" >&2 -printf ' %s\n' $HITS >&2 +printf '%s\n' "$HITS" | sed 's/^/ /' >&2 echo "" >&2 echo " If false positive, redact / move out of the staged content. Bypass:" >&2 echo " WORKLOG_NO_SCAN=1 git commit ... # one-shot" >&2 diff --git a/skills/worklog/bin/project.sh b/skills/worklog/bin/project.sh index f36ce94..876ade9 100755 --- a/skills/worklog/bin/project.sh +++ b/skills/worklog/bin/project.sh @@ -365,7 +365,7 @@ cmd_reap() { local f for f in people/*/active/*.md; do [[ -f "$f" ]] || continue - local INFO SID HB + local INFO SID INFO="$(python3 "$SCRIPT_DIR/_claim.py" read "$f" 2>/dev/null)" || continue SID="$(echo "$INFO" | python3 -c 'import json,sys;print(json.load(sys.stdin).get("session_id") or "")')" [[ -z "$SID" ]] && continue diff --git a/skills/worklog/bin/refactor.sh b/skills/worklog/bin/refactor.sh index 92ec574..ac6be6e 100755 --- a/skills/worklog/bin/refactor.sh +++ b/skills/worklog/bin/refactor.sh @@ -117,7 +117,7 @@ if [[ "$COUNT" -eq 0 ]]; then echo "No other files reference '$OLD_SLUG'." else echo "$COUNT file(s) reference '$OLD_SLUG':" - printf ' %s\n' $ALL_HITS + printf ' %s\n' "$ALL_HITS" fi echo "" echo "Plan: rename $OLD_FILE → $NEW_FILE; rewrite '$OLD_SLUG' → '$NEW_SLUG' in the $COUNT files above." @@ -130,7 +130,7 @@ fi # 1. Rewrite references in other files (sed in-place; word-boundary match). if [[ "$COUNT" -gt 0 ]]; then - for f in $ALL_HITS; do + for f in "$ALL_HITS"; do # Use perl for portable word-boundary in-place edit (sed -i syntax differs # between BSD/Linux; perl behaves identically everywhere). perl -i -pe "s/\\b${OLD_SLUG}\\b/${NEW_SLUG}/g" "$f" @@ -140,7 +140,7 @@ fi # 2. Rename the task file via checkpoint.sh (handles the Worklog-Previous-Slug # trailer). Note: checkpoint only stages NEW_FILE; we stage the rewritten # references too so they all land in one commit. -git add $ALL_HITS 2>/dev/null || true +git add "$ALL_HITS" 2>/dev/null || true "$SCRIPT_DIR/checkpoint.sh" "$NEW_SLUG" --rename="$OLD_SLUG" --next="Cross-task slug rename: $OLD_SLUG → $NEW_SLUG, $COUNT references rewritten." echo ""