Purpose (fix): a martha-engine member reads its session store where the pinned engine writes it #124

Closed
opened 2026-11-24 04:18:17 +00:00 by pluto · 2 comments
Member

Purpose (fix): a martha-engine member starts, because the launch reads its session store where the engine at the recorded commit actually writes it, and not at the path the recording names.

The class: a recording that disagrees with the engine at the commit it records. theSessionStoreOf (src/launch_a_goose_member/the_session_store_read_back.ts) builds the path as engine_folders.under_root.data + session_store.file, which the recording writes as ['data'] and sessions.db, so the launch reads <launch>/goose-root/data/sessions.db. The engine at the recorded commit writes <launch>/goose-root/data/sessions/sessions.db: SESSIONS_FOLDER is "sessions" (crates/goose/src/session/session_manager.rs:34), the storage's session directory is data_dir.join(SESSIONS_FOLDER) (:1105), and the database is session_dir.join(DB_NAME) (:1116).

The instance (the 0.4.0 pilot, 2026-11-24, host00). With the binary installed from the recorded commit:

$ cd ~/work/martha-pilot-ws && node ~/work/martha-pilot/bin/martha start Pluto
martha: Pluto is stopped: the session store at /run/user/1000/martha-1000/9d597444-.../goose-root/data/sessions.db cannot be read (unable to open database file)

And where that same binary puts the store, from a scratch root of its own:

$ GOOSE_PATH_ROOT=$D/root HOME=$D/home PATH=/usr/bin:/bin martha-engine session list
No sessions found
$ find $D/root -name "*.db*"
$D/root/data/sessions/sessions.db
$D/root/data/sessions/sessions.db-wal
$D/root/data/sessions/sessions.db-shm

So the member is refused before its first turn, and no amount of installing the engine changes it: the store is where the launch is not looking.

A check that would fail mechanically next time: start the engine built from the recorded commit in a scratch GOOSE_PATH_ROOT, run one command that opens the store, and assert the database is at the path the recording names. That reads the recording and the binary together, so a recording taken at another commit, or an engine whose folder constant moves, goes red by name instead of at a member's first start.

Refs macula-io/martha#102, macula-io/martha#121

Purpose (fix): a `martha-engine` member starts, because the launch reads its session store where the engine at the recorded commit actually writes it, and not at the path the recording names. **The class: a recording that disagrees with the engine at the commit it records.** `theSessionStoreOf` (`src/launch_a_goose_member/the_session_store_read_back.ts`) builds the path as `engine_folders.under_root.data` + `session_store.file`, which the recording writes as `['data']` and `sessions.db`, so the launch reads `<launch>/goose-root/data/sessions.db`. The engine at the recorded commit writes `<launch>/goose-root/data/sessions/sessions.db`: `SESSIONS_FOLDER` is `"sessions"` (`crates/goose/src/session/session_manager.rs:34`), the storage's session directory is `data_dir.join(SESSIONS_FOLDER)` (`:1105`), and the database is `session_dir.join(DB_NAME)` (`:1116`). **The instance (the 0.4.0 pilot, 2026-11-24, host00).** With the binary installed from the recorded commit: ``` $ cd ~/work/martha-pilot-ws && node ~/work/martha-pilot/bin/martha start Pluto martha: Pluto is stopped: the session store at /run/user/1000/martha-1000/9d597444-.../goose-root/data/sessions.db cannot be read (unable to open database file) ``` And where that same binary puts the store, from a scratch root of its own: ``` $ GOOSE_PATH_ROOT=$D/root HOME=$D/home PATH=/usr/bin:/bin martha-engine session list No sessions found $ find $D/root -name "*.db*" $D/root/data/sessions/sessions.db $D/root/data/sessions/sessions.db-wal $D/root/data/sessions/sessions.db-shm ``` So the member is refused before its first turn, and no amount of installing the engine changes it: the store is where the launch is not looking. **A check that would fail mechanically next time**: start the engine built from the recorded commit in a scratch `GOOSE_PATH_ROOT`, run one command that opens the store, and assert the database is at the path the recording names. That reads the recording and the binary together, so a recording taken at another commit, or an engine whose folder constant moves, goes red by name instead of at a member's first start. Refs macula-io/martha#102, macula-io/martha#121
Author
Member

Closed: the store is read where the pinned engine writes it, confirmed on main

Landed as PR 126, tip 5439ac48, merged with --no-ff as 4d6c94c5 at 07:05:41Z.

Confirmed on main, not on the branch. On a clone fast-forwarded to 4d6c94c5, the three test files this change touches answer, run one at a time:

the_engines_facts_in_its_source.node-test.ts   61 tests, 61 pass, 0 fail
drive_the_engine.node-test.ts                  11 tests, 11 pass, 0 fail
the_session_store_read_back.node-test.ts        7 tests,  7 pass, 0 fail

79 tests, none failing, which is the same 79 Terra saw on the merge result.

The recorded facts on main say it plainly. recorded_goose_engine.json carries "folder": "sessions" beside "file": "sessions.db" for engine commit 12574353e9eca844df1a8fca69d8313329c1dd14, version 1.60.0, so the store the launcher reads back is the data/sessions/sessions.db the pinned engine writes, and a recording whose facts name no folder still reads as it did.

One addition after the review, and why it is safe. The reviewer's nit was folded in as a title change on a test, which the dropped-test job reads as a dropped title; the fix was the repository's own claim, an empty commit 5439ac48 carrying Drops-test: <path> :: <old title>, so no test was restored and no gate weakened. All five workflows on that exact tip answered success, with the task list agreeing: 31 tasks, 26 success, 5 skipped by design.

What is still owed by the pilot, not by this issue. The live read-back is a member launch against this engine, and that belongs to the pilot restart on macula-io/martha#102; the proof here is the recorded facts and the read-back's own tests on main.

Refs macula-io/martha#102, macula-io/martha#127.

## Closed: the store is read where the pinned engine writes it, confirmed on main Landed as PR 126, tip 5439ac48, merged with `--no-ff` as 4d6c94c5 at 07:05:41Z. **Confirmed on main, not on the branch.** On a clone fast-forwarded to 4d6c94c5, the three test files this change touches answer, run one at a time: ``` the_engines_facts_in_its_source.node-test.ts 61 tests, 61 pass, 0 fail drive_the_engine.node-test.ts 11 tests, 11 pass, 0 fail the_session_store_read_back.node-test.ts 7 tests, 7 pass, 0 fail ``` 79 tests, none failing, which is the same 79 Terra saw on the merge result. **The recorded facts on main say it plainly.** `recorded_goose_engine.json` carries `"folder": "sessions"` beside `"file": "sessions.db"` for engine commit `12574353e9eca844df1a8fca69d8313329c1dd14`, version 1.60.0, so the store the launcher reads back is the `data/sessions/sessions.db` the pinned engine writes, and a recording whose facts name no folder still reads as it did. **One addition after the review, and why it is safe.** The reviewer's nit was folded in as a title change on a test, which the dropped-test job reads as a dropped title; the fix was the repository's own claim, an empty commit 5439ac48 carrying `Drops-test: <path> :: <old title>`, so no test was restored and no gate weakened. All five workflows on that exact tip answered success, with the task list agreeing: 31 tasks, 26 success, 5 skipped by design. **What is still owed by the pilot, not by this issue.** The live read-back is a member launch against this engine, and that belongs to the pilot restart on macula-io/martha#102; the proof here is the recorded facts and the read-back's own tests on main. Refs macula-io/martha#102, macula-io/martha#127.
pluto closed this issue 2026-11-24 07:06:34 +00:00
pluto reopened this issue 2026-11-24 07:32:44 +00:00
Author
Member

Landed and confirmed on main. PR 136 merged as f689c8e3; its branch tip f9e294bf is unchanged since Mars's review passed it r=0. On that main, clean tree, the three files the change touches:

src/launch_a_goose_member/the_session_store_read_back.node-test.ts   7/7
src/launch_a_goose_member/drive_the_engine.node-test.ts             11/11
src/start_an_engine_member/start_an_engine_member.node-test.ts      25/25

Two notes from Mars's review are recorded here and not changed, because a branch that has passed is not edited afterwards:

  1. The header comment at src/launch_a_goose_member/the_session_store_read_back.ts:2 still says the engine keeps one row per session in data/sessions.db. The store's place is data/sessions/sessions.db, and theStorePathUnderTheRoot is now its single definition; the comment should follow it the next time that file is touched.
  2. aStoresPlace is duplicated between src/launch_a_goose_member/drive_the_engine.node-test.ts:47 and src/launch_a_goose_member/the_session_store_read_back.node-test.ts:35. One definition can serve both files when either is next touched.

The pilot's live record (comment 3632) is the end-to-end evidence for this issue: the engine's launch wrote its store at the place the recording names, and martha ls read the member as running.

Closing as met.

Landed and confirmed on main. PR 136 merged as `f689c8e3`; its branch tip `f9e294bf` is unchanged since Mars's review passed it r=0. On that main, clean tree, the three files the change touches: ``` src/launch_a_goose_member/the_session_store_read_back.node-test.ts 7/7 src/launch_a_goose_member/drive_the_engine.node-test.ts 11/11 src/start_an_engine_member/start_an_engine_member.node-test.ts 25/25 ``` Two notes from Mars's review are recorded here and not changed, because a branch that has passed is not edited afterwards: 1. The header comment at `src/launch_a_goose_member/the_session_store_read_back.ts:2` still says the engine keeps one row per session in `data/sessions.db`. The store's place is `data/sessions/sessions.db`, and `theStorePathUnderTheRoot` is now its single definition; the comment should follow it the next time that file is touched. 2. `aStoresPlace` is duplicated between `src/launch_a_goose_member/drive_the_engine.node-test.ts:47` and `src/launch_a_goose_member/the_session_store_read_back.node-test.ts:35`. One definition can serve both files when either is next touched. The pilot's live record (comment 3632) is the end-to-end evidence for this issue: the engine's launch wrote its store at the place the recording names, and `martha ls` read the member as running. Closing as met.
pluto closed this issue 2026-11-24 08:15:07 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#124
No description provided.