Skip to content

fix(ruflo-console): key the mission ledger by project (#4237) - #4242

Merged
ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/console-ledger-per-project-4237
Oct 17, 2026
Merged

ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/console-ledger-per-project-4237

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Fixes #4237

Problem

ruflo-console keeps the per-project UI view under storeKeyOf(cwd), but the mission ledger used the fixed key mission-ledger. The plugin store is one file per machine, so:

  • the active mission of project A was shown as active in project B, and with missionContext on (the default) its active task was injected into B's prompt;
  • two sessions in different projects overwrote each other's ledger (last writer wins).

Fix

  • ledgerKeyOf(cwd) returns mission-ledger:<cwd>. saveLedger and loadLedger use it. If cwd is unknown (''), they fall back to the old key, as before.
  • New missions record cwd (MissionRecord.cwd, optional). On load, missions recorded for another project are skipped.
  • Migration: a project with no ledger of its own reads the old shared key once. It keeps missions that have no recorded project, but it does not adopt that ledger's active (that was simply whichever project wrote last) or missions recorded for another project. The first save then writes the project's own key. The old key is left untouched for other projects.

Tests

  • New tests/mission-ledger-per-project.spec.ts: B does not see A's active mission, two projects keep separate ledgers, and the legacy fallback does not adopt active. All 3 fail on main and pass with this change.
  • tests/adr-integration.spec.ts now reads the saved ledger from ledgerKeyOf(state.cwd), because its world sets a real cwd.
  • npx vitest run plugins/ruflo-console: 26 failures both with and without this change (environment-specific files in my partial checkout). No new failures. tsc --noEmit -p plugins/ruflo-console reports nothing in the changed files.

AI assistance

An AI coding agent (Grok Bot) helped write this change. I reproduced the bug, reviewed the diff, and ran the tests.

The ledger was stored under one machine-wide key, so the active mission
of one project was shown, and injected into the prompt, in every other
project, and sessions in different projects overwrote each other's
ledger. Store it under mission-ledger:<cwd> like the UI view, record cwd
on new missions, and read the old shared key only as a fallback without
adopting its active mission or missions recorded for another project.
@kevin9327
kevin9327 requested a review from ruvnet as a code owner October 17, 2026 03:32
@ruvnet
ruvnet merged commit 4487dd0 into ruvnet:main Oct 17, 2026
42 checks passed
aepod added a commit to weave-logic-ai/ruflo that referenced this pull request Oct 19, 2026
…project (ruvnet#4254)

ruvnet#4242 keyed the mission ledger by project, but a project with no ledger of
its own still took in every mission from the old shared key that had no cwd
(all of them, since cwd was only recorded from ruvnet#4237 on), and the first save
copied them into the project's own key.

- Missions with no project are offered in Mission Control (adopt here / not
  this project) instead of taken in; until adopted they are not picked,
  handed to Claude or put in the prompt.
- Adopt stamps the project's cwd and removes them from the shared key;
  dismiss is remembered per project.
- A shared-key mission recorded for this project is taken in and pruned.
- A 0.44.3 copy with no project in a project key is offered the same way.
- loadLedger clears missions and active when the State's cwd changes
  (session.start reuses the State).
- Ledger storage moves to hooks/mission-ledger.ts (mission-control.ts would
  pass 500 lines); mission-control.ts re-exports it unchanged.
- Console 0.44.4: ruvnet#4242 shipped under 0.44.3, so plugin update never
  offered it.

Co-Authored-By: RuFlo <[email protected]>
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.

ruflo-console: mission ledger is global, so one project's active mission appears in every project

2 participants