This repository has been archived on 2026-10-29. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Loki/README.md

87 lines
3 KiB
Markdown
Raw Normal View History

2026-06-09 15:04:37 +01:00
# Loki
2026-06-09 16:12:31 +01:00
Loki is a CultMesh-oriented daemon for observing local Chrome tabs through a
drop-in Chrome extension or an explicit Chrome DevTools Protocol endpoint.
2026-06-09 15:04:37 +01:00
2026-06-09 16:12:31 +01:00
It does not see ordinary locked Chrome tabs by magic. The easy path is loading
the unpacked extension in `extension/`; the developer path is launching Chrome
with a remote debugging port. The daemon publishes reachability as state instead
of pretending.
2026-06-09 15:04:37 +01:00
## Authority Map
- Owner: Loki owns Chrome DevTools observation and the derived operator surface.
2026-06-09 16:12:31 +01:00
- Inputs: Chrome extension reports, `http://127.0.0.1:9222/json/version`,
2026-06-09 15:04:37 +01:00
`http://127.0.0.1:9222/json/list`, and daemon configuration.
- Outputs: typed `.cc` witness documents, an Eve provider advertisement, and a
`gamecult.eve.surface.v1` surface projection.
- Derived state: Eve surface health, tab counts, selected tab hints, and
operator text are derived from the Chrome snapshot.
- Forbidden writers: renderers, dashboards, ad hoc scripts, and browser windows
do not own Loki state.
2026-06-09 16:12:31 +01:00
- Shared paths: extension and CDP observations are normalized into one snapshot
before witness, advertisement, and Eve projection.
2026-06-09 15:04:37 +01:00
- Cut line: command execution is not implemented until it has an auditable
command envelope and explicit consent boundary.
2026-06-09 16:12:31 +01:00
## Drop Into Chrome
2026-06-09 15:04:37 +01:00
2026-06-09 16:12:31 +01:00
Run Loki:
2026-06-09 15:04:37 +01:00
```powershell
2026-06-09 16:12:31 +01:00
cd E:\Projects\Loki
npm run start
2026-06-09 15:04:37 +01:00
```
2026-06-09 16:12:31 +01:00
Then install the extension:
1. Open `chrome://extensions`.
2. Enable `Developer mode`.
3. Choose `Load unpacked`.
4. Select `E:\Projects\Loki\extension`.
The extension posts tab metadata to
2026-06-09 17:04:38 +01:00
`http://127.0.0.1:17666/ingest/chrome-extension`. Its normal sync does not read
page DOM, cookies, or page content.
2026-06-13 19:46:10 +01:00
Use `Snapshot active tab` in the popup when Codex needs help reading a page that
only your authenticated Chrome session can see. That action captures only the
current active tab, records visible text, headings, links, and visible form
controls, and writes `state/loki.chrome_page_snapshot.cc`. It does not read
cookies, response bodies, password values, or hidden inputs.
2026-06-09 17:04:38 +01:00
The popup also exposes `Debug sweep`. Chrome will warn that Loki can debug
pages because the extension uses `chrome.debugger`. A sweep attaches to each
debuggable tab, probes Chrome Debugger Protocol domains, records frame/runtime/
performance/security/root-DOM metadata, then detaches. It does not read response
bodies, cookies, form values, or full page DOM.
2026-06-09 16:12:31 +01:00
## CDP Observation
Close Chrome or use a separate profile, then launch:
2026-06-09 15:04:37 +01:00
```powershell
2026-06-09 16:12:31 +01:00
& "$env:ProgramFiles\Google\Chrome\Application\chrome.exe" `
--remote-debugging-port=9222 `
--user-data-dir="$env:TEMP\loki-chrome-profile"
2026-06-09 15:04:37 +01:00
```
For a one-shot smoke:
```powershell
npm run smoke
```
## State Files
Loki writes:
- `state/loki.chrome_snapshot.cc`
2026-06-09 17:04:38 +01:00
- `state/loki.chrome_debug_probe.cc`
2026-06-13 19:46:10 +01:00
- `state/loki.chrome_page_snapshot.cc`
2026-06-09 15:04:37 +01:00
- `state/loki.provider_advertisement.cc`
- `state/loki.eve_surface.cc`
These first `.cc` documents are typed text witnesses. They preserve schema
identity, provider authority, and redaction posture while the daemon awaits a
direct CultCacheTS/CultNetTS backing store integration.