# Published data/jobs consumer evidence

This isolated consumer verifies only registry-published public imports. It does not import from `/home/user/Projects/platform`, use relative source/dist paths, or add compatibility shims.

## Pins

The PDF2HTML workspace catalog and `docs/integration/platform-data-jobs.md` pin:

- `@platform-modules/db@0.2.1`
- `@platform-modules/jobs@0.0.2`
- `drizzle-orm@0.45.2`
- `@standard-schema/spec@1.1.0`
- TypeScript `5.9.3` and `@types/node@22.19.21`

The local `.npmrc` contains only the scoped GitHub Packages registry and policy settings. Authentication is supplied by the established remote environment and is neither stored nor printed here.

## Verification

Run on `debian1` through `/home/user/.claude/bin/run-remote`; no install, typecheck, test, or build ran on the workstation:

```text
npm install --ignore-scripts --no-audit --no-fund
npm run typecheck
npm test
npm run build
```

Result on 2026-08-23: install succeeded; typecheck succeeded; 18 runtime subpath/export tests succeeded; build succeeded. The first install attempt against the public npm registry failed with sanitized `E404 Not Found` for `@platform-modules/db@0.2.1`; adding the already-documented scoped GitHub Packages registry to this isolated consumer corrected the registry selection.

TypeScript checks package declarations while `skipLibCheck` isolates this consumer from unrelated optional-driver declaration failures inside Drizzle/PGlite. Consumer source remains fully strict and is compiled without errors.

## Published-contract findings

- The documented root DB types, health and advisory-lock helpers, four explicit PostgreSQL adapters, D1 adapter, and four compatibility alias subpaths resolve from the published DB package.
- The jobs root, CF Queues, DB polling, outbox, and Durable Object runner subpaths resolve with their documented runtime exports. `REARM_DELAY_MS` is `1500`.
- Contrary to the integration document, `SQLiteQuerier` and `SQLiteTransactionalDatabase` are declared internally by `@platform-modules/db/sqlite/d1` but are **not exported by the published `0.2.1` declaration surface**. The public D1 types are `D1Binding`, `D1ClientOptions`, and `DrizzleD1Database`.
- A published `DrizzleD1Database` does not satisfy the root PostgreSQL-shaped `Querier` accepted by `withAdvisoryLock`; the compile-time negative assertion proves the D1/advisory-lock seam is unavailable.
- A root `Database` does not satisfy `TransactionalDatabase`; atomic application commands must require the latter.

## Real CAS limitations

Compilation proves signatures and incompatibilities, not concurrency semantics. The published jobs helpers remain generic rather than authoritative PDF2HTML CAS primitives:

- `claim` does not establish PDF2HTML owner, lease-token hash, lease expiry, heartbeat, source-expiry, or cancellation invariants.
- `requeueAfterFailure` exposes no expected-attempt/owner/lease CAS contract.
- `markJobCompleted` accepts a job identity without an expected-state/owner/lease/attempt predicate.
- `IdempotencyStore.seen()` followed by handler execution and `mark()` is not an atomic claim.
- `dispatchOutboxRow` has no public claiming/lease transition before dispatch, so handlers must independently tolerate duplicate dispatch.

These are API/SQL contract limitations, not production race measurements. Production-like two-connection PostgreSQL concurrency evidence remains required for PDF2HTML-owned lease and CAS commands.
