@atrib/recall 0.2.2 → 0.3.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
@@ -65,5 +65,5 @@ Or run via `npx`:
65
65
  ## What this does NOT do
66
66
 
67
67
  - **No log-inclusion verification.** Local signature verification ≠ log commitment proof. Use the log API for inclusion proofs.
68
- - **No graph derivation.** Returns records, not the §3.2.4 graph. For that, use `@atrib/trace` (causal chain) or query graph-node directly.
68
+ - **No graph derivation.** Returns records, not the [§3.2.4](../../atrib-spec.md#324-edge-derivation-rules) graph. For that, use `@atrib/trace` (causal chain) or query graph-node directly.
69
69
  - **No write surface.** Read-only. Use `@atrib/emit` to sign new records.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import type { AtribRecord } from '@atrib/mcp';
3
3
  export declare function loadRecords(path: string): AtribRecord[];
4
+ /**
5
+ * Load every `*.jsonl` file in `dir` and merge their records. Files that
6
+ * don't exist or aren't readable are silently skipped (a file rotated out
7
+ * mid-scan shouldn't error the whole call). Returns the union of records;
8
+ * de-duplication and ordering are caller responsibilities.
9
+ *
10
+ * Spec §5.9 establishes `~/.atrib/records/` as the well-known per-agent
11
+ * mirror namespace; every producer running under one identity writes a
12
+ * file there with the convention `<producer>-<agent>.jsonl`. Scanning the
13
+ * directory unifies recall across producers without recall having to know
14
+ * the naming scheme — any producer that follows §5.9 just shows up.
15
+ */
16
+ export declare function loadRecordsFromDir(dir: string): {
17
+ records: AtribRecord[];
18
+ files: string[];
19
+ };
4
20
  interface RecallArgs {
5
21
  context_id?: string;
6
22
  event_type?: 'tool_call' | 'transaction';
@@ -44,10 +60,35 @@ export interface RecallResult {
44
60
  * Always 0 when include_unverified=true was passed.
45
61
  */
46
62
  filtered_out_by_verification: number;
63
+ /**
64
+ * Mirror files actually scanned. When ATRIB_RECORD_FILE was set, this is
65
+ * a single-element list (back-compat). Otherwise it lists every `*.jsonl`
66
+ * found in ATRIB_MIRROR_DIR.
67
+ */
68
+ record_files: string[];
69
+ /**
70
+ * @deprecated Use `record_files`. Preserved as the first entry of
71
+ * `record_files` for callers still reading this field.
72
+ */
47
73
  record_file: string;
48
74
  log_origin: string;
49
75
  pagination_caveat: string;
50
76
  records: RecallRecordFull[] | RecallRecordCompact[];
51
77
  }
78
+ /**
79
+ * Discover and load records per the mirror-discovery contract:
80
+ * - If `recordFile` is provided, load just that file.
81
+ * - Else if ATRIB_RECORD_FILE is set, load just that file (back-compat).
82
+ * - Else scan ATRIB_MIRROR_DIR (default ~/.atrib/records).
83
+ *
84
+ * Returns the union of records and the list of files scanned. Callers that
85
+ * dedupe should key on `record.signature` (signatures are unique per record
86
+ * per spec §1.4); the same record present in two mirrors will appear twice
87
+ * here unless the caller dedupes.
88
+ */
89
+ export declare function discoverRecords(recordFile?: string): {
90
+ records: AtribRecord[];
91
+ files: string[];
92
+ };
52
93
  export declare function recall(args: RecallArgs, recordFile?: string): Promise<RecallResult>;
53
94
  export {};
package/dist/index.js CHANGED
@@ -4,11 +4,21 @@
4
4
  * @atrib/recall — recall_my_attribution_history MCP server.
5
5
  *
6
6
  * Exposes a single tool to the host agent: recall_my_attribution_history.
7
- * The tool reads the local signed-record jsonl mirror that an @atrib/mcp-wrap
8
- * wrapper persists (~/.atrib/records/<wrapper-name>-<agent>.jsonl per spec §5.9
9
- * D062), VERIFIES the Ed25519 signature on each record before returning it,
10
- * and tags every entry with signature_verified so the agent can distinguish
11
- * provable past from tampered or partial mirror state.
7
+ * Reads signed-record jsonl mirrors (per spec §5.9), VERIFIES the Ed25519
8
+ * signature on each record before returning it, and tags every entry with
9
+ * signature_verified so the agent can distinguish provable past from tampered
10
+ * or partial mirror state.
11
+ *
12
+ * Mirror discovery (in priority order):
13
+ * 1. ATRIB_RECORD_FILE — single explicit jsonl file. Back-compat with
14
+ * pre-0.4.0 callers that pinned a specific producer's mirror.
15
+ * 2. ATRIB_MIRROR_DIR — directory; recall reads every `*.jsonl` inside.
16
+ * Default: ~/.atrib/records (the spec §5.9 well-known mirror namespace).
17
+ *
18
+ * Two on-disk shapes are accepted, matching D062 / spec §5.9:
19
+ * - Bare AtribRecord (legacy producers): {spec_version, ...}
20
+ * - Envelope (D062 sidecar form): {record: {...}, proof?, _local?}
21
+ * Both round-trip through verifyRecord; the parser picks the right inner shape.
12
22
  *
13
23
  * Trust scope: signature verification is local-only. A passing signature_verified
14
24
  * proves the record was signed by the named creator_key; it does NOT prove the
@@ -16,8 +26,8 @@
16
26
  * should fetch the inclusion proof from the log API.
17
27
  *
18
28
  * Configuration via environment variables:
19
- * ATRIB_RECORD_FILE — path to the jsonl mirror.
20
- * Default: ~/.atrib/records/mcp-wrap-claude-code.jsonl
29
+ * ATRIB_RECORD_FILE — single explicit file (overrides directory scan).
30
+ * ATRIB_MIRROR_DIR — directory to scan. Default: ~/.atrib/records.
21
31
  * ATRIB_LOG_ORIGIN — origin used in human-readable messages.
22
32
  * Default: log.atrib.dev
23
33
  */
@@ -33,12 +43,38 @@ const EVENT_TYPE_SHORT_TO_URI = {
33
43
  tool_call: EVENT_TYPE_TOOL_CALL_URI,
34
44
  transaction: EVENT_TYPE_TRANSACTION_URI,
35
45
  };
36
- import { existsSync, readFileSync } from 'node:fs';
46
+ import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
37
47
  import { homedir } from 'node:os';
38
48
  import { join } from 'node:path';
39
49
  import { z } from 'zod';
40
- const ATRIB_RECORD_FILE = process.env.ATRIB_RECORD_FILE ?? join(homedir(), '.atrib', 'records', 'mcp-wrap-claude-code.jsonl');
50
+ const ATRIB_RECORD_FILE = process.env.ATRIB_RECORD_FILE;
51
+ const ATRIB_MIRROR_DIR = process.env.ATRIB_MIRROR_DIR ?? join(homedir(), '.atrib', 'records');
41
52
  const ATRIB_LOG_ORIGIN = process.env.ATRIB_LOG_ORIGIN ?? 'log.atrib.dev';
53
+ /**
54
+ * Pull the inner AtribRecord out of either on-disk shape (D062 envelope or
55
+ * legacy bare record). Returns null when the line is neither shape or is
56
+ * missing required fields. Same shape contract as the wrapper-side
57
+ * normalizeMirrorLine in @atrib/mcp-wrap.
58
+ */
59
+ function extractRecord(parsed) {
60
+ if (!parsed || typeof parsed !== 'object')
61
+ return null;
62
+ const obj = parsed;
63
+ // D062 envelope: { record: {...}, proof?, _local?, written_at? }.
64
+ // Legacy bare: the AtribRecord fields sit at the top level.
65
+ const candidate = (typeof obj.record === 'object' && obj.record !== null)
66
+ ? obj.record
67
+ : obj;
68
+ if (typeof candidate.spec_version === 'string' &&
69
+ typeof candidate.event_type === 'string' &&
70
+ typeof candidate.context_id === 'string' &&
71
+ typeof candidate.creator_key === 'string' &&
72
+ typeof candidate.chain_root === 'string' &&
73
+ typeof candidate.signature === 'string') {
74
+ return candidate;
75
+ }
76
+ return null;
77
+ }
42
78
  export function loadRecords(path) {
43
79
  if (!existsSync(path))
44
80
  return [];
@@ -49,24 +85,64 @@ export function loadRecords(path) {
49
85
  if (!trimmed)
50
86
  continue;
51
87
  try {
52
- const parsed = JSON.parse(trimmed);
53
- // Light shape check: require the load-bearing fields. Anything missing
54
- // these is malformed jsonl from an older wrapper version; skip silently.
55
- if (parsed.spec_version &&
56
- parsed.event_type &&
57
- parsed.context_id &&
58
- parsed.creator_key &&
59
- parsed.chain_root &&
60
- parsed.signature) {
61
- out.push(parsed);
62
- }
88
+ const rec = extractRecord(JSON.parse(trimmed));
89
+ if (rec)
90
+ out.push(rec);
63
91
  }
64
92
  catch {
65
- // Malformed line; skip.
93
+ // Malformed JSON; skip.
66
94
  }
67
95
  }
68
96
  return out;
69
97
  }
98
+ /**
99
+ * Load every `*.jsonl` file in `dir` and merge their records. Files that
100
+ * don't exist or aren't readable are silently skipped (a file rotated out
101
+ * mid-scan shouldn't error the whole call). Returns the union of records;
102
+ * de-duplication and ordering are caller responsibilities.
103
+ *
104
+ * Spec §5.9 establishes `~/.atrib/records/` as the well-known per-agent
105
+ * mirror namespace; every producer running under one identity writes a
106
+ * file there with the convention `<producer>-<agent>.jsonl`. Scanning the
107
+ * directory unifies recall across producers without recall having to know
108
+ * the naming scheme — any producer that follows §5.9 just shows up.
109
+ */
110
+ export function loadRecordsFromDir(dir) {
111
+ if (!existsSync(dir))
112
+ return { records: [], files: [] };
113
+ let entries = [];
114
+ try {
115
+ entries = readdirSync(dir).filter((name) => name.endsWith('.jsonl'));
116
+ }
117
+ catch {
118
+ return { records: [], files: [] };
119
+ }
120
+ const records = [];
121
+ const files = [];
122
+ for (const name of entries) {
123
+ const full = join(dir, name);
124
+ try {
125
+ const stat = statSync(full);
126
+ if (!stat.isFile())
127
+ continue;
128
+ }
129
+ catch {
130
+ continue;
131
+ }
132
+ const loaded = loadRecords(full);
133
+ if (loaded.length > 0) {
134
+ records.push(...loaded);
135
+ files.push(full);
136
+ }
137
+ else {
138
+ // Surface empty/unreadable files too so the operator can see them in
139
+ // the response if they care, but only if the file existed (which it
140
+ // does — readdirSync returned it).
141
+ files.push(full);
142
+ }
143
+ }
144
+ return { records, files };
145
+ }
70
146
  async function annotateVerification(records) {
71
147
  return Promise.all(records.map(async (r) => {
72
148
  let ok = false;
@@ -93,14 +169,32 @@ function compactify(records) {
93
169
  return out;
94
170
  });
95
171
  }
96
- export async function recall(args, recordFile = ATRIB_RECORD_FILE) {
172
+ /**
173
+ * Discover and load records per the mirror-discovery contract:
174
+ * - If `recordFile` is provided, load just that file.
175
+ * - Else if ATRIB_RECORD_FILE is set, load just that file (back-compat).
176
+ * - Else scan ATRIB_MIRROR_DIR (default ~/.atrib/records).
177
+ *
178
+ * Returns the union of records and the list of files scanned. Callers that
179
+ * dedupe should key on `record.signature` (signatures are unique per record
180
+ * per spec §1.4); the same record present in two mirrors will appear twice
181
+ * here unless the caller dedupes.
182
+ */
183
+ export function discoverRecords(recordFile) {
184
+ const explicit = recordFile ?? ATRIB_RECORD_FILE;
185
+ if (explicit) {
186
+ return { records: loadRecords(explicit), files: [explicit] };
187
+ }
188
+ return loadRecordsFromDir(ATRIB_MIRROR_DIR);
189
+ }
190
+ export async function recall(args, recordFile) {
97
191
  // Defaults: compact=true (small responses) and include_unverified=false
98
192
  // (no tampered records). The verbose+include-tampered combo is opt-in.
99
193
  // Rationale: a poorly-written agent that doesn't check signature_verified
100
194
  // would otherwise treat tampered records as provable. Default to safe.
101
195
  const compact = args.compact !== false;
102
196
  const includeUnverified = args.include_unverified === true;
103
- const all = loadRecords(recordFile);
197
+ const { records: all, files } = discoverRecords(recordFile);
104
198
  let filtered = all;
105
199
  if (args.context_id)
106
200
  filtered = filtered.filter((r) => r.context_id === args.context_id);
@@ -133,7 +227,8 @@ export async function recall(args, recordFile = ATRIB_RECORD_FILE) {
133
227
  total: filtered.length,
134
228
  returned: verified.length,
135
229
  filtered_out_by_verification: filteredOutByVerification,
136
- record_file: recordFile,
230
+ record_files: files,
231
+ record_file: files[0] ?? '',
137
232
  log_origin: ATRIB_LOG_ORIGIN,
138
233
  pagination_caveat: 'offset is not stable when new records are appended. For consistent paging, capture the' +
139
234
  ' first-page timestamps and re-page using a context_id or event_type filter instead.',
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,YAAY,CAAA;AAGnB,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,MAAM,uBAAuB,GAA2B;IACtD,SAAS,EAAE,wBAAwB;IACnC,WAAW,EAAE,0BAA0B;CACxC,CAAA;AACD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAA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EAAE,IAAI,EAAE,EAAE;IACb,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAkB,CAAC,CAAA;IAC/C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACtC;SACF;KACF,CAAA;AACH,CAAC,CACF,CAAA;AAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;AAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atrib/recall",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "MCP server for atrib. Lets agents query their own provable past from the local signed-record mirror with per-record signature verification.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@modelcontextprotocol/sdk": "^1.12.1",
12
12
  "zod": "^4.3.6",
13
- "@atrib/mcp": "0.5.0"
13
+ "@atrib/mcp": "0.6.1"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^22.0.0",