[Feature] Compare and explicitly upgrade tenant organization models from template versions #6

Closed
opened 2026-07-30 17:34:17 +02:00 by zemion · 2 comments
Owner

Follow-up to #4. Tenant models are concrete copies of immutable, versioned system templates and never live-inherit template changes. Add the explicit upgrade workflow.

Acceptance criteria

  • Administrators can compare the instantiated template version with a newer published version.
  • The diff classifies compatible additions, destructive/remapping changes, local tenant divergence, and invalid references.
  • Upgrade creates a preview and requires explicit confirmation; it never mutates a tenant silently.
  • The resulting tenant model remains independently editable and records source template/version provenance.
  • Conflicts require a bounded mapping decision and are audit/event visible.
  • Tests cover unchanged, additive, divergent, invalid, cancelled, and applied upgrades.
Follow-up to #4. Tenant models are concrete copies of immutable, versioned system templates and never live-inherit template changes. Add the explicit upgrade workflow. ## Acceptance criteria - Administrators can compare the instantiated template version with a newer published version. - The diff classifies compatible additions, destructive/remapping changes, local tenant divergence, and invalid references. - Upgrade creates a preview and requires explicit confirmation; it never mutates a tenant silently. - The resulting tenant model remains independently editable and records source template/version provenance. - Conflicts require a bounded mapping decision and are audit/event visible. - Tests cover unchanged, additive, divergent, invalid, cancelled, and applied upgrades.
Author
Owner

Closure audit (2026-08-03)

Immutable system template versions, publication, and initial instantiation into an empty tenant are implemented. This issue is not yet closable: there is no compare/preview/apply upgrade engine, no local-divergence classification, and no bounded mapping-decision workflow or UI.

Shortest closure path:

  1. Persist the instantiated source template/version and a normalized tenant baseline fingerprint.
  2. Build deterministic three-way comparison: source baseline vs newer template vs current tenant model.
  3. Persist preview/mapping decisions and apply only after explicit confirmation with audit/event evidence.
  4. Add the administration UI and unchanged/additive/divergent/invalid/cancelled/applied tests.
## Closure audit (2026-08-03) Immutable system template versions, publication, and initial instantiation into an empty tenant are implemented. This issue is **not yet closable**: there is no compare/preview/apply upgrade engine, no local-divergence classification, and no bounded mapping-decision workflow or UI. Shortest closure path: 1. Persist the instantiated source template/version and a normalized tenant baseline fingerprint. 2. Build deterministic three-way comparison: source baseline vs newer template vs current tenant model. 3. Persist preview/mapping decisions and apply only after explicit confirmation with audit/event evidence. 4. Add the administration UI and unchanged/additive/divergent/invalid/cancelled/applied tests.
Author
Owner

Codex State: done

Summary

  • Implemented persisted three-way organization-template upgrade previews with compatible, divergent, destructive, and invalid-reference classifications.
  • Added explicit keep/use-target/remap decisions, optimistic stale-state checks, cancellation, confirmed application, provenance, lifecycle events, and tenant-owned resulting instantiations.
  • Added the Organizations administration surface, Views declaration, documentation, migration, and uninstall safety.

Changed Files

  • src/govoplan_organizations/backend/upgrades.py
  • src/govoplan_organizations/backend/api/v1/routes.py
  • webui/src/features/organizations/OrganizationTemplateUpgradePanel.tsx
  • docs/ORGANIZATION_MODEL.md

Verification

  • 24 organization Python tests passed
  • Ruff passed
  • Organizations WebUI contract tests passed
  • 65/65 manifest registry and strict endpoint inventory passed
  • Integrated Core WebUI production build and bundle budget passed
## Codex State: done ### Summary - Implemented persisted three-way organization-template upgrade previews with compatible, divergent, destructive, and invalid-reference classifications. - Added explicit keep/use-target/remap decisions, optimistic stale-state checks, cancellation, confirmed application, provenance, lifecycle events, and tenant-owned resulting instantiations. - Added the Organizations administration surface, Views declaration, documentation, migration, and uninstall safety. ### Changed Files - `src/govoplan_organizations/backend/upgrades.py` - `src/govoplan_organizations/backend/api/v1/routes.py` - `webui/src/features/organizations/OrganizationTemplateUpgradePanel.tsx` - `docs/ORGANIZATION_MODEL.md` ### Verification - `24 organization Python tests passed` - `Ruff passed` - `Organizations WebUI contract tests passed` - `65/65 manifest registry and strict endpoint inventory passed` - `Integrated Core WebUI production build and bundle budget passed`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-organizations#6