refactor(analysis-view): break the analysis view hub cycle (#8061)

* refactor(analysis-view): break the analysis view hub cycle

Move request fragments, the request union, and the result union out of
analysisView.ts so projectors no longer import the module that imports them.
The dispatcher re-exports the public schemas and seals projector results.

Co-authored-by: morluto <morluto@users.noreply.github.com>

* fix(analysis-view): check inferred projector results

Require each projector result to match the unsigned result union before
sealing it, and parse the cycle guard's imports with Babel so comments
and side-effect imports are not misread.

* fix(analysis-view): close IL2CPP and Android symbol view inputs

Admit those projectors through AdmittedView and check test selections
against their request schemas, so misspelled fields fail at the call site.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: morluto <morluto@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-10-30 05:41:58 +08:00
1 parent 4a8d8f72b3
commit 940d71a45a
59 files changed
+2915 -2319

No files matched your search

+14 -10
View File
@@ -25,11 +25,12 @@ import {
} from "../il2cpp/il2cppMetadata.js";
import { err, ok, type Result } from "../result.js";
import { createAnalysisViewResultReader } from "./analysisViewParent.js";
import type {
AnalysisViewParent,
AnalysisViewRequest,
UnsignedAnalysisView,
} from "./analysisView.js";
import type { AnalysisViewParent } from "./analysisViewParent.js";
import {
ownedView,
type AdmittedView,
type SummaryAnalysisView,
} from "./analysisViewShape.js";
import {
completeWithinViewCoverage,
pageViewCoverage,
@@ -519,9 +520,12 @@ const selection = (view: Request, report: Report) => {
/** Reuse retained facts; source indices stay distinct from filtered page offsets. */
export const projectIl2cppMetadataView = (
parent: AnalysisViewParent,
view: AnalysisViewRequest,
): Result<UnsignedAnalysisView, AnalysisError> => {
if (view.kind !== "summary" && view.kind !== "il2cpp-metadata")
admitted: AdmittedView,
) => {
const view = ownedView<
SummaryAnalysisView | z.output<typeof il2cppMetadataViewRequestSchema>
>(admitted, "summary", "il2cpp-metadata");
if (view === undefined)
return err(
analysisViewInputError([
{
@@ -653,7 +657,7 @@ export const projectIl2cppMetadataView = (
}),
}))(report.binary);
return ok({
kind: "summary",
kind: "summary" as const,
view,
...shared,
summary: {
@@ -729,7 +733,7 @@ export const projectIl2cppMetadataView = (
}
}
return ok({
kind: "il2cpp-metadata",
kind: "il2cpp-metadata" as const,
view,
...shared,
items,