Repository navigation
refactor(native): parse native inventory results once at the operation port - #10880
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
[Low impact] This PR appears safe to merge; no blocking issues were found. SummaryAdds five named native inventory contracts and
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Caller] --> B[executeFact]
B --> C[Supplied port.execute]
C --> D{Port succeeds?}
D -->|No| E[Return original failure]
D -->|Yes| F[Parse result with named contract]
F --> G{Rows match?}
G -->|Yes| H[Return original execution and typed fact]
G -->|No| I[AnalysisOutputError with partial Evidence]
Reviews (2) · Last reviewed commit: "refactor(native): parse native inventory..." · Reviewed by Greptile |
22 tasks
morluto
changed the base branch from
docs/native-typed-operation-facts
to
main
November 15, 2026 08:28
22 tasks
morluto
force-pushed
the
refactor/native-operation-fact-port
branch
from
November 15, 2026 08:49
0615298 to
5e5f9f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First implementation step of the accepted ADR
docs/adr/native/typed-operation-facts.md(#10866): named provider-neutral contracts for the five native inventory operations and one port-levelexecuteFactthat runs an operation through anyAnalysisOperationPortand parses its result once. Readers migrate in the stacked PRs that follow. Plan W13 step 1 follow-up.Problem and expected behavior
EnhancedLiteralTracing,NativeDispatchMetadataInspection,functionInventory,nativeInventoryView) re-parseAnalysisExecution.resultwith their own schemas and failure policies.AnalysisOutputErrorwith field diagnostics and the observed execution as partial Evidence), and Evidence keeping the provider's source value.Change and scope
src/domain/native/nativeOperationFacts.ts:NativeOperationFactContract<Operation, Fact>and the contractslistNamesFact,listProceduresFact,searchProceduresFact,listStringsFact,searchStringsFact, built fromnativeInventoryRowsSchemas(lenient rows: unknown fields dropped from the fact).src/application/AnalysisOperationFacts.ts:executeFact(port, contract, parameters, options)returns{ execution, fact }. It calls the given port's ownexecute, so wrapping ports (WorkflowEvidence, admission, managed wrappers) observe the call unchanged; the execution'sresultstays the source value.executeFact.Not included: reader migrations (stacked:
nativeInventoryView,functionInventory,NativeDispatchMetadataInspection,EnhancedLiteralTracing), and a guard against new local re-parses, which lands with the last reader. Hopper's and Ghidra's reply checks are intentionally kept (ADR decision 6).Contribution scope: not applicable (internal refactor within existing boundaries).
Contract and boundary impact
executeFactowns the parse and failure policy at the application port. No consumer changes in this PR.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/application/AnalysisOperationFacts.test.ts: each contract parses once through the port'sexecute, drops an unknown row field from the fact while the execution keeps it; a malformed row is refused withcontract_issues([0, "address"], expected string, received number) and the observed execution as partial Evidence; a port failure is returned unchanged.executeFactyet; the reader PRs carry the workflow coverage.For evidence-bearing changes:
Validation performed
npm run test:local -- src/application/AnalysisOperationFacts.test.ts— 7 passednpm run check:fast— passednpx knip --include exports,types,files— no findingsnpx oxfmton changed files; pre-commit and pre-push hooks passedCompatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.