#!/usr/bin/env bash # Tick intake briefing — one command for tick.md step 0. # Binding: wiki/process/agent-scale.md slice L; procedure wiki/process/tick.md. # # Emits, in intake order: recent commits, activity, project status, decision # labels (tg-backed public records, best-effort), the findings queue, and the stalest coverage # rows from wiki/process/tick-ledger.md. Sections degrade to a one-line note # instead of failing the brief. set -uo pipefail cd "$(dirname "$0")/.." || exit 1 ledger="wiki/process/tick-ledger.md" section() { printf '\n== %s ==\n' "$1" } section "recent commits" git log --oneline -15 || echo "(git log unavailable)" section "activity" if [ -x tools/claim.sh ]; then tools/claim.sh list || echo "(claim list failed)" else echo "(tools/claim.sh missing)" fi section "project status" if [ -f tools/project-status.py ]; then python3 tools/project-status.py || echo "(project status failed)" else echo "(tools/project-status.py missing)" fi section "decision labels (harvest decision-made first)" if command -v tg >/dev/null 2>&1 && [ -f tools/tangled_issues.py ]; then decision_json=$(python3 tools/tangled_issues.py list --state open 2>/dev/null) decision_status=$? if [ "$decision_status" -eq 0 ]; then python3 -c ' import json, sys issues = json.load(sys.stdin)["issues"] rows = [] for issue in issues: labels = sorted(label["name"] for label in issue.get("labels", []) if label["name"].startswith("decision-")) if labels: rows.append(("decision-made" not in labels, issue["number"], labels, issue)) for _, number, labels, issue in sorted(rows): print("#{} [{}] {} ({})".format(number, ",".join(labels), issue["title"], issue["rkey"])) if not rows: print("(none)") ' <<< "$decision_json" || echo "(decision-label formatting failed)" else echo "(tg-backed decision-label read failed)" fi else echo "(tg or tools/tangled_issues.py unavailable)" fi section "findings queue (act on these before fresh audit)" if [ -f "$ledger" ]; then queue=$(awk '/^## Findings queue/{inq=1; next} inq && /^## /{inq=0} inq && /^- /' "$ledger") if [ -n "$queue" ]; then printf '%s\n' "$queue" else echo "(empty)" fi else echo "($ledger missing)" fi section "coverage, stalest first (fresh-audit picks from the top)" if [ -f "$ledger" ]; then awk -F'|' '/^\|/ && $3 !~ /Last audited/ && $2 !~ /^[- ]+$/ { gsub(/^ +| +$/, "", $2); gsub(/^ +| +$/, "", $3); gsub(/^ +| +$/, "", $4); printf "%s %s %s\n", $3, $4, $2 }' "$ledger" | sort | head -15 echo "(slices never audited are staler than any row — see wiki/overview.md)" else echo "($ledger missing)" fi