feat(engine): apply package-update deltas from embedded components - #384
feat(engine): apply package-update deltas from embedded components#384bomly-guy wants to merge 1 commit into
Conversation
Bomly Diff SummaryCompared Overview
Dependency Changes✅ No dependency changes. Vulnerabilities✅ No vulnerability changes. License Changes✅ No license changes. Project Posture✅ No project posture changes ( Policy Findings✅ No policy differences were identified. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
feecb35 to
651fd39
Compare
sdk.MatchResult.PackageUpdates / sdk.AnalyzeResult.PackageUpdates were only honored by the managed-plugin transport adapters (internal/plugin/registry.go), so embedded matchers and analyzers that returned deltas instead of a full registry had their enrichment silently dropped by the engine. Engine.Match and Engine.Analyze now advertise AcceptPackageUpdates on every request and, mirroring the adapter semantics exactly: - a returned Registry wins and deltas are ignored; - otherwise non-empty PackageUpdates are applied with sdk.ApplyPackageUpdates and the resulting registry threads to the aggregated result and to subsequent components in the same run; - a zero-value result preserves the effective registry. External plugins are unaffected: their adapter resolves deltas into a full Registry before the engine sees the result, so plugin deltas are never applied twice. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
651fd39 to
2d9c12e
Compare
Gap
sdk.MatchResult.PackageUpdates/sdk.AnalyzeResult.PackageUpdatesdeltas were honored only by the managed-plugin transport adapters (internal/plugin/registry.goexternalMatcher.Match/externalAnalyzer.Analyze). An embedded matcher or analyzer that returned deltas instead of a full registry had its enrichment silently dropped by the engine — the loop only consumedresult.Registry.What changed
Engine.MatchandEngine.Analyze(internal/engine/engine.go) now:AcceptPackageUpdates = trueon the request before invoking components — placed in the engine methods (the single funnel every request-construction path goes through, includingpipeline.go), so every caller gets it;Registrywins and deltas are ignored;PackageUpdatesare applied viasdk.ApplyPackageUpdatesand the resulting registry threads to the aggregated result and to subsequent components in the same run, identically to how a returned registry threads;No double-apply for external plugins: their adapter resolves deltas into a full
Registrybefore the engine sees the result — noted in a code comment at both apply sites.Tests
internal/engine/package_updates_test.go:PackageUpdates: enrichment lands in the final registry, stats aggregate, and a second matcher observes the updated registry (that second matcher also covers the zero-value-result case);RegistryandPackageUpdates: the registry wins (adapter semantics) for both kinds;AcceptPackageUpdatesasserted visible to components.Why now
This unlocks per-wave delta adoption in the component-extraction program: embedded components can move to the delta contract before they are extracted, and behave identically after extraction.
🤖 Generated with Claude Code