Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
b6f3bcf
Persist replay evidence and retention-safe V4 repository substrate
benhook1013 Sep 20, 2026
8879a17
Restore execution replay and queue recovery behavior
benhook1013 Sep 20, 2026
b158b02
Document durable replay and Entity receipt boundaries
benhook1013 Sep 20, 2026
38b2bb8
Merge commit '2afe7df54' into codex/5b-retention-rebuild-prep
benhook1013 Sep 20, 2026
3e76249
style: align combined replay test imports
benhook1013 Sep 20, 2026
341362d
docs: preserve replay cleanup and handoff boundaries
benhook1013 Sep 20, 2026
55f1753
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 20, 2026
6449ad4
Merge updated 5B Publication stack into Retention
benhook1013 Sep 22, 2026
4a70216
Merge latest 5B Publication stack into Retention
benhook1013 Sep 22, 2026
3458c93
style(automation): normalize replay merge formatting
benhook1013 Sep 22, 2026
59946f4
test(automation): reconcile lifecycle retry proof with V4 batching
benhook1013 Sep 22, 2026
9486c5c
Merge updated 5B Publication checkpoint
benhook1013 Sep 22, 2026
0ca762c
Merge updated #2828 checkpoint
benhook1013 Sep 22, 2026
d080f74
Merge remote-tracking branch 'origin/codex/5b-publication-rebuild-pre…
benhook1013 Sep 22, 2026
2d13478
Merge remote-tracking branch 'origin/codex/5b-publication-rebuild-pre…
benhook1013 Sep 22, 2026
0586c69
fix(automation): retain incomplete handoff evidence
benhook1013 Sep 22, 2026
40a0a95
docs(alignment): record first dry retention cycle
benhook1013 Sep 22, 2026
8d898b3
docs(alignment): record retention review taper
benhook1013 Sep 22, 2026
9b8c522
docs(alignment): record first dry 5B closure cycle
benhook1013 Sep 22, 2026
c204582
docs(automation): classify plugin lifecycle retention
benhook1013 Sep 22, 2026
d626cf1
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 22, 2026
78ccccd
docs(review): record productive 5B closure cycle
benhook1013 Sep 22, 2026
dce1d82
Record whole-5B closure report boundary
benhook1013 Sep 22, 2026
32c8e10
docs(shared-runtime): reconcile 5C and 5D corpus authority
benhook1013 Sep 22, 2026
e57b184
docs(alignment): link combined 5C and 5D review
benhook1013 Sep 22, 2026
c0c494b
docs(redis): correct current automation queue behavior
benhook1013 Sep 22, 2026
820c28b
docs(redis): clarify reset release authority
benhook1013 Sep 22, 2026
18521e6
docs(ticks): qualify aggregate watermark identities
benhook1013 Sep 22, 2026
9dc2d0d
docs(automation): remove stale fence status
benhook1013 Sep 22, 2026
b58aa60
fix(runtime): persist cross-service intents before dispatch
benhook1013 Sep 23, 2026
77c91e4
docs(runtime): align accepted-command recovery status
benhook1013 Sep 23, 2026
9d2f0dd
docs(publication): align current transaction status
benhook1013 Sep 23, 2026
3e29415
fix(game-session): fence accepted command retries
benhook1013 Sep 23, 2026
99d2af8
docs(redis): remove duplicate tick reset policy
benhook1013 Sep 23, 2026
bd97280
docs(redis): record hosted profile gaps
benhook1013 Sep 23, 2026
a38861d
docs(game-session): correct remote retry status
benhook1013 Sep 23, 2026
0c53700
test(automation): use coherent identity fixtures for PostgreSQL claims
benhook1013 Sep 24, 2026
76a0e34
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 24, 2026
b00afb3
Merge 5B retention parent into 5C/5D successor
benhook1013 Sep 24, 2026
d04a577
Format Automation PostgreSQL proof fixture
benhook1013 Sep 24, 2026
b96e303
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 24, 2026
03747a1
Merge branch 'codex/5b-retention-rebuild-prep' into codex/5c-5d-succe…
benhook1013 Sep 24, 2026
13e779d
Merge commit 'e84fcc9f8b2ae85d941335269251fc9402868556' into codex/5b…
benhook1013 Sep 24, 2026
932dcab
Merge commit '13e779dbe4f76a1de79f59e1259f24e7b404e1ba' into codex/5c…
benhook1013 Sep 24, 2026
4a4b1ce
Merge commit 'c1db6f90c393cc45c43bf02d84108189d3741252' into codex/5b…
benhook1013 Sep 24, 2026
d150d47
Merge commit '4a4b1cee7fbc27b432ad2bf608b4502f7982cd7e' into codex/5c…
benhook1013 Sep 24, 2026
ee7444d
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 24, 2026
9f7588e
Merge branch 'codex/5b-retention-rebuild-prep' into codex/5c-5d-succe…
benhook1013 Sep 24, 2026
04d37d2
Merge branch 'codex/5b-publication-rebuild-prep' into codex/5b-retent…
benhook1013 Sep 25, 2026
afbe97c
Merge branch 'codex/5b-retention-rebuild-prep' into codex/5c-5d-succe…
benhook1013 Sep 25, 2026
7e2de1e
Preserve tick commit and handoff retry boundaries
benhook1013 Sep 27, 2026
f6dea7b
Fence handoff responses to prepared intent row
benhook1013 Sep 27, 2026
1a53deb
Reconcile 5C/5D successor with exact-base retention parent
benhook1013 Sep 27, 2026
696900c
Assert PostgreSQL migration catalog counts as longs
benhook1013 Sep 27, 2026
d1a9865
Reconcile 5C/5D successor with exact-base retention parent
benhook1013 Sep 27, 2026
de66e66
Validate accepted handoff replay identity and clarify pending allocat…
benhook1013 Sep 28, 2026
222c5e4
Align Redis scheduler claim identity with namespace authority
benhook1013 Sep 28, 2026
47e4186
Reconcile 5C/5D successor with retention parent
benhook1013 Sep 28, 2026
79926ff
Prove post-evaluation routing fence after parent reconciliation
benhook1013 Sep 28, 2026
58a6e31
fix: reconcile failed handoff intent and skipped preflight safely
benhook1013 Sep 29, 2026
13a07d3
Separate proposed effect allocator from accepted replay contract
benhook1013 Sep 29, 2026
66246a4
Merge reviewed retention parent; gate unfenced receivers and retain S…
benhook1013 Sep 30, 2026
ccd3209
Merge commit 'cef12f8b9e58cec837a090fccac4789354f80792' into codex/5c…
benhook1013 Sep 30, 2026
358fc22
Allow review stops without blocking active runs
benhook1013 Sep 30, 2026
6b819d0
Consume bridge runtime and contract review corrections
benhook1013 Sep 30, 2026
3094f11
Preserve review controller prerequisite ancestry
benhook1013 Sep 30, 2026
5559c05
Preserve combined runtime and controller prerequisite ancestry
benhook1013 Sep 30, 2026
3f0375e
Retain corrected runtime proof links from prerequisite
benhook1013 Sep 30, 2026
680380b
Align canonical scripting and effect contracts with proven runtime bo…
benhook1013 Sep 30, 2026
f8af1b5
Reconcile combined #2909 prerequisite while preserving #2839 contract…
benhook1013 Sep 30, 2026
b99b325
Preserve #2839 unique patch above reviewed controller preparation
benhook1013 Sep 30, 2026
e34135a
Merge commit '7e2016bfc83ca38f1618021f9b1302896146d700' into codex/5c…
benhook1013 Sep 30, 2026
a6d51c7
Merge commit 'd929bcd58af475c5365640f749dc06a315151966' into codex/5c…
benhook1013 Sep 30, 2026
f88323c
Merge corrected review-stop prerequisite into runtime corpus
benhook1013 Sep 30, 2026
6b00473
Propagate reviewed prerequisite fixes without changing corpus patch
benhook1013 Sep 30, 2026
8443bf9
Reconcile reviewed parent handoff guards into runtime corpus
benhook1013 Sep 30, 2026
e4a87b4
Carry receiver-gate proof qualifications into runtime corpus
benhook1013 Sep 30, 2026
1534ddd
Reconcile receiver-gated handoff proof from prerequisite
benhook1013 Sep 30, 2026
1e632be
Preserve child scope after handoff diagnostic corrections
benhook1013 Sep 30, 2026
a45330c
Reconcile retained-command parent corrections into runtime corpus
benhook1013 Sep 30, 2026
1a97d36
Preserve receiver qualifiers through controller parent reconciliation
benhook1013 Sep 30, 2026
fda9bc8
Reconcile published review runtime corrections into architecture succ…
benhook1013 Sep 30, 2026
6524fdf
Reconcile published lifecycle failure-boundary fixes from #2909
benhook1013 Sep 30, 2026
b8341e6
Reconcile published intent rollback and controller proof from #2909
benhook1013 Sep 30, 2026
228516d
Reconcile #2909 develop-only publisher input update
benhook1013 Sep 30, 2026
6f96700
Merge reviewed runtime prerequisite fixes into architecture successor
benhook1013 Sep 30, 2026
145b362
Propagate reviewed controller overlap and Automation retry corrections
benhook1013 Sep 30, 2026
79230b0
Reconcile validated unresolved-handoff repair from runtime prerequisite
benhook1013 Sep 30, 2026
be56521
Preserve receiver and queue qualifications alongside parent status de…
benhook1013 Sep 30, 2026
71b02a8
Align successor with the reconciled runtime prerequisite
benhook1013 Sep 30, 2026
9820bf9
Retain defensive receiver classification proof from parent
benhook1013 Sep 30, 2026
1ec7842
Clarify recovery, watermark and inspection contract boundaries
benhook1013 Sep 30, 2026
dbf84e9
Merge commit '10cbb1ca1ab845590446fccac2f4af8884438b49' into codex/5c…
benhook1013 Sep 30, 2026
582d725
Clarify timer recovery isolation and current contract proof
benhook1013 Sep 30, 2026
7921ccd
Merge commit 'f97a153f5' into codex/5c-5d-successor
benhook1013 Sep 30, 2026
be8fceb
docs: narrow pending effect allocation mechanics
benhook1013 Sep 30, 2026
64ddb1e
docs: correct replay identity and terminal proof boundaries
benhook1013 Oct 1, 2026
dc25693
docs(runtime): align charge, replay and recovery contract owners
benhook1013 Oct 1, 2026
d17e15a
docs(runtime): align handoff identities and fenced action intent boun…
benhook1013 Oct 1, 2026
a5c9156
docs: align scheduler identity and fail-closed admission proof
benhook1013 Oct 1, 2026
d4ffada
docs: clarify continuity transitions and gated break-glass writes
benhook1013 Oct 1, 2026
8a8bb24
docs: separate current wire and staging proof from target behavior
benhook1013 Oct 1, 2026
db22bf3
docs: qualify pre-staging loss and centralize proof guidance
benhook1013 Oct 1, 2026
42c2cdd
docs: clarify work-bearing identity and lifecycle result evidence
benhook1013 Oct 1, 2026
850b40c
docs: align runtime authority and implementation status
benhook1013 Oct 1, 2026
a0e1611
docs: require complete tick settlement and qualified recovery
benhook1013 Oct 1, 2026
279d267
docs: close replay fencing and target-state contract gaps
benhook1013 Oct 1, 2026
2df98b5
Merge remote-tracking branch 'origin/develop' into codex/5c-5d-successor
benhook1013 Oct 1, 2026
ccddab6
docs: qualify full-version publication participant gate
benhook1013 Oct 1, 2026
033c45f
docs: require maintenance admission for incident ledger repair
benhook1013 Oct 1, 2026
662e947
docs: align replay guards and recovery admission contracts
benhook1013 Oct 1, 2026
9bff813
docs: qualify target charge records and complete audit schema identity
benhook1013 Oct 1, 2026
80573cd
docs: align proof records and fence resume identity reuse
benhook1013 Oct 1, 2026
2fd21cf
docs: align replay proof and complete participant terminal evidence
benhook1013 Oct 1, 2026
fb5bc2e
docs: preserve accepted persisted child identity mapping
benhook1013 Oct 1, 2026
28df7b2
docs: retain atomic replay marker and tracker owner boundaries
benhook1013 Oct 1, 2026
0664db7
docs: fence recovery and distinguish live incident capabilities
benhook1013 Oct 1, 2026
c74f889
fix: align replay recovery and reviewed runtime authority contracts
benhook1013 Oct 1, 2026
1e6ab8a
Align reviewed recovery authority and owning contract references
benhook1013 Oct 1, 2026
1dd0ff8
Clarify script pin evidence and fail-closed replay cutover
benhook1013 Oct 1, 2026
9e9d7ee
Clarify per-entity sequencing and bounded maintenance scope
benhook1013 Oct 1, 2026
ad467b0
docs(runtime): distinguish current safety seams from target recovery …
benhook1013 Oct 1, 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
3 changes: 2 additions & 1 deletion design/architecture/decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Validation precedence is fixed: first parse every checked queue row and validate
| [ADR 0072](./adr-0072-class-specific-timer-durability-and-recovery.md) | Accepted | `AS-1.4` | `GR-1.2`, `GR-2.3`, `AS-1.5`, `SF-1.4` | Class-specific timer durability and recovery |
| [ADR 0073](./adr-0073-evidence-calibrated-tick-budgets-and-lock-ttls.md) | Accepted | `SF-1.4` | `GR-1.2`, `GR-1.3`, `PO-4.2`, `AR-2.3` | Evidence-calibrated tick budgets and lock TTLs |
| [ADR 0074](./adr-0074-one-entity-lock-per-redis-script.md) | Accepted | `GR-1.3` | `SF-2.2`, `GR-4.1`, `PO-4.4` | One entity lock per Redis script |
| [ADR 0075](./adr-0075-depth-cost-and-count-bounds-for-generated-effect-chains.md) | Accepted | `GR-4.1` | `GR-1.2`, `AS-1.2`, `PO-4.2` | Depth, cost, and count bounds for generated effect chains |
| [ADR 0075](./adr-0075-depth-cost-and-count-bounds-for-generated-effect-chains.md) | Accepted | `GR-4.1` | `GR-1.2`, `AS-1.2`, `PO-4.2` | Depth, cost, and count bounds with replay-stable owner-defined child identity and lineage |
| [ADR 0076](./adr-0076-failure-class-specific-durable-tick-retries.md) | Accepted | `GR-1.2` | `PO-2.4`, `PO-4.2`, `SF-2.3` | Failure-class-specific durable tick retries |
| [ADR 0077](./adr-0077-durable-global-effect-fanout-and-lightweight-idle-ticks.md) | Accepted | `GR-1.2` | `GR-2.1`, `AS-1.4`, `SF-1.4`, `PO-4.2` | Durable global-effect fan-out and lightweight idle ticks |
| [ADR 0078](./adr-0078-digest-bound-workflow-and-step-retry-identities.md) | Accepted | `SF-2.3` | `SF-2.4`, `SF-1.2` | Digest-bound workflow and step retry identities |
Expand Down Expand Up @@ -277,6 +277,7 @@ Validation precedence is fixed: first parse every checked queue row and validate
| [ADR 0180](./adr-0180-account-owned-hosted-terms-acceptance-gate.md) | Accepted | `AA-1.3` | `AA-1.5`, `AR-1.1`, `AR-1.4`, `AR-1.5`, `EA-3.2`, `PO-1.3`, `SF-2.3` | Account-owned hosted-terms catalog, acceptance evidence, and official-hosted creator mutation gate |
| [ADR 0181](./adr-0181-changed-hosted-terms-decline-and-existing-content-continuity.md) | Accepted | `PO-1.3` | `AA-1.3`, `AA-1.4`, `AA-1.5`, `AR-1.1`, `AR-1.4`, `AR-1.5`, `EA-3.2`, `SF-2.3` | Changed hosted-terms decline, prior-terms continuity, lifecycle-reducing access, and finite transition |
| [ADR 0182](./adr-0182-separated-hosted-runtime-and-certificate-identity-lifecycles.md) | Accepted | `PO-3.2` | `PO-3.1`, `PO-4.4`, `SF-1.3`, `PO-1.1` | Separated hosted runtime and certificate-identity lifecycles |
| [ADR 0183](./adr-0183-deterministic-effect-id-allocation-and-replay-binding.md) | Proposed - Pending Human Review | `GR-1.2` | `GR-1.4`, `GR-4.1`, `AS-1.2`, `AS-1.4`, `SF-1.4`, `SF-2.3`, `PO-4.2` | Pending command-plan ordering, `planOrdinal`, command-root allocation, UUIDv7 scalar, canonical serialization, and additional child/fan-out allocation mechanics |
| [ADR 0184](./adr-0184-emergency-tcp-proxy-identity-withdrawal.md) | Accepted | `SF-1.3` | `PO-2.1`, `PO-2.2`, `PO-3.2`, `PO-4.4` | Emergency trust cutoff for a withdrawn TCP Proxy bridge identity |

Capability identifiers are defined in the [FireMUD Product Capability Taxonomy](../../product/capability-taxonomy.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,38 @@

Superseded by [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md)

This ADR preserves historical ingress-idempotency context, not an independent current identity contract. [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md) owns parent-event and frozen-handler execution identity; [Scripting Normative Contract Tables](../system-architecture-scripting-normative-contract-tables.md#table-1-trigger-identity-required-fields) owns the current endpoint-specific Trigger Identity fields and scheduler candidate preimage.

## Implementation Status

The live `ScriptScheduleInstanceServiceImpl.TimerFiringCandidate.identity()` implementation remains narrower than the canonical scheduler preimage until the target and owner/plugin fields are carried. It currently resolves `playableStateScope` and emits `eventSchemaVersion=v1`, `isDryRun=false`, and `triggerMode=TRIGGER_MODE_CATCH_UP`; those values are explicit inputs even while they remain constant. It has no cross-producer golden-vector proof for the canonical preimage or its numeric formatting rules. See the [automation and scheduler runtime tracker](../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#capability-status).
The live `ScriptScheduleInstanceServiceImpl.TimerFiringCandidate.identity()` implementation remains narrower than the canonical scheduler preimage until the target and owner/plugin fields are carried. It currently uses resolved `playableStateScope` in the identity preimage and emits `eventSchemaVersion=v1`, `isDryRun=false`, and `triggerMode=TRIGGER_MODE_CATCH_UP`; authoritative `playableStateNamespaceId` identity and separate non-identity scope evidence are target-state. The current values remain explicit preimage inputs even while they are constant. It has no cross-producer golden-vector proof for the canonical preimage or its numeric formatting rules. See the [automation and scheduler runtime tracker](../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#capability-status).

## Context

Event-ingress RPCs into the Automation & Scripting Service must be idempotent under retries and failover. Multiple documents previously used inconsistent dedupe keys (for example omitting `entityId`, `eventType`, `scriptPatchVersion`, and `regionEpoch`), which creates ambiguity and collision risk.

## Decision

Automation & Scripting treats event ingress as at-most-once per **Trigger Identity**. The exact endpoint-specific field matrix is owned by [Scripting Normative Contract Tables](../system-architecture-scripting-normative-contract-tables.md#table-1-trigger-identity-required-fields) so the ADR and runtime contract cannot evolve as competing tuples.
The original decision treated event ingress as at-most-once per **Trigger Identity**. Current endpoint-specific identity semantics are owned by [Scripting Normative Contract Tables](../system-architecture-scripting-normative-contract-tables.md#table-1-trigger-identity-required-fields) and [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md); the notes below preserve context without defining a competing tuple.

- Gameplay/runtime handler identity includes the applicable `tenantId`, `gameInstanceId`, resolved `playableStateScope`, `regionId`, `regionEpoch`, `entityId`, `scriptId`, `eventType`, `eventSchemaVersion`, `scriptPatchVersion`, `scriptEventId`, and `isDryRun` fields.
- `isDryRun` is always an identity dimension so live and test execution cannot collide.
- Scheduler/timer identity additionally carries its due point and trigger mode. The canonical scheduler preimage fields are serialized in this fixed order: `<tenantId, gameInstanceId, playableStateScope, stableOwnerKind, stableOwnerId, regionId, regionEpoch, entityId when targetScopeType=ENTITY, scriptId when core-owned, eventType, eventSchemaVersion, scriptPatchVersion, scriptPinEpoch, scheduleDefinitionId, targetScopeType, targetScopeId, duePoint, isDryRun, triggerMode, pluginId when plugin-owned, pluginVersionId when plugin-owned, bindingId when plugin-owned, pluginActivationEpoch when plugin-owned, resumeWindowId when triggerMode=CATCH_UP>`. Fields marked `when ...` are omitted, not replaced by empty or sentinel values, when their branch does not apply; `targetScopeType` makes the target selector explicit and `stableOwnerKind` makes the core/plugin owner branch explicit. Thus `scriptEventId` itself is never part of this preimage, and `resumeWindowId` is absent for non-catch-up triggers. `duePoint` is exactly one tagged value: `dueTickId:<value>` for tick-aligned schedules or `dueAt:<epochMillis>` for wall-clock timers. Any additional scheduler schema version or trigger mode must become an explicit deterministic-ID input before it is admitted.
- The canonical target preimage is the fixed-order, length-prefixed UTF-8 serialization that `ScriptScheduleInstanceServiceImpl.TimerFiringCandidate.identity()` must implement. Each field is encoded as its UTF-8 byte length rendered as unsigned base-10 ASCII decimal with no leading zeroes, followed by a colon and its unescaped UTF-8 value; fields are concatenated without separators. Numeric identity values therefore use their canonical base-10 ASCII spelling (for example, `0`, `7`, and `-1`), and the prefix length counts UTF-8 bytes rather than Unicode code points. Semantic validation still controls which numeric values are admissible; deterministic decimal serialization does not make an otherwise invalid value valid. Boolean values serialize canonically as lowercase `true` or `false`. Enum values serialize as the contract-declared enum symbol/name, never an ordinal, localized spelling, or other implementation-specific representation. This permits delimiters and arbitrary UTF-8 text without creating tuple collisions. Hash those bytes with SHA-256, encode the digest as lowercase hexadecimal, retain the first 60 hexadecimal characters, and prefix the result with `timer-`. Cross-producer golden vectors must cover empty values, non-ASCII values, delimiters, negative and zero numeric values, both boolean values, representative enum branches, and both tagged due-point branches before this identity is considered proven.
- Tenant-readiness `onLoad` follows the explicit non-runtime exception in the normative table and does not invent sentinel runtime, region, or entity identity.
- Plugin-trigger identity additionally carries plugin and binding identity where the invocation unit is plugin- or binding-scoped.
- Presented `playableStateScope` is exact-validated evidence, not a uniqueness discriminator. Stale or mismatched scope remains fenced until authoritative reconciliation; a namespace-keyed identity may be reused only if authority proves scope unchanged. An authority-proven transition starts a new playable-state lifecycle and namespace.
- Live/test separation, tenant-readiness `onLoad` exceptions, and plugin/binding identity follow the applicable fields and branches in the normative table and ADR 0172; this superseded ADR does not define their current schema.
- Scheduler/timer candidate identity, including its conditional branches, serialization, hash, and proof requirements, is owned by [Table 1's Scheduler Candidate Identity Preimage](../system-architecture-scripting-normative-contract-tables.md#scheduler-candidate-identity-preimage-normative).

Ordinary event-ingress callers must reuse the same full applicable Trigger Identity, including the same `scriptEventId`, when retrying a logically identical trigger. Scheduler retries instead reuse the same complete due-candidate/firing-claim identity and its deterministically derived `scriptEventId`; that derived ID is propagated into resolved handler identities but remains excluded from `TimerFiringCandidate.identity()`'s scheduler preimage.
Retry identity and handler materialization follow the current Trigger Identity and scheduler-candidate owners linked above; the original decision's retry rule is historical context rather than a separate current specification.

## Consequences

- Protos and service contracts must carry enough fields to represent the endpoint-specific Trigger Identity, including runtime scope, dry-run namespace, and due-point or plugin dimensions where applicable.
- Audit records (`script_event_audit`) must be keyed by Trigger Identity, not by `scriptEventId` alone.
- Current proto and service requirements for endpoint-specific Trigger Identity and frozen handler execution are owned by [Scripting Normative Contract Tables](../system-architecture-scripting-normative-contract-tables.md#table-1-trigger-identity-required-fields) and [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md); this ADR's original consequence is historical context.
- Audit records (`script_event_audit`) follow the current Trigger Identity contract, not `scriptEventId` alone.

## Implementation and Proof Obligations

Prove the endpoint-specific Trigger Identity field matrix, fixed-order scheduler preimage, length-prefixed UTF-8 serialization, canonical numeric, boolean, and enum forms, optional-branch omission, deterministic hashing, cross-producer golden vectors, and exact retry reuse without collisions or duplicate logical triggers. Select and report the required checks and evidence under [Validation and Runtime Proof](../../developer-workflows/validation-and-runtime-proof.md); record execution results in PR/CI evidence or implementation-tracking documents rather than in this decision record.
Current implementation and proof obligations are owned by [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md) and the canonical identity matrix and scheduler-preimage requirements in [Scripting Normative Contract Tables](../system-architecture-scripting-normative-contract-tables.md#table-1-trigger-identity-required-fields). Select and report checks under [Validation and Runtime Proof](../../developer-workflows/validation-and-runtime-proof.md); this superseded ADR is not an independent proof authority.

## Supersession

- Replacement ADR: [ADR 0172](./adr-0172-parent-event-and-frozen-handler-execution-identity.md)

## References

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Accepted

## Implementation Status

This decision is partially implemented. Stage-qualified outcomes exist, but the database-save/Redis-stage gap, durable per-dispatch custody, and state-sensitive duplicate handling do not yet satisfy the accepted handoff boundary. See the [automation and scheduler runtime tracker](../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#capability-status) for current implementation and proof status.
This decision is partially implemented. Stage-qualified outcomes exist, but durable outbox persistence and queue-pointer publication, durable per-dispatch custody, and state-sensitive duplicate handling do not yet satisfy the accepted handoff boundary. See the [automation and scheduler runtime tracker](../../project-management/implementation-tracking/automation-and-scheduler-runtime.md#capability-status) for current implementation and proof status.

## Decision Record

Expand All @@ -17,23 +17,21 @@ This decision is partially implemented. Stage-qualified outcomes exist, but the

## Context

Scripting produces commands that must flow into the tick system. The historical design included Redis-based staging (`automation:queue:*` and the former `automation:tick:*` path) and internal gRPC handoff to Game Session. The `automation:tick:*` path is retired and not live; current automation stages work through `automation:queue:*` and hands gameplay enqueue to Game Session. Without a clear contract, “success” can mean either “DSL ran” or “effects will happen”, which undermines rollback semantics and operator trust.
Scripting produces commands that must flow into the tick system. The historical design included Redis-based staging (the former `automation:tick:*` path), which is retired and not live; current automation stages work through `automation:queue:*` discovery pointers and hands gameplay enqueue to Game Session. The target design records script work items in a durable PostgreSQL outbox and publishes instance-aware queue pointers in Cache/Rate-Limit Redis. Queue pointers are disposable discovery indexes, not work truth; durable outbox rows and Game Session handoff custody determine recovery and success. The current implementation has narrower work-item persistence and queue-pointer paths, but does not yet prove this accepted durable publication and custody boundary. Without a clear contract, “success” can mean either “DSL ran” or “effects will happen”, which undermines rollback semantics and operator trust.

## Decision

- The historical generic label `script_event_audit.finalOutcome=success` is superseded **only as a label** by [ADR 0064](adr-0064-stage-qualified-script-outcomes.md). For a live command-producing handler, `finalStage=TICK_HANDOFF` and `finalOutcome=handoff_accepted` mean every required child dispatch is in Game Session custody: each child is either durably adopted/admitted, or covered by a committed per-child durable re-drive obligation that Game Session owns for outcome convergence. This is not a claim that gameplay effects were applied. The canonical stage-qualified outcomes are defined in the [scripting normative outcome table](../system-architecture-scripting-normative-contract-tables.md#canonical-finaloutcome-values-normative).
- `completed_no_commands`, `readiness_success`, and `dry_run_success` remain distinct non-handoff outcomes in their declared branches.
- Local `automation:queue:*` staging is only pending Automation work-item discovery and is not handoff acceptance. A durable remote coordinator or follow-up schedule counts as the per-child re-drive obligation only when Game Session transactionally accepts it under stable identities; acceptance never means that the target tick has executed.
- In the target state, the durable PostgreSQL outbox/work-item row is the pending-work record. An instance-aware `automation:queue:*` pointer in Cache/Rate-Limit Redis is only a disposable discovery index; it is neither handoff acceptance nor work truth. A durable remote coordinator or follow-up schedule counts as the per-child re-drive obligation only when Game Session transactionally accepts it under stable identities; acceptance never means that the target tick has executed.
- The pipeline must record stage-aware outcomes so operators can see where a trigger failed to progress (DSL evaluation vs persistence vs handoff/enqueue).
- Duplicate lookup compares the immutable dispatch digest and returns accepted only from a state that proves handoff custody. A received-but-unstaged volatile row must be re-driven, reported pending or not accepted, or exposed as terminal `NOT_APPLIED`; it must never become an unconditional accepted no-op.
- If Redis staging queues are reset/lost, the system must either:
- re-drive delivery from a durable outbox of script work items, or
- record explicit “dropped before tick enqueue” outcomes and never report `handoff_accepted`.
- Duplicate lookup compares the immutable dispatch digest and returns accepted only from a state that proves handoff custody. A received-but-not-yet-handed-off durable outbox/work-item row must be re-driven, reported pending or not accepted, or exposed as terminal `NOT_APPLIED`; it must never become an unconditional accepted no-op because a discovery pointer is absent.
- If `automation:queue:*` discovery pointers in Cache/Rate-Limit Redis are reset or lost, the system must rebuild them from durable PostgreSQL outbox/work-item rows and re-drive delivery; pointer loss is not a dropped-work outcome. If durable outbox persistence fails before Game Session handoff, the system must record an explicit persistence/drop outcome and never report `handoff_accepted`.

## Consequences

- The Automation & Scripting Service must have a durable representation of “pending script work items” if the target behavior is “do not drop silently”.
- Any best-effort Redis buffer (`automation:queue:*`) cannot be the sole record of admitted work if `handoff_accepted` implies tick acceptance.
- Any Cache/Rate-Limit Redis discovery pointer (`automation:queue:*`) cannot be the sole record of admitted work if `handoff_accepted` implies tick acceptance.
- A handler may be `handoff_accepted` even when one of its commands later becomes `NOT_APPLIED` or `ABANDONED`; the authoritative per-command status explains that later result.

## References
Expand Down
Loading
Loading