Web service and HTTP interfaces#

The Cloudflare/TanStack service has two distinct responsibilities: distribute validated retained scientific artifacts and perform bounded exploratory source discovery. The second does not turn the Worker into the canonical Python compiler.

Retained scientific read API#

GET /api/v1/health
GET /api/v1/studies/change6
GET /api/v1/manifests/change6
GET /api/v1/benchmarks/probe-r1
GET /api/v1/studies/change6/currentness

Scientific artifact reads use build-time standalone validators generated from Python-owned JSON Schemas. Runtime schema code generation is not introduced into the Worker.

Bundled canonical artifacts provide the baseline. If an evidence bucket is configured, objects are accepted only after expected identity and contract checks. Missing or invalid distribution objects produce an explicit fallback to the bundled artifact, not a different scientific Standing.

Object storage is distribution infrastructure, not scholarly archival custody by itself.

Exploratory discovery API#

POST /api/v1/discovery
Content-Type: application/json

A request carries a versioned research draft, for example:

{
  "version": 1,
  "label": "My lunar investigation",
  "latitude": -42,
  "longitude": 206,
  "at": "2024-06-01T22:23:00.000Z",
  "beforeDays": 365,
  "afterDays": 365,
  "uncertaintySeconds": 0,
  "spatialMode": "POINT",
  "halfSpanDegrees": 0.25,
  "coordinateBasis": "USER_DEFINED_PLANETOCENTRIC"
}

These are illustrative user-input values, not an independently validated event localization or a claim about the source result count.

The target, mission, instrument, product type, upstream host, and source-query construction are server-controlled. Caller-provided upstream URLs and unknown draft fields are rejected.

Discovery response#

The lunartrace-lab/2 envelope includes:

Field

Meaning

authority

DISCOVERY, not canonical admission

query / queryKey

Exact normalized source-query intent and its local representation

queriedAt / finishedAt

Operation timing, not archive indexing horizon

expectedCount

Count witness when a unique total is established; otherwise null

retrievedCount

Number of retained normalized observations

closure

COMPLETE, PARTIAL, or UNKNOWN within the documented retrieval ceiling

observations

Actual normalized exploratory rows with source identities and issues

sourcePages

Request parameters, receipt time, byte count, raw base64 bytes, and SHA-256

normalizedHash

Digest of the browser-oriented observation projection; not Python canonical model identity

indexedThrough

Currently null in the Lab

limitations

Relevant retrieval, normalization, and interpretation boundaries

See Source discovery, closure, and currentness for resource limits and closure semantics.

Errors and request policy#

Retained artifact-service errors use the existing generated application error contracts. The new exploratory discovery boundary uses a small separate JSON error envelope; it does not mislabel those failures as canonical scientific artifacts.

Status

Discovery meaning

400

Invalid or oversized draft

403

Disallowed cross-origin request

405

Unsupported method; use POST

415

Unsupported content type

429

This isolate’s bounded concurrency is occupied

502

Source operation failed before a usable capture response

Responses are not implicitly cached as canonical results. Per-request budgets and an isolate-local concurrency guard do not constitute a distributed rate-limit guarantee. Broader public use needs an operational quota/abuse review.

A request failure must not erase the client’s last reconciled capture. A changed query makes that capture inapplicable to the new draft until another query succeeds.