cloudflare
@fungi.computer/app-release / cloudflare
cloudflare
Section titled “cloudflare”Type Aliases
Section titled “Type Aliases”AssetR2Object
Section titled “AssetR2Object”AssetR2Object =
object
Native R2 metadata: checksums are validated by R2, not custom metadata claims.
Properties
Section titled “Properties”version
Section titled “version”
readonlyversion:string
readonlysize:number
checksums
Section titled “checksums”
readonlychecksums:object
sha256?
Section titled “sha256?”
readonlyoptionalsha256?:ArrayBuffer
AssetR2Bucket
Section titled “AssetR2Bucket”AssetR2Bucket =
object
Native R2 operations required to verify and serve one asset build.
Methods
Section titled “Methods”head()
Section titled “head()”head(
key):Promise<AssetR2Object|null>>
Read immutable object metadata without loading its body.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<AssetR2Object | null>
get(
key):Promise<AssetR2Object&object|null>>
Read immutable object metadata and its streaming body.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<AssetR2Object & object | null>
AppReleaseTransitionObligation
Section titled “AppReleaseTransitionObligation”AppReleaseTransitionObligation =
object
Durable catalog-scoped fact awaiting delivery to a separately owned Team.
Properties
Section titled “Properties”sequence
Section titled “sequence”
readonlysequence:number
transition
Section titled “transition”
readonlytransition:ReleaseTransition
transitionId
Section titled “transitionId”
readonlytransitionId:AppTransitionId
affectedPublicSurfaceIds
Section titled “affectedPublicSurfaceIds”
readonlyaffectedPublicSurfaceIds: readonlyPublicSurfaceId[]
affectedSurfaces
Section titled “affectedSurfaces”
readonlyaffectedSurfaces: readonlyAppReleaseAffectedSurface[]
Catalog-owned material needed by a Team without a second catalog read.
enumeration
Section titled “enumeration”
readonlyenumeration:object
The last opaque Global Team cursor and whether enumeration is complete.
cursor
Section titled “cursor”
readonlycursor:string|null
complete
Section titled “complete”
readonlycomplete:boolean
readonlystate:"pending"|"acknowledged"
AppReleaseAffectedSurface
Section titled “AppReleaseAffectedSurface”AppReleaseAffectedSurface =
object
Catalog-owned public-Surface material carried with a transition obligation.
Properties
Section titled “Properties”publicSurfaceId
Section titled “publicSurfaceId”
readonlypublicSurfaceId:PublicSurfaceId
readonlyappId:AppId
stableRoute
Section titled “stableRoute”
readonlystableRoute:StableRoute
AppReleaseTeamRecipient
Section titled “AppReleaseTeamRecipient”AppReleaseTeamRecipient =
object
Durable delivery state for one Team recipient of a transition obligation.
Properties
Section titled “Properties”teamId
Section titled “teamId”
readonlyteamId:string
readonlystate:"pending"|"applied"|"no-op"|"expired"
AppReleaseTeamRecipientPage
Section titled “AppReleaseTeamRecipientPage”AppReleaseTeamRecipientPage =
object
One ordered page of Team IDs returned by the separately owned Team directory.
Properties
Section titled “Properties”cursor?
Section titled “cursor?”
readonlyoptionalcursor?:string|null
Null identifies the first page; all later cursors remain opaque strings.
nextCursor?
Section titled “nextCursor?”
readonlyoptionalnextCursor?:string|null
teamIds
Section titled “teamIds”
readonlyteamIds: readonlystring[]
complete
Section titled “complete”
readonlycomplete:boolean
AppReleaseTeamRecipientOutcome
Section titled “AppReleaseTeamRecipientOutcome”AppReleaseTeamRecipientOutcome =
"applied"|"no-op"|"expired"
Terminal delivery outcome recorded for one Team recipient.
AppReleaseTransitionObligationStore
Section titled “AppReleaseTransitionObligationStore”AppReleaseTransitionObligationStore =
object
D1-only at-least-once read/ack seam; Team routing remains outside App Release.
Methods
Section titled “Methods”readByTransitionId()
Section titled “readByTransitionId()”readByTransitionId(
transitionId):Promise<AppReleaseStoreResult<AppReleaseTransitionObligation| {kind:"absent"; }>>
Read one obligation by its immutable transition identity, or report it absent.
Parameters
Section titled “Parameters”transitionId
Section titled “transitionId”Returns
Section titled “Returns”Promise<AppReleaseStoreResult<AppReleaseTransitionObligation
| { kind: "absent"; }>>
read()
Section titled “read()”read(
options):Promise<AppReleaseStoreResult<readonlyAppReleaseTransitionObligation[]>>
Read pending obligations after a sequence cursor in ascending sequence order.
Parameters
Section titled “Parameters”options
Section titled “options”afterSequence?
Section titled “afterSequence?”number
limit?
Section titled “limit?”number
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<readonly
AppReleaseTransitionObligation[]>>
recordTeamRecipientPage()
Section titled “recordTeamRecipientPage()”recordTeamRecipientPage(
sequence,page):Promise<AppReleaseStoreResult<AppReleaseTransitionObligation| {kind:"absent"; }>>
Persist the next ordered Team-recipient page; identical replays are idempotent.
Parameters
Section titled “Parameters”sequence
Section titled “sequence”number
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<AppReleaseTransitionObligation
| { kind: "absent"; }>>
readPendingTeamRecipients()
Section titled “readPendingTeamRecipients()”readPendingTeamRecipients(
options):Promise<AppReleaseStoreResult<readonlyAppReleaseTeamRecipient[]>>
Read pending recipients for one obligation in stable Team-ID order.
Parameters
Section titled “Parameters”options
Section titled “options”sequence
Section titled “sequence”number
limit?
Section titled “limit?”number
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<readonly
AppReleaseTeamRecipient[]>>
recordTeamRecipientOutcome()
Section titled “recordTeamRecipientOutcome()”recordTeamRecipientOutcome(
sequence,teamId,outcome):Promise<AppReleaseStoreResult<AppReleaseTeamRecipient| {kind:"absent"; }>>
Record a pending recipient’s terminal outcome; conflicting replays fail.
Parameters
Section titled “Parameters”sequence
Section titled “sequence”number
teamId
Section titled “teamId”string
outcome
Section titled “outcome”AppReleaseTeamRecipientOutcome
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<AppReleaseTeamRecipient
| { kind: "absent"; }>>
acknowledge()
Section titled “acknowledge()”acknowledge(
sequence):Promise<AppReleaseStoreResult<AppReleaseTransitionObligation| {kind:"absent"; }>>
Acknowledge only after enumeration is complete and no recipients remain pending.
Parameters
Section titled “Parameters”sequence
Section titled “sequence”number
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<AppReleaseTransitionObligation
| { kind: "absent"; }>>
AppReleaseSurfaceTransitionBasis
Section titled “AppReleaseSurfaceTransitionBasis”AppReleaseSurfaceTransitionBasis = {
kind:"absent"; } | {kind:"ambiguous"; } | {kind:"none";appId:AppId;publicSurfaceId:PublicSurfaceId; } | {kind:"selected";appId:AppId;publicSurfaceId:PublicSurfaceId;releaseId:ReleaseId;sequence:number;eligibility:"eligible"|"ineligible";checkedAt:number; }
Selected Release basis from the same D1 authority snapshot, including its transition sequence.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ kind: "absent"; }
Type Literal
Section titled “Type Literal”{ kind: "ambiguous"; }
Type Literal
Section titled “Type Literal”{ kind: "none"; appId: AppId; publicSurfaceId:
PublicSurfaceId; }
Type Literal
Section titled “Type Literal”{ kind: "selected"; appId: AppId; publicSurfaceId:
PublicSurfaceId; releaseId:
ReleaseId; sequence: number; eligibility:
"eligible" | "ineligible"; checkedAt: number; }
readonlykind:"selected"
readonlyappId:AppId
publicSurfaceId
Section titled “publicSurfaceId”
readonlypublicSurfaceId:PublicSurfaceId
releaseId
Section titled “releaseId”
readonlyreleaseId:ReleaseId
sequence
Section titled “sequence”
readonlysequence:number
eligibility
Section titled “eligibility”
readonlyeligibility:"eligible"|"ineligible"
checkedAt
Section titled “checkedAt”
readonlycheckedAt:number
Authority-read start time; consumers may only shorten its horizon.
AppReleaseD1QueryResult
Section titled “AppReleaseD1QueryResult”AppReleaseD1QueryResult =
object
Structural result returned by the D1 operations used by App Release.
Properties
Section titled “Properties”success
Section titled “success”
readonlysuccess:boolean
Whether D1 completed the operation successfully.
results
Section titled “results”
readonlyresults: readonlyunknown[]
Untrusted row values returned by the operation.
AppReleaseD1PreparedStatement
Section titled “AppReleaseD1PreparedStatement”AppReleaseD1PreparedStatement =
object
Structural prepared-statement surface needed by the D1-backed store.
Methods
Section titled “Methods”bind()
Section titled “bind()”bind(…
values):AppReleaseD1PreparedStatement
Bind positional values and return the statement to execute.
Parameters
Section titled “Parameters”values
Section titled “values”…unknown[]
Returns
Section titled “Returns”first()
Section titled “first()”first(
columnName?):Promise<object|null>>
Read the first row or selected column, or null when none exists.
Parameters
Section titled “Parameters”columnName?
Section titled “columnName?”string
Returns
Section titled “Returns”Promise<object | null>
all():
Promise<AppReleaseD1QueryResult>>
Read all matching rows.
Returns
Section titled “Returns”Promise<AppReleaseD1QueryResult>
run():
Promise<AppReleaseD1QueryResult>>
Execute a mutating statement.
Returns
Section titled “Returns”Promise<AppReleaseD1QueryResult>
AppReleaseD1Database
Section titled “AppReleaseD1Database”AppReleaseD1Database =
object
Structural D1 surface kept independent of Cloudflare vendor declarations.
Methods
Section titled “Methods”prepare()
Section titled “prepare()”prepare(
query):AppReleaseD1PreparedStatement
Prepare one SQL statement for binding and execution.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”batch()
Section titled “batch()”batch(
statements):Promise<readonlyAppReleaseD1QueryResult[]>
Execute a group of statements atomically in native D1.
Parameters
Section titled “Parameters”statements
Section titled “statements”readonly AppReleaseD1PreparedStatement[]
Returns
Section titled “Returns”Promise<readonly AppReleaseD1QueryResult[]>
AppReleaseR2Object
Section titled “AppReleaseR2Object”AppReleaseR2Object =
object
Structural R2 object surface needed by the artifact reader.
Properties
Section titled “Properties”version
Section titled “version”
readonlyversion:string
Native immutable object version checked for referenced App children.
readonlysize:number
Object size in bytes, checked before the body is buffered.
httpMetadata?
Section titled “httpMetadata?”
readonlyoptionalhttpMetadata?:object
HTTP metadata retained with the object, when present.
contentType?
Section titled “contentType?”
readonlyoptionalcontentType?:string
Declared media type for the stored object.
Methods
Section titled “Methods”arrayBuffer()
Section titled “arrayBuffer()”arrayBuffer():
Promise<ArrayBuffer>>
Read the immutable object body.
Returns
Section titled “Returns”Promise<ArrayBuffer>
AppReleaseR2Bucket
Section titled “AppReleaseR2Bucket”AppReleaseR2Bucket =
object
Structural R2 surface kept independent of Cloudflare vendor declarations.
Methods
Section titled “Methods”get(
key):Promise<AppReleaseR2Object|null>>
Read one object by its opaque storage key.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<AppReleaseR2Object | null>
ArtifactSnapshotPolicy
Section titled “ArtifactSnapshotPolicy”ArtifactSnapshotPolicy =
Readonly<{maxBytes:number;maxManifestBytes?:number; }>
Trusted composition limit for reading one immutable artifact.
Variables
Section titled “Variables”APP_RELEASE_D1_MIGRATION_V1
Section titled “APP_RELEASE_D1_MIGRATION_V1”
constAPP_RELEASE_D1_MIGRATION_V1: “\nCREATE TABLE IF NOT EXISTS app_release_apps (app_id TEXT PRIMARY KEY) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_releases (release_id TEXT PRIMARY KEY, app_id TEXT NOT NULL REFERENCES app_release_apps(app_id), artifact_ref TEXT NOT NULL, artifact_digest TEXT NOT NULL, source_revision TEXT NOT NULL, source_tree_digest TEXT NOT NULL, build_recipe_digest TEXT NOT NULL) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_release_verifications (release_id TEXT PRIMARY KEY REFERENCES app_release_releases(release_id), artifact_digest TEXT NOT NULL) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_release_verification_formats (release_id TEXT PRIMARY KEY REFERENCES app_release_releases(release_id), media_type TEXT NOT NULL) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_public_surfaces (public_surface_id TEXT PRIMARY KEY, app_id TEXT NOT NULL REFERENCES app_release_apps(app_id), stable_route TEXT NOT NULL) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_transitions (sequence INTEGER PRIMARY KEY AUTOINCREMENT, transition_id TEXT NOT NULL UNIQUE, operation_kind TEXT NOT NULL, idempotency_key TEXT NOT NULL, release_id TEXT NOT NULL, public_surface_id TEXT, UNIQUE (operation_kind, idempotency_key)) STRICT;\nCREATE TRIGGER IF NOT EXISTS app_release_apps_write_once BEFORE UPDATE ON app_release_apps BEGIN SELECT RAISE(ABORT, ‘App Release apps are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_releases_write_once BEFORE UPDATE ON app_release_releases BEGIN SELECT RAISE(ABORT, ‘App Release releases are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_verifications_write_once BEFORE UPDATE ON app_release_release_verifications BEGIN SELECT RAISE(ABORT, ‘App Release verifications are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_verification_formats_write_once BEFORE UPDATE ON app_release_release_verification_formats BEGIN SELECT RAISE(ABORT, ‘App Release verification formats are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_apps_append_only BEFORE DELETE ON app_release_apps BEGIN SELECT RAISE(ABORT, ‘App Release apps are append-only’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_releases_append_only BEFORE DELETE ON app_release_releases BEGIN SELECT RAISE(ABORT, ‘App Release releases are append-only’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_verifications_append_only BEFORE DELETE ON app_release_release_verifications BEGIN SELECT RAISE(ABORT, ‘App Release verifications are append-only’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_verification_formats_append_only BEFORE DELETE ON app_release_release_verification_formats BEGIN SELECT RAISE(ABORT, ‘App Release verification formats are append-only’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_public_surfaces_write_once BEFORE UPDATE ON app_release_public_surfaces BEGIN SELECT RAISE(ABORT, ‘App Release public Surfaces are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_public_surfaces_append_only BEFORE DELETE ON app_release_public_surfaces BEGIN SELECT RAISE(ABORT, ‘App Release public Surfaces are append-only’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_transitions_write_once BEFORE UPDATE ON app_release_transitions BEGIN SELECT RAISE(ABORT, ‘App Release transitions are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_transitions_append_only BEFORE DELETE ON app_release_transitions BEGIN SELECT RAISE(ABORT, ‘App Release transitions are append-only’); END;\n”
Append-only D1 schema for the A1.1 catalog, transition, and verification facts.
APP_RELEASE_D1_MIGRATION_V2
Section titled “APP_RELEASE_D1_MIGRATION_V2”
constAPP_RELEASE_D1_MIGRATION_V2: “\nCREATE INDEX IF NOT EXISTS app_release_public_surfaces_stable_route_idx ON app_release_public_surfaces (stable_route, public_surface_id);\nCREATE INDEX IF NOT EXISTS app_release_transitions_selected_surface_idx ON app_release_transitions (public_surface_id, operation_kind, sequence DESC) WHERE operation_kind IN (‘promotion’, ‘rollback’);\nCREATE INDEX IF NOT EXISTS app_release_transitions_revoked_release_idx ON app_release_transitions (release_id, operation_kind) WHERE operation_kind = ‘revocation’;\n”
Ordered A1.2 lookup indexes; apply after the immutable V1 catalog schema.
APP_RELEASE_D1_MIGRATION_V4
Section titled “APP_RELEASE_D1_MIGRATION_V4”
constAPP_RELEASE_D1_MIGRATION_V4: “\nCREATE TABLE IF NOT EXISTS app_release_transition_obligations (sequence INTEGER PRIMARY KEY REFERENCES app_release_transitions(sequence), transition_id TEXT NOT NULL UNIQUE, operation_kind TEXT NOT NULL, idempotency_key TEXT NOT NULL, release_id TEXT NOT NULL, public_surface_id TEXT, state TEXT NOT NULL CHECK(state IN (‘pending’,‘acknowledged’))) STRICT;\nCREATE INDEX IF NOT EXISTS app_release_transition_obligations_pending_idx ON app_release_transition_obligations(state, sequence);\nINSERT OR IGNORE INTO app_release_transition_obligations (sequence, transition_id, operation_kind, idempotency_key, release_id, public_surface_id, state) SELECT sequence, transition_id, operation_kind, idempotency_key, release_id, public_surface_id, ‘pending’ FROM app_release_transitions;\nCREATE TRIGGER IF NOT EXISTS app_release_transition_obligation_after_insert AFTER INSERT ON app_release_transitions BEGIN INSERT INTO app_release_transition_obligations (sequence, transition_id, operation_kind, idempotency_key, release_id, public_surface_id, state) VALUES (NEW.sequence, NEW.transition_id, NEW.operation_kind, NEW.idempotency_key, NEW.release_id, NEW.public_surface_id, ‘pending’); END;\n”
Catalog-scoped transition obligations for a future Team-owned dispatcher.
APP_RELEASE_D1_MIGRATION_V5
Section titled “APP_RELEASE_D1_MIGRATION_V5”
constAPP_RELEASE_D1_MIGRATION_V5: “\nCREATE TABLE IF NOT EXISTS app_release_transition_obligation_enumeration (sequence INTEGER PRIMARY KEY REFERENCES app_release_transition_obligations(sequence), cursor TEXT, started INTEGER NOT NULL DEFAULT 0 CHECK(started IN (0, 1)), complete INTEGER NOT NULL DEFAULT 0 CHECK(complete IN (0, 1))) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_transition_obligation_pages (sequence INTEGER NOT NULL REFERENCES app_release_transition_obligations(sequence), cursor TEXT, cursor_is_initial INTEGER NOT NULL CHECK(cursor_is_initial IN (0, 1)), cursor_key TEXT NOT NULL, next_cursor TEXT, complete INTEGER NOT NULL CHECK(complete IN (0, 1)), team_ids_json TEXT NOT NULL CHECK(json_valid(team_ids_json)), PRIMARY KEY(sequence, cursor_is_initial, cursor_key)) STRICT;\nCREATE TABLE IF NOT EXISTS app_release_transition_obligation_teams (sequence INTEGER NOT NULL REFERENCES app_release_transition_obligations(sequence), team_id TEXT NOT NULL CHECK(length(team_id) BETWEEN 1 AND 256), state TEXT NOT NULL CHECK(state IN (‘pending’, ‘applied’, ‘no-op’, ‘expired’)), PRIMARY KEY(sequence, team_id)) STRICT;\nCREATE INDEX IF NOT EXISTS app_release_transition_obligation_teams_pending_idx ON app_release_transition_obligation_teams(sequence, state, team_id);\nINSERT OR IGNORE INTO app_release_transition_obligation_enumeration(sequence) SELECT sequence FROM app_release_transition_obligations;\nCREATE TRIGGER IF NOT EXISTS app_release_transition_obligation_enumeration_after_insert AFTER INSERT ON app_release_transition_obligations BEGIN INSERT OR IGNORE INTO app_release_transition_obligation_enumeration(sequence) VALUES (NEW.sequence); END;\n”
Durable recipient enumeration and terminal delivery facts, applied after V4.
APP_RELEASE_D1_MIGRATION_V6
Section titled “APP_RELEASE_D1_MIGRATION_V6”
constAPP_RELEASE_D1_MIGRATION_V6: “\nDROP TRIGGER IF EXISTS app_release_transition_obligation_after_insert;\nCREATE TRIGGER app_release_transition_obligation_after_insert AFTER INSERT ON app_release_transitions WHEN NEW.operation_kind = ‘revocation’ BEGIN INSERT INTO app_release_transition_obligations (sequence, transition_id, operation_kind, idempotency_key, release_id, public_surface_id, state) VALUES (NEW.sequence, NEW.transition_id, NEW.operation_kind, NEW.idempotency_key, NEW.release_id, NEW.public_surface_id, ‘pending’); END;\nDELETE FROM app_release_transition_obligation_pages WHERE sequence IN (SELECT sequence FROM app_release_transition_obligations WHERE operation_kind != ‘revocation’);\nDELETE FROM app_release_transition_obligation_teams WHERE sequence IN (SELECT sequence FROM app_release_transition_obligations WHERE operation_kind != ‘revocation’);\nDELETE FROM app_release_transition_obligation_enumeration WHERE sequence IN (SELECT sequence FROM app_release_transition_obligations WHERE operation_kind != ‘revocation’);\nDELETE FROM app_release_transition_obligations WHERE operation_kind != ‘revocation’;\n”
Security delivery applies only to revocation; selection history remains append-only.
APP_RELEASE_D1_MIGRATION_V7
Section titled “APP_RELEASE_D1_MIGRATION_V7”
constAPP_RELEASE_D1_MIGRATION_V7: “\nCREATE TABLE IF NOT EXISTS app_release_team_publishers (app_id TEXT PRIMARY KEY REFERENCES app_release_apps(app_id), team_id TEXT NOT NULL CHECK(length(team_id) BETWEEN 1 AND 256), source_provider TEXT NOT NULL CHECK(source_provider IN (‘artifacts’,‘github’)), source_repository TEXT NOT NULL CHECK(length(source_repository) BETWEEN 1 AND 1024), source_branch TEXT NOT NULL CHECK(source_branch = ‘main’)) STRICT;\nCREATE INDEX IF NOT EXISTS app_release_team_publishers_team_idx ON app_release_team_publishers(team_id, app_id);\nCREATE TRIGGER IF NOT EXISTS app_release_team_publishers_write_once BEFORE UPDATE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_team_publishers_append_only BEFORE DELETE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are append-only’); END;\n”
Team-owned publisher/source facts, applied after the immutable App catalog.
APP_RELEASE_D1_MIGRATION_V8
Section titled “APP_RELEASE_D1_MIGRATION_V8”
constAPP_RELEASE_D1_MIGRATION_V8: “\nCREATE TABLE IF NOT EXISTS app_release_release_verification_metadata (release_id TEXT PRIMARY KEY REFERENCES app_release_release_verifications(release_id), artifact_digest TEXT NOT NULL, description_json TEXT NOT NULL CHECK(json_valid(description_json))) STRICT;\nCREATE TRIGGER IF NOT EXISTS app_release_verification_metadata_write_once BEFORE UPDATE ON app_release_release_verification_metadata BEGIN SELECT RAISE(ABORT, ‘App Release verification metadata is write-once’); END;\nCREATE TRIGGER IF NOT EXISTS app_release_verification_metadata_append_only BEFORE DELETE ON app_release_release_verification_metadata BEGIN SELECT RAISE(ABORT, ‘App Release verification metadata is append-only’); END;\n”
Immutable verified App description metadata, applied after V7.
APP_RELEASE_D1_MIGRATION_V9
Section titled “APP_RELEASE_D1_MIGRATION_V9”
constAPP_RELEASE_D1_MIGRATION_V9: “\nCREATE TABLE IF NOT EXISTS publisher_template_seed_receipts (template_repository TEXT NOT NULL, seed_revision TEXT NOT NULL, platform_app_id TEXT NOT NULL, source_revision TEXT NOT NULL, source_tree_digest TEXT NOT NULL, PRIMARY KEY (template_repository, seed_revision)) STRICT;\nCREATE TRIGGER IF NOT EXISTS publisher_template_seed_receipts_write_once BEFORE UPDATE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are write-once’); END;\nCREATE TRIGGER IF NOT EXISTS publisher_template_seed_receipts_append_only BEFORE DELETE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are append-only’); END;\n”
Publisher-owned verified source seed receipts, applied after V8.
APP_RELEASE_D1_MIGRATION_V10
Section titled “APP_RELEASE_D1_MIGRATION_V10”
constAPP_RELEASE_D1_MIGRATION_V10: “\nDROP TRIGGER app_release_team_publishers_write_once;\nDROP TRIGGER app_release_team_publishers_append_only;\nDROP INDEX app_release_team_publishers_team_idx;\nALTER TABLE app_release_team_publishers RENAME TO app_release_team_publishers_v9;\nCREATE TABLE app_release_team_publishers (app_id TEXT PRIMARY KEY REFERENCES app_release_apps(app_id), team_id TEXT NOT NULL CHECK(length(team_id) BETWEEN 1 AND 256), source_provider TEXT NOT NULL CHECK(source_provider IN (‘artifacts’,‘github’)), source_repository TEXT NOT NULL CHECK(length(source_repository) BETWEEN 1 AND 1024), source_branch TEXT NOT NULL CHECK(source_branch = ‘main’), template_app_id TEXT, template_seed_revision TEXT, CHECK((template_app_id IS NULL) = (template_seed_revision IS NULL))) STRICT;\nINSERT INTO app_release_team_publishers (app_id, team_id, source_provider, source_repository, source_branch, template_app_id, template_seed_revision) SELECT app_id, team_id, source_provider, source_repository, source_branch, NULL, NULL FROM app_release_team_publishers_v9;\nDROP TABLE app_release_team_publishers_v9;\nCREATE INDEX app_release_team_publishers_team_idx ON app_release_team_publishers(team_id, app_id);\nCREATE TRIGGER app_release_team_publishers_write_once BEFORE UPDATE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are write-once’); END;\nCREATE TRIGGER app_release_team_publishers_append_only BEFORE DELETE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are append-only’); END;\nDROP TRIGGER publisher_template_seed_receipts_write_once;\nDROP TRIGGER publisher_template_seed_receipts_append_only;\nALTER TABLE publisher_template_seed_receipts RENAME TO publisher_template_seed_receipts_v9;\nCREATE TABLE publisher_template_seed_receipts (template_repository TEXT NOT NULL, seed_revision TEXT NOT NULL, platform_app_id TEXT NOT NULL, source_revision TEXT NOT NULL, source_tree_digest TEXT NOT NULL, recipe_json TEXT CHECK(recipe_json IS NULL OR json_valid(recipe_json)), build_recipe_digest TEXT CHECK(build_recipe_digest IS NULL OR (length(build_recipe_digest) = 71 AND substr(build_recipe_digest, 1, 7) = ‘sha256:’ AND substr(build_recipe_digest, 8) NOT GLOB ‘*[^0-9a-f]*’)), CHECK((recipe_json IS NULL) = (build_recipe_digest IS NULL)), PRIMARY KEY (template_repository, seed_revision)) STRICT;\nINSERT INTO publisher_template_seed_receipts (template_repository, seed_revision, platform_app_id, source_revision, source_tree_digest, recipe_json, build_recipe_digest) SELECT template_repository, seed_revision, platform_app_id, source_revision, source_tree_digest, NULL, NULL FROM publisher_template_seed_receipts_v9;\nDROP TABLE publisher_template_seed_receipts_v9;\nCREATE TRIGGER publisher_template_seed_receipts_write_once BEFORE UPDATE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are write-once’); END;\nCREATE TRIGGER publisher_template_seed_receipts_append_only BEFORE DELETE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are append-only’); END;\nCREATE TRIGGER app_release_team_publishers_template_seed_pair BEFORE INSERT ON app_release_team_publishers WHEN (NEW.template_app_id IS NULL) != (NEW.template_seed_revision IS NULL) BEGIN SELECT RAISE(ABORT, ‘App publisher template seed pointer is incomplete’); END;\nCREATE TRIGGER app_release_team_publishers_artifacts_seed_required BEFORE INSERT ON app_release_team_publishers WHEN NEW.source_provider = ‘artifacts’ AND NEW.template_app_id IS NULL BEGIN SELECT RAISE(ABORT, ‘Artifacts App publisher requires verified template seed provenance’); END;\nCREATE TRIGGER app_release_team_publishers_artifacts_seed_verified BEFORE INSERT ON app_release_team_publishers WHEN NEW.source_provider = ‘artifacts’ AND NOT EXISTS (SELECT 1 FROM publisher_template_seed_receipts WHERE platform_app_id = NEW.template_app_id AND seed_revision = NEW.template_seed_revision AND recipe_json IS NOT NULL AND build_recipe_digest IS NOT NULL) BEGIN SELECT RAISE(ABORT, ‘Artifacts App publisher template seed is not verified’); END;\nCREATE TRIGGER publisher_template_seed_recipe_required BEFORE INSERT ON publisher_template_seed_receipts WHEN NEW.recipe_json IS NULL OR json_valid(NEW.recipe_json) = 0 OR NEW.build_recipe_digest IS NULL BEGIN SELECT RAISE(ABORT, ‘Publisher template seed recipe proof is incomplete’); END;\n”
Exact Team fork ancestry and Publisher recipe proof, applied after V9.
APP_RELEASE_D1_MIGRATION_V11
Section titled “APP_RELEASE_D1_MIGRATION_V11”
constAPP_RELEASE_D1_MIGRATION_V11: “\nCREATE TABLE IF NOT EXISTS publisher_artifacts_repositories (repository_name TEXT PRIMARY KEY CHECK(length(repository_name) BETWEEN 1 AND 128), provider_id TEXT NOT NULL CHECK(length(provider_id) > 0), default_branch TEXT NOT NULL CHECK(default_branch = ‘main’), remote TEXT NOT NULL CHECK(length(remote) > 0), parent_repository TEXT REFERENCES publisher_artifacts_repositories(repository_name), CHECK(parent_repository IS NULL OR parent_repository <> repository_name)) STRICT;\nCREATE TRIGGER IF NOT EXISTS publisher_artifacts_repositories_write_once BEFORE UPDATE ON publisher_artifacts_repositories BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts repository metadata is write-once’); END;\nCREATE TRIGGER IF NOT EXISTS publisher_artifacts_repositories_append_only BEFORE DELETE ON publisher_artifacts_repositories BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts repository metadata is append-only’); END;\nCREATE TABLE IF NOT EXISTS publisher_artifacts_repositories_pending (repository_name TEXT PRIMARY KEY CHECK(length(repository_name) BETWEEN 1 AND 128), provider_id TEXT NOT NULL CHECK(length(provider_id) > 0), default_branch TEXT NOT NULL CHECK(default_branch = ‘main’), remote TEXT NOT NULL CHECK(length(remote) > 0), parent_repository TEXT REFERENCES publisher_artifacts_repositories(repository_name), initial_token TEXT NOT NULL CHECK(length(initial_token) > 0), CHECK(parent_repository IS NULL OR parent_repository <> repository_name)) STRICT;\nCREATE TRIGGER IF NOT EXISTS publisher_artifacts_repositories_pending_write_once BEFORE UPDATE ON publisher_artifacts_repositories_pending BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts recovery state is write-once’); END;\n”
Publisher-owned Artifacts repository metadata, applied after V10.
APP_RELEASE_D1_FRESH_SCHEMA
Section titled “APP_RELEASE_D1_FRESH_SCHEMA”
constAPP_RELEASE_D1_FRESH_SCHEMA: “\nCREATE TABLE app_release_apps (app_id TEXT PRIMARY KEY) STRICT;\nCREATE TABLE app_release_releases (release_id TEXT PRIMARY KEY, app_id TEXT NOT NULL REFERENCES app_release_apps(app_id), artifact_ref TEXT NOT NULL, artifact_digest TEXT NOT NULL, source_revision TEXT NOT NULL, source_tree_digest TEXT NOT NULL, build_recipe_digest TEXT NOT NULL) STRICT;\nCREATE TABLE app_release_release_verifications (release_id TEXT PRIMARY KEY REFERENCES app_release_releases(release_id), artifact_digest TEXT NOT NULL) STRICT;\nCREATE TABLE app_release_release_verification_formats (release_id TEXT PRIMARY KEY REFERENCES app_release_releases(release_id), media_type TEXT NOT NULL) STRICT;\nCREATE TABLE app_release_public_surfaces (public_surface_id TEXT PRIMARY KEY, app_id TEXT NOT NULL REFERENCES app_release_apps(app_id), stable_route TEXT NOT NULL) STRICT;\nCREATE TABLE app_release_transitions (sequence INTEGER PRIMARY KEY AUTOINCREMENT, transition_id TEXT NOT NULL UNIQUE, operation_kind TEXT NOT NULL, idempotency_key TEXT NOT NULL, release_id TEXT NOT NULL, public_surface_id TEXT, UNIQUE (operation_kind, idempotency_key)) STRICT;\nCREATE INDEX app_release_public_surfaces_stable_route_idx ON app_release_public_surfaces (stable_route, public_surface_id);\nCREATE INDEX app_release_transitions_selected_surface_idx ON app_release_transitions (public_surface_id, operation_kind, sequence DESC) WHERE operation_kind IN (‘promotion’, ‘rollback’);\nCREATE INDEX app_release_transitions_revoked_release_idx ON app_release_transitions (release_id, operation_kind) WHERE operation_kind = ‘revocation’;\nCREATE TABLE app_release_transition_obligations (sequence INTEGER PRIMARY KEY REFERENCES app_release_transitions(sequence), transition_id TEXT NOT NULL UNIQUE, operation_kind TEXT NOT NULL, idempotency_key TEXT NOT NULL, release_id TEXT NOT NULL, public_surface_id TEXT, state TEXT NOT NULL CHECK(state IN (‘pending’,‘acknowledged’))) STRICT;\nCREATE INDEX app_release_transition_obligations_pending_idx ON app_release_transition_obligations(state, sequence);\nCREATE TABLE app_release_transition_obligation_enumeration (sequence INTEGER PRIMARY KEY REFERENCES app_release_transition_obligations(sequence), cursor TEXT, started INTEGER NOT NULL DEFAULT 0 CHECK(started IN (0, 1)), complete INTEGER NOT NULL DEFAULT 0 CHECK(complete IN (0, 1))) STRICT;\nCREATE TABLE app_release_transition_obligation_pages (sequence INTEGER NOT NULL REFERENCES app_release_transition_obligations(sequence), cursor TEXT, cursor_is_initial INTEGER NOT NULL CHECK(cursor_is_initial IN (0, 1)), cursor_key TEXT NOT NULL, next_cursor TEXT, complete INTEGER NOT NULL CHECK(complete IN (0, 1)), team_ids_json TEXT NOT NULL CHECK(json_valid(team_ids_json)), PRIMARY KEY(sequence, cursor_is_initial, cursor_key)) STRICT;\nCREATE TABLE app_release_transition_obligation_teams (sequence INTEGER NOT NULL REFERENCES app_release_transition_obligations(sequence), team_id TEXT NOT NULL CHECK(length(team_id) BETWEEN 1 AND 256), state TEXT NOT NULL CHECK(state IN (‘pending’, ‘applied’, ‘no-op’, ‘expired’)), PRIMARY KEY(sequence, team_id)) STRICT;\nCREATE INDEX app_release_transition_obligation_teams_pending_idx ON app_release_transition_obligation_teams(sequence, state, team_id);\nCREATE TABLE app_release_team_publishers (app_id TEXT PRIMARY KEY REFERENCES app_release_apps(app_id), team_id TEXT NOT NULL CHECK(length(team_id) BETWEEN 1 AND 256), source_provider TEXT NOT NULL CHECK(source_provider IN (‘artifacts’,‘github’)), source_repository TEXT NOT NULL CHECK(length(source_repository) BETWEEN 1 AND 1024), source_branch TEXT NOT NULL CHECK(source_branch = ‘main’), template_app_id TEXT, template_seed_revision TEXT, CHECK((template_app_id IS NULL) = (template_seed_revision IS NULL))) STRICT;\nCREATE INDEX app_release_team_publishers_team_idx ON app_release_team_publishers(team_id, app_id);\nCREATE TABLE app_release_release_verification_metadata (release_id TEXT PRIMARY KEY REFERENCES app_release_release_verifications(release_id), artifact_digest TEXT NOT NULL, description_json TEXT NOT NULL CHECK(json_valid(description_json))) STRICT;\nCREATE TABLE publisher_template_seed_receipts (template_repository TEXT NOT NULL, seed_revision TEXT NOT NULL, platform_app_id TEXT NOT NULL, source_revision TEXT NOT NULL, source_tree_digest TEXT NOT NULL, recipe_json TEXT CHECK(recipe_json IS NULL OR json_valid(recipe_json)), build_recipe_digest TEXT CHECK(build_recipe_digest IS NULL OR (length(build_recipe_digest) = 71 AND substr(build_recipe_digest, 1, 7) = ‘sha256:’ AND substr(build_recipe_digest, 8) NOT GLOB ‘*[^0-9a-f]*’)), CHECK((recipe_json IS NULL) = (build_recipe_digest IS NULL)), PRIMARY KEY (template_repository, seed_revision)) STRICT;\nCREATE TABLE publisher_artifacts_repositories (repository_name TEXT PRIMARY KEY CHECK(length(repository_name) BETWEEN 1 AND 128), provider_id TEXT NOT NULL CHECK(length(provider_id) > 0), default_branch TEXT NOT NULL CHECK(default_branch = ‘main’), remote TEXT NOT NULL CHECK(length(remote) > 0), parent_repository TEXT REFERENCES publisher_artifacts_repositories(repository_name), CHECK(parent_repository IS NULL OR parent_repository <> repository_name)) STRICT;\nCREATE TRIGGER app_release_apps_write_once BEFORE UPDATE ON app_release_apps BEGIN SELECT RAISE(ABORT, ‘App Release apps are write-once’); END;\nCREATE TRIGGER app_release_releases_write_once BEFORE UPDATE ON app_release_releases BEGIN SELECT RAISE(ABORT, ‘App Release releases are write-once’); END;\nCREATE TRIGGER app_release_verifications_write_once BEFORE UPDATE ON app_release_release_verifications BEGIN SELECT RAISE(ABORT, ‘App Release verifications are write-once’); END;\nCREATE TRIGGER app_release_verification_formats_write_once BEFORE UPDATE ON app_release_release_verification_formats BEGIN SELECT RAISE(ABORT, ‘App Release verification formats are write-once’); END;\nCREATE TRIGGER app_release_public_surfaces_write_once BEFORE UPDATE ON app_release_public_surfaces BEGIN SELECT RAISE(ABORT, ‘App Release public Surfaces are write-once’); END;\nCREATE TRIGGER app_release_transitions_write_once BEFORE UPDATE ON app_release_transitions BEGIN SELECT RAISE(ABORT, ‘App Release transitions are write-once’); END;\nCREATE TRIGGER app_release_transition_obligation_enumeration_after_insert AFTER INSERT ON app_release_transition_obligations BEGIN INSERT OR IGNORE INTO app_release_transition_obligation_enumeration(sequence) VALUES (NEW.sequence); END;\nCREATE TRIGGER app_release_transition_obligation_after_insert AFTER INSERT ON app_release_transitions WHEN NEW.operation_kind = ‘revocation’ BEGIN INSERT INTO app_release_transition_obligations (sequence, transition_id, operation_kind, idempotency_key, release_id, public_surface_id, state) VALUES (NEW.sequence, NEW.transition_id, NEW.operation_kind, NEW.idempotency_key, NEW.release_id, NEW.public_surface_id, ‘pending’); END;\nCREATE TRIGGER app_release_team_publishers_write_once BEFORE UPDATE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are write-once’); END;\nCREATE TRIGGER app_release_verification_metadata_write_once BEFORE UPDATE ON app_release_release_verification_metadata BEGIN SELECT RAISE(ABORT, ‘App Release verification metadata is write-once’); END;\nCREATE TRIGGER app_release_apps_append_only BEFORE DELETE ON app_release_apps BEGIN SELECT RAISE(ABORT, ‘App Release apps are append-only’); END;\nCREATE TRIGGER app_release_releases_append_only BEFORE DELETE ON app_release_releases BEGIN SELECT RAISE(ABORT, ‘App Release releases are append-only’); END;\nCREATE TRIGGER app_release_verifications_append_only BEFORE DELETE ON app_release_release_verifications BEGIN SELECT RAISE(ABORT, ‘App Release verifications are append-only’); END;\nCREATE TRIGGER app_release_verification_formats_append_only BEFORE DELETE ON app_release_release_verification_formats BEGIN SELECT RAISE(ABORT, ‘App Release verification formats are append-only’); END;\nCREATE TRIGGER app_release_public_surfaces_append_only BEFORE DELETE ON app_release_public_surfaces BEGIN SELECT RAISE(ABORT, ‘App Release public Surfaces are append-only’); END;\nCREATE TRIGGER app_release_transitions_append_only BEFORE DELETE ON app_release_transitions BEGIN SELECT RAISE(ABORT, ‘App Release transitions are append-only’); END;\nCREATE TRIGGER app_release_team_publishers_append_only BEFORE DELETE ON app_release_team_publishers BEGIN SELECT RAISE(ABORT, ‘App publisher registrations are append-only’); END;\nCREATE TRIGGER app_release_verification_metadata_append_only BEFORE DELETE ON app_release_release_verification_metadata BEGIN SELECT RAISE(ABORT, ‘App Release verification metadata is append-only’); END;\nCREATE TRIGGER app_release_team_publishers_template_seed_pair BEFORE INSERT ON app_release_team_publishers WHEN (NEW.template_app_id IS NULL) != (NEW.template_seed_revision IS NULL) BEGIN SELECT RAISE(ABORT, ‘App publisher template seed pointer is incomplete’); END;\nCREATE TRIGGER app_release_team_publishers_artifacts_seed_required BEFORE INSERT ON app_release_team_publishers WHEN NEW.source_provider = ‘artifacts’ AND NEW.template_app_id IS NULL BEGIN SELECT RAISE(ABORT, ‘Artifacts App publisher requires verified template seed provenance’); END;\nCREATE TRIGGER app_release_team_publishers_artifacts_seed_verified BEFORE INSERT ON app_release_team_publishers WHEN NEW.source_provider = ‘artifacts’ AND NOT EXISTS (SELECT 1 FROM publisher_template_seed_receipts WHERE platform_app_id = NEW.template_app_id AND seed_revision = NEW.template_seed_revision AND recipe_json IS NOT NULL AND build_recipe_digest IS NOT NULL) BEGIN SELECT RAISE(ABORT, ‘Artifacts App publisher template seed is not verified’); END;\nCREATE TRIGGER publisher_template_seed_receipts_write_once BEFORE UPDATE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are write-once’); END;\nCREATE TRIGGER publisher_template_seed_receipts_append_only BEFORE DELETE ON publisher_template_seed_receipts BEGIN SELECT RAISE(ABORT, ‘Publisher template seed receipts are append-only’); END;\nCREATE TRIGGER publisher_template_seed_recipe_required BEFORE INSERT ON publisher_template_seed_receipts WHEN NEW.recipe_json IS NULL OR json_valid(NEW.recipe_json) = 0 OR NEW.build_recipe_digest IS NULL BEGIN SELECT RAISE(ABORT, ‘Publisher template seed recipe proof is incomplete’); END;\nCREATE TRIGGER publisher_artifacts_repositories_write_once BEFORE UPDATE ON publisher_artifacts_repositories BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts repository metadata is write-once’); END;\nCREATE TRIGGER publisher_artifacts_repositories_append_only BEFORE DELETE ON publisher_artifacts_repositories BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts repository metadata is append-only’); END;\nCREATE TABLE publisher_artifacts_repositories_pending (repository_name TEXT PRIMARY KEY CHECK(length(repository_name) BETWEEN 1 AND 128), provider_id TEXT NOT NULL CHECK(length(provider_id) > 0), default_branch TEXT NOT NULL CHECK(default_branch = ‘main’), remote TEXT NOT NULL CHECK(length(remote) > 0), parent_repository TEXT REFERENCES publisher_artifacts_repositories(repository_name), initial_token TEXT NOT NULL CHECK(length(initial_token) > 0), CHECK(parent_repository IS NULL OR parent_repository <> repository_name)) STRICT;\nCREATE TRIGGER publisher_artifacts_repositories_pending_write_once BEFORE UPDATE ON publisher_artifacts_repositories_pending BEGIN SELECT RAISE(ABORT, ‘Publisher Artifacts recovery state is write-once’); END;\n”
Current App Release D1 schema for a new, empty catalog.
Remarks
Section titled “Remarks”Apply only to a new, empty D1 database. Existing catalogs use their ordered V1–V11 migration history.
Functions
Section titled “Functions”createD1TeamAppPublisherRegistry()
Section titled “createD1TeamAppPublisherRegistry()”createD1TeamAppPublisherRegistry(
database):TeamAppPublisherRegistry
Create the native registry that joins a Team publisher to one App/source.
Parameters
Section titled “Parameters”database
Section titled “database”Returns
Section titled “Returns”createD1AppReleaseStore()
Section titled “createD1AppReleaseStore()”createD1AppReleaseStore(
database):PromiseAppReleaseStore&object
Create the D1-backed App Release store with private public-website authority.
Parameters
Section titled “Parameters”database
Section titled “database”Returns
Section titled “Returns”PromiseAppReleaseStore & object
createR2ArtifactReader()
Section titled “createR2ArtifactReader()”createR2ArtifactReader(
bucket,policy?,assets?):ArtifactReader
Create the R2-backed artifact reader for opaque artifact references.
Asset manifests are verified cheaply for delivery: the root bytes are
digest-checked here, while the asset handler checks the requested object.
Publication callers pass verification: "publication" to retain the complete
manifest object sweep.
Parameters
Section titled “Parameters”bucket
Section titled “bucket”policy?
Section titled “policy?”ArtifactSnapshotPolicy =
DEFAULT_ARTIFACT_SNAPSHOT_POLICY
assets?
Section titled “assets?”bucket
Section titled “bucket”Pick<AssetR2Bucket, "head">
policy
Section titled “policy”{ maxManifestBytes: number; maxObjects: number; maxObjectBytes:
number; maxTotalBytes: number; }
policy.maxManifestBytes
Section titled “policy.maxManifestBytes”number = positiveInteger
policy.maxObjects
Section titled “policy.maxObjects”number = positiveInteger
policy.maxObjectBytes
Section titled “policy.maxObjectBytes”number = positiveInteger
policy.maxTotalBytes
Section titled “policy.maxTotalBytes”number = positiveInteger
Returns
Section titled “Returns”createD1TransitionObligationStore()
Section titled “createD1TransitionObligationStore()”createD1TransitionObligationStore(
database):AppReleaseTransitionObligationStore
Open the D1-only obligation adjunct for a future owner-driven dispatcher. The ordinary App Release store contract intentionally does not expose it.
Parameters
Section titled “Parameters”database
Section titled “database”Returns
Section titled “Returns”AppReleaseTransitionObligationStore
readD1SurfaceTransitionBasis()
Section titled “readD1SurfaceTransitionBasis()”readD1SurfaceTransitionBasis(
database,stableRoute,releaseId,now?):Promise<AppReleaseStoreResult<AppReleaseSurfaceTransitionBasis>>>>
Resolve one previously selected Release on a Surface and retain the exact transition sequence. The Release need not remain the Surface’s current default, but it must still be verified, active, and owned by that Surface.
Parameters
Section titled “Parameters”database
Section titled “database”stableRoute
Section titled “stableRoute”releaseId
Section titled “releaseId”() => number
Returns
Section titled “Returns”Promise<AppReleaseStoreResult<AppReleaseSurfaceTransitionBasis>>
matchEligibleSurfaceTransitionBasis()
Section titled “matchEligibleSurfaceTransitionBasis()”matchEligibleSurfaceTransitionBasis(
result,expected): {kind:"selected";appId:AppId;publicSurfaceId:PublicSurfaceId;releaseId:ReleaseId;sequence:number;eligibility:"eligible"|"ineligible";checkedAt:number; } |null
Match one eligible selected Release without leaking store-result branching to consumers.
Parameters
Section titled “Parameters”result
Section titled “result”AppReleaseStoreResult<AppReleaseSurfaceTransitionBasis>
expected
Section titled “expected”Readonly<{ appId: AppId; releaseId:
ReleaseId; sequence?: number; }>
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ kind: "selected"; appId: AppId; publicSurfaceId:
PublicSurfaceId; releaseId:
ReleaseId; sequence: number; eligibility:
"eligible" | "ineligible"; checkedAt: number; }
readonlykind:"selected"
readonlyappId:AppId
publicSurfaceId
Section titled “publicSurfaceId”
readonlypublicSurfaceId:PublicSurfaceId
releaseId
Section titled “releaseId”
readonlyreleaseId:ReleaseId
sequence
Section titled “sequence”
readonlysequence:number
eligibility
Section titled “eligibility”
readonlyeligibility:"eligible"|"ineligible"
checkedAt
Section titled “checkedAt”
readonlycheckedAt:number
Authority-read start time; consumers may only shorten its horizon.
null