Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript

test(hermes): verify OSB surface against core normalize/validate-before-wrap and in_place compaction (1.26.1) (#129)

Sol Aitkenfb474accab2c
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index b0b5eac1..bee1b178 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.26.0",
+ "version": "1.26.1",
"description": "Plugin-first second brain package for AI agents and humans.",
"author": {
"name": "Open Second Brain contributors"
diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index 99315d83..30c6d19f 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.26.0",
+ "version": "1.26.1",
"description": "Plugin-first second brain package for Codex, Hermes, Claude Code, OpenClaw, and other agent runtimes.",
"skills": "./skills",
"hooks": "./hooks/hooks.json",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e371f9f4..a2e9827b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.26.1] - 2026-07-08
+
+An upstream-alignment guard release. Two regression suites now pin Open Second Brain's Hermes-facing surface against two landed upstream Hermes changes, with no source edits and no runtime behavior changes. The kernel still calls no LLM.
+
+### Added
+
+- **Structural invariant tests for the memory-provider tool schemas.** A new `NormalizeContractTests` suite in `tests/python/test_static_schemas.py` asserts that every entry `get_tool_schemas()` exports, on both the static-fallback and the live-bridge code paths, is flat (no `{type: function}` wrapper nested anywhere) and carries a non-empty top-level `name`, exactly the preconditions core's new shared `normalize_tool_schema()` (upstream Hermes PR #52140) relies on. A companion `ProviderNormalizeSurvivalTests` case drives the provider's live-listing path with a mixed tool list (a curated tool, a non-curated tool, and an accidentally pre-wrapped entry) and asserts only the curated, flat, named tools survive, so a strict-provider turn (DeepSeek) can no longer be disabled by a malformed schema. The `inputSchema` to `parameters` remap is also shown to preserve the curated name set, count, and order, and to be idempotent with deep-copied output.
+- **Repeated in-place-compaction regression under a stable session id.** A new `InPlaceCompactionLifecycleTests` suite in `tests/python/test_memory_provider.py` drives `sync_turn` followed by repeated `on_pre_compress` and `on_session_end` with one fixed session id (the new `compression.in_place` default flipped by upstream Hermes PR #52658) and asserts exactly-once flush semantics: `brain_pre_compact_extract` fires once per boundary that has buffered turns, the in-memory buffer is cleared between flushes with no double-flush or clobber, and no duplicate Brain session writes accumulate across repeated in-place compaction. The provider is shown to make no assumption that the session id rotates.
+
## [1.26.0] - 2026-07-08
A memory-signal provenance and lifecycle integrity layer that closes five gaps in one coherent scope. Every new surface is additive and byte-identical when off, and the kernel still calls no LLM.
diff --git a/README.md b/README.md
index 80bec947..622dae15 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Open Second Brain plugs into [Hermes Agent](https://github.com/NousResearch/herm
## What is new
-Open Second Brain 1.26.0 closes five memory-integrity gaps in one coherent scope, each surface additive and byte-identical when off. Ingest now classifies sources by SHA-256 content hash and skips the extraction pass for unchanged files, and batch remember and import stamp each signal with the original turn event time instead of the import moment. Writes are idempotent under retry through client idempotency keys, where the same key and hash is a no-op and the same key with a different hash is an explicit error; extraction offers a faithful dry-run preview, and a bounded verbatim last-N-turns buffer survives compaction. Preferences and signals accept a caller-settable expiration date, a dry-run-by-default delete-by-source command reports blast radius before removing derived entries, and a whole-session checkpoint saves signals, learnings, and summary in one round-trip. On the truth side, a signed source-diversity grounding score quantifies how much independent support a slot carries, note-position contradiction detection pairs same-subject notes with opposite stances, and a declared-thesis register evaluates incoming notes against standing positions. A new Aider wrapper brackets a session end to end, mirroring the Hermes lifecycle. The kernel still calls no LLM.
+Open Second Brain 1.26.1 is an upstream-alignment guard release. Two regression suites now pin the Hermes-facing surface against landed upstream Hermes changes: the memory-provider tool schemas are proven flat and named so the core normalize/validate-before-wrap step never disables the toolset on a strict provider, and the in-place compaction lifecycle is shown to flush each boundary exactly once under one stable session id. No runtime behavior changes, no source edits; the kernel still calls no LLM.
## Why
diff --git a/docs/brainstorm/osb-hermes-core-surface-align/cli-output/claude.md b/docs/brainstorm/osb-hermes-core-surface-align/cli-output/claude.md
new file mode 100644
index 00000000..74e0e6f4
--- /dev/null
+++ b/docs/brainstorm/osb-hermes-core-surface-align/cli-output/claude.md
@@ -0,0 +1,43 @@
+## Variant 1 β€” Two disjoint, thin regression guards (task-local)
+
+**Approach:** Treat the tasks as behaviorally independent and give each its own focused test module against `provider.py`. For t_2c8448bb, assert the *structural invariants* the new `normalize_tool_schema()` depends on β€” no `{type:function}` wrapper, a top-level `name` on every entry, and that the in-place `inputSchema`β†’`parameters` remap is idempotent and preserves the curated set/count/order β€” rather than re-implementing upstream normalization. For t_3190e771, drive `sync_turn` β†’ repeated `on_pre_compress` β†’ `on_session_end` against a fixed session id and assert exactly-once flush semantics and no duplicate/clobbered Brain writes.
+
+**Trade-offs:**
+- No shared infrastructure to build or maintain; smallest possible diff for a verify task.
+- Structural-invariant assertions (vs. a ported normalizer) can't drift out of sync with upstream and give no false confidence.
+- Honestly models that schema-shape and compaction-lifecycle share nothing β€” no artificial coupling.
+- Weaker at proving the end-to-end "strict-provider turn survives"; the strict path is asserted by proxy (invariants) rather than by exercising a wrap step.
+- Two modules means two places to update if the provider surface later grows.
+
+**Complexity:** small
+**Risk:** low
+
+## Variant 2 β€” Shared upstream-contract harness (joint)
+
+**Approach:** Frame both tasks as one theme β€” "OSB conforms to changed upstream contracts" β€” and build a single test-support module with two reusable fixtures: a local port of `normalize_tool_schema()` semantics and a session-lifecycle/compaction-boundary simulator mirroring `test_compression_boundary_hook.py`. Both regression suites consume this harness so the whole upstream surface is verified through one coherent seam.
+
+**Trade-offs:**
+- DRY, one canonical place expressing "what upstream expects of us"; easy to extend when the next Hermes PR lands.
+- Coherent story for the shared branch/release: one harness, one intent.
+- A locally-ported `normalize_tool_schema` is a maintenance liability β€” if upstream changes its normalization, the port silently drifts and the guard passes while reality breaks (false confidence).
+- More upfront surface than a verify task warrants; couples two behaviorally unrelated concerns for organizational neatness only.
+- Simulator fidelity to real compaction is an assumption that must itself be trusted.
+
+**Complexity:** medium
+**Risk:** medium
+
+## Variant 3 β€” Golden-snapshot drift detection
+
+**Approach:** Capture the post-normalization toolset and a session-write "ledger" (the sequence of `brain_pre_compact_extract` calls + summary keys emitted across a repeated in-place compaction run) as golden artifacts, then assert byte-identical-when-off against those snapshots. This leans on the "additive/byte-identical" convention and pairs naturally with the existing `o2b mcp` anti-drift comparison, making both tasks a single drift-guard surface.
+
+**Trade-offs:**
+- Excellent at catching *unintended* changes to the exposed schema set and hook call pattern; cheap to read as a diff in review.
+- Reuses the anti-drift muscle the repo already has.
+- Snapshots prove "nothing changed," not "behavior is correct under the new default" β€” a careless regenerate can bake in a real regression.
+- Snapshotting the write ledger likely requires instrumenting the provider's write path, pushing toward touching more than the adapter.
+- Doesn't behaviorally exercise the strict-provider wrap or the exactly-once flush; it observes outputs, not the lifecycle guarantees the tasks actually ask about.
+
+**Complexity:** medium
+**Risk:** medium
+
+Recommended: Variant 1 β€” The two tasks are behaviorally disjoint (schema shape vs. compaction lifecycle), so forcing a shared harness or snapshot surface adds coupling and maintenance a verify task doesn't warrant. Asserting the structural invariants `normalize_tool_schema()` relies on β€” rather than re-porting it β€” keeps the guards deterministic, CI-safe without DeepSeek, and immune to upstream drift, while still shipping both as one minimal, coherent branch.
diff --git a/docs/brainstorm/osb-hermes-core-surface-align/cli-output/prompt.md b/docs/brainstorm/osb-hermes-core-surface-align/cli-output/prompt.md
new file mode 100644
index 00000000..1d0c27bc
--- /dev/null
+++ b/docs/brainstorm/osb-hermes-core-surface-align/cli-output/prompt.md
@@ -0,0 +1,64 @@
+You are a senior backend architect advising the maintainers of **Open Second Brain (OSB)**, a TypeScript/Bun Obsidian-native memory-layer plugin for Hermes Agent (a Python LLM gateway). OSB ships a native Python `MemoryProvider` that bridges the deterministic TS core to Hermes' memory contract.
+
+Two upstream Hermes PRs just landed and OSB must verify its surface against them. This is a **verify + regression-guard** task β€” not a feature build. The kernel calls no LLM; all changes are on the thin Python provider adapter + tests.
+
+# Project / runtime facts
+
+- Language: TypeScript core (Bun) + a thin Python `MemoryProvider` adapter (`plugins/hermes/`).
+- Key files:
+ - `plugins/hermes/_schemas.py` β€” vendored static tool schemas, each a flat `{name, description, inputSchema}` tuple. `static_tool_schemas()` returns deep copies with `inputSchema` renamed to `parameters`.
+ - `plugins/hermes/provider.py` β€” `OpenSecondBrainMemoryProvider`: owns `get_tool_schemas()`, `handle_tool_call()`, and lifecycle hooks `on_pre_compress`, `on_session_end`, `sync_turn`, `prefetch`, `on_memory_write`, `shutdown`. `_flush_buffer()` calls `brain_pre_compact_extract` with `session_id = self._session_id or "hermes"`.
+ - `src/core/brain/session-summary.ts` β€” TS session digests keyed/deduped by `session_id`.
+ - `tests/python/test_static_schemas.py` + `tests/python/test_memory_provider.py` β€” Python unit tests (always run); plus a live `o2b mcp` anti-drift comparison that skips when Bun is absent.
+- Conventions: SOLID/KISS/DRY; no misleading fallbacks; no hardcoding; English-only strings, abstract multi-language; every new surface additive and byte-identical when off; fail-soft hooks (never break a gateway turn).
+- Tests: Python `unittest` for the provider; TS core has its own suite. CI has Bun (anti-drift enforced locally too).
+
+# Recent git log (for direction / prior art)
+
+```
+61a9ad66 fix(brain): CodeRabbit review hardening for the unreleased v1.26.0 (#128)
+962c3e0a feat(brain): memory-signal provenance and lifecycle integrity layer (v1.26.0) (#127)
+fe2c0be2 feat(brain): context-pack economics and observability (1.25.0) (#126)
+1cde572f fix(brain): harden reindex swap, self-heal, hot paths, and continuity contracts (1.24.0) (#125)
+998e437f fix(windows): resolve 3 compatibility issues on Windows (#123)
+```
+
+# In-scope task bodies (verbatim)
+
+## TASK t_2c8448bb β€” Verify OSB tool schemas against new core normalize/validate-before-wrap (PR #52140)
+
+Upstream Hermes PR #52140 β€” fix(agent): validate context/memory tool schemas before wrapping. Core now runs a shared `normalize_tool_schema()` (agent/memory_manager.py) that unwraps already-wrapped `{type:function,function:{...}}` entries and validates a top-level `name` before agent_init.py wraps them. Previously one malformed schema from a memory provider disabled the ENTIRE toolset with HTTP 400 on strict providers (DeepSeek). Topic 41/157/160/161 run deepseek-v4-pro, so OSB tool exposure on those topics is exactly the at-risk path.
+
+Verify:
+- Confirm OSB's exported brain_* tool schemas are NOT pre-wrapped (no nested {type:function}) and every entry has a top-level name.
+- Confirm none of OSB's tools get silently dropped/renamed by the new normalization.
+- Add a regression check that the OSB toolset survives a strict-provider turn.
+
+Pre-check note: OSB brain_* schemas in `plugins/hermes/_schemas.py` are flat (name, description, inputSchema) β€” no `{type:function}` wrapper anywhere, every entry has a top-level name β€” so they appear to already satisfy the constraint. But `get_tool_schemas()` mutates live entries: renames `inputSchema`β†’`parameters` in-place (`t = dict(t); t["parameters"] = t.pop("inputSchema")`). Need to confirm this remap still passes `normalize_tool_schema()` and that the curated set is unchanged after normalization.
+
+## TASK t_3190e771 β€” Re-verify OSB compression hooks under in_place=True default flip (PR #52658)
+
+Upstream Hermes PR #52658 — feat(compression): flip `compression.in_place` default False→True. Compaction now keeps ONE durable session id instead of rotating it. OSB hooks `on_pre_compress` (via `_flush_buffer`) and `on_session_end`, and writes continuity/summary records keyed by session id. A stable session id across compaction changes the lifecycle around those hooks (see upstream tests `test_compression_boundary_hook.py`).
+
+Verify:
+- OSB `on_pre_compress` / `on_session_end` still fire correctly and exactly once per boundary with a non-rotating session id.
+- No duplicate/clobbered Brain session writes when a session is compacted in place repeatedly.
+- Decide whether OSB should rely on session-id stability or remain id-agnostic. Opt-out fallback is `compression.in_place: false`.
+
+Current behavior: `on_pre_compress` and `on_session_end` both call `_drain_captures()` + `_flush_buffer()`, which clears the in-memory buffer after one `brain_pre_compact_extract` call. Existing test `test_sync_turn_buffers_and_pre_compress_flushes_through_extract` checks a single flush + buffer-clear (second flush is a no-op), but does NOT cover repeated in-place compaction under a STABLE session id. Session summaries in `session-summary.ts` dedupe by content hash + scope by `session_id`.
+
+# What I need from you
+
+Produce EXACTLY 3 distinct architectural variants for how to structure this verify + regression-guard work across both tasks. For each variant give:
+- **Approach** (2-3 sentences: what gets verified, where the regression guard lives, how the two tasks relate).
+- **Trade-offs** (bullets).
+- **Complexity**: small | medium | large.
+- **Risk**: low | medium | high.
+
+Then EXACTLY ONE line: `Recommended: Variant N` with a 2-3 sentence rationale.
+
+Constraints to respect in every variant:
+- The Python provider adapter is the only place allowed to change (plus tests). Do NOT touch the TS core or vendored schema bodies unless a real defect is found.
+- Regression tests must be deterministic and runnable in CI without a live strict-provider β€” i.e. they must simulate the normalize path / repeated-compaction locally, not depend on DeepSeek.
+- Both tasks ship together in ONE release on a shared feature branch; variants may sequence them or treat them jointly, but must keep the combined change minimal and coherent.
+- No code in your answer β€” variants + recommendation only. Nothing outside those sections.
diff --git a/docs/brainstorm/osb-hermes-core-surface-align/design.md b/docs/brainstorm/osb-hermes-core-surface-align/design.md
new file mode 100644
index 00000000..5ff98535
--- /dev/null
+++ b/docs/brainstorm/osb-hermes-core-surface-align/design.md
@@ -0,0 +1,58 @@
+# Design β€” OSB Hermes-core surface align
+
+- **Slug:** `osb-hermes-core-surface-align`
+- **Branch:** `feat/osb-hermes-core-surface-align` (off `61a9ad66`, == `origin/main`)
+- **Scope:** single coherent line β€” verify OSB's Hermes-facing surface (memory-provider tool schemas + compression/session lifecycle hooks) against two freshly-landed upstream Hermes PRs, and add deterministic regression guards. No TS-core changes.
+
+## Problem
+
+Two upstream Hermes PRs landed on `main` (2026-06-24 / 2026-06-25) and OSB must confirm its `MemoryProvider` surface still conforms:
+
+1. **PR #52140** β€” `fix(agent): validate context/memory tool schemas before wrapping` (closes #47707). Core now runs a shared `normalize_tool_schema()` in `agent/memory_manager.py` that (a) unwraps any already-wrapped `{type:function, function:{...}}` entry and (b) validates a top-level `name` before `agent_init.py` wraps each schema. A malformed schema previously disabled the **entire** toolset with HTTP 400 on strict providers (DeepSeek). OSB exposes its `brain_*` tools through exactly this memory-provider surface, and topics 41/157/160/161 run `deepseek-v4-pro` β€” so OSB tool exposure is precisely the at-risk path.
+
+2. **PR #52658** — `feat(compression): flip compression.in_place default False→True`. Compaction now keeps **one durable session id** instead of rotating it (root cause of a P1 cluster: lost pending response, search black-hole, stale sid). OSB hooks `on_pre_compress` (via `_flush_buffer` → `brain_pre_compact_extract`) and `on_session_end`, and writes continuity/summary records **keyed by `session_id`**. A stable session id across compaction changes the lifecycle around those hooks.
+
+## Scope
+
+- `plugins/hermes/provider.py` β€” read/verify; change only if a real defect surfaces (none found in pre-check).
+- `plugins/hermes/_schemas.py` β€” read/verify (already flat; no change expected).
+- `tests/python/test_static_schemas.py` β€” **extend** with a structural-invariant regression for the normalize path (t_2c8448bb).
+- `tests/python/test_memory_provider.py` β€” **extend** with a repeated in-place-compaction regression under a stable session id (t_3190e771).
+- `docs/brainstorm/osb-hermes-core-surface-align/` β€” this design + plan + variants + cli-output.
+
+## Out of scope
+
+- The deterministic TypeScript core (`src/core/brain/*`) β€” session-summary dedup already keys by `session_id` + content hash; no change needed.
+- Re-porting upstream `normalize_tool_schema()` or `test_compression_boundary_hook.py` into OSB (deliberately rejected β€” see Design decisions).
+- Vendored schema bodies β€” they are a verbatim projection of the live `o2b mcp` `tools/list` and are protected by the existing anti-drift test; do not hand-edit.
+- Any change to OSB's `compression.in_place` config handling β€” OSB does not own that flag; it is a Hermes core knob.
+- The umbrella meta-card `t_9935bd26` (intentionally omitted; pure coordinator, closed manually after children ship).
+
+## Chosen approach β€” Variant 1: two disjoint, thin regression guards (task-local)
+
+The two tasks are **behaviorally disjoint** (schema shape vs. compaction lifecycle), so each gets its own focused, deterministic test. No shared harness, no ported normalizer, no golden snapshots.
+
+- **t_2c8448bb β€” assert structural invariants the new normalize path depends on**, against the exact output of `get_tool_schemas()` (both the static-fallback and the live-bridge code paths), rather than re-implementing `normalize_tool_schema()`. Invariants: no `{type:function}` wrapper nested anywhere; every entry has a non-empty top-level `name`; the `inputSchema`β†’`parameters` in-place remap is idempotent and preserves the curated name set, count, and order.
+- **t_3190e771 β€” drive `sync_turn` β†’ repeated `on_pre_compress` β†’ `on_session_end` with a fixed session id**, and assert exactly-once flush semantics: `brain_pre_compact_extract` fires once per boundary, the in-memory buffer is cleared between flushes (no double-flush), and no duplicate/clobbered Brain session writes accumulate across repeated in-place compaction. Decide OSB stays **session-id-agnostic** (it already keys writes by `session_id` but makes no assumption the id rotates; stability only helps, never hurts).
+
+## Design decisions
+
+1. **Assert invariants, do not port the normalizer.** Hermes is fast-forwarded to `main` on every `hermes update`; a locally-ported `normalize_tool_schema()` would silently drift and give false confidence (a green test guarding the wrong contract). Asserting the *preconditions* the normalizer relies on (flat shape, top-level `name`) is upstream-drift-proof and deterministic in CI without DeepSeek.
+2. **No DeepSeek dependency.** The "strict-provider turn survives" guarantee is asserted **by proxy** β€” the structural invariants that caused the HTTP 400 are proven absent. This keeps the test hermetic and CI-cheap, and matches the repo's existing anti-drift style (which skips, not fails, when a live dependency is missing).
+3. **Stable-id is a non-event for OSB.** OSB never assumed the session id rotates: `_flush_buffer` clears its buffer after each flush, and TS-side summaries dedupe by content hash. Repeated in-place compaction under one stable id therefore cannot produce duplicate writes *unless* the buffer is flushed twice per boundary β€” which is exactly the regression the new test pins. No opt-out toggle is added; `compression.in_place: false` remains Hermes' own fallback, not OSB's concern.
+4. **Test-only where possible.** Both changes are additive regression tests. `provider.py`/`_schemas.py` change only if a real defect is found during implementation β€” the pre-check found none.
+5. **Ship as one release on one branch.** Both guards land on `feat/osb-hermes-core-surface-align` as one coherent upstream-alignment release, cards driven one at a time, each worker building on the prior card's commits.
+
+## File changes
+
+| File | Change | Task |
+|---|---|---|
+| `tests/python/test_static_schemas.py` | Add `NormalizeContractTests`: assert flat shape (no `{type:function}`), top-level `name` present on every entry, and that `get_tool_schemas()` output (static + live-remap paths) survives a faithful *invariant* check + preserves the curated name set/count/order under the `inputSchema`β†’`parameters` remap. | t_2c8448bb |
+| `tests/python/test_memory_provider.py` | Add `test_repeated_in_place_compaction_flushes_each_boundary_once_with_stable_session_id`: buffer turns, fire `on_pre_compress` N times with the same `session_id`, assert exactly one `brain_pre_compact_extract` per boundary, buffer cleared between, no duplicate/clobbered writes. | t_3190e771 |
+| `docs/brainstorm/osb-hermes-core-surface-align/{design,plan,variants}.md` + `cli-output/*` | Phase-0 artifacts. | β€” |
+
+## Risks
+
+- **Proxy vs. end-to-end (low).** Asserting invariants proves the HTTP-400 preconditions are absent but does not exercise a real strict-provider wrap. Mitigation: the invariants are the *exact* conditions the upstream issue #47707 names; satisfying them is the precise fix the PR enforces. A live DeepSeek e2e is out of scope (no credentials in CI; non-hermetic).
+- **Upstream test-shape drift (low).** If a future Hermes release changes the normalize contract, the invariant test still holds (it asserts OSB's own shape, not upstream's internals) β€” and the live `o2b mcp` anti-drift test already catches schema-body drift.
+- **Compaction-simulator fidelity (low).** The repeated-compaction test simulates the boundary by calling the hook directly, which is how the existing lifecycle tests already exercise it; no new simulator abstraction is introduced.
diff --git a/docs/brainstorm/osb-hermes-core-surface-align/plan.md b/docs/brainstorm/osb-hermes-core-surface-align/plan.md
new file mode 100644
index 00000000..c6cb519c
--- /dev/null
+++ b/docs/brainstorm/osb-hermes-core-surface-align/plan.md
@@ -0,0 +1,57 @@
+# Plan β€” OSB Hermes-core surface align
+
+Branch: `feat/osb-hermes-core-surface-align`. Drive cards **one at a time**; each worker builds on the commits the previously-driven card landed. Follow TDD: write the failing test first, then the minimal change that makes it pass. Reference: `docs/brainstorm/osb-hermes-core-surface-align/design.md`.
+
+Run tests from the repo root:
+- Python provider tests: `python -m pytest tests/python/test_static_schemas.py tests/python/test_memory_provider.py -q` (or `python -m unittest` if pytest is absent).
+- The live anti-drift test in `test_static_schemas.py` skips automatically when Bun/`o2b` is missing β€” that is expected and must stay a skip, not a failure.
+
+---
+
+## Task t_2c8448bb β€” Verify OSB tool schemas against new core normalize/validate-before-wrap (PR #52140)
+
+**Files**
+- `tests/python/test_static_schemas.py` β€” add a new `NormalizeContractTests(unittest.TestCase)` class.
+- `plugins/hermes/_schemas.py` β€” read-only verify (no change expected; pre-check confirmed flat schemas).
+- `plugins/hermes/provider.py` β€” read-only verify of `get_tool_schemas()` (the `inputSchema`β†’`parameters` in-place remap is the focus).
+
+**Acceptance (a passing test)**
+- A test that imports `STATIC_TOOL_SCHEMAS`, `static_tool_schemas()`, and `MEMORY_TOOLS`, and asserts, for both the raw static tuple and the remapped accessor output:
+ 1. No entry contains a nested `{type:function, function:{...}}` wrapper (i.e. no key `type == "function"` with a `function` sub-dict at top level).
+ 2. Every entry has a non-empty top-level `name` (str).
+ 3. After the `inputSchema`β†’`parameters` remap, the set of `name`s, the count, and the declaration order are unchanged vs. the curated `MEMORY_TOOLS` set / static tuple order.
+ 4. The remap is idempotent: calling the accessor twice yields identical deep-copied output (guards the existing `test_accessor_returns_deep_copies` contract too).
+- Additionally, a test that drives `OpenSecondBrainMemoryProvider.get_tool_schemas()` through a `FakeBrainBridge` returning a live-shaped tool list (one with `inputSchema`, one accidentally pre-wrapped `{type:function,...}`) and asserts the provider **filters out only non-curated names** and never emits a nameless/ double-wrapped entry β€” proving the OSB toolset survives the normalize path a strict provider would apply.
+- `python -m pytest tests/python/test_static_schemas.py -q` is green; existing `StaticSchemaIntegrityTests` still pass.
+
+**Depends on**
+- Nothing (leaf). Ship first on the shared branch.
+
+---
+
+## Task t_3190e771 β€” Re-verify OSB compression hooks under in_place=True default flip (PR #52658)
+
+**Files**
+- `tests/python/test_memory_provider.py` β€” add a new test (and, only if the FakeBridge lacks it, a tiny helper to record ordered call args; reuse the existing `FakeBrainBridge.calls` list).
+- `plugins/hermes/provider.py` β€” read-only verify of `on_pre_compress` / `on_session_end` / `_flush_buffer` (no change expected; confirm buffer-clear semantics).
+
+**Acceptance (a passing test)**
+- A test `test_repeated_in_place_compaction_flushes_each_boundary_once_with_stable_session_id` that:
+ 1. Initializes a provider with a `FakeBrainBridge` whose `brain_pre_compact_extract` returns an empty structured result.
+ 2. `sync_turn("u1","a1", session_id="sess-stable")`, then `_drain_captures()`.
+ 3. Fires `on_pre_compress([])` (boundary #1), then `on_pre_compress([])` again (boundary #2, same `session_id="sess-stable"` β€” simulating repeated in-place compaction with a non-rotating id), then `on_session_end([])`.
+ 4. Asserts `brain_pre_compact_extract` was called **exactly once per boundary that had buffered turns** β€” i.e. boundary #1 flushes the buffered turn; boundaries #2 and the final `on_session_end` make **zero** additional extract calls (buffer was cleared), because no new turn was buffered between them.
+ 5. Additionally: buffer some turns between boundary #1 and #2 and assert boundary #2 flushes exactly once with the newly-buffered turns only (no re-flush of #1's content) β€” proving no duplicate/clobbered writes accumulate under a stable id.
+- A second test `test_stable_session_id_does_not_assume_rotation` documenting the decision: the provider makes no assumption that `session_id` changes across compaction; passing the same id to repeated `sync_turn` + `on_pre_compress` produces independent, dedup-safe flushes (the TS core dedupes by content hash anyway).
+- `python -m pytest tests/python/test_memory_provider.py -q` is green; all existing `ProviderLifecycleTests` still pass.
+
+**Depends on**
+- t_2c8448bb having landed its test additions on the shared branch (so this worker builds on a green, schema-verified base). Both ship in the same release commit set; drive t_2c8448bb first, then this one.
+
+---
+
+## Release notes (both tasks)
+
+- No `CHANGELOG.md` entry is required for a verify+regression-guard release with no behavior change, UNLESS a defect is found and fixed during implementation β€” in which case add a `### Fixed` line under the next unreleased version describing the corrected surface.
+- Combined design: `docs/brainstorm/osb-hermes-core-surface-align/design.md`.
+- Commit each card's work as its own focused commit on `feat/osb-hermes-core-surface-align`; the phase-0 brainstorm commit (`chore(brainstorm): osb-hermes-core-surface-align`) is already the branch base.
diff --git a/docs/brainstorm/osb-hermes-core-surface-align/variants.md b/docs/brainstorm/osb-hermes-core-surface-align/variants.md
new file mode 100644
index 00000000..b4126fc0
--- /dev/null
+++ b/docs/brainstorm/osb-hermes-core-surface-align/variants.md
@@ -0,0 +1,61 @@
+# Variants β€” OSB Hermes-core surface align
+
+All variants verbatim from the consultant (claude-opus-4-8), plus the final decision rationale.
+
+---
+
+## Variant 1 β€” Two disjoint, thin regression guards (task-local)
+
+**Approach:** Treat the tasks as behaviorally independent and give each its own focused test module against `provider.py`. For t_2c8448bb, assert the *structural invariants* the new `normalize_tool_schema()` depends on β€” no `{type:function}` wrapper, a top-level `name` on every entry, and that the in-place `inputSchema`β†’`parameters` remap is idempotent and preserves the curated set/count/order β€” rather than re-implementing upstream normalization. For t_3190e771, drive `sync_turn` β†’ repeated `on_pre_compress` β†’ `on_session_end` against a fixed session id and assert exactly-once flush semantics and no duplicate/clobbered Brain writes.
+
+**Trade-offs:**
+- No shared infrastructure to build or maintain; smallest possible diff for a verify task.
+- Structural-invariant assertions (vs. a ported normalizer) can't drift out of sync with upstream and give no false confidence.
+- Honestly models that schema-shape and compaction-lifecycle share nothing β€” no artificial coupling.
+- Weaker at proving the end-to-end "strict-provider turn survives"; the strict path is asserted by proxy (invariants) rather than by exercising a wrap step.
+- Two modules means two places to update if the provider surface later grows.
+
+**Complexity:** small
+**Risk:** low
+
+---
+
+## Variant 2 β€” Shared upstream-contract harness (joint)
+
+**Approach:** Frame both tasks as one theme β€” "OSB conforms to changed upstream contracts" β€” and build a single test-support module with two reusable fixtures: a local port of `normalize_tool_schema()` semantics and a session-lifecycle/compaction-boundary simulator mirroring `test_compression_boundary_hook.py`. Both regression suites consume this harness so the whole upstream surface is verified through one coherent seam.
+
+**Trade-offs:**
+- DRY, one canonical place expressing "what upstream expects of us"; easy to extend when the next Hermes PR lands.
+- Coherent story for the shared branch/release: one harness, one intent.
+- A locally-ported `normalize_tool_schema` is a maintenance liability β€” if upstream changes its normalization, the port silently drifts and the guard passes while reality breaks (false confidence).
+- More upfront surface than a verify task warrants; couples two behaviorally unrelated concerns for organizational neatness only.
+- Simulator fidelity to real compaction is an assumption that must itself be trusted.
+
+**Complexity:** medium
+**Risk:** medium
+
+---
+
+## Variant 3 β€” Golden-snapshot drift detection
+
+**Approach:** Capture the post-normalization toolset and a session-write "ledger" (the sequence of `brain_pre_compact_extract` calls + summary keys emitted across a repeated in-place compaction run) as golden artifacts, then assert byte-identical-when-off against those snapshots. This leans on the "additive/byte-identical" convention and pairs naturally with the existing `o2b mcp` anti-drift comparison, making both tasks a single drift-guard surface.
+
+**Trade-offs:**
+- Excellent at catching *unintended* changes to the exposed schema set and hook call pattern; cheap to read as a diff in review.
+- Reuses the anti-drift muscle the repo already has.
+- Snapshots prove "nothing changed," not "behavior is correct under the new default" β€” a careless regenerate can bake in a real regression.
+- Snapshotting the write ledger likely requires instrumenting the provider's write path, pushing toward touching more than the adapter.
+- Doesn't behaviorally exercise the strict-provider wrap or the exactly-once flush; it observes outputs, not the lifecycle guarantees the tasks actually ask about.
+
+**Complexity:** medium
+**Risk:** medium
+
+---
+
+## Consultant recommendation
+
+> Recommended: Variant 1 β€” The two tasks are behaviorally disjoint (schema shape vs. compaction lifecycle), so forcing a shared harness or snapshot surface adds coupling and maintenance a verify task doesn't warrant. Asserting the structural invariants `normalize_tool_schema()` relies on β€” rather than re-porting it β€” keeps the guards deterministic, CI-safe without DeepSeek, and immune to upstream drift, while still shipping both as one minimal, coherent branch.
+
+## Final decision: Variant 1 (agree with recommendation)
+
+Rationale: the two tasks are behaviorally disjoint (schema shape vs. compaction lifecycle). Asserting structural invariants instead of re-porting `normalize_tool_schema()` avoids the false-confidence drift risk that is especially acute here β€” Hermes is fast-forwarded to `main` on every `hermes update`, so any local port can silently rot while the test stays green. Variant 1 is the only option that is deterministic in CI without DeepSeek credentials, minimal in diff, and upstream-drift-proof, while still shipping both guards as one coherent alignment release. Variants 2 and 3 were rejected for coupling unrelated concerns and for observing outputs rather than the actual lifecycle guarantees the tasks require.
diff --git a/openclaw.plugin.json b/openclaw.plugin.json
index d1378f3b..22f4cdda 100644
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@ -2,7 +2,7 @@
"id": "open-second-brain",
"name": "Open Second Brain",
"description": "Second brain for AI agents using Obsidian-compatible Markdown vaults.",
- "version": "1.26.0",
+ "version": "1.26.1",
"activation": { "onStartup": true },
"skills": ["./skills"],
"contracts": {
diff --git a/package.json b/package.json
index 77e5ae81..0e392557 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.26.0",
+ "version": "1.26.1",
"private": false,
"description": "Second brain for AI agents using Obsidian-compatible Markdown vaults. Works with Hermes, Claude Code, Codex, and OpenClaw.",
"keywords": [
diff --git a/plugin.yaml b/plugin.yaml
index 0754f860..1396b901 100644
--- a/plugin.yaml
+++ b/plugin.yaml
@@ -1,5 +1,5 @@
name: open-second-brain
-version: "1.26.0"
+version: "1.26.1"
description: "Open Second Brain - native Hermes memory provider backed by an Obsidian-compatible Markdown vault."
author: "Open Second Brain contributors"
memory_provider: true
diff --git a/plugins/codex/.codex-plugin/plugin.json b/plugins/codex/.codex-plugin/plugin.json
index a3e7fe85..052a185e 100644
--- a/plugins/codex/.codex-plugin/plugin.json
+++ b/plugins/codex/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.26.0",
+ "version": "1.26.1",
"description": "Plugin-first second brain package for Codex, Hermes, Claude Code, OpenClaw, and other agent runtimes.",
"author": {
"name": "Open Second Brain contributors",
diff --git a/plugins/hermes/plugin.yaml b/plugins/hermes/plugin.yaml
index 0754f860..1396b901 100644
--- a/plugins/hermes/plugin.yaml
+++ b/plugins/hermes/plugin.yaml
@@ -1,5 +1,5 @@
name: open-second-brain
-version: "1.26.0"
+version: "1.26.1"
description: "Open Second Brain - native Hermes memory provider backed by an Obsidian-compatible Markdown vault."
author: "Open Second Brain contributors"
memory_provider: true
diff --git a/pyproject.toml b/pyproject.toml
index 3aeb5399..9e98eecb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
# CLI entry points (those moved to `package.json` `bin`).
[project]
name = "open-second-brain"
-version = "1.26.0"
+version = "1.26.1"
description = "Hermes Python shim for Open Second Brain. Most of the project (CLI, MCP server, OpenClaw plugin) is TypeScript on Bun; see package.json."
readme = "README.md"
requires-python = ">=3.11"
diff --git a/tests/python/test_memory_provider.py b/tests/python/test_memory_provider.py
index 88c2d997..d81fc890 100644
--- a/tests/python/test_memory_provider.py
+++ b/tests/python/test_memory_provider.py
@@ -607,6 +607,101 @@ class ProviderLifecycleTests(unittest.TestCase):
provider.shutdown()
+class InPlaceCompactionLifecycleTests(unittest.TestCase):
+ """Regression guards for Hermes PR #52658 (compression.in_place default
+ False->True). Compaction now keeps ONE durable session id instead of
+ rotating it, so the provider must flush exactly once per boundary that has
+ buffered turns, clear its buffer between flushes (no double-flush /
+ clobber), and make no assumption that the session id rotates.
+ """
+
+ _ENV_KEYS = ("VAULT_AGENT_NAME", "VAULT_DIR", "OPEN_SECOND_BRAIN_CONFIG")
+
+ def setUp(self):
+ self._saved = {k: os.environ.pop(k, None) for k in self._ENV_KEYS}
+
+ def tearDown(self):
+ for k in self._ENV_KEYS:
+ os.environ.pop(k, None)
+ if self._saved[k] is not None:
+ os.environ[k] = self._saved[k]
+
+ def _init(self, bridge, session_id):
+ provider = OpenSecondBrainMemoryProvider(bridge=bridge)
+ provider.initialize(session_id, hermes_home="/tmp/hh")
+ return provider
+
+ @staticmethod
+ def _extract_calls(bridge):
+ return [a for n, a in bridge.calls if n == "brain_pre_compact_extract"]
+
+ def test_repeated_in_place_compaction_flushes_each_boundary_once_with_stable_session_id(self):
+ bridge = FakeBrainBridge(results={"brain_pre_compact_extract": {"structuredContent": {}}})
+ provider = self._init(bridge, "sess-stable")
+
+ # Buffer a turn, then fire boundary #1 (in-place compaction).
+ provider.sync_turn("u1", "a1", session_id="sess-stable")
+ provider._drain_captures()
+ provider.on_pre_compress([]) # boundary #1: flushes the buffered turn
+
+ # Boundary #2 uses the SAME (non-rotating) session id but no new turn
+ # was buffered; the buffer was cleared by #1, so it must NOT re-flush.
+ provider.on_pre_compress([]) # boundary #2: zero extract calls
+ # A final session end (still the same stable id) also adds nothing.
+ provider.on_session_end([]) # zero extract calls
+
+ extract_calls = self._extract_calls(bridge)
+ self.assertEqual(len(extract_calls), 1)
+ # The single flush carried the stable session id, never a rotated one.
+ self.assertEqual(extract_calls[0]["session_id"], "sess-stable")
+ self.assertIn("u1", extract_calls[0]["text"])
+ self.assertIn("a1", extract_calls[0]["text"])
+
+ # Now buffer NEW turns between boundary #1 and a later boundary and
+ # assert the next boundary flushes only the new turns β€” no re-flush of
+ # #1's content, proving no duplicate/clobbered writes accumulate under
+ # a stable id.
+ provider.sync_turn("u2", "a2", session_id="sess-stable")
+ provider._drain_captures()
+ provider.on_pre_compress([]) # boundary #3: flushes only u2/a2
+
+ extract_calls = self._extract_calls(bridge)
+ self.assertEqual(len(extract_calls), 2)
+ second = extract_calls[1]
+ self.assertEqual(second["session_id"], "sess-stable")
+ self.assertIn("u2", second["text"])
+ self.assertNotIn("u1", second["text"])
+ self.assertNotIn("a1", second["text"])
+
+ def test_stable_session_id_does_not_assume_rotation(self):
+ # Decision guard: the provider makes NO assumption that session_id
+ # changes across compaction. Passing the same id to repeated sync_turn
+ # + on_pre_compress produces independent, dedup-safe flushes β€” each
+ # carries only the turns buffered since the previous boundary, keyed by
+ # the one stable id (the TS core dedupes by content hash downstream).
+ bridge = FakeBrainBridge(results={"brain_pre_compact_extract": {"structuredContent": {}}})
+ provider = self._init(bridge, "sess-stable")
+
+ for tag in ("t1", "t2", "t3"):
+ provider.sync_turn(f"u-{tag}", f"a-{tag}", session_id="sess-stable")
+ provider._drain_captures()
+ provider.on_pre_compress([])
+
+ extract_calls = self._extract_calls(bridge)
+ self.assertEqual(len(extract_calls), 3)
+ # Every flush used the one stable id; none assumed a rotated/new id.
+ self.assertEqual({c["session_id"] for c in extract_calls}, {"sess-stable"})
+ # Each flush is independent β€” it carries only its own turn, so repeated
+ # in-place compaction under one id cannot clobber a prior boundary.
+ self.assertIn("u-t1", extract_calls[0]["text"])
+ self.assertNotIn("u-t2", extract_calls[0]["text"])
+ self.assertIn("u-t3", extract_calls[2]["text"])
+ self.assertNotIn("u-t1", extract_calls[2]["text"])
+ # turn_end reflects the per-boundary buffer size (1), not a cumulative
+ # count β€” no unbounded growth across in-place compaction cycles.
+ self.assertTrue(all(c["turn_end"] == 1 for c in extract_calls))
+
+
class _ScriptedReader:
"""Readline source that yields pre-built JSON-RPC frames in order."""
diff --git a/tests/python/test_static_schemas.py b/tests/python/test_static_schemas.py
index 6ced3348..6847744e 100644
--- a/tests/python/test_static_schemas.py
+++ b/tests/python/test_static_schemas.py
@@ -22,7 +22,11 @@ from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
from plugins.hermes._schemas import STATIC_TOOL_SCHEMAS, static_tool_schemas # noqa: E402
-from plugins.hermes.provider import MEMORY_TOOLS # noqa: E402
+from plugins.hermes.bridge import FakeBrainBridge # noqa: E402
+from plugins.hermes.provider import ( # noqa: E402
+ MEMORY_TOOLS,
+ OpenSecondBrainMemoryProvider,
+)
# Fields the provider vendors for each tool; the anti-drift comparison is
# limited to this projection so unrelated server-side additions (annotations,
@@ -145,5 +149,131 @@ class AntiDriftTests(unittest.TestCase):
)
+def _is_prewrapped(entry: dict) -> bool:
+ """A schema is pre-wrapped when it carries the Chat-Completions function
+ envelope (``{"type": "function", "function": {...}}``) at the top level
+ instead of a flat tool schema. Upstream Hermes PR #52140 makes core unwrap
+ such entries before it re-wraps them; OSB must never hand core a pre-wrapped
+ entry in the first place, or a strict provider (DeepSeek) 400s the turn."""
+ return entry.get("type") == "function" and isinstance(entry.get("function"), dict)
+
+
+class NormalizeContractTests(unittest.TestCase):
+ """Guard OSB's exported schema shape against core's new
+ normalize/validate-before-wrap (Hermes PR #52140). The exported entries
+ must be flat and named so core's ``normalize_tool_schema()`` neither
+ unwraps nor drops any of them."""
+
+ def test_static_tuple_entries_are_flat_and_named(self):
+ for schema in STATIC_TOOL_SCHEMAS:
+ with self.subTest(tool=schema.get("name")):
+ self.assertFalse(
+ _is_prewrapped(schema),
+ "static schema is pre-wrapped; core would unwrap it",
+ )
+ name = schema.get("name")
+ self.assertIsInstance(name, str)
+ self.assertTrue(name, "static schema has an empty top-level name")
+
+ def test_accessor_output_entries_are_flat_and_named(self):
+ for schema in static_tool_schemas():
+ with self.subTest(tool=schema.get("name")):
+ self.assertFalse(_is_prewrapped(schema))
+ name = schema.get("name")
+ self.assertIsInstance(name, str)
+ self.assertTrue(name)
+
+ def test_remap_preserves_names_count_and_order(self):
+ # The inputSchema->parameters remap must not drop, rename, or reorder
+ # any tool: normalization keys off the top-level name, so a silent
+ # rename would desync the routing table.
+ static_names = [s["name"] for s in STATIC_TOOL_SCHEMAS]
+ accessor_names = [s["name"] for s in static_tool_schemas()]
+ self.assertEqual(accessor_names, static_names)
+ self.assertEqual(len(accessor_names), len(MEMORY_TOOLS))
+ self.assertEqual(set(accessor_names), set(MEMORY_TOOLS))
+
+ def test_remap_moves_inputschema_to_parameters_without_wrapping(self):
+ for schema in static_tool_schemas():
+ with self.subTest(tool=schema["name"]):
+ # The MCP key is gone, the adapter key is present, and the
+ # remap introduced no function envelope.
+ self.assertNotIn("inputSchema", schema)
+ self.assertIn("parameters", schema)
+ self.assertEqual(schema["parameters"].get("type"), "object")
+ self.assertFalse(_is_prewrapped(schema))
+
+ def test_accessor_is_idempotent_and_deep_copied(self):
+ first = static_tool_schemas()
+ second = static_tool_schemas()
+ self.assertEqual(first, second)
+ # Deep-copied: mutating one call's output cannot leak into the next.
+ first[0]["parameters"]["properties"]["__mutated__"] = True
+ third = static_tool_schemas()
+ self.assertEqual(third, second)
+ self.assertNotIn("__mutated__", third[0]["parameters"]["properties"])
+
+
+class ProviderNormalizeSurvivalTests(unittest.TestCase):
+ """A strict-provider turn: drive the provider's live-listing path with a
+ tool list that mixes a normal curated tool, a non-curated tool, and an
+ accidentally pre-wrapped entry. The provider must keep the curated flat
+ tools intact and never emit a nameless or double-wrapped schema β€” the exact
+ shape core's normalize/validate step accepts without disabling the toolset."""
+
+ def _provider_with_live_tools(self, tools):
+ bridge = FakeBrainBridge(tools=tools)
+ provider = OpenSecondBrainMemoryProvider(bridge=bridge)
+ provider.initialize("s", hermes_home="/tmp/hh")
+ return provider
+
+ def test_live_toolset_survives_normalize_path(self):
+ tools = [
+ {"name": "brain_note", "description": "d", "inputSchema": {"type": "object"}},
+ {"name": "brain_query", "description": "d", "inputSchema": {"type": "object"}},
+ # Non-curated: must be filtered out by name.
+ {"name": "vault_health", "description": "d", "inputSchema": {"type": "object"}},
+ # Accidentally pre-wrapped: no top-level name, so it is dropped
+ # rather than emitted as a double-wrapped entry that core would
+ # have to unwrap.
+ {"type": "function", "function": {"name": "brain_search", "parameters": {"type": "object"}}},
+ ]
+ schemas = self._provider_with_live_tools(tools)
+ emitted = schemas.get_tool_schemas()
+
+ names = {s.get("name") for s in emitted}
+ # Only curated, properly-named tools survive; the pre-wrapped and the
+ # non-curated entries are gone.
+ self.assertEqual(names, {"brain_note", "brain_query"})
+ self.assertTrue(names.issubset(set(MEMORY_TOOLS)))
+
+ for entry in emitted:
+ with self.subTest(tool=entry.get("name")):
+ # No entry is nameless or double-wrapped, and each was remapped
+ # to the adapter key.
+ self.assertIsInstance(entry.get("name"), str)
+ self.assertTrue(entry["name"])
+ self.assertFalse(_is_prewrapped(entry))
+ self.assertNotIn("inputSchema", entry)
+ self.assertIn("parameters", entry)
+
+ def test_static_fallback_path_also_survives_normalize(self):
+ # When the live listing fails, the vendored static set is the surface a
+ # strict provider sees; it must satisfy the same flat-and-named contract.
+ class _ListingFailsBridge(FakeBrainBridge):
+ def list_tools(self):
+ raise RuntimeError("listing failed")
+
+ provider = OpenSecondBrainMemoryProvider(bridge=_ListingFailsBridge())
+ provider.initialize("s", hermes_home="/tmp/hh")
+ emitted = provider.get_tool_schemas()
+ self.assertEqual({s["name"] for s in emitted}, set(MEMORY_TOOLS))
+ for entry in emitted:
+ with self.subTest(tool=entry["name"]):
+ self.assertFalse(_is_prewrapped(entry))
+ self.assertTrue(entry["name"])
+ self.assertNotIn("inputSchema", entry)
+
+
if __name__ == "__main__":
unittest.main()