Skip to content

product/composition: persist immutable generation and activation authority #435

Description

@seonghobae

Buyer-visible gap

#432/#433/#434 currently prove only process-local product-composition admission. OwnerApiRelease, CompositionRoute, CompositionGeneration, and AdmissionReceipt construction/issuance integrity disappears across GC/process restart and therefore cannot prove which exact generation/configuration/deployment was historically active.

This issue owns the next Orgmetra product-composition persistence slice under #432. It is not a new bounded context and does not own HR domain truth. It may persist only immutable composition generation/configuration/deployment/activation/audit coordinates needed to prove exact product-composition state. It must not copy owner schemas, query owner application tables, or move Keyverse/domain authorization/idempotency/concurrency/scientific truth into composition.

Dependency boundary

No mutable sibling source copy, feature-local quality workflow, cross-service SQL, force-push/destructive rebase, self-approval, gate weakening, or routine administrator bypass is authorized.

Durable invariants

  1. Generation identity is non-reassignable. One generation_id is bound permanently to one schema/configuration meaning. Re-registering the exact same canonical generation is idempotent; reusing the ID for a different config_sha256 or route material fails closed.
  2. Canonical configuration is reconstructable. Durable rows retain enough normalized route and owner-release material to reconstruct OwnerApiRelease/CompositionRoute/CompositionGeneration, recompute the canonical configuration digest, and run the existing feat(composition): admit exact released owner API routes #434 admission evaluator. A stored digest without reconstructable semantic material is not authority.
  3. No partial generation becomes eligible. Generation root + route/release material are written atomically. Incomplete route sets, split owner releases, invalid Path Item ownership, path-selection ambiguity, or hash mismatch fail before commit/activation.
  4. Deployment identity is explicit and non-PII. Deployment/environment coordinates contain no credential, Person, tenant, or other HR data and are not inferred from caller labels that can be reassigned silently.
  5. Activation is generation-atomic and append-only. Current deployment state is derived from an append-only activation event sequence under a per-deployment transaction lock. Concurrent activations cannot both claim the same next state.
  6. Rollback is a new activation event. It may target only a previously persisted immutable generation and must re-run durable generation/configuration/release/owner compatibility checks; a stale in-process AdmissionReceipt is never rollback authority.
  7. Mutation history is not rewritten. Generation semantic rows and activation events are update/delete denied after insertion except for explicitly modeled append-only successor evidence.
  8. Recovery is reproducible. After process restart the active generation can be reconstructed and re-admitted from durable rows without relying on Python object identity or prior closure state.
  9. Composition-only persistence. No HR application table, owner-service table, Keyverse table, or cross-service SQL is introduced.

Implementation order

Start with a narrow child of #434 that defines the immutable durable generation/configuration registry and its PostgreSQL adapter/contract tests. Then add deployment activation/rollback event semantics on the same owner path. Keep the issue open until both persistence and activation/recovery are exercised under canonical Foundation/PostgreSQL acceptance on a protected-base candidate.

Acceptance

GREEN requires executable RED coverage for generation-ID reassignment, partial writes, route-material/digest mismatch, forged stored release coordinates, concurrent activation conflict, stale rollback evidence, update/delete attempts, and restart reconstruction; exact-head 100% owned statement/branch/docstring/edge evidence; isolated PostgreSQL acceptance; failure/recovery evidence; normal Security/SAST/CodeQL/review governance; then protected integration and immutable Orgmetra release evidence. None of those are inferred merely from this issue or a Draft child PR.

Refs #432 #433 #434 #260.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions