Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9e1bf38
feat: retain owner-local runtime family catalog evidence
benhook1013 Nov 3, 2026
9e242cd
Merge commit '95a765c9bb33ed91dd2202c2f97416e053068f9c' into codex/ga…
benhook1013 Nov 3, 2026
3f72a18
test: align complete foreign-owner migration fixture dependencies
benhook1013 Nov 3, 2026
c1bdab3
Merge commit 'ee7ae1c02ff94521da02ec9a34befd5ab159f3a4' into codex/ga…
benhook1013 Nov 3, 2026
bcee42f
Fix catalog seals and immutable snapshot bindings
benhook1013 Nov 3, 2026
b059669
Bind Social catalog snapshots to exact retained frames
benhook1013 Nov 3, 2026
cf0f1e6
Share runtime catalog storage status classification
benhook1013 Nov 3, 2026
d0e07ba
Strengthen catalog frame and drift regression proof
benhook1013 Nov 3, 2026
1622065
Merge commit '882dfe886ceb34d6b904eab863ec98937feb6727' into codex/ga…
benhook1013 Nov 3, 2026
1a10b28
Consolidate closed owner catalog validation and tighten drift proof
benhook1013 Nov 3, 2026
dee73f2
Merge commit '736c3af39750ac19c64de083d970c656d73c8aaa' into codex/ga…
benhook1013 Nov 3, 2026
074a11e
Merge commit '6afe9fa6a6331e72ba3d93f563a34a69c3a647ba' into codex/ga…
benhook1013 Nov 3, 2026
9925000
Merge commit 'e056ed7223c66dd57efd93f43d6433e394a69fb2' into codex/ga…
benhook1013 Nov 3, 2026
c21b818
Prove exact Automation catalog drift refusals
benhook1013 Nov 3, 2026
efeb23a
Merge branch 'codex/gameplay-3383-hosted3-fixes-20261104' into codex/…
benhook1013 Nov 3, 2026
04b0f2d
Merge branch 'codex/gameplay-3383-hosted3-fixes-20261104' into codex/…
benhook1013 Nov 3, 2026
007a5a7
Clarify shared catalog client transport requirements
benhook1013 Nov 3, 2026
de837a7
Merge branch 'codex/gameplay-3383-hosted3-fixes-20261104' into codex/…
benhook1013 Nov 3, 2026
8967e80
Clarify sealed catalog maintenance and align classifier tests
benhook1013 Nov 3, 2026
31ee075
Share catalog receiver workload and transaction guard
benhook1013 Nov 3, 2026
921fd4c
Carry merged public discovery fixes into owner catalog successor
benhook1013 Nov 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ Target formation control-plane behavior eliminates unauthenticated service-local
- Durable parent-event identity, canonical request-digest conflict handling, an atomically frozen ordered handler manifest, binding-scoped plugin execution identity, and activation-epoch fencing under ADR 0172 are not implemented. Current retries can still re-resolve mutable handler state.
- Registry-classified `REJECT_VISIBLE`, `DURABLE_RETRY`, and `SKIP_RECONCILE` reload handling, transient attempt state, producer-specific expiry/backoff, and policy-specific proof under ADR 0173 are not implemented. Current denial memoization and producer behavior do not establish that target.

## Owner-local runtime-family catalog read

[`AutomationRuntimeFamilyCatalogReadService.ReadAutomationRuntimeFamilyCatalog`](../../../../protos/automation-scripting/v1/automation_runtime_family_catalog_read.proto) is a standalone, manually composed source prerequisite. Its owner-local schema/classification, durable epoch, immutable snapshot, and retained-family consequences are defined in the [runtime/data catalog contract](./runtime-and-data.md#owner-local-runtime-family-catalog). Implementation and proof status belong to the [Automation tracker](../../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#owner-local-runtime-family-catalog-source-prerequisite). Neither producer nor Game Session client is registered by default; this read grants no owner enrollment, FRESH completeness/materialization, actor authorization, runtime admission, CLOSED aggregation, or activation authority.

The receiver authenticates the exact same-workload-namespace `game-session-service` mTLS peer before decoding request bytes or touching SQL. Account/role context, global/scoped role overrides, shared internal-service credentials, absent or foreign peer identity, and ambient SQL transaction/synchronization refuse. A request binds one non-nil `readRequestId` UUID and the configured workload `targetNamespace`; a request namespace must match the authenticated peer and owner configuration. This workload namespace is not a playable-state namespace, tenant selector, actor identity, lifecycle token, or proof of any target's absence.

Each protobuf message contains exactly one canonical bytes field; duplicate, missing, unknown, malformed, trailing, or oversized input refuses rather than truncating or paginating. The version-1 request frame is `ACR1`, followed by the UUID's 16 bytes and a four-byte big-endian length-prefixed ASCII workload namespace. The `ACE1` evidence frame binds the complete length-prefixed original request, a non-nil snapshot UUID, the length-prefixed catalog SHA-256 digest, and the complete length-prefixed original catalog bytes. UUIDs use big-endian most-significant then least-significant bits. Digests use lowercase `sha256:<64 hex digits>`. The request wire limit is 1,024 bytes; the complete response wire limit is 2 MiB plus 4,096 bytes, without expanding the nested 2 MiB catalog bound. Exact bytes, snapshot identity, request correlation, epoch, and digests must survive complete decoding and retained readback.

The owner commits capture before performing independent committed readback; an exact retry returns its original retained snapshot, not a new sample under the same request. Changed correlation input, namespace, catalog epoch, schema/classification, original bytes, or digest binding cannot replace that evidence. An absent catalog, unclassified family, drifted epoch, unavailable store, unsupported evidence, or contradictory retained record is a refusal, never an empty owner or initialized target result. Authentication uses `UNAUTHENTICATED`/`PERMISSION_DENIED`, closed decoding uses `INVALID_ARGUMENT`, inconsistent or invalidated owner evidence uses `FAILED_PRECONDITION`, and storage failures retain their bounded transport classification without exposing private SQL details.

Game Session's manually constructed `AutomationRuntimeFamilyCatalogClient` requires file-backed mTLS, pins the exact same-namespace Automation server URI SAN identity, applies finite inbound/outbound bounds and a five-second deadline, and rejects ambient SQL/synchronization before transport. Complete request/evidence comparison is mandatory; an outage or deadline is not an empty-source fallback. Consuming a successful source read does not resolve any blocking family disposition or non-SQL gap, and must not enroll Automation or enable a FRESH/lifecycle operation. No plugin activation, epoch generation, `onLoad`, schedule firing, work creation, or runtime mutation is performed to produce this read.

## Script-transition API consequences

The service-local control-plane and event-ingress surfaces apply the canonical script-transition authority as follows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,38 @@ The current queue consumer has an additional bounded-drain limitation that must

The selected-source terminal reader and Account settlement composition are standalone and unregistered construction components; they do not establish complete authenticated owner intake or physical proof. The [authoring tracker](../../../project-management/implementation-tracking/game-authoring-publishing-and-activation.md#current-status) owns their code and validation status. Without the exact committed Account settlement, finalized source participation remains pending.

## Owner-local runtime-family catalog

Automation's runtime-family catalog is an owner-local source classification, not a runtime-state manifest. Its fixed owner is `automation-scripting-service` and its closed schema is `automation-runtime-family-catalog/v1`. The canonical replacement and retention authorities remain [ADR 0122](../../decisions/adr-0122-stable-playable-state-namespaces-for-runtime-replacement.md), [ADR 0123](../../decisions/adr-0123-database-authoritative-temporal-coordinated-world-lifecycle.md), [ADR 0137](../../decisions/adr-0137-isolated-playtest-state-modes-and-reset.md), [ADR 0163](../../decisions/adr-0163-service-owned-retention-classes-with-cross-service-safety.md), and the [scheduler runtime-replacement classification](../../system-architecture-scripting-scheduler-and-timers.md#runtime-replacement-classification). This prerequisite does not enroll an owner, close a FRESH owner set, prove private lifecycle/namespace/build evidence, create a target, initialize gameplay, authorize an actor, or release runtime admission. Its [separate read API](./api-contracts.md#owner-local-runtime-family-catalog-read) owns authentication, framing, and consumer consequences; detailed source and proof status belong to the [Automation tracker](../../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#owner-local-runtime-family-catalog-source-prerequisite).

### Catalog source and retention boundary

The owner derives a complete ordered census from the installed combined Automation/Saga PostgreSQL schema, not ORM names, observed rows, a zero count, hand-maintained table-name prefixes, or a mutable cache. Every installed table, including empty tables, has an explicit relation-level disposition; material mixed components are named separately and must exist as installed columns. Live table/column, constraint/index, trigger/policy/rule, routine, sequence definition, view, and type facts and actual configured Flyway history bind the schema seal. Gameplay payload rows, sequence positions, volatile statistics, and installation timestamps do not define that seal. Adding, removing, renaming, or changing a covered object or classification invalidates the current epoch; an unclassified table or missing classified component refuses even if it contains no rows.

The catalog retains exact PostgreSQL-produced UTF-8 bytes with a positive monotonic owner-local epoch and SHA-256 digest. Its closed root fields are `schema`, `owner`, decimal-string `catalogEpoch`, `families`, `schemaFacts`, and `nonSqlGaps`. Ordered, nonduplicate family entries bind exact relation/component, role, state class, FRESH disposition, retention disposition, and a bounded explicit owner consequence. Schema facts bind kind, identity, and definition digest. Limits are 512 families, 16,384 schema facts, 32 known non-SQL gaps, and 2 MiB of complete catalog bytes; exceeding a bound refuses, never returns a partial source. Roles distinguish `RUNTIME_PAYLOAD`, `SOURCE`, `CONTROL`, `AUDIT`, `PROVENANCE`, and `CATALOG`. `UNKNOWN`, `UNRESOLVED`, and `NOT_PAYLOAD` are classification/disposition evidence, not new runtime replacement classes; no S3 classification is inferred from this source.

The additive V1004 storage consists of explicit classification and known non-SQL-gap declarations, retained catalog epochs, and immutable request-bound snapshots. It preserves prior Automation/Saga rows, source-intake guards, sequences, and migration history; it does not adopt old numeric identities or rewrite prior migrations. Flyway 13.12's built-in `${flyway:table}` binds the actual configured history table, including custom history names. View and materialized-view facts bind both `pg_get_viewdef` and `pg_class.reloptions`, including view security options; changing either invalidates the sealed epoch. The V1005 forward migration replaces the census routines and appends the next exact owner-local epoch without rewriting prior epochs, snapshots, payload rows, or history. Because catalog migrations' successful history rows are written after their transactions, the current seal uses distinct `catalog-installation:1004` and `catalog-installation:1005` markers in place of those rows and separately requires both successful exact scripts on later reads. These markers do not attest to post-transaction checksums; normal Flyway validation remains required. An old request cannot be resampled under the new epoch.

Capture uses an independent owner transaction and complete retained readback in a separate read-only repeatable-read transaction. SQL guards bind the complete request/evidence frames to the latest exact sealed epoch; Java additionally compares every retained identity, byte array, and digest. Exact concurrent retries converge on one immutable snapshot. UPDATE, DELETE, and TRUNCATE of catalog declarations, epochs, or snapshots refuse; a later explicit owner revision cannot overwrite the old evidence, and an invalidated old request cannot be silently resampled. Catalog rows have no automatic expiry. These catalog retention guards neither replace existing runtime cleanup/hold rules nor grant new cleanup, clone, reset, resume, or deployment authority.

### Explicit family consequences

| Installed family or component | Source disposition and owner consequence |
| --- | --- |
| `npc_memory`, `npc_formations`, `npc_formation_member` | `STATE_CLASS_UNKNOWN_BLOCKING`: live/latent NPC behavior and actor references lack complete stable namespace, typed actor ownership, replacement classification, mapping, and required-initialization proof. Retain dependency closure; do not infer S3 or copy memory/formations. |
| `faction_standing` | `OWNERSHIP_DRIFT_BLOCKING`: the live Automation reputation writer conflicts with canonical Social ownership. Social owner migration requires explicit retained-row disposition, stable tenant/namespace/character/faction identity, and consumer cutover. The catalog must not normalize Automation as the FRESH standing owner or perform that cutover. Local `factions` definitions remain separate source input. |
| `script_schedule_instances` and due-point state | S2 with `NAMESPACE_MAPPING_BLOCKING`: canonical durable schedules are not disposable instance state. Current rows lack stable playable namespace and complete continuity/mapping and required-initialization evidence; do not inherit schedules/due points or fire them to manufacture proof. Authored `script_schedule_definitions` are source outside S1/S2/S3, not initialized runtime state. |
| `script_work_items`, including `read_snapshot_token` and `admission_epoch` | Runtime payload remains `STATE_CLASS_UNKNOWN_BLOCKING`; retained provenance/control components remain `RUNTIME_EVIDENCE_BLOCKING`. A legacy token/local barrier is not the complete sealed input manifest, descriptor/recovery bundle, or durable charge marker. No inherited pending work, replay, synthetic initialization, or cleanup follows from the census. |
| `script_event_ingress_audit`, `script_event_audit`, `script_handoff_events`, replay requests/results | Explicit audit/control/provenance with `RUNTIME_EVIDENCE_BLOCKING`; retain original claims, work/child/replay lineage, holds, and retry evidence. The ingress `script_id` component identifies the mixed pre-instance readiness branch, not namespace absence. Complete namespace, frozen-handler/recovery evidence, and measured retention horizons remain required. |
| `plugin_runtime_states`, request history, lifecycle events, signer-policy observation | Runtime state remains `STATE_CLASS_UNKNOWN_BLOCKING`; histories are retained blocking control/audit evidence, and policy observation is separate control input. Exact `(pluginActivationEpoch, lifecycleRevision)` does not establish private lifecycle/namespace/build identity, replacement classification, initialization, or a retention horizon. Do not enable a plugin or generate a lifecycle epoch to populate evidence. |
| Pin/rollout projections and events, admission state/history | Retained `RUNTIME_EVIDENCE_BLOCKING` control/audit, not authoritative Game Session pin/rollout chronology, actor authorization, or a private lifecycle manifest. No inherited source barrier, receipt, or chronology and no outage-to-UNPINNED fallback. |
| Scripts, event bindings, schedule definitions, readiness and `readiness_generation`, patch-base provenance, selected-source associations/receipts/reservations | Explicit source/control/provenance outside runtime S-classes, retained and non-cloned under their existing owners. Empty authored source is not empty runtime state. Tenant readiness is not durable game initialization; no `onLoad` is run for catalog evidence. Original source custody, signer/publication provenance and source guards remain unchanged. |
| Installed `saga_instance`/`saga_step`, actual Flyway history, catalog declarations/epochs/snapshots | Explicit retained control/catalog-only, not gameplay payload, a second lifecycle authority, owner enrollment, or materialization evidence. |

### Known non-SQL limitations

The `nonSqlGaps` declarations name known limitations, not a census of Redis keys. `DURABLE_CHARGE_MARKERS` is `UNSUPPORTED_BLOCKING`: current quota, tenant-budget, and capacity decisions are best-effort Redis counters/leases, with no durable full-Trigger-Identity charge family or exactly-once admission/execution-start markers. `QUEUE_POINTER_RETENTION` is also `UNSUPPORTED_BLOCKING`: the current pointer lists lack a TTL/length bound and owner-reconciled durable re-drive/reset gate. `QUEUE_DISCOVERY_AND_ENCODING`, `CAPACITY_LEASE_ACCOUNTING`, and `CENTRAL_RESET_ACL_REGISTRATION` are `UNRESOLVED_BLOCKING` for the existing raw identity builders/database-wide `KEYS`, non-idempotent retry leases, and incomplete central reset/ACL inventory described above. The SQL source must not invent durable charge rows or imply cluster, reset, accounting, PKI, operational Unit1B, seeded/snapshot, private-first-OPEN, or lifecycle qualification. Those holds remain separate and unchanged.

## Authored Template Source Inventory

Automation owns the source inventory declaration schema carried as authored content by a new versioned Game Design `TEMPLATE_CONFIG` source ([closed schema and reference rules](../game-design-service/game-templates.md#closed-versioned-configuration-and-references-target-state)). The Automation value schema is `automation-authored-source-inventory/v1` with exactly three required family arrays: `SCRIPT_DEFINITIONS`, `EVENT_BINDINGS`, and `SCRIPT_PATCH_SOURCES`. The current shared value accepts only explicitly authored empty arrays; omitted, null, unknown, malformed, duplicate, trailing, oversized, or nonempty input is rejected. Its canonical RFC 8785 bytes preserve the authored declaration deterministically. This declaration is content only: it is not an owner receipt, source readback, authorization, provenance, or proof of owner completeness, and cannot qualify a publication on its own. Existing `TEMPLATE_CONFIG` schema-version content is not reinterpreted as this declaration.
Expand Down
Loading
Loading