Commit Graph
992 Commits
Author SHA1 Message Date
Ivan Dergachev e811b6d10a fix: avoid false HNSW metadata quarantine 2026-05-18 16:08:55 -03:00
Igor Lins e Silva 8f40dcec92 Merge pull request #1541 from MemPalace/ci/pin-ruff-0.15
ci(lint): pin ruff to 0.15.9 (CI + dev) and reformat tree
2026-05-18 13:47:54 -03:00
Igor Lins e Silva 283ef03361 ci(lint): pin ruff in pre-commit + uv.lock too (#1541 review)
Addresses Copilot review: the ruff pin was incomplete.
- .pre-commit-config.yaml stayed on ruff-pre-commit v0.4.10, so
  contributors running pre-commit would reintroduce the exact 0.4-vs-0.5
  formatter drift this PR removes. Bumped rev to v0.15.9 and rewrote the
  lock-step comment to point at pyproject as the source of truth.
- uv.lock still constrained dev ruff at >=0.4.0, so `uv sync --extra dev`
  (the documented setup) would not honor the new exact pin. Regenerated;
  the dev specifier is now ==0.15.9 in both lock entries.

ruff check/format still pass; no formatting delta from these files.
2026-05-18 00:08:17 -03:00
Igor Lins e Silva 2cab6f5a5b style: reformat tree with ruff 0.15.9
One-time mechanical reformat so `ruff format --check .` passes under the
newly pinned ruff. Layout only (assert-message parenthesization etc.),
no behavior change. 29 files: 28 under tests/ + 1 tools helper, no core
mempalace/ modules. Produced by `ruff format .`.
2026-05-17 23:20:01 -03:00
Igor Lins e Silva 96a327233d ci(lint): pin ruff to 0.15.9 across CI and dev deps
CI installed `ruff>=0.4.0,<0.5` (resolves 0.4.10) while contributors
run modern ruff (0.5+). ruff 0.5 changed assert-message formatting, so
valid code formatted by a current ruff fails CI's `ruff format --check .`
on layout alone. This blocked #1438, #1445, and #1528 — each needing a
manual reformat-and-push cycle with no actual code defect.

Pin an exact, modern ruff in both pyproject dev lists and in ci.yml so
CI and `pip install -e ".[dev]"` format/lint identically. No new
`ruff check` violations under the existing E/F/W/C901 select.
2026-05-17 23:20:01 -03:00
Igor Lins e Silva 5c9a5e04b1 Merge pull request #1528 from therahul-yo/fix/1505-extract-mode-aware-skip
fix(convo_miner): scope skip-check and drawer ids by extract_mode (#1505)
2026-05-17 23:16:10 -03:00
Igor Lins e Silva 83e4711593 style(tests): apply ruff 0.4.x format to test_convo_miner (#1528)
CI pins ruff>=0.4.0,<0.5 (resolves 0.4.10); one new assert block was
laid out in ruff-0.5+ style, failing `ruff format --check .`.
Reformat with the exact CI ruff version (assertion layout only, no
semantic change). `ruff check .` + `ruff format --check .` both pass
under 0.4.10.
2026-05-17 22:52:01 -03:00
Igor Lins e Silva 18bda00304 Merge pull request #1438 from fatkobra/patch-1
Fix UTF-8 lock holder writes on Windows
2026-05-17 22:50:47 -03:00
Igor Lins e Silva cabc3afb6e Merge pull request #1445 from yonefive71/fix/1426-none-metadata-mcp-handler
fix(mcp): tolerate None metadata cells (#1426)
2026-05-17 16:24:17 -03:00
Igor Lins e Silva 3c74ba6493 style(tests): apply ruff 0.4.x format to test_mcp_server (#1445)
CI pins ruff>=0.4.0,<0.5 (resolves 0.4.10); the PR's two new assert
blocks were laid out in ruff-0.5+ style, so `ruff format --check .`
failed. Reformat with ruff 0.4.10 (the exact CI version) — assertion
layout only, no semantic change. `ruff check .` + `ruff format --check .`
both pass under 0.4.10.
2026-05-17 16:09:45 -03:00
Igor Lins e Silva 419a34c5c5 style(tests): restore ruff 0.4.x assert formatting in test_palace_locks (#1438)
The PR reformatted two pre-existing assertions with a newer ruff
(0.5+ `assert X, (\n msg\n)` style) that CI's pinned ruff
(>=0.4.0,<0.5) rejects, failing `ruff format --check .`. Revert those
two unrelated blocks to develop's 0.4.x form; the genuine #1435 fix and
its new regression tests are untouched.
2026-05-17 15:01:14 -03:00
Igor Lins e Silva a62f8a95a4 Merge pull request #1532 from mvalentsev/fix/1498-stratified-palace-state-messages
fix(palace): stratify state messages for empty/missing palace (#1498)
2026-05-17 12:22:57 -03:00
Igor Lins e Silva 8199d7287f Merge pull request #1529 from mvalentsev/fix/1504-tunnel-preserve-hyphenated-wing
fix(tunnels): preserve hyphenated wing slugs in create_tunnel write-path (#1504)
2026-05-17 12:22:19 -03:00
Igor Lins e Silva fc4d06d0e6 Merge pull request #1441 from mvalentsev/fix/hooks-bash-3.2-compat-1440
fix(hooks): replace mapfile with sed for bash 3.2 compat (#1440)
2026-05-17 12:21:59 -03:00
Igor Lins e Silva d114a594d6 Merge pull request #1383 from mvalentsev/fix/mcp-kg-cache-realpath
fix(mcp): canonicalize KG cache key via realpath + normcase (#1372)
2026-05-17 12:21:10 -03:00
Igor Lins e Silva e6c06ef1c8 Merge pull request #1408 from arnoldwender/fix/entity-registry-tmp-cleanup-on-failure
fix(entity_registry): clean up .tmp sidecar on write or rename failure (#1373)
2026-05-17 12:20:48 -03:00
Igor Lins e Silva d2ff6eb311 Merge pull request #1530 from mvalentsev/fix/1495-mcp-cold-start-diagnostics
fix(mcp): cold-start embedder diagnostics + opt-in warmup (#1495)
2026-05-17 12:19:41 -03:00
mvalentsev 990b155515 fix(palace): address Gemini review on #1532
- searcher.search: add filesystem-first isdir/isfile checks before
  get_collection so State B (palace dir exists, chroma.sqlite3 absent)
  is distinguished from State C ("initialized but empty") instead of
  triggering chromadb's lazy DB creation as a side effect of a
  read-only search call. Preserves the SearchError(...) from e chain
  via the typed exception catches that follow.

- cli.cmd_compress: replace the redundant `ChromaBackend()` instance
  used for the mempalace_closets write with
  `palace.get_closets_collection(create=True)`. The closets write now
  reuses the module-level _DEFAULT_BACKEND, avoiding the WAL-lock
  contention risk on Windows that Gemini flagged.

- tests: new `fake_palace_path` fixture for searcher CLI unit tests so
  the filesystem-first state checks pass through to mocked backends
  instead of raising on State A / B; cmd_compress stores-results test
  patches `palace.get_closets_collection` to mirror the new write path.
2026-05-17 04:13:42 +05:00
mvalentsev c933095a2f fix(palace): stratify state messages for empty/missing palace (#1498)
`mempalace status`, `search`, and `compress` printed the same misleading
"No palace found / Run: mempalace init" output for three distinct
palace states (no dir / no DB / no collection). Most user-visible on
the first-run state where `init` had run but `mine` had not: the hint
to re-run `init` is a no-op and wastes the user's time.

Backend gets a new typed exception `CollectionNotInitializedError`
(subclass of `PalaceNotFoundError`, transitively `FileNotFoundError`,
so legacy callers keep working). `ChromaBackend.get_collection(
create=False)` wraps chromadb's bare `NotFoundError` as the new typed
exception instead of leaking the chromadb-specific class to callers.

A new internal helper `_open_collection_or_explain` in `palace.py`
runs filesystem-first state checks before the backend call to avoid
chromadb's lazy `chroma.sqlite3` creation as a side-effect of a
read-only inspection, then catches the typed exceptions and prints a
state-specific actionable message. `BackendClosedError` is explicitly
re-raised so a programmer error is not masked as a UX hint.

Two CLI bug sites route through the helper: `miner.status` and
`cli.cmd_compress`. `searcher.search` catches the typed exceptions
directly so it can preserve the cause chain in `SearchError(...) from
e` for programmatic search-API consumers. `cli.cmd_sync` gained an
inline filesystem distinction (no helper needed: it does not use the
collection handle). `repair.status` (capacity check, which by design
must work on corrupted palaces without opening a chromadb client) got
the same distinction via `sqlite_drawer_count`-based empty detection.
The MCP `tool_status` is intentionally left alone: PR #831 already
fixed it there with a `create=True` bootstrap strategy appropriate
for programmatic clients.
2026-05-17 03:57:19 +05:00
mvalentsevandStarshipSuperjam cf96e68edf fix(mcp): cold-start embedder diagnostics + opt-in warmup (#1495)
MCP clients (Claude Code, Claude Desktop) surface the cold-load of the
ONNX/CoreML embedder + HNSW segment as -32000 "Internal tool error"
without a recoverable trace, because the first chromadb-touching tool
call after a fresh mempalace-mcp boot can exceed the client timeout.
Two opt-in env vars, both default off, both fail-soft:

- MEMPALACE_LOG_FILE: append-mode FileHandler so the server-side
  traceback that the MCP client never surfaces stays diagnosable. Invalid
  path falls back to stderr-only with a warning naming the env var, so
  it cannot itself become a server-start failure. basicConfig uses
  force=True so the FileHandler is not silently dropped when something
  already configured root logging. (OSError, ValueError) catch covers
  Windows NUL-byte paths in addition to POSIX missing-dir / EPERM.

- MEMPALACE_EAGER_WARMUP: pre-loads embedder + HNSW segment at the end
  of main() startup via _get_collection(create=False).query(...) — a
  single call drives ONNX _download_model_if_not_exists +
  InferenceSession AND HNSW data_level0.bin segment load (HNSW chunks
  are read lazily on the first chromadb collection op). Fresh-install
  pre-check on os.path.isfile(palace/chroma.sqlite3) skips the warmup
  before any chromadb client call so the chromadb constructor cannot
  materialize the palace scaffold before `mempalace init` (preserves
  CLAUDE.md "Incremental only" invariant). Truthy 1/true/yes/on; falsy
  0/false/no/off and empty are silent; unrecognized values warn so
  typos like "tru" do not silently disable the feature. All failure
  paths (collection-open-raise, returned-None, query-raise) log with
  palace path + device + error class so ops can disambiguate.

Empirical evidence (Linux, CPU-only ONNX, ~1k drawers): first
diary_write t_handoff = 7.60s baseline vs 0.17s with warmup
(-7.4s shifted off the first-call window into startup). CoreML cold-load
on macOS is reported at 5-30s in the issue's empirical record
(paideia#114); the CPU baseline above is the floor.

Tests (24 cases) cover both env vars across set/unset/empty/invalid/
garbage paths, warmup truthy/falsy/garbage parsing, fresh-install (real
integration, no monkeypatch — pins zero on-disk side effect),
collection-open-raise / returned-None / query-raise fail modes, and
two regression pins: warning-before-banner ordering (guards delay=True
regression) + truthy path actually invokes col.query (guards no-op
warmup regression). Probe text is a sentinel so it cannot semantically
match real drawer content.

Co-Authored-By: StarshipSuperjam <33380501+StarshipSuperjam@users.noreply.github.com>
2026-05-17 00:57:13 +05:00
mvalentsev fba6372f2c fix(tunnels): preserve hyphenated wing slugs in create_tunnel write-path (#1504)
create_tunnel no longer normalizes hyphen->underscore on write. Wings
created via "mempalace mine --wing my-wing" are stored verbatim in
tunnels.json. list_tunnels and follow_tunnels filters normalize both
the stored value and the query at compare time so previously-stored
underscore tunnels and post-fix verbatim tunnels both resolve via
either query form.

compute_topic_tunnels canonicalizes its wing keys via
normalize_wing_name so repeated mining runs with mixed slug forms
cannot accumulate parallel duplicate tunnels. topic_tunnels_for_wing
gains a symmetric lookup so a hyphenated argument finds an
underscore-keyed registry entry.

_normalize_wing now returns None for non-string inputs instead of
raising; read-path filters use the (t.get(k) or {}) idiom so
hand-edited records with "source": null no longer crash iteration.
2026-05-16 20:48:23 +05:00
Rahul 2bf36210e9 refactor(convo_miner): reuse _metadata_matches_extract_mode helper
Address PR #1528 review feedback (gemini-code-assist, medium):
_source_file_delete_ids duplicated the legacy-drawer matching logic
that already lives in palace._metadata_matches_extract_mode.

Import the helper and call it instead so the back-compat rule
(legacy drawers without extract_mode count as exchange-mode) has a
single source of truth.

No behavior change. All 71 miner/convo tests still pass.
2026-05-16 18:15:44 +05:30
Rahul 92de001c20 fix(convo_miner): scope skip-check and drawer ids by extract_mode (#1505)
Mining a transcript with --extract general was silently skipped when the
same file had already been mined with --extract exchange (or vice versa)
because file_already_mined() and prefetch_mined_set() only looked at
source_file. The two extraction modes produce different drawer content
and rooms, so they should coexist for the same source.

Changes:
- file_already_mined() and prefetch_mined_set() take an optional
  extract_mode arg and only return True when stored drawer metadata
  matches. Legacy drawers without extract_mode are treated as
  exchange-mode for back-compat.
- _file_chunks_locked() purges only same-mode drawers when rebuilding
  on a normalize-version bump, so a schema bump on one mode does not
  drop drawers filed under the other.
- Drawer ids and sentinel ids include extract_mode so the two modes
  cannot collide on hash.
- Pagination on the direct skip-check path so large transcripts (>1k
  drawers) are classified correctly when the bulk prefetch is skipped.

Adds regression coverage for the extract-mode-aware helper, the
pagination path, and an end-to-end mine_convos run that files
exchange then general for the same transcript without skipping.
2026-05-16 17:55:10 +05:30
mvalentsev 1988f3dc91 ci: retrigger after #1520 unblocked develop lint 2026-05-15 22:51:28 +05:00
mvalentsev c736a57078 test(hooks): force umask 022 in test subprocess (#1440)
Cycle 2 follow-up: harden the permission tests so they actively
falsify the "ambient umask masking a regression" hypothesis raised
during the adversarial review pass.

- `_run_hook` now sets `preexec_fn=lambda: os.umask(0o022)` on the
  bash subprocess. The child starts with a permissive 022 umask so a
  bare file would land at mode 0644. The hook's own `umask 077` in
  the parse subshell remains the only thing protecting
  `last_python_err.log` and `last_input.log`, so `test_dump_is_not_world_readable`
  and `test_python_stderr_log_is_not_world_readable_on_failure` now
  empirically prove that protection rather than passively benefitting
  from a CI runner's restrictive ambient umask.
- Docstring precision: the helper's primary diagnostic surface is
  `hook.log` (a file under `STATE_DIR`), not the subprocess's stderr.
  Subprocess stderr is captured here only to surface unexpected
  interpreter failures (e.g., a bash syntax error introduced by a
  future edit), and the docstring now says so.

No production-code changes. 26/26 tests still pass.
2026-05-15 22:51:28 +05:00
mvalentsev 2bdb1e8846 fix(hooks): apply post-review hardenings (#1440)
Follow-up on c271e7b after the bot review and an adversarial pass.

- Replace `echo "$INPUT"` with `printf '%s' "$INPUT"` in both hooks
  so payloads with leading `-n`/`-e`/`-E` or backslashes are not
  eaten by echo flag parsing.
- Wrap the `last_python_err.log` and `last_input.log` writes in a
  `( umask 077; ... )` subshell so the files are created at mode
  0600 atomically. The existing `chmod 600` calls stay as
  belt-and-suspenders.
- Refactor the `_run_hook` test helper: internal assert on
  returncode with stderr surfaced in the failure message; new
  `extra_env=` kwarg subsumes the ad-hoc `subprocess.run` in the
  UTF-8 locale test.
- Promote the world-readable, bounded-overwrite, UTF-8, unicode and
  literal-unknown tests to a shared `_BOTH_HOOKS` parametrize with
  readable ids so the symmetry across both hooks is enforced.
- `test_sed_extraction_present` strips line comments before counting
  `sed -n '` occurrences so a regression that swapped sed back to
  mapfile while keeping the prose cannot false-pass.
- Rewrite the precompact hook header docblock: the previous
  "ALWAYS blocks" wording was stale (the hook returns `{}` and
  does not emit a `decision: block` payload to the Stop-hook
  protocol; the "always run" guarantee comes from the synchronous
  mine call).
- Apply ruff 0.4.x format to the new test file (matches CI pin
  `pip install "ruff>=0.4.0,<0.5"`).

Tests: 1749 passed (was 21 cases in c271e7b's test file; now 26 after
parametrize promotions, +5 cases).
2026-05-15 22:51:27 +05:00
mvalentsev e241aa38ba fix(hooks): replace mapfile with sed for bash 3.2 compat (#1440)
The legacy hook scripts used `mapfile -t` (introduced in #1231) to read
sanitized values from the inline Python JSON parser. On stock macOS
/bin/bash is GNU 3.2.57 (Apple GPLv3 freeze) and `mapfile` only landed
in bash 4.0, so the hook silently failed: every parsed value fell back
to its default, the log wrote "Session unknown: 0 exchanges", and zero
drawers were saved.

This commit replaces the array read with `sed -n 'Np'` line extraction,
which is POSIX and runs on /bin/bash 3.2 unmodified. It also adds a
defense-in-depth fail-loud guard: Python prints a `__MEMPAL_PARSE_OK__`
sentinel and the hook surfaces the raw input plus Python traceback to
0600-mode sibling files when the sentinel is missing, so the next silent
failure has a debuggable trail instead of an unsolved zero-drawer day.
2026-05-15 22:51:27 +05:00
mvalentsev 4dc3ccf26a fix(mcp): thread captured KG path through _get_kg to lock insert/evict keys
_get_kg now accepts an optional canonical_path argument and uses it
verbatim when given. _call_kg passes its top-of-function captured key
through, so the dict insertion that _get_kg performs and the eviction
lookup _call_kg performs always agree on the key -- even if env state
(MEMPALACE_PALACE_PATH rotation) or FS state (symlink remap) mutates
between attempts. Without the pass-through, _get_kg's internal call
to _canonicalize_kg_path(_resolve_kg_path()) could land on a different
key than the captured path, leaving a closed handle in the cache under
a stale key the eviction lookup no longer matches.

Tests:
  test_call_kg_passes_captured_path_through_resolve_drift -- patches
  _resolve_kg_path with a shifting iterator + identity canonicalize,
  pre-seeds the closed handle under the captured key; asserts both
  _get_kg calls receive the captured key and the closed handle is
  evicted by retry.

  test_call_kg_oserror_at_top_propagates_unmasked -- patches
  _canonicalize_kg_path to raise OSError; asserts it propagates without
  conversion (the rationale for capturing at the top before the retry
  loop -- prevents an OSError mid-handler from masking a
  sqlite3.ProgrammingError it can't retry through).

_patch_mcp_server test helper updated to a varargs lambda so existing
tests that patch _get_kg as a no-arg fixture stay compatible with the
new optional-arg signature.
2026-05-15 22:51:14 +05:00
mvalentsev 51eb279348 fix(mcp): capture canonical KG path once at top of _call_kg
Move _canonicalize_kg_path call from inside the except branch to the
top of _call_kg so OSError from realpath (e.g. transient Windows
junction loss) propagates cleanly instead of masking the original
sqlite3.ProgrammingError mid-handler. Also keeps the eviction key
identical to the insertion key if FS state mutates between attempts,
preventing a closed handle from leaking into the cache under a stale
key the lookup no longer matches.
2026-05-15 22:51:14 +05:00
mvalentsev 3ee158ecdd test(mcp): tighten _canonicalize_kg_path normcase wiring assertion
Patch both realpath and normcase with sentinel wrappers and assert the
result composes them as normcase(realpath(p)). Swapping the order would
leave Windows symlinks under the original case, defeating the dedup.
The previous assertion (result == seen[-1].lower()) was tautological --
the fake normcase already returned p.lower(), so any implementation
that lowercased anything would pass.
2026-05-15 22:51:14 +05:00
mvalentsev 6f9fe8055a fix(mcp): canonicalize KG cache key via realpath + normcase (#1372)
Switch _kg_by_path lookups in _get_kg and _call_kg from os.path.abspath
to a new _canonicalize_kg_path helper applying realpath (collapses
symlink aliases) + normcase (Windows drive-letter casing). Two tenants
pointing at /srv/A and /srv/link-to-A no longer open duplicate
sqlite3.Connection handles over the same file.
2026-05-15 22:51:14 +05:00
Igor Lins e Silva bb313961f3 Merge pull request #1519 from MemPalace/fix/1024-convo-min-chunk-validation
fix(convo_miner): validate explicit min_chunk_size instead of raw config reach
2026-05-15 12:23:06 -03:00
Igor Lins e Silva 342cfa629b fix(config): catch OverflowError in coercion; correct "stricter" wording
Addresses review-bot feedback on #1519:

- gemini: JSON `Infinity`/`1e1000` round-trips to float('inf'); int(inf)
  raises OverflowError, which _try_coerce_int did not catch — bad config
  could still crash ingest. Catch it alongside TypeError/ValueError and
  fall back like any other garbage value. Regression test added.
- Copilot: the 30-char convo floor was described as "stricter" than the
  50-char project default. It is the opposite — lower, i.e. more
  permissive (keeps short exchanges the project default would drop).
  Reworded the docstring and comments to state this accurately.
2026-05-15 11:01:48 -03:00
Igor Lins e Silva a10f65e094 Merge pull request #1520 from MemPalace/fix/duplicate-pytest-import-lint
fix(test): remove duplicate pytest import breaking lint on develop
2026-05-15 10:58:12 -03:00
Igor Lins e Silva 78d57ddf64 fix(test): remove duplicate pytest import breaking lint on develop
The #1024 merge added `import pytest` to tests/test_convo_miner_unit.py
while a pytest import already existed from another merged change. The
collision was textually clean so git didn't flag it, but CI ruff
reports F811 (redefinition of unused `pytest`), turning lint red on
develop and every branch cut from it.

Drop the duplicate import. `ruff check .` (0.4.x, CI pin) clean;
test_convo_miner_unit 23 passed.
2026-05-15 10:46:41 -03:00
Igor Lins e Silva bea7cb1646 fix(convo_miner): validate explicit min_chunk_size instead of raw config reach
#1024 routed min_chunk_size for the project miner through the repairing
MempalaceConfig validation, but the convo path read the raw, unvalidated
_file_config["min_chunk_size"]. A garbage/negative/bool config value
would TypeError the convo length gate or ValueError out of
chunk_exchanges and abort the whole convo mine — breaking the PR's own
"a bad config.json key never takes ingest down" guarantee for one path
only.

Extract _try_coerce_int helper (shared with _coerce_config_int) and add
a public MempalaceConfig.min_chunk_size_explicit accessor that returns
the validated value when the user set it, else None. convo_miner uses
the None sentinel to keep its stricter 30-char floor for untuned users
while honoring a valid override, with no raw _file_config reach.

Adds accessor + convo-fallback regression tests.
2026-05-15 10:42:21 -03:00
Igor Lins e Silva 29d686e5d4 Merge pull request #1024 from techempower-org/pr/configurable-chunking
feat: configurable chunk_size, chunk_overlap, min_chunk_size
2026-05-15 10:39:10 -03:00
Igor Lins e Silva 6ba75851df Merge pull request #1470 from mvalentsev/fix/plugin-hooks-bounded-timeout
fix(hooks): add bounded timeout to plugin Stop/PreCompact (#1465)
2026-05-15 10:28:57 -03:00
Igor Lins e Silva b348483e21 Merge pull request #1466 from mvalentsev/fix/mine-log-skipped-symlinks
fix(miner): log skipped symlinks in mine paths (#1462)
2026-05-15 10:08:04 -03:00
Igor Lins e Silva dce538fc0c Merge pull request #1513 from anastasiiaanfimova/fix/mcp-unknown-param-name
fix(mcp): structured -32602 for unknown parameter name (#1512)
2026-05-15 09:58:43 -03:00
Anastasiia AnfimovaandClaude Opus 4.7 51c03a0c5c fix(mcp): structured -32602 for unknown parameter name (#1512)
Unknown kwargs (wrong parameter name, e.g. text= instead of content=)
were silently dropped by the schema-filter, surfacing only indirectly
as a later "Missing required 'X'". Emit -32602 naming the offending
kwarg instead — symmetric with #1500's missing-required path. Gated by
the existing accepts_var_keyword check; wait_for_previous excluded.

Closes #1512.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 13:48:29 +02:00
Igor Lins e Silva 9893100ca4 Merge pull request #1439 from mvalentsev/fix/init-strip-leaked-pythonpath
fix: drop leaked PYTHONPATH on package init (#1423)
2026-05-15 08:05:47 -03:00
Igor Lins e Silva 73d0fe31ec Merge pull request #1424 from arnoldwender/fix/wing-truncation-hyphenated-projects
fix(hooks): correct wing extraction for hyphenated project names (#1410)
2026-05-15 07:54:56 -03:00
Igor Lins e Silva fc2d1dad5f Merge pull request #1507 from workblac/fix/1461-ruff-format-test-hnsw-payload
style: ruff format test_hnsw_payload_health.py (#1461 follow-up)
2026-05-14 19:22:14 -03:00
Bruno Leal 6bd164e4b1 style: ruff format test_hnsw_payload_health.py (#1461 follow-up)
Collapse the multi-line assert startswith() added in #1461 into a
single line as required by ruff format. No logic change.
2026-05-14 19:17:26 -03:00
Igor Lins e Silva a1bf6dea35 Merge pull request #1461 from fatkobra/patch-2
Fix: Reject zero-byte HNSW link lists during quarantine (#1457)
2026-05-14 18:57:01 -03:00
Igor Lins e Silva 2b3af2b2fa Merge pull request #1500 from mvalentsev/fix/mcp-typed-error-1351
fix(mcp): structured error for param-shape mismatch (#1351)
2026-05-14 17:25:53 -03:00
mvalentsevandanastasiiaanfimova f28d0e3511 refactor(mcp): extract _internal_tool_error helper (#1351)
Address gemini-code-assist review on PR #1500: dedup the two -32000
return branches in handle_request tools/call. Behavior unchanged;
TestParamShapeDiagnostics 6/6 green.

Co-authored-by: anastasiiaanfimova <271004602+anastasiiaanfimova@users.noreply.github.com>
2026-05-14 01:28:23 +05:00
mvalentsevandanastasiiaanfimova 982adcf09b fix(mcp): structured error for param-shape mismatch (#1351)
Split the bare except in handle_request tools/call: TypeError matching
Python's signature-mismatch shape (gated on handler __qualname__) returns
-32602 with parsed parameter name(s); handler-internal TypeError and
non-TypeError exceptions stay on the existing generic -32000 path so
internals never leak. Adds TestParamShapeDiagnostics with 6 cases.

Closes #1351

Co-authored-by: anastasiiaanfimova <271004602+anastasiiaanfimova@users.noreply.github.com>
2026-05-14 01:03:31 +05:00
mvalentsev cab41c8a75 test(hooks): use hook.get("type") for graceful assert message
A direct ``hook["type"]`` subscript raised ``KeyError`` before the
assert evaluated when the ``"type"`` key was missing, so the
diagnostic message naming the event and the unexpected value was
never shown. ``hook.get("type")`` lets the assert fail gracefully
with the intended feedback.
2026-05-13 22:53:48 +05:00