# Grounding Lab Admission Gate

The Grounding Lab Admission Gate (`admission-service`, crate `pcoc-admission`) checks a Satoshi Hike v2.0 object. It reads one config file. It does not run v1.35 verify and it does not load a v1.35 profile.

Install is [deploy/DEPLOY.md](deploy/DEPLOY.md). Request and response bodies are [WIRE.md](WIRE.md).

The Sign-in door is `POST /v1/sign-in`. The body is the locked §15.1 six-field JSON object. The website polls `GET /v1/sign-in/result/<nonce>`. The phone may leave after the POST. A signature miss is HTTP 400 `bad_signature` with no message. A grammar miss is HTTP 400 `malformed` with no message. Any other response is delivery of that POST. This process does not mint a session.

A v1.35 object on sign-in is website outcome `earlier_version` after a valid signature. On verify, the job error message is `This object is an earlier version. This gate checks Satoshi Hike v2.0 only.` It is not "could not be read".

| Piece | Name |
|---|---|
| Service | Grounding Lab Admission Gate |
| Spec | Satoshi Hike v2.0 (`spec_kind` `v2.0`) |
| Cargo package | `pcoc-admission` |
| Directory | `services/admission-gate/` |
| Binary | `admission-service` |
| Config | one TOML file, `--config` or `GATE_CONFIG` |
| Crate version | `0.3.0` |

```text
POST /v1/sign-in           -> locked §15.1 body
GET  /v1/sign-in/result/{nonce}
GET  /latest.json          -> tip after a durable line
GET  /log/{YYYY-MM-DD}.jsonl
POST /v1/verify            -> 202 { "job_id" }
GET  /v1/verify/{job_id}   -> status, and the section 14 record when the object is v2.0
GET  /v1/health            -> version, commit, spec, spec_kind, config
```

`POST /v1/admit` and the other legacy names are HTTP 404.

The reference verifier is `linked_measure` in `src/verifier.rs`. It calls `hike::verify_with_bind_threads` from the v2.0 reference crate. Index reads are one shot. An earlier kind is that crate's Rule A5. Policy then judges the measurements.

Policy is not a profile. `leg_rate_floor` in the config is `strict` (7/20), `default` (1/4), or `lenient` (1/8). The floor compares the bookend pair `(N, S)` in the section 14 record. There is no friendly list and no held state. `verify_summary` is that record, including `profile` and the trailing newline.

The public log starts empty. The process creates `log_dir`. A chain that is not Satoshi Hike v2.0 is not opened and not served.

```bash
cargo build --release -p pcoc-admission --manifest-path services/Cargo.toml
cargo test --manifest-path services/Cargo.toml -p pcoc-admission
```

`GET /v1/health` on the bind (default `127.0.0.1:8787`) reports what is running. It does not fetch the index.
