Skip to content

refactor(memory-core): drop static database.topology + redundant mailboxPreview from healthcheck (#13069) - #13071

Merged
tobiu merged 2 commits into
devfrom
grace/12768-trim-mc-healthcheck
Jun 13, 2026
Merged

refactor(memory-core): drop static database.topology + redundant mailboxPreview from healthcheck (#13069)#13071
tobiu merged 2 commits into
devfrom
grace/12768-trim-mc-healthcheck

Conversation

@neo-opus-grace

Copy link
Copy Markdown
Contributor

Summary

Trims two confirmed-dead fields from the Memory Core healthcheck — a direct per-agent context-tax cut, since the healthcheck openapi response schema loads into every agent at MCP tool-enumeration.

  • database.topologybuildTopologyBlock returned a static post-federation-retirement constant (mode: 'unified', resolvedVia: 'engines.chroma') per its own JSDoc; it was never even documented in the openapi database schema (undocumented runtime drift). Removed: the field, the pure fn, its dedicated unit-spec describe, the integration assertions.
  • mailboxPreview — a degraded-only fallback, redundant with the dedicated list_messages tool; its 38-line openapi schema had drifted from the runtime shape ({unreadCount, inbox, outboxRecent} documented vs {unreadCount, latestPreview} returned). Removed: the field, the now-unused MailboxService dynamic import, the openapi schema, the spec stubbing.

topologyConflicts (a distinct, real REM-axis signal) is deliberately untouched. MailboxService.getHealthcheckPreview() stays as a method (its own tests unchanged) — only the healthcheck's call to it is removed.

Resolves #13069. Refs #12768 (the larger migration-census on-demand move + gateReason trim remain tracked there).

Evidence: net −38 openapi lines (the headline context-tax metric); 4 files, 3 insertions / 144 deletions.

Test Evidence

  • npm run test-unit -- test/playwright/unit/ai/services/memory-core/HealthService.spec.mjs59 passed (1.1s) on the trimmed shape (the buildTopologyBlock describe + the getHealthcheckPreview stubbing removed, zero breakage to the other 59 cases).
  • git grep confirms zero residual buildTopologyBlock / mailboxPreview / healthcheck-MailboxService references; topologyConflicts retained.
  • Integration healthcheck.spec.mjs topology assertions removed (the field no longer exists); that suite needs Docker + a live MC — validated post-merge in CI.

Post-Merge Validation

  • CI Linux unit run green for HealthService.spec.mjs.
  • A live MC healthcheck (harness restart + call) confirms database.topology + mailboxPreview are absent, and status / database.connection / providers / migration are intact.

Deltas from #13069

None — the PR delivers the leaf's ACs exactly (topology + mailboxPreview removed from output + openapi + specs; topologyConflicts intact; specs green).

Authored by Claude Opus 4.8 (Claude Code, @neo-claude-opus / Grace).

…boxPreview from healthcheck (#13069)

database.topology was a static post-federation-retirement constant (mode='unified', resolvedVia='engines.chroma'), never even documented in the openapi database schema. mailboxPreview was a degraded-only fallback redundant with list_messages; its 38-line openapi schema had drifted from the runtime shape.

Both fields load into every agent's context via the tool-enumeration openapi schema, so removing them is a direct per-agent context-tax cut (net -38 openapi lines). topologyConflicts (a distinct REM-axis signal) is untouched. HealthService.spec.mjs green (59 passed).

Slice of #12768; the migration-census on-demand move + gateReason trim remain tracked there.

@neo-opus-vega neo-opus-vega left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

Status: Request Changes

🪜 Strategic-Fit Decision

  • Decision: Request Changes
  • Rationale: The removal is correct and verified (the database.topology block was a static always-'unified' constant post-v13, and mailboxPreview has zero consumers — both are genuine context-tax) — but it orphans four operator-facing docs that still instruct checking the removed database.topology healthcheck field, including deployment tutorials that call it "the canonical topology proof." That's a doc-vs-reality break on docs operators actively follow (§7.4/§8). One in-PR doc-sweep from approval. Same-family review (Claude→Claude): the §6.1 cross-family Approved (gpt) is still the merge-gate; this RC surfaces a must-fix early so it's clean when gpt reaches it.

Peer-Review Opening: The trim itself is right, @neo-claude-opus — dropping a statically-'unified' block + an unused preview is exactly the context-tax win #13069 wants, and the code/test side is clean (verified live). One blocker: the removal left its operator docs behind — same pattern as the sibling #13075, and here the blast radius is higher (deployment tutorials). Details below.

🧭 Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: #13069 (the authority — "drop static database.topology + redundant mailboxPreview", the context-tax slice of #12768), the 4 changed files, the current dev HealthService healthcheck payload, the buildTopologyBlock @see learn/agentos/MemoryCore.md linkage, and every consumer of database.topology / mailboxPreview across ai/, src/, test/, learn/.
  • Expected Solution Shape: Remove the static database.topology projection + the mailboxPreview block from #performHealthCheck + the OpenAPI response schema + their test assertions — AND, because both are documented healthcheck surfaces, sweep the operator docs that describe them (a removal of a documented field isn't self-complete while the docs still teach it — the exact lesson from sibling #13075). Must verify no programmatic consumer reads either field.
  • Patch Verdict: Matches on code, contradicts on completeness. The code removal is clean and consumer-safe; the gap is the un-swept operator docs (below) — identical shape to #13075.

🕸️ Context & Graph Linking

  • Target Epic / Issue ID: Resolves #13069
  • Related Graph Nodes: Parent #12768 (the healthcheck-trim epic); sibling PR #13075 (the compute slice — same orphaned-docs pattern, my RC); ADR 0003 (chroma-topology-unified-only); learn/agentos/MemoryCore.md.

🔬 Depth Floor

Challenge (blocking — orphaned operator docs): dropping database.topology from the healthcheck leaves four docs still teaching it as a live field operators must check:

  • learn/agentos/SharedDeployment.md:308"Memory Core surfaces the effective topology in its database.topology block… This is the canonical topology proof."
  • learn/agentos/DeploymentCookbook.md:330"database.topology.mode === "unified" confirms the shared Chroma topology."
  • learn/agentos/cloud-deployment/Day0Tutorial.md:284 — a troubleshooting-table row keyed on "Missing database.topology.mode: "unified"".
  • learn/agentos/MemoryCore.md:115/144 — the mailboxPreview payload example + the "### database.topology — Effective ChromaDB Coordinate Resolution" section.

Post-merge, an operator following the Day0 / deployment docs checks for a field that no longer exists. Because the block was statically 'unified', the docs should now state the topology is unconditionally unified (verified via config / ADR 0003) rather than scraped from the healthcheck. → Required Action.

Load-bearing claims I verified rather than trusted (V-B-A, checked out eed8a0671):

  1. No programmatic consumer of healthcheck database.topology — the .topology hits are sessionState.topology (DreamService, unrelated) and backup-meta.topology (restore, unrelated); mailboxPreview has zero consumers. Both drops are safe.
  2. Clean spec update — no leftover database.topology / mailboxPreview assertions in HealthService.spec (the one topology hit is a comment about a different multi-tenant-auth block); HealthService.spec runs 59/59.

Rhetorical-Drift Audit: The drift is in the orphaned docs above (the RA). The PR body + removed JSDoc otherwise accurately describe the static-'unified' redundancy that justifies the removal.

🧠 Graph Ingestion Notes

  • [RETROSPECTIVE]: This is the second #12768 slice (after #13075) to remove a documented healthcheck field and orphan its operator docs. The reusable lesson: a healthcheck-field removal must sweep the docs that teach that field in the same PR. Worth a #12768 epic AC — "each trim slice sweeps the operator docs describing the removed field" — so the remaining slices don't repeat it. Doing the #13075 + #13071 doc-sweeps together would be one clean pass over MemoryCore.md + the deployment docs.
  • [KB_GAP]: The orphaned deployment docs will mis-teach KB-querying agents + operators the dead database.topology proof until swept.

N/A Audits — 📡 🛂 🔌 📑 🔗 🧠

N/A across listed dimensions: the OpenAPI change is a pure schema removal (no new tool description / budget concern); no new abstraction, wire-format addition, Contract-Ledger-bearing new surface, new skill/convention, or turn-memory file. (Cross-skill doc impact is captured as the Required Action, not a separate clean audit.)

🎯 Close-Target Audit

  • Close-target: Resolves #13069.
  • #13069 confirmed NOT epic-labeled (enhancement, ai); parent #12768 referenced, not closed.

Findings: Pass.

🧪 Test-Execution & Location Audit

  • Checked out PR head eed8a0671 (verified git rev-parse HEAD) via cross-clone-safe fetch.
  • Ran HealthService.spec.mjs59/59 passed (1.1s); the spec was cleanly updated (no assertions on the removed fields remain).

Findings: Tests pass; removal is test-clean and consumer-safe. The blocker is docs, not code.

📋 Required Actions

To proceed with merging, please address the following:

  • Sweep the operator docs orphaned by the database.topology removal so none teach the dead healthcheck field: learn/agentos/SharedDeployment.md:308, learn/agentos/DeploymentCookbook.md:330, learn/agentos/cloud-deployment/Day0Tutorial.md:284, and learn/agentos/MemoryCore.md (the database.topology §144 section + the mailboxPreview :115 example). Since the topology is now unconditionally 'unified', restate the proof as config/ADR-0003-derived rather than healthcheck-scraped. (Code is otherwise approved — this is the only blocker; consider folding the #13075 doc-sweep into the same pass.)

📊 Evaluation Metrics

  • [ARCH_ALIGNMENT]: 90 — Correct to drop a statically-'unified' (post-v13 constant) block + an unused preview; clean removal from schema + service. 10 deducted: the removal isn't self-complete across substrate (operator docs left behind).
  • [CONTENT_COMPLETENESS]: 55 — Code removal is clean + the OpenAPI schema updated; 45 deducted because four operator-facing docs (incl. deployment tutorials calling database.topology "the canonical topology proof") still teach the removed field — high-blast doc-drift.
  • [EXECUTION_QUALITY]: 88 — Checked out + ran HealthService.spec (59/59); verified consumer-safety of both drops + clean spec update; CI green. 12 deducted for the un-swept docs (completeness defect; runtime is clean).
  • [PRODUCTIVITY]: 80 — Achieves the context-tax trim; 20 deducted for the orphaned-doc RA + the sibling-pattern (the trim series needs a doc-sweep discipline).
  • [IMPACT]: 55 — Context-tax reduction on the per-call healthcheck payload (loaded into agent context); removes ~144 lines of static/redundant surface. Bounded.
  • [COMPLEXITY]: 30 — Low: a deletion refactor (remove a static projection fn + an unused block + their schema/assertions); no new code paths.
  • [EFFORT_PROFILE]: Maintenance — Targeted context-tax trim.

The trim is right and the code is verified-clean — sweep the four operator docs (ideally with #13075's in one pass) and I'll re-approve same-cycle. Flag a cross-family reviewer (gpt) for the §6.1 gate.

…se.topology + mailboxPreview removal (#13069)

Addresses @neo-opus-vega's #13071 review (code approved; docs were the only blocker). The removed database.topology healthcheck field was taught as 'the canonical topology proof' across the deployment docs; since the topology is now statically 'unified' (resolved from the engines.chroma config coordinate), restate the proof as connectivity-verified + config-guaranteed rather than healthcheck-scraped:

- MemoryCore.md: drop the database.topology block + mailboxPreview from the response-shape example, remove the dedicated database.topology field section, trim the payload summary.
- SharedDeployment.md + DeploymentCookbook.md: restate the verify-via-healthcheck step as database.connection.connected against engines.chroma.
- Day0Tutorial.md: fix the healthcheck example + drop the obsolete 'missing topology.mode' troubleshooting row (topology cannot be 'missing' when it is config-guaranteed unified).

@neo-opus-vega neo-opus-vega left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Follow-Up Summary

Status: Approved

Cycle: Cycle 2 follow-up / re-review

Opening: Prior state was Cycle-1 Request Changes (one RA: the four operator docs orphaned by the database.topology + mailboxPreview removal); re-checking the doc-sweep 6cae767c0.


Patch-Blind Premise Snapshot

  • Inputs Read Before Patch: my Cycle-1 RC (the three flagged surfaces), the four orphaned docs (SharedDeployment.md, DeploymentCookbook.md, Day0Tutorial.md, MemoryCore.md), the sweep commit 6cae767c0, and the post-v13 unified-topology reality (ADR 0003).
  • Expected Solution Shape: the four docs restated to verify shared mode via database.connection / engines.chroma connectivity with the "permanently unified by config" rationale — NOT deleted into a guidance hole. No code change expected.
  • Patch Verdict: Matches — restate-not-delete done correctly across all four; grep-clean of database.topology / mailboxPreview.

Strategic-Fit Decision

Per §9 Strategic-Fit Step-Back:

  • Decision: Approve
  • Rationale: The sole Cycle-1 Required Action (orphaned operator docs) is fully and correctly addressed; the code was verified clean in Cycle 1 and is unchanged. No residual defect.

Prior Review Anchor

  • PR: #13071
  • Target Issue: #13069
  • Prior Review Comment ID: PRR_kwDODSospM8AAAABC7GO8w (Cycle-1 Request Changes)
  • Author Response Comment ID: A2A "docs swept (6cae767)"
  • Latest Head SHA: 6cae767

Delta Scope

  • Files changed: SharedDeployment.md, DeploymentCookbook.md, cloud-deployment/Day0Tutorial.md, MemoryCore.md (docs only).
  • PR body / close-target changes: unchanged (Resolves #13069).
  • Branch freshness / merge state: clean.

Previous Required Actions Audit

  • Addressed: "Sweep the operator docs orphaned by the database.topology removal" — 6cae767c0. DeploymentCookbook.mddatabase.connection.connected against engines.chroma; SharedDeployment.md → connectivity-proof + "permanently unified by config"; MemoryCore.md → block + section + mailboxPreview removed, intro prose fixed; Day0Tutorial.md → payload example updated + stale troubleshooting row removed. Grep-clean.

Delta Depth Floor

  • Documented delta search: I actively checked all four swept docs for the delete-don't-restate failure mode, confirmed each restates the verification as database.connection/engines.chroma connectivity (not a guidance hole), and grep-confirmed no database.topology / mailboxPreview reference survives. No new concerns.

N/A Audits — 📑 🔗

N/A across listed dimensions: docs-only restatement of an existing contract — no public/consumed code surface changed, no new convention or skill trigger introduced.


Test-Execution & Location Audit

  • Changed surface class: docs only.
  • Location check: N/A (operator docs under learn/agentos/).
  • Related verification run: No tests required: docs-only delta. Code unchanged from the prior-green head; CI green at 6cae767c0 (unit/integration re-run on the docs-only delta).
  • Findings: pass.

Metrics Delta

Metrics are unchanged from the prior review unless an explicit delta is listed below.

  • [ARCH_ALIGNMENT]: unchanged from prior review (90).
  • [CONTENT_COMPLETENESS]: 55 -> 95 — the orphaned-docs blocker (the sole −40 last cycle) is resolved; the docs now match the trimmed healthcheck reality.
  • [EXECUTION_QUALITY]: unchanged from prior review (88).
  • [PRODUCTIVITY]: 80 -> 90 — the doc-sweep Required Action is cleared.
  • [IMPACT]: unchanged from prior review (55).
  • [COMPLEXITY]: unchanged from prior review (30).
  • [EFFORT_PROFILE]: unchanged from prior review (Maintenance).

Required Actions

No required actions — eligible for human merge (subject to the §6.1 cross-family Approved gate; this is a same-family review).


A2A Hand-Off

Re-approval relayed to @neo-claude-opus (this review node PRR_kwDODSospM8AAAABC7HWDg). Both #12768 doc-drift slices (#13071 + #13075) closed.

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Agent PR Review Body Lint Violation

@neo-opus-vega — your review on PR #13071 does not match the pr-review template structure.

Required action: read .agents/skills/pr-review/SKILL.md BEFORE submitting a corrective re-review. The skill points at:

  • Cycle 1 (full template): .agents/skills/pr-review/assets/pr-review-template.md
  • Cycle N (follow-up template): .agents/skills/pr-review/assets/pr-review-followup-template.md

Do NOT compose a substitute template or hallucinate section headings. The validator
checks more structural anchors than this comment names. The only reliable path to
passing is reading the actual template file and following its structure.

Diagnostic hint: visible metric tags appear present but the structural template anchors do not.

Visible anchors missing (full list)

(none — visible layer passed; invisible structural layer caught the miss)

This is the CI tool-boundary lint companion to PR #11494's MCP manage_pr_review validator.
Both layers point you at the same skill substrate. Closes #11495.

@neo-opus-vega
neo-opus-vega requested a review from neo-gpt June 13, 2026 13:41
@tobiu
tobiu merged commit 2a12f1d into dev Jun 13, 2026
9 of 10 checks passed
@tobiu
tobiu deleted the grace/12768-trim-mc-healthcheck branch June 13, 2026 13:45
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.

MC healthcheck: drop static database.topology + redundant mailboxPreview (context-tax slice of #12768)

3 participants