feat(memory): ensure project MMs, delta refresh, lean budgets, eval docs#533
Open
luxus wants to merge 9 commits into
Open
feat(memory): ensure project MMs, delta refresh, lean budgets, eval docs#533luxus wants to merge 9 commits into
luxus wants to merge 9 commits into
Conversation
Guided setup no longer skips starters when a shared coding bank already has other projects' models. Offer/ensure compares expected starter ids (bank-global + active project) from the resolved template. Coding project template resolution now merges bank-global operating preferences, and bundled models request refresh_after_consolidation. Closes #528
Exclude probe bait "no questions" rules and capture durable up-front / high-signal clarification preferences.
- Bundled mental models: mode delta, refresh_after_consolidation, observation-first, exclude_mental_models; max_tokens 600/800 - Sharpen default coding/user bank missions (ignore probe noise) - Docs: coding-memory-evaluation (AMB/sde-bench/perf-monitor); update starter/core-function notes and docs-site Closes #528, #529, #530, #531, #532
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bundles several coding-memory optimizations: it makes guided setup “starter mental model” provisioning aware of the expected starter model IDs (bank-global + active-project), updates bundled bank templates to use delta refresh defaults with lean max_tokens budgets, revises default bank mission strings to better align with Hindsight best practices, and adds evaluation-alignment documentation.
Changes:
- Guided setup now probes mental model IDs and only skips starter provisioning when all expected starter IDs are already present (avoids “other project’s models” causing an incorrect skip on shared coding banks).
- Bundled templates now emit delta refresh triggers (
mode: delta,refresh_after_consolidation,fact_types: ["observation"],exclude_mental_models) and enforce leanmax_tokenscaps (prefs 600 / project 800). - Adds coding-memory evaluation notes to docs + docs-site and updates related concept/setup documentation and unit tests.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mental-models.test.ts | Updates assertions to account for bank-global vs project-stamped model IDs. |
| tests/guided-setup.test.ts | Adds coverage for “expected starter IDs” skip/offer behavior and ID-aware probing. |
| tests/bank-templates.test.ts | Verifies delta trigger defaults + max_tokens caps; checks expected starter IDs. |
| tests/bank-operations.test.ts | Updates expectations for revised default bank mission text. |
| package.json | Publishes new docs/coding-memory-evaluation.md in package files. |
| extensions/tui/guided-setup.ts | Probes modelIds, computes expected starter IDs, and offers starters only when missing. |
| extensions/operations/memory-control-operations.ts | Notes client trigger-field limitation; keeps create mapping to refreshAfterConsolidation. |
| extensions/banks/bank-templates.ts | Adds bank-global coding starter MM, delta-trigger defaults, token budgets, and expected-ID helper. |
| extensions/banks/bank-operations.ts | Revises default reflect/retain/observations missions for project + global banks. |
| docs/starter-mental-model-suggestions.md | Documents lean token budgets + delta trigger defaults; adds bank-global coding starter section. |
| docs/hindsight-core-functions.md | Updates mental model positioning and documents delta+refresh trigger rationale. |
| docs/coding-memory-evaluation.md | New evaluation-alignment note (AMB / sde-bench / perf monitor) and default implications. |
| docs-site/src/content/docs/start/setup-tui.md | Documents “skip only when all expected starters present” behavior. |
| docs-site/src/content/docs/concepts/starter-mental-model-suggestions.md | Mirrors starter MM doc updates (budgets, delta triggers, what-not-to-seed). |
| docs-site/src/content/docs/concepts/index.mdx | Adds concept link for Coding memory evaluation. |
| docs-site/src/content/docs/concepts/hindsight-core-functions.md | Mirrors core-functions doc updates for docs-site. |
| docs-site/src/content/docs/concepts/coding-memory-evaluation.md | Adds docs-site page for evaluation alignment. |
| astro.config.mjs | Adds sidebar/nav entry for Coding memory evaluation concept page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+328
to
+335
| /** Extract mental-model ids from a listMentalModels response body. */ | ||
| export function extractMentalModelIds(response: unknown): string[] { | ||
| const ids: string[] = []; | ||
| for (const row of mentalModelListRows(response)) { | ||
| if (typeof row.id === "string" && row.id.trim()) ids.push(row.id.trim()); | ||
| } | ||
| return ids; | ||
| } |
Comment on lines
+295
to
+301
| /** Bank-global models merged into coding project template apply (unstamped). */ | ||
| export function bankGlobalMentalModelsForTemplate( | ||
| templateId: string, | ||
| ): readonly BankTemplateMentalModel[] { | ||
| if (templateId === "pi-coding-project") return CODING_BANK_GLOBAL_MENTAL_MODELS; | ||
| return []; | ||
| } |
Keep DEFAULT_MM_* and bankGlobalMentalModelsForTemplate module-private.
Split user-bank defaults: coding keeps cross-project coding prefs; conversation/life uses defaultLifeBankMissions. Wire agentUse into ensureGlobalBank from lifecycle and guided setup.
Add criteria for good missions/MMs and when agents should propose create/update/refresh (dry-run first, never silent). Wire docs-site sidebar and cross-links from starters, core functions, tools surface.
When it's worth optimizing, concrete inspect signals, cadence, and priority order so agents propose fixes instead of nagging every turn.
Small on-demand skill: when the user is frustrated about memory, inspect status/scope/MMs/missions, score against quality signals, propose dry-run fixes — never silent bank mutation.
Observation-only fact_types rebuilt coding-assistant-operating-preferences as empty '#' after clear. Prefs/user seeds use world+experience+observation; project architecture/conventions/decisions stay observation-first. Document signal for memory-doctor.
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.
Summary
Bundles the coding-memory optimization backlog into one PR:
mode: delta,refresh_after_consolidation, observation-first refresh,exclude_mental_models.docs/coding-memory-evaluation.md(+ docs-site) from AMB / sde-bench / perf-monitor.Linked issue
Scope
extensions/tui/guided-setup.ts— expected-id ensure for MM offerextensions/banks/bank-templates.ts— bank-global coding prefs seed, delta trigger, max_tokensextensions/banks/bank-operations.ts— mission stringsextensions/operations/memory-control-operations.ts— create still maps refreshAfterConsolidation (client limitation)Verification
npm run checknpm run check:coverage(source, tests, critical paths, orci:coverage) — covered by CI coverage gate on this PRnpm run typecheck:tsc(source/critical paths or full CI) — covered by CI TypeScript compiler fallback on this PRci:full) — skipped because this is not a release PR and has no platform-sensitive changes; CI correctly skips full matrixci:package) — package verification job passed on this PRnpm run pack:verify(release/package changes) — skipped because no package/release packaging path changenpm run smoke:hindsightor configuredHindsight Integrationpass (memory-path behavior changes orci:live-smoke; document unavailable live proof) — CI live-smoke job passed on this PRRelease impact
Check exactly one:
Setup no longer skips starters when other projects already provisioned models on the shared coding bank. New template applies get delta refresh + lean budgets. Default bank missions wording changes for new bank creates (existing banks unchanged until reconfigured).
Risk and rollback
Follow-ups
max_tokenson existing Hindsight models) done outside this PR. Upstream client only mapsrefreshAfterConsolidationon create — full delta fields ride template import.Memory invariants
Guidance sync
AGENTS.mdandCONTRIBUTING.mdwere updated together. (N/A — docs only for eval alignment)Agent checklist
AGENTS.mdandCONTRIBUTING.md.Notes
Sources: Hindsight best practices, oh-my-pi blog, MM deep dive, AMB, sde-bench, continuous perf monitor.