Skip to content

feat(routes)!: replace createMemory({ app }) with createMemoryRoutes - #53

Merged
TheGreatAxios merged 1 commit into
cl-9057-memory-move-intx-hono-drizzle-orm-postgres-tofrom
cl-9061-memory-remove-duplicate-creatememory-declaration
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9057-memory-move-intx-hono-drizzle-orm-postgres-tofrom
cl-9061-memory-remove-duplicate-creatememory-declaration

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #52; merge that first.

  • createMemoryRoutes({ memory, requireGrant, callerResolver? }) returns the memory routes as a Hono<TenantEnv> sub-app, with paths relative to the mount point. The host mounts it with app.route("/api/tenants/:tenantId/memory", …), the same shape as Interchange hub-api createGrantRoutes. Every route is guarded by deps.requireGrant.
  • createMemory({ app }), CreateMemoryOptions and registerMemoryRoutes are removed. The one createMemory is the plane factory in memory.ts, and it builds its options as explicit literals.
  • The package root exports only the public API. Internal services and helpers, the test fakes and resolveGrantConfig are gone from it. The distiller stays at @corbits/memory/distiller and migrations at @corbits/memory/migrations.
  • MergeLocalLiveV1 no longer appears in shipped declarations.
  • README, CHANGELOG and the root docs show the new mount.

Verification

  • bun run typecheck, bun run build and bun test ./src pass (456 tests).
  • grep -r MergeLocalLiveV1 dist finds nothing.
  • The route tests mount createMemoryRoutes at /api/tenants/:tenantId/memory and pass.

Closes CL-9061
Closes CL-9316
Closes CL-9314
Closes CL-9128
Closes CL-9130
Closes CL-9134

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review, three passes over the stacked range.

Verdict: ready for review.

  • There is one createMemory. createMemoryRoutes returns a fresh Hono<TenantEnv> with relative paths, and the tests mount it the way the README shows.
  • No conditional spreads remain in createMemory. The one spread left is the condition-registry key merge in resolveGrantConfig.
  • The barrel is the public API only, and the built .d.ts files carry no MergeLocalLiveV1.
  • Route authorization does not change when the host builds requireGrant from its own registry: share grants sit on memory.doc:<id>, not on the memory capability resource that the guard checks.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9061-memory-remove-duplicate-creatememory-declaration branch from ac95c5d to 3ec7fcb Compare September 25, 2026 18:31
@TheGreatAxios
TheGreatAxios force-pushed the cl-9061-memory-remove-duplicate-creatememory-declaration branch from 3ec7fcb to aa3bc5e Compare September 26, 2026 01:32
@TheGreatAxios TheGreatAxios changed the title Replace createMemory({ app }) with a createMemoryRoutes sub-app and trim the barrel feat(routes)!: replace createMemory({ app }) with createMemoryRoutes Sep 26, 2026
createMemoryRoutes(deps) builds the routes on a fresh Hono<TenantEnv>
with paths relative to the mount point; the host mounts it at
/api/tenants/:tenantId/memory with its own requireGrant. The barrel's
createMemory wrapper that mutated a passed app is gone, so the one
createMemory is the plane factory in memory.ts, and it assembles its
options as explicit literals rather than conditional spreads.

The package root now exports only the public API: internal services,
helpers and test fakes are gone from it, the distiller and migrations
stay on their own subpaths, and the internal MergeLocalLiveV1 name no
longer appears in shipped declarations.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9061-memory-remove-duplicate-creatememory-declaration branch from aa3bc5e to c108d16 Compare September 26, 2026 01:36
@TheGreatAxios
TheGreatAxios added this pull request to stack #61 September 26, 2026 01:57
@TheGreatAxios
TheGreatAxios merged commit 20065bf into main Sep 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant