#!/usr/bin/env bash # # Anti-drift diff demo (Phase 7A, Step 7A-12) — reproducible driver. # # Proves the FLOW-PROJECTION-GENERATOR-CONTRACT-7A-11 §10 acceptance bar end-to-end against # our own repo guidance, using the real `knowtation flow project` CLI: # 1. Generate marker-first, ordered, secret-free artifacts from a canonical Flow. # 2. Edit canonical + bump version -> regenerate -> diff shows ONLY the canonical change. # 3. Delete the artifact -> regenerate -> reproduced byte-for-byte. # 4. Hand-edit the artifact -> `--check` reports drift and exits non-zero. # 5. Canonical ahead of a pinned artifact -> `--check` reports stale and exits non-zero. # 6. Fidelity is honest (cursor_rule drops `when_not_to_run`; cli_runbook expresses it). # # Scope fence (7A-12): demo only. The shipped `flows/starter/` bundles, the live data store, # the real `AGENTS.md`, and `.cursor/rules/` are NOT touched — the demo runs against copied # starter bundles (`demo-starters/v1`,`/v2`) and a throwaway data store (mktemp). set -uo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" cd "$REPO_ROOT" EV="docs/evidence/7A-12" ART="$EV/artifacts" V1="$EV/demo-starters/v1" V2="$EV/demo-starters/v2" STORE_ROOT="$(mktemp -d)" export KNOWTATION_DATA_DIR="$STORE_ROOT/data" mkdir -p "$KNOWTATION_DATA_DIR" "$ART" TRANSCRIPT="$ART/transcript.txt" : > "$TRANSCRIPT" log() { printf '%s\n' "$*" | tee -a "$TRANSCRIPT"; } run() { # run