mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 03:33:25 +00:00
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:
59 files changed
+2915
-2319
No files matched your search
@@ -16,11 +16,12 @@ import {
|
||||
} from "./analysisViewCoverage.js";
|
||||
import { err, ok, type Result } from "../result.js";
|
||||
import type { AnalysisError } from "../analysisErrorBase.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 type { JsonValue } from "../jsonValue.js";
|
||||
|
||||
const matchRow = nativeFunctionMatchSchema.extend({
|
||||
@@ -259,9 +260,13 @@ const selectedItems = (
|
||||
/** Query immutable matching facts without copying full alias groups into selected pages. */
|
||||
export const projectNativeFunctionMatchingView = (
|
||||
parent: AnalysisViewParent,
|
||||
view: AnalysisViewRequest,
|
||||
): Result<UnsignedAnalysisView, AnalysisError> => {
|
||||
if (view.kind !== "summary" && view.kind !== "function-matches")
|
||||
admitted: AdmittedView,
|
||||
) => {
|
||||
const view = ownedView<
|
||||
| SummaryAnalysisView
|
||||
| z.output<typeof nativeFunctionMatchingViewRequestSchema>
|
||||
>(admitted, "summary", "function-matches");
|
||||
if (view === undefined)
|
||||
return err(
|
||||
analysisViewInputError([
|
||||
{
|
||||
@@ -283,7 +288,7 @@ export const projectNativeFunctionMatchingView = (
|
||||
const shared = sharedContext(parent, entry.report);
|
||||
if (view.kind === "summary")
|
||||
return ok({
|
||||
kind: "summary",
|
||||
kind: "summary" as const,
|
||||
view,
|
||||
...shared,
|
||||
summary: context,
|
||||
@@ -292,7 +297,7 @@ export const projectNativeFunctionMatchingView = (
|
||||
const rows = filterRows(entry, view),
|
||||
items = selectedItems(entry, view, rows);
|
||||
return ok({
|
||||
kind: "function-matches",
|
||||
kind: "function-matches" as const,
|
||||
view,
|
||||
...shared,
|
||||
...context,
|
||||
|
||||
Reference in new issue
Block a user