# Veillance requests, the ledger, light-field credit, and area render requests (w5k8r2tq)

Lane: player, Ansel, 2026-10-25. takeoff-player v0.5.0 and the probe handler. Specs are in ROP orientation §22-§23
([note](https://redfish.acequia.io/guerin/.agents/01a173e5-d532-7488-97b0-d6dd4aafcedc/2026-10-25/notes/rop-orientation_q4w8n2zt.md)).
Stephen: *"a user is requesting a fixed area. That is a veillance request ... I would know who's looking at my imagery and
for what purpose"*, *"I would get credit for the light field percentage that I'm rendering, the direction and the
resolution and the time"*, and *"imagine the request was either for ortho tiles or for 3D temporal tiles"*.
This follows [render-probe_p5r8x2kd.md](render-probe_p5r8x2kd.md).

**Edited:**
- `artifacts/takeoff-player/` (js/probe.mjs, probe-ui.mjs, app.mjs, index.html, styles.css; new veillance-ui.mjs and who-looked.mjs);
- `probe/handler.mjs`;
- `artifacts/rop/sources/` (the index builder gained owners; new credit-validate_p5r8x2kd.mjs).

**New, append-only:** `artifacts/rop/veillance/`, `artifacts/rop/jobs/`.

**Not touched:**
- the phone gate. Its read-only `/_whoami` route already existed (`GET /agents/_whoami` → `{pid, name, signedIn, ...}`,
  private, no-store, no CORS), so nothing was added and no backup was needed;
- the imageryintel Worker, rop/lynn-shore-nahant-circle/, the nahant lane, calibration, takeoff-3d.

## 1. Who and why: the veillance request record

Every probe (`kind: render-probe`) and every area render request (`kind: area-render-request`) is written to
`artifacts/rop/veillance/req_<utc>_<id>.json`, with O_EXCL (never overwritten). Schema `rop-veillance-request/1`:
`{ requester: {id, kind: person|agent|institution|anonymous, verified, via, name?, public}, purpose: {category, text},
polygon, window, gsd: {max, output, best_available}, cadence, output, fulfilment, sourcesTouched: [{sourceId, owner, kind,
posed, potential, spans}], credit, credit_method, result (the probe summary), utc, client }`.

**Who.**
- **Signed in:** the handler reads the phone gate's HttpOnly `sgl_id` cookie itself (`whoFromCookie` from
  auth/phone-gate.mjs, imported read-only). The record is `{id: pid, kind: person, verified: true, via: 'stephenguerin.live phone gate'}`.
  The page only calls `/agents/_whoami` to show the name.
- **Not signed in:** the visitor declares a name or agent id (`verified: false, via: declared`) or stays anonymous, and
  sees a **sign in** link to `/agents/_login?next=<this page>`.
- **Agents:** headless agents pass `requester=<bead/chat id>`, recorded as kind agent.
- **imageryintel.org:** through the story proxy the cookie does not travel (another site; the Worker strips Set-Cookie),
  so identity there is declared or anonymous, with a link to sign in on stephenguerin.live.

**Why.** `purpose` is **required**; without it the handler answers 400 with the list. The categories are my-home,
my-street-or-community, emergency-response, research, journalism, public-interest, commercial, other, plus free text in
`purpose_text`. In the player, a purpose picker comes before the first probe and is remembered for the session.
`public=1` means "list me publicly".

**rop/demand/** (v0.4.0, 36 records) **predates identity** and is kept as it is; new records go to rop/veillance/ only.

## 2. Light-field credit (§23)

`probe.mjs` (class LightField) credits every posed imagery source that would feed a render of the place and window.

**The observation.** An observation is (source, ground sample p, 1 s bin k), taken from the frames that pass the probe's
minCover and gsdMax. It keeps:
- the finest GSD;
- the best quality q = (1 − occlusion/2) / (1 + (σ_pose·range / 10 m)²);
- the view-direction bin (azimuth 30° × elevation 15°, seen from p).

| axis | raw score |
|---|---|
| space | Σ_p max_k q: how much of the place, quality-weighted |
| resolution | Σ_p max_k min(1, (gsd_out/gsd)²)·q: information per point at its best, capped at the output GSD (default 0.25 m); time is not counted twice |
| direction | Σ_p Σ_(bins of s at p) 1/n(p, bin): novel directions earn 1, shared ones are split |
| time | Σ_k c_s(k)·(2 if alone in k, else 1/n(k)), where c = share of the place seen in that second |

**share = normalised geometric mean** of the four axis shares: (S·R·D·T)^¼ / Σ. Shares sum to 1 per request, and a
source must give something on every axis.

**Results (15:53-16:00Z):**

| place | source | share | space | resolution | direction | time |
|---|---|---|---|---|---|---|
| Nahant Circle (the ROP AOI) | 8K clip 115634 (Stephen) | **75.9%** | 53% | 98% | 66% | 1% |
| | Nahant cam (Ocean House) | **18.4%** | 37% | ~0% | 22% | 99% |
| | photo 115638 (Stephen) | 5.7% | | | | |
| Wonderland | clip 115531 | 95.8% | | | | |
| | photo 115541 | 4.2% | | | | |
| Swampscott shore | clip 115634 | 90% | | | | |
| | photos 115659 and 115707 | 5% each | | | | |

- Stephen's light at Nahant Circle (clip + photo) is **82%**.
- The Nahant cam's 18.4% is ~3× its 6.4% pixel share inside the 8K window, because of time and direction, as §23 expects.

**Validation at cell level.** `artifacts/rop/sources/credit-validate_p5r8x2kd.mjs` (→ `.json`) applies the same axes to
the fused product's own per-frame source-map statistics (render-stats-fused/nahant, read only).
- Inside the 8K window the cells are 85.4% 8K and 5.9% Nahant.
- The Nahant cam covers 63.7% of the grid alone for the other 355 s.
- The cell-level share is **8K 72%, Nahant 28%**.

The probe's sample-point estimate (Nahant 19.5% without the photo) is lower: the probe sees the whole place from Nahant
(no DSM occlusion) but weights its 13-23 m GSD. The two methods agree in direction and in order of magnitude.

## 3. Area render requests (ortho, 3d-temporal)

**Player.** After a probe, "request a render of this place": output (ortho time-tiles, or 3D temporal tiles), GSD
(0.25/0.5/1 m), cadence (1 s, every frame, 10 s), then request.

**Headless.** `GET|POST <bead>/probe/request?polygon=&start=&end=&output=ortho|3d-temporal&gsd=&cadence=&rule=&requester=&purpose=`.
Credit is computed the same way, with gsd_out = the requested GSD.

**Fulfilment v0.** Nothing is rendered in the handler.
- **fulfilled-from-existing:** when ≥80% of the place is inside an existing product and ≥50% of the window overlaps it.
  Today that means rop/lynn-shore-nahant-circle: ortho = STAC + COG items + ortho MP4s; 3d-temporal = index-fused.html +
  surface.glb + tiles-fused. It answers with links, the covered window, and a note if the requested GSD is finer than 0.25 m.
- **queued:** otherwise `artifacts/rop/jobs/job_<utc>_<id>.json` (`rop-render-job/1`, status queued) is written. It holds
  polygon, window, output, the sources with their spans, render hints and credit, the requester, purpose, and the link to
  its veillance record. Status: `GET <bead>/probe/job?id=<id>`. `log=0` is a dry run (`would-queue`, no file).

## 4. Who's looking: the ledger route and its policy

`GET <bead>/probe/ledger?source=<id | prefix* | owner:<pid>>[&aoi=<polygon or aoi:name>]`. In the player: **who's
looking** (in the probe panel and the ⋯ menu), with a source picker:
- all of Stephen's;
- each 8K clip;
- the photos;
- the Nahant cam.

It shows who (✓ verified / declared / anonymous), when, why, the output, fulfilled or queued, the best GSD, and the
credit the source earned per request, in total and by axis. Tapping a record draws its polygon on the map.

**POLICY (implemented):**
- **Owner of the source**: the gate's pid equals the source's owner, e.g. stephen-guerin for his 3 clips and 15 photos.
  The owner sees every record that touched it: identities, polygons, windows, resolution, purpose, output, credit.
- **Custodian of this bead** (stephen-guerin) has the same access for sources whose owner has no account here (the Nahant
  cam's operator, Windy/MassDOT, aircraft operators), until they can sign in themselves.
- **A signed-in requester** also sees their own records.
- **Everyone else** gets the public view:
  - aggregate counts by purpose, requester kind, output and fulfilment;
  - credit totals and means by axis;
  - only the records of requesters who chose `public=1`.
  - The rest are counted as "hidden"; their identities and polygons are withheld.
- The public view is served with CORS *; owner and custodian views are `private, no-store`, without CORS (same origin only).
- With `aoi=`, the selection is every request over that place, so the owner's share reads "of what people saw there".

## 5. Owners in the sources index

| sources | owner |
|---|---|
| clips and photos | `stephen-guerin` |
| Nahant cam | "Ocean House Surf & Skate (public stream)" |
| the other YouTube streams | "<channel> (public stream)" |
| Windy road cams | "MassDOT (road camera, via Windy.com)" |
| Windy scenic cams | "webcam operator listed on Windy.com (not identified here)" |
| MassDOT live-only | "MassDOT (Mass511)" |
| aircraft | "<operator> (position via ADS-B, adsb.lol ODbL)" |

## 6. Story hook

`artifacts/takeoff-player/js/who-looked.mjs`:

```js
mountWhoLooked(el, { aoi: 'aoi:lynn-shore-nahant-circle', place: 'Nahant Circle' })
```

- It reads the public ledger view (CORS *) and shows "Of what people saw of Nahant Circle, **82%** was Stephen's light".
  Below that: the four axes (space 63%, resolution 100%, direction 78%, time 1%), why people looked, the public
  requesters, and how many chose not to be named.
- Without `aoi`, it is "who has looked at this video". Demo: `verify/who-looked-demo.html`.
- The story file was not edited.

## Verified

**Headless, public URL and via imageryintel.org.**

Identity and purpose:
- No purpose → 400.
- Anonymous probe → `requester.kind anonymous`.
- Declared agent `claude:ef1a66e3/player:ansel-verify` with public=1 → kind agent, unverified, public.
- Declared person "Test Neighbor", my-home, not public → hidden in the public view.

Render requests:
- Nahant Circle, ortho and 3d-temporal → **fulfilled-from-existing** (rop:lynn-shore-nahant-circle, 88% of the window,
  15:53:25-15:59:34Z).
- Wonderland, ortho and 3d-temporal → **queued** job files; the job status route answers `queued`.
- The request through imageryintel.org was fulfilled and recorded (no cookie there, so declared).

Gate and ledger:
- `/agents/_whoami` without a cookie gives `{pid: null}`.
- The ledger without a cookie gives the **public** view, with CORS *.

Ledger policy, unit-tested in Node on the real records with the handler's own `ledgerView()`:

| viewer | records seen of 13 |
|---|---|
| public | 8 shown (only the public agent), 5 hidden |
| stephen-guerin | 13, including "Test Neighbor" and the anonymous ones |
| another signed-in pid | public view (8, 5 hidden) |

**UI (headless Chrome via CDP, `verify/veillance-check.mjs`, desktop 1500x880 and iPhone 14 with touch).** In this order:
1. The panel asks who and why before the first probe.
2. A declared agent with a purpose → the probe → "recorded on the veillance ledger: req_… · as … (declared) · agent ·
   public · for research".
3. The credit table: 76 / 18 / 6% with the axes.
4. "Request 3D temporal" at Nahant → fulfilled-from-existing, with the viewer, glb and time-tile links.
5. Wonderland ortho → queued, with the job and status links.
6. Who's looking: the public view as served, then the owner view.
7. The story panel on desktop and phone.

Results: no console errors, no horizontal overflow, no control under 44 px on the phone.
- About the owner view in the UI: headless Chrome has no phone-gate session, and I did not forge one. For the owner-view
  screenshots the ledger response was replaced (CDP Fetch) with the handler's own `ledgerView()` for viewer stephen-guerin.
- Fixed after looking: on the phone the who/why picker was hidden behind the closed map sheet, the "who's looking" title
  was hidden, and the story panel's axis captions were too large.
- Screenshots: `verify/veil_*.png`; results: `verify/veillance-check-results.json`.

**Records written by these checks:** 29 veillance records and 6 queued jobs, nearly all requester
`claude:ef1a66e3/player:ansel-verify[-ui]`, plus "Test Neighbor" and a few anonymous ones. The ledger is append-only, so
they stay.
- The first 6 records were written while the server still had the v0.4 probe module cached, so they carry no credit; the
  handler now re-imports probe.mjs when it changes.
- Credit means count only records that carry credit.

## For Stephen to try on his phone

1. Open https://stephenguerin.live/agents/8ac6d87f-3192-4fdb-a260-583dbee74291/artifacts/takeoff-player/index.html.
2. Choose ⋯ → probe and pick a purpose. Before signing in it says "as anonymous / declared", with a **sign in** link.
3. Sign in (phone line). The probe panel should then say "as **Stephen Guerin** ✓ verified", and the ledger record should
   carry `verified: true`.
4. Open **who's looking**. It should say **owner view** without any simulation, listing every request including the
   hidden ones.
5. Open the same page on imageryintel.org. Identity there stays declared or anonymous (no cookie across sites).

## Limits

- Purpose is a promise on the record, not yet a consent rule. Per-source consent policies (§22) and purpose caveats on
  capabilities are next.
- The credit axes use the probe's sea-level samples. The cell-level version from a product's source map is more exact
  (see the validation), and should be computed when a job is rendered.
- Jobs are queued, not run. The co-hosted render queue (§7) and the rop/tools pipeline still have to pick them up.
- The custodian rule gives stephen-guerin full sight of the Nahant cam's ledger until its operator can sign in. That
  stands in for the operator; it does not belong to Stephen.
