compresh-mcp 0.2.2__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. {compresh_mcp-0.2.2/src/compresh_mcp.egg-info → compresh_mcp-0.2.3}/PKG-INFO +1 -1
  2. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/pyproject.toml +1 -1
  3. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/__init__.py +1 -1
  4. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/server.py +36 -1
  5. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3/src/compresh_mcp.egg-info}/PKG-INFO +1 -1
  6. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/LICENSE +0 -0
  7. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/NOTICES.md +0 -0
  8. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/README.md +0 -0
  9. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/setup.cfg +0 -0
  10. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/auth.py +0 -0
  11. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/onboarding.py +0 -0
  12. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tul1_client.py +0 -0
  13. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/__init__.py +0 -0
  14. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/backfill.py +0 -0
  15. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/cli.py +0 -0
  16. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/cold_storage.py +0 -0
  17. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/compose.py +0 -0
  18. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/compression_log.py +0 -0
  19. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/config.py +0 -0
  20. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/counter.py +0 -0
  21. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/injection.py +0 -0
  22. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/main.py +0 -0
  23. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/modality.py +0 -0
  24. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/pipeline.py +0 -0
  25. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/provenance.py +0 -0
  26. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/retrieval.py +0 -0
  27. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/router.py +0 -0
  28. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/summarizer.py +0 -0
  29. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/system_prompts.py +0 -0
  30. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/tools.py +0 -0
  31. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp/tulbase/turn_box.py +0 -0
  32. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp.egg-info/SOURCES.txt +0 -0
  33. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp.egg-info/dependency_links.txt +0 -0
  34. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp.egg-info/entry_points.txt +0 -0
  35. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp.egg-info/requires.txt +0 -0
  36. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/src/compresh_mcp.egg-info/top_level.txt +0 -0
  37. {compresh_mcp-0.2.2 → compresh_mcp-0.2.3}/tests/test_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compresh-mcp
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: MCP server for Compresh — production-grade context compression with Q-protective ranking, epistemic markers, and depth-aware adaptation
5
5
  Author-email: Compresh Ltd <hello@compre.sh>
6
6
  License: BUSL-1.1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "compresh-mcp"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "MCP server for Compresh — production-grade context compression with Q-protective ranking, epistemic markers, and depth-aware adaptation"
9
9
  readme = "README.md"
10
10
  license = { text = "BUSL-1.1" }
@@ -39,7 +39,7 @@ Architecture history:
39
39
 
40
40
  from . import tulbase
41
41
 
42
- __version__ = "0.2.2"
42
+ __version__ = "0.2.3"
43
43
  __author__ = "Compresh Ltd"
44
44
  __license__ = "BUSL-1.1"
45
45
 
@@ -317,6 +317,41 @@ async def tool_compress(
317
317
  len(b.compressed_refs) for b in turn_boxes[: local_composed.n_compressed]
318
318
  )
319
319
 
320
+ # Net-negative saving guard: on short conversations the Compresh memory
321
+ # header can outweigh the text it elides, so the "compressed" view is
322
+ # actually larger than the raw turns. Reporting that as a negative
323
+ # saving is wrong (it drags down dashboard totals and bills nothing).
324
+ # Treat it as a pass-through: applied=False, saving=0, raw messages
325
+ # returned unchanged. The calling hook then skips injection.
326
+ if saving_chars <= 0:
327
+ state.n_turns = max(state.n_turns, len(messages))
328
+ asyncio.create_task(
329
+ _report_usage_background(
330
+ session_id=session_id,
331
+ saved_input_tokens=0,
332
+ saved_chars=0,
333
+ n_turns=state.n_turns,
334
+ n_compressed_entries=0,
335
+ provider_hint=provider_hint,
336
+ model_hint=model_hint,
337
+ )
338
+ )
339
+ return {
340
+ "ok": True,
341
+ "applied": False,
342
+ "reason": "net_negative_saving",
343
+ "optimized_messages": messages,
344
+ "compresh_md": "",
345
+ "raw_tail": messages,
346
+ "n_compressed_turns": 0,
347
+ "n_compressed_entries": 0,
348
+ "n_total": len(messages),
349
+ "saving_chars": 0,
350
+ "session_id": session_id,
351
+ "protection_mode": protection_mode,
352
+ "tier": (get_auth().tier or "unknown"),
353
+ }
354
+
320
355
  state.saved_chars += saving_chars
321
356
  state.n_compressed_entries += n_compressed_entries
322
357
  state.n_turns = max(state.n_turns, len(messages))
@@ -680,7 +715,7 @@ async def serve() -> None:
680
715
  read_stream, write_stream,
681
716
  InitializationOptions(
682
717
  server_name="compresh-mcp",
683
- server_version="0.2.2",
718
+ server_version="0.2.3",
684
719
  capabilities=app.get_capabilities(
685
720
  notification_options=NotificationOptions(),
686
721
  experimental_capabilities={},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compresh-mcp
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: MCP server for Compresh — production-grade context compression with Q-protective ranking, epistemic markers, and depth-aware adaptation
5
5
  Author-email: Compresh Ltd <hello@compre.sh>
6
6
  License: BUSL-1.1
File without changes
File without changes
File without changes
File without changes