Repository navigation
Use LaunchX's shared memory for the schedule page and Suggest - #21
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).launchx.tomlgains[service.rmd.memory] wants = "write"with a one-line reason.install.shcopies the manifest from thelaunchx =line onward, so the installed copy (~/SCHEDULE_MANAGEMENT/launchx.toml) carries it too. Access stays off until the user runslx memory access rmd writeor flips the switch in LaunchX.crates/rmd/src/memory.rs), used only when LaunchX startsrmd serve. It readsLAUNCHX_MEMORY_URL/LAUNCHX_MEMORY_TOKEN, then removes the token from the environment likeLAUNCHX_TOKEN, so tools it launches (the Codex CLI) never see it. It asksGET /merather 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.profileandpreferencespages, 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.schedulepage: 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_snapshotgainmemory:available,access,wants,reachable,error,change(the command that grants access), andschedule(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
schedule, not aschedule/rmdsub-page.scheduleis the well-known page other apps and agents look for. A sub-page would leavescheduleas 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 toreadstops that.PUTsends therevit read asbase. On a 409, rmd merges its section intocurrentand retries once. If the page was deleted in between, it creates it again.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/meagain when the state document is read and what it knows is over 5 seconds old.Tests
cargo testpasses: 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_snapshotgolden files gain thememorykey (same kind of one-line update the Suggest PR made).Web:
vitest185 passing, including a new test for the Shared memory card in each state. The bundle incrates/rmd/web-staticis rebuilt.End to end:
crates/rmd/tests/launchx_memory.rshas a scratch LaunchX (ownLAUNCHX_HOME,HOMEand gateway port in a temp dir) runrmd 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 withPOST /api/shutdown, neverlx down. It is skipped unlessRMD_TEST_LXnames anlxwith shared memory:RMD_TEST_LX=../LaunchX/target/debug/lx cargo test -p rmd --test launchx_memoryIt passes locally (about 14 seconds) against an
lxbuilt from LaunchX'sfeat/shared-memorywork.For reviewers
memory.availableisfalse.documentation/docs/advanced/launchx.md(new Shared memory section, plus thememorykey in the state table),documentation/docs/browser.md(what Suggest sends), and the README.🤖 Generated with Claude Code