Repository navigation
refactor(domain): replace production prose/regex limitation matching with typed discriminators - #14359
Conversation
…with typed discriminators Closes #14347
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The reviewed changes appear safe to merge; no actionable issue remains. SummaryThe PR replaces decisions based on limitation text with typed facts across binary diagnostics, Ghidra dossiers, relationship coverage, and Windows launch errors.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
P["Provider emits typed facts"] --> L["Live checks"]
L --> E["Evidence"]
S["Saved format-2 coverage"] --> H["Historical reader preserves omitted directions"]
H --> E
E --> G["Graph projection adds required directions"]
G --> O["Strict graph output"]
Reviews (3) · Last reviewed commit: "test(mcp): align boundary coverage fixtu..." · Reviewed by Greptile |
… CI tests/formatting
Closes #14347
Summary
Replaces production prose/regex limitation and error-message matching with typed discriminators across all five sites identified in #14347:
src/application/binaryDiagnostics/KernelBuildConfigService.ts): Removed the.includes("untrusted")prose scan invalidReport; untrustedness is enforced via structuredtrust: "target-derived-untrusted"fields onbannerandconfig.entries[*]alongside non-emptylimitations.src/domain/native/functionDossier.ts,src/ghidra/GhidraFunctionValues.ts,bridge/ghidra/ReaGhidraBridge.java): Added typedfunctionDossierLimitationCodeSchema(unresolved_computed_or_indirect_flows,provider_specific_representations), emittedlimitation_codesfromReaGhidraBridge.java, and replaced the/indirect|computed/uand/provider|Ghidra|Hopper/uregex checks inghidraFunctionDossierwith typed code validation.src/domain/relationshipCoverage.ts,src/domain/functionCallCoverage.ts, producers): Madelimited_directionsrequired onpartialRelationshipCoverageSchemaandunknownRelationshipCoverageSchema, updated all producers (IdaOperationRunner,IdaCallGraph,CallPathTracing,EnhancedTools,AnalysisSnapshotCache,BinarySession), and removed thestartsWith("Callers: ")/!includes("Callees: ")prose fallback fromisCallerOnlyIncompleteCoverage.src/domain/native/elfDebugLink.ts,src/native/elf/ElfDebugLink.ts,src/native/elf/ElfDebugLinkProvider.ts,src/application/binaryDiagnostics/ElfDebugLinkService.ts,src/domain/native/elfUnwindRanges.ts,src/native/elf/ElfUnwindTables.ts,src/application/binaryDiagnostics/ElfUnwindRangesService.ts): Added typedlimitation_codesschemas and producer emissions, and replaced all production.includes(ELF_*_LIMITATION)prose checks inElfDebugLinkServiceandElfUnwindRangesServicewith typed code checks.src/windows/WindowsOwnedProcess.ts): Removed the 27-sentenceWINDOWS_CONTROL_SPAWN_CONSTRAINTSlist and allcause.message.startsWith(...)fallbacks inisWindowsExecutableLaunchFailureandwindowsNativeSpawnControlError, classifying spawn failures solely via structuredconstraintcodes set at the N-API FFI boundary.Fail-Closed Invariants Preserved
ghidraFunctionDossier,ElfDebugLinkService, andElfUnwindRangesServiceare rejected at the schema/service boundary.partialandunknownrelationship coverage records withoutlimited_directionsare rejected byrelationshipCoverageSchema.KernelBuildConfigService.validReportstill rejects emptylimitationsor non-"target-derived-untrusted"trust fields.constraintcodes fail closed as host-control (WindowsNativeSpawnControlError) rather than being silently classified as target executable launch failures; ordinary non-Windows POSIX errors remain unaffected.Validation
npm run typecheck && npm run lint && npm run verify:architecture-guards: passed (0 errors across 8,089 linted files, 4,770 module-boundary files, 3,088 architecture-guard files).npm run test:localacross 15 unit test files (503/503 passed) and 13 additional service/adapter test files (259/259 passed after updatingAnalysisSnapshotCache.test.ts).npx vitest runacross 10 boundary, composition, and snapshot cache suites (elfDebugLink,elfUnwindRanges,kernelBuildConfig,functionComparisonCoverageMcp,enhancedTools.callPathsAndBatches,nativeObservationViewsMcp,workflowUnknownIdentityMcp,analysisViewMcp,reverseProviderLaunchErrors,AnalysisSnapshotCache): 185/185 passed.