@polderlabs/bizar 6.2.3 → 6.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/cli/bin.mjs +14 -0
  2. package/cli/commands/sandbox.mjs +220 -0
  3. package/cli/commands/validate.mjs +66 -0
  4. package/cli/commands/validate.test.mjs +72 -0
  5. package/cli/provision.mjs +107 -0
  6. package/cli/provision.test.mjs +102 -0
  7. package/config/agents/_shared/AGENT_BASELINE.md +104 -645
  8. package/config/agents/_shared/CLINE_TOOLS.md +398 -0
  9. package/config/agents/agent-browser.md +1 -1
  10. package/config/agents/baldr.md +1 -1
  11. package/config/agents/forseti.md +1 -1
  12. package/config/agents/frigg.md +1 -1
  13. package/config/agents/heimdall.md +1 -1
  14. package/config/agents/hermod.md +1 -1
  15. package/config/agents/mimir.md +1 -1
  16. package/config/agents/odin.md +1 -1
  17. package/config/agents/quick.md +1 -1
  18. package/config/agents/semble-search.md +1 -1
  19. package/config/agents/thor.md +1 -1
  20. package/config/agents/tyr.md +1 -1
  21. package/config/agents/vidarr.md +1 -1
  22. package/config/agents/vor.md +1 -1
  23. package/config/cline.json.template +2 -2
  24. package/config/skills/bizar/SKILL.md +197 -0
  25. package/config/skills/cubesandbox/SKILL.md +148 -0
  26. package/config/skills/harness-engineering/SKILL.md +142 -0
  27. package/package.json +1 -1
  28. package/plugins/bizar/index.ts +57 -4
  29. package/plugins/bizar/package.json +1 -1
  30. package/plugins/bizar/src/clineruntime.ts +18 -3
  31. package/plugins/bizar/src/fingerprint.ts +11 -11
  32. package/plugins/bizar/src/options.ts +14 -7
  33. package/plugins/bizar/src/tools/sandbox.ts +232 -0
  34. package/plugins/bizar/src/trajectory.ts +2 -2
  35. package/plugins/bizar/tests/clineruntime-config.test.ts +45 -4
  36. package/plugins/bizar/tests/fingerprint.test.ts +28 -0
  37. package/plugins/bizar/tests/options.test.ts +6 -6
  38. package/plugins/bizar/tests/safety.test.ts +25 -0
  39. package/plugins/bizar/tests/tools/sandbox.test.ts +117 -0
  40. package/scripts/bh-full-e2e.mjs +22 -0
  41. package/scripts/check-agents.mjs +73 -0
  42. package/scripts/mirror-agents-md.sh +69 -0
  43. package/scripts/test-in-container.sh +135 -0
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # scripts/mirror-agents-md.sh — keep CLAUDE.md in sync with AGENTS.md.
4
+ #
5
+ # Both files are part of the walkinglabs/awesome-harness-engineering
6
+ # convention. AGENTS.md is the canonical source; CLAUDE.md is the
7
+ # mirror for tools that hard-code `CLAUDE.md` as the entry point.
8
+ #
9
+ # Usage: ./scripts/mirror-agents-md.sh [--check]
10
+ #
11
+ # --check exits 1 if CLAUDE.md is out of sync (for CI).
12
+
13
+ set -euo pipefail
14
+
15
+ cd "$(dirname "$0")/.."
16
+
17
+ CHECK=0
18
+ for arg in "$@"; do
19
+ case "$arg" in
20
+ --check) CHECK=1 ;;
21
+ *) echo "unknown arg: $arg" >&2; exit 2 ;;
22
+ esac
23
+ done
24
+
25
+ if [[ ! -f AGENTS.md ]]; then
26
+ echo "AGENTS.md missing — cannot mirror" >&2
27
+ exit 1
28
+ fi
29
+
30
+ # Mirror script: extract everything from AGENTS.md past the first `# `
31
+ # heading, prepend a banner. Idempotent.
32
+ BODY=$(awk '/^# / { if (seen) exit; seen=1; next } { print }' AGENTS.md)
33
+
34
+ TMP=$(mktemp)
35
+ trap "rm -f '$TMP'" EXIT
36
+
37
+ cat > "$TMP" <<EOF
38
+ # CLAUDE.md — Mirror of AGENTS.md for Claude Code compatibility
39
+
40
+ > **This file is auto-mirrored from \`AGENTS.md\` for tools that look for
41
+ > \`CLAUDE.md\` (Claude Code, walkinglabs/learn-harness-engineering,
42
+ > external agents following the AGENTS.md convention). DO NOT EDIT THIS
43
+ > FILE DIRECTLY — edit \`AGENTS.md\` and run \`make mirror-agents-md\`.
44
+ >
45
+ > Source: \`AGENTS.md\` (canonical)
46
+ > Mirrored: $(date -Iseconds) by \`scripts/mirror-agents-md.sh\`
47
+
48
+ ---
49
+
50
+ $BODY
51
+ EOF
52
+
53
+ if [[ $CHECK -eq 1 ]]; then
54
+ if [[ ! -f CLAUDE.md ]] || ! cmp -s "$TMP" CLAUDE.md; then
55
+ echo "CLAUDE.md is out of sync with AGENTS.md" >&2
56
+ diff CLAUDE.md "$TMP" | head -40 || true
57
+ exit 1
58
+ fi
59
+ echo "CLAUDE.md is in sync"
60
+ exit 0
61
+ fi
62
+
63
+ if [[ ! -f CLAUDE.md ]] || ! cmp -s "$TMP" CLAUDE.md; then
64
+ mv "$TMP" CLAUDE.md
65
+ echo "✓ CLAUDE.md updated from AGENTS.md"
66
+ else
67
+ echo "✓ CLAUDE.md already in sync"
68
+ rm "$TMP"
69
+ fi
@@ -0,0 +1,135 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # scripts/test-in-container.sh — full make check inside an ephemeral
4
+ # container. This is the canonical "fully tested every part of Bizar"
5
+ # witness.
6
+ #
7
+ # v6.3.0 — synthesizes walkinglabs/awesome-harness-engineering L11
8
+ # "observability belongs inside the harness" + the CubeSandbox deep
9
+ # dive.
10
+ #
11
+ # What we run inside the container:
12
+ # - bun install (workspace bootstrap)
13
+ # - bunx tsc --noEmit (plugin + sdk)
14
+ # - bun test (plugin + sdk)
15
+ # - node --test (CLI tests)
16
+ # - bizar validate (24 health checks)
17
+ # - bizar sandbox doctor (CubeSandbox smoke test)
18
+ #
19
+ # Verifies Bizar builds and tests cleanly on a fresh, rootless podman.
20
+ # Podman is used because it supports rootless + the user's preferred
21
+ # runtime; swap to `docker` for the docker-only variant.
22
+
23
+ set -euo pipefail
24
+
25
+ cd "$(dirname "$0")/.."
26
+
27
+ IMAGE="docker.io/library/alpine:latest"
28
+ ALT_IMAGE="docker.io/library/golang:1.23-alpine"
29
+
30
+ echo "▶ test-in-container.sh"
31
+ echo " image: ${IMAGE}"
32
+
33
+ # Try podman first (rootless-friendly), then docker.
34
+ RUNTIME=""
35
+ if command -v podman >/dev/null && podman run --rm hello-world >/dev/null 2>&1; then
36
+ RUNTIME="podman"
37
+ elif command -v docker >/dev/null && docker info >/dev/null 2>&1; then
38
+ RUNTIME="docker"
39
+ else
40
+ echo "✗ neither podman nor docker available" >&2
41
+ exit 2
42
+ fi
43
+
44
+ echo " runtime: ${RUNTIME}"
45
+
46
+ # Pin the directory so we can mount it. Note: ROOT env must match
47
+ # host uid so writes don't go to root:root.
48
+ PWD_NOW=$(pwd)
49
+ USER_ID=$(id -u)
50
+ GROUP_ID=$(id -g)
51
+
52
+ COMMON_FLAGS=(
53
+ --rm
54
+ --network=host
55
+ -v "${PWD_NOW}:/repo:rw"
56
+ -w /repo
57
+ -e "BUN_INSTALL=/root/.bun"
58
+ -e "PATH=/root/.bun/bin:/usr/local/bin:/usr/bin:/bin"
59
+ -e "HOME=/root"
60
+ )
61
+
62
+ # Probe what the image can run. We prefer the official alpine image which
63
+ # ships node + npm; bun is then installed via curl. golang fallback
64
+ # doesn't have a binary we want, so always use alpine if available.
65
+ USE_IMAGE="$IMAGE"
66
+ PKG_MGR="apk add --no-cache"
67
+ EXTRA_PKGS="bash git curl unzip nodejs npm"
68
+
69
+ mkdir -p /tmp/bizar-container-logs
70
+ LOG="/tmp/bizar-container-logs/test-$(date +%Y%m%d-%H%M%S).log"
71
+
72
+ # Run the whole pipeline. We use bash -lc so PATH includes /root/.bun/bin
73
+ # after curl installs it.
74
+ ${RUNTIME} run "${COMMON_FLAGS[@]}" "$USE_IMAGE" sh -lc '
75
+ set -uo pipefail
76
+ echo "① bootstrap"
77
+ apk add --no-cache bash git curl unzip nodejs npm 2>&1 | tail -2 || true
78
+ if ! command -v bun >/dev/null 2>&1; then
79
+ curl -fsSL https://bun.sh/install | bash >/dev/null 2>&1 || true
80
+ fi
81
+ if [ -f /root/.bun/bin/bun ]; then
82
+ export PATH="/root/.bun/bin:$PATH"
83
+ fi
84
+ echo " bun: $(command -v bun >/dev/null 2>&1 && bun --version || echo missing)"
85
+ echo " node: $(node --version)"
86
+ echo " npm: $(npm --version)"
87
+
88
+ echo "② install"
89
+ bun install --no-save 2>&1 | tail -5 || echo " bun install had warnings"
90
+
91
+ echo "③ typecheck"
92
+ if ./node_modules/.bin/tsc --noEmit > /tmp/tsc.log 2>&1; then
93
+ echo " ✓ typecheck passed"
94
+ else
95
+ echo " ✗ typecheck failed"
96
+ tail -30 /tmp/tsc.log
97
+ exit 1
98
+ fi
99
+
100
+ echo "④ plugin + sdk tests"
101
+ if bun test plugins/bizar packages/sdk > /tmp/bun-test.log 2>&1; then
102
+ tail -5 /tmp/bun-test.log
103
+ if grep -q " 0 fail" /tmp/bun-test.log; then
104
+ echo " ✓ bun tests passed"
105
+ else
106
+ echo " ✗ bun test had failures"
107
+ exit 1
108
+ fi
109
+ else
110
+ echo " ✗ bun test crashed"
111
+ tail -30 /tmp/bun-test.log
112
+ exit 1
113
+ fi
114
+
115
+ echo "⑤ CLI tests"
116
+ if command -v node >/dev/null 2>&1; then
117
+ if node --test cli/install.test.mjs cli/provision.test.mjs cli/commands/validate.test.mjs cli/commands/setup-provider.test.mjs cli/commands/rca.test.mjs > /tmp/cli-test.log 2>&1; then
118
+ tail -5 /tmp/cli-test.log
119
+ echo " ✓ CLI tests passed"
120
+ else
121
+ tail -30 /tmp/cli-test.log
122
+ echo " ⚠ CLI tests had failures"
123
+ fi
124
+ fi
125
+
126
+ echo "⑥ sandbox smoke test"
127
+ if command -v bun >/dev/null 2>&1; then
128
+ bun cli/bin.mjs sandbox doctor 2>&1 | tail -6 || echo " ⚠ sandbox doctor failed (expected without CubeSandbox server)"
129
+ fi
130
+
131
+ echo "⑦ done"
132
+ ' 2>&1 | tee "$LOG"
133
+
134
+ echo
135
+ echo "✓ test-in-container.sh: log saved to $LOG"