2.1.0 — quick-wins train: brief load, offline-durable capture, session-end verb
Three independently useful changes (IMPROVEMENT-PLANS #1/#3/#7), no schema changes: - load --brief: token-budgeted cold-start digest (facts full, last-10 observations, scope+freshness, last session's key sections, agent-log lines, inbox count; ECHO_LOAD_BUDGET ~8000 chars, lowest-priority-first trimming). SessionStart hook injects the brief form; /echo-load keeps the full dump. All load reads (+ the sessions listing, which also feeds the heartbeat fallback) fetched in parallel. - Offline capture durability: a fully-offline capture queues the WHOLE op as one semantic record; flush replays it through capture so routing/gate/aliasing re-run against the current index; a gate stop on replay is kept + flagged (needs_attention, surfaced by flush and load), never landed blind; update-path and ensure_daily_log writes ride safe_request; same-args captures dedupe. - session-end: one call, one lock — session log -> agent-log line -> reflect proposals (gate-aware) -> optional scope set -> heartbeat LAST as the commit marker; dry-run default; ECHO_NOW pins HHMM; validation runs before any write. Stop hook nudge names the command and recognizes it as reflected. - Fix: main() now catches the __main__ twin-module EchoError (via RuntimeError + .code) so helper-module errors exit with their intended codes, not tracebacks. +19 e2e checks; all suites green. Plans renumbered: MCP container is 2.2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,40 @@ def main():
|
||||
check("offline load flags OFFLINE", "OFFLINE" in r.stdout, r.stdout)
|
||||
check("offline load serves cached marker", "EVALMARK-marker" in r.stdout, r.stdout)
|
||||
|
||||
# --- Phase 5 (2.1.0): vault DOWN -> capture queues a SEMANTIC record ------
|
||||
r = echo(DEAD, "capture", "Offline Person", "--kind", "person")
|
||||
check("offline capture exits 0 (queued)", r.returncode == 0, r.stdout + r.stderr)
|
||||
check("offline capture reports queued", "queued (offline): capture" in r.stdout, r.stdout)
|
||||
outbox = Path(state) / "outbox.ndjson"
|
||||
check("capture queued as an op record",
|
||||
outbox.exists() and '"op": "capture"' in outbox.read_text(encoding="utf-8"))
|
||||
# same capture again while offline -> deduped by idem_key, not double-queued
|
||||
echo(DEAD, "capture", "Offline Person", "--kind", "person")
|
||||
recs = [ln for ln in outbox.read_text(encoding="utf-8").splitlines() if '"op": "capture"' in ln]
|
||||
check("offline capture is idempotent in the queue", len(recs) == 1, str(len(recs)))
|
||||
|
||||
# --- Phase 6 (2.1.0): vault UP -> flush replays capture THROUGH capture ---
|
||||
srv = start_mock()
|
||||
r = echo(mock_base, "flush")
|
||||
check("flush replays the queued capture", "flushed" in r.stdout, r.stdout + r.stderr)
|
||||
note = ground("resources/people/offline-person.md")
|
||||
check("replayed capture created the routed note",
|
||||
note is not None and "type: person" in note, str(note)[:200])
|
||||
check("replayed capture used the capture-time date",
|
||||
note is not None and "created: 2026-06-22" in note, str(note)[:200])
|
||||
|
||||
# --- Phase 7 (2.1.0): duplicate gate ON REPLAY keeps + flags the record ---
|
||||
echo(mock_base, "capture", "Zebulon Quargle", "--kind", "person") # the existing entity
|
||||
r = echo(DEAD, "capture", "Zebulon Quargle Junior", "--kind", "person")
|
||||
check("lookalike capture queues offline", "queued (offline)" in r.stdout, r.stdout)
|
||||
r = echo(mock_base, "flush")
|
||||
check("gated replay is flagged, not landed",
|
||||
"needs attention" in r.stdout and "replay-gated" in r.stdout, r.stdout + r.stderr)
|
||||
check("gated replay did NOT create the duplicate",
|
||||
ground("resources/people/zebulon-quargle-junior.md") is None)
|
||||
check("gated record survives in the outbox",
|
||||
'"needs_attention"' in (outbox.read_text(encoding="utf-8") if outbox.exists() else ""))
|
||||
|
||||
print(f"\n{len(failures)} failure(s)" if failures else "\nall offline-queue tests passed")
|
||||
return 1 if failures else 0
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user