# Bot Observatory integration handoff

This archive contains the available working-copy web application source. It is not certified as byte-identical to the currently published version. No hosted records, credentials, model weights, or training database are included.

## Files and build
- ui.html: dashboard and individual bot screens.
- seed.json: recorded bot profiles and requirements; these are not completed-training results.
- server-core.mjs: HTTP routing and event validation/storage logic.
- assemble.mjs: combines the core, seed and HTML into worker/index.js.
- worker/index.js: assembled Worker ESM entry point.
- checks.mjs and upgrade-checks.mjs: existing source checks.
- .openai/hosting.json and scripts/: existing hosting/build configuration.

Run from the extracted webapp directory with Node.js:
    node assemble.mjs
    node checks.mjs
    node upgrade-checks.mjs
    npm run build
    npm run validate

## Local Mac integration boundary
The current application targets a Worker-compatible runtime and uses an R2-compatible BUCKET binding. It is not a standalone Mac server. The Sites manifest identifies the existing hosted project; it does not configure a Mac deployment.

For local-only hosting, adapt the fetch handler to your authenticated local HTTP server and supply a private local storage adapter, or replace the BUCKET operations with your reviewed local persistence implementation. Preserve authorization, event immutability, duplicate protection and client isolation. Do not deploy to cloud storage as part of local migration.

GET /api/snapshot reads profiles and saved event records. POST /api/events validates and imports activity records. Review the exact validation schema in server-core.mjs; imports do not run training. Provide the existing platform identity/access protections when porting the handler. Browser origin checks alone are not authentication.

The snapshot explicitly reports trainerConnected:false. An actual training runner and authenticated telemetry path are still required to display genuine live training. Do not change that flag merely to make the dashboard appear connected.

Training-reference workbook: Foresixa_Bot_Training_Reference_Review.xlsx, supplied separately. No separate financial cashbook was identified. No live financial or hosted activity records were exported.

## Checks performed on this source
JavaScript syntax, existing schema/storage checks and existing bot-page/navigation/coverage-display checks passed. These use test fixtures; they do not establish actual bot learning. Browser rendering, local Mac operation, real training integration and production storage behavior were not verified here.
