@atrib/trace 0.3.1 → 0.3.3

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 (2) hide show
  1. package/dist/index.js +6 -8
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15,6 +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
19
  import { loadAllRecords } from './storage.js';
19
20
  import { traceBackward } from './trace.js';
20
21
  const SHA256_REF_PATTERN = /^sha256:[0-9a-f]{64}$/;
@@ -97,14 +98,11 @@ export async function createAtribTraceServer() {
97
98
  const depth = args.depth ?? 3;
98
99
  const maxNodes = args.max_nodes ?? 200;
99
100
  const compact = args.compact ?? true;
100
- // ATRIB_CONTEXT_ID env-var default: when the caller omitted
101
- // context_id, fall back to the env var if it carries a valid
102
- // 32-hex value. Lets Inspect-style harnesses scope the trace walk
103
- // to a per-arm context_id via the MCP env block (per D072's
104
- // per-arm isolation contract). Explicit args.context_id always wins.
105
- const envContextId = process.env['ATRIB_CONTEXT_ID'];
106
- const contextId = args.context_id ??
107
- (envContextId && HEX_32_PATTERN.test(envContextId) ? envContextId : undefined);
101
+ // Env-var context_id default: when the caller omitted context_id,
102
+ // fall back to @atrib/mcp's resolveEnvContextId (D078 + D083
103
+ // precedence: ATRIB_CONTEXT_ID, then a registered harness env var
104
+ // like CLAUDE_CODE_SESSION_ID). Explicit args.context_id always wins.
105
+ const contextId = args.context_id ?? resolveEnvContextId();
108
106
  const { byHash } = loadAllRecords();
109
107
  const result = traceBackward(args.record_hash, depth, byHash, {
110
108
  maxNodes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/trace",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
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.7.0"
14
+ "@atrib/mcp": "0.9.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^25.8.0",