Skip to content

fix(dispatcher): correct ILI label to packdelivery-{name} + lineage unit test#21

Merged
ontave merged 20 commits into
mainfrom
feature/post-migration-wis
May 21, 2026
Merged

fix(dispatcher): correct ILI label to packdelivery-{name} + lineage unit test#21
ontave merged 20 commits into
mainfrom
feature/post-migration-wis

Conversation

@ontave
Copy link
Copy Markdown
Contributor

@ontave ontave commented May 21, 2026

Summary

  • ILI label fix: clusterpack_reconciler.go and packexecution_reconciler.go now set infrastructure.ontai.dev/root-ili to packdelivery-{name} (using lineage.IndexName("PackDelivery", ...)) on created PackExecution and PackInstalled CRs. Previous value was packexecution-{name} which caused the seam DescendantReconciler to look up a non-existent LineageRecord.
  • Unit test: TestPackInstalled_LineageLabelUsesPackDeliveryName verifies the corrected label value.
  • Test fix: newRunnerConfig() helpers updated from string capability format to map[string]interface{}{"name": "pack-deploy"} matching the RunnerCapabilityEntry type. Unblocks TC-MC-13, TC-MC-23.
  • Also includes: seam/pkg/namespaces constants migration, dispatcher leader lease fix, RunnerConfig runnerImage read, PermissionSnapshot fallback.

Test plan

  • go test ./... -- all pass
  • Live TC-MC-13: dex LineageRecord descendantRegistry has 2 entries (PackExecution + PackInstalled) with all required fields -- PASS
  • Live TC-MC-23: C->T feedback causal chain verified -- PASS

ontave added 20 commits May 12, 2026 11:42
Non-canonical copy deleted. seam-core is the authority and the type
has been removed from seam-core in this migration phase.
…rapper

Phase 2 step 2.3: delete all infrastructure.ontai.dev CRD YAML files
copied into wrapper/config/crd/ -- these were stale copies that would
conflict with the new seam.ontai.dev definitions after the move.

Phase 3 steps 3.3-3.7: define PackDelivery, PackExecution, PackInstalled,
PackReceipt, and PackLog as first-class types under seam.ontai.dev/v1alpha1
in wrapper/api/seam/v1alpha1/. Generate CRD YAML into config/crd/bases/
and wire embed.go to expose them via compileLaunchBundle.

WrapperRunnerRBAC gate renamed to DispatcherRunnerRBAC throughout the
PackExecution reconciler. clusterPackRef field references updated to
packDeliveryRef in all tests and production code.
Update go.mod module declaration from github.com/ontai-dev/wrapper to
github.com/ontai-dev/dispatcher. Update all internal import paths to
use github.com/ontai-dev/dispatcher. Update seam-core -> seam replace
directive and require entry. Add seam-sdk replace + require. No type
or logic changes.
Replace ../seam-core with ../seam following the seam-core -> seam
filesystem rename. Module path github.com/ontai-dev/seam was already
updated in Phase 4; this aligns the local path pointer.
…ontai.dev

Update all GroupVersionKind Group fields for RBACProfile, RBACPolicy, and
PermissionSnapshot from security.ontai.dev to guardian.ontai.dev in the
PackExecution reconciler and associated tests.
…ming

- Package comments, suite name, test descriptions: wrapper -> dispatcher
- Gate condition comments: WrapperRunnerRBAC -> DispatcherRunnerRBAC
- Type comments: InfrastructurePackReceipt -> PackReceipt
- It() string: "PackExecution is created by wrapper" -> "by dispatcher"
wrapper-schema.md / seam-core-schema.md doc refs left unchanged (Phase 8).
All 4 dispatcher test packages pass.
Fresh documentation from current codebase. wrapper renamed to dispatcher
throughout. seam.ontai.dev replaces infra.ontai.dev. Type names updated:
PackDelivery, PackExecution, PackInstalled, PackReceipt, PackLog. New
dispatcher-schema.md replaces stale wrapper-schema.md (redirect left in
place).
…am-sdk); fix integration test scheme registration and CRD path
The pack-deploy Job mounts the cluster kubeconfig secret without SubPath,
causing the secret key 'value' to appear as a directory entry at
/var/run/secrets/kubeconfig/value rather than as a plain file at
/var/run/secrets/kubeconfig. Add SubPath: "value" so conductor execute
mode can open the path as a regular file.
…nAttempts to PackLog

PackInstalled gains spec.remediationPolicyRef for conductor watchdog escalation policy
resolution. PackLog gains status.remediationAttempts slice for per-reason attempt tracking.
Deepcopy regenerated. pack-name label injection wired into PackExecution reconciler (T-CW-12 through T-CW-20).
Replace all infrastructure.ontai.dev references with seam.ontai.dev across
controllers and tests. Fix InfrastructureRunnerConfig -> RunnerConfig and
InfrastructureTalosCluster -> TalosCluster GVKs in SetupWithManager watch,
isConductorReadyForCluster lookups, and all test helpers. Rename wrapper-runner
SA to dispatcher-runner throughout. Update finalizer, annotation, and label
keys to seam.ontai.dev prefix. Update unit tests to use post-migration GVKs
so gate 0 clears correctly in test scenarios.
PackExecution reconciler was looking for PackDelivery in pe.Namespace
(seam-tenant-{cluster}) but PackDeliveries live in seam-system. This
caused Gate 1 to block indefinitely with "ClusterPack not found".
Fix: hardcode seam-system in the Gate 1 lookup. Update all test
fixtures to use seam-system for PackDelivery namespace.
…or mgmt cluster

The management cluster's PermissionSnapshot is named snapshot-management
(role-derived) not snapshot-ccs-mgmt (cluster-name-derived). G-BL-SNAPSHOT-ALIAS.
isPermissionSnapshotCurrent now tries snapshot-{clusterRef} first then falls
back to snapshot-management, matching Guardian's naming convention for the
management cluster self-import case.
buildPackDeployJob was using a hardcoded conductorImageDefault
("conductor-execute:dev") instead of reading the RunnerConfig's
spec.runnerImage. Changed buildPackDeployJob to accept runnerImage
parameter; call site reads it from RunnerConfig in ont-system with
conductorImageDefault as fallback.
cmd/wrapper/main.go: LeaderElectionID was "wrapper-leader"; corrected
to "dispatcher-leader" per post-migration naming.

config/crd/: add generated seam.ontai.dev CRD manifests for PackDelivery,
PackExecution, PackInstalled, PackLog, PackReceipt.

api/seam/v1alpha1/zz_generated.deepcopy.go: regenerated deep copy.
…mespaces constants

Eliminates all hardcoded namespace strings from dispatcher controllers
per Governor invariant 2026-05-20: never hardcode namespaces in code.

Key fix: PackDelivery lookup now uses pe.Namespace (seam-tenant-{clusterRef})
instead of hardcoded seam-system. This was the root cause of TC-MC-2
failing when PackDelivery was correctly placed in the tenant namespace.

- packexecution_reconciler.go: 8 literals replaced with namespaces.* calls
- clusterpack_reconciler.go: 3 literals replaced; removed unused strings import
- packinstance_reconciler.go: 1 literal replaced
- identity/identity.go: 2 literals replaced
- Tests updated: capabilities format changed from []CapabilityEntry to []string;
  PackDelivery namespace in test fixtures aligned with PackExecution namespace
… for lineage label

- clusterpack_reconciler: SetDescendantLabels on new PackExecution using
  IndexName("PackDelivery", cp.Name) so the descendant registry lookup resolves
  to the correct LineageRecord (packdelivery-{name} not packexecution-{name})
- packexecution_reconciler: same fix for PackInstalled label at reconcile time
- helpers_test: fix RunnerCapabilityEntry format from plain string to
  map[string]interface{}{"name":...} matching the seam type definition
- packinstance_lifecycle_test: add TestPackInstalled_LineageLabelUsesPackDeliveryName
  verifying the root-ili label value (unblocks TC-MC-13, TC-MC-23)
- packexecution_reconciler_test: same RunnerCapabilityEntry format fix
…n-wis

# Conflicts:
#	api/seam/v1alpha1/packinstalled_types.go
#	api/seam/v1alpha1/packlog_types.go
#	api/seam/v1alpha1/zz_generated.deepcopy.go
#	cmd/wrapper/main.go
#	config/crd/bases/seam.ontai.dev_packdeliveries.yaml
#	config/crd/infrastructure.ontai.dev_infrastructureclusterpacks.yaml
#	config/crd/seam.ontai.dev_packdeliveries.yaml
#	config/crd/seam.ontai.dev_packinstalleds.yaml
#	internal/controller/clusterpack_reconciler.go
#	internal/controller/packexecution_reconciler.go
#	internal/controller/packinstance_reconciler.go
@ontave ontave merged commit 2ff811c into main May 21, 2026
1 check failed
@ontave ontave deleted the feature/post-migration-wis branch May 21, 2026 19:03
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