fix/legacy prose implicit worktree scope - #1156
Conversation
…tion Merge workstation AgentMemory hardening stack
Fix action list pagination
Add canonical AgentMemory project scope
Decouple hook capture from synchronous observe
Await asynchronous hook transport acknowledgements
Make observation ingestion durable and report disabled LLM work as skipped
Build runtime assets automatically before npm packaging.
Prevent duplicate workers from unregistering live AgentMemory routes.
Add resilient Streamable HTTP MCP transport
Fix iii 0.11.2 active-invocation leak
Exclude blocked actions from AgentMemory frontier
ci: retire push/PR triggers to workflow_dispatch (local-builds quota policy)
feat: add curated workstation LLM tool profile
fix: ignore sentence punctuation in compression URL checks
Complete workstation DeepSeek MCP surface
Add idempotent, audited lesson deletion and supersession through the existing StateModule authority. Expose validated REST and MCP surfaces, prevent silent resurrection, regenerate interface documentation, and isolate embedding-provider tests from workstation environment state. Validated locally: npm test (1,560 passed), npm run build, npm run skills:check, git diff --check.
feat(lessons): add causal lesson schema foundation
feat: enforce causal lesson access policy
…eval-v3 feat: add authorized causal lesson hybrid retrieval
…e + heal
Root cause (D2): mem::governance-delete and mem::governance-bulk deleted a
memory without clearing supersedes/parentId/relatedIds back-references in
*other* memories, so every delete minted new memory-missing-supersedes
warnings. The heal path could not repair them either (the warn was
fixable=false and no prune branch existed).
Changes (code-only; no live data touched, no restart/deploy):
- src/state/memory-utils.ts: add pure stripMemoryReferences() that drops
references to a given id set from supersedes/parentId/relatedIds and
reports what was removed. Shared by governance and diagnostics.
- src/functions/governance.ts: governance-delete and governance-bulk now
call clearDanglingMemoryReferences() on surviving memories after a
delete, returning repairedReferrers + removedReferences in the result
and audit details. Indexes untouched (ref fields are not searchable).
- src/functions/diagnostics.ts:
* memory-missing-supersedes warn is now fixable=true.
* add memory-missing-parent and memory-missing-related warn detection.
* add a memories heal branch that prunes dangling supersedes/parentId/
relatedIds (dry-run supported), audited as reason
"dangling-memory-reference-prune".
- Honest project-coverage messaging (D3): the diagnostic no longer
blindly prescribes infer-memory-projects. It splits the unscoped count
into session-linked (inferable) vs session-less (ambiguous; the
migration returns them unchanged), and says so explicitly — verified
live that infer-memory-projects is updated=0/ambiguous=128 here.
Tests: +8 in test/diagnostics.test.ts and test/governance.test.ts
covering delete cleanup (single + bulk), heal prune (apply + dry-run),
the new parentId/relatedIds warns, and the honest coverage messages.
Full suite: 1699 passed (160 files). Build: tsdown OK.
Not pushed, not merged, not deployed, not activated. The diverged local
main (ahead 2 / behind 13) is untouched. The running engine build is
unchanged; these changes take effect only after a supervisor-authorized
build + systemctl restart agentmemory.service, at which point the
existing dangling references can be pruned via
mem::heal {categories:["memories"]} (dry-run first).
Refs: AgentMemory action act_msfdnoby_4609034b3c0f (workstation)
Code-only supervisor review corrections for 6c27da2. No live mutation, no restart/deploy. (1) blocked-deps-done false-positive guard (the rebound root cause): - src/functions/actions.ts: export hasExplicitNonDependencyGate() — true when an action is held by blockedReason / awaitingHuman / pending-or- rejected approval / an unsatisfied gated_by checkpoint (i.e. NOT by its requires-deps alone). - diagnostics.ts diagnosis: only flag blocked-deps-done (fixable) when the block is dependency-only; explicitly-gated actions are intentionally blocked and are no longer flagged. - diagnostics.ts heal: the blocked-deps-done branch now skips explicitly- gated actions (returns false -> skipped), so heal no longer churns revisions or writes a misleading newStatus=pending audit for actions legacyStatusFor would immediately re-block. (2) Honest project-coverage fixability: fixable = inferableCount > 0. When every unscoped memory lacks sessionIds the infer-memory-projects migration is a no-op, so the finding is not auto-fixable. (3) clearDanglingMemoryReferences concurrency: each survivor is now repaired under its per-memory keyed lock (mem:memory:<id>) with a fresh read immediately before strip/write, so a concurrent survivor update is preserved instead of clobbered by a stale snapshot. (4) Removed the untracked node_modules symlink from the worktree. Tests (+4): diagnose "explicit human/approval/blockedReason gates not flagged"; heal "does not unblock an explicit-gate action"; governance concurrency "preserves a concurrent survivor update" and "does not clobber a concurrently-corrected survivor" (both fail on the pre-fix code). Project-coverage tests gained fixable assertions (zero-candidate=false, mixed=true). Full suite 1703 passed (160 files); tsdown build OK. git status clean (node_modules symlink removed). Not pushed, not merged, not deployed, not activated. REBOUND-INVESTIGATION conclusions unchanged (the three live actions remain correctly blocked by their approval gates; this commit just stops flagging/healing them). Refs: AgentMemory action act_msfdnoby_4609034b3c0f (workstation)
fix(memories): repair dangling references and diagnostic false positives
The causal schema foundation (495b051) tightened scope validation but the three write entry points (mem::lesson-save, api::lesson-save REST, and the memory_lesson_save MCP handler) parse input without allowImplicitWorktreeScope, so every scope-less legacy prose save fails with 'scope.scopeId is required for non-global explicit scopes'. The causal-lesson-schema-v1 spec mandates: 'Legacy prose lessons retain the fail-closed implicit worktree scope for compatibility' and 'Legacy prose-only saves remain valid'. Restore the spec behavior at all three entry points. Structured causal lessons still require an explicit durable scope (that guard is independent in parseLessonSaveInput and is now regression-tested). No change to global scope humanApproval, access enforcement, or FORCE_PROXY semantics.
|
Someone is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (189)
📝 WalkthroughWalkthroughThis PR adds Actions v2 persistence and migration, structured causal lessons with authorization and hybrid retrieval, Streamable HTTP MCP support, asynchronous observation ingestion, LLM execution-state reporting, expanded workstation tools, session pagination, and updated integrations, documentation, and tests. ChangesAgentMemory platform expansion
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
✨ Finishing Touches 💡 2⚔️ Resolve merge conflicts 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Documentation