8774e94f91
The demo has been unrunnable since eafd1c1f deleted bot-bottle.demo.json
as a pre-YAML-migration artifact. demo-setup.sh still copied that file
under `set -euo pipefail`, so demo.sh and demo-record.sh both exited
non-zero before launching anything.
Rebuild the fixtures in the current per-file Markdown format. Bottles
are only read from $HOME/.bot-bottle/bottles/ — manifest/index.py
ignores a bottles/ dir in CWD by design (PRD 0011) — so setup now
installs into real config and pairs every write with a .demo-backup
that teardown restores. Teardown compares content before removing, so
a second run cannot delete the user's restored original.
Point the DLP probe at the bottle's own example.org route rather than
api.anthropic.com/dlp-probe. The provider-injected anthropic route
defaults to `redact`, which would forward a scrubbed request instead of
refusing; the declared route sets outbound_on_match: block so probe 3
stays the hard 403 the demo is showing off. Left at the default
`supervise` it would instead hold the request open for up to 300s
awaiting operator approval and stall the recording.
Also drop the stale pipelock naming from the tape (egress is the
gateway's own scanner now), fix demo.sh's ./cli.py invocation, and
pre-warm Dockerfile.gateway instead of the removed Dockerfile.git-gate.
Refs #540
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
40 lines
1.3 KiB
Bash
Executable File
40 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Undo what demo-setup.sh did: remove the installed demo bottle/agent,
|
|
# restore whatever they displaced, drop the dummy SSH identity.
|
|
#
|
|
# Idempotent, and deliberately not `set -e` on the restore path — this
|
|
# runs from an EXIT trap, so a partial setup (or a second invocation)
|
|
# must still put back everything it can rather than bailing on the
|
|
# first missing file.
|
|
|
|
set -uo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
config_root="${BOT_BOTTLE_ROOT:-$HOME/.bot-bottle}"
|
|
|
|
# Remove our copy, then restore the displaced original if there was
|
|
# one. Order matters: the backup can only move back once the demo file
|
|
# is out of the way.
|
|
#
|
|
# The `cmp` guard is what makes a second run safe. Removing $dest
|
|
# unconditionally would delete the user's own file on the second
|
|
# invocation — the first run has already restored it by then, and from
|
|
# teardown's point of view a restored original is indistinguishable
|
|
# from an installed demo file except by content.
|
|
uninstall_demo_file() {
|
|
src=$1
|
|
dest=$2
|
|
if [ -e "$dest" ] && cmp -s "$src" "$dest"; then
|
|
rm -f "$dest"
|
|
fi
|
|
if [ -e "$dest.demo-backup" ]; then
|
|
mv "$dest.demo-backup" "$dest"
|
|
fi
|
|
}
|
|
|
|
uninstall_demo_file scripts/demo/bottle.md "$config_root/bottles/demo.md"
|
|
uninstall_demo_file scripts/demo/agent.md "$config_root/agents/demo.md"
|
|
|
|
rm -rf "$HOME/.cache/bot-bottle-demo"
|