Skip to content

feat: Signal Scope — live browser monitor for incoming sensor signals - #1

Open
v1b3x0r wants to merge 9 commits into
mainfrom
feat/signal-scope
Open

feat: Signal Scope — live browser monitor for incoming sensor signals#1
v1b3x0r wants to merge 9 commits into
mainfrom
feat/signal-scope

Conversation

@v1b3x0r

@v1b3x0r v1b3x0r commented Jun 4, 2026

Copy link
Copy Markdown
Owner

What

Opt-in browser signal scope (--scope) that turns incoming sensor JSON into live waves — a debug instrument to confirm all signals are arriving before trusting interpretation. Production stays --headless and untouched.

Highlights

  • Auto-discover channels — every numeric field in a packet becomes its own wave; new fields appear as new lanes automatically.
  • Multi-value readings: {} bundle (BME280/688-style multi-sensor) alongside legacy semanticValue (backward compatible).
  • Multi-column layout — one auto-created column per probe, each with its own waves + collapsible raw JSON. Relationships read by eye on a shared, auto-fit time axis (no correlation math).
  • Real-data feeder tools/feed-meteo.mjs (Open-Meteo, no API key) + simulated tools/feed.mjs creek-level stand-in → testable with no hardware.
  • Vanilla <canvas> + SSE, zero new runtime deps (Tailwind via CDN for layout).

Architecture

  • src/scope/SignalBuffer.js — pure in-memory ring buffer, auto-channel by numeric key
  • src/scope/ScopeServer.jsGET / + SSE GET /stream on the existing express app (backlog-first)
  • src/scope/public/scope.html — per-probe columns, auto-fit waves, raw JSON, liveness
  • src/index.js--scope flag + tiny record() hook at end of /report

Tests

  • test/scope.test.mjs — SignalBuffer (eviction, multi-value, auto-channel, isolation) + ScopeServer SSE backlog/live
  • Existing 10 tests stay green (legacy path unchanged)

Notes / follow-ups

  • Packets with readings only (no semanticValue) make the legacy globalBaseline EMA return NaN/null — doesn't affect scope or interpretation; patch if readings becomes primary.
  • Tailwind Play CDN can't use SRI (JIT runtime); local debug tool only.

Design spec + plan under docs/superpowers/.

🤖 Generated with Claude Code

v1b3x0r and others added 8 commits June 5, 2026 01:23
…eo feeder

- scope.html: group channels into one auto-created column per probe, each with
  its own waves + collapsible raw JSON; auto-fit time axis (works for slow polls
  and fast feeds); single-point dot; set probe title via textContent (XSS-safe)
- tools/feed-meteo.mjs: real-data feeder pulling all numeric current-weather
  fields from Open-Meteo (no API key), location/probe/interval via env

🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0810eab66e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/feed.mjs
Comment on lines +19 to +23
const body = {
probeId: PROBE,
timestamp: Date.now(),
readings: { level: +level.toFixed(2), temp: +temp.toFixed(2) },
drift: +drift.toFixed(2)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include a semantic value in simulated reports

When the documented node tools/feed.mjs simulator posts this payload, it omits semanticValue, but /report still updates globalBaseline with ALPHA * semanticValue and broadcasts ground.*.val before the scope-only recording runs. The first simulated sample therefore turns the response baseline into NaN/null and sends undefined semantic context; either include a representative semanticValue here (and in the meteo feeder's same payload shape) or default it in the handler.

Useful? React with 👍 / 👎.

…ivates

Untracked for seven weeks. States plainly that DreamLink is Layer 3 (Mind)
of the MDS stack and is NOT yet integrated into HomeLog, so a session that
lands here does not mistake it for active sprint surface.

Also picks up the package-lock drift from the signal-scope work.

🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant