Plan: SHINES profile delivers CpsRequest via S3 object drop
Archive record
Merge requests: !1751 (re-land of !1576: three cherry-picks + fixes; Closes #1610, #1611, #1612, #1687)
2026-09-29 (GA SHINES ingests by S3 bucket drop — ShinesSink writes, under
{prefix}/{client_request_id}/, craig_receipt.json first (server receipt time + the conformed digest), signed-path
attachments/{sha256}, then cps_request.json last via craig_store::store_blob_create; dateReported /
intakeDate / submitted_at are the server receipt time and a replay answers the original; same id + different
substance is the typed 409 IDEMPOTENCY_CONFLICT before any attachment; CRAIG_STOREBACKEND=local refused under
shines; the honeypot echoes the client id under shines; pre-1.0 breaking — CRAIG_INTAKESHINES_URL + the SHINES
mock removed, the edge needs CRAIG_STORE* + optional CRAIG_INTAKES3_KEY_PREFIX; tracking reference is the
reporter’s own client_request_id. ADR-042 § "Amendment 2026-08-31". Open: #691 BOTS schema + key-layout sign-off,
#1613 object-store-degradation e2e, #2094 SDK client-id minting, #2109 honeypot submitted_at tell, #2110 form
recovery from a SHINES IDEMPOTENCY_CONFLICT.)
Status
Done (2026-09-29) — !1751
Erratum (2026-09-29): this plan was written on the original branch after implementation, and the first draft derived
submitted_at and a date key segment from the client-minted id. The re-land (feat/1610-shines-s3-delivery, three
cherry-picks plus fixes) corrects the Design to as-built: server receipt time persisted in craig_receipt.json, a
date-free key, the typed 409, the Local refusal, the honeypot echo under Shines (#1687).
Epic: &85
Issues: #1610, #1611, #1612, #1687
Branch: feat/1610-shines-s3-delivery
Context
craig-intake is a stateless edge (ADR-017). Under BackendProfile::Shines
(ADR-042) a standalone edge conforms each validated submission
to Georgia’s legacy SHINES CpsRequest schema (backend/shines/mapper.rs) and — before this plan — POSTed it
synchronously to {shines_url}/cps-requests. SHINES has no such API; that target was a mock (the shines module of
craig-mock-server).
The real GA SHINES ingestion path is an S3 bucket drop. This plan makes the
SHINES profile write the conformed CpsRequest (and, on the signed path, its
attachments) to an S3-compatible object store via the existing craig-store
crate, and removes the HTTP POST path, the shines_url setting, and the SHINES
mock route.
This is a pre-1.0 breaking change to the SHINES profile’s deployment config and is recorded as an ADR-042 amendment (no new ADR). The object store is the durable record — the same "synchronous, durability-confirming, no local buffering" posture ADR-042 already specifies, with a different transport.
Scope
In scope:
-
Rewrite
ShinesSinkinternals:reqwestPOST →craig_store::Storeobject write.parse_views+mapper::mapare unchanged. -
Object layout:
craig_receipt.json(first) + onecps_request.json(last) per submission + content-addressed attachment blobs on the signed path; convergent no-overwrite viacraig_store::store_blob_create. -
Config: remove
shines_url(field + helper +validate()requirement); addCRAIG_INTAKES3_KEY_PREFIX. Bucket / endpoint / credentials load from the existingCRAIG_STORE*env. -
Boot:
boot_standalone_shinesloads the object store, keeps the crosswalk fidelity gate, and addscheck_store_fidelity(key-prefix escape guard
Local-backend refusal). -
Honeypot: under
Shinesthe public honeypot echoes theclient_request_id, as the real accept does. -
Remove the SHINES mock (the
shinesmodule ofcraig-mock-server) + its mount + the/shines/_control/faulttoggle; mark the proposed-API interface page superseded. -
Devstack:
craig-intake-standalone-shines(+-tls) dropCRAIG_INTAKE__SHINES_URL/ themock-serverdep edge and gain thegarage_credentialsanchor +garage/garage-initdeps. -
Test migration: the
ShinesSinkdelivery tests, the signed-submit integration assertions (mock capture → Garage read-back), and the SHINES e2e upstream-fault scenario.
Out of scope:
-
A configurable HTTP-vs-S3 toggle — S3 is now the only SHINES delivery.
-
Object read-back / a status API —
get_report_statusstays 503, route unmounted (ADR-042 §D7, unchanged). -
Bucket lifecycle / retention / TTL / server-side encryption — operator-owned (see Risks, PII at rest).
-
The
None(cases) and integrated paths — untouched. -
Any change to the mapper,
ExtraFields,NarrativeView, the RefVal crosswalk, the signed-JWS verification, or the keyring sidecar.
Design
ShinesSink — services/craig-intake/src/backend/shines/sink.rs
pub(crate) struct ShinesSink {
store: craig_store::Store, // Clone
key_prefix: String, // boot-validated
}
forward() parses the typed views (500 on an internal parse failure), then:
-
dir = {prefix}/{client_request_id}— built ONLY from the boot-validated prefix and the UUID. No date, no request field. -
Read
{dir}/craig_receipt.json. Present: conform at itssubmitted_at. Absent: stamp the server clock, conform at it, and create the receipt ({submitted_at, cps_sha256}); a lost create race adopts the winner’s receipt and re-conforms at its time. A mapping failure is the 422 and writes nothing. -
The conformed digest differs from the receipt’s
cps_sha256→ 409IDEMPOTENCY_CONFLICT, before any attachment write. -
Write each edge-verified attachment to
{dir}/attachments/{sha256}, THEN{dir}/cps_request.jsonLAST, declared against the receipt’s digest. -
Return
AcceptedReport { id: TrackingReference(client_request_id), submitted_at: receipt.submitted_at }.
put_object wraps craig_store::store_blob_create: Created / Converged → Ok; OccupiedKeyForeignBlob → the
typed 409; Store(e) → opaque 500 via From<StoreError>; the remaining variants → opaque 500. Garage (no
If-None-Match) leaves a residual last-writer-wins window for two simultaneous different submissions under one id
(ADR-042 amendment, "Concurrency").
Object layout
{prefix}/{client_request_id}/craig_receipt.json (written first)
{prefix}/{client_request_id}/attachments/{sha256} (signed path only)
{prefix}/{client_request_id}/cps_request.json (written last)
The CpsRequest.supportingDocuments manifest already carries
{fileName, fileType, sha256} per file, so a consumer resolves each
attachments/{sha256} from the manifest. {prefix} =
CRAIG_INTAKE__S3_KEY_PREFIX, default cps-requests.
Config — services/craig-intake/src/config.rs
-
Remove
shines_url(field,shines_url()helper, the(Standalone, Shines)validate()requirement, the hand-writtenDebugfield, the test fixtures).keyring_urlis still required. -
Add
#[serde(default = "default_s3_key_prefix")] pub s3_key_prefix: String(defaultcps-requests).
Boot — services/craig-intake/src/main.rs + backend/shines/fidelity.rs
boot_standalone_shines loads craig_store::ObjectStoreConfig::load() (which
already refuses a missing backend), runs check_boot_fidelity()
check_store_fidelity(&backend, &s3_key_prefix), then
Store::from_config(&store_config) and
ShinesSink::new(store, settings.s3_key_prefix.clone()). build_router is
unchanged (the Signed wiring, mount_status: false, the keygen-under-Shines
gate are all as-is).
check_store_fidelity fails the boot (via anyhow) on a prefix that is empty,
whitespace-padded, absolute, or has a . / .. / empty path segment / backslash
/ NUL; it refuses StoreBackend::Local.
Steps
Step 1: ShinesSink HTTP → S3 + config + boot + mock removal + devstack
Files: services/craig-intake/src/backend/shines/{sink,fidelity,mod}.rs,
services/craig-intake/src/{config,main,router_tests}.rs,
services/craig-intake/Cargo.toml, tools/craig-mock-server/src/{lib,shines}.rs,
docker-compose.yml, CHANGELOG.adoc.
Rewrite the sink struct + delivery half + helpers; migrate the ShinesSink unit tests to a tempdir Local Store
(writes CpsRequest object, idempotent retry, attachments as siblings, zero-byte attachment, typed 409 before
attachments, receipt replay, lost-claim, partial-failure retry, store-fault → redacted 500, key not request-derived,
never-logs-attachment-bytes; the mapper-422 + debug-capture + get_report_status 503 tests are kept). Delete the SHINES mock;
rewire the two devstack SHINES services to Garage.
Step 2: integration + e2e test migration
Files: services/craig-intake/tests/api/signed_submit.rs,
tests/e2e/specs/intake-embedded-ui-shines.spec.ts,
docker-compose.yml (craig-e2e env), xtask/src/docker.rs.
The signed-submit integration tests already asserted only "a tracking reference
is returned" (they never read the mock’s captured body), so the migration
strengthens rather than rewrites them: a craig_test_lib::garage_test_store()
read-back of {prefix}/{client_request_id}/cps_request.json asserts
the mapped CpsRequest shape, plus a new signed_submit_is_idempotent_on_the_object_key.
The three SHINES e2e specs assert the tracking reference equals the submitted
client_request_id; the /shines/_control/fault upstream-fault scenario is removed
(no upstream) with an object-store-degradation e2e tracked as a follow-up
(#1613). CRAIG_SHINES_MOCK_URL is removed from compose + xtask.
Step 3: docs
Files: docs/modules/ROOT/pages/adrs/adr-042-standalone-intake-backend-plugin.adoc,
docs/modules/ROOT/pages/interfaces/shines-cps-intake-proposed-api.adoc,
docs/modules/ROOT/pages/intake-standalone-architecture.adoc,
docs/modules/ROOT/pages/configuration-reference.adoc,
docs/modules/ROOT/pages/local-dev.adoc, CHANGELOG.adoc, this plan.
ADR-042 amendment (S3 delivery + strip-surface update); "Superseded" banner on the proposed-API interface page;
architecture flow diagram + ShinesSink bullet; configuration-reference S3_KEY_PREFIX row; local-dev service row;
CHANGELOG Changed + Removed.
Verification
-
cargo nextest run -p craig-intake --bin craig-intake— thebackend::shines+configunit suites (tempdir-store, no devstack). -
cargo nextest run -p craig-mock-server— passes withshines.rsgone. -
cargo clippy --workspace --all-targets — -D warnings,cargo fmt --check,cargo xtask quality-budgets. -
cargo xtask dev reload—craig-intake-standalone-shinesboots healthy withgarage/garage-init/craig-intake-keyringdeps and nomock-serveredge. -
cargo nextest run -p craig-intake --test api—signed_submitreads thecps_request.jsonback from Garage with the assertedCpsRequestfields;route_profile_visibilityunchanged. -
Boot-failure: unset
CRAIG_STOREBACKENDfor the shines container → refuses;CRAIG_STOREBACKEND=local→check_store_fidelityrefuses;s3_key_prefix=".."→check_store_fidelityrefuses;Shines
MODE=integrated→validate()refuses (unchanged); noKEYRING_URL→ refuses. -
The battery’s e2e projects
intake-ui-shinesandintake-ui-shines-tls— the form and the signed paths submit against the S3-backed edge and the confirmation shows the submittedclient_request_id.
Documentation Updates
-
ADR-042: Modular Per-Backend Plugin for Standalone Intake (SHINES Alignment) — amendment + strip-surface update
-
SHINES CPS Intake — Proposed API — Superseded banner
-
Standalone Intake — Backend-Profile Architecture — flow diagram,
ShinesSinkbullet, receipt contract -
Configuration Reference —
S3_KEY_PREFIXrow (least privilege, dedicated bucket, SSE) + the standalone-SHINES mode note -
Local Development — the
craig-intake-standalone-shinesservice row -
CHANGELOG.adoc—== Unreleased=== Changed+=== Removed(pre-1.0 breaking)
Risks / open items
-
PII at rest. The
CpsRequestobject carries third-party / minor SSNs, addresses, DOBs — plaintext JSON in the bucket. Inherent to the feature; the ADR amendment + architecture page state that bucket encryption / ACLs / retention are operator responsibilities. No app-layer envelope encryption in scope. Operator requirements:s3:GetObject+s3:PutObjecton{bucket}/{prefix}/*pluss3:ListBucketon the bucket conditioned ons3:prefix={prefix}/*(without List, S3 answers a missing key 403 instead of 404, and the receipt read and the read-back precheck depend on the 404), nos3:DeleteObject; a bucket dedicated to the drop; bucket default encryption (SSE-S3, or SSE-KMS withkms:GenerateDataKey+kms:Decrypton the key), never a policy denying a PutObject that lacks an SSE header (craig-storesends none). -
Removing the mock breaks the SHINES upstream-fault e2e. Replaced with a happy-path tracking-reference assertion; an object-store-degradation e2e is #1613.
-
BOTS has not confirmed the object schema or key layout (#691). The mock was equally unconfirmed; S3 is strictly closer to the real path. The drop also carries CRAIG’s
craig_receipt.jsonbesidecps_request.json; BOTS ingestion is to key oncps_request.jsononly. -
Garage concurrency residual. Garage ignores
If-None-Match, so two simultaneous DIFFERENT submissions under one id can end last-writer-wins, and two simultaneous identical first attempts converge on the bytes but may answer differentsubmitted_atvalues; sequential identical retries converge. Documented in the ADR amendment. -
Sticky claim. A store fault between the receipt and
cps_request.jsonleaves the id claimed for that content: an identical retry converges, an edited resubmission is a 409, and today the form cannot recover from it without a reload (#2110). -
Honeypot
submitted_at. Under Shines the honeypot echoes the client id, but itssubmitted_atis the edge’s current time on every attempt where a real replay answers the original — a pre-existing tell (#2109).
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic — fresh post-implementation review of !1576 (posted on the MR) |
Claude Opus 5.5 |
no-ship — folded on re-land: server receipt time + date-free key, the false client-id-version claim (#1687), typed 409 before attachments, Local refused, least-privilege / dedicated-bucket / SSE guidance, the e2e id oracles, the tautological idempotency read, the partial-failure test, the plan’s status table |