@atrib/summarize 0.3.4 → 0.4.1

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.
package/README.md CHANGED
@@ -54,6 +54,7 @@ When a record lacks a `_local` sidecar (legacy entry), the prompt includes a mar
54
54
  - **Honest input flagging**: a per-record line in the prompt marks records lacking semantic content; the system prompt instructs the LLM not to invent semantics.
55
55
  - **Network access only on LLM call**: storage reads are local. Tests use the same FORBIDDEN_HOSTS guard as the rest of the workspace to prevent fixture leakage.
56
56
  - **No retry on LLM failure**: surfaces the error in `warnings` and returns null narrative. Caller decides whether to retry with smaller `max_records` or different model.
57
+ - **Instrumented (per [D084](https://github.com/creatornader/atrib/blob/main/DECISIONS.md#d084-read-primitive-instrumentation-for-empirical-loop-closure-measurement) Surface 6)**: every call writes a per-invocation jsonl entry to `~/.atrib/state/read-primitives/calls.jsonl` for the unified loop-closure analyzer. Includes `elapsed_ms` covering the full LLM round-trip plus `errored: true` on LLM failure paths. Silent-failure per [§5.8](https://github.com/creatornader/atrib/blob/main/atrib-spec.md#58-degradation-contract); instrumentation never blocks the summarize response. `ATRIB_READ_PRIMITIVES_LOG` overrides the default path for tests.
57
58
 
58
59
  ## Wire-up
59
60
 
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
18
18
  import { z } from 'zod';
19
- import { resolveEnvContextId } from '@atrib/mcp';
19
+ import { resolveEnvContextId, logReadPrimitiveCall, extractRecordHashesFromMcpResult, } from '@atrib/mcp';
20
20
  import { loadAllRecords } from './storage.js';
21
21
  import { callLlm, resolveLlmConfig } from './llm.js';
22
22
  import { buildSystemPrompt, buildUserMessage } from './prompt.js';
@@ -48,13 +48,13 @@ export async function createAtribSummarizeServer() {
48
48
  '_local sidecar for semantic content. Records without a sidecar are ' +
49
49
  'flagged so the LLM can be honest about impoverished input.',
50
50
  inputSchema: SummarizeInput.shape,
51
- }, async (rawInput) => {
51
+ }, async (rawInput) => logReadPrimitiveCall('summarize', rawInput, async () => {
52
52
  const input = SummarizeInput.parse(rawInput);
53
53
  const result = await handleSummarize(input);
54
54
  return {
55
55
  content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
56
56
  };
57
- });
57
+ }, extractRecordHashesFromMcpResult));
58
58
  return { mcp };
59
59
  }
60
60
  async function handleSummarize(input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/summarize",
3
- "version": "0.3.4",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for atrib. Synthesizes a narrative across N records via an OpenAI-compatible LLM so agents read context, not raw record bytes.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@modelcontextprotocol/sdk": "^1.29.0",
13
13
  "zod": "^3.25.76",
14
- "@atrib/mcp": "0.9.1"
14
+ "@atrib/mcp": "0.11.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^25.8.0",