mirror of
https://github.com/morluto/rea.git
synced 2026-11-03 05:16:16 +00:00
Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures. Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation. BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
127 lines
3.8 KiB
TypeScript
127 lines
3.8 KiB
TypeScript
import { createEvidence } from "../domain/evidence.js";
|
|
import { reconcileJavaScriptRuntime } from "../domain/javascriptRuntimeReconciliation.js";
|
|
import {
|
|
JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE,
|
|
} from "./javascriptRuntimeReconciliationExample.js";
|
|
import { createHistoricalSourceGraph } from "../domain/referenceSourceGraph.js";
|
|
|
|
const reconciliation = reconcileJavaScriptRuntime(
|
|
JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE,
|
|
);
|
|
const reconciliationEvidence = createEvidence(
|
|
undefined,
|
|
{
|
|
id: "rea-javascript-runtime-reconciliation",
|
|
name: "REA JavaScript runtime reconciliation",
|
|
version: "1",
|
|
},
|
|
{
|
|
predicateType: "rea.javascript-runtime-reconciliation",
|
|
operation: "reconcile_javascript_runtime",
|
|
parameters: {
|
|
static_layers:
|
|
JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE.static_layers.map(
|
|
({ analysis }) => ({
|
|
role: "application",
|
|
evidence_id: analysis.evidence_id,
|
|
runtime_mappings: [],
|
|
}),
|
|
),
|
|
runtime_evidence_ids:
|
|
JAVASCRIPT_RUNTIME_RECONCILIATION_EXAMPLE.runtime_observations.map(
|
|
({ evidence_id: id }) => id,
|
|
),
|
|
},
|
|
result: reconciliation,
|
|
confidence: "inferred",
|
|
authority: "analyst-inference",
|
|
limitations: reconciliation.limitations,
|
|
evidenceLinks: reconciliation.evidence_links,
|
|
},
|
|
);
|
|
const TRACE_SEED = {
|
|
kind: "module" as const,
|
|
value: "renderer.js",
|
|
match: "exact" as const,
|
|
case_sensitive: false,
|
|
};
|
|
|
|
/** Natural trace request with the producer's complete Evidence inline. */
|
|
export const JAVASCRIPT_FEATURE_TRACE_EXAMPLE = {
|
|
application: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
seed: TRACE_SEED,
|
|
direction: "both" as const,
|
|
};
|
|
|
|
/** Natural version comparison with both Evidence records inline. */
|
|
export const JAVASCRIPT_APPLICATION_VERSION_COMPARISON_EXAMPLE = {
|
|
left: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
right: reconciliationEvidence,
|
|
};
|
|
|
|
/** Historical source inventory compared with inline application Evidence. */
|
|
export const SOURCE_TO_BUNDLE_COMPARISON_EXAMPLE = {
|
|
reference: createHistoricalSourceGraph({
|
|
schema: "HistoricalSourceGraph",
|
|
authority: "historical-reference",
|
|
root_alias: "$REFERENCE_ROOT",
|
|
inventory_state: "complete",
|
|
entries: [
|
|
{
|
|
path: "src",
|
|
kind: "directory",
|
|
classifications: ["source"],
|
|
tree_state: "enumerated",
|
|
limitations: [],
|
|
},
|
|
{
|
|
path: "src/main.ts",
|
|
kind: "file",
|
|
sha256: "2".repeat(64),
|
|
size: 128,
|
|
language: "TypeScript",
|
|
classifications: ["source"],
|
|
content_state: "hashed",
|
|
limitations: [],
|
|
},
|
|
],
|
|
relationships: [],
|
|
parse_failures: [],
|
|
exclusions: [],
|
|
languages: ["TypeScript"],
|
|
manifests: [],
|
|
vcs: { kind: "none", head: null, dirty: null },
|
|
provenance: {
|
|
importer: "rea",
|
|
importer_version: "1",
|
|
caller: "contract-example",
|
|
},
|
|
limitations: [],
|
|
}),
|
|
application: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
};
|
|
|
|
/** Exact static return-shape comparison with both Evidence records inline. */
|
|
export const JAVASCRIPT_EXPORT_SHAPE_COMPARISON_EXAMPLE = {
|
|
left: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
right: reconciliationEvidence,
|
|
left_module_path: "parser.mjs",
|
|
left_export_name: "default",
|
|
right_module_path: "parser.mjs",
|
|
right_export_name: "default",
|
|
};
|
|
|
|
/** Full-Evidence compatibility fixture used by pure domain and adapter tests. */
|
|
export const JAVASCRIPT_FEATURE_TRACE_FULL_EVIDENCE_EXAMPLE = {
|
|
application: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
seed: TRACE_SEED,
|
|
direction: "both" as const,
|
|
};
|
|
|
|
/** Full-Evidence compatibility comparison fixture. */
|
|
export const JAVASCRIPT_VERSION_COMPARISON_FULL_EVIDENCE_EXAMPLE = {
|
|
left: JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE,
|
|
right: reconciliationEvidence,
|
|
};
|