diff --git a/scripts/lib/module-layers.baseline.json b/scripts/lib/module-layers.baseline.json index 7b79f742b3..3857aebc41 100644 --- a/scripts/lib/module-layers.baseline.json +++ b/scripts/lib/module-layers.baseline.json @@ -14,7 +14,6 @@ "model -> artifacts": 1 }, "entry": { - "application -> browser": 2, "application -> desktop": 41, "application -> frida": 2 } diff --git a/scripts/verify/baselines/inline-sha256-hex.json b/scripts/verify/baselines/inline-sha256-hex.json index 29fa33b87b..ae2c398ea7 100644 --- a/scripts/verify/baselines/inline-sha256-hex.json +++ b/scripts/verify/baselines/inline-sha256-hex.json @@ -4,6 +4,7 @@ "src/apkSignature/apkCertificateFacts.ts": 1, "src/application/GuidanceAccess.ts": 1, "src/application/LinuxHopperPublisher.ts": 2, + "src/application/PublishWebScripts.ts": 1, "src/application/ReferenceSourceImportEntries.ts": 1, "src/application/SetupRecoveryBackup.ts": 1, "src/application/ValidateSelectedWebScript.ts": 1, @@ -28,7 +29,6 @@ "src/browser/PlaywrightElectronActiveProvider.ts": 1, "src/browser/PlaywrightScenarioArtifacts.ts": 2, "src/browser/WebSourceMapFetcher.ts": 1, - "src/browser/assets/PublishWebScripts.ts": 1, "src/browser/history/HarCapture.ts": 1, "src/browser/history/SazProjection.ts": 1, "src/browser/history/protobuf/ProtobufCapture.ts": 1, diff --git a/src/browser/assets/PublishWebScripts.ts b/src/application/PublishWebScripts.ts similarity index 96% rename from src/browser/assets/PublishWebScripts.ts rename to src/application/PublishWebScripts.ts index 1384854427..f6a160e406 100644 --- a/src/browser/assets/PublishWebScripts.ts +++ b/src/application/PublishWebScripts.ts @@ -10,27 +10,27 @@ import { SafeOutputTree, outputDirectoryAdmissionRefusal, SafeOutputTreeCreationFailure, -} from "../../resources/index.js"; -import { PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION } from "../../domain/browserNetworkEvidence.js"; +} from "../resources/index.js"; +import { PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION } from "../domain/browserNetworkEvidence.js"; import { AnalysisCancelledError, cancelledBy, carriedReason, -} from "../../domain/analysisErrorCore.js"; +} from "../domain/analysisErrorCore.js"; import { webScriptExportManifestSchema, webScriptExportResultSchema, type ExportWebScriptsInput, type ExportedWebScript, type WebScriptExportResult, -} from "../../domain/webScriptExport.js"; +} from "../domain/webScriptExport.js"; import { isolatedWebScriptPath, planWebScriptExport, type PlannedWebScript, -} from "../../domain/webScriptExportPlan.js"; -import { WebScriptExportError } from "../../domain/webScriptExportError.js"; -import type { SelectedScriptCapture } from "./ScriptCaptureAdapters.js"; +} from "../domain/webScriptExportPlan.js"; +import { WebScriptExportError } from "../domain/webScriptExportError.js"; +import type { SelectedScriptCapture } from "../domain/webScriptCaptureAdapters.js"; const LIMITATIONS = [ "Only script bytes retained in this capture are exported. Sources are not refetched or executed, and a response or Debugger source does not prove execution.", diff --git a/src/application/WebScriptExportService.ts b/src/application/WebScriptExportService.ts index 3bd60bf1ee..7dc7bf692b 100644 --- a/src/application/WebScriptExportService.ts +++ b/src/application/WebScriptExportService.ts @@ -10,8 +10,8 @@ import { type ArtifactResourceScope, bindArtifactFileCleanup, } from "../resources/index.js"; -import { publishWebScripts } from "../browser/assets/PublishWebScripts.js"; -import { selectScriptCapture } from "../browser/assets/ScriptCaptureAdapters.js"; +import { publishWebScripts } from "./PublishWebScripts.js"; +import { selectScriptCapture } from "../domain/webScriptCaptureAdapters.js"; import { AnalysisAccessDeniedError, AnalysisInputError, diff --git a/src/browser/assets/PageScriptCapture.ts b/src/domain/pageScriptCapture.ts similarity index 89% rename from src/browser/assets/PageScriptCapture.ts rename to src/domain/pageScriptCapture.ts index 6997c1678b..3c13ddfd78 100644 --- a/src/browser/assets/PageScriptCapture.ts +++ b/src/domain/pageScriptCapture.ts @@ -1,5 +1,5 @@ -import type { WebPageInspection } from "../../domain/browserObservationSchemas.js"; -import type { CapturedWebScript } from "../../domain/webScriptExport.js"; +import type { WebPageInspection } from "./browserObservationSchemas.js"; +import type { CapturedWebScript } from "./webScriptExport.js"; /** Project verified Debugger sources without fetching resource URLs. */ export const pageScripts = ( diff --git a/src/browser/assets/ScenarioScriptCapture.ts b/src/domain/scenarioScriptCapture.ts similarity index 88% rename from src/browser/assets/ScenarioScriptCapture.ts rename to src/domain/scenarioScriptCapture.ts index d641a94f98..7ab02a78c0 100644 --- a/src/browser/assets/ScenarioScriptCapture.ts +++ b/src/domain/scenarioScriptCapture.ts @@ -1,11 +1,11 @@ -import type { BrowserScenarioCapture } from "../../domain/browserScenarioCapture.js"; -import type { BrowserScenarioEvent } from "../../domain/browserScenarioCaptureValues.js"; -import type { BrowserNetworkBody } from "../../domain/browserNetworkEvidence.js"; -import type { CapturedWebScript } from "../../domain/webScriptExport.js"; +import type { BrowserScenarioCapture } from "./browserScenarioCapture.js"; +import type { BrowserScenarioEvent } from "./browserScenarioCaptureValues.js"; +import type { BrowserNetworkBody } from "./browserNetworkEvidence.js"; +import type { CapturedWebScript } from "./webScriptExport.js"; import { indexBrowserScenarioTransactions, type BrowserScenarioTransactionIndex, -} from "../../domain/browserScenarioTransactions.js"; +} from "./browserScenarioTransactions.js"; type RequestEvent = Extract; diff --git a/src/browser/assets/ScriptCaptureAdapters.test.ts b/src/domain/webScriptCaptureAdapters.test.ts similarity index 96% rename from src/browser/assets/ScriptCaptureAdapters.test.ts rename to src/domain/webScriptCaptureAdapters.test.ts index 7e59961864..5f9f8c5056 100644 --- a/src/browser/assets/ScriptCaptureAdapters.test.ts +++ b/src/domain/webScriptCaptureAdapters.test.ts @@ -3,10 +3,10 @@ import { describe, expect, it } from "vitest"; import { scriptCaptureEvidenceFixture, scriptScenarioFixture, -} from "../../../tests/fixtures/webScriptCapture.js"; -import { createWebTextArtifact } from "../../domain/webContentArtifact.js"; -import { pageScripts } from "./PageScriptCapture.js"; -import { selectScriptCapture } from "./ScriptCaptureAdapters.js"; +} from "../../tests/fixtures/webScriptCapture.js"; +import { createWebTextArtifact } from "./webContentArtifact.js"; +import { pageScripts } from "./pageScriptCapture.js"; +import { selectScriptCapture } from "./webScriptCaptureAdapters.js"; describe("passive script projection", () => { it("preserves passive source bytes, declarations, and unavailable languages", () => { diff --git a/src/browser/assets/ScriptCaptureAdapters.ts b/src/domain/webScriptCaptureAdapters.ts similarity index 87% rename from src/browser/assets/ScriptCaptureAdapters.ts rename to src/domain/webScriptCaptureAdapters.ts index 6496d063a0..cc555adfa9 100644 --- a/src/browser/assets/ScriptCaptureAdapters.ts +++ b/src/domain/webScriptCaptureAdapters.ts @@ -1,12 +1,12 @@ -import { webPageInspectionSchema } from "../../domain/browserObservationSchemas.js"; -import { retainedBrowserScenarioCaptureSchema } from "../../domain/browserScenarioCapture.js"; -import { parseEvidence } from "../../domain/evidence.js"; +import { webPageInspectionSchema } from "./browserObservationSchemas.js"; +import { retainedBrowserScenarioCaptureSchema } from "./browserScenarioCapture.js"; +import { parseEvidence } from "./evidence.js"; import type { CapturedWebScript, WebScriptExportResult, -} from "../../domain/webScriptExport.js"; -import { pageScripts } from "./PageScriptCapture.js"; -import { scenarioScripts } from "./ScenarioScriptCapture.js"; +} from "./webScriptExport.js"; +import { pageScripts } from "./pageScriptCapture.js"; +import { scenarioScripts } from "./scenarioScriptCapture.js"; /** Capture-specific parsing and source selection, independent of publication. */ export interface ScriptCaptureAdapter { diff --git a/tests/boundary/browser/cdpScriptMetadata.test.ts b/tests/boundary/browser/cdpScriptMetadata.test.ts index 9fdd92c147..7cb3e05570 100644 --- a/tests/boundary/browser/cdpScriptMetadata.test.ts +++ b/tests/boundary/browser/cdpScriptMetadata.test.ts @@ -8,9 +8,9 @@ import { afterEach, describe, expect, it } from "vitest"; import { createJavaScriptRuntimeObservationEvidence } from "../../../src/application/javascript/JavaScriptRuntimeObservationEvidence.js"; import { CdpBrowserProvider } from "../../../src/browser/CdpBrowserProvider.js"; import { CdpElectronProvider } from "../../../src/browser/CdpElectronProvider.js"; -import { publishWebScripts } from "../../../src/browser/assets/PublishWebScripts.js"; +import { publishWebScripts } from "../../../src/application/PublishWebScripts.js"; import { ArtifactResourceScope } from "../../../src/resources/ArtifactResourceScope.js"; -import { selectScriptCapture } from "../../../src/browser/assets/ScriptCaptureAdapters.js"; +import { selectScriptCapture } from "../../../src/domain/webScriptCaptureAdapters.js"; import { inspectWebPageInputSchema } from "../../../src/domain/browserObservation.js"; import { inspectElectronPageInputSchema } from "../../../src/domain/javascript/electronObservation.js"; import { parseRuntimeCapture } from "../../../src/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js"; diff --git a/tests/boundary/filesystem/webScriptExport.test.ts b/tests/boundary/filesystem/webScriptExport.test.ts index 078c96ad85..1167f29149 100644 --- a/tests/boundary/filesystem/webScriptExport.test.ts +++ b/tests/boundary/filesystem/webScriptExport.test.ts @@ -28,12 +28,12 @@ import { analyzeJavaScriptApplication } from "../../support/javascriptApplicatio import { exportWebScripts } from "../../../src/application/WebScriptExportService.js"; import { AnalysisCancelledError } from "../../../src/domain/analysisErrorCore.js"; import { ArtifactResourceScope } from "../../../src/resources/ArtifactResourceScope.js"; -import { publishWebScripts } from "../../../src/browser/assets/PublishWebScripts.js"; +import { publishWebScripts } from "../../../src/application/PublishWebScripts.js"; import { DestinationCaseCollisionFailure } from "../../../src/resources/ArtifactPaths.js"; import { ArtifactReaderFailure } from "../../../src/resources/ArtifactReader.js"; import { SafeOutputTree } from "../../../src/resources/SafeOutputTree.js"; import { SafeOutputTreeCreationFailure } from "../../../src/resources/SafeOutputTreeCreationFailure.js"; -import { selectScriptCapture } from "../../../src/browser/assets/ScriptCaptureAdapters.js"; +import { selectScriptCapture } from "../../../src/domain/webScriptCaptureAdapters.js"; import { javascriptApplicationAnalysisResultSchema } from "../../../src/domain/javascript/javascriptApplicationAnalysis.js"; import { projectAnalysisError } from "../../../src/domain/analysisErrorProjection.js"; import { PLAYWRIGHT_RESPONSE_BODY_PROVENANCE_LIMITATION } from "../../../src/domain/browserNetworkEvidence.js";