Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/API_CONTRACTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ Netlify helper responses use:
## Nullable event/source metadata (October 12 repair candidate)

Canonical source occurrence/publication/update/verification clocks are ISO strings or null, and legacy/UI clocks are epoch milliseconds or null. Ingestion/generated clocks describe processing, never source observation. Confidence is numeric (including legitimate zero) or null. Unknown source freshness is null. Source/provider URLs are absolute HTTP(S) without embedded credentials or null; invalid supplied ingestion URLs produce errors and raw imported UI links remain unavailable. Existing route names/envelopes are preserved. See [repair capability and editing guide](AUDIT_REPAIR_2026-10-12.md).

## Local unknown severity candidate (2026-11-02)

Canonical severity is nullable; absent or invalid severity has label `unknown`. Legacy events carry `severity: unknown` and `severityScore: null`; numeric zero remains low with score zero. Unknown can be selected explicitly in severity filters and sorts after known zero. Country risk counts `unknownSeverityEvents` and excludes them from severity-weighted pressure, with a limitation notice; this does not imply safety. Threat and all-unknown clusters remain unscored. Known label mappings are 20/45/70/90 on the canonical 0-100 scale. Confidence, freshness and impact retain separate fields. No feeds or hosting policy changed.
42 changes: 42 additions & 0 deletions docs/GLOBE_PERFORMANCE_LOCAL_2026-10-30.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Local globe repeat-work measurement

Baseline: `390b9a6b79bc89b03baf03f4fe4b1e02aed29384`, origin `https://github.com/Zacharon/live-map.git`. Candidate exists only in orchestrator-bound `perf/globe-local-20261030`; no canonical application, push or deployment.

## OBSERVED

- `src/map/globe-controller.js:setGlobeMode` called `webglAvailable()` on every render. `src/map/cesium-adapter.js:19-30` creates a temporary canvas/context and releases it. Twenty synthetic chokepoint toggles produced 24 and 22 WebGL getContext calls, consuming 182.0 and 133.2 ms inside getContext alone.
- The focused change reuses `globeHandle.ok` while a viewer exists. Forced failure and context-loss guards take precedence; teardown clears the handle so a new probe occurs.
- Same scenario after the change produced zero repeat probes in both initial and verification runs. Rotation and viewer identity passed. No overall latency speedup is established: repeat elapsed times varied.
- Startup source path: index.html loads Leaflet and markercluster before app.js; app.js statically imports app-controller.js and its dependency graph. Cesium loads dynamically from cesium-adapter.js:118 onward, with an IIFE fallback. Resource durations do not isolate JS parse/evaluation time.
- Initial baseline Cesium module resource duration was 5245.6 ms for 4,754,611 transferred bytes, versus 151.7 ms on reload. The later cold-cache sample was 137.1 ms. OS/filesystem/antivirus/process warmup are uncontrolled; this is not evidence of an optimization to Cesium transfer or parsing.

| Sample | First renderer-ready ms | 20 toggles elapsed ms | Repeat probes |
| --- | ---: | ---: | ---: |
| Before, cold browser cache | 6776.3 | 1755.8 | 24 |
| Before, warm process reload | 1117.8 | 1459.6 | 22 |
| After, cold browser cache | 1667.2 | 1646.1 | 0 |
| After, warm process reload | 1119.3 | 1173.6 | 0 |
| Verification, cold browser cache | 1936.3 | 1826.8 | 0 |
| Verification, warm process reload | 1210.1 | 1617.0 | 0 |

Readiness is a 10 ms sampled renderer signal, followed by an explicit camera rotation assertion, not a user-input-to-photon metric. The loopback server sends no-store, so warm means process reload, not an HTTP asset-cache hit.

## Reproduce and correctness

Raw local evidence: [before](../artifacts/globe-performance/before.json), [after](../artifacts/globe-performance/after.json), [verification and regressions](../artifacts/globe-performance/after-verified.json). These generated artifacts are ignored by Git and remain in this local checkout.

`node scripts/measure-globe-local.mjs <label>` starts a loopback synthetic-only preview and isolated headless Edge, blocks HTTPS, clears browser cache for the first navigation, reloads, rotates the camera and toggles chokepoints twenty times. It writes `artifacts/globe-performance/<label>.json`, then closes its browser and server. Baseline data was collected before the controller change using the same measurement segment. Added post-measurement regressions verify forced WebGL fallback, recovery and probing after 2D teardown.

PASS: npm run check:syntax; offline validator (10 checks); semantic-globe-weather tests; globe-style tests; headless assertions, forced failure/recovery/2D teardown, zero unhandled exceptions. Offline source reachability intentionally omitted. No provider contacts or real user records used.

## INFERRED / UNKNOWN

INFERRED: reusing a live viewer removes redundant GPU capability work. MDN documents canvas context creation/reuse and context-loss notification: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext and https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/webglcontextlost_event . This implementation preserves the existing context-loss callback/guard.

UNKNOWN / NOT RUN: physical GPU/device performance, hosted startup, actual input rotation latency, precise parse/long-task attribution, induced context loss, HTTP warm-cache performance and statistical latency benefit. No release/closure or H3 certification is claimed. Owner acceptance, production CSP and native recovery gates remain open. Auth, schemas, ingestion, public export and hosted configuration unchanged. No feature added; existing human controls and agent setGlobeMode command share this path, with no new authorization or durable state.

Tool discovery: Node v24.16.0 and installed Edge found; repository design-browser.mjs supplies headless CDP without dependencies. No REA-named tool surfaced in available-tool discovery and no rea/playwright executable was found by Get-Command. No installation attempted.

Primary upstream evidence: [Khronos WebGL specification, Context Creation](https://registry.khronos.org/webgl/specs/latest/1.0/#2.1) defines creation of a drawing buffer with a new WebGL context. Consulted editor draft dated June 30, 2026 (work in progress). This supports the allocation mechanism; measured timings come exclusively from local results above.

Independent read-only researcher corroborated adapter lines 19-28 create a new canvas for each probe, so same-canvas context reuse does not avoid this lifecycle. The reviewer identified the creation-success-only nature of `ok:true`: the patch retains contextLost/failWebgl precedence and existing teardown nulling. [Cesium Viewer.destroy documentation](https://cesium.com/learn/cesiumjs/ref-doc/Viewer.html#destroy) requires destruction when permanently removing the widget. This is a source review, not independent runtime or H3 certification.
142 changes: 142 additions & 0 deletions docs/HOSTED_ACCEPTANCE_2026-10-19.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Hosted acceptance probe — October 19, 2026

Verdict: **PARTIAL; proposed hosted acceptance milestone remains open.**

Observed 15:36–15:40 UTC using T3's collaborative browser. Desktop 1280×800 and
mobile layout 390×844 (desktop browser engine, not a physical mobile device).
No deployment, production configuration changes, provider activation, case import,
review approval or external publication was performed.

## Revision and hosting identity

Fetched `origin/main` read-only; it resolves to
`5aabf0f7903ecee7e10c12d05e7eea7113d2cf56`. This worktree stays on its separate
October 18 fixture branch. No rebase, merge or checkout was performed.

GitHub's check-runs API reports success for validate, repo-secret-scan,
browser-secret-scan, CodeQL and Workers Builds on that revision. The Workers check
links build `cac3d61d-5a42-487b-b1bd-4543ec4f2555`. GitHub's deployments API returned
an empty array; that is not proof of no Cloudflare deployment. The serving Worker
version was not exposed by the sampled responses and was not independently bound
to the supplied `5ca83369-1dde-401a-8d72-f73f12a0ac96` version.

- [Netlify homepage](https://liveworldmap.netlify.app/): HTTP 200, older operator
console visible; serving SHA unknown.
- [Netlify globe](https://liveworldmap.netlify.app/globe.html): fresh HTTP 404,
“Page not found.” This is a host/path observation, not a merged-code diagnosis.
- [Cloudflare homepage](https://live-map.zacharyfavaron.workers.dev/): HTTP 200,
Watch workspace visible; defaults to `mapMode=2d`.
- [Cloudflare globe](https://live-map.zacharyfavaron.workers.dev/globe.html): HTTP
200. Normal 3D selection navigated to `/globe?...&mapMode=3d` and rendered Cesium.

Five sampled frontend response bodies match `git show origin/main:<path>` SHA-256:

```text
index.html d898ffb47ec6b0a7b0288feb892f0a52d2bbdf0433b5159d3cfcbca8e21b55a6
globe.html c56cb3ef9d835bcc853d10562db8663d2b6a77c6af785dfdc7c0ac504ac55dbd
src/app-controller.js 8dd8a724b9a050240f68b64f2a09250f0f1b25dbd6441a9915e8dd9287e65456
src/map/cesium-adapter.js fcdec2879c94ac00e5b3b6938192aca532a383a86766d1b72205d394835f1ec2
src/map/globe-controller.js 802e2f9cab8632cb3715f3fc2dd4a4c034688dea3b30f77bce81fbd35b96e72e
```

This establishes sampled frontend content parity. It does not prove the entire
deployed bundle, server code, serving version, or every asset matches that SHA.
One initial local hashing command failed due to PowerShell/native quoting; the
corrected stdin Node script produced the hashes above. No application change was
needed.

## Genuine public-event journey

Hosted `/api/events?hours=24` returned HTTP 200. Selected record:

- ID `usgs:us6000u3ct`, M 5.3, 116 km WNW of Höfn, Iceland.
- [USGS source](https://earthquake.usgs.gov/earthquakes/eventpage/us6000u3ct).
- Occurred `2026-10-19T14:44:24.015Z`; source revision
`2026-10-19T14:59:53.040Z`; API `ingestedAt` `2026-10-19T15:37:10.607Z`.
- Latitude 64.5774, longitude -17.5136; provider `usgs`; reviewed in supplied
provider metadata. Source page itself was not independently opened in this run.
- Provider status reported healthy, not stale, with `stateStorageMode: memory`.
This is not evidence of durable collection or recovery.

Clicked the ordinary report title, changed the native map-mode control to 3D,
opened the ordinary export disclosure, downloaded JSON, and used browser Back.
No synthetic event injection or demo mode was used for this journey.

PASS observations:

- The same ID/source/occurrence/revision appeared in list, inspector, globe
selection attribute and downloaded artifact. A selected marker and label were
visible on the desktop globe.
- Desktop 2D loaded 12 tile elements at the sampled moment. Globe loaded actual
same-origin Natural Earth JPEG tiles; network diagnostics show HTTP 200.
- Cloudflare homepage CSP has `script-src 'self' 'wasm-unsafe-eval'`; globe adds
`'unsafe-eval'`, retaining the other restrictions. No CSP refusal was found in
captured browser diagnostics. GPU ReadPixels warnings were present.
- The 2D→3D URL retained event ID, 24-hour window, filters, view, basemap, center
and zoom. Browser Back returned to the 2D homepage with those values retained.
Non-default as-of, different time windows and every filter combination were
NOT RUN.
- At 390×844, document scroll width remained 390. The globe rendered at mobile
layout and recovered after one Retry now action. Physical mobile testing and
owner visual acceptance remain NOT RUN.
- Existing `?failWebgl=1` hook explicitly disclosed forced unavailability and
retained the selected event and filters in the Leaflet fallback. This is a
forced renderer-failure probe, separate from the real API failure below.

## Acceptance gaps and precise follow-up

1. **Serving-version binding UNKNOWN.** Obtain read-only Cloudflare deployment
metadata linking the currently serving URL/version to the exact revision.
Sampled assets already match; no deployment is needed merely to investigate.
2. **USGS-to-case path not demonstrated.** Clicking Evidence ledger with the
USGS event selected opened `view=chokepoints`, Strait of Hormuz and
`case=portwatch-hormuz-2025-01`. The case selector exposed historical PortWatch,
synthetic Hormuz and Riyadh reporting. No USGS case entry was present. This
run therefore cannot accept the same event through Question → Evidence →
Assessment → Review → Export. Import is available, but was not used to invent
a native handoff or approval. Existing review gates were not exercised/closed.
3. **Mobile pane transition clears selection.** With the event selected in the
mobile Reports inspector, clicking Map removed `event=usgs:us6000u3ct` from
the URL and left `data-globe-selected-event` empty. This fails selection
preservation for that specific pane transition; it is distinct from the
successful desktop Back behavior.
4. **Export semantics differ.** API independentSourceCount/corroborationScore are
null and the inspector says “Independent sources: Not established.” The
snapshot card shows “Corroboration: 1”; JSON reports `distinctSourceCount: 1`,
`sourceKeys: ["usgs"]`, `display: "1 distinct source (related/co-cluster)"`.
Its caveat explicitly says this is not independent primary confirmation.
Record this as terminology/semantic parity ambiguity, not proof that JSON
claims independent verification. Inspector retrieval time also says “Not
supplied” despite API ingestedAt; document the intended clock mapping before
treating ingestion as publication or observation time.
5. **Observed API failure and recovery.** At 15:39:11 UTC console reported HTTP
503 and `Error: API 503` in loadEvents. Mobile showed “Feed unavailable,”
“Event data temporarily unavailable,” and last successful refresh while
retaining the prior inspector. It also said “Next automatic retry
Future-dated.” This timestamp label is misleading for a scheduled future
retry. One manual Retry now later returned an Operational display with
9/28 sources healthy; it does not explain the 503 or prove sustained recovery.
Root cause, broader host availability and stale-record export behavior remain
unverified. Do not generalize this single observed response into an outage.

Next bounded work is version binding and these experience gaps using the merged
implementation. Native PostgreSQL concurrency/restore, hosted durable activation,
global tracking coverage and owner approval remain separate gates. No globe or
routing replacement was attempted.

## Evidence retained locally

Ignored directory `artifacts/hosted-acceptance-20261019/` contains:

- `receipts.json`: browser results, source response sample, URLs, headers, sampled
hashes, globe attributes, ledger navigation, failure diagnostics and recovery.
- `usgs-export.json`: exact 12,676-byte downloaded artifact; not a case approval.
- `desktop-globe-selected.png`, `mobile-2d-selected.png`,
`mobile-feed-unavailable.png`, `mobile-map-after-retry.png`,
`forced-webgl-fallback.png`, `netlify-globe-404.png`.
- `manifest.json`: SHA-256 for those local files. These artifacts are not staged
or intended for static hosting.

Docs-only follow-up: `git diff --check` and local receipt/export/manifest checks.
No product test suite rerun; no runtime files changed. Acceptance is bounded
browser evidence, not independent H3 or owner sign-off.
Loading
Loading