Repository navigation
refactor(identity): shared deriveScopeKey β P4/G3 graphiti-memory (REBUILT) - #36
Conversation
β¦veScopeKey (P4/G3 graphiti-memory) Extract the canonical memory-partition rule (external_id ?? id) into a single source of truth: extensions/shared/scope-key.ts (deriveScopeKey). Both writers now import it instead of computing it independently: - auth-memory-gate scope.ts (the [MEMORY_SCOPE].scope_key it injects) - memory-graphiti identity.ts (resolveIdentityScopeKey, the identity groupId) Behavior-preserving consolidation β the partition key and the identity scope key can no longer drift. Adds scope-key.test.ts (3 tests) pinning the precedence. REFRAME: the literal G3 plan (memory-graphiti parses auth-memory-gate's emitted [MEMORY_SCOPE] block) is INFEASIBLE β the before_agent_start hook chain runs hooks in PARALLEL and only merges each hook's prependContext, so the block is never visible to memory-graphiti. A shared resolver is the correct way to share the contract. The user_id-vs-external_id PRECEDENCE (SJ #9β#11) is OUT OF SCOPE here β this preserves today's behavior; when precedence is settled it becomes a single-function change in scope-key.ts. Gates: oxfmt clean, tsgo 0, extensions 204p/13skip, sealed 38/38. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
The formal models extracted constants ( This check is informational (not blocking merges yet). If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there. |
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: π Files selected for processing (4)
π WalkthroughWalkthroughA new shared module ChangesShared scope-key extraction and adoption
Estimated code review effortπ― 1 (Trivial) | β±οΈ ~5 minutes Poem
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ Generate docstrings
π§ͺ 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 |
P4 / G3 β shared
deriveScopeKey(REBUILT on a durable ref)Extract the canonical memory-partition rule (
external_id ?? id) into a single source of truth β newextensions/shared/scope-key.ts(deriveScopeKey). Both writers now import it instead of computing it independently:auth-memory-gate/src/scope.tsβ the[MEMORY_SCOPE].scope_keyit injectsmemory-graphiti/identity.tsβresolveIdentityScopeKey, the identity-strategy groupIdBehavior-preserving consolidation: the partition key and the identity scope key can no longer drift. Adds
scope-key.test.ts(3 tests) pinning the precedence.Reframe (the original premise was infeasible)
The literal G3 plan β memory-graphiti reads auth-memory-gate's emitted
[MEMORY_SCOPE]block β is infeasible: thebefore_agent_starthook chain runs hooks in parallel and only merges each hook'sprependContext, so the block is never visible to memory-graphiti. A shared resolver is the correct way to share the contract.Out of scope
The
user_id-vs-external_idprecedence (SJ #9β#11) is explicitly out of scope β this preserves today's behavior. When precedence is settled later it becomes a single-function change inscope-key.ts.Rebuild note
P4 was QG-passed locally but LOST β the prior QGR ran against an uncommitted working tree, never committed/pushed, wiped by a submodule reset to clean P3 (
main@f6b086723). This PR rebuilds it on a durable ref: committed + pushed before the receipt was minted.Gates
d65a0dd(diff-baseorigin/main=f6b086723), receipt-verify βBase:
main(f6b086723). Independent of P5/P6 (no file overlap). Land order: P4 β P5 β P6.π€ Generated with Claude Code
Summary by CodeRabbit
Tests
Refactor