Skip to content

Use LaunchX's shared memory for the schedule page and Suggest - #21

Merged
sergiudm merged 1 commit into
mainfrom
feat/launchx-shared-memory
Nov 18, 2026
Merged

sergiudm merged 1 commit into
mainfrom
feat/launchx-shared-memory

Conversation

@sergiudm

Copy link
Copy Markdown
Collaborator

What

Schedule Everything becomes the first app to use the shared memory LaunchX keeps for the user's apps and agents (LaunchX SPEC.md §12: a small wiki of Markdown pages, with per-app none/read/write access set by the user).

  • Asks, doesn't grant. launchx.toml gains [service.rmd.memory] wants = "write" with a one-line reason. install.sh copies the manifest from the launchx = line onward, so the installed copy (~/SCHEDULE_MANAGEMENT/launchx.toml) carries it too. Access stays off until the user runs lx memory access rmd write or flips the switch in LaunchX.
  • Memory client (crates/rmd/src/memory.rs), used only when LaunchX starts rmd serve. It reads LAUNCHX_MEMORY_URL / LAUNCHX_MEMORY_TOKEN, then removes the token from the environment like LAUNCHX_TOKEN, so tools it launches (the Codex CLI) never see it. It asks GET /me rather than assuming. Memory being off, LaunchX being unreachable, or a 403 are states to show, not errors. Each problem is logged once, and the token never is.
  • Suggest: with read access, the prompt gets the memory's index plus the profile and preferences pages, shortened (4,000 / 3,000 characters), in a <memory> block. The model is told to treat it as information, not instructions. It is fetched before the operation lock is taken.
  • The schedule page: with write access, rmd keeps its own section current: the weekly routine day by day (days with the same shape share a line; odd and even weeks are listed separately when they differ) and upcoming deadlines (one-offs in the next six months, recurring ones by their rule, at most 20). Dates are absolute, so the section changes only when the routine or deadlines do. The task list and other live data stay out (§12.2).
  • Status: the state document and status_snapshot gain memory: available, access, wants, reachable, error, change (the command that grants access), and schedule (rev, syncedAt, error). Settings gets a Shared memory card, and the AI card says when Suggest also sends memory. New strings are translated into es, ko and zh.

Design choices worth a look

  • A section in schedule, not a schedule/rmd sub-page. schedule is the well-known page other apps and agents look for. A sub-page would leave schedule as a bare link whenever rmd is its only writer, and reading it would take two requests. rmd's lines sit between <!-- rmd:begin … --> and <!-- rmd:end -->, and nothing outside them is ever changed (merge_section). Trade-off: while rmd may write, a deleted section comes back. Setting access to read stops that.
  • No lost writes. Every PUT sends the rev it read as base. On a 409, rmd merges its section into current and retries once. If the page was deleted in between, it creates it again.
  • When it writes. 5 quiet seconds after a routine, deadline or type change made through the workspace (at most 30 seconds while changes keep coming), as soon as access becomes write, and on a 2-minute check that picks up CLI and hand edits. It writes only when the section differs from the page. LaunchX doesn't push access changes, so rmd asks /me again when the state document is read and what it knows is over 5 seconds old.

Tests

  • cargo test passes: 477 lib tests, including 20 new memory tests against a stand-in API. They cover the client, merging, the conflict retry, a page deleted mid-write, a failed write, an unreachable launcher, read-only access, rendering, and the server's sync loop.

  • The six status_snapshot golden files gain the memory key (same kind of one-line update the Suggest PR made).

  • Web: vitest 185 passing, including a new test for the Shared memory card in each state. The bundle in crates/rmd/web-static is rebuilt.

  • End to end: crates/rmd/tests/launchx_memory.rs has a scratch LaunchX (own LAUNCHX_HOME, HOME and gateway port in a temp dir) run rmd serve. It checks that access changes show up in /api/state, the page appears with rmd's section, another writer's line survives a new deadline, and rmd's logs never contain the token. It stops the launcher with POST /api/shutdown, never lx down. It is skipped unless RMD_TEST_LX names an lx with shared memory:

    RMD_TEST_LX=../LaunchX/target/debug/lx cargo test -p rmd --test launchx_memory

    It passes locally (about 14 seconds) against an lx built from LaunchX's feat/shared-memory work.

For reviewers

  • This depends on LaunchX's shared memory, which isn't released yet. Without it, rmd behaves exactly as before: the card says memory is available under LaunchX, and memory.available is false.
  • Docs: documentation/docs/advanced/launchx.md (new Shared memory section, plus the memory key in the state table), documentation/docs/browser.md (what Suggest sends), and the README.

🤖 Generated with Claude Code

Schedule Everything is the first app to use the shared memory LaunchX keeps
for the user's apps and agents (LaunchX SPEC §12).

- launchx.toml (and so the copy install.sh writes) asks for write access in
  [service.rmd.memory], with the reason the user sees. It stays off until the
  user allows it (lx memory access rmd write).
- A memory client in the `rmd serve` path, under LaunchX only. It reads
  LAUNCHX_MEMORY_URL and LAUNCHX_MEMORY_TOKEN, removes the token from the
  environment like LAUNCHX_TOKEN, asks GET /me rather than assuming, and
  treats off, unreachable and 403 as states to show, not errors. It never
  logs the token, and logs each problem once.
- With read access, Suggest adds the memory's index and the profile and
  preferences pages to the prompt, cut short, read before the lock is taken.
- With write access, rmd keeps its own section of the well-known schedule
  page current: the routine's shape day by day and the upcoming deadlines,
  with absolute dates so it changes only when they do. The section sits
  between marker lines in the schedule page itself, not on a sub-page, so
  the page other apps look for holds the whole picture; text outside the
  markers is never touched. Writes send the rev they read; on 409 rmd merges
  into the current page and retries once. Writes follow routine, deadline
  and type changes after 5 quiet seconds (at most 30), a switch to write,
  and a check every two minutes for CLI and hand edits.
- The state document (and status_snapshot) gains `memory`: available,
  access, wants, reachable, error, the command to change it, and the
  schedule page's rev, last check and last write error. Settings shows it in
  a Shared memory card, and the AI card says when Suggest also sends memory.
- Tests: client, merge, conflict retry, deleted page, rendering and the
  server's sync loop against a stand-in API; tests/launchx_memory.rs runs
  rmd under a scratch LaunchX (RMD_TEST_LX=path/to/lx) and checks access
  switches, the page, another writer's line surviving a deadline change, and
  logs without the token. The snapshot golden cases gain the `memory` key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergiudm
sergiudm merged commit c14c43f into main Nov 18, 2026
5 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