Skip to content

feat(target-operatorbox): MuxReconciler dispatch and intent package - #262

Merged
iAlexeze merged 4 commits into
mainfrom
feat/per-target-operatorbox
Aug 17, 2026
Merged

feat(target-operatorbox): MuxReconciler dispatch and intent package#262
iAlexeze merged 4 commits into
mainfrom
feat/per-target-operatorbox

Conversation

@iAlexeze

Copy link
Copy Markdown
Collaborator

The experimental exploration continues as runtime meets intent and targets.

Phase 1 established per-target operatorBox declarations, surface cleanup, and the gateway surface routing model. This PR is phase 2: the runtime side of that exploration — bug fixes, a new package to house the intent and target layer, a MuxReconciler that holds all reconcilers for every target, and a fixture to prove it.


pkg/intent/target/ — a new home

Target resolution and CR construction move out of the gateway package into a dedicated layer: pkg/intent/target/. This is where the exploration of what "intent" means at runtime lives — how a flat gateway intent becomes a CR, how a target annotation becomes a routing decision, and now how a routing decision becomes a reconciler dispatch.


MuxReconciler

MuxReconciler holds one domain.Reconciler per registered target. At reconcile time, the kordinator reads the target annotation on the CR and selects the matching reconciler. If no target-specific reconciler is registered, it falls back to the CRD-level reconciler.

This makes per-target constructor dispatch transparent to the rest of the runtime — the kordinator sees one reconciler, the MuxReconciler handles the routing internally.


Fixture: 03-hooks-targets

A new fixture in pkg/kubeclient/fixture/ with three targets on one CRD, proving each dispatch path:

  • v2-enabled — hooks with an enqueueGate (business hours), featureEnabled: true
  • v2-disabled — same hook binary, featureEnabled: false, no gate
  • v2-ctorreconciler.default: false, dedicated constructor

ork serve apply --override

Adds --override to allow routing a resource to a different target when a surface conflict exists.


Documentation

documentation/concepts/reusability/ — new section: Reusability and Composition in Orkestra.

… for per-target dispatch

- TargetHookRegistry / TargetReconcilerRegistry: new GVK→target maps in pkg/types
- TargetHookFactories / TargetReconcilerFactories: runtime fields on CRDEntry
- HasServeTargetEntries(): accessor replacing direct nil checks
- EffectiveOperatorBox: deep merge via mergeReconcilerConfig (args key-by-key)
- addTargetHooks / addTargetConstructors: new validate pipeline steps (6b, 8b)
- generator: per-target loop emits TargetHookRegistry / TargetReconcilerRegistry entries
- validate_hooks_reconcilers.go: extracted from validation_methods, fixed save-back bug, removed IsTargetOnly gate
- 20 tests covering addHooks, addReconcilers, addTargetHooks, addTargetConstructors
- fixture 03-hooks-targets: per-target hooks fixture with intent/ pattern
…ture, and override flag

- Move target resolution and CR construction to pkg/intent/target/
- Add MuxReconciler that dispatches per-target constructors, falling back to GenericReconciler
- Wire MuxReconciler in runtime_konstructor when HasTargetConstructorFactories()
- Add TargetConstructorArgs and HasTargetConstructorFactories accessors on CRDEntry
- Fix addReconcilers to skip per-target entries owned by addTargetConstructors
- Add --override flag to ork serve apply for routing surface conflict override
- Extend 03-hooks-targets fixture with v2-ctor target and constructor
- Add issues.md noting surface cleanup gap for hook-managed resources
Covers the system-level view of reuse across every layer of Orkestra:
core infrastructure, building blocks (Motifs/Katalogs/Komposers/include),
user-defined vocabulary (notes and profiles), args, and per-target
reconcile strategies. Each page links to related concept pages.
…egistry

Per-target entries with reconciler.default: false and a ConstructorDecl declared
were not getting their Constructor wired in addReconcilers(). The function skipped
the entire CRD when the top-level DefaultReconcile() returned true, never inspecting
target-level entries.

Added wirePerTargetConstructors which iterates per-target entries, finds those with
default: false and a ConstructorDecl, and wires the constructor from ReconcilerRegistry
using the CRD-level GVK.
@iAlexeze
iAlexeze merged commit 1d53e56 into main Aug 17, 2026
8 checks passed
@iAlexeze iAlexeze changed the title feat(target-operatorbox): MuxReconciler dispatch, intent package, fixture, and override flag feat(target-operatorbox): MuxReconciler dispatch and intent package Aug 17, 2026
@iAlexeze
iAlexeze deleted the feat/per-target-operatorbox branch August 19, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant