|
15 | 15 | # This gate reproduces the real default-install environment and boots the |
16 | 16 | # CLI, so that class can never ship again. |
17 | 17 | # |
| 18 | +# It also probes the personal-memory capture -> recall round-trip against |
| 19 | +# the shipped wheel. 9.3.0 shipped with `attune memory recall` broken |
| 20 | +# (capture succeeded; recall printed "No results found." and exited 0) |
| 21 | +# while every unit test was green — the tests mocked the RAG layer that |
| 22 | +# was broken. The probe asserts on recall CONTENT under a fake HOME, |
| 23 | +# never on the exit code, so that class can't ship again either. |
| 24 | +# |
18 | 25 | # Usage: |
19 | 26 | # scripts/smoke_default_install.sh [path/to/attune_ai-*.whl] |
20 | 27 | # |
@@ -61,4 +68,48 @@ ATTUNE="$WORK/venv/bin/attune" |
61 | 68 | "$ATTUNE" --help >/dev/null |
62 | 69 | "$ATTUNE" version |
63 | 70 |
|
64 | | -echo "PASS: default-install CLI boots without extras" |
| 71 | +echo "== smoke: personal-memory capture -> recall must round-trip ==" |
| 72 | +# The 9.3.0 regression class: recall exits 0 even with zero hits, so a |
| 73 | +# boot-only smoke can't see it. Probe under a fake HOME (isolated global |
| 74 | +# memory root, exactly the clean-venv + fake-HOME audit that caught the |
| 75 | +# original bug) and assert on the returned content. ANTHROPIC_API_KEY is |
| 76 | +# set EMPTY (not unset) so dotenv cannot inject a real key; the whole |
| 77 | +# round-trip is keyless (polish degrades gracefully without attune-author). |
| 78 | +PROBE_HOME="$WORK/home" |
| 79 | +mkdir -p "$PROBE_HOME" |
| 80 | +SENTINEL="smoke sentinel: the quarterly fox prefers decaf espresso" |
| 81 | + |
| 82 | +( |
| 83 | + cd "$WORK" |
| 84 | + HOME="$PROBE_HOME" ANTHROPIC_API_KEY="" \ |
| 85 | + "$ATTUNE" memory capture smoke-recall-probe "$SENTINEL" --kind reference |
| 86 | +) |
| 87 | +CAPTURED="$PROBE_HOME/.attune/memory/smoke-recall-probe/reference.md" |
| 88 | +if [[ ! -f "$CAPTURED" ]]; then |
| 89 | + echo "FAIL: capture wrote nothing at $CAPTURED" |
| 90 | + exit 1 |
| 91 | +fi |
| 92 | + |
| 93 | +RECALL_JSON="$( |
| 94 | + cd "$WORK" |
| 95 | + HOME="$PROBE_HOME" ANTHROPIC_API_KEY="" \ |
| 96 | + "$ATTUNE" memory recall "quarterly fox decaf espresso" --json |
| 97 | +)" |
| 98 | +# NOTE: `python - <<HEREDOC` would consume stdin for the script itself, |
| 99 | +# leaving json.load(sys.stdin) an empty stream — pipe into `-c` instead. |
| 100 | +printf '%s' "$RECALL_JSON" | "$VPY" -c ' |
| 101 | +import json |
| 102 | +import sys |
| 103 | +
|
| 104 | +hits = json.load(sys.stdin) |
| 105 | +if not hits: |
| 106 | + sys.exit( |
| 107 | + "FAIL: recall returned zero hits for freshly captured content " |
| 108 | + "(the 9.3.0 broken-round-trip class - exit code alone would not catch this)" |
| 109 | + ) |
| 110 | +if not any("smoke-recall-probe" in hit.get("path", "") for hit in hits): |
| 111 | + sys.exit("FAIL: recall hits do not include the captured topic: %r" % hits) |
| 112 | +print("confirmed: recall round-trips (%d hit(s), top: %s)" % (len(hits), hits[0]["path"])) |
| 113 | +' |
| 114 | + |
| 115 | +echo "PASS: default-install CLI boots and personal memory round-trips without extras" |
0 commit comments