refactor(process): separate capture implementation from analyst workflows (#988)
* refactor(process): separate capture implementation from analyst workflows * fix(ci): generate source catalog before shard tests
This commit is contained in:
parent
5b172b1042
commit
6aa9afb549
|
|
@ -102,6 +102,8 @@ jobs:
|
|||
with:
|
||||
name: rea-dist
|
||||
path: dist
|
||||
- name: Generate source catalog from downloaded build
|
||||
run: node scripts/generate-mcp-tool-catalog.mjs
|
||||
- run: npm run test:ci:shard:run -- --shard=${{ matrix.shard }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
|
|
@ -314,6 +316,8 @@ jobs:
|
|||
run: npm run test:focused -- tests/boundary/cli/nativePlistCli.test.ts tests/boundary/cli/nativePlistPrototypeKeyCli.test.ts tests/boundary/cli/nativePlistSelectionFailureCli.test.ts
|
||||
- name: Native Swift demangling CLI and MCP regressions
|
||||
run: npm run test:focused -- tests/boundary/cli/nativeDemangleCli.test.ts tests/boundary/mcp/nativeDemangleMcp.test.ts
|
||||
- name: Process filesystem snapshot descriptor regressions
|
||||
run: npm run test:focused -- src/process/capture/FilesystemSnapshot.test.ts
|
||||
|
||||
reconstruction-readiness:
|
||||
name: Reconstruction readiness
|
||||
|
|
|
|||
|
|
@ -425,3 +425,29 @@ native-value verifier locations are retained until their own proof lanes migrate
|
|||
interactive macOS UI success and real dependency tracing require their respective
|
||||
host/engine workflows. Portable source fixtures and injected call-route tests
|
||||
establish their narrower boundaries, without expanding provider/platform support.
|
||||
|
||||
## Process capture and analyst workflow ownership
|
||||
|
||||
`src/domain/process/` owns scenario/capture validation, portable process trees,
|
||||
trace specifications, observations, comparisons and the canonical process Evidence
|
||||
identity. The standalone contract example lives in `src/contracts/process/`;
|
||||
shared session contracts retain their broader investigation owner.
|
||||
|
||||
`src/process/capture/` owns the actual PTY boundary, terminal rendering, sampling,
|
||||
selected child environment, filesystem snapshots/effects, runtime path admission,
|
||||
event journal, settlement and resource cleanup. It reuses `src/process/` ownership
|
||||
primitives and the Windows host substrate. Its identity import follows the
|
||||
existing pure declaration directly. A source guard rejects outward application,
|
||||
composition and caller imports; no new provider or lifecycle interface is added.
|
||||
|
||||
`src/application/process/` retains Evidence projection and file-backed CLI
|
||||
capture/comparison workflows. Capture helper tests use the forked adapter lane;
|
||||
Evidence/host integration tests use the serial process-boundary lane. Their
|
||||
fixtures and assertions remain unchanged. Installed capability-probe URLs follow
|
||||
the new compiled adapter path, including the optional-dependency failure probe.
|
||||
|
||||
Windows PTY capture retains its existing unavailable outcome because descendant
|
||||
cleanup is not yet verified. Native Job Objects and a PTY binary do not establish
|
||||
that capture workflow. Real POSIX capture/cleanup and installed terminal/PTY module
|
||||
resolution require their actual host and package lanes; portable comparison
|
||||
fixtures establish their separate evidence semantics.
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ names remain unchanged.
|
|||
The existing Apple CI job also runs the host Swift-demangling CLI/MCP regression
|
||||
suites, including option-like symbols, carriage returns and multiline rejection.
|
||||
|
||||
Process semantics/tests live in `src/domain/process/`; PTY capture implementation
|
||||
and forked helper tests live in `src/process/capture/`. Evidence projection and
|
||||
file workflows live in `src/application/process/`; producer-backed Evidence/host
|
||||
cases run in the serial `tests/boundary/process/` lane. Installed-package probes
|
||||
load the compiled capture capability owner, including the missing-optional-module
|
||||
case. Real capture tests preserve actual descendant and cleanup checks.
|
||||
The existing Apple job also exercises the relocated filesystem snapshot identity,
|
||||
cancellation and descriptor cleanup regressions on macOS.
|
||||
|
||||
MCP SDK transport tests with recording providers remain integration tests.
|
||||
They are useful for schema drift and failure projection but do not prove that
|
||||
Hopper, Ghidra or another substituted engine works. `verify:package` proves
|
||||
|
|
|
|||
|
|
@ -68,12 +68,12 @@ harm_rank,location,trigger,current_copy,user_risk,proposed_replacement,implement
|
|||
58,src/application/SetupHost.ts:unsupported Node,Runtime version cannot run setup,"Install Node.js 22.x (>=22.19), 24.x (>=24.11), or 26+ and rerun setup.",Low risk; exact dependency and retry,Keep current copy,unchanged,verified by setup host tests
|
||||
59,src/application/Setup.ts:unsupported macOS,macOS version is missing or older than 12,Upgrade to macOS 12 or newer.,Low risk; exact support floor,Keep current copy,unchanged,verified by setup host tests
|
||||
60,src/application/Setup.ts:unsupported Linux,Linux distribution is outside supported set,"REA supports Hopper on Ubuntu 24.04+, Fedora 41+, 64-bit Arch Linux, and CachyOS.",Low risk; exact supported alternatives,Keep current copy,unchanged,verified by setup unit test
|
||||
61,src/application/ProcessCli.ts:readJson read,Process scenario or evidence file cannot be read,Raw filesystem exception through CLI framework,Can expose local paths/codes and no recovery,"Process input file could not be read. Check that the path exists and is readable.",implemented,verified by focused CLI test
|
||||
62,src/application/ProcessCli.ts:readJson size,Process scenario or evidence file exceeds 64 MiB,Process JSON input exceeds byte limit,Does not state limit or recovery,"Process input file is too large. Reduce it below 64 MiB, then try again.",implemented,verified by focused sparse-file CLI test
|
||||
63,src/application/ProcessCli.ts:readJson parse,Process scenario or evidence file is malformed JSON,Raw JSON parser exception through CLI framework,Can expose parser implementation and lacks recovery,"Process input file is not valid JSON. Repair the file, then try again.",implemented,verified by focused CLI test
|
||||
64,src/application/ProcessCli.ts:capture scenario parse,Scenario fails Process Capture schema,Raw Zod validation exception through CLI framework,Exposes schema internals and field paths without stable recovery,"Process scenario is invalid. Check its required fields and limits, then try again.",implemented,verified by focused CLI test
|
||||
66,src/application/ProcessCli.ts:wrong evidence,Comparison receives valid Evidence from another workflow,Expected REA process capture Evidence,Uses internal schema name and does not explain recovery,"Capture evidence is not from the current process-capture workflow. Create new capture evidence, then try again.",implemented,verified by focused CLI test
|
||||
67,src/application/ProcessCli.ts:unexpected,Unexpected parser/comparison/canonicalization failure escapes expected classifications,Raw thrown exception through CLI framework,Can expose stack or internal invariant,"Process command could not complete. Check the input files and run `rea doctor`, then try again.",implemented,verified by direct unexpected-cause projection test
|
||||
61,src/application/process/ProcessCli.ts:readJson read,Process scenario or evidence file cannot be read,Raw filesystem exception through CLI framework,Can expose local paths/codes and no recovery,"Process input file could not be read. Check that the path exists and is readable.",implemented,verified by focused CLI test
|
||||
62,src/application/process/ProcessCli.ts:readJson size,Process scenario or evidence file exceeds 64 MiB,Process JSON input exceeds byte limit,Does not state limit or recovery,"Process input file is too large. Reduce it below 64 MiB, then try again.",implemented,verified by focused sparse-file CLI test
|
||||
63,src/application/process/ProcessCli.ts:readJson parse,Process scenario or evidence file is malformed JSON,Raw JSON parser exception through CLI framework,Can expose parser implementation and lacks recovery,"Process input file is not valid JSON. Repair the file, then try again.",implemented,verified by focused CLI test
|
||||
64,src/application/process/ProcessCli.ts:capture scenario parse,Scenario fails Process Capture schema,Raw Zod validation exception through CLI framework,Exposes schema internals and field paths without stable recovery,"Process scenario is invalid. Check its required fields and limits, then try again.",implemented,verified by focused CLI test
|
||||
66,src/application/process/ProcessCli.ts:wrong evidence,Comparison receives valid Evidence from another workflow,Expected REA process capture Evidence,Uses internal schema name and does not explain recovery,"Capture evidence is not from the current process-capture workflow. Create new capture evidence, then try again.",implemented,verified by focused CLI test
|
||||
67,src/application/process/ProcessCli.ts:unexpected,Unexpected parser/comparison/canonicalization failure escapes expected classifications,Raw thrown exception through CLI framework,Can expose stack or internal invariant,"Process command could not complete. Check the input files and run `rea doctor`, then try again.",implemented,verified by direct unexpected-cause projection test
|
||||
68,src/server/registerEvidenceTools.ts:object guard,Validated provider-tool input is unexpectedly not an object,Provider tool input was not an object,Exposes provider architecture and implies caller can fix impossible state,Remove the impossible duplicate guard and parse through the declared JSON-object schema.,removed,verified by typecheck and MCP integration tests
|
||||
69,src/server/registerEnhancedTools.ts:object guard,Validated enhanced-tool input is unexpectedly not an object,Validated enhanced input was not a JSON object,Exposes validation/JSON implementation detail,Remove the impossible duplicate guard and parse through the declared JSON-object schema.,removed,verified by typecheck and enhanced MCP integration tests
|
||||
70,src/server/registerOfficialTools.ts:object guard,Validated direct-tool input is unexpectedly not an object,Validated MCP tool input was not a JSON object,Exposes MCP validation implementation detail,Remove the impossible duplicate guard and parse through the declared JSON-object schema.,removed,verified by typecheck and official MCP integration tests
|
||||
|
|
|
|||
|
Can't render this file because it has a wrong number of fields in line 35.
|
|
|
@ -75,7 +75,7 @@ const SOURCE_PATHS = {
|
|||
evidenceBundle: "dist/domain/evidenceBundle.js",
|
||||
evidenceCompletion: "dist/domain/evidenceCompletionLedger.js",
|
||||
completionGeneration: "dist/domain/completionLedgerGeneration.js",
|
||||
processCapture: "dist/domain/processCapture.js",
|
||||
processCapture: "dist/domain/process/processCapture.js",
|
||||
analysisSnapshot: "dist/domain/analysisSnapshot.js",
|
||||
artifactGraph: "dist/domain/artifactGraph.js",
|
||||
browserObservation: "dist/domain/browserObservation.js",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export interface ModuleBoundaryViolation {
|
|||
readonly target: string;
|
||||
readonly boundary:
|
||||
| "artifact-acquisition"
|
||||
| "process-capture"
|
||||
| "pure-layer"
|
||||
| "application-composition"
|
||||
| "provider-construction"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,14 @@ const failedBoundary = (file, target) => {
|
|||
if (!file.startsWith("src/") || !target.startsWith("src/")) return undefined;
|
||||
const layer = file.split("/")[1];
|
||||
const targetLayer = target.split("/")[1];
|
||||
if (
|
||||
file.startsWith("src/process/capture/") &&
|
||||
(["application", "composition", "server", "cli", "main"].includes(
|
||||
targetLayer,
|
||||
) ||
|
||||
/^src\/(?:cli|main)\./u.test(target))
|
||||
)
|
||||
return "process-capture";
|
||||
if (
|
||||
file.startsWith("src/application/javascript/") &&
|
||||
/^src\/artifacts\/(?:Asar|Directory)ArtifactReader\.(?:js|ts)$/u.test(
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export async function verifyPackageInstall({
|
|||
const processCaptureCapabilityUrl = pathToFileURL(
|
||||
join(
|
||||
prefix,
|
||||
"lib/node_modules/rea-agents/dist/application/ProcessCaptureCapability.js",
|
||||
"lib/node_modules/rea-agents/dist/process/capture/ProcessCaptureCapability.js",
|
||||
),
|
||||
).href;
|
||||
const processCaptureCapability = json(
|
||||
|
|
@ -77,7 +77,7 @@ export async function verifyPackageInstall({
|
|||
const noOptionalCapabilityUrl = pathToFileURL(
|
||||
join(
|
||||
noOptionalPrefix,
|
||||
"lib/node_modules/rea-agents/dist/application/ProcessCaptureCapability.js",
|
||||
"lib/node_modules/rea-agents/dist/process/capture/ProcessCaptureCapability.js",
|
||||
),
|
||||
).href;
|
||||
const noOptionalCapability = json(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
EvidenceIntegrityError,
|
||||
} from "../domain/evidenceErrors.js";
|
||||
import { err, ok, type Result } from "../domain/result.js";
|
||||
import { parseProcessCapture } from "../domain/processCapture.js";
|
||||
import { parseProcessCapture } from "../domain/process/processCapture.js";
|
||||
import { readJsonFile, writeTextFile } from "./JsonFiles.js";
|
||||
|
||||
type EvidenceReadFailure = EvidenceFileError | EvidenceIntegrityError;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
parseEvidenceBundle,
|
||||
type EvidenceBundle,
|
||||
} from "../domain/evidenceBundle.js";
|
||||
import { parseProcessCapture } from "../domain/processCapture.js";
|
||||
import { parseProcessCapture } from "../domain/process/processCapture.js";
|
||||
import type {
|
||||
ReconstructionObligation,
|
||||
ReviewedReconstructionObligation,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PROCESS_PROVIDER } from "./ProcessEvidence.js";
|
||||
import { PROCESS_PROVIDER } from "./process/ProcessEvidence.js";
|
||||
import {
|
||||
buildReconstructionObligationLedgerEvidenceValidated,
|
||||
resolveReconstructionObligationLedgerRequest,
|
||||
} from "./ReconstructionObligationLedgerService.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/processCapture.fixture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/process/processCapture.fixture.js";
|
||||
import { createEvidence, type Evidence } from "../domain/evidence.js";
|
||||
import { createEvidenceBundle } from "../domain/evidenceBundle.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { processCaptureSchema } from "../domain/processCapture.js";
|
||||
import { processCaptureSchema } from "../domain/process/processCapture.js";
|
||||
import {
|
||||
reconstructionObligationLedgerSchema,
|
||||
type ReconstructionObligationLedgerInput,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PROCESS_PROVIDER } from "./ProcessEvidence.js";
|
||||
import { PROCESS_PROVIDER } from "./process/ProcessEvidence.js";
|
||||
import {
|
||||
buildReconstructionObligationLedgerEvidenceValidated,
|
||||
resolveReconstructionObligationLedgerRequest,
|
||||
} from "./ReconstructionObligationLedgerService.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/processCapture.fixture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/process/processCapture.fixture.js";
|
||||
import { createEvidence, type Evidence } from "../domain/evidence.js";
|
||||
import { createEvidenceBundle } from "../domain/evidenceBundle.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { processCaptureSchema } from "../domain/processCapture.js";
|
||||
import { processCaptureSchema } from "../domain/process/processCapture.js";
|
||||
import {
|
||||
reconstructionObligationLedgerSchema,
|
||||
type ReconstructionObligationLedgerInput,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
import {
|
||||
probeProcessCaptureCapability,
|
||||
type ProcessCaptureCapability,
|
||||
} from "./ProcessCaptureCapability.js";
|
||||
} from "../process/capture/ProcessCaptureCapability.js";
|
||||
|
||||
/** One named Windows host observation without inferred authority. */
|
||||
export type WindowsCapabilityOutcome =
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import { readFile } from "node:fs/promises";
|
||||
|
||||
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import { AnalysisInputError } from "../domain/analysisErrorCore.js";
|
||||
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
||||
import { createEvidence, parseEvidence } from "../domain/evidence.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { projectInputIssues } from "../domain/inputIssueProjection.js";
|
||||
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
||||
import { processScenarioSchema } from "../domain/processScenario.js";
|
||||
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
||||
import { AnalysisInputError } from "../../domain/analysisErrorCore.js";
|
||||
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
||||
import { createEvidence, parseEvidence } from "../../domain/evidence.js";
|
||||
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
||||
import { projectInputIssues } from "../../domain/inputIssueProjection.js";
|
||||
import { processTraceSpecificationSchema } from "../../domain/process/processTraceComparison.js";
|
||||
import { processScenarioSchema } from "../../domain/process/processScenario.js";
|
||||
import {
|
||||
compareProcessCaptures,
|
||||
parseProcessCapture,
|
||||
} from "../domain/processCapture.js";
|
||||
import { captureProcessScenario } from "./ProcessHarness.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import { captureProcessScenario } from "../../process/capture/ProcessHarness.js";
|
||||
import {
|
||||
PROCESS_PROVIDER,
|
||||
createProcessCaptureEvidence,
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import type { JsonValue } from "../domain/jsonValue.js";
|
||||
import { createEvidence } from "../domain/evidence.js";
|
||||
import { PROCESS_PROVIDER } from "../domain/processEvidenceProvider.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import type { JsonValue } from "../../domain/jsonValue.js";
|
||||
import { createEvidence } from "../../domain/evidence.js";
|
||||
import { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
||||
import { jsonValueSchema } from "../../domain/jsonValue.js";
|
||||
import type {
|
||||
ProcessCapture,
|
||||
ProcessScenario,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
|
||||
export { PROCESS_PROVIDER } from "../domain/processEvidenceProvider.js";
|
||||
export { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
||||
|
||||
/** Project one process scenario into secret-free Evidence parameters. */
|
||||
const processEvidenceParameters = (
|
||||
|
|
@ -4,7 +4,7 @@ import {
|
|||
captureProcessScenarioFile,
|
||||
compareProcessEvidenceFiles,
|
||||
isProcessCliFailure,
|
||||
} from "../application/ProcessCli.js";
|
||||
} from "../application/process/ProcessCli.js";
|
||||
import { logCliCommand } from "../cliLogging.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { CLI_COMMANDS } from "../cliCommandNames.js";
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import { describe, expect, it } from "vitest";
|
|||
|
||||
import { createCli } from "./cli.js";
|
||||
import { createSystemDoctorHost } from "./doctorRuntime.js";
|
||||
import { captureProcessScenarioFile } from "./application/ProcessCli.js";
|
||||
import { captureProcessScenarioFile } from "./application/process/ProcessCli.js";
|
||||
import { runCapabilityStatus } from "./composition/directAnalysis.js";
|
||||
import { probeProcessCaptureCapability } from "./application/ProcessHarness.js";
|
||||
import { probeProcessCaptureCapability } from "./process/capture/ProcessHarness.js";
|
||||
import { parseEvidence } from "./domain/evidence.js";
|
||||
import { parseProcessCapture } from "./domain/processCapture.js";
|
||||
import { parseProcessCapture } from "./domain/process/processCapture.js";
|
||||
|
||||
describe("the CLI takes its environment as an input", () => {
|
||||
it("builds from an explicitly supplied environment", () => {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
type UninstallHost,
|
||||
} from "./application/Uninstall.js";
|
||||
import { CLI_COMMANDS } from "./cliCommandNames.js";
|
||||
import { isProcessCliFailure } from "./application/ProcessCli.js";
|
||||
import { isProcessCliFailure } from "./application/process/ProcessCli.js";
|
||||
|
||||
describe("CLI operation status classification", () => {
|
||||
it.each([
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
|
|||
import {
|
||||
compareProcessCaptures,
|
||||
parseProcessCapture,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../domain/process/processCapture.js";
|
||||
import { FUNCTION_COMPARISON_EXAMPLE } from "./functionComparisonExample.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./process/processCaptureExample.js";
|
||||
|
||||
const comparison = compareFunctions(
|
||||
FUNCTION_COMPARISON_EXAMPLE.left,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
/** Minimal valid process capture retained as a public contract example. */
|
||||
export { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../domain/process/processCaptureExample.js";
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
/** Minimal valid process capture retained as a public contract example. */
|
||||
export { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/processCaptureExample.js";
|
||||
|
|
@ -6,8 +6,8 @@ import { callPathInputSchema } from "../domain/callPath.js";
|
|||
import { changedBehaviorInputSchema } from "../domain/changedBehavior.js";
|
||||
import { functionComparisonInputSchema } from "../domain/functionComparison.js";
|
||||
import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { processScenarioSchema } from "../domain/processCapture.js";
|
||||
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
||||
import { processScenarioSchema } from "../domain/process/processCapture.js";
|
||||
import { processTraceSpecificationSchema } from "../domain/process/processTraceComparison.js";
|
||||
import { recordUnknownInputSchema } from "../domain/residualUnknown.js";
|
||||
import { reconstructionVerificationInputSchema } from "../domain/reconstructionVerification.js";
|
||||
import { staticRuntimeCorrelationInputSchema } from "../domain/staticRuntimeCorrelation.js";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { evidenceBundleSchema } from "../domain/evidenceBundle.js";
|
|||
import {
|
||||
processCaptureComparisonSchema,
|
||||
processCaptureSchema,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../domain/process/processCapture.js";
|
||||
import {
|
||||
functionInstructionWindowSchema,
|
||||
referenceKindSchema,
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ import { functionComparisonResultSchema } from "./functionComparison.js";
|
|||
import {
|
||||
PROCESS_PROVIDER,
|
||||
isProcessEvidenceProvider,
|
||||
} from "./processEvidenceProvider.js";
|
||||
} from "./process/processEvidenceProvider.js";
|
||||
import {
|
||||
comparisonStatusSchema,
|
||||
deriveProcessComparisonStatus,
|
||||
PROCESS_COMPARISON_DIMENSIONS,
|
||||
processCaptureComparisonSchema,
|
||||
} from "./processCapture.js";
|
||||
} from "./process/processCapture.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
|
||||
const evidenceIdSchema = prefixedDigestSchema("ev");
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
|
|||
import { z } from "zod";
|
||||
|
||||
import { projectInputIssues } from "./inputIssueProjection.js";
|
||||
import { processScenarioSchema } from "./processScenario.js";
|
||||
import { processScenarioSchema } from "./process/processScenario.js";
|
||||
|
||||
describe("input issue projection", () => {
|
||||
it("preserves static regex guidance without echoing the rejected value", () => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from "zod";
|
||||
import { jsonValueSchema } from "./jsonValue.js";
|
||||
import { jsonValueSchema } from "../jsonValue.js";
|
||||
|
||||
import { normalizationSchema } from "./processScenario.js";
|
||||
import { collectProcessCaptureIssues } from "./processCaptureValidation.js";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import type { JsonValue } from "./jsonValue.js";
|
||||
import type { JsonValue } from "../jsonValue.js";
|
||||
import { digestProcessCommitment } from "./processCapture.js";
|
||||
|
||||
const normalization = {
|
||||
|
|
@ -2,7 +2,7 @@ import canonicalize from "canonicalize";
|
|||
import { z } from "zod";
|
||||
|
||||
import type { ProcessCapture } from "./processCapture.js";
|
||||
import { jsonValueSchema } from "./jsonValue.js";
|
||||
import { jsonValueSchema } from "../jsonValue.js";
|
||||
import {
|
||||
compareProcessTraces,
|
||||
processTraceOutcomesDiffer,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import type { EvidenceProvider } from "./evidence.js";
|
||||
import type { EvidenceProvider } from "../evidence.js";
|
||||
|
||||
/** Canonical provider identity for controlled process capture Evidence. */
|
||||
export const PROCESS_PROVIDER = {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from "zod";
|
||||
|
||||
import { jsonValueSchema, type JsonValue } from "./jsonValue.js";
|
||||
import { jsonValueSchema, type JsonValue } from "../jsonValue.js";
|
||||
import type { UnverifiedProcessCapture } from "./processCapture.js";
|
||||
|
||||
/** Process-capture observation families shared by live drivers and trace assertions. */
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from "zod";
|
||||
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
import type { JsonValue } from "../jsonValue.js";
|
||||
import type { ProcessCapture } from "./processCapture.js";
|
||||
import {
|
||||
processObservationLocationSchema,
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import canonicalize from "canonicalize";
|
||||
import { z } from "zod";
|
||||
|
||||
import { jsonValueSchema } from "./jsonValue.js";
|
||||
import { jsonValueSchema } from "../jsonValue.js";
|
||||
import {
|
||||
comparableProcessObservationPayload,
|
||||
processObservationSourceSchema,
|
||||
|
|
@ -7,7 +7,7 @@ import {
|
|||
verifyReconstruction,
|
||||
} from "./reconstructionVerification.js";
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCapture.fixture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./process/processCapture.fixture.js";
|
||||
import { reconstructionSpecificationSchema } from "./reconstructionVerificationSchemas.js";
|
||||
import { ARTIFACT_COMPARISON_EXAMPLE } from "../contracts/artifactComparisonExample.js";
|
||||
import { createResidualUnknown } from "./residualUnknown.js";
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import { functionComparisonResultSchema } from "./functionComparison.js";
|
|||
import {
|
||||
PROCESS_PROVIDER,
|
||||
isProcessEvidenceProvider,
|
||||
} from "./processEvidenceProvider.js";
|
||||
} from "./process/processEvidenceProvider.js";
|
||||
import { functionDossierSchema } from "./hopperValues.js";
|
||||
import {
|
||||
deriveProcessComparisonStatus,
|
||||
PROCESS_COMPARISON_DIMENSIONS,
|
||||
processCaptureComparisonSchema,
|
||||
processCaptureSchema,
|
||||
} from "./processCapture.js";
|
||||
} from "./process/processCapture.js";
|
||||
import {
|
||||
reconstructionClaimResultSchema,
|
||||
reconstructionSpecificationSchema,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from "zod";
|
||||
import { digestSchema } from "./../domain/digests.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
import { PROCESS_COMPARISON_DIMENSIONS } from "./processComparison.js";
|
||||
import { PROCESS_COMPARISON_DIMENSIONS } from "./process/processComparison.js";
|
||||
|
||||
const evidenceIdSchema = prefixedDigestSchema("ev");
|
||||
const unknownIdSchema = prefixedDigestSchema("unk");
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ import { functionComparisonResultSchema } from "./functionComparison.js";
|
|||
import {
|
||||
PROCESS_PROVIDER,
|
||||
isProcessEvidenceProvider,
|
||||
} from "./processEvidenceProvider.js";
|
||||
} from "./process/processEvidenceProvider.js";
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
import {
|
||||
comparisonStatusSchema,
|
||||
processCaptureComparisonSchema,
|
||||
} from "./processCapture.js";
|
||||
import { PROCESS_COMPARISON_DIMENSIONS } from "./processComparison.js";
|
||||
} from "./process/processCapture.js";
|
||||
import { PROCESS_COMPARISON_DIMENSIONS } from "./process/processComparison.js";
|
||||
import { prefixedDigestSchema } from "./../domain/digests.js";
|
||||
|
||||
const evidenceIdSchema = prefixedDigestSchema("ev");
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ import { createHash } from "node:crypto";
|
|||
import { constants as fsConstants } from "node:fs";
|
||||
import { lstat, open, readdir, readlink } from "node:fs/promises";
|
||||
import { dirname, join, relative, resolve } from "node:path";
|
||||
import type { FileState, ProcessScenario } from "../domain/processCapture.js";
|
||||
import type {
|
||||
FileState,
|
||||
ProcessScenario,
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import type { Stats } from "node:fs";
|
||||
|
||||
export interface SnapshotResult {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import type { ProcessScenario } from "../domain/processCapture.js";
|
||||
import type { ProcessScenario } from "../../domain/process/processCapture.js";
|
||||
|
||||
interface ProcessCaptureEnvironmentOptions {
|
||||
readonly scenario: ProcessScenario;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
||||
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
||||
import {
|
||||
ProcessCaptureError,
|
||||
processCaptureCancelled,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import { AnalysisError } from "../../domain/analysisErrorBase.js";
|
||||
|
||||
interface ProcessCaptureErrorOptions extends ErrorOptions {
|
||||
readonly userMessage?: string;
|
||||
|
|
@ -5,7 +5,7 @@ import type {
|
|||
ProcessCaptureEventJournalEntry,
|
||||
ProcessScenario,
|
||||
RecordProcessCaptureEvent,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import {
|
||||
normalizeProcessElapsedTime,
|
||||
normalizeProcessText,
|
||||
|
|
@ -16,18 +16,18 @@ import type {
|
|||
ProcessCaptureEventJournalEntry,
|
||||
RecordProcessCaptureEvent,
|
||||
TerminalFrame,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import {
|
||||
digestProcessCommitment,
|
||||
processComparisonContract,
|
||||
processScenarioCommitment,
|
||||
} from "../domain/processCapture.js";
|
||||
import { PRODUCT_IDENTITY } from "../identity.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import { PRODUCT_IDENTITY } from "../../identity.js";
|
||||
import type { SnapshotResult } from "./FilesystemSnapshot.js";
|
||||
import { snapshotRoots } from "./FilesystemSnapshot.js";
|
||||
import { classifyFilesystemEffects } from "./ProcessFilesystemEffects.js";
|
||||
import { cleanupOwnedProcessGroup } from "../process/ProcessOwnership.js";
|
||||
import { observeOwnedProcessGroup } from "../process/ProcessOwnershipObservation.js";
|
||||
import { cleanupOwnedProcessGroup } from "../ProcessOwnership.js";
|
||||
import { observeOwnedProcessGroup } from "../ProcessOwnershipObservation.js";
|
||||
import { ProcessCaptureError } from "./ProcessCaptureError.js";
|
||||
import { assertNotCancelled } from "./ProcessScenarioRuntimeValidation.js";
|
||||
import {
|
||||
|
|
@ -35,7 +35,7 @@ import {
|
|||
normalizeProcessSamples,
|
||||
normalizeProcessText,
|
||||
} from "./ProcessNormalization.js";
|
||||
import { PROCESS_PROVIDER } from "./ProcessEvidence.js";
|
||||
import { PROCESS_PROVIDER } from "../../domain/process/processEvidenceProvider.js";
|
||||
import { TerminalRenderer } from "./TerminalRenderer.js";
|
||||
import { scheduleProcessInterval, type ProcessTimer } from "./ProcessTimer.js";
|
||||
|
||||
|
|
@ -10,8 +10,8 @@ import {
|
|||
parseProcessCapture,
|
||||
parseProcessScenario,
|
||||
type ProcessCapture,
|
||||
} from "../domain/processCapture.js";
|
||||
import { emptyProcessCapture as emptyCapture } from "../domain/processCapture.fixture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import { emptyProcessCapture as emptyCapture } from "../../domain/process/processCapture.fixture.js";
|
||||
|
||||
const base = {
|
||||
executable: "/bin/sh",
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import type {
|
||||
FileState,
|
||||
FilesystemCheckpoint,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
|
||||
/** Classify path-stable filesystem effects between two bounded states. */
|
||||
export const classifyFilesystemEffects = (
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
import { expect, it } from "vitest";
|
||||
import { processScenarioSchema } from "../domain/processScenario.js";
|
||||
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
||||
import { processScenarioSchema } from "../../domain/process/processScenario.js";
|
||||
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
|
||||
import { captureProcessScenario } from "./ProcessHarness.js";
|
||||
import { settleProcessCaptureJournal } from "./ProcessCaptureLifecycle.js";
|
||||
import { processCaptureSchema } from "../domain/processCapture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../domain/processCapture.fixture.js";
|
||||
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
||||
import { processCaptureSchema } from "../../domain/process/processCapture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../domain/process/processCapture.fixture.js";
|
||||
import { projectAnalysisError } from "../../domain/analysisErrorProjection.js";
|
||||
|
||||
it("rejects legacy replay output instead of silently discarding it", () => {
|
||||
expect(
|
||||
|
|
@ -8,11 +8,11 @@ import type {
|
|||
ProcessScenario,
|
||||
RecordProcessCaptureEvent,
|
||||
TerminalFrame,
|
||||
} from "../domain/processCapture.js";
|
||||
import { parseProcessCapture } from "../domain/processCapture.js";
|
||||
import { err, ok, type Result } from "../domain/result.js";
|
||||
import { AnalysisCapabilityUnavailableError } from "../domain/analysisErrorCore.js";
|
||||
import { type AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import { parseProcessCapture } from "../../domain/process/processCapture.js";
|
||||
import { err, ok, type Result } from "../../domain/result.js";
|
||||
import { AnalysisCapabilityUnavailableError } from "../../domain/analysisErrorCore.js";
|
||||
import { type AnalysisError } from "../../domain/analysisErrorBase.js";
|
||||
import {
|
||||
ProcessCaptureError,
|
||||
processCaptureCancelled,
|
||||
|
|
@ -23,7 +23,7 @@ import { snapshotRoots } from "./FilesystemSnapshot.js";
|
|||
import { TerminalRenderer } from "./TerminalRenderer.js";
|
||||
import type { ProcessTimer } from "./ProcessTimer.js";
|
||||
import { normalizeProcessText } from "./ProcessNormalization.js";
|
||||
import { selectCapturedProcessGroupIds } from "../process/ProcessOwnershipProcessTree.js";
|
||||
import { selectCapturedProcessGroupIds } from "../ProcessOwnershipProcessTree.js";
|
||||
import {
|
||||
awaitTerminalExit,
|
||||
buildCaptureResult,
|
||||
|
|
@ -4,7 +4,7 @@ import { normalizeProcessSamples } from "./ProcessNormalization.js";
|
|||
import {
|
||||
parseProcessScenario,
|
||||
type ProcessSample,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
|
||||
const rootPid = 41_010;
|
||||
const samples = Object.freeze(
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import type {
|
||||
ProcessSample,
|
||||
ProcessScenario,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
|
||||
/** Bucket one elapsed process-capture timestamp under scenario normalization. */
|
||||
export const normalizeProcessElapsedTime = (
|
||||
|
|
@ -2,9 +2,9 @@ import { readFile, readdir } from "node:fs/promises";
|
|||
import type {
|
||||
ProcessSample,
|
||||
RecordProcessCaptureEvent,
|
||||
} from "../domain/processCapture.js";
|
||||
import { execFileOutput } from "../process/ExecFileOutput.js";
|
||||
import { readProcessRunId } from "../process/ProcessOwnership.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
import { execFileOutput } from "../ExecFileOutput.js";
|
||||
import { readProcessRunId } from "../ProcessOwnership.js";
|
||||
const PROC_READ_CONCURRENCY = 64;
|
||||
|
||||
interface ProcessRow {
|
||||
|
|
@ -7,7 +7,7 @@ import {
|
|||
resolveExecutable,
|
||||
resolveProcessScenarioRuntimePaths,
|
||||
} from "./ProcessScenarioRuntimeValidation.js";
|
||||
import { parseProcessScenario } from "../domain/processCapture.js";
|
||||
import { parseProcessScenario } from "../../domain/process/processCapture.js";
|
||||
|
||||
it("preserves the caller-selected executable symlink for process invocation", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "rea-process-executable-alias-"));
|
||||
|
|
@ -2,7 +2,7 @@ import { access, realpath, stat } from "node:fs/promises";
|
|||
import { constants as fsConstants } from "node:fs";
|
||||
import { delimiter, isAbsolute, join, resolve } from "node:path";
|
||||
|
||||
import type { ProcessScenario } from "../domain/processCapture.js";
|
||||
import type { ProcessScenario } from "../../domain/process/processCapture.js";
|
||||
import {
|
||||
ProcessCaptureError,
|
||||
processCaptureCancelled,
|
||||
|
|
@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|||
import type {
|
||||
RecordProcessCaptureEvent,
|
||||
RenderedTerminalFrame,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../domain/process/processCapture.js";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
// SAFETY: both pinned xterm packages publish CommonJS at runtime and matching declarations.
|
||||
|
|
@ -7,7 +7,7 @@ import type { BinarySessionPort } from "../application/binary/BinarySession.js";
|
|||
import type { PromptCompletionKind } from "../contracts/promptContracts.js";
|
||||
import { artifactInventoryResultSchema } from "../domain/artifactGraph.js";
|
||||
import { artifactInspectionResultSchema } from "../domain/artifactInspection.js";
|
||||
import { processCaptureSchema } from "../domain/processCapture.js";
|
||||
import { processCaptureSchema } from "../domain/process/processCapture.js";
|
||||
|
||||
const documentListSchema = z.array(z.string().min(1));
|
||||
const providerStatusSchema = z.object({
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
|
|||
import {
|
||||
compareProcessCaptures,
|
||||
parseProcessCapture,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../domain/process/processCapture.js";
|
||||
import type { RecordUnknownInput } from "../domain/residualUnknown.js";
|
||||
import { err } from "../domain/result.js";
|
||||
import { recordDerivedEvidence } from "./recordDerivedEvidence.js";
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ import {
|
|||
} from "../application/AnalysisContextQueries.js";
|
||||
import { readAnalysisSnapshot } from "../application/binary/AnalysisSnapshotFiles.js";
|
||||
import type { BinarySessionPort } from "../application/binary/BinarySession.js";
|
||||
import { createProcessCaptureEvidence } from "../application/ProcessEvidence.js";
|
||||
import { captureProcessScenario } from "../application/ProcessHarness.js";
|
||||
import { createProcessCaptureEvidence } from "../application/process/ProcessEvidence.js";
|
||||
import { captureProcessScenario } from "../process/capture/ProcessHarness.js";
|
||||
import { toolContract } from "../contracts/toolContracts.js";
|
||||
import type { AnalysisSnapshot } from "../domain/analysisSnapshot.js";
|
||||
import { UnknownRegistryError } from "../domain/unknownRegistryError.js";
|
||||
import { type AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import type { Evidence } from "../domain/evidence.js";
|
||||
import type { ProcessCapture } from "../domain/processCapture.js";
|
||||
import type { ProcessCapture } from "../domain/process/processCapture.js";
|
||||
import { ok, type Result } from "../domain/result.js";
|
||||
import type { Logger } from "../logger.js";
|
||||
import { mcpProgressReporter } from "./mcpProgress.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export { PROCESS_PROVIDER } from "../application/ProcessEvidence.js";
|
||||
export { PROCESS_PROVIDER } from "../application/process/ProcessEvidence.js";
|
||||
export {
|
||||
ARTIFACT_COMPARISON_PROVIDER,
|
||||
BUNDLE_COMPARISON_PROVIDER,
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ import {
|
|||
captureProcessScenarioFile,
|
||||
compareProcessEvidenceFiles,
|
||||
projectProcessCliError,
|
||||
} from "../../../src/application/ProcessCli.js";
|
||||
} from "../../../src/application/process/ProcessCli.js";
|
||||
import { createEvidence } from "../../../src/domain/evidence.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/ProcessEvidence.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/process/ProcessEvidence.js";
|
||||
|
||||
const roots: string[] = [];
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ import { z } from "zod";
|
|||
|
||||
import { toolContract } from "../../../src/contracts/toolContracts.js";
|
||||
import { MANAGED_NATIVE_VERIFICATION_EXAMPLE } from "../../../src/contracts/managed/managedWorkflowExamples.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/domain/processCaptureExample.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/domain/process/processCaptureExample.js";
|
||||
import {
|
||||
managedNativeVerificationInputSchema,
|
||||
managedNativeVerificationResultSchema,
|
||||
verifyManagedNativeBoundaries,
|
||||
} from "../../../src/domain/managed/managedNativeVerification.js";
|
||||
import { nativeUiResultSchema } from "../../../src/domain/native/nativeUiObservation.js";
|
||||
import { processCaptureSchema } from "../../../src/domain/processCapture.js";
|
||||
import { processCaptureSchema } from "../../../src/domain/process/processCapture.js";
|
||||
import { toolRegistrationOptions } from "../../../src/server/toolRegistrationOptions.js";
|
||||
|
||||
const record = (value: unknown): Record<string, unknown> => {
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ import { Client, InMemoryTransport } from "@modelcontextprotocol/client";
|
|||
import { expect, it, onTestFinished } from "vitest";
|
||||
import { z } from "zod";
|
||||
|
||||
import { compareProcessEvidenceFiles } from "../../../src/application/ProcessCli.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/ProcessEvidence.js";
|
||||
import { compareProcessEvidenceFiles } from "../../../src/application/process/ProcessCli.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/process/ProcessEvidence.js";
|
||||
import { FUNCTION_COMPARISON_EXAMPLE } from "../../../src/contracts/functionComparisonExample.js";
|
||||
import {
|
||||
FUNCTION_COMPARISON_EVIDENCE,
|
||||
INVESTIGATION_EXAMPLES,
|
||||
} from "../../../src/contracts/investigationExamples.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/processCaptureExample.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/process/processCaptureExample.js";
|
||||
import { findChangedBehavior } from "../../../src/domain/changedBehavior.js";
|
||||
import {
|
||||
createEvidence,
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import { afterEach, describe, expect, it } from "vitest";
|
|||
|
||||
import { createTestBinarySession } from "../../fixtures/binarySession.js";
|
||||
import type { AnalysisClient } from "../../../src/application/AnalysisProvider.js";
|
||||
import { compareProcessEvidenceFiles } from "../../../src/application/ProcessCli.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/ProcessEvidence.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/processCaptureExample.js";
|
||||
import { compareProcessEvidenceFiles } from "../../../src/application/process/ProcessCli.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/application/process/ProcessEvidence.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/process/processCaptureExample.js";
|
||||
import { createEvidence, parseEvidence } from "../../../src/domain/evidence.js";
|
||||
import { jsonValueSchema } from "../../../src/domain/jsonValue.js";
|
||||
import type { ProcessTraceSpecification } from "../../../src/domain/processTraceComparison.js";
|
||||
import type { ProcessTraceSpecification } from "../../../src/domain/process/processTraceComparison.js";
|
||||
import { createServer } from "../../../src/server/createServer.js";
|
||||
import { observed as ok } from "../../fixtures/analysisExecution.js";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import { observed as ok } from "../../fixtures/analysisExecution.js";
|
|||
import { createServer } from "../../../src/server/createServer.js";
|
||||
import { createEvidence, parseEvidence } from "../../../src/domain/evidence.js";
|
||||
import { parseEvidenceBundle } from "../../../src/domain/evidenceBundle.js";
|
||||
import { processCaptureSchema } from "../../../src/domain/processCapture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/processCaptureExample.js";
|
||||
import { processCaptureSchema } from "../../../src/domain/process/processCapture.js";
|
||||
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "../../../src/contracts/process/processCaptureExample.js";
|
||||
import { jsonValueSchema } from "../../../src/domain/jsonValue.js";
|
||||
import { PROCESS_PROVIDER } from "../../../src/server/sessionToolPolicies.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import type {
|
|||
AnalysisProvider,
|
||||
CapabilityDescriptor,
|
||||
} from "../../../src/application/AnalysisProvider.js";
|
||||
import { probeProcessCaptureCapability } from "../../../src/application/ProcessHarness.js";
|
||||
import { probeProcessCaptureCapability } from "../../../src/process/capture/ProcessHarness.js";
|
||||
import { observed as ok } from "../../fixtures/analysisExecution.js";
|
||||
import { createServer } from "../../../src/server/createServer.js";
|
||||
import { toolContract } from "../../../src/contracts/toolContracts.js";
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { z } from "zod";
|
|||
|
||||
import { TOOL_CONTRACTS } from "../../../src/contracts/toolContracts.js";
|
||||
import { emptyArraySchema } from "../../../src/domain/emptyArraySchema.js";
|
||||
import { processScenarioSchema } from "../../../src/domain/processScenario.js";
|
||||
import { processScenarioSchema } from "../../../src/domain/process/processScenario.js";
|
||||
import { GENERATED_MCP_TOOL_CATALOG } from "../../../src/generatedMcpToolCatalog.js";
|
||||
import { toolRegistrationOptions } from "../../../src/server/toolRegistrationOptions.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { expect, it } from "vitest";
|
||||
|
||||
import { emptyUnverifiedProcessCapture } from "../domain/processCapture.fixture.js";
|
||||
import { parseProcessCapture } from "../domain/processCapture.js";
|
||||
import { parseProcessScenario } from "../domain/processScenario.js";
|
||||
import { createProcessCaptureEvidence } from "./ProcessEvidence.js";
|
||||
import { observeSettlement } from "./ProcessCaptureLifecycle.js";
|
||||
import { emptyUnverifiedProcessCapture } from "../../../src/domain/process/processCapture.fixture.js";
|
||||
import { parseProcessCapture } from "../../../src/domain/process/processCapture.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/process/processScenario.js";
|
||||
import { createProcessCaptureEvidence } from "../../../src/application/process/ProcessEvidence.js";
|
||||
import { observeSettlement } from "../../../src/process/capture/ProcessCaptureLifecycle.js";
|
||||
|
||||
it("stamps process Evidence from the capture manifest host", () => {
|
||||
const scenario = parseProcessScenario({
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
import { expect, it } from "vitest";
|
||||
|
||||
import { createProcessCaptureEvidence } from "./ProcessEvidence.js";
|
||||
import { createRunManifest } from "./ProcessCaptureLifecycle.js";
|
||||
import { emptyUnverifiedProcessCapture } from "../domain/processCapture.fixture.js";
|
||||
import { createProcessCaptureEvidence } from "../../../src/application/process/ProcessEvidence.js";
|
||||
import { createRunManifest } from "../../../src/process/capture/ProcessCaptureLifecycle.js";
|
||||
import { emptyUnverifiedProcessCapture } from "../../../src/domain/process/processCapture.fixture.js";
|
||||
import {
|
||||
compareProcessCaptures,
|
||||
parseProcessCapture,
|
||||
} from "../domain/processCapture.js";
|
||||
} from "../../../src/domain/process/processCapture.js";
|
||||
import {
|
||||
digestProcessCommitment,
|
||||
parseProcessScenario,
|
||||
processComparisonContract,
|
||||
processScenarioCommitment,
|
||||
} from "../domain/processScenario.js";
|
||||
} from "../../../src/domain/process/processScenario.js";
|
||||
|
||||
const captureEvidenceForSensitiveInput = (data: string) => {
|
||||
const scenario = parseProcessScenario({
|
||||
|
|
@ -23,7 +23,7 @@ it.skipIf(process.platform === "win32")(
|
|||
);
|
||||
const snapshotModule = fileURLToPath(
|
||||
new URL(
|
||||
"../../../dist/application/FilesystemSnapshot.js",
|
||||
"../../../dist/process/capture/FilesystemSnapshot.js",
|
||||
import.meta.url,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {
|
|||
processCaptureProbeFailureReason,
|
||||
processCaptureOwnershipUnavailableReason,
|
||||
probeProcessCaptureCapability,
|
||||
} from "../../../src/application/ProcessCaptureCapability.js";
|
||||
} from "../../../src/process/capture/ProcessCaptureCapability.js";
|
||||
|
||||
describe("process capture capability diagnostics", () => {
|
||||
it("distinguishes missing native modules from runtime ABI mismatches", () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { it } from "vitest";
|
||||
|
||||
import { probeProcessCaptureCapability } from "../../../src/application/ProcessCaptureCapability.js";
|
||||
import { probeProcessCaptureCapability } from "../../../src/process/capture/ProcessCaptureCapability.js";
|
||||
|
||||
/**
|
||||
* Process-capture tests need real native PTY authority. Probing once at module
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import { expect } from "vitest";
|
|||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import { itWithCaptureCapability } from "./processCaptureCapability.js";
|
||||
|
||||
import { captureProcessScenario } from "../../../src/application/ProcessHarness.js";
|
||||
import { snapshotRoots } from "../../../src/application/FilesystemSnapshot.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/processCapture.js";
|
||||
import { captureProcessScenario } from "../../../src/process/capture/ProcessHarness.js";
|
||||
import { snapshotRoots } from "../../../src/process/capture/FilesystemSnapshot.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/process/processCapture.js";
|
||||
|
||||
const processFixture = fileURLToPath(
|
||||
new URL("../../fixtures/processFidelity.mjs", import.meta.url),
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import { fileURLToPath } from "node:url";
|
|||
import { expect, it } from "vitest";
|
||||
import { z } from "zod";
|
||||
|
||||
import { captureProcessScenario } from "../../../src/application/ProcessHarness.js";
|
||||
import { createProcessCaptureEvidence } from "../../../src/application/ProcessEvidence.js";
|
||||
import { captureProcessScenario } from "../../../src/process/capture/ProcessHarness.js";
|
||||
import { createProcessCaptureEvidence } from "../../../src/application/process/ProcessEvidence.js";
|
||||
import {
|
||||
digestProcessCommitment,
|
||||
parseProcessCapture,
|
||||
parseProcessScenario,
|
||||
} from "../../../src/domain/processCapture.js";
|
||||
} from "../../../src/domain/process/processCapture.js";
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import { itWithCaptureCapability } from "./processCaptureCapability.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
|||
import {
|
||||
captureProcessScenario,
|
||||
probeProcessCaptureCapability,
|
||||
} from "../../../src/application/ProcessHarness.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/processCapture.js";
|
||||
} from "../../../src/process/capture/ProcessHarness.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/process/processCapture.js";
|
||||
|
||||
it("captures one command's terminal output, selected files, and owned cleanup", async () => {
|
||||
const root = await createTestTempDirectory("rea-process-capture-");
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { expect, it } from "vitest";
|
||||
|
||||
import { parseProcessScenario } from "../../../src/domain/processScenario.js";
|
||||
import { parseProcessScenario } from "../../../src/domain/process/processScenario.js";
|
||||
import {
|
||||
createRunManifest,
|
||||
observeSettlement,
|
||||
} from "../../../src/application/ProcessCaptureLifecycle.js";
|
||||
} from "../../../src/process/capture/ProcessCaptureLifecycle.js";
|
||||
|
||||
it("uses one selected host identity for manifest and settlement", async () => {
|
||||
const scenario = parseProcessScenario({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { ProcessCaptureError } from "../../../src/application/ProcessCaptureError.js";
|
||||
import { ProcessCaptureError } from "../../../src/process/capture/ProcessCaptureError.js";
|
||||
import { analysisErrorProjectionSchema } from "../../../src/contracts/errorSchemas.js";
|
||||
import { ArtifactOperationError } from "../../../src/domain/artifactOperationError.js";
|
||||
import { EvidenceFileError } from "../../../src/domain/evidenceErrors.js";
|
||||
|
|
|
|||
|
|
@ -8,6 +8,28 @@ import { describe, expect, it } from "vitest";
|
|||
import { inspectModuleBoundaries } from "../../scripts/lib/module-boundaries.mjs";
|
||||
import { createTestTempDirectory } from "../fixtures/temporaryDirectory.js";
|
||||
|
||||
describe("process capture implementation ownership", () => {
|
||||
it.each([
|
||||
["../../application/process/ProcessEvidence.js", false],
|
||||
["../../composition/binary.js", false],
|
||||
["../../server/createServer.js", false],
|
||||
["../../cli.ts", false],
|
||||
["../../main.js", false],
|
||||
["../../domain/process/processEvidenceProvider.js", true],
|
||||
["../ProcessOwnership.js", true],
|
||||
["../../windows/WindowsOwnedProcess.js", true],
|
||||
["./TerminalRenderer.js", true],
|
||||
])("checks capture importing %s", (dependency, allowed) => {
|
||||
const violations = inspectModuleBoundaries(
|
||||
"src/process/capture/ProcessHarness.ts",
|
||||
`import { value } from "${dependency}";`,
|
||||
process.cwd(),
|
||||
);
|
||||
if (allowed) expect(violations).toEqual([]);
|
||||
else expect(violations).toMatchObject([{ boundary: "process-capture" }]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("binary production construction ownership", () => {
|
||||
it.each([
|
||||
"hopper/HopperProvider.js",
|
||||
|
|
|
|||
Loading…
Reference in New Issue