@atrib/trace 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
@@ -47,6 +47,7 @@ When the envelope carries an optional `_local` sidecar (per the local-mirror sid
47
47
  - **Dangling-aware**: `informed_by` entries pointing at records not in the local mirror surface in `dangling` and do NOT advance the walk.
48
48
  - **Local-only (v1)**: reads only the local mirror. v2 will fall back to `log.atrib.dev/v1/lookup/<hash>` for hashes not in the local mirror.
49
49
  - **Backward-only (v1)**: walks `informed_by` upstream. Forward-walk (records that reference THIS one) is a v2 concern via the graph service.
50
+ - **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. Silent-failure per [§5.8](https://github.com/creatornader/atrib/blob/main/atrib-spec.md#58-degradation-contract); instrumentation never blocks the trace result. `ATRIB_READ_PRIMITIVES_LOG` overrides the default path for tests.
50
51
 
51
52
  ## Wire-up
52
53
 
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
17
17
  import { z } from 'zod';
18
- import { resolveEnvContextId } from '@atrib/mcp';
18
+ import { resolveEnvContextId, logReadPrimitiveCall, extractRecordHashesFromMcpResult, } from '@atrib/mcp';
19
19
  import { loadAllRecords } from './storage.js';
20
20
  import { traceBackward } from './trace.js';
21
21
  const SHA256_REF_PATTERN = /^sha256:[0-9a-f]{64}$/;
@@ -94,7 +94,7 @@ export async function createAtribTraceServer() {
94
94
  'so the caller can reconstruct the tree, and dangling hashes (records ' +
95
95
  'referenced via informed_by but not present in the local mirror).',
96
96
  inputSchema: TraceInput.shape,
97
- }, async (args) => {
97
+ }, async (args) => logReadPrimitiveCall('trace', args, async () => {
98
98
  const depth = args.depth ?? 3;
99
99
  const maxNodes = args.max_nodes ?? 200;
100
100
  const compact = args.compact ?? true;
@@ -128,6 +128,6 @@ export async function createAtribTraceServer() {
128
128
  return {
129
129
  content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
130
130
  };
131
- });
131
+ }, extractRecordHashesFromMcpResult));
132
132
  return { mcp };
133
133
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/trace",
3
- "version": "0.3.4",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for atrib. Walks informed_by chains backward from a record_hash to surface the reasoning chain that produced it.",
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",