Skip to content

feat!: drop priorKnowledge from describe_screen - #59

Draft
cryptotavares wants to merge 2 commits into
cryptotavares/mmcli-p1-02-device-mcp-0-5from
cryptotavares/mmcli-p1-03-no-prior-knowledge
Draft

cryptotavares wants to merge 2 commits into
cryptotavares/mmcli-p1-02-device-mcp-0-5from
cryptotavares/mmcli-p1-03-no-prior-knowledge

Conversation

@cryptotavares

Copy link
Copy Markdown
Collaborator

Description

describe_screen called knowledgeStore.generatePriorKnowledge on every call (src/tools/discovery-tools.ts:168-188 at 0.12.0). That read past step files from test-artifacts/llm-knowledge/ and added a priorKnowledge block (related sessions, similar steps, suggested actions) of 3–5 kB to the output. No consumer reads the block. This is the first, smallest part of removing the knowledge store, split out so its cost can be measured on its own.

  • describe_screen no longer calls generatePriorKnowledge and no longer returns priorKnowledge.
  • priorKnowledge is removed from DescribeScreenResult and StepRecordObservation, from the 4th createDefaultObservation argument, from observation diffing (observation-compaction.ts) and from step redaction.
  • Tests, SKILL.md and README.md are updated to match.
  • The rest of the knowledge store stays. The next PR in the stack removes it.

Part of the mm CLI v2 effort: ticket P1-03 (Phase 1).
Stacked on #58 (review that first).

Breaking changes

  • describe_screen results (mm describe-screen) no longer contain priorKnowledge.
  • The DescribeScreenResult and StepRecordObservation types no longer have priorKnowledge.
  • createDefaultObservation(state, testIds, nodes) no longer takes a 4th priorKnowledge argument.

Consumer impact

Consumer Change needed Done on branch
Extension test/e2e/playwright/llm-workflow/ None (rg priorKnowledge: 0 hits) n/a
Mobile tests/llm-workflow/ None (rg priorKnowledge: 0 hits) n/a

Proof

Tested with yalc builds of the parent (c87dbc3) and of this branch in the Extension (e2e test build 13.56.0, headless) and Mobile (dev client 8.19.0, iOS sim + Android emulator), on wallet home after unlock.

Check Before After
priorKnowledge in describe-screen (ext / iOS / Android) present (1/1/1) absent (0/0/0)
Size of the removed block (pretty-printed, ext / iOS / Android) 3881 / 5060 / 4856 B 0
describe-screen bytes p50, Extension 14019 9816
describe-screen toolMs p50, Extension (5 runs) 712 614
describe-screen toolMs p50, Android (3 runs) 6916 4034
generatePriorKnowledge alone, Mobile store (18 sessions, 31 MB) p50 294 ms per call 0
generatePriorKnowledge alone, Extension store (9 sessions, 1 MB) p50 30 ms per call 0

The iOS device bench was too noisy on this host (load average 11–19) to show the ~0.3 s gain: observationMs, which this change does not touch, moved by the same amount as toolMs. The isolated timing of the removed call is the reliable number. Its cost grows with the history on disk.

Transcripts
describe-screen bench p50 (bytes / wall / toolMs / observationMs / totalMs)
ext      before 14019 / 2177 / 712 / 634 / 1348     after 9816 / 2182 / 614 / 642 / 1242
android  before 1010607 / 10957 / 6916 / 2928 / 9849   after 1014571 / 8457 / 4034 / 2845 / 7355
(Android a11y tree on wallet home varies by ~7 kB between runs, which hides the 4.9 kB removal)

$ grep -c priorKnowledge {ext,ios,android}/describe-screen.txt
0 0 0
Top-level keys after: state, activeTab (ext), testIds, a11y, screenshot, meta
Unit tests
 Test Files  49 passed (49)
      Tests  1636 passed (1636)
Type Errors  no errors
All files          |   96.38 |     91.7 |   94.63 |   96.62 |

describe_screen no longer calls KnowledgeStore.generatePriorKnowledge, which
read past step files from disk on every call, and its result no longer has a
`priorKnowledge` field. The field is also gone from StepRecordObservation,
createDefaultObservation and the observation compaction/redaction code.
The rest of the knowledge store stays until it is removed separately.

BREAKING CHANGE: `describe_screen` results (and `DescribeScreenResult`,
`StepRecordObservation`) no longer contain `priorKnowledge`.
`createDefaultObservation` no longer takes a fourth `priorKnowledge`
argument.
@cryptotavares
cryptotavares added this pull request to stack #63 October 23, 2026 20:59

This branch has not been deployed

No deployments
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