drupflare/worker - v1.0.4
    Preparing search index...

    Class SitePhpDurableObject

    One site: the interpreter and the database in the same isolate.

    ctx.storage.sql is synchronous only inside the Durable Object and PHP's PDO blocks, so PHP must run here.

    Hierarchy

    • SiteDurableObject
      • SitePhpDurableObject
    Index
    _migrator? activitySinceFlush? alarmDueMs? alarmFirings? alarmRearms? arrivals? authSpend? bootBesideResident? bootDiag bootImage? bootImageBaseline? bootLinear bootMs? bumpCoalesced? bumps? carriedServe? coldsSinceFlush? consecutiveFillFailures? crossingNames? crossings? ctx deferredInRender? demandByPath demandLog deploymentChecked doRequestsSinceFlush? doRing elidedWrites? encounters env fillHolds forwardBuffer? forwardParent? gate heapIntegrity? heapRestore? heapRestoreCursor? heapsReused? httpTablesReady? inflight? inflightPeak? installedModuleFiles? invalidatedTags kvGrantsSinceFlush? kvLeverNames? laneRowsCap? lanesPublished? laneTimings? lastAggregation? lastAlarmAt? lastAlarmClass? lastAlarmOutcome? lastAuthenticatedAt? lastAutoScale? lastBootInclusiveMs? lastCatchUp? lastCron? lastCronHooks? lastDerive? lastFillHold? lastFindings? lastFleetError? lastForward? lastGc? lastGcAt? lastGitPoll? lastHeapImage? lastHttpDrain? lastInvalidatedTags? lastKeepWarm? lastMailDrain? lastMeterFlushMs? lastMirrorDrain? lastOpsJob? lastOutboundRefusal? lastPageMirrorDrain? lastPark? lastPendingDrain? lastPlanPurge? lastRearm? lastReconcile? lastRecycle? lastRedrive? lastRenderAtMs? lastRenderBytes lastRenderCrossings? lastRenderMs? lastRenderWindowFlushMs? lastRetention? lastReuse? lastScopedPurge? lastSessionCatchUpAt? lastSweep? lastSweepAt? lastTrap? lastUpdb? lastWarmDecision? lastWithdrawal? limitTally logs? mails? mailSocketOpen? memoryRing migrated migrateFailures? moduleIntegrity? mountInfo? out ownerAdoption packedContainer? pageBytes pageHits pagesFilledByAlarms? parkFetchDep? parkInstall? parkSockets? parkTotals? pendingAttempt? pendingCommits pendingDrained? pendingReplication? phpBootedAt? phpLaneEntries? phpOwner? pinnedHandles? plansStaled? queryCount rangeErrors rebuildBoot recentErrors recycles? renderClockUnmeasurable? renderFlights rendersSinceFlush? replicaGuard? replicaRefusals replicaRefusalsTotal retentionAdoptions retired? rowsRead? rowsRing rowsSinceFlush? rowsWritten? serveRequestsPending? serveTablesReady? sessionCatchUps? shellSeedFailed sleepBudget? speculating? spoolStamps? sql sqlTraceSeq? storage storageLaneServes? suppressBump? trappedRuns? txnCount? txnSkipOverlap? txnSkippable? txnSkippableStatements? txnSkipUnattributed? txnSkipUnparseable? txnSpeculative? txnSpeculativeNoRead? txnSpeculativeWithRead? txnStatements? uploadSeen wideRepairs? windowFills? writeTally? FILL_BINS SESSION_CATCHUP_MS
    activityToday adoptSecrets adoptSettings advanceCommit advisoryVerdict aggregateIndex alarm appendDeferred applyReconcileStep applyRestoreChunk armFillAlarm assembleFor autoScaleStep awaitingCopy backgroundHold bootSettings bufferForReplication bumpGeneration canonicalOrigin carriedServeTotal catchUpOnce cfCredentials cfCredentialsSync chargeR2 clearPendingTags clearRestore coldEncounterRate collectForward commitSeq containerMissing copyableGeneration copyBackoffMs corruptStoredChunk countActivity countOrNull cronHooksForSite dailyDoRequests dailyKvWrites dailyRows degradation dequeueLaneRepair deriveStep drainHttpQueue drainPendingTags dropCompiledContainer dropInterpreter enabledModulesFingerprint enqueueLaneRepair enqueueRefill ensureHttpTables ensurePhp ensureReplicationLog ensureServeTables estimateRenderMs execSql execTxn fenceRefusal fetch fillOne fleetHealth flushCommitSeq flushDailyDoRequests flushDailyRows flushEncounters flushForward flushMeters flushRenderWindow flushServeRequests flushTagPurge generation gitCredential gitGet gitOwners gitPoll gitPollStates gitPulls gitRefs gitRemotes gitSaveRemotes gitSmart gitStoredFiles gitSync gitWriteStatus handle handleGit handleIndex handleModify harvestShellFor hasMigrationManifest hasTable healthObservation heapBytes heapGeneration heapNow herdKeyFor httpCacheGet idPartition imageAttempts indexPageTags inlineBudgetMs installableVerdict installBridge installCapabilities installPackage installTree invalidateOnCoreUpgrade isolateNow isPoolLane isReplica isUnstorable laneHeaders laneIsIdle laneRepairQueue loadPackedContainer logStore mailEnv mandatoryGap markAttempt markLaneHigh medianRenderBytes metaGet metaSet migrateChunks migrateCursorOrNull migratePartial migrateStepIfPending migrator mirrorBucket modifyBadBody neverMigrated noteAuthoritativeWrite noteDemand noteError noteLaneServing notePendingTags noteRangeError noteRenderBytes noteStorable nowMs observe oidcConfig oidcProvider opsJobActive opsJobBeat opsJobStep oversized packageAutoloads packGeneration pageResponse pageStaleness parkSocketTable parkState pathsForTags pendingTags performOutbound pinHandles prefillServingTable provisionLane provisionRequested publicFilesOrigin purgeAfterApply purgeDynamicPageCache purgeForTags purgePlansFor queueDepth queueDerivatives queueHttp r2Allowance readModifyBody readSecret reconcileHost reconcileSkipReason reconcileState reconcileStatus reconcileStepOnce recycleAfterUpload recycleIfOversized refuseOutbound registerPackageAutoload replicaHandoff replicaStage replicatedRowsSince replicationRecords reportToFleet requestProvision requestReadmission restoreList retainInterpreter retire run runJson runJsonMaybeParked scheduleKeepWarm sealGeneration secretStore seedShellFrom sendMailTest serveFromStorage serveRequests serveStatsSync sessionReach setAlarmAt setReplicaStage settlePendingIfOwed settlePlans shellCandidates shellRows shellVerified shouldFlushMeters shouldRunGc siteName snapshotHeap snapshotRows snapshotStep spoolVector stalePlans storedMeters storedRenderWindow strikeFillHead supervise sweepBeat tableDdl tableNames thermalRearmMs traceMemory tryRestoreHeap unstorablePaths updbAction updbBeat updbDeps updbStepOnce warmCeiling workerVersion writeSecret
    _migrator?: SqlMigrator

    the pack replay driver, created on first use

    activitySinceFlush?: { alarms: number; fetches: number; renders: number }

    today's renders, alarm firings and drained fetches since the last meter flush

    alarmDueMs?: number

    When the alarm this object last set is due, in memory only.

    armFillAlarm() compares against it so a burst costs one charged row; a hibernation costs one extra arm.

    alarmFirings?: number

    alarm firings this incarnation

    alarmRearms?: number

    alarm re-arms this incarnation

    arrivals?: Arrival[]

    the arrivals the thermal predictor reads; a ring, so it costs no rows

    authSpend?: AuthSpend

    Today's authenticated spend, or undefined when nothing has been charged in this lifetime.

    Re-read from ctx.storage on each charge; an eviction must not reset the day's budget.

    bootBesideResident?: {
        at: number;
        id: string;
        interpreters: number;
        linearBytes: number;
    }

    the last boot that started while another interpreter was still resident in this isolate

    bootDiag: string[]

    timestamped boot notes from the loader

    bootImage?: Payload

    what the last boot decided about the published boot image, and what the restore did

    bootImageBaseline?: Uint8Array<ArrayBufferLike>

    the heap at the restore point, kept only by a bake rig so a capture can take the delta

    bootLinear: number = 0

    linear memory when the current interpreter finished booting; a reused memory starts large

    bootMs?: number

    how long the last boot took

    bumpCoalesced?: boolean

    whether this invocation already bumped the generation

    bumps?: number

    generation bumps this incarnation

    carriedServe?: number

    carriedServeTotal()'s memo; the lifetime serve total moves only through flushMeters()

    coldsSinceFlush?: number

    cold boots not yet folded into the persisted window

    consecutiveFillFailures?: number

    consecutive failing batches, for the capped backoff; reset by any batch that progressed

    crossingNames?: string[]

    capability names actually present to wrap, so a 0 is not read as "never called"

    crossings?: CrossingTally

    PHP-to-host crossings, per capability; see src/ops/crossings.ts

    ctx: DurableObjectState
    deferredInRender?: number

    outbound calls the render in flight has deferred; see the re-drive in fillOne

    demandByPath: Record<string, number> = {}

    the highest linear-memory reading each path has caused

    demandLog: {
        after: number;
        before: number;
        bridge?: {
            in: number;
            maxIn: number;
            maxName: string;
            maxOut: number;
            out: number;
        };
        method: string;
        path: string;
        renderBytes?: number;
        reused: boolean;
    }[] = []

    the last requests' effect on linear memory

    deploymentChecked: boolean = false

    whether this incarnation has already made sure the deployment document lists it

    doRequestsSinceFlush?: number

    Durable Object invocations since the last flush; in memory, since a row each would inflate the rows meter.

    doRing: RingBuffer = ...

    trend ring for Durable Object requests

    elidedWrites?: number

    Writes skipped because the row already held the value; in memory (a row to count rows saved defeats it).

    encounters: EncounterCounts = ...

    How often a request met an evicted interpreter; in memory, folded into a per-day total on the alarm.

    env: SiteEnv

    the worker's own vars (narrows the base class's env; emits nothing)

    fillHolds: number = 0

    firings whose background PHP waited for a young interpreter

    forwardBuffer?: (ForwardStatement & { params: unknown[]; table: string })[]

    writes this lane executed speculatively and owes the primary; see collectForward()

    forwardParent?: number

    the generation this lane read at, pinned on the first collected write

    gate: Gate
    heapIntegrity?: HeapIntegrityStats

    what the heap image integrity check has seen; shown by /__serve-stats

    heapRestore?: Payload

    what the last heap restore attempt did, or undefined when it was never attempted

    heapRestoreCursor?: HeapRestoreCursor

    Where a chunked restore has got to, or undefined when none is in flight.

    In memory only: the cursor indexes a live heap, and a persisted one could resume at chunk 7 of a heap an eviction already zeroed. Repeating one object's memcpy after an eviction is idempotent.

    heapsReused?: number

    how many boots instantiated into a dropped interpreter's memory

    httpTablesReady?: boolean

    whether ensureHttpTables() has run

    inflight?: number

    requests in flight right now

    inflightPeak?: number

    the peak of inflight since the alarm last read it

    installedModuleFiles?: number

    files written from cfw_module_file at boot; 0 on a site that has installed nothing

    invalidatedTags: Set<string> = ...

    every cache tag invalidated this invocation (the bump is coalesced; the tag set is not)

    kvGrantsSinceFlush?: number

    PAGE_KV page writes granted since the last meter flush

    kvLeverNames?: Set<string>

    lever names adoptSettings() took from KV, so cfwSettings can report a source

    laneRowsCap?: LaneRowsCap

    set when one more lane would project the day's rows past the reduce fraction

    lanesPublished?: Promise<unknown>

    the last CONFIG_KV write of the pool, awaited only by tests

    laneTimings?: { ahead: number; queueMs: number; serviceMs: number }[]

    the gated lane's queue/service split; a ring, read by /serve-stats

    lastAggregation?: {
        bytesSaved: number;
        libraries: number;
        path: string;
        skipped?: "not-cacheable" | "no-index" | "no-match";
        tagsRemoved: number;
    }

    what the last asset aggregation removed from a stored page, so 5,400 bytes/row has an n

    lastAlarmAt?: number

    when the alarm last fired

    lastAlarmClass?: AlarmClass

    the class of the last alarm outcome

    lastAlarmOutcome?: unknown

    how the last alarm ended

    lastAuthenticatedAt?: number

    When an authenticated request last reached this object; in memory, since a row spends the meter it protects.

    lastAutoScale?: Payload

    what the last autoscale evaluation decided; null when it did nothing

    lastBootInclusiveMs?: number

    wall time of the last fill that also booted; diagnostics only, never an estimate

    lastCatchUp?: unknown

    the last catch-up round, reported at /serve-stats so a stuck lane is visible

    lastCron?: Stamped<Payload>

    the last cron firing, with when it ran

    lastCronHooks?: string[]

    the hook list the last firing scheduled from; discovered, or the shipped fallback

    lastDerive?: Payload

    what the last eager derivative run did; see deriveStep()

    lastFillHold?: { at: number; queued: number; until: number }

    the last firing whose background PHP waited for a young interpreter

    lastFindings?: Finding[]

    what the last supervised alarm found, for /__health

    lastFleetError?: string

    the last fleet reporting failure

    lastForward?: unknown

    the last forward outcome, reported at /serve-stats so a refused write is visible

    lastGc?: Payload

    the last garbage-collection pass; lastGcAt is apart because it paces the next

    lastGcAt?: number

    when the last collection pass succeeded; an error leaves it so a failing pass retries

    lastGitPoll?: Stamped<Record<string, unknown>[]>

    the last git poll, with when it ran

    lastHeapImage?: Payload

    what the last heap-image attempt did; see SitePhpDurableObject.snapshotStep

    lastHttpDrain?: Stamped<Payload>

    the last deferred-HTTP drain, with when it ran

    lastInvalidatedTags?: string[]

    the last invocation's complete tag set, reported at /serve-stats

    lastKeepWarm?: number
    lastMailDrain?: Stamped<Payload>

    the last mail drain, with when it ran

    lastMeterFlushMs?: number

    when the daily meters last paid for a write; see shouldFlushMeters()

    lastMirrorDrain?: Stamped<Payload>

    the last file-mirror drain, with when it ran

    lastOpsJob?: Payload

    the last stepped-operation outcome

    lastOutboundRefusal?: { reason: string; url: string }

    the last outbound URL the SSRF guard refused; see src/ops/outbound-guard.ts

    lastPageMirrorDrain?: Stamped<Payload>

    the last page-mirror drain, with when it ran

    lastPark?: { state: string; trips: number; why?: string }

    how the last parked render went, so a park that stopped answering is readable

    lastPendingDrain?: { purged: number; tags: number }

    what that settlement did, so a crash-then-recover is observable rather than assumed

    lastPlanPurge?: { purged: number; tags: number }

    the last scoped plan purge, so an invalidation that removed nothing is still visible

    lastRearm?: { idleForMs: number | null; ms: number; reason: string }

    the idle re-arm last chosen, with why and the idle time behind it; in memory

    lastReconcile?: Payload

    the last reconciliation outcome, including a step that is waiting and owns no firing

    lastRecycle?: {
        at: number;
        bytes: number;
        reason: "request" | "alarm" | "upload";
        rebuild?: boolean;
    }

    the last interpreter drop and why

    lastRedrive?: {
        at: number;
        deferred: number;
        deferredAgain: number;
        drained: number;
        path: string;
        seq: number;
    }

    The last request-level re-drive; at and seq tell a repeat from the first one still sitting here.

    lastRenderAtMs?: number

    when a render last began in this incarnation; the exact half of the idle clock

    lastRenderBytes: number = 0

    the size of the last rendered page, for the demand record

    lastRenderCrossings?: CrossingTally

    the tally at the start of the last render, so /serve-stats reports a per-render figure

    lastRenderMs?: number

    wall ms of the last warm render (the inline budget guard's estimate)

    lastRenderWindowFlushMs?: number

    when that window last paid for a write

    lastRetention?: {
        adopted: boolean;
        at: number;
        idleMs?: number;
        reason?: string;
    }

    the last adoption attempt, for /serve-stats

    lastReuse?: { at: number; bytes: number }

    the last such reuse

    lastScopedPurge?: {
        purged: number;
        requeued?: number;
        scoped: boolean;
        tags: number;
    }

    what the last tag-scoped purge did, reported at /serve-stats so the 11x is observable

    lastSessionCatchUpAt?: number

    when this lane last chased a session it did not hold; the cookie is attacker-supplied

    lastSweep?: SweepReport | { error: string }

    what the last addressable-sweep step did, so coverage has a number rather than a guess

    lastSweepAt?: number

    when a sweep last queued something; separate from the report, which every step replaces

    lastTrap?: { at: number; message: string }

    the last VM trap

    lastUpdb?: Stamped<Payload>

    the last database-update beat, with when it ran

    lastWarmDecision?: WarmDecision

    what the predictor last decided, reported at /serve-stats so a policy is legible

    lastWithdrawal?: unknown

    why this lane last left the pool; survives the readmission that clears lastCatchUp

    limitTally: LimitTally

    Which platform limits this incarnation's failed requests hit; per incarnation, since a reset object has already answered.

    logs?: Payload[]

    recent PHP log payloads, bounded

    mails?: {
        bytes: number;
        refusal?: string;
        subject: unknown;
        to: unknown;
        transport: string | null;
    }[]

    recent mail attempts, bounded

    Type Declaration

    • bytes: number
    • Optionalrefusal?: string

      why it was refused; absent on a message that reached the queue

    • subject: unknown
    • to: unknown
    • transport: string | null

      the transport the message was committed to, or null when it was refused

    mailSocketOpen?: boolean

    Whether an SMTP send holds an outbound socket; the only thing that makes this object non-hibernateable.

    memoryRing: RingBuffer = ...

    Trend ring for memory; held here because the supervisor owns no state (a poisoned observation must not outlive a recycle).

    migrated: boolean

    whether the pack database has been replayed into this object

    migrateFailures?: number

    consecutive pack replay failures

    moduleIntegrity?: IntegrityStats

    what the installed-file integrity check has seen; shown by /serve-stats

    mountInfo?: SiteMountInfo

    what the lazy mount reported for this site

    out: string[]

    the shared output buffer of the interpreter

    ownerAdoption: Promise<void>

    settles once a legacy plaintext owner token has been moved into sealed storage

    packedContainer?: PackedContainer

    the pack's container row, loaded once an instance has reconciliation to do

    pageBytes: Map<string, number[]> = ...

    per-path render sizes, previous renders only (the renderSizeAnomaly baseline)

    pageHits: Map<string, number> = ...

    per-path serve counts, in memory only; the R2 page mirror publishes the busiest first

    pagesFilledByAlarms?: number

    pages the alarm chain filled this incarnation

    parkFetchDep?: typeof fetch

    What a parked HTTP yield is performed with; global fetch unless a test stubs it (keeps the real classifier and guard).

    parkInstall?: ParkInstall

    whether this interpreter can park a Zend continuation, probed once per interpreter

    parkSockets?: ParkSockets

    the sockets a parked chain holds; per interpreter, because its PHP tokens are

    parkTotals?: { refused: number; runs: number; trips: number }

    Every park this interpreter has driven, and every trip inside them.

    Cumulative: one park is below the 1 ms meter, so a cost needs two reads either side of a window.

    pendingAttempt?: string

    the attempt the next render belongs to; see src/ops/attempt.ts

    pendingCommits: number = 0

    commit advances not yet persisted; see flushCommitSeq()

    pendingDrained?: boolean

    whether this incarnation has settled a purge a previous one recorded

    pendingReplication?: {
        overflowed: boolean;
        parent: number;
        statements: { params?: readonly unknown[]; sql: string }[];
    }

    Authoritative statements collected during this invocation, awaiting a fingerprint.

    Per invocation: one that dies before sealing must leave no record (a replica restores instead; a partial record would leave it silently wrong).

    phpBootedAt?: number

    nowMs() when the resident interpreter booted; what fillSettleMs is measured from.

    phpLaneEntries?: number

    requests served through the PHP lane this incarnation

    phpOwner?: { current: SitePhpDurableObject }

    what every host closure of the current interpreter resolves this through

    pinnedHandles?: Set<object>

    Strong references to every vrzno handle value this interpreter has handed PHP.

    In memory only; stops the handle table's WeakRefs dying under a heap that still holds their integers.

    plansStaled?: boolean

    whether this invocation has already flagged the plans; cleared by settlePlans()

    queryCount: number
    rangeErrors: RangeReport[] = []

    the last RangeErrors a handler saw, with what the interpreter was doing when they landed

    rebuildBoot: boolean = false

    Set when this interpreter's first kernel boot has no container row and so rebuilds it.

    The rebuild's garbage is invisible to the memory estimate, so the next invocation can be reset; the interpreter is dropped at the end of that invocation regardless of thresholds.

    recentErrors: ErrorNote[] = []

    the last faults a catch absorbed while keeping its fallback, oldest first

    recycles?: number

    interpreter drops taken to stay under the isolate limit; /serve-stats reports both

    renderClockUnmeasurable?: boolean

    set when the frozen clock made the last render time unusable

    renderFlights: Map<string, Promise<SharedRender | undefined>> = ...

    renders in flight, so N concurrent identical requests cost one; see herdKeyFor()

    rendersSinceFlush?: number

    renders not yet folded into the persisted window; see flushRenderWindow()

    replicaGuard?: ReadOnlyGuard

    The read-only guard when REPLICA_READ_ONLY is set, undefined on a primary; see src/ops/replica.ts.

    replicaRefusals: ReplicaRequiresPrimary[] = []

    The most recent refusals (failovers are counted from it); bounded, since each holds a stack and the JS heap shares the 128 MiB isolate.

    replicaRefusalsTotal: number = 0

    the total, kept apart so bounding the array above does not deflate the reported count

    retentionAdoptions: number = 0

    interpreters adopted from an evicted instance

    retired?: boolean

    set by retire(); this incarnation then answers 410 and arms nothing

    rowsRead?: number
    rowsRing: RingBuffer = ...

    trend ring for rows written

    rowsSinceFlush?: number

    writes accumulated since the last alarm folded them into the daily total

    rowsWritten?: number

    accumulated across the object's life; undefined until the first statement

    serveRequestsPending?: number

    served requests not yet folded into their durable total; see flushServeRequests()

    serveTablesReady?: boolean

    whether ensureServeTables() has run

    sessionCatchUps?: { found: number; tried: number }

    how many times chasing a session found it

    shellSeedFailed: Set<string> = ...

    Paths a shell seed already failed on, so each is attempted once (in memory; a hibernation costs one more attempt).

    sleepBudget?: SleepBudget

    the waiting allowance of the invocation in progress; see sleepBudgetMs()

    speculating?: boolean

    inside an execTxn pass that will be rolled back; see the guard in execSql()

    spoolStamps?: SpoolStamps

    tag to the cursor of its last change, for spool's sync; memory only

    sql: SqlStorage
    sqlTraceSeq?: number

    statement counter for PW_SQL_TRACE, so the tail can be read as a sequence

    storage: DurableObjectStorage

    the counted handle; storage-metered.spec.ts fails on a direct ctx.storage write

    storageLaneServes?: number

    requests served from storage this incarnation

    suppressBump?: boolean

    set while a write must not bump the generation

    trappedRuns?: number

    drops taken because the VM trapped, which is a fault rather than a size; see run

    txnCount?: number
    txnSkipOverlap?: number

    replays not skippable because a read overlaps the buffer's tables

    txnSkippable?: number

    speculative replays whose read touches no table the buffer writes; see execTxn()

    txnSkippableStatements?: number

    statements those replays ran, which is the size of the lever rather than its value

    txnSkipUnattributed?: number

    replays not skippable because a statement's table could not be attributed

    txnSkipUnparseable?: number

    why a replay was NOT skippable, so no opportunity reads differently from a blind parser

    txnSpeculative?: number
    txnSpeculativeNoRead?: number

    speculative replays with no read

    txnSpeculativeWithRead?: number

    the split a read filter lives or dies on: a replay with no read has nothing to filter

    txnStatements?: number
    uploadSeen: boolean = false

    set by a request carrying a file, cleared when the interpreter drops after it

    wideRepairs?: number

    how many result sets this lifetime needed a wide-integer re-read; 0 on an ordinary site

    windowFills?: number

    fills served by the open fill window, sent back on its socket

    writeTally?: WriteTally

    per-table rows-written tally; only allocated when /__writes turns it on

    FILL_BINS: string[] = FILL_BINS

    The bins a fill empties on itself.

    dynamic_page_cache stays warm: 1.4x on a site whose page table fills (5 charged rows against 7), and tag invalidation still reaches it through its checksum. A non-tag bump purges it and gcDynamicPageCache() bounds it.

    SESSION_CATCHUP_MS: 1000 = SESSION_CATCHUP_MS

    Minimum ms between session chases on a lane; a forged cookie must not buy a primary hop per request.

    • today's activity counters, stored plus pending, so a read between flushes is current

      Parameters

      • nowMs: number = ...

      Returns { alarms: number; fetches: number; renders: number }

    • Moves every credential that sits in cfw_meta (a site from before sealed storage, or an import that carried them) into sealed storage. Runs on wake and at the head of each alarm, which is where an import is applied, so a credential is in SQL for one firing at most.

      Returns Promise<void>

    • Overlays every KV lever override onto this object's env.

      withSettings() only covers the front worker's env; the object gets its own bindings. Awaited here and never in fetch() (the fast lane stays await-free and reads no lever), and called from alarm() too, which never passes through handle().

      Returns Promise<void>

    • Advances the monotonic count of authoritative invalidations that a replica fences on.

      Separate from generation, a coalesced page-purge counter that stops moving once cfw_page is empty (a permission grant invalidated two tags and left it still).

      Returns number

    • What the last advisory sweep found: one indexed row read, no kernel boot (the module's cron hook fills it).

      Returns AdvisoryVerdict & { ageS: number; fresh: boolean }

    • The aggregate manifest from the ASSETS binding, or undefined; memoised per incarnation, absence included.

      Returns Promise<AggregateIndex | undefined>

    • Fill one page, then re-arm at +1 ms (each link is a fresh invocation with a fresh budget).

      The fill runs inside the gate. The return is any because the platform discards it and this one feeds /__serve-stats.

      Parameters

      • Optionalinfo: AlarmInvocationInfo

      Returns Promise<any>

    • Appends the disposable rows a forwarded batch carried, outside its transaction; a failure drops only that row, and nothing is buffered for replication.

      Parameters

      Returns number

    • Parameters

      Returns {
          missing: string[];
          ok: boolean;
          reason: string;
          stage: ReplicaStage;
          statements: number;
      }

    • Arms the fill alarm without disturbing one that is already sooner.

      Synchronous callers cannot await getAlarm(), so the guard is an in-memory note; an unconditional setAlarm() costs a row per hit on hot paths. Fire-and-forget: a memo lost to hibernation costs one extra arm and never skips one.

      Parameters

      • delayMs: number = 1

      Returns void

    • Parameters

      • path: string
      • cookie: string
      • origin: string

      Returns Promise<ShellAssembly | undefined>

    • Whether this lane is empty and waiting for the primary's copy (CREATED with a readmission ask outstanding).

      Returns boolean

    • the end of the young-interpreter hold on background PHP, or undefined when there is none

      Returns number | undefined

    • the settings override's inputs other than the origin, which the boot image keys on

      Returns {
          argon2: boolean;
          deploymentEnv: string;
          lane: number;
          lanes: number;
          memoryBins: string;
          memoryItems: number;
          packageAutoload: string;
      }

    • Parameters

      • sql: string
      • Optionalparams: SqlBindings

      Returns void

    • Parameters

      • Optionalreason: string
      • Optionaloptions: { arm?: boolean; invalidatedTags?: string[]; scopedTo?: string[] }

      Returns {
          droppedFromRequeue: number;
          generation: number;
          purgedDynamic: number;
          purgedPages: number;
          purgedPlans: number;
          purgedShells: number;
          reason: string;
          requeued: number;
      }

    • The scheme://host[:port] this site renders absolute URLs against; pinned on first use (one cfw_meta row), and a local origin is never pinned.

      Parameters

      • Optionalobserved: string

        url.origin of the request being served (the visitor's scheme and host in production); harness origins like do.local are refused by pinnable

      Returns string

    • The lifetime serve total from whichever day last recorded one; memoised, since it only moves through flushMeters().

      Returns number

    • Parameters

      • Optionallimit: number

      Returns Promise<
          {
              admitted: boolean;
              advertised: number;
              applied: number;
              ran: boolean;
              reason: string;
              records: number;
              stage: ReplicaStage;
          },
      >

    • The Cloudflare API credentials, from the durable grant or from the deployed pair.

      Every consumer goes through here: the env overlay dies with the incarnation (about ten seconds idle), so the persisted grant is the source. A refreshed set is persisted so the next incarnation starts from it; a refresh failure is not an error (the access token may still be valid).

      Returns Promise<{ accountId: string; token: string }>

    • The same credentials without the refresh, for a caller that cannot await.

      One rule for which credential a site uses (durable grant first), shared with mailEnv(); the drain refreshes before it resolves. An expired token answers 401, which is the better signal.

      Returns { accountId: string; token: string }

    • adds ops to this month's R2 write tally (deletes count too, so it reads high)

      Parameters

      • ops: number

      Returns void

    • forgets the recorded set, once the purge it describes has happened

      Returns void

    • Abandons a restore in progress.

      Without it restore_generation survives and every chunk of a fresh attempt is refused as torn. The in-flight marker stays: landed rows remain and the replica is untrusted until a copy completes.

      Returns void

    • Parameters

      • statements: readonly string[]
      • payload: unknown

      Returns void

    • the stored commit sequence plus advances not yet persisted

      Returns number

    • whether the next kernel boot has to rebuild the container; unreadable reads as no

      Returns boolean

    • The generation a copy may hand a replica: the last sealed record, not commitSeq().

      The sequence can sit ahead of the last record (a lane copied at 86 meets a record from 85 and is withdrawn). The gap holds no statements, so resuming at the last record skips no change.

      Returns number

    • How long a lane waiting on a copy sleeps before asking again: doubling from the catch-up interval to 60 s.

      Returns number

    • adds n to today's pending counter for kind

      Parameters

      • kind: "renders" | "alarms" | "fetches"
      • n: number = 1

      Returns void

    • Row count for a table that may not exist yet. null rather than 0: several Drupal tables are created lazily on first write, and 0 for a missing one reads as a verified invariant.

      Parameters

      • table: string
      • Optionalwhere: string

      Returns number | null

    • Returns Promise<{ discovered: boolean; hooks: string[] }>

    • today's DO invocations, without flushing

      Parameters

      • nowMs: number = ...

      Returns number

    • today's granted PAGE_KV page writes, without flushing

      Parameters

      • nowMs: number = ...

      Returns number

    • today's rows written, without flushing (for a read that must not write)

      Parameters

      • nowMs: number = ...

      Returns number

    • Where this site sits on the quota ladder; both daily meters reset at midnight UTC, so nothing is persisted (two warm reads, no await).

      Parameters

      • nowMs: number = ...

      Returns Degradation

    • removes a lane from the repair queue and returns what remains

      Parameters

      • lane: number

      Returns number[]

    • Parameters

      • Optionallimit: number

      Returns Promise<{ drained: Payload[]; remaining: number }>

    • purges the recorded pending tags and clears the record; undefined when none are owed

      Returns { purged: number; tags: number } | undefined

    • Drops the compiled container and plugin discovery so the next boot rebuilds both.

      Called when a delivery changes an extension's wiring; a container cached before a module's code arrives resolves routes to classes that cannot load.

      Returns void

    • Drops the interpreter, but only one with a binary (a stubRender() stub holds no heap and would be lost).

      Returns void

    • records a lane as needing a fresh copy; idempotent, since a lane re-asks every firing

      Parameters

      • lane: number

      Returns number[]

    • Queues a refill for one path and wakes the chain; await-free (the storage lane runs outside the gate) and bounded by FILL_QUEUE_MAX.

      Parameters

      • path: string

      Returns void

    • Builds the interpreter, installs the bridge, mounts the tree. Once.

      Lazy rather than in the constructor so boot cost is attributable to a route. A static build instantiates inside a request handler because it needs no runtime codegen.

      Parameters

      • opts: { skipRestore?: boolean } = {}

      Returns Promise<PhpInstance>

    • creates the replication log table if absent

      Returns void

    • What the next render on this instance is expected to cost, in ms.

      A prediction, because php._run() is one synchronous wasm call that no timer or AbortSignal can preempt. The last render is the best predictor; pessimistic with no evidence (a cold instance is the common case and must not gamble on a multi-second boot).

      Returns number

    • Every Drupal statement, plus the automatic invalidation trigger.

      Suppressed during /__migrate (packed cachetags rows are setup). Coalesced: one save writes many tags, and once bumped further writes are ignored until fillOne() clears the flag.

      Parameters

      • sql: string
      • Optionalparams: SqlBindings

      Returns ExecSqlResult

    • Counts speculative replays whose read could not have seen the buffer anyway.

      An instrument, not a lever (skipping a replay also skips rememberResults()); measured zero, since replays on a content write carry no read.

      Parameters

      • req: TxnRequest

      Returns ExecTxnResult

    • Whether this object may answer a request that requires generation g.

      A primary is never fenced. A replica checks the caller's header: absent means any view will do, an unparseable one refuses (unreadable is not absent), a number goes to fenceAllows.

      Parameters

      • request: Request

      Returns { applied: number; refuse: boolean; required: number }

    • serves one request: routes it, hands refusals to the primary, classifies platform limits

      Parameters

      • request: Request

      Returns Promise<Response>

    • Parameters

      • OptionaltargetPath: string
      • Optionalbins: string[]
      • Optionaldestruct: string | boolean
      • Optionalrequest: RenderRequest

      Returns Promise<FillOutcome>

    • This site's own verdict on itself for the fleet inventory (findings stay on /health).

      Quarantine outranks degradation: a quarantined site refuses requests, a degraded one serves them cheaper.

      Returns "ok" | "quarantined" | "degraded"

    • Persists the invocation's commit advances as one row (a write per statement was 15% of a node save's row cost). An invocation's writes commit together, so the counter cannot fall behind the data it fences; the seal flushes unconditionally, since under-advancing serves stale authorization.

      Returns void

    • Folds this firing's Durable Object invocations into a per-UTC-day total.

      Counts only what reached this object (an edge-cache hit never enters the isolate), so it is the DO meter and not the Worker-request meter.

      Parameters

      • nowMs: number = ...

      Returns number

    • Folds the writes since the last flush into a per-UTC-day total; flushed on the alarm, never per write (that would double the count; the flush row is itself counted).

      Parameters

      • nowMs: number = ...

      Returns number

      the running total for today

    • Folds this incarnation's cold-encounter counts into a per-UTC-day total; called from the alarm, where a row is already written.

      Parameters

      • nowMs: number = ...

      Returns EncounterCounts

    • Folds pending renders into the persisted window, at most once per 15-minute window (96 rows/day against 1,440 at the 60 s meter interval; the rate only separates ~505 renders/day from ~8,640).

      The roll is also where the warm interval is solved: lastRenderWindowFlushMs is in memory, so it is set only if this incarnation did the previous roll.

      Parameters

      • nowMs: number = ...

      Returns RenderWindow | undefined

    • Folds served requests into their durable total, on the meters' own interval.

      A row per view would cost ~15,000 of free's 100,000 rows/day. A serve arms the fill alarm at +1 ms and that firing flushes, so an eviction loses about a millisecond of counting.

      Returns number

    • Runs the tag-scoped purge once the invocation's invalidated tags are complete.

      Runs at the end, so a death before it leaves a plan alive. The wholesale purge in bumpGeneration() runs at the write and has no such window.

      Returns string[]

    • The site generation: one integer every edge cache key carries, so one write unreaches every cached URL (tag purge is Enterprise-only).

      Returns number

    • one authenticated API GET, returning parsed JSON or a refusal

      Parameters

      Returns Promise<{ body: unknown; ok: boolean; status: number }>

    • who owns each installed path, which is what turns an overwrite into a refusal

      Returns Map<string, string>

    • Parameters

      • Optionallimit: number

      Returns Promise<Record<string, unknown>[]>

    • stores the remote list as one meta row

      Parameters

      Returns void

    • every file this remote has installed, so a plan can tell a change from an addition

      Parameters

      • id: string

      Returns Map<string, string>

    • Parameters

      • remote: Remote
      • sha: string
      • Optionalopts: { apply: boolean; previewOf?: string }

      Returns Promise<Record<string, unknown>>

    • Writes one commit status, never a check run (a pasted token is refused by the check-run endpoints on all three providers).

      Parameters

      • remote: Remote
      • sha: string
      • state: BuildState
      • description: string
      • targetUrl: string

      Returns Promise<boolean>

    • adopts KV levers, learns the site name, then dispatches to the route table

      Parameters

      • request: Request
      • url: URL

      Returns Promise<Response>

    • Parameters

      • url: URL
      • OptionaldeliverBase: string

      Returns Promise<Response>

    • Parameters

      • url: URL
      • request: Request

      Returns Promise<Response>

    • Parameters

      • path: string
      • cookies: readonly string[]
      • origin: string

      Returns Promise<
          {
              holes?: number;
              permissionsHash?: string;
              reason: string;
              stored: boolean;
          },
      >

    • Whether this deployment ships migration chunks; a quiet false, since an alarm that throws stops re-arming.

      Returns Promise<boolean>

    • whether this object holds a table at all; the restore's own precondition

      Parameters

      • table: string

      Returns boolean

    • What the host knows about itself, in the shape BootSelfTest reads.

      Every key is a host fact (bridge, absent capabilities, migration progress, update run, pack identity), so the PHP health unit needs no kernel. missing_capabilities comes from the installed list, not a hand-kept name list.

      Returns Record<string, unknown>

    • The emscripten heap as bytes (HEAPU8, else wasmMemory; php-wasm types neither); undefined if neither exists.

      Parameters

      Returns Uint8Array<ArrayBufferLike> | undefined

    • The identity a heap image is valid for: the pack plus the site's module set.

      An install changes the container and class loader without touching the pack, so a pack-only key restores a stale kernel (access() on null). Undefined when there is no pack generation.

      Returns string | undefined

    • Linear memory right now, or 0 where there is nothing to read (this.php can be a stubRender() stub with no binary).

      Returns number

    • The key N concurrent identical requests share, or undefined when they may not be coalesced.

      The cookie is in the key, so one visitor's page is never handed to another. Serving GETs only.

      Parameters

      • request: Request
      • url: URL

      Returns string | undefined

    • reads a cached outbound response, optionally stale; undefined on a miss

      Parameters

      • url: string
      • Optionalmethod: string
      • Optionalbody: string
      • Optionalheaders: Record<string, string>
      • Optionalopts: { allowStale?: boolean }

      Returns { body: string; headers: Payload; stale: boolean; status: number } | undefined

    • Which slice of the rowid space this object's driver mints from.

      The count is ID_PARTITION_LANES, not the pool size (a lane cannot learn it). The primary takes slice 0, or unpartitioned ids collide with forwarded rows on UNIQUE. Gated on the site having a pool, since ids advance by the stride.

      Returns { lane: number; lanes: number }

    • how many times this object has tried to image generation; a new one starts at zero

      Parameters

      • generation: string

      Returns number

    • Sets a stored page's tag list out of band, for a caller that did not write the row.

      Tags come from the render's cacheability metadata, never parsed HTML. Replaces rather than merges, so a re-render with fewer dependencies is not purged by a dropped tag.

      Parameters

      • path: string
      • tags: unknown

      Returns void

    • Wall-clock budget a miss may spend rendering before the path goes to the alarm chain.

      2 s covers the measured first-render range (195 to 1,636 ms) and excludes the 3,754 ms cold boot; it bounds the visitor's patience, not a billed resource. budget on the query string overrides (0 disables inline rendering). A cold object refuses on !this.php before this is consulted.

      Parameters

      • url: URL

      Returns number

    • Parameters

      • name: string
      • Optionalconstraint: string
      • Optionalstability: string

      Returns Promise<OracleResult>

    • Installs the synchronous SQL entry point on the PHP Module so vrzno can reach it, wrapped in the codec.

      The codec matters here specifically: node IDs, file sizes and timestamps all cross this boundary, PHP is 32-bit, and a SQLite INTEGER can exceed 2^31. Handing back a raw JS number silently wraps it -- that is the bug class the codec closes, and a database driver is where it would bite hardest.

      Both entry points run inside withMask(): they are JS frames under the PHP stack, and a slice interrupt that fires there cannot suspend (see src/mask.js). The decode/encode codec calls sit inside the same window, so the codec needs no mask of its own.

      Parameters

      • module: Record<string, unknown>

      Returns Record<string, unknown>

    • Parameters

      • registry: Registry
      • name: string
      • Optionalconstraint: string
      • Optionalstability: string

      Returns Promise<Record<string, unknown>>

    • Parameters

      • registry: Registry
      • name: string
      • Optionalconstraint: string
      • Optionalbudget: { left: number }
      • Optionalstability: string

      Returns Promise<Record<string, unknown>[]>

    • The whole isolate's demand: wasm linear memory plus the JS-side bytes the mount holds (the pack blob and in-memory fs arrays share the 128 MiB budget).

      Returns number

    • Whether this object is a pool lane, narrower than a replica.

      A lane has a lifecycle (restore, then SERVING) and hands traffic back until then; a var-configured replica sits at CREATED forever, so the readiness check would refuse everything.

      Returns boolean

    • Whether this object is a replica, a property of its name (example.com#r1).

      REPLICA_READ_ONLY is deployment-wide and would make a pool's primary read-only, so the role is per-object; no client request can change which id the router used. Either source suffices (OR, so a misconfiguration lands on read-only).

      Returns boolean

    • whether the fill chain has already proven it cannot satisfy this path

      Parameters

      • path: string

      Returns boolean

    • the pool advertisement every primary response carries, or nothing without a pool

      Returns Record<string, string>

    • Whether this is a pool lane nothing has routed to lately; a primary is never idle (it takes every write and miss).

      Returns boolean

    • lane numbers waiting to be copied again, lowest first; read on the primary

      Returns number[]

    • loads the pack's container row from ASSETS once

      Returns Promise<void>

    • The replication log's view of this object.

      Uses cfw_meta, not ctx.storage.kv (a record applies inside synchronous transactionSync). metaSet('') clears the in-flight marker: v is NOT NULL, so empty means absent.

      Returns LogStore

    • Which values this object cannot mint for itself and does not hold.

      Asked of a replica (did the copy finish) and of a primary (may it be copied from): a provisioned site holds no system.private_key yet, and each replica would then mint a key the others reject.

      Returns string[]

    • records that an attempt's PHP is about to run, dropping markers past their ttl

      Parameters

      • key: string

      Returns void

    • Records the rowids this lane minted for a batch the primary committed (else a second insert between catch-ups mints the id again). Uses MAX so the mark never falls.

      Parameters

      Returns void

    • The rolling median body size for one path, over previous renders only.

      Reading cfw_page would compare a render against the row it just wrote (ratio 1.00, so renderSizeAnomaly could never fire). In memory and capped, like pageHits.

      Parameters

      • path: string

      Returns number | undefined

    • Reads a cfw_meta value, or fallback when the key is absent.

      A key in SEALED_META_KEYS is read from sealed storage; a row left from before the move is adopted on the first read that misses it.

      Parameters

      • key: string
      • fallback: string | null = null

      Returns string | null

    • Writes a cfw_meta value, skipping one that is already there. A key in SEALED_META_KEYS goes to sealed storage and leaves no row.

      Parameters

      • key: string
      • value: unknown

      Returns void

    • The cursor when a migration is started but unfinished, else undefined (never started must keep serving; deploys predate the chunked engine).

      Returns MigrateCursor | undefined

    • The JS-side migrator, built lazily (the manifest is an asset fetch) and cached (re-reading per chunk costs 15 subrequests of the 50 cap).

      Returns SqlMigrator

    • The R2 bucket to offload files to, or undefined when there is none.

      An absent bucket is supported (the free-tier default): files live durably in DO SQL and R2 only buys serving headroom. Typed structurally so the drain runs over a stand-in.

      Returns MirrorBucket | undefined

    • the 400 for a modify action called without a JSON POST

      Returns Response

    • Whether this site was never provisioned (no cursor at all, unlike a half-finished one); migrateStepIfPending() needs a cursor, so this starts the chain.

      Returns boolean

    • Advances the commit sequence when a statement writes authoritative state.

      Keyed on the target table, not cache tags (a user create and a system.private_key rotation write no tag). Every key_value write counts, which over-advances safely: too often costs a refresh, too rarely serves stale authorization.

      Parameters

      • sql: string
      • Optionalparams: SqlBindings

      Returns void

    • Parameters

      • request: Request
      • before: number
      • reusedBefore: number

      Returns void

    • Parameters

      • where: string
      • e: unknown

      Returns void

    • Records that a lane finished copying; the key puts x-cfw-lanes on responses, so every provisioning path must call this (one writer).

      Parameters

      • lane: number

      Returns void

    • Persists the tags this invocation invalidated, at the write, so a crash before flushTagPurge() leaves a durable record of what is owed. drainPendingTags settles it at the end of the invocation and again at boot.

      Parameters

      • tags: readonly string[]

      Returns void

    • Parameters

      • e: unknown
      • where: string
      • Optionalrequest: Request<unknown, CfProperties<unknown>>

      Returns void

    • records one render's size after its median was taken, so a render never sets its baseline

      Parameters

      • path: string
      • bytes: number

      Returns void

    • Records whether a path can be stored at all; only an anonymous render Drupal itself refused counts (a cookie, redirect or 500 is transient).

      Parameters

      • path: string
      • cacheable: boolean
      • refused: boolean
      • anonymous: boolean

      Returns void

    • Date.now() is not available at DO global scope in some contexts and the value must also survive the 32-bit PHP boundary, so it is read here and encoded by the codec on the way out rather than passed raw.

      Returns number

    • The OIDC provider an operator configured, or why it is not usable.

      The secret is an env binding; neither it nor the issuer may join KV_OVERRIDABLE (a KV writer could point every login at a provider they control).

      Parameters

      • origin: string

      Returns { config: OidcConfig } | { refusal: string }

    • the discovery document, fetched per callback, not cached; a login is not a hot path

      Parameters

      • issuer: string

      Returns Promise<{ provider: OidcProvider } | { refusal: string }>

    • whether a stepped operation is in flight

      Returns boolean

    • advances the stepped operation one step; a throw drops the job (a throwing alarm stops)

      Returns Promise<{ opsJob: Payload }>

    • Runs one step of a stepped operation, keeping the job only while it reports more to do.

      A failed step also ends it (a retry from the top would replay what already landed). The first cim step carries the payload; the run holds its own state after that.

      Parameters

      • name: string
      • args: string[]
      • options: {
            budget?: unknown;
            collections?: unknown;
            limit?: number;
            offset?: number;
            payload?: unknown;
        }

      Returns Promise<Payload>

    • Whether this object should drop its interpreter at the next safe point; either threshold fires.

      Only once the heap has grown since the boot (a reused memory starts large and a drop cannot shrink it, else it would drop every invocation). The batch guard reads this too.

      Returns boolean

    • The pack generation this object migrated from, or undefined; a heap restored across packs holds paths into moved files.

      Returns string | undefined

    • Parameters

      • row: PageRow
      • tier:
            | "PLAN"
            | "RENDER"
            | "STALE"
            | "HIT"
            | "MISS"
            | "ASSEMBLED"
            | "VERIFY"
            | "EDGE"
            | "MEM"
            | "KV"
            | "DENY"
            | "AGED"
            | "REFUSED"
            | "ERROR"
      • serveMs: number
      • Optionalextra: Record<string, string>

      Returns Response

    • When this page became superseded, derived from tag state rather than written per save.

      A marked row answers at once; an unmarked one is checked against its tags' invalidation sum and marked if it moved (2 rows instead of 34 per save). Undefined with no usable checksum, which bumpGeneration() marks eagerly.

      Parameters

      • path: string
      • row: { stale_at?: number | null; tag_checksum?: number | null; tags?: unknown }

      Returns number | undefined

    • the stored paths that depend on any of tags

      Parameters

      • tags: readonly string[]

      Returns string[] | undefined

    • the durably recorded tag set, empty when there is nothing owed

      Returns string[]

    • Parameters

      • url: string
      • method: string
      • body: string
      • headers: Record<string, string>

      Returns Promise<TcpResult>

    • Whether a page request asked this site to provision itself; durable (one cfw_meta row), since an eviction sits between ask and alarm.

      Returns boolean

    • the origin public bytes are served from, or '' when everything goes through the Worker

      Returns string

    • Drops the derived caches a lane holds once the primary's log has moved it past a generation.

      Only the primary runs bumpGeneration(); replayed SQL leaves a lane's path-keyed cfw_page stale. Wholesale, since the log carries statements, not tags.

      Returns { dynamic: number; pages: number; plans: number; shells: number }

      what each store gave up, for the pull loop to report

    • Empties Drupal's dynamic page cache, tolerating a site that has never created the table.

      Returns number

      rows removed, or -1 when the bin does not exist yet.

    • Parameters

      • tags: readonly string[]
      • Optionalreason: string
      • Optionaloptions: { bump?: boolean }

      Returns
          | {
              droppedFromRequeue: number;
              generation: number;
              purged: number;
              purgedDynamic: number;
              purgedPages: number;
              purgedPlans: number;
              purgedShells: number;
              reason: string;
              requeued: number;
              scoped: boolean;
              shells: { dropped: number; kept: number; reasons: string[] };
              tags: number;
          }
          | {
              generation: number;
              policy: FanoutPolicy;
              purged: number;
              purgedPages: number;
              reason: string;
              requeued: number;
              scoped: boolean;
              shells: { dropped: number; kept: number; reasons: string[] };
              tags: number;
          }

    • Deletes the plans that depend on any of tags, or every plan when none are known.

      LIKE rather than a join table: a page bubbles 10-40 tags and a row each would spend the meter that binds regeneration, so the tags live in one JSON column on the plan row.

      Parameters

      • Optionaltags: string[]

      Returns number

    • rows waiting in the fill queue

      Returns number

    • Queues a public image for its styles to be rendered ahead of the first view (derivatives and Drupal's styles directory are not sources).

      Parameters

      • uri: string

      Returns void

    • Parameters

      • url: string
      • Optionalmethod: string
      • Optionalbody: string
      • Optionalheaders: Record<string, string>

      Returns void

    • this month's R2 writes against r2WriteBudget; the key carries the month

      Returns { budget: number; left: number; month: string; used: number }

    • a body that is not JSON is a caller error, and a throw here would read as a server fault

      Parameters

      • request: Request

      Returns Promise<unknown>

    • reads a credential from sealed storage, moving a legacy cfw_meta row over on first read

      Parameters

      • key: string

      Returns string | null

    • Why reconcileStepOnce() answered undefined, so a POST that did nothing is not mistaken for a silent failure.

      Returns string

    • the reconciliation report for this site

      Returns {
          packVersion: number;
          steps: {
              describe: string;
              detail: string;
              id: string;
              since: number;
              state: string;
          }[];
          version: number;
      }

    • drops the interpreter after a request that carried a file; see carriesUpload()

      Returns void

    • Drops the interpreter when linear memory has climbed too close to the isolate limit.

      PHP returns nothing under USE_ZEND_ALLOC=0, so demand is cumulative; past 128 MiB the edge resets the isolate and every in-flight request. Called between invocations only (a mid-request drop holds both heaps until collection). A ceiling check; a trend misses a workload arriving high.

      Parameters

      • reason: "request" | "alarm"

      Returns boolean

    • the SSRF guard, or undefined when it is off or the URL is allowed

      Parameters

      • url: string

      Returns { reason: string; url: string } | undefined

    • stores the autoload map a build-delivered vendor package asks composer to register

      Parameters

      Returns void

    • statements sealed for replication since sinceMs, each at least one row on every lane

      Parameters

      • sinceMs: number

      Returns number

    • sealed log records after generation since

      Parameters

      • since: number
      • Optionallimit: number

      Returns LogRecord[]

    • records that a visitor wants this site, and wakes the alarm chain to build it

      Returns Promise<void>

    • a comma-joined restore bookkeeping list, empty when unset

      Parameters

      • key: string

      Returns string[]

    • keeps this object's interpreter in module scope, stamped with the commit it has seen

      Returns void

    • Wipes this object: its alarm, its storage, its interpreter and any retained one. The flag goes first so nothing in flight can arm an alarm between the two deletes.

      Returns Promise<void>

    • Runs a PHP fragment and returns everything it wrote.

      A wasm trap (RuntimeError out of _run()) leaves a half-finished Zend state, so the interpreter is dropped. The error still propagates; a 503 would read as warming and hide a fault.

      Parameters

      • code: string

      Returns Promise<string>

    • runs a fragment and parses the JSON object it printed

      Parameters

      • code: string

      Returns Promise<Payload>

    • Keeps the interpreter warm.

      Boot is per-DO-lifetime, not per-request: 3,754 ms of CPU on the edge, of which roughly 1 s of the residual has no identified lever. So the strategy cannot be "make boot fast", it has to be "boot rarely". An alarm is the only way a DO wakes itself, so it is the cold-start strategy rather than an optimisation.

      The interval is a floor, not a guarantee: Cloudflare may still evict, and alarms are best-effort. It reduces cold starts, it does not remove them.

      Parameters

      • intervalMs: number = 240000

      Returns Promise<
          | { existingAlarm?: undefined; intervalMs: number; scheduled: boolean }
          | { existingAlarm: number; intervalMs?: undefined; scheduled: boolean },
      >

    • Returns Promise<{ generation: number; statements: number } | undefined>

    • Parameters

      • path: string
      • cookie: string
      • origin: string

      Returns Promise<ShellAssembly | undefined>

    • Parameters

      • url: URL

      Returns Response | undefined

    • the durable total plus what has not been paid for yet; for a read that must not write

      Returns number

    • Parameters

      • cookie: string

      Returns Promise<"unknown" | "absent" | "held">

    • Sets an alarm and remembers when it is due, so armFillAlarm() never believes a +1 ms alarm survived a 240 s re-arm.

      Parameters

      • atMs: number

      Returns Promise<void>

    • Settles a purge a previous invocation recorded and did not finish; runs at boot too, so a dead invocation purges on the next.

      Returns void

    • Deletes the plans this invocation's tags invalidate and un-flags the rest; runs at the end, when the tag set is complete.

      Parameters

      • tags: readonly string[]

      Returns { cleared: boolean; purged: number }

    • Returns {
          answerable: boolean;
          how: string;
          reasons: Record<string, number>;
          safe: number;
          unsafe: number;
      }

      • answerable: boolean

        always false; see the summary

      • how: string
      • reasons: Record<string, number>
      • safe: number
      • unsafe: number
    • how many shells are stored for a path; 0 makes a seed the right move, not a retry

      Parameters

      • path: string

      Returns number

    • whether this visitor has been proven against the harvest the stored shell came from

      Parameters

      • path: string
      • hash: string
      • uid: string
      • harvestedAt: number

      Returns boolean

    • Whether this firing should pay for a daily-meter flush.

      Two triggers: pending volume flushes at once, an idle warming tick waits for the interval. Both come from meterFlushBudget() (the remaining budget), reaching 25 rows and 60 s at the ceiling. The accumulator is in memory, so an eviction loses at most one interval of counting.

      Parameters

      • nowMs: number = ...

      Returns boolean

    • Whether this alarm firing should spend rows on garbage collection.

      Fills and GC share the rows-written meter, so a waiting page outranks reclaiming disk; the interval gate exists because the measured steady state is 0 rows written.

      Returns boolean

    • Which site this object is, pinned like the origin (a shared bucket needs per-site mirror keys, not the literal 'site').

      Parameters

      • Optionalobserved: string

      Returns string

    • Parameters

      • Optionalopts: { chunkBytes?: number }

      Returns Promise<Payload>

    • One page of one table, as columns plus flat rows.

      Uses OFFSET (a WITHOUT ROWID table has no rowid); unstable under a concurrent write, which the receiving generation check refuses. ponytail: O(n^2) over a whole table; a keyset cursor if a restore ever spans a large one

      Parameters

      • table: string
      • offset: number
      • limit: number

      Returns { columns: string[]; rows: unknown[][] }

    • Flags every plan the moment content changes, before the tag set is known.

      One wholesale UPDATE at the write, so an invocation that dies before settlePlans leaves everything flagged. Not coalesced on bumpCoalesced, which only fillOne() clears (a node save left plans in place on a site serving plans).

      Returns void

    • What the packed day row holds, else the four legacy keys (read-only, so an upgrade mid-day keeps the row budget the degrade guard reads).

      Parameters

      • nowMs: number = ...

      Returns DayMeters

    • Parameters

      • error: string

      Returns number | undefined

    • Parameters

      • Optionaloptions: { force?: boolean }

      Returns boolean

    • The DDL that recreates one table, its own statement first and its indexes after.

      sql IS NOT NULL drops sqlite's auto-indexes, which have no statement and are recreated with the table anyway.

      Parameters

      • table: string

      Returns string[]

    • every table this object holds, in sqlite_master order

      Returns string[]

    • The idle re-arm this site's own traffic justifies.

      Falls back to the configured interval when the predictor has nothing to say. The warm branch is solved (climbing toward the ceiling on windows the object survived); an explicit WARM_INTERVAL_MS wins.

      Parameters

      • queued: boolean = false

      Returns number

    • One log line of memory readings when MEMORY_TRACE=1 (the platform only reports that the isolate was reset).

      Parameters

      • at: string

      Returns void

    • the paths a render has proven cannot be stored

      Returns string[]

    • Parameters

      • action: string
      • params: URLSearchParams

      Returns Promise<Payload>

    • One beat, acquiring the gate only when the caller does not already hold it.

      The gate is a non-reentrant FIFO chain and fetch() already holds it; a second acquire inside the router hangs forever. alarm() is its own event and needs the explicit acquire.

      Parameters

      • gated: boolean

      Returns Promise<{ updb: Payload }>

    • Advances a database-update run by one beat; updbStep() owns no transport, alarm or env, so the dependency bag is built here.

      Returns Promise<{ updb: Payload }>

    • the ceiling the warm solver may climb to; 9,500 unless WARM_CEILING_MS raises it

      Returns number

    • Which uploaded Worker version is answering; null under wrangler dev --local and in the test lanes (not deployed, not unknown).

      Returns { id: string; tag: string | null; timestamp: string | null } | null

    • stores a credential in sealed storage, where the SQL bridge cannot read or write it

      Parameters

      • key: string
      • value: string

      Returns void