@remnic/core 9.3.685 → 9.3.686
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/dist/access-boundary.d.ts +2 -2
- package/dist/access-boundary.js +2 -2
- package/dist/access-cli.js +88 -7
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +1 -1
- package/dist/access-http.js +5 -5
- package/dist/access-mcp.d.ts +12 -2
- package/dist/access-mcp.js +4 -4
- package/dist/access-operations.d.ts +8 -3
- package/dist/access-operations.js +5 -3
- package/dist/access-schema.d.ts +4 -4
- package/dist/{access-service-DeKrlYU_.d.ts → access-service-DmCHJ4cH.d.ts} +105 -29
- package/dist/access-service.d.ts +1 -1
- package/dist/access-service.js +1 -1
- package/dist/access-surface-catalog.d.ts +1 -1
- package/dist/access-surface-catalog.js +2 -0
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/{chunk-OFUULUSY.js → chunk-473JIN2U.js} +56 -5
- package/dist/chunk-473JIN2U.js.map +1 -0
- package/dist/{chunk-SQGPGC76.js → chunk-FUCUR2OZ.js} +540 -43
- package/dist/chunk-FUCUR2OZ.js.map +1 -0
- package/dist/{chunk-IIDSFFE5.js → chunk-KFBOZYME.js} +42 -3
- package/dist/chunk-KFBOZYME.js.map +1 -0
- package/dist/{chunk-PK6RGRSD.js → chunk-NN7QYW5W.js} +2 -2
- package/dist/chunk-NN7QYW5W.js.map +1 -0
- package/dist/{chunk-JPCKLFWK.js → chunk-QVMXQGT7.js} +6 -5
- package/dist/chunk-QVMXQGT7.js.map +1 -0
- package/dist/{chunk-BZISAF67.js → chunk-S2OU5DZY.js} +28 -6
- package/dist/chunk-S2OU5DZY.js.map +1 -0
- package/dist/{cli-D3-Q5Uod.d.ts → cli-D8nZ2MPH.d.ts} +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/mcp-memory-inspector-app.d.ts +1 -1
- package/dist/schemas.d.ts +38 -38
- package/dist/transfer/types.d.ts +22 -22
- package/package.json +2 -2
- package/src/access-boundary.ts +2 -1
- package/src/access-cli.ts +94 -4
- package/src/access-http.ts +39 -1
- package/src/access-mcp.ts +54 -1
- package/src/access-operations.ts +66 -0
- package/src/access-service.ts +147 -62
- package/src/access-surface-catalog.test.ts +1 -1
- package/src/access-surface-catalog.ts +2 -0
- package/src/cli.ts +1 -0
- package/src/coding/decision-surfaces.test.ts +279 -0
- package/src/coding/decision-surfaces.ts +475 -0
- package/dist/chunk-BZISAF67.js.map +0 -1
- package/dist/chunk-IIDSFFE5.js.map +0 -1
- package/dist/chunk-JPCKLFWK.js.map +0 -1
- package/dist/chunk-OFUULUSY.js.map +0 -1
- package/dist/chunk-PK6RGRSD.js.map +0 -1
- package/dist/chunk-SQGPGC76.js.map +0 -1
|
@@ -92,6 +92,81 @@ interface ConsoleStateSnapshot {
|
|
|
92
92
|
errors: string[];
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Decision-record surface contract + handler (issue #1548 Track A PR 2).
|
|
97
|
+
*
|
|
98
|
+
* Rule 39: one gate predicate, checked identically on every surface. Rule 22
|
|
99
|
+
* spirit: one implementation behind three thin wirings. The service holds
|
|
100
|
+
* only a thin delegate that builds a {@link DecisionSurfaceContext} and calls
|
|
101
|
+
* {@link handleCodingDecision}; the handler logic lives here so the
|
|
102
|
+
* access-service god file gains thin wiring only.
|
|
103
|
+
*
|
|
104
|
+
* No orchestrator imports (rule 11 — no shared mutable state). No circular
|
|
105
|
+
* dependency on access-service.ts: validation errors are thrown via
|
|
106
|
+
* `ctx.throwInputError`, which the service wires to EngramAccessInputError.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
declare const DECISION_SUBCOMMANDS: readonly ["list", "get", "record", "supersede"];
|
|
110
|
+
type DecisionSubcommand = (typeof DECISION_SUBCOMMANDS)[number];
|
|
111
|
+
/**
|
|
112
|
+
* Canonical surface request — one shape for all three transports. The
|
|
113
|
+
* `subcommand` field selects which operation runs; the remaining fields are
|
|
114
|
+
* optional depending on the subcommand.
|
|
115
|
+
*
|
|
116
|
+
* `sessionKey` identifies the session whose coding context scopes the
|
|
117
|
+
* operation. `namespace` overrides the coding-scoped namespace (same
|
|
118
|
+
* precedence as `memory_store` — explicit namespace wins).
|
|
119
|
+
*/
|
|
120
|
+
interface DecisionSurfaceRequest {
|
|
121
|
+
subcommand: DecisionSubcommand;
|
|
122
|
+
sessionKey?: string;
|
|
123
|
+
namespace?: string;
|
|
124
|
+
id?: string;
|
|
125
|
+
title?: string;
|
|
126
|
+
status?: string;
|
|
127
|
+
context?: string;
|
|
128
|
+
decision?: string;
|
|
129
|
+
consequences?: string;
|
|
130
|
+
entityRefs?: string[];
|
|
131
|
+
supersedesId?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Surface response — a discriminated union on `subcommand`. Each surface
|
|
135
|
+
* serializes this to its transport-appropriate shape.
|
|
136
|
+
*/
|
|
137
|
+
type DecisionSurfaceResponse = {
|
|
138
|
+
subcommand: "list";
|
|
139
|
+
records: DecisionSurfaceRecord[];
|
|
140
|
+
count: number;
|
|
141
|
+
} | {
|
|
142
|
+
subcommand: "get";
|
|
143
|
+
found: boolean;
|
|
144
|
+
record?: DecisionSurfaceRecord;
|
|
145
|
+
} | {
|
|
146
|
+
subcommand: "record";
|
|
147
|
+
memoryId: string;
|
|
148
|
+
status: string;
|
|
149
|
+
} | {
|
|
150
|
+
subcommand: "supersede";
|
|
151
|
+
supersededMemoryId: string;
|
|
152
|
+
replacementMemoryId: string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Flattened record projection surfaced to clients. Stored as markdown +
|
|
156
|
+
* frontmatter memory files (category `"decision"`) — this shape is the
|
|
157
|
+
* read-side projection, not the storage format.
|
|
158
|
+
*/
|
|
159
|
+
interface DecisionSurfaceRecord {
|
|
160
|
+
id: string;
|
|
161
|
+
title: string;
|
|
162
|
+
status: string;
|
|
163
|
+
context?: string;
|
|
164
|
+
decision?: string;
|
|
165
|
+
consequences?: string;
|
|
166
|
+
entityRefs: string[];
|
|
167
|
+
supersedes?: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
95
170
|
/**
|
|
96
171
|
* Procedural memory stats surface (issue #567 PR 5/5).
|
|
97
172
|
*
|
|
@@ -916,40 +991,31 @@ declare class EngramAccessService {
|
|
|
916
991
|
* priority over `cwd` (matching `maybeAttachCodingContext`).
|
|
917
992
|
*/
|
|
918
993
|
private resolveCodingContextFromOptions;
|
|
994
|
+
/** Shared coding-scope derivation for the read/write resolvers below —
|
|
995
|
+
* coding context, overlay, principal, scope-profile plan for an IMPLICIT
|
|
996
|
+
* request, IDENTICAL to recall precedence (session-first, per-call fallback)
|
|
997
|
+
* so a scoped store is discoverable by scoped recall (#1434). Single source
|
|
998
|
+
* of truth for the namespacesEnabled/projectScope gates (rule 22; keeps the
|
|
999
|
+
* scattered-config-read ratchet flat). READ-ONLY: never mutates session. */
|
|
1000
|
+
private resolveCodingScopeInputs;
|
|
919
1001
|
/**
|
|
920
1002
|
* Resolve the write namespace for explicit-write tools (memory_store /
|
|
921
1003
|
* suggestion_submit), project-scoping the write the same way recall does so a
|
|
922
1004
|
* memory stored with a client-injected `cwd`/`projectTag` is discoverable by
|
|
923
|
-
* project-scoped recall (#1434, rule 42).
|
|
924
|
-
*
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
* `resolveWritableNamespace` → `canWriteNamespace`. A coding-overlay
|
|
928
|
-
* namespace string (`<base>-project-*`) is NOT a writable target via the
|
|
929
|
-
* explicit field — project scoping is requested with `cwd`/`projectTag`,
|
|
930
|
-
* never by naming the derived namespace — so there is no way to bypass the
|
|
931
|
-
* policy allow-list by guessing/forging an overlay name (Codex review).
|
|
932
|
-
* - With NO coding overlay, the write stays on `config.defaultNamespace` —
|
|
933
|
-
* exactly the pre-#1434 behavior, so an unqualified write is NOT silently
|
|
934
|
-
* moved to a principal self namespace (Codex review).
|
|
935
|
-
* - WITH a coding overlay, the base is the principal self namespace
|
|
936
|
-
* (`defaultNamespaceForPrincipal`, write-checked) — the SAME base recall,
|
|
937
|
-
* observe, and the orchestrator buffer-flush write path overlay onto
|
|
938
|
-
* (rule 42 / Cursor) — so a project-scoped store lands exactly where
|
|
939
|
-
* project-scoped recall searches. The overlay namespace is always REBUILT
|
|
940
|
-
* from the authenticated principal's base, never accepted as a caller
|
|
941
|
-
* string, so a caller can never reach another principal's subtree.
|
|
942
|
-
*
|
|
943
|
-
* Read-only: this NEVER mutates session coding context, so the idempotency
|
|
944
|
-
* peeks and dryRun preflights that call it stay side-effect free (Codex
|
|
945
|
-
* review). It prefers the per-call `cwd`/`projectTag` (the project explicitly
|
|
946
|
-
* identified for this write), else the session's existing context. The HTTP
|
|
947
|
-
* surface lets the peek and the write each resolve independently; the peek's
|
|
948
|
-
* namespace only gates rate-limiting (memory_store/suggestion_submit run their
|
|
949
|
-
* own idempotency check), so a benign session-context change between the two
|
|
950
|
-
* never fails a write — there is no namespace to "pin".
|
|
1005
|
+
* project-scoped recall (#1434, rule 42). Shared derivation lives in
|
|
1006
|
+
* {@link resolveCodingScopeInputs}; this method enforces the WRITE acl
|
|
1007
|
+
* (`canWriteNamespace` / profile-layer writability). Read-only: never mutates
|
|
1008
|
+
* session coding context.
|
|
951
1009
|
*/
|
|
952
1010
|
private resolveCodingScopedWriteNamespace;
|
|
1011
|
+
/** Read-side mirror of {@link resolveCodingScopedWriteNamespace}. Decision
|
|
1012
|
+
* `list`/`get` use this so a record written by a project-scoped session is
|
|
1013
|
+
* listable/fetchable by the SAME session without manually supplying the
|
|
1014
|
+
* overlaid namespace (review P2). Derivation is IDENTICAL to the write path
|
|
1015
|
+
* (shared via {@link resolveCodingScopeInputs}); the only difference is the
|
|
1016
|
+
* ACL — reads enforce {@link canReadNamespace}, so a read-but-not-write
|
|
1017
|
+
* principal can still list/fetch (rule 42). */
|
|
1018
|
+
private resolveCodingScopedReadableNamespace;
|
|
953
1019
|
/**
|
|
954
1020
|
* Resolve ONE effective memory scope plan for a write-producing request
|
|
955
1021
|
* (#1495 / seed for epic #1494). The returned {@link MemoryScopePlan} is the
|
|
@@ -1121,6 +1187,16 @@ declare class EngramAccessService {
|
|
|
1121
1187
|
peekSuggestionSubmitIdempotency(request: EngramAccessSuggestionSubmitRequest): Promise<EngramAccessIdempotencyStatus>;
|
|
1122
1188
|
private validateWriteCandidate;
|
|
1123
1189
|
memoryGet(memoryId: string, namespace?: string, principal?: string): Promise<EngramAccessMemoryResponse>;
|
|
1190
|
+
/** Whether the coding_decision tool should appear in tools/list (rule 39). */
|
|
1191
|
+
get decisionRecordSurfaceVisible(): boolean;
|
|
1192
|
+
/**
|
|
1193
|
+
* Thin delegate — handler logic in coding/decision-surfaces.ts (#1548 PR2).
|
|
1194
|
+
* All three surfaces (MCP/HTTP/CLI) arrive here via the boundary operation.
|
|
1195
|
+
* Namespace resolution uses the SAME path as memory_store (principal ACL +
|
|
1196
|
+
* coding overlay + default fallback) so decision records land in the same
|
|
1197
|
+
* storage root.
|
|
1198
|
+
*/
|
|
1199
|
+
codingDecision(request: DecisionSurfaceRequest, authenticatedPrincipal?: string): Promise<DecisionSurfaceResponse>;
|
|
1124
1200
|
memoryBrowse(request?: EngramAccessMemoryBrowseRequest): Promise<EngramAccessMemoryBrowseResponse>;
|
|
1125
1201
|
memoryTimeline(memoryId: string, namespace?: string, limit?: number, principal?: string): Promise<EngramAccessTimelineResponse>;
|
|
1126
1202
|
entityList(options?: {
|
|
@@ -1887,4 +1963,4 @@ declare class EngramAccessService {
|
|
|
1887
1963
|
}): Promise<Awaited<ReturnType<WearablesService["transcriptMemories"]>>>;
|
|
1888
1964
|
}
|
|
1889
1965
|
|
|
1890
|
-
export { type
|
|
1966
|
+
export { type EngramAccessQmdHealthResponse as $, type EngramAccessLcmSearchResponse as A, type EngramAccessLcmStatusResponse as B, type CodingScopedWriteInput as C, type DecisionSurfaceRequest as D, type EngramAccessMemoryResponse as E, type EngramAccessMaintenanceResponse as F, type EngramAccessMemoryBrowseRequest as G, type EngramAccessMemoryBrowseResponse as H, type EngramAccessMemoryRecord as I, type EngramAccessMemoryStoreRequest as J, type EngramAccessMemorySummary as K, type EngramAccessObserveMessage as L, type EngramAccessObserveRequest as M, type EngramAccessObserveResponse as N, type EngramAccessOfflineSyncApplyFileContentRequest as O, type ProcedureStatsConfigSnapshot as P, type EngramAccessOfflineSyncApplyFileContentResponse as Q, type EngramAccessOfflineSyncApplyRequest as R, type EngramAccessOfflineSyncApplyResponse as S, type EngramAccessOfflineSyncFileContentRequest as T, type EngramAccessOfflineSyncFileContentResponse as U, type EngramAccessOfflineSyncFilesRequest as V, type EngramAccessOfflineSyncFilesResponse as W, type EngramAccessOfflineSyncSnapshotRequest as X, type EngramAccessOfflineSyncSnapshotResponse as Y, type EngramAccessOfflineSyncSnapshotStreamResponse as Z, type EngramAccessQmdCollectionState as _, type DecisionSurfaceResponse as a, type EngramAccessQualityResponse as a0, type EngramAccessRecallExplainRequest as a1, type EngramAccessRecallExplainResponse as a2, type EngramAccessRecallRequest as a3, type EngramAccessReviewDispositionRequest as a4, type EngramAccessReviewDispositionResponse as a5, type EngramAccessReviewQueueResponse as a6, type EngramAccessScopeDebug as a7, type EngramAccessSetCodingContextRequest as a8, type EngramAccessSuggestionSubmitRequest as a9, type EngramAccessTimelineResponse as aa, type EngramAccessTrustZoneBrowseRequest as ab, type EngramAccessTrustZoneBrowseResponse as ac, type EngramAccessTrustZoneDemoSeedRequest as ad, type EngramAccessTrustZoneDemoSeedResponse as ae, type EngramAccessTrustZonePromoteRequest as af, type EngramAccessTrustZonePromoteResponse as ag, type EngramAccessTrustZoneRecordSummary as ah, type EngramAccessTrustZoneStatusResponse as ai, type EngramAccessWriteEnvelope as aj, type MemoryScopePlan as ak, shapeMemorySummary as al, type EngramAccessWriteResponse as b, EngramAccessService as c, type EngramAccessRecallResponse as d, EngramAccessInputError as e, type ProcedureStatsRecent as f, type ProcedureStatsReport as g, type ProcedureStatusCounts as h, computeProcedureStats as i, formatProcedureStatsText as j, ENGRAM_ACCESS_WRITE_SCHEMA_VERSION as k, type EngramAccessActionConfidenceRequest as l, type EngramAccessActionConfidenceResponse as m, type EngramAccessBriefingRequest as n, type EngramAccessBriefingResponse as o, type EngramAccessCapsuleListResponse as p, type EngramAccessDaySummaryRequest as q, type EngramAccessEntityListResponse as r, type EngramAccessEntityResponse as s, type EngramAccessEntitySummary as t, type EngramAccessHealthResponse as u, type EngramAccessLcmCompactionFlushRequest as v, type EngramAccessLcmCompactionFlushResponse as w, type EngramAccessLcmCompactionRecordRequest as x, type EngramAccessLcmCompactionRecordResponse as y, type EngramAccessLcmSearchRequest as z };
|
package/dist/access-service.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './storage.js';
|
|
2
2
|
import './types-B1VHaf2w.js';
|
|
3
|
-
export { C as CodingScopedWriteInput,
|
|
3
|
+
export { C as CodingScopedWriteInput, k as ENGRAM_ACCESS_WRITE_SCHEMA_VERSION, l as EngramAccessActionConfidenceRequest, m as EngramAccessActionConfidenceResponse, n as EngramAccessBriefingRequest, o as EngramAccessBriefingResponse, p as EngramAccessCapsuleListResponse, q as EngramAccessDaySummaryRequest, r as EngramAccessEntityListResponse, s as EngramAccessEntityResponse, t as EngramAccessEntitySummary, u as EngramAccessHealthResponse, e as EngramAccessInputError, v as EngramAccessLcmCompactionFlushRequest, w as EngramAccessLcmCompactionFlushResponse, x as EngramAccessLcmCompactionRecordRequest, y as EngramAccessLcmCompactionRecordResponse, z as EngramAccessLcmSearchRequest, A as EngramAccessLcmSearchResponse, B as EngramAccessLcmStatusResponse, F as EngramAccessMaintenanceResponse, G as EngramAccessMemoryBrowseRequest, H as EngramAccessMemoryBrowseResponse, I as EngramAccessMemoryRecord, E as EngramAccessMemoryResponse, J as EngramAccessMemoryStoreRequest, K as EngramAccessMemorySummary, L as EngramAccessObserveMessage, M as EngramAccessObserveRequest, N as EngramAccessObserveResponse, O as EngramAccessOfflineSyncApplyFileContentRequest, Q as EngramAccessOfflineSyncApplyFileContentResponse, R as EngramAccessOfflineSyncApplyRequest, S as EngramAccessOfflineSyncApplyResponse, T as EngramAccessOfflineSyncFileContentRequest, U as EngramAccessOfflineSyncFileContentResponse, V as EngramAccessOfflineSyncFilesRequest, W as EngramAccessOfflineSyncFilesResponse, X as EngramAccessOfflineSyncSnapshotRequest, Y as EngramAccessOfflineSyncSnapshotResponse, Z as EngramAccessOfflineSyncSnapshotStreamResponse, _ as EngramAccessQmdCollectionState, $ as EngramAccessQmdHealthResponse, a0 as EngramAccessQualityResponse, a1 as EngramAccessRecallExplainRequest, a2 as EngramAccessRecallExplainResponse, a3 as EngramAccessRecallRequest, d as EngramAccessRecallResponse, a4 as EngramAccessReviewDispositionRequest, a5 as EngramAccessReviewDispositionResponse, a6 as EngramAccessReviewQueueResponse, a7 as EngramAccessScopeDebug, c as EngramAccessService, a8 as EngramAccessSetCodingContextRequest, a9 as EngramAccessSuggestionSubmitRequest, aa as EngramAccessTimelineResponse, ab as EngramAccessTrustZoneBrowseRequest, ac as EngramAccessTrustZoneBrowseResponse, ad as EngramAccessTrustZoneDemoSeedRequest, ae as EngramAccessTrustZoneDemoSeedResponse, af as EngramAccessTrustZonePromoteRequest, ag as EngramAccessTrustZonePromoteResponse, ah as EngramAccessTrustZoneRecordSummary, ai as EngramAccessTrustZoneStatusResponse, aj as EngramAccessWriteEnvelope, b as EngramAccessWriteResponse, ak as MemoryScopePlan, al as shapeMemorySummary } from './access-service-DmCHJ4cH.js';
|
|
4
4
|
import './recall-explain-renderer.js';
|
|
5
5
|
import './types-Dm5xxVrr.js';
|
|
6
6
|
import './recall-audit-anomaly.js';
|
package/dist/access-service.js
CHANGED
|
@@ -25,6 +25,7 @@ var MCP_TOOLS = [
|
|
|
25
25
|
{ tool: "memory_get", operation: "memory_get" },
|
|
26
26
|
{ tool: "memory_timeline", operation: null },
|
|
27
27
|
{ tool: "memory_store", operation: "memory_store" },
|
|
28
|
+
{ tool: "coding_decision", operation: "coding_decision" },
|
|
28
29
|
{ tool: "suggestion_submit", operation: null },
|
|
29
30
|
{ tool: "entity_get", operation: null },
|
|
30
31
|
{ tool: "review_queue_list", operation: null },
|
|
@@ -113,6 +114,7 @@ var HTTP_ROUTES = [
|
|
|
113
114
|
{ method: "POST", pathname: "/engram/v1/lcm/compaction/record", operation: null },
|
|
114
115
|
{ method: "GET", pathname: "/engram/v1/lcm/status", operation: null },
|
|
115
116
|
{ method: "POST", pathname: "/engram/v1/memories", operation: "memory_store" },
|
|
117
|
+
{ method: "POST", pathname: "/engram/v1/coding/decisions", operation: "coding_decision" },
|
|
116
118
|
{ method: "POST", pathname: "/engram/v1/suggestions", operation: null },
|
|
117
119
|
{ method: "GET", pathname: "/engram/v1/memories", operation: null },
|
|
118
120
|
{ method: "GET", pathname: "/engram/v1/memories/:id", operation: "memory_get" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/access-surface-catalog.ts"],"sourcesContent":["/**\n * Static inventory of every handler on the MCP and HTTP access surfaces, with\n * its migration status against the access boundary (issue #1525).\n *\n * The fitness test (`access-surface-catalog.test.ts`) walks this catalog,\n * checks each entry against the live registry, and counts unmigrated handlers.\n * The ratchet (`scripts/check-ratchets.mjs`) reads this file and counts\n * `operation: null` entries so the unmigrated count can only decrease.\n *\n * WHEN MIGRATING A HANDLER (follow-up PRs):\n * 1. Add the operation to `access-operations.ts` via `defineOperation`.\n * 2. Flip its entry here from `operation: null` to `operation: \"<name>\"`.\n * 3. Delete the surface-local validation the handler used to do.\n * 4. Run `node scripts/check-ratchets.mjs --update` to ratchet the count\n * down — the improvement is recorded in `scripts/ratchet-baseline.json`.\n *\n * WHEN ADDING A NEW HANDLER:\n * 1. Add the entry here with `operation: null` (the fitness test will fail\n * until you either migrate it or acknowledge it as unmigrated).\n * 2. Migrate it in the same PR if it carries user input — the boundary's\n * whole point is that no new handler bypasses it.\n */\n\nimport type { OperationName } from \"./access-boundary.js\";\n\n/**\n * One row per MCP tool, keyed by the canonical SHORT name (no `engram.`/\n * `remnic.` prefix — both aliases dispatch to the same operation). The name\n * MUST match the tool's short suffix as advertised by `tools/list`.\n */\nexport interface McpToolEntry {\n readonly tool: string;\n readonly operation: OperationName | null;\n}\n\n/**\n * One row per HTTP route that invokes an access-service method. Routes that\n * only serve static assets, SSE streams, or admin console HTML are excluded —\n * they don't carry user-validated request envelopes into the facade.\n */\nexport interface HttpRouteEntry {\n readonly method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n readonly pathname: string;\n readonly operation: OperationName | null;\n}\n\n// Each tool below corresponds 1:1 to an `engram.*` definition in\n// `EngramMcpServer.tools` (access-mcp.ts). The fitness test asserts the live\n// `tools/list` response matches this list by short name, so a new tool cannot\n// land without either migrating it or acknowledging the unmigrated count.\nexport const MCP_TOOLS: readonly McpToolEntry[] = [\n { tool: \"recall\", operation: null },\n { tool: \"recall_explain\", operation: null },\n { tool: \"set_coding_context\", operation: null },\n { tool: \"recall_tier_explain\", operation: null },\n { tool: \"recall_xray\", operation: null },\n { tool: \"wearables_status\", operation: null },\n { tool: \"wearables_sync\", operation: null },\n { tool: \"transcript_day\", operation: null },\n { tool: \"transcript_search\", operation: null },\n { tool: \"transcript_memories\", operation: null },\n { tool: \"action_confidence\", operation: null },\n { tool: \"chatgpt_memory_inspector\", operation: null },\n { tool: \"day_summary\", operation: null },\n { tool: \"capsule_export\", operation: null },\n { tool: \"capsule_import\", operation: null },\n { tool: \"capsule_list\", operation: null },\n { tool: \"memory_governance_run\", operation: null },\n { tool: \"procedure_mining_run\", operation: null },\n { tool: \"pattern_reinforcement_run\", operation: null },\n { tool: \"procedural_stats\", operation: null },\n { tool: \"memory_get\", operation: \"memory_get\" },\n { tool: \"memory_timeline\", operation: null },\n { tool: \"memory_store\", operation: \"memory_store\" },\n { tool: \"suggestion_submit\", operation: null },\n { tool: \"entity_get\", operation: null },\n { tool: \"review_queue_list\", operation: null },\n { tool: \"observe\", operation: null },\n { tool: \"lcm_search\", operation: null },\n { tool: \"lcm_compaction_flush\", operation: null },\n { tool: \"lcm_compaction_record\", operation: null },\n { tool: \"continuity_audit_generate\", operation: null },\n { tool: \"continuity_incident_open\", operation: null },\n { tool: \"continuity_incident_close\", operation: null },\n { tool: \"continuity_incident_list\", operation: null },\n { tool: \"continuity_loop_add_or_update\", operation: null },\n { tool: \"continuity_loop_review\", operation: null },\n { tool: \"identity_anchor_get\", operation: null },\n { tool: \"identity_anchor_update\", operation: null },\n { tool: \"memory_identity\", operation: null },\n { tool: \"work_task\", operation: null },\n { tool: \"work_project\", operation: null },\n { tool: \"work_board\", operation: null },\n { tool: \"shared_context_write_output\", operation: null },\n { tool: \"shared_feedback_record\", operation: null },\n { tool: \"shared_priorities_append\", operation: null },\n { tool: \"shared_context_cross_signals_run\", operation: null },\n { tool: \"shared_context_curate_daily\", operation: null },\n { tool: \"compounding_weekly_synthesize\", operation: null },\n { tool: \"compounding_promote_candidate\", operation: null },\n { tool: \"compression_guidelines_optimize\", operation: null },\n { tool: \"compression_guidelines_activate\", operation: null },\n { tool: \"memory_search\", operation: \"memory_search\" },\n { tool: \"memory_profile\", operation: null },\n { tool: \"memory_entities_list\", operation: null },\n { tool: \"memory_questions\", operation: null },\n { tool: \"memory_last_recall\", operation: null },\n { tool: \"memory_intent_debug\", operation: null },\n { tool: \"memory_qmd_debug\", operation: null },\n { tool: \"memory_graph_explain\", operation: null },\n { tool: \"graph_snapshot\", operation: null },\n { tool: \"memory_feedback\", operation: null },\n { tool: \"memory_promote\", operation: null },\n { tool: \"memory_outcome\", operation: null },\n { tool: \"memory_action_apply\", operation: null },\n { tool: \"context_checkpoint\", operation: null },\n { tool: \"briefing\", operation: null },\n { tool: \"review_list\", operation: null },\n { tool: \"review_resolve\", operation: null },\n { tool: \"contradiction_scan_run\", operation: null },\n { tool: \"memory_summarize_hourly\", operation: null },\n { tool: \"conversation_index_update\", operation: null },\n { tool: \"profiling_report\", operation: null },\n { tool: \"graph_edge_decay_run\", operation: null },\n { tool: \"live_connectors_run\", operation: null },\n { tool: \"peer_list\", operation: null },\n { tool: \"peer_get\", operation: null },\n { tool: \"peer_set\", operation: null },\n { tool: \"peer_delete\", operation: null },\n { tool: \"peer_profile_get\", operation: null },\n { tool: \"peer_forget\", operation: null },\n { tool: \"console_state\", operation: null },\n { tool: \"dreams_status\", operation: null },\n { tool: \"dreams_run\", operation: null },\n];\n\n// Each route below corresponds 1:1 to a service-invoking route branch in\n// `EngramAccessHttpServer.handle` (access-http.ts). Pathname patterns use\n// `:param` for path segments. The fitness test asserts each entry resolves\n// against the catalog so a new service route cannot land without either\n// migrating it or acknowledging the unmigrated count. Infrastructure probes\n// (health, adapters, the /mcp delegate, admin console, SSE-only endpoints)\n// carry no user request envelope and are intentionally excluded.\nexport const HTTP_ROUTES: readonly HttpRouteEntry[] = [\n { method: \"POST\", pathname: \"/engram/v1/recall\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/coding-context\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/capsules/export\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/capsules/import\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/offline-sync/snapshot\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/offline-sync/snapshot-stream\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/snapshot\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/files\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/file-content\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/apply-file-content\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/apply\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/recall/explain\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/action-confidence\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/recall/tier-explain\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/recall/xray\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/wearables/sync\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/transcript\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/transcripts/search\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/memories\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/observe\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/search\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/compaction/flush\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/compaction/record\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/lcm/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/memories\", operation: \"memory_store\" },\n { method: \"POST\", pathname: \"/engram/v1/suggestions\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/memories\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/memories/:id\", operation: \"memory_get\" },\n { method: \"GET\", pathname: \"/engram/v1/memories/:id/timeline\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/entities\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/entities/:id\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review-queue\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/maintenance\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/quality\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/trust-zones/status\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/procedural/stats\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/trust-zones/records\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/review-disposition\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/trust-zones/promote\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/trust-zones/demo-seed\", operation: null },\n { method: \"POST\", pathname: \"/v1/citations/observed\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review/contradictions\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review/contradictions/:id\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/review/resolve\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/graph/snapshot\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/contradiction-scan\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/graph/events\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/console/state\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers/:id/profile\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"PUT\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"DELETE\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/dreams/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/dreams/run\", operation: null },\n];\n\n/**\n * Total unmigrated-handler count across both surfaces. The ratchet baseline\n * tracks this number; it may only decrease. `access-surface-catalog.test.ts`\n * recomputes it from the live catalog and asserts equality, so a catalog edit\n * without a baseline bump (or, ideally, a migration) fails the gate.\n */\nexport function countUnmigratedHandlers(): number {\n let count = 0;\n for (const entry of MCP_TOOLS) {\n if (entry.operation === null) count += 1;\n }\n for (const entry of HTTP_ROUTES) {\n if (entry.operation === null) count += 1;\n }\n return count;\n}\n"],"mappings":";;;AAkDO,IAAM,YAAqC;AAAA,EAChD,EAAE,MAAM,UAAU,WAAW,KAAK;AAAA,EAClC,EAAE,MAAM,kBAAkB,WAAW,KAAK;AAAA,EAC1C,EAAE,MAAM,sBAAsB,WAAW,KAAK;AAAA,EAC9C,EAAE,MAAM,uBAAuB,WAAW,KAAK;AAAA,EAC/C,EAAE,MAAM,eAAe,WAAW,KAAK;AAAA,EACvC,EAAE,MAAM,oBAAoB,WAAW,KAAK;AAAA,EAC5C,EAAE,MAAM,kBAAk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,QAAQ,UAAU,iCAAiC,WAAW,KAAK;AAAA,EAC7E,EAAE,QAAQ,OAAO,UAAU,2BAA2B,WAAW,KAAK;AAAA,EACtE,EAAE,QAAQ,OAAO,UAAU,4BAA4B,WAAW,KAAK;AAAA,EACvE,EAAE,QAAQ,OAAO,UAAU,oBAAoB,WAAW,KAAK;AAAA,EAC/D,EAAE,QAAQ,OAAO,UAAU,gCAAgC,WAAW,KAAK;AAAA,EAC3E,EAAE,QAAQ,OAAO,UAAU,wBAAwB,WAAW,KAAK;AAAA,EACnE,EAAE,QAAQ,OAAO,UAAU,wBAAwB,WAAW,KAAK;AAAA,EACnE,EAAE,QAAQ,UAAU,UAAU,wBAAwB,WAAW,KAAK;AAAA,EACtE,EAAE,QAAQ,OAAO,UAAU,4BAA4B,WAAW,KAAK;AAAA,EACvE,EAAE,QAAQ,QAAQ,UAAU,yBAAyB,WAAW,KAAK;AACvE;AAQO,SAAS,0BAAkC;AAChD,MAAI,QAAQ;AACZ,aAAW,SAAS,WAAW;AAC7B,QAAI,MAAM,cAAc,KAAM,UAAS;AAAA,EACzC;AACA,aAAW,SAAS,aAAa;AAC/B,QAAI,MAAM,cAAc,KAAM,UAAS;AAAA,EACzC;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/access-surface-catalog.ts"],"sourcesContent":["/**\n * Static inventory of every handler on the MCP and HTTP access surfaces, with\n * its migration status against the access boundary (issue #1525).\n *\n * The fitness test (`access-surface-catalog.test.ts`) walks this catalog,\n * checks each entry against the live registry, and counts unmigrated handlers.\n * The ratchet (`scripts/check-ratchets.mjs`) reads this file and counts\n * `operation: null` entries so the unmigrated count can only decrease.\n *\n * WHEN MIGRATING A HANDLER (follow-up PRs):\n * 1. Add the operation to `access-operations.ts` via `defineOperation`.\n * 2. Flip its entry here from `operation: null` to `operation: \"<name>\"`.\n * 3. Delete the surface-local validation the handler used to do.\n * 4. Run `node scripts/check-ratchets.mjs --update` to ratchet the count\n * down — the improvement is recorded in `scripts/ratchet-baseline.json`.\n *\n * WHEN ADDING A NEW HANDLER:\n * 1. Add the entry here with `operation: null` (the fitness test will fail\n * until you either migrate it or acknowledge it as unmigrated).\n * 2. Migrate it in the same PR if it carries user input — the boundary's\n * whole point is that no new handler bypasses it.\n */\n\nimport type { OperationName } from \"./access-boundary.js\";\n\n/**\n * One row per MCP tool, keyed by the canonical SHORT name (no `engram.`/\n * `remnic.` prefix — both aliases dispatch to the same operation). The name\n * MUST match the tool's short suffix as advertised by `tools/list`.\n */\nexport interface McpToolEntry {\n readonly tool: string;\n readonly operation: OperationName | null;\n}\n\n/**\n * One row per HTTP route that invokes an access-service method. Routes that\n * only serve static assets, SSE streams, or admin console HTML are excluded —\n * they don't carry user-validated request envelopes into the facade.\n */\nexport interface HttpRouteEntry {\n readonly method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n readonly pathname: string;\n readonly operation: OperationName | null;\n}\n\n// Each tool below corresponds 1:1 to an `engram.*` definition in\n// `EngramMcpServer.tools` (access-mcp.ts). The fitness test asserts the live\n// `tools/list` response matches this list by short name, so a new tool cannot\n// land without either migrating it or acknowledging the unmigrated count.\nexport const MCP_TOOLS: readonly McpToolEntry[] = [\n { tool: \"recall\", operation: null },\n { tool: \"recall_explain\", operation: null },\n { tool: \"set_coding_context\", operation: null },\n { tool: \"recall_tier_explain\", operation: null },\n { tool: \"recall_xray\", operation: null },\n { tool: \"wearables_status\", operation: null },\n { tool: \"wearables_sync\", operation: null },\n { tool: \"transcript_day\", operation: null },\n { tool: \"transcript_search\", operation: null },\n { tool: \"transcript_memories\", operation: null },\n { tool: \"action_confidence\", operation: null },\n { tool: \"chatgpt_memory_inspector\", operation: null },\n { tool: \"day_summary\", operation: null },\n { tool: \"capsule_export\", operation: null },\n { tool: \"capsule_import\", operation: null },\n { tool: \"capsule_list\", operation: null },\n { tool: \"memory_governance_run\", operation: null },\n { tool: \"procedure_mining_run\", operation: null },\n { tool: \"pattern_reinforcement_run\", operation: null },\n { tool: \"procedural_stats\", operation: null },\n { tool: \"memory_get\", operation: \"memory_get\" },\n { tool: \"memory_timeline\", operation: null },\n { tool: \"memory_store\", operation: \"memory_store\" },\n { tool: \"coding_decision\", operation: \"coding_decision\" },\n { tool: \"suggestion_submit\", operation: null },\n { tool: \"entity_get\", operation: null },\n { tool: \"review_queue_list\", operation: null },\n { tool: \"observe\", operation: null },\n { tool: \"lcm_search\", operation: null },\n { tool: \"lcm_compaction_flush\", operation: null },\n { tool: \"lcm_compaction_record\", operation: null },\n { tool: \"continuity_audit_generate\", operation: null },\n { tool: \"continuity_incident_open\", operation: null },\n { tool: \"continuity_incident_close\", operation: null },\n { tool: \"continuity_incident_list\", operation: null },\n { tool: \"continuity_loop_add_or_update\", operation: null },\n { tool: \"continuity_loop_review\", operation: null },\n { tool: \"identity_anchor_get\", operation: null },\n { tool: \"identity_anchor_update\", operation: null },\n { tool: \"memory_identity\", operation: null },\n { tool: \"work_task\", operation: null },\n { tool: \"work_project\", operation: null },\n { tool: \"work_board\", operation: null },\n { tool: \"shared_context_write_output\", operation: null },\n { tool: \"shared_feedback_record\", operation: null },\n { tool: \"shared_priorities_append\", operation: null },\n { tool: \"shared_context_cross_signals_run\", operation: null },\n { tool: \"shared_context_curate_daily\", operation: null },\n { tool: \"compounding_weekly_synthesize\", operation: null },\n { tool: \"compounding_promote_candidate\", operation: null },\n { tool: \"compression_guidelines_optimize\", operation: null },\n { tool: \"compression_guidelines_activate\", operation: null },\n { tool: \"memory_search\", operation: \"memory_search\" },\n { tool: \"memory_profile\", operation: null },\n { tool: \"memory_entities_list\", operation: null },\n { tool: \"memory_questions\", operation: null },\n { tool: \"memory_last_recall\", operation: null },\n { tool: \"memory_intent_debug\", operation: null },\n { tool: \"memory_qmd_debug\", operation: null },\n { tool: \"memory_graph_explain\", operation: null },\n { tool: \"graph_snapshot\", operation: null },\n { tool: \"memory_feedback\", operation: null },\n { tool: \"memory_promote\", operation: null },\n { tool: \"memory_outcome\", operation: null },\n { tool: \"memory_action_apply\", operation: null },\n { tool: \"context_checkpoint\", operation: null },\n { tool: \"briefing\", operation: null },\n { tool: \"review_list\", operation: null },\n { tool: \"review_resolve\", operation: null },\n { tool: \"contradiction_scan_run\", operation: null },\n { tool: \"memory_summarize_hourly\", operation: null },\n { tool: \"conversation_index_update\", operation: null },\n { tool: \"profiling_report\", operation: null },\n { tool: \"graph_edge_decay_run\", operation: null },\n { tool: \"live_connectors_run\", operation: null },\n { tool: \"peer_list\", operation: null },\n { tool: \"peer_get\", operation: null },\n { tool: \"peer_set\", operation: null },\n { tool: \"peer_delete\", operation: null },\n { tool: \"peer_profile_get\", operation: null },\n { tool: \"peer_forget\", operation: null },\n { tool: \"console_state\", operation: null },\n { tool: \"dreams_status\", operation: null },\n { tool: \"dreams_run\", operation: null },\n];\n\n// Each route below corresponds 1:1 to a service-invoking route branch in\n// `EngramAccessHttpServer.handle` (access-http.ts). Pathname patterns use\n// `:param` for path segments. The fitness test asserts each entry resolves\n// against the catalog so a new service route cannot land without either\n// migrating it or acknowledging the unmigrated count. Infrastructure probes\n// (health, adapters, the /mcp delegate, admin console, SSE-only endpoints)\n// carry no user request envelope and are intentionally excluded.\nexport const HTTP_ROUTES: readonly HttpRouteEntry[] = [\n { method: \"POST\", pathname: \"/engram/v1/recall\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/coding-context\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/capsules/export\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/capsules/import\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/offline-sync/snapshot\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/offline-sync/snapshot-stream\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/snapshot\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/files\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/file-content\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/apply-file-content\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/offline-sync/apply\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/recall/explain\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/action-confidence\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/recall/tier-explain\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/recall/xray\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/wearables/sync\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/transcript\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/transcripts/search\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/wearables/memories\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/observe\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/search\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/compaction/flush\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/lcm/compaction/record\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/lcm/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/memories\", operation: \"memory_store\" },\n { method: \"POST\", pathname: \"/engram/v1/coding/decisions\", operation: \"coding_decision\" },\n { method: \"POST\", pathname: \"/engram/v1/suggestions\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/memories\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/memories/:id\", operation: \"memory_get\" },\n { method: \"GET\", pathname: \"/engram/v1/memories/:id/timeline\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/entities\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/entities/:id\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review-queue\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/maintenance\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/quality\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/trust-zones/status\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/procedural/stats\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/trust-zones/records\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/review-disposition\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/trust-zones/promote\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/trust-zones/demo-seed\", operation: null },\n { method: \"POST\", pathname: \"/v1/citations/observed\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review/contradictions\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/review/contradictions/:id\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/review/resolve\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/graph/snapshot\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/contradiction-scan\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/graph/events\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/console/state\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers/:id/profile\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"PUT\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"DELETE\", pathname: \"/engram/v1/peers/:id\", operation: null },\n { method: \"GET\", pathname: \"/engram/v1/dreams/status\", operation: null },\n { method: \"POST\", pathname: \"/engram/v1/dreams/run\", operation: null },\n];\n\n/**\n * Total unmigrated-handler count across both surfaces. The ratchet baseline\n * tracks this number; it may only decrease. `access-surface-catalog.test.ts`\n * recomputes it from the live catalog and asserts equality, so a catalog edit\n * without a baseline bump (or, ideally, a migration) fails the gate.\n */\nexport function countUnmigratedHandlers(): number {\n let count = 0;\n for (const entry of MCP_TOOLS) {\n if (entry.operation === null) count += 1;\n }\n for (const entry of HTTP_ROUTES) {\n if (entry.operation === null) count += 1;\n }\n return count;\n}\n"],"mappings":";;;AAkDO,IAAM,YAAqC;AAAA,EAChD,EAAE,MAAM,UAAU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
|
|
16
16
|
getOperation
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NN7QYW5W.js";
|
|
18
18
|
import {
|
|
19
19
|
EngramAccessInputError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FUCUR2OZ.js";
|
|
21
21
|
import {
|
|
22
22
|
projectTagProjectId
|
|
23
23
|
} from "./chunk-7MOTEVAA.js";
|
|
@@ -55,7 +55,8 @@ function withToolAliases(tool, emitLegacyTools = true) {
|
|
|
55
55
|
var MCP_MIGRATED_OPERATIONS = {
|
|
56
56
|
"engram.memory_get": "memory_get",
|
|
57
57
|
"engram.memory_search": "memory_search",
|
|
58
|
-
"engram.memory_store": "memory_store"
|
|
58
|
+
"engram.memory_store": "memory_store",
|
|
59
|
+
"engram.coding_decision": "coding_decision"
|
|
59
60
|
};
|
|
60
61
|
function resolveChatGptInspectorRecallSessionKey(explicitSessionKey, authenticatedPrincipal) {
|
|
61
62
|
if (explicitSessionKey) return explicitSessionKey;
|
|
@@ -194,6 +195,7 @@ var EngramMcpServer = class {
|
|
|
194
195
|
this.citationsEnabled = options.citationsEnabled === true;
|
|
195
196
|
this.citationsAutoDetect = options.citationsAutoDetect !== false;
|
|
196
197
|
this.emitLegacyTools = options.emitLegacyTools !== false;
|
|
198
|
+
this.codingDecisionVisible = options.codingDecisionVisible === true;
|
|
197
199
|
this.authenticatedPrincipal = options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0;
|
|
198
200
|
this.resources = [
|
|
199
201
|
{
|
|
@@ -1768,6 +1770,46 @@ var EngramMcpServer = class {
|
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
1770
1772
|
].flatMap((tool) => withToolAliases(tool, this.emitLegacyTools));
|
|
1773
|
+
if (this.codingDecisionVisible) {
|
|
1774
|
+
const codingDecisionTools = withToolAliases(
|
|
1775
|
+
{
|
|
1776
|
+
name: "engram.coding_decision",
|
|
1777
|
+
description: "List, get, record, or supersede decision records in the session's coding namespace (issue #1548 Track A). Subcommands: list, get, record, supersede.",
|
|
1778
|
+
inputSchema: {
|
|
1779
|
+
type: "object",
|
|
1780
|
+
properties: {
|
|
1781
|
+
subcommand: {
|
|
1782
|
+
type: "string",
|
|
1783
|
+
enum: ["list", "get", "record", "supersede"],
|
|
1784
|
+
description: "Which decision-record operation to run."
|
|
1785
|
+
},
|
|
1786
|
+
sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
|
|
1787
|
+
namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." },
|
|
1788
|
+
id: { type: "string", description: "Decision record id (required for get and supersede)." },
|
|
1789
|
+
title: { type: "string", description: "Decision title (required for record and supersede)." },
|
|
1790
|
+
status: {
|
|
1791
|
+
type: "string",
|
|
1792
|
+
enum: ["proposed", "accepted", "superseded", "rejected"],
|
|
1793
|
+
description: "Decision status (record only; defaults to proposed)."
|
|
1794
|
+
},
|
|
1795
|
+
context: { type: "string", description: "Context/background for the decision." },
|
|
1796
|
+
decision: { type: "string", description: "The decision itself (required for record and supersede)." },
|
|
1797
|
+
consequences: { type: "string", description: "Consequences of the decision." },
|
|
1798
|
+
entityRefs: {
|
|
1799
|
+
type: "array",
|
|
1800
|
+
items: { type: "string" },
|
|
1801
|
+
description: "Entity references the decision relates to."
|
|
1802
|
+
},
|
|
1803
|
+
supersedesId: { type: "string", description: "Id of the record this decision supersedes (supersede only)." }
|
|
1804
|
+
},
|
|
1805
|
+
required: ["subcommand"],
|
|
1806
|
+
additionalProperties: false
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
this.emitLegacyTools
|
|
1810
|
+
);
|
|
1811
|
+
this.tools = [...this.tools, ...codingDecisionTools];
|
|
1812
|
+
}
|
|
1771
1813
|
}
|
|
1772
1814
|
service;
|
|
1773
1815
|
buffer = Buffer.alloc(0);
|
|
@@ -1790,7 +1832,9 @@ var EngramMcpServer = class {
|
|
|
1790
1832
|
* initialize with the same JSON-RPC id concurrently.
|
|
1791
1833
|
*/
|
|
1792
1834
|
initSessionIds = /* @__PURE__ */ new Map();
|
|
1793
|
-
/**
|
|
1835
|
+
/**
|
|
1836
|
+
* Whether oai-mem-citation guidance is explicitly enabled via config.
|
|
1837
|
+
*/
|
|
1794
1838
|
citationsEnabled;
|
|
1795
1839
|
/** Whether to auto-enable citations for Codex adapter connections. */
|
|
1796
1840
|
citationsAutoDetect;
|
|
@@ -1800,6 +1844,13 @@ var EngramMcpServer = class {
|
|
|
1800
1844
|
* set false to halve the advertised `tools/list` surface.
|
|
1801
1845
|
*/
|
|
1802
1846
|
emitLegacyTools;
|
|
1847
|
+
/**
|
|
1848
|
+
* Whether the `coding_decision` tool should appear in `tools/list`. Gated on
|
|
1849
|
+
* `codingKnowledge.enabled && codingKnowledge.decisionRecords` (issue #1548
|
|
1850
|
+
* Track A PR 2, rule 39). When false the tools array is byte-identical to
|
|
1851
|
+
* pre-feature.
|
|
1852
|
+
*/
|
|
1853
|
+
codingDecisionVisible;
|
|
1803
1854
|
/** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
|
|
1804
1855
|
getClientInfo(sessionId) {
|
|
1805
1856
|
if (sessionId) {
|
|
@@ -3103,4 +3154,4 @@ ${body}`;
|
|
|
3103
3154
|
export {
|
|
3104
3155
|
EngramMcpServer
|
|
3105
3156
|
};
|
|
3106
|
-
//# sourceMappingURL=chunk-
|
|
3157
|
+
//# sourceMappingURL=chunk-473JIN2U.js.map
|