Repository navigation
feat(omp): add background Curated LoA for captured sessions - #340
Merged
Merged
Conversation
omp session_stop is turn completion. After a successful capture, detach recall loa omp-end only when the Curated snapshot is missing or behind the lifecycle high-water. Fabric failure keeps the basic summary. Explicit dump rows are not scored again.
- Retry runLoaOmpEnd up to 8 times until the Curated snapshot matches - Requeue a detached loa omp-end and hand the pid lock to the successor - Cover captures that land during the child worker
… and test isolation
edheltzel
pushed a commit
that referenced
this pull request
Oct 20, 2026
* feat(hooks): capture Empryo sessions through the Claude hooks - Route Empryo session logs to a new empryo host adapter as harness empryo - Stop sends the latest finished turn; SessionEnd sends every turn within the JSON cap - Skip the Claude transcript fallback, PreCompact flush, and in-session extraction for Empryo logs - Share payload building and the recall capture call in hooks/lib/hosts/capture-door.ts - Document the Empryo integration and remove the new hook files on uninstall * chore: track Empryo follow-ups and close omp Curated LoA tasks - Mark the omp Curated LoA tasks done with PR #340 - Add Empryo MCP registration, injection check, and hyphenated search bug * fix(hooks): capture every recent Empryo tab on Stop - Stop sends each tab's latest turn finished within 10 minutes of the newest - Stop no longer relies on SessionEnd, which the installer does not register - Run the Claude and Empryo Stop tests from a hooks copy without src - Drop source-grep assertions in favor of that run - Narrow Empryo skill docs: plugin installs do not expose skills to Empryo * no-mistakes(review): Document Empryo custom database environment forwarding * no-mistakes(document): Refresh Empryo capture documentation and remove stale duplicates --------- Co-authored-by: Atlas-Key <296298943+Atlas-Key@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
recall loa omp-endcuration after successful omp capture when the Curated snapshot is missing or stale, guarded by a per-session lock.homedir()as the database-path fallback when home environment variables are absent.Risk Assessment
🚨 High: Review is incomplete: but-axi is unavailable, and GitButler cannot inspect this worktree without setup; repository instructions prohibit raw Git fallback.
Testing
The build, 41 focused regressions, and all 10 live scenarios passed after correcting debugger-driver setup; evidence was retained and disposable processes and files were cleaned up.
Evidence: Native omp and packaged Recall CLI transcript
~/.no-mistakes/evidence/01M5AGKM1XYGWW84YRPE729J0X/database-observations.jsonl)~/.no-mistakes/evidence/01M5AGKM1XYGWW84YRPE729J0X/completion-debugger-protocol.json)Evidence: CLI child exit statuses
Pipeline
Updates from git push no-mistakes
⏭️ **Intent** - skipped
Step was skipped.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 6 issues found → auto-fixed ✅
src/commands/loa.ts:208- The successor CLI path is wrong after bundling. From <package>/dist/index.js, '../..' resolves above the package, so exhausting eight retries launches a nonexistent sibling dist/index.js. Bun exits without running cleanup, while handoff leaves the lock permanently held. Related sites: src/commands/loa.ts:219 launches that path; src/commands/loa.ts:331 transfers lock ownership; hosts/omp/recall.ts:461 subsequently skips every capture. Resolve the successor from the running bundled CLI. This follows standard import.meta.url semantics.src/commands/loa.ts:329- A final capture can still be stranded after successful extraction: worker A commits its snapshot, capture B publishes newer content and finds A's lock, then A releases the lock and exits without another check. B's snapshot remains uncovered until another turn. Related sites: src/commands/loa.ts:286 releases SQLite's write lock; src/commands/loa.ts:335 removes the worker lock; hosts/omp/recall.ts:460 checks freshness and hosts/omp/recall.ts:461 skips the locked worker. Correct the completion handshake so releasing ownership cannot lose a capture that already deferred to that owner.hosts/omp/recall.ts:370- The watermark includes hidden historical frames, whereas extraction reads published content. Capture frames A, B, then A again under one session: content dedup reuses A's earlier ID and hides B with source_position=NULL, but this MAX still returns B's larger ID. An existing B snapshot is incorrectly considered current; without that snapshot, the worker repeatedly extracts A and rejects it as stale. Related sites: hosts/omp/recall.ts:380 assumes monotonic freshness; src/commands/loa.ts:227 loads published rows; src/commands/loa.ts:239 repeats the unfiltered MAX; src/commands/loa.ts:256, src/commands/loa.ts:323 and src/commands/loa.ts:327 compare incompatible watermarks. Use one freshness rule matching the published snapshot, including revisited snapshots.src/commands/loa.ts:281- Updating an existing Curated LoA retains its old embedding. After a user backfills embeddings and another omp turn replaces this extract, semantic search ranks the new text using the previous extract's vector, and ordinary backfill skips it because an embedding already exists. Related site: src/commands/loa.ts:284 replaces source pins in the same update transaction. Invalidate the existing LoA embedding inside this transaction when the extract changes, using invalidateRecordEmbedding as the existing dump and terminal-capture writers do.tests/commands/loa-omp-end.test.ts:20- These tests isolate HOME and the database but never isolate RECALL_HOME. getRecallHome falls back to Bun's cached homedir(), so a normal local run can create files in the live ~/.agents/Recall directory and remove matching live lock files. Related sites: tests/commands/loa-omp-end.test.ts:93 writes a lock; tests/commands/loa-omp-end.test.ts:211 selects the runtime directory; tests/commands/loa-omp-end.test.ts:215, tests/commands/loa-omp-end.test.ts:222 and tests/commands/loa-omp-end.test.ts:249 write lock/ready/go files; tests/commands/loa-omp-end.test.ts:239 passes that directory to the child. Set and restore a disposable RECALL_HOME before any runtime call.hosts/omp/recall.ts:341- Simplification: the change introduces parallel definitions of the omp curation protocol. The row identity is repeated at src/commands/loa.ts:206, and the lock filename/cleanup rule is repeated at src/commands/loa.ts:210 and hosts/omp/recall.ts:343, hosts/omp/recall.ts:388. Detached curation needs both consumers to agree, but no requirement needs independent definitions. Remove the duplicate definitions by sharing one hook-safe protocol helper, consistent with the repository's single-source rule.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bun run buildbun test tests/commands/loa-omp-end.test.ts tests/omp-integration.test.tswith isolated HOME, TMPDIR, RECALL_HOME, and RECALL_DB_PATHbun .agents/omp-live-validation/live.ts: packaged Recall, native omp 18.12.2, and real Fabric 1.4.526 against disposable localhost model and embedding endpointsDrove native turns, resume, extraction failure, concurrent capture, bundled successor handoff, snapshot revisits, and embedding backfillUsed Bun's debugger to pause the real worker after its SQLite commit and drive the final-capture raceVerified all 44 instrumented CLI child exit statuses; stopped the fixture server and removed disposable runtime, downloads, package, driver, and generated build output✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.