The MCP catalog survived the recent API changes because it is derived
from OpenAPI, but three things drifted around it, and fixing them
surfaced a fourth.
- mcp: the adapter built each in-process API request with httptest,
whose fixed peer address (192.0.2.1) overrode the caller's resolved
address on the client-address middleware's second pass. Every
anonymous MCP caller shared one rate-limit bucket. The adapter now
presents the address resolved for the /mcp request as the peer.
- mcp: the full SpaceService is curated as space_* tools. Space and
member updates drop path-bound fields and rely on the gateway's
update-mask inference; accepting and declining an invitation no
longer require an empty body for a body: "*" binding whose only
field comes from the path.
- mcp/evals: answers re-pinned to the current seed (four users,
22 top-level memos, 35 reactions, four spaces) and extended with
space questions.
- store/sqlite: transactions begin IMMEDIATE. Token authentication
records the token's last-used time asynchronously on every request,
and the space drivers read before they write in a deferred
transaction; when the background commit landed in between, SQLite
refused the upgrade with SQLITE_BUSY without consulting the busy
timeout. Roughly half of space creates over MCP failed. Taking the
write lock up front keeps the parent-delete serialization the design
relies on, so the SQLite stale-snapshot test now asserts that a
concurrent delete waits for the open transaction instead.
An active application ADMIN now passes every memo-local authorization
check on named operations: authorship, audience, Space membership and
participation, attachment and reaction ownership. Structural validity
still applies, an archived admin holds no privilege, and collection
listings keep the audience predicate so feeds never surface other users'
private memos.
- core/access: admin bypass in the read policy; CanManageMemo and
CanManageAttachment as the shared author-level predicates.
- store: drivers read the actor's role alongside its lifecycle state in
the mutation transaction; validators accept an admin where they
required the author or a member; shared attachment binding and
removal predicates.
- api: handlers use the shared predicates; admins may place memos in
any existing Space and see a memo's Space by name.
- web: one canManageMemo helper replaces the ad hoc creator checks.
- docs: multi-spaces design revised in place; share RPC comments
updated.
Drop the D1 store driver, its migrations, emulator, design doc, filter
dialect, and test-harness wiring. Memos supports SQLite, MySQL, and
PostgreSQL only.
layout
Review follow-up for the D1 driver.
- LATEST.sql kept two index statements in one paragraph; the bridge
sends a
paragraph as one prepared statement, which D1 refuses. Separate them,
and
join buffered scripts in the sql adapter with a blank line so several
migration files commit over the bridge.
- List lookups by id, uid, and username bound one parameter per value
and
failed above D1's 100-parameter limit for pages larger than 100 rows.
Bind
the whole list as one JSON array through json_each instead, which also
replaces the uid resolution threshold and the chunk-and-resort paths.
- Write-policy validation now returns the memo state it read, and every
policy-checked write guards on exactly that state: memo update, memo
mutation, share creation, and attachment creation, update, and
deletion,
including the expected memo content and attachment bindings. Memo,
user,
and space deletion guard their pre-read row sets on count plus highest
id
so a row swapped for a newer one is caught.
- A 429 is no longer retried; the API rate limit that produces it blocks
the
caller for minutes.
- The reference Worker defaults a null result set to an empty array, and
the
comments claiming a batch never reads its own writes are corrected.
The emulator now judges statement boundaries with sqlite3_complete: a
bridge
entry or a parameterized REST entry holding two statements is refused
with
D1's message, and a parameter-free REST entry runs as a script. New
tests
interpose on the transport to change the database between a method's
reads
and its batch, apply the real schema over both transports, pin the
one-statement rule, and list by 250-entry id lists on every driver.
- Generate UUID v4 values in the client with validated custom UID
support.\n- Show immutable UIDs where Space titles need
disambiguation.\n- Standardize Space surfaces on the Lucide Astroid
icon.
- Load IdPs and supported instance-setting groups as runtime overlays from /etc/secrets.
- Reject API mutations of deployment-managed resources and serialize authentication safety checks across database drivers.
- Preserve upgrade compatibility, demo SSO policy, stable IdP ordering, and driver-specific transaction retries.
- scan /etc/secrets for memos-idp-*.json after migrations and demo seeding
- reconcile protobuf JSON identity providers by stable UID
- validate all discovered providers before applying updates
Let users write three more CEL constructs in the filter field, each compiled to
SQL across SQLite/MySQL/Postgres:
- Scalar startsWith()/endsWith() on content/filename/mime_type (case-insensitive)
- matches() regex: PG ~, MySQL/SQLite REGEXP (Go-backed SQLite fn), validated at
compile time via cel.ValidateRegexLiterals()
- all() comprehension over tags via per-element subqueries, non-empty required
Also: contains() now escapes LIKE metacharacters (%, _, \); cross-dialect render
tests plus behavioral tests; cel-go bumped to v0.28.1; new operators surfaced in
the frontend shortcut guide.
Fixes the inconsistency where switching the memo list to update_time
left the activity heatmap aggregating by created_time. The heatmap
now follows the same time basis as the list it sits next to.
Backend
- UserStats gains memo_updated_timestamps (additive proto field, tag 8).
- GetUserStats and ListAllUserStats populate it alongside the existing
memo_created_timestamps. No DB migration; memo.updated_ts already
exists on every row.
Frontend
- useFilteredMemoStats reads timeBasis from ViewContext and selects
the matching timestamp source.
- StatisticsView and MonthNavigator forward timeBasis through to
MonthCalendar / YearCalendar so tooltip text matches the basis
("X memos in DATE" vs "X memos updated on DATE").
- Falls back to memoCreatedTimestamps when an old server returns an
empty memoUpdatedTimestamps array (detected by length divergence,
since protobuf-es deserializes missing repeated fields as []).
Tests
- Backend: TestGetUserStats_MemoUpdatedTimestamps verifies the field
is populated and reflects post-creation updates.
- Frontend: filtered-memo-stats covers create/update source switching
and the old-server fallback path; activity-calendar-tooltip covers
basis-aware label selection.
Spec and implementation plan committed under docs/superpowers/.