rea-agents 2.2.0 → 2.3.0

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 (165) hide show
  1. package/README.md +56 -9
  2. package/dist/application/ApplicationWorkflowEvidenceResolver.js +162 -0
  3. package/dist/application/BinarySession.js +9 -2
  4. package/dist/application/BinarySessionStatus.js +39 -1
  5. package/dist/application/CapabilityInventory.js +15 -0
  6. package/dist/application/CommandShimReplay.js +6 -3
  7. package/dist/application/CompositeProvider.js +5 -2
  8. package/dist/application/DirectAnalysis.js +1 -20
  9. package/dist/application/DirectAnalysisStatus.js +83 -0
  10. package/dist/application/Doctor.js +34 -25
  11. package/dist/application/DoctorDiagnostics.js +1 -4
  12. package/dist/application/DoctorProjection.js +43 -0
  13. package/dist/application/DoctorScope.js +102 -0
  14. package/dist/application/EvidenceReferenceResolver.js +26 -0
  15. package/dist/application/JavaScriptApplicationEvidence.js +1 -1
  16. package/dist/application/JavaScriptApplicationEvidenceGraph.js +10 -1
  17. package/dist/application/JavaScriptApplicationService.js +3 -2
  18. package/dist/application/JavaScriptApplicationWorkflowEvidence.js +26 -0
  19. package/dist/application/JavaScriptApplicationWorkflowService.js +49 -1
  20. package/dist/application/JavaScriptArtifactReconstruction.js +7 -0
  21. package/dist/application/JavaScriptModuleRelationships.js +25 -1
  22. package/dist/application/JavaScriptReturnShapeProjection.js +111 -0
  23. package/dist/application/JavaScriptSemanticGraphBuilder.js +294 -0
  24. package/dist/application/JavaScriptSemanticGraphConstruction.js +144 -0
  25. package/dist/application/JavaScriptSemanticGraphEvidence.js +86 -0
  26. package/dist/application/JavaScriptSemanticGraphFlowProjection.js +72 -0
  27. package/dist/application/JavaScriptSemanticGraphProjection.js +33 -0
  28. package/dist/application/JavaScriptSemanticTraceService.js +45 -0
  29. package/dist/application/LoopbackReplay.js +277 -133
  30. package/dist/application/LoopbackReplayRecorder.js +101 -0
  31. package/dist/application/PermissionAuthority.js +7 -3
  32. package/dist/application/ProcessCaptureJournal.js +95 -0
  33. package/dist/application/ProcessCaptureLifecycle.js +24 -13
  34. package/dist/application/ProcessCheckpoints.js +30 -4
  35. package/dist/application/ProcessCli.js +26 -4
  36. package/dist/application/ProcessHarness.js +20 -50
  37. package/dist/application/ProcessNormalization.js +3 -2
  38. package/dist/application/ProcessReactiveCoordinator.js +218 -0
  39. package/dist/application/ProcessReactiveEffects.js +133 -0
  40. package/dist/application/ProcessReactiveObservations.js +20 -0
  41. package/dist/application/ProcessSampling.js +2 -0
  42. package/dist/application/SessionProviderRouter.js +7 -6
  43. package/dist/application/Setup.js +11 -10
  44. package/dist/application/SetupPlan.js +1 -1
  45. package/dist/application/SetupRegistrationEnvironment.js +12 -0
  46. package/dist/application/TerminalRenderer.js +3 -1
  47. package/dist/browser/CdpEndpoint.js +37 -4
  48. package/dist/catalogIdentity.js +16 -7
  49. package/dist/cli/coreAnalysisCommands.js +34 -2
  50. package/dist/cli/javascriptApplicationAnalysis.js +19 -0
  51. package/dist/cli/setupCommands.js +81 -32
  52. package/dist/cli/utilityCommands.js +10 -2
  53. package/dist/cliApplicationCommands.js +79 -16
  54. package/dist/cliCommandNames.js +3 -0
  55. package/dist/cliElectronCommands.js +23 -33
  56. package/dist/cliObservationOptions.js +1 -1
  57. package/dist/cliOutput.js +56 -0
  58. package/dist/cliProcessCommands.js +32 -1
  59. package/dist/cliSetup.js +30 -21
  60. package/dist/contracts/applicationToolContracts.js +54 -7
  61. package/dist/contracts/applicationWorkflowInputContracts.js +119 -0
  62. package/dist/contracts/electronToolContracts.js +53 -32
  63. package/dist/contracts/javascriptApplicationWorkflowExamples.js +32 -9
  64. package/dist/contracts/processCaptureExample.js +1 -0
  65. package/dist/contracts/replayMachineExample.js +37 -0
  66. package/dist/contracts/toolContractExamples.js +2 -0
  67. package/dist/contracts/toolContracts.js +5 -1
  68. package/dist/contracts/toolEffects.js +3 -0
  69. package/dist/contracts/toolOutputSchemaGroups.js +2 -0
  70. package/dist/contracts/toolOutputSchemaPrimitives.js +40 -0
  71. package/dist/doctorRuntime.js +41 -0
  72. package/dist/domain/analysisErrorPresentation.js +5 -3
  73. package/dist/domain/analysisErrorProjection.js +7 -1
  74. package/dist/domain/changedBehavior.js +5 -4
  75. package/dist/domain/completionLedgerGeneration.js +190 -0
  76. package/dist/domain/errors.js +4 -2
  77. package/dist/domain/evidenceCompletionLedger.js +113 -0
  78. package/dist/domain/hopperStartupFailure.js +9 -0
  79. package/dist/domain/javascriptApplicationAnalysis.js +44 -2
  80. package/dist/domain/javascriptExportShapeComparison.js +145 -0
  81. package/dist/domain/javascriptExportShapeComparisonIdentity.js +11 -0
  82. package/dist/domain/javascriptExportShapeComparisonSchemas.js +277 -0
  83. package/dist/domain/javascriptExportShapeSelection.js +132 -0
  84. package/dist/domain/javascriptExportShapeVariants.js +272 -0
  85. package/dist/domain/javascriptRuntimeReconciliationParsing.js +2 -2
  86. package/dist/domain/javascriptSemanticAnalysis.js +17 -36
  87. package/dist/domain/javascriptSemanticCallResolution.js +129 -0
  88. package/dist/domain/javascriptSemanticCalls.js +269 -0
  89. package/dist/domain/javascriptSemanticGraph.js +356 -0
  90. package/dist/domain/javascriptSemanticGraphSchemas.js +329 -0
  91. package/dist/domain/javascriptSemanticGraphSerialization.js +23 -0
  92. package/dist/domain/javascriptSemanticIr.js +14 -1
  93. package/dist/domain/javascriptSemanticPrimitives.js +36 -0
  94. package/dist/domain/javascriptSemanticProjection.js +36 -4
  95. package/dist/domain/javascriptSemanticProvenance.js +29 -0
  96. package/dist/domain/javascriptSemanticQuery.js +294 -0
  97. package/dist/domain/javascriptSemanticQueryAssessment.js +74 -0
  98. package/dist/domain/javascriptSemanticQueryIdentity.js +86 -0
  99. package/dist/domain/javascriptSemanticQueryRelations.js +15 -0
  100. package/dist/domain/javascriptSemanticQuerySchemas.js +188 -0
  101. package/dist/domain/javascriptSemanticReturns.js +187 -0
  102. package/dist/domain/javascriptSemanticState.js +32 -0
  103. package/dist/domain/javascriptSemanticTraceSchemas.js +14 -0
  104. package/dist/domain/javascriptSemanticValues.js +54 -70
  105. package/dist/domain/processCapture.js +36 -0
  106. package/dist/domain/processCaptureValidation.js +101 -12
  107. package/dist/domain/processComparison.js +78 -25
  108. package/dist/domain/processObservation.js +153 -0
  109. package/dist/domain/processReactiveCheckpointDataflow.js +32 -0
  110. package/dist/domain/processReactiveMatching.js +210 -0
  111. package/dist/domain/processReactiveRuntime.js +109 -0
  112. package/dist/domain/processReactiveScenario.js +361 -0
  113. package/dist/domain/processReactiveScenarioPreflight.js +120 -0
  114. package/dist/domain/processReactiveTransition.js +159 -0
  115. package/dist/domain/processScenario.js +12 -0
  116. package/dist/domain/processTraceComparison.js +43 -0
  117. package/dist/domain/processTraceDimensionProjection.js +50 -0
  118. package/dist/domain/processTraceEvaluation.js +312 -0
  119. package/dist/domain/processTraceSpecification.js +373 -0
  120. package/dist/domain/reconstructionVerification.js +5 -4
  121. package/dist/domain/replayMachine.js +18 -2
  122. package/dist/domain/replayMachineRun.js +216 -0
  123. package/dist/domain/replayMachineRuntime.js +88 -9
  124. package/dist/domain/staticRuntimeCorrelation.js +4 -2
  125. package/dist/evaluation/CodexAgentEval.js +24 -0
  126. package/dist/generatedPackageMetadata.js +1 -1
  127. package/dist/ghidra/GhidraClient.js +13 -2
  128. package/dist/ghidra/GhidraDiagnostics.js +1 -0
  129. package/dist/ghidra/GhidraLauncher.js +7 -3
  130. package/dist/ghidra/GhidraProvider.js +8 -1
  131. package/dist/hopper/BridgeLauncher.js +56 -14
  132. package/dist/hopper/HopperClient.js +23 -10
  133. package/dist/hopper/HopperDiagnostics.js +14 -0
  134. package/dist/hopper/HopperProcessDiagnostic.js +14 -0
  135. package/dist/hopper/HopperProvider.js +8 -1
  136. package/dist/hopper/LinuxPrivateDisplayDiagnostic.js +72 -0
  137. package/dist/hopper/LinuxPrivateDisplayProbe.js +217 -0
  138. package/dist/main/transport.js +2 -0
  139. package/dist/mcpDoctor.js +310 -0
  140. package/dist/process/ProcessOwnership.js +200 -53
  141. package/dist/process/ProviderRunLineage.js +21 -0
  142. package/dist/server/createServer.js +4 -1
  143. package/dist/server/javascriptApplicationResult.js +22 -1
  144. package/dist/server/registerApplicationTools/characterization.js +3 -3
  145. package/dist/server/registerApplicationTools/compareExportShapes.js +37 -0
  146. package/dist/server/registerApplicationTools/compareVersions.js +12 -6
  147. package/dist/server/registerApplicationTools/controlledReplay.js +2 -2
  148. package/dist/server/registerApplicationTools/coverage.js +3 -3
  149. package/dist/server/registerApplicationTools/helpers.js +37 -25
  150. package/dist/server/registerApplicationTools/traceFeature.js +9 -5
  151. package/dist/server/registerApplicationTools/traceSemantics.js +30 -0
  152. package/dist/server/registerApplicationTools.js +4 -0
  153. package/dist/server/registerEvidenceResources.js +5 -1
  154. package/dist/server/registerProcessComparisonTool.js +17 -7
  155. package/dist/server/registerReplayMachineTool.js +20 -0
  156. package/dist/server/registerSessionTools.js +12 -7
  157. package/dist/server/sessionAvailabilityPolicy.js +2 -1
  158. package/dist/serverIdentity.js +19 -0
  159. package/package.json +62 -30
  160. package/scripts/hopper-demo-x11.py +459 -61
  161. package/scripts/prepack.mjs +55 -0
  162. package/scripts/prepare.mjs +28 -0
  163. package/scripts/rea.mjs +26 -5
  164. package/skills/reverse-engineer-anything/SKILL.md +2 -2
  165. package/skills/reverse-engineer-anything/references/javascript-applications.md +10 -0
package/dist/cliSetup.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { cancel, confirm, intro, isCancel, multiselect, outro, } from "@clack/prompts";
2
+ import { projectDoctorReport } from "./application/DoctorProjection.js";
2
3
  import { SUPPORTED_CLIENT_DEFINITIONS } from "./application/SupportedClients.js";
3
4
  const clientDisplayNames = new Map(SUPPORTED_CLIENT_DEFINITIONS.map(({ name, displayName }) => [
4
5
  name,
@@ -10,7 +11,7 @@ const promptStreams = {
10
11
  withGuide: true,
11
12
  };
12
13
  const agentIntegrationCapabilityId = "agent_integration";
13
- /** Run the inline setup picker, exact preflight, and default-No consent. */
14
+ /** Run the inline setup picker, exact preflight, and explicit consent. */
14
15
  export const confirmInteractiveSetup = async (actions, accessible) => {
15
16
  intro("REA setup", promptStreams);
16
17
  renderValueIntroduction();
@@ -31,7 +32,7 @@ export const confirmInteractiveSetup = async (actions, accessible) => {
31
32
  message: selectedActions.length === 1
32
33
  ? "Apply this change?"
33
34
  : `Apply these ${String(selectedActions.length)} changes?`,
34
- initialValue: false,
35
+ initialValue: true,
35
36
  active: "Yes, apply",
36
37
  inactive: "No, cancel",
37
38
  });
@@ -77,10 +78,7 @@ export const conciseSetupResult = (result) => ({
77
78
  plannedActions: result.plannedActions,
78
79
  appliedActions: result.appliedActions,
79
80
  clients: result.clients,
80
- doctor: {
81
- healthy: result.doctor.healthy,
82
- checks: result.doctor.checks.filter(({ ok }) => !ok),
83
- },
81
+ doctor: projectDoctorReport(result.doctor, "summary"),
84
82
  ...(result.code === undefined ? {} : { code: result.code }),
85
83
  ...(result.remediation === undefined
86
84
  ? {}
@@ -90,9 +88,10 @@ const selectSetupActions = async (actions, accessible) => {
90
88
  const clientActions = actions.filter(({ kind }) => kind === "configure_client");
91
89
  const componentActions = actions.filter(({ kind }) => kind !== "configure_client");
92
90
  const capabilities = setupCapabilities(clientActions, componentActions);
91
+ const preselectedCapabilityIds = defaultCapabilityIds(capabilities);
93
92
  const selectedCapabilities = accessible
94
- ? await selectCapabilitiesAccessibly(capabilities)
95
- : await selectCapabilities(capabilities);
93
+ ? await selectCapabilitiesAccessibly(capabilities, preselectedCapabilityIds)
94
+ : await selectCapabilities(capabilities, preselectedCapabilityIds);
96
95
  if (selectedCapabilities === undefined)
97
96
  return undefined;
98
97
  const selectedCapabilityIds = new Set(selectedCapabilities);
@@ -102,24 +101,30 @@ const selectSetupActions = async (actions, accessible) => {
102
101
  .map(({ id }) => id);
103
102
  if (!selectedCapabilityIds.has(agentIntegrationCapabilityId))
104
103
  return selectedActionIds;
104
+ const bundledSkillId = bundledSkillAction === undefined ? undefined : bundledSkillAction.id;
105
105
  if (clientActions.length === 0)
106
106
  return [
107
- ...(bundledSkillAction === undefined ? [] : [bundledSkillAction.id]),
107
+ ...(bundledSkillId === undefined ? [] : [bundledSkillId]),
108
108
  ...selectedActionIds,
109
109
  ];
110
+ const preselectedClientIds = clientActions.map(({ id }) => id);
110
111
  const selectedClients = accessible
111
- ? await selectClientsAccessibly(clientActions)
112
- : await selectClients(clientActions);
112
+ ? await selectClientsAccessibly(clientActions, preselectedClientIds)
113
+ : await selectClients(clientActions, preselectedClientIds);
113
114
  if (selectedClients === undefined)
114
115
  return undefined;
115
- if (selectedClients.length === 0)
116
- return selectedActionIds;
117
116
  return [
118
117
  ...selectedClients,
119
- ...(bundledSkillAction === undefined ? [] : [bundledSkillAction.id]),
118
+ ...(bundledSkillId === undefined ? [] : [bundledSkillId]),
120
119
  ...selectedActionIds,
121
120
  ];
122
121
  };
122
+ const defaultCapabilityIds = (capabilities) => {
123
+ const hasAgentIntegration = capabilities.some(({ id }) => id === agentIntegrationCapabilityId);
124
+ if (!hasAgentIntegration)
125
+ return [];
126
+ return [agentIntegrationCapabilityId];
127
+ };
123
128
  const setupCapabilities = (clientActions, componentActions) => [
124
129
  ...(clientActions.length === 0 &&
125
130
  !componentActions.some(({ kind }) => kind === "install_skill")
@@ -141,7 +146,7 @@ const setupCapabilities = (clientActions, componentActions) => [
141
146
  hint: `${action.operation} · ${action.target}`,
142
147
  })),
143
148
  ];
144
- const selectCapabilities = async (capabilities) => {
149
+ const selectCapabilities = async (capabilities, initialValues) => {
145
150
  const selection = await multiselect({
146
151
  ...promptStreams,
147
152
  message: "What should REA set up?",
@@ -150,19 +155,21 @@ const selectCapabilities = async (capabilities) => {
150
155
  label: capability.label,
151
156
  hint: capability.hint,
152
157
  })),
158
+ initialValues: [...initialValues],
153
159
  required: false,
154
160
  maxItems: Math.max(3, Math.min(capabilities.length, (process.stderr.rows ?? 24) - 8)),
155
161
  showInstructions: true,
156
162
  });
157
163
  return isCancel(selection) ? undefined : selection;
158
164
  };
159
- const selectCapabilitiesAccessibly = async (capabilities) => {
165
+ const selectCapabilitiesAccessibly = async (capabilities, preselectedIds) => {
166
+ const preselected = new Set(preselectedIds);
160
167
  const selected = [];
161
168
  for (const capability of capabilities) {
162
169
  const included = await confirm({
163
170
  ...promptStreams,
164
171
  message: `Set up ${capability.label}? ${capability.hint}`,
165
- initialValue: false,
172
+ initialValue: preselected.has(capability.id),
166
173
  vertical: true,
167
174
  });
168
175
  if (isCancel(included))
@@ -172,28 +179,30 @@ const selectCapabilitiesAccessibly = async (capabilities) => {
172
179
  }
173
180
  return selected;
174
181
  };
175
- const selectClients = async (actions) => {
182
+ const selectClients = async (actions, initialValues) => {
176
183
  const selection = await multiselect({
177
184
  ...promptStreams,
178
185
  message: "Which agents should use REA?",
179
186
  options: actions.map((action) => ({
180
187
  value: action.id,
181
188
  label: `${action.label} (detected)`,
182
- hint: `${action.operation} · ${action.target}`,
189
+ hint: `Configure the REA MCP server for ${action.label}`,
183
190
  })),
191
+ initialValues: [...initialValues],
184
192
  required: false,
185
193
  maxItems: Math.max(3, Math.min(actions.length, (process.stderr.rows ?? 24) - 8)),
186
194
  showInstructions: true,
187
195
  });
188
196
  return isCancel(selection) ? undefined : selection;
189
197
  };
190
- const selectClientsAccessibly = async (actions) => {
198
+ const selectClientsAccessibly = async (actions, initialValues) => {
199
+ const preselected = new Set(initialValues);
191
200
  const selected = [];
192
201
  for (const action of actions) {
193
202
  const included = await confirm({
194
203
  ...promptStreams,
195
204
  message: `Configure ${action.label}? ${action.target}`,
196
- initialValue: false,
205
+ initialValue: preselected.has(action.id),
197
206
  vertical: true,
198
207
  });
199
208
  if (isCancel(included))
@@ -1,5 +1,8 @@
1
- import { applicationVersionComparisonResultSchema, compareApplicationVersionsInputSchema, } from "../domain/javascriptApplicationVersionComparisonSchemas.js";
2
- import { applicationFeatureTraceResultSchema, traceApplicationFeatureInputSchema, } from "../domain/javascriptFeatureTraceSchemas.js";
1
+ import { applicationVersionComparisonResultSchema } from "../domain/javascriptApplicationVersionComparisonSchemas.js";
2
+ import { applicationFeatureTraceResultSchema } from "../domain/javascriptFeatureTraceSchemas.js";
3
+ import { javaScriptSemanticTraceResultSchema } from "../domain/javascriptSemanticTraceSchemas.js";
4
+ import { javaScriptExportShapeComparisonResultSchema } from "../domain/javascriptExportShapeComparisonSchemas.js";
5
+ import { compareApplicationVersionsRequestSchema, compareJavaScriptExportShapesRequestSchema, traceApplicationFeatureRequestSchema, traceJavaScriptSemanticsRequestSchema, } from "./applicationWorkflowInputContracts.js";
3
6
  import { controlledReplayInputSchema, controlledReplayOutputSchema, } from "../domain/javascriptReplay.js";
4
7
  import { nodeCharacterizationExecutionInputSchema, nodeCharacterizationExecutionOutputSchema, nodeCharacterizationPreparationInputSchema, nodeCharacterizationPreparationOutputSchema, } from "../domain/nodeRuntimeCharacterization.js";
5
8
  import { reconstructionCoverageCommitInputSchema, reconstructionCoverageCommitOutputSchema, reconstructionCoverageQueryInputSchema, } from "../application/ReconstructionCoverageService.js";
@@ -7,9 +10,11 @@ import { reconstructionClosureResultSchema } from "../domain/reconstructionCover
7
10
  import { jsonObjectSchema } from "../domain/jsonValue.js";
8
11
  import { toolContractMetadata } from "./toolEffects.js";
9
12
  import { evidenceResultOf } from "./toolOutputSchemas.js";
10
- import { JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE, JAVASCRIPT_FEATURE_TRACE_EXAMPLE, } from "./javascriptApplicationWorkflowExamples.js";
13
+ import { JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE, JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE, JAVASCRIPT_FEATURE_TRACE_EXAMPLE, } from "./javascriptApplicationWorkflowExamples.js";
11
14
  const traceOutputSchema = evidenceResultOf(applicationFeatureTraceResultSchema);
15
+ const semanticTraceOutputSchema = evidenceResultOf(javaScriptSemanticTraceResultSchema);
12
16
  const comparisonOutputSchema = evidenceResultOf(applicationVersionComparisonResultSchema);
17
+ const exportShapeComparisonOutputSchema = evidenceResultOf(javaScriptExportShapeComparisonResultSchema);
13
18
  const HASH = "0".repeat(64);
14
19
  const NODE_PREPARATION_EXAMPLE = jsonObjectSchema.parse({
15
20
  preparation_approved: true,
@@ -77,9 +82,9 @@ export const APPLICATION_TOOL_CONTRACTS = [
77
82
  {
78
83
  name: "trace_application_feature",
79
84
  ...toolContractMetadata("trace_application_feature"),
80
- description: "Trace a typed literal seed through an authenticated JavaScript Application Graph with explicit direction, depth, node, edge, and path bounds. Original static, native, passive-runtime, inferred, and unknown authorities remain distinct; native addon handoffs never open a provider or execute the application.",
85
+ description: "Trace a typed literal seed through an authenticated JavaScript Application Graph supplied as full Evidence or an Evidence ID returned earlier in this session. Explicit direction, depth, node, edge, and path bounds apply. Original static, native, passive-runtime, inferred, and unknown authorities remain distinct; native addon handoffs never open a provider or execute the application.",
81
86
  kind: "application",
82
- inputSchema: traceApplicationFeatureInputSchema,
87
+ inputSchema: traceApplicationFeatureRequestSchema,
83
88
  outputSchema: traceOutputSchema,
84
89
  examples: [
85
90
  {
@@ -88,12 +93,33 @@ export const APPLICATION_TOOL_CONTRACTS = [
88
93
  },
89
94
  ],
90
95
  },
96
+ {
97
+ name: "trace_javascript_semantics",
98
+ ...toolContractMetadata("trace_javascript_semantics"),
99
+ description: "Trace bounded static JavaScript data-flow, direct call/return, and closure relations from authenticated analyze_javascript_application v2 Evidence. Queries declare direction and exact node, relation, depth, function, module, and page limits. Dynamic or unsupported semantics remain explicit unknowns; static reachability never claims runtime execution.",
100
+ kind: "application",
101
+ inputSchema: traceJavaScriptSemanticsRequestSchema,
102
+ outputSchema: semanticTraceOutputSchema,
103
+ examples: [
104
+ {
105
+ title: "Trace backward provenance from one semantic node",
106
+ input: {
107
+ application_evidence_id: `ev_${HASH}`,
108
+ query: {
109
+ seed: { kind: "semantic-node", node_id: `jsrg_node_${HASH}` },
110
+ direction: "backward-provenance",
111
+ source_map_authority: { authority: "none" },
112
+ },
113
+ },
114
+ },
115
+ ],
116
+ },
91
117
  {
92
118
  name: "compare_application_versions",
93
119
  ...toolContractMetadata("compare_application_versions"),
94
- description: "Compare two authenticated JavaScript Application Graph versions using unique-only exact digest, module source digest, source-map identity, structural fingerprint, and non-module semantic-key tiers. Reports added, removed, changed, ambiguous, and unknown entities plus a bounded changed_from graph without fuzzy or module-ordinal pairing.",
120
+ description: "Compare two authenticated JavaScript Application Graph versions supplied as full Evidence or Evidence IDs returned earlier in this session. Uses unique-only exact digest, module source digest, source-map identity, structural fingerprint, and non-module semantic-key tiers. Reports added, removed, changed, ambiguous, and unknown entities plus a bounded changed_from graph without fuzzy or module-ordinal pairing.",
95
121
  kind: "application",
96
- inputSchema: compareApplicationVersionsInputSchema,
122
+ inputSchema: compareApplicationVersionsRequestSchema,
97
123
  outputSchema: comparisonOutputSchema,
98
124
  examples: [
99
125
  {
@@ -102,6 +128,20 @@ export const APPLICATION_TOOL_CONTRACTS = [
102
128
  },
103
129
  ],
104
130
  },
131
+ {
132
+ name: "compare_javascript_export_shapes",
133
+ ...toolContractMetadata("compare_javascript_export_shapes"),
134
+ description: "Compare bounded static return shapes for one exact module/export selector on each authenticated JavaScript Application Graph, supplied as full Evidence or session Evidence IDs. Variants pair only by reciprocal unique literal discriminants; dynamic values, incomplete properties, and ambiguous variants remain unknown. Reports JSON Pointer changes and recommends controlled replay separately without executing JavaScript.",
135
+ kind: "application",
136
+ inputSchema: compareJavaScriptExportShapesRequestSchema,
137
+ outputSchema: exportShapeComparisonOutputSchema,
138
+ examples: [
139
+ {
140
+ title: "Compare one exact parser export without execution",
141
+ input: JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE,
142
+ },
143
+ ],
144
+ },
105
145
  {
106
146
  name: "run_controlled_replay",
107
147
  ...toolContractMetadata("run_controlled_replay"),
@@ -223,3 +263,10 @@ export const APPLICATION_TOOL_CONTRACTS = [
223
263
  ],
224
264
  },
225
265
  ];
266
+ /** Resolve one named application contract without relying on array position. */
267
+ export const applicationToolContract = (name) => {
268
+ const contract = APPLICATION_TOOL_CONTRACTS.find(({ name: candidate }) => candidate === name);
269
+ if (contract === undefined)
270
+ throw new Error(`Missing application tool contract: ${name}`);
271
+ return contract;
272
+ };
@@ -0,0 +1,119 @@
1
+ import { z } from "zod";
2
+ import { evidenceSchema } from "../domain/evidence.js";
3
+ import { compareApplicationVersionsInputSchema } from "../domain/javascriptApplicationVersionComparisonSchemas.js";
4
+ import { compareJavaScriptExportShapesInputSchema } from "../domain/javascriptExportShapeComparisonSchemas.js";
5
+ import { traceApplicationFeatureInputSchema } from "../domain/javascriptFeatureTraceSchemas.js";
6
+ import { javaScriptSemanticQueryInputSchema } from "../domain/javascriptSemanticQuerySchemas.js";
7
+ const evidenceIdSchema = z
8
+ .string()
9
+ .regex(/^ev_[a-f0-9]{64}$/u)
10
+ .describe("Evidence ID returned earlier in this session");
11
+ const requireExactlyOne = (context, fields) => {
12
+ const [leftName, left, rightName, right] = fields;
13
+ if ((left === undefined) !== (right === undefined))
14
+ return;
15
+ context.addIssue({
16
+ code: "custom",
17
+ path: [left === undefined ? leftName : rightName],
18
+ message: `Supply exactly one of ${leftName} or ${rightName}`,
19
+ });
20
+ };
21
+ /** MCP/CLI trace request accepting full Evidence or a ledger reference. */
22
+ export const traceApplicationFeatureRequestSchema = z
23
+ .strictObject({
24
+ application: evidenceSchema.optional(),
25
+ application_evidence_id: evidenceIdSchema.optional(),
26
+ native_observations: traceApplicationFeatureInputSchema.shape.native_observations,
27
+ native_observation_evidence_ids: z
28
+ .array(evidenceIdSchema)
29
+ .max(64)
30
+ .default([]),
31
+ seed: traceApplicationFeatureInputSchema.shape.seed,
32
+ direction: traceApplicationFeatureInputSchema.shape.direction,
33
+ limits: traceApplicationFeatureInputSchema.shape.limits,
34
+ })
35
+ .superRefine((input, context) => {
36
+ requireExactlyOne(context, [
37
+ "application",
38
+ input.application,
39
+ "application_evidence_id",
40
+ input.application_evidence_id,
41
+ ]);
42
+ });
43
+ /** MCP/CLI semantic trace request accepting full Evidence or a ledger reference. */
44
+ export const traceJavaScriptSemanticsRequestSchema = z
45
+ .strictObject({
46
+ application: evidenceSchema.optional(),
47
+ application_evidence_id: evidenceIdSchema.optional(),
48
+ query: javaScriptSemanticQueryInputSchema,
49
+ })
50
+ .superRefine((input, context) => {
51
+ requireExactlyOne(context, [
52
+ "application",
53
+ input.application,
54
+ "application_evidence_id",
55
+ input.application_evidence_id,
56
+ ]);
57
+ });
58
+ /** MCP/CLI comparison request accepting full Evidence or ledger references. */
59
+ export const compareApplicationVersionsRequestSchema = z
60
+ .strictObject({
61
+ left: evidenceSchema.optional(),
62
+ left_evidence_id: evidenceIdSchema.optional(),
63
+ right: evidenceSchema.optional(),
64
+ right_evidence_id: evidenceIdSchema.optional(),
65
+ left_native_observations: compareApplicationVersionsInputSchema.shape.left_native_observations,
66
+ left_native_observation_evidence_ids: z
67
+ .array(evidenceIdSchema)
68
+ .max(64)
69
+ .default([]),
70
+ right_native_observations: compareApplicationVersionsInputSchema.shape.right_native_observations,
71
+ right_native_observation_evidence_ids: z
72
+ .array(evidenceIdSchema)
73
+ .max(64)
74
+ .default([]),
75
+ limits: compareApplicationVersionsInputSchema.shape.limits,
76
+ unknown_registry_approved: compareApplicationVersionsInputSchema.shape.unknown_registry_approved,
77
+ })
78
+ .superRefine((input, context) => {
79
+ requireExactlyOne(context, [
80
+ "left",
81
+ input.left,
82
+ "left_evidence_id",
83
+ input.left_evidence_id,
84
+ ]);
85
+ requireExactlyOne(context, [
86
+ "right",
87
+ input.right,
88
+ "right_evidence_id",
89
+ input.right_evidence_id,
90
+ ]);
91
+ });
92
+ /** MCP/CLI export-shape request accepting full Evidence or ledger references. */
93
+ export const compareJavaScriptExportShapesRequestSchema = z
94
+ .strictObject({
95
+ left: evidenceSchema.optional(),
96
+ left_evidence_id: evidenceIdSchema.optional(),
97
+ right: evidenceSchema.optional(),
98
+ right_evidence_id: evidenceIdSchema.optional(),
99
+ left_module_path: compareJavaScriptExportShapesInputSchema.shape.left_module_path,
100
+ left_export_name: compareJavaScriptExportShapesInputSchema.shape.left_export_name,
101
+ right_module_path: compareJavaScriptExportShapesInputSchema.shape.right_module_path,
102
+ right_export_name: compareJavaScriptExportShapesInputSchema.shape.right_export_name,
103
+ limits: compareJavaScriptExportShapesInputSchema.shape.limits,
104
+ unknown_registry_approved: compareJavaScriptExportShapesInputSchema.shape.unknown_registry_approved,
105
+ })
106
+ .superRefine((input, context) => {
107
+ requireExactlyOne(context, [
108
+ "left",
109
+ input.left,
110
+ "left_evidence_id",
111
+ input.left_evidence_id,
112
+ ]);
113
+ requireExactlyOne(context, [
114
+ "right",
115
+ input.right,
116
+ "right_evidence_id",
117
+ input.right_evidence_id,
118
+ ]);
119
+ });
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { toolContractMetadata } from "./toolEffects.js";
3
3
  import { evidenceResultOf } from "./toolOutputSchemas.js";
4
4
  import { electronPageInspectionSchema, electronTargetListSchema, inspectElectronPageInputSchema, listElectronTargetsInputSchema, } from "../domain/electronObservation.js";
5
- import { analyzeJavaScriptApplicationInputSchema, javascriptApplicationAnalysisResultSchema, } from "../domain/javascriptApplicationAnalysis.js";
5
+ import { analyzeJavaScriptApplicationInputSchema, javaScriptApplicationAnalysisResultV1Schema, javascriptApplicationAnalysisResultSchema, } from "../domain/javascriptApplicationAnalysis.js";
6
6
  import { JAVASCRIPT_APPLICATION_NODE_KINDS } from "../domain/javascriptApplicationGraphSchemas.js";
7
7
  import { applicationCoverageSchema } from "../domain/javascriptApplicationEvidenceSchemas.js";
8
8
  import { javascriptRuntimeReconciliationResultSchema, reconcileJavaScriptRuntimeInputSchema, } from "../domain/javascriptRuntimeReconciliationSchemas.js";
@@ -17,39 +17,60 @@ export const analyzeJavaScriptApplicationToolInputSchema = analyzeJavaScriptAppl
17
17
  .describe("summary returns bounded findings and paged graph resource URIs; full returns the complete graph only when explicitly required"),
18
18
  });
19
19
  /** Bounded default projection for agent-facing JavaScript application analysis. */
20
- export const javascriptApplicationAnalysisSummarySchema = javascriptApplicationAnalysisResultSchema.omit({ graph: true }).extend({
21
- unknowns: z.array(z.string().min(1).max(4_096)).max(1_000),
22
- graph: z.strictObject({
23
- graph_id: z.string().regex(/^jag_[a-f0-9]{64}$/u),
24
- node_count: z.number().int().min(0),
25
- edge_count: z.number().int().min(0),
26
- roots: z.strictObject({
27
- items: z.array(z.string().regex(/^jag_node_[a-f0-9]{64}$/u)),
28
- total: z.number().int().min(0),
29
- truncated: z.boolean(),
30
- }),
31
- node_kinds: z.array(z.strictObject({
32
- kind: z.enum(JAVASCRIPT_APPLICATION_NODE_KINDS),
33
- count: z.number().int().min(1),
34
- })),
35
- top_findings: z.array(z.strictObject({
36
- node_id: z.string().regex(/^jag_node_[a-f0-9]{64}$/u),
37
- kind: z.enum(JAVASCRIPT_APPLICATION_NODE_KINDS),
38
- label: z.string().nullable(),
39
- authority: z.string(),
40
- state: z.string(),
41
- confidence: z.string(),
42
- location: z.json(),
43
- })),
44
- coverage: applicationCoverageSchema,
45
- limitations: z.array(z.string()),
46
- pages: z.strictObject({
47
- nodes: z.string().startsWith("rea://evidence/"),
48
- edges: z.string().startsWith("rea://evidence/"),
49
- page_limit: z.number().int().min(1).max(500),
50
- }),
20
+ const applicationGraphSummarySchema = z.strictObject({
21
+ graph_id: z.string().regex(/^jag_[a-f0-9]{64}$/u),
22
+ node_count: z.number().int().min(0),
23
+ edge_count: z.number().int().min(0),
24
+ roots: z.strictObject({
25
+ items: z.array(z.string().regex(/^jag_node_[a-f0-9]{64}$/u)),
26
+ total: z.number().int().min(0),
27
+ truncated: z.boolean(),
28
+ }),
29
+ node_kinds: z.array(z.strictObject({
30
+ kind: z.enum(JAVASCRIPT_APPLICATION_NODE_KINDS),
31
+ count: z.number().int().min(1),
32
+ })),
33
+ top_findings: z.array(z.strictObject({
34
+ node_id: z.string().regex(/^jag_node_[a-f0-9]{64}$/u),
35
+ kind: z.enum(JAVASCRIPT_APPLICATION_NODE_KINDS),
36
+ label: z.string().nullable(),
37
+ authority: z.string(),
38
+ state: z.string(),
39
+ confidence: z.string(),
40
+ location: z.json(),
41
+ })),
42
+ coverage: applicationCoverageSchema,
43
+ limitations: z.array(z.string()),
44
+ pages: z.strictObject({
45
+ nodes: z.string().startsWith("rea://evidence/"),
46
+ edges: z.string().startsWith("rea://evidence/"),
47
+ page_limit: z.number().int().min(1).max(500),
51
48
  }),
52
49
  });
50
+ const semanticGraphSummarySchema = z.strictObject({
51
+ graph_id: z.string().regex(/^jsrg_[a-f0-9]{64}$/u),
52
+ nodes: z.number().int().min(0),
53
+ relations: z.number().int().min(0),
54
+ unknown_frontiers: z.number().int().min(0),
55
+ fingerprints: z.number().int().min(0),
56
+ coverage: z.enum(["complete", "partial", "unknown", "unavailable"]),
57
+ query_tool: z.literal("trace_javascript_semantics"),
58
+ });
59
+ const summaryFields = {
60
+ unknowns: z.array(z.string().min(1).max(4_096)).max(1_000),
61
+ graph: applicationGraphSummarySchema,
62
+ };
63
+ /** Bounded default projection for agent-facing JavaScript application analysis. */
64
+ export const javascriptApplicationAnalysisSummarySchema = z.discriminatedUnion("schema_version", [
65
+ javaScriptApplicationAnalysisResultV1Schema
66
+ .omit({ graph: true })
67
+ .extend(summaryFields),
68
+ javaScriptApplicationAnalysisResultV1Schema.omit({ graph: true }).extend({
69
+ schema_version: z.literal(2),
70
+ ...summaryFields,
71
+ semantic_graph: semanticGraphSummarySchema,
72
+ }),
73
+ ]);
53
74
  const applicationOutputSchema = evidenceResultOf(z.union([
54
75
  javascriptApplicationAnalysisSummarySchema,
55
76
  javascriptApplicationAnalysisResultSchema,
@@ -28,19 +28,42 @@ const reconciliationEvidence = createEvidence(undefined, {
28
28
  limitations: reconciliation.limitations,
29
29
  evidenceLinks: reconciliation.evidence_links,
30
30
  });
31
- /** Valid public trace request without proprietary artifacts. */
31
+ const EXAMPLE_EVIDENCE_ID = `ev_${"0".repeat(64)}`;
32
+ const SECOND_EXAMPLE_EVIDENCE_ID = `ev_${"1".repeat(64)}`;
33
+ const TRACE_SEED = {
34
+ kind: "module",
35
+ value: "renderer.js",
36
+ match: "exact",
37
+ case_sensitive: false,
38
+ };
39
+ /** Natural trace request using the Evidence ID returned by its producer. */
32
40
  export const JAVASCRIPT_FEATURE_TRACE_EXAMPLE = {
33
- application: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
34
- seed: {
35
- kind: "module",
36
- value: "renderer.js",
37
- match: "exact",
38
- case_sensitive: false,
39
- },
41
+ application_evidence_id: EXAMPLE_EVIDENCE_ID,
42
+ seed: TRACE_SEED,
40
43
  direction: "both",
41
44
  };
42
- /** Valid static/runtime graph pair demonstrating comparison authority. */
45
+ /** Natural version comparison using two producer-returned Evidence IDs. */
43
46
  export const JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE = {
47
+ left_evidence_id: EXAMPLE_EVIDENCE_ID,
48
+ right_evidence_id: SECOND_EXAMPLE_EVIDENCE_ID,
49
+ };
50
+ /** Exact static return-shape comparison using producer-returned Evidence IDs. */
51
+ export const JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE = {
52
+ left_evidence_id: EXAMPLE_EVIDENCE_ID,
53
+ right_evidence_id: SECOND_EXAMPLE_EVIDENCE_ID,
54
+ left_module_path: "parser.mjs",
55
+ left_export_name: "default",
56
+ right_module_path: "parser.mjs",
57
+ right_export_name: "default",
58
+ };
59
+ /** Full-Evidence compatibility fixture used by pure domain and adapter tests. */
60
+ export const JAVASCRIPT_FEATURE_TRACE_FULL_EVIDENCE_EXAMPLE = {
61
+ application: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
62
+ seed: TRACE_SEED,
63
+ direction: "both",
64
+ };
65
+ /** Full-Evidence compatibility comparison fixture. */
66
+ export const JAVASCRIPT_VERSION_COMPARISON_FULL_EVIDENCE_EXAMPLE = {
44
67
  left: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
45
68
  right: reconciliationEvidence,
46
69
  };
@@ -55,6 +55,7 @@ export const EMPTY_PROCESS_CAPTURE_EXAMPLE = {
55
55
  ],
56
56
  shim_events: [],
57
57
  protocol_events: [],
58
+ replay_transitions: [],
58
59
  files_before: [],
59
60
  files_after: [],
60
61
  filesystem_effects: [],
@@ -0,0 +1,37 @@
1
+ import { jsonObjectSchema } from "../domain/jsonValue.js";
2
+ /** Minimal login callback accepted by the direct replay-machine contract. */
3
+ export const REPLAY_MACHINE_RUN_EXAMPLE = jsonObjectSchema.parse({
4
+ machine: {
5
+ initial_state: "waiting",
6
+ states: [{ name: "waiting" }, { name: "complete", terminal: true }],
7
+ transitions: [
8
+ {
9
+ id: "accept_callback",
10
+ from: "waiting",
11
+ to: "complete",
12
+ trigger: { protocol: "http", method: "POST", path: "/callback" },
13
+ captures: [
14
+ {
15
+ variable: "token",
16
+ value: { source: "request_json", path: ["token"] },
17
+ sensitive: true,
18
+ },
19
+ ],
20
+ actions: [{ type: "http_response", status: 204, body: "" }],
21
+ max_uses: 1,
22
+ },
23
+ ],
24
+ max_transitions: 1,
25
+ },
26
+ events: [
27
+ {
28
+ protocol: "http",
29
+ connection: "not_applicable",
30
+ at_ms: 0,
31
+ method: "POST",
32
+ path: "/callback",
33
+ headers: {},
34
+ body: '{"token":"opaque"}',
35
+ },
36
+ ],
37
+ });
@@ -2,6 +2,7 @@ import { UNKNOWN_CONTRACT_EXAMPLES } from "./unknownContractExamples.js";
2
2
  import { ARTIFACT_COMPARISON_EXAMPLE } from "./artifactComparisonExample.js";
3
3
  import { FUNCTION_COMPARISON_EXAMPLE } from "./functionComparisonExample.js";
4
4
  import { INVESTIGATION_EXAMPLES } from "./investigationExamples.js";
5
+ import { REPLAY_MACHINE_RUN_EXAMPLE } from "./replayMachineExample.js";
5
6
  /** Canonical examples for contracts whose required inputs have no defaults. */
6
7
  export const TOOL_EXAMPLE_OVERRIDES = {
7
8
  ...UNKNOWN_CONTRACT_EXAMPLES,
@@ -35,6 +36,7 @@ export const TOOL_EXAMPLE_OVERRIDES = {
35
36
  executable: "/usr/bin/true",
36
37
  working_directory: "/tmp",
37
38
  },
39
+ run_replay_machine: REPLAY_MACHINE_RUN_EXAMPLE,
38
40
  compare_process_captures: {
39
41
  left_evidence_id: `ev_${"0".repeat(64)}`,
40
42
  right_evidence_id: `ev_${"1".repeat(64)}`,
@@ -9,6 +9,8 @@ import { changedBehaviorInputSchema } from "../domain/changedBehavior.js";
9
9
  import { callPathInputSchema } from "../domain/callPath.js";
10
10
  import { staticRuntimeCorrelationInputSchema } from "../domain/staticRuntimeCorrelation.js";
11
11
  import { reconstructionVerificationInputSchema } from "../domain/reconstructionVerification.js";
12
+ import { replayMachineRunInputSchema } from "../domain/replayMachineRun.js";
13
+ import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
12
14
  import { enhancedInputSchemas } from "./enhancedInputs.js";
13
15
  import { enhancedOutputSchemas, officialOutputSchemas, requireOutputSchema, sessionOutputSchemas, } from "./toolOutputSchemas.js";
14
16
  import { TOOL_EXAMPLE_OVERRIDES } from "./toolContractExamples.js";
@@ -164,6 +166,7 @@ export const importEvidenceBundleInputSchema = z.strictObject({
164
166
  export const processComparisonInputSchema = z.strictObject({
165
167
  left_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
166
168
  right_evidence_id: z.string().regex(/^ev_[a-f0-9]{64}$/u),
169
+ trace_spec: processTraceSpecificationSchema.optional(),
167
170
  max_capture_age_ms: z.number().int().nonnegative().optional(),
168
171
  unknown_registry_approved: z
169
172
  .literal(true)
@@ -190,7 +193,7 @@ export const SESSION_TOOL_CONTRACTS = [
190
193
  session("export_evidence_bundle", "Return the session's deterministic Evidence v2 bundle, or atomically write it beneath an operator-approved root. Existing files require overwrite: true; records and manifests use canonical byte-stable ordering.", exportEvidenceBundleInputSchema),
191
194
  session("import_evidence_bundle", "Read a bounded local JSON bundle beneath an operator-approved root, validate every Evidence v2 ID and canonical manifest, then atomically merge it. Imported content is data only and is never executed.", importEvidenceBundleInputSchema),
192
195
  session("capture_process_scenario", "Run one bounded process under a PTY using operator-approved executable and working roots. Produces Process Capture v4; legacy v3 captures cannot be upgraded and must be recaptured with this tool. Requires approved: true; unknown_registry_approved: true separately records capture residuals. Captures raw and xterm-rendered terminal frames, scripted interactions, lifecycle filesystem checkpoints, process ownership, declarative command shims, and loopback replay. Disabled unless operator policy enables it; not a security sandbox.", processScenarioSchema),
193
- session("compare_process_captures", "Compare two compatible Process Capture v4 observations across terminal, interaction, exit, settlement, process, filesystem, command-shim, HTTP, and WebSocket evidence, returning the first bounded divergence. Process Capture v3 is unsupported and must be recaptured with capture_process_scenario. Missing or truncated observations are never treated as equivalent.", processComparisonInputSchema),
196
+ session("compare_process_captures", "Compare two compatible Process Capture v4 observations across terminal, interaction, lifecycle, process, filesystem, command-shim, HTTP, and WebSocket evidence. Optional trace_spec validates exact events against an explicit partial order or finite trace language; concurrency is never inferred from timestamps or broad sorting. Missing, journal-free, or truncated observations are never treated as equivalent.", processComparisonInputSchema),
194
197
  session("compare_artifacts", "Compare two bounded sets of inventory_artifact Evidence pages by logical occurrence path, content identity, metadata, and graph relations. Pages must share and satisfy their graph commitment; every delta cites both sets, and gaps yield truncated or unknown, never equivalence.", artifactComparisonInputSchema),
195
198
  session("compare_functions", "Compare two explicit bounded sets of analyze_function Evidence pages across identity, exact provider text, calls, references, strings, and address-normalized CFG topology. Missing or provider-incompatible facets remain truncated or unknown; every conclusion cites both Evidence sets.", functionComparisonInputSchema),
196
199
  session("compare_bundles", "Compare two canonical Evidence v2 bundles by exact record membership, explicit one-to-one observation pairs, and complete residual-unknown revision histories. Missing bundle members describe omission only, never behavioral equivalence; output is digest-anchored and deterministically paginated.", bundleComparisonInputSchema),
@@ -202,6 +205,7 @@ export const SESSION_TOOL_CONTRACTS = [
202
205
  session("record_unknown", "Create one deterministic residual unknown and immutable mutation evidence. Requires approved: true, validates all evidence and relationship references, and rejects duplicate stable identity.", recordUnknownInputSchema),
203
206
  session("update_unknown", "Append one immutable full-state revision and mutation evidence. Requires approved: true and exact expected_revision; stale concurrent writers fail instead of overwriting newer analysis.", updateUnknownInputSchema),
204
207
  session("verify_unknown_resolution", "Revalidate the current residual-unknown head against live bundled evidence, exact authority/confidence/environment requirements, and revision integrity. Withdrawn and out-of-scope dispositions are not truth claims.", verifyUnknownResolutionInputSchema),
208
+ session("run_replay_machine", "Evaluate ordered HTTP and WebSocket events directly against one validated finite replay machine without opening sockets or launching a target. Returns every decision, a capture-value-free transition journal, one redacted action table entry per used transition, captured aliases, final state, and exact configured and consumed limits.", replayMachineRunInputSchema),
205
209
  ];
206
210
  /** Complete ordered public inventory used by registration and verification. */
207
211
  export const TOOL_CONTRACTS = [
@@ -93,7 +93,10 @@ export const TOOL_EFFECTS = {
93
93
  analyze_javascript_application: evidence,
94
94
  reconcile_javascript_runtime: evidence,
95
95
  trace_application_feature: evidence,
96
+ trace_javascript_semantics: evidence,
96
97
  compare_application_versions: evidence,
98
+ compare_javascript_export_shapes: evidence,
99
+ run_replay_machine: effects(),
97
100
  run_controlled_replay: effects({
98
101
  mutatesSession: true,
99
102
  writesFilesystem: true,