KeiSeiKit-1.0/hooks/graph-export-watcher.sh
KeiSei84 98d30e352f chore(public-prep): scrub author identity + private-IP references (#43)
Pre-public Phase 1. Remove personal/IP traces that should not ship in a
general-purpose kit; keep only intended author attribution.

- no-github-push.sh + hooks-and-blocks.md + ci-scaffold: drop "KeiTech
  unfiled patent IP / trade secrets / priority date" wording; reword as a
  generic opt-in guard for keeping code on a private remote.
- check-error-patterns.sh: remove author-local absolute path from the
  tombstone comment.
- graph-export-watcher.sh: default viz dir to ~/.local/share/kei/graph-viz
  (was a personal project path).
- agent manifests (cost-guardian, modal-runner, infra/ml/code-implementer)
  + ci.yml: strip private memory references and dated personal incidents;
  keep the generic cost/ops lessons. Snapshots regenerated; golden 3/3.

Kept intentionally: author attribution (NOTICE / README / Cargo / plugin).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:31:19 +07:00

18 lines
622 B
Bash
Executable file

#!/bin/sh
# graph-export-watcher.sh — polls kei-graph-export and writes data-runtime.js atomically.
# Bypass: GRAPH_EXPORT_BYPASS=1
INTERVAL="${KEI_GRAPH_EXPORT_INTERVAL_S:-5}"
OUT="${KEI_GRAPH_VIZ_DIR:-$HOME/.local/share/kei/graph-viz}/data-runtime.js"
BIN="$(command -v kei-graph-export 2>/dev/null || echo "$HOME/.cargo/bin/kei-graph-export")"
[ -x "$BIN" ] || exit 0
[ "${GRAPH_EXPORT_BYPASS:-0}" = "1" ] && exit 0
mkdir -p "$(dirname "$OUT")" 2>/dev/null
while true; do
"$BIN" --format spaces-fragment --output "$OUT.tmp" 2>/dev/null \
&& mv "$OUT.tmp" "$OUT" 2>/dev/null
sleep "$INTERVAL"
done