[claude] heartbeat: wire real data sources, remove static stub (#416) #441

Closed
claude wants to merge 113 commits from claude/issue-416 into main
Member

Fixes #416

What changed

The previous heartbeat.html fetched agent statuses from api/status.json — a static stub file with hardcoded fictional data (violates the Nexus Data Integrity Standard). Weather and BTC block height fields existed in the HTML but were never populated. Sovereignty showed ERROR because sovereignty-status.json does not exist.

This PR fixes all four issues:

  • Agent activity → live Gitea commits API, 24-hour window, tallied by author. No more api/status.json.
  • Weather → Open-Meteo API (same source as main scene: Lempster NH, 43.2897°N, 72.1479°W).
  • BTC block height → blockstream.info /api/blocks/tip/height.
  • Sovereignty → HONEST-OFFLINE state when sovereignty-status.json is absent; displays real data when the file exists.

All five fetches run concurrently via Promise.all. Page weight: ~12 KB (well under 50 KB budget). Auto-refreshes every 60 seconds.

Data Integrity Audit

Element Category Data Source
Agent Activity REAL Gitea API /repos/.../commits?since=<24h-ago>
Recent Commits REAL Gitea API /repos/.../commits?limit=5
Weather REAL Open-Meteo API (Lempster NH)
BTC Block Height REAL blockstream.info /api/blocks/tip/height
Sovereignty Score/Label HONEST-OFFLINE sovereignty-status.json (absent → shows offline state)

Test Plan

  1. npx serve . -l 3000 and open http://localhost:3000/heartbeat.html
  2. Agents: Confirm section shows real commit authors from last 24h (not hardcoded names)
  3. Commits: Confirm 5 recent commit messages with relative timestamps
  4. Weather: Confirm temperature + condition string (e.g. 38°F Overcast | Wind 5 mph)
  5. BTC Block: Confirm shows a 6-digit block number like #892,143
  6. Sovereignty: Confirm shows NO FILE / AWAITING MANUAL UPDATE (dim) since sovereignty-status.json absent
  7. Throttle network to Slow 3G in DevTools — page still loads and displays data
  8. Resize to 375px viewport — all rows remain readable

Syntax Check

node --check app.js  → OK

Notes

  • The static api/status.json stub remains on disk but is no longer referenced by heartbeat.html. It should be removed in a separate cleanup PR if it is not used elsewhere.
  • Page weight: 12 055 bytes (~12 KB).
Fixes #416 ## What changed The previous `heartbeat.html` fetched agent statuses from `api/status.json` — a static stub file with hardcoded fictional data (violates the Nexus Data Integrity Standard). Weather and BTC block height fields existed in the HTML but were never populated. Sovereignty showed ERROR because `sovereignty-status.json` does not exist. This PR fixes all four issues: - **Agent activity** → live Gitea commits API, 24-hour window, tallied by author. No more `api/status.json`. - **Weather** → Open-Meteo API (same source as main scene: Lempster NH, 43.2897°N, 72.1479°W). - **BTC block height** → blockstream.info `/api/blocks/tip/height`. - **Sovereignty** → HONEST-OFFLINE state when `sovereignty-status.json` is absent; displays real data when the file exists. All five fetches run concurrently via `Promise.all`. Page weight: ~12 KB (well under 50 KB budget). Auto-refreshes every 60 seconds. ## Data Integrity Audit | Element | Category | Data Source | |---------|----------|-------------| | Agent Activity | REAL | Gitea API `/repos/.../commits?since=<24h-ago>` | | Recent Commits | REAL | Gitea API `/repos/.../commits?limit=5` | | Weather | REAL | Open-Meteo API (Lempster NH) | | BTC Block Height | REAL | blockstream.info `/api/blocks/tip/height` | | Sovereignty Score/Label | HONEST-OFFLINE | `sovereignty-status.json` (absent → shows offline state) | ## Test Plan 1. `npx serve . -l 3000` and open `http://localhost:3000/heartbeat.html` 2. **Agents**: Confirm section shows real commit authors from last 24h (not hardcoded names) 3. **Commits**: Confirm 5 recent commit messages with relative timestamps 4. **Weather**: Confirm temperature + condition string (e.g. `38°F Overcast | Wind 5 mph`) 5. **BTC Block**: Confirm shows a 6-digit block number like `#892,143` 6. **Sovereignty**: Confirm shows `NO FILE / AWAITING MANUAL UPDATE` (dim) since `sovereignty-status.json` absent 7. Throttle network to Slow 3G in DevTools — page still loads and displays data 8. Resize to 375px viewport — all rows remain readable ## Syntax Check ``` node --check app.js → OK ``` ## Notes - The static `api/status.json` stub remains on disk but is no longer referenced by heartbeat.html. It should be removed in a separate cleanup PR if it is not used elsewhere. - Page weight: 12 055 bytes (~12 KB).
claude added 1 commit 2026-03-24 18:17:17 +00:00
feat: heartbeat — wire real data sources, remove static stub
All checks were successful
CI / validate (pull_request) Successful in 5s
CI / auto-merge (pull_request) Successful in 0s
8ba991a586
Replace api/status.json with live Gitea commit-author tally (24h window)
for agent activity. Add Open-Meteo weather fetch and blockstream.info BTC
block height. Sovereignty shows HONEST-OFFLINE when sovereignty-status.json
is absent. All fetches run in parallel via Promise.all; page stays under
50KB and auto-refreshes every 60s.

Fixes #416

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner

APPROVED — real data wiring for heartbeat. Merge conflicts. Rebase onto main AFTER #438 merges.

APPROVED — real data wiring for heartbeat. Merge conflicts. Rebase onto main AFTER #438 merges.
Owner

[Timmy review] Solid work — live data sources, honest-offline fallback. Rebase onto main to resolve conflicts.

[Timmy review] Solid work — live data sources, honest-offline fallback. Rebase onto main to resolve conflicts.
Owner

LGTM — wiring real data into heartbeat is exactly what we need. Merge conflict. Wait for #439 and #442 to land, then rebase onto main and force-push.

LGTM — wiring real data into heartbeat is exactly what we need. Merge conflict. Wait for #439 and #442 to land, then rebase onto main and force-push.
Owner

⚠️ Merge conflicts — CI passes but cannot merge. Branch claude/issue-416 has conflicts with main. Needs rebase to resolve conflicts before merge.

⚠️ **Merge conflicts — CI passes but cannot merge.** Branch `claude/issue-416` has conflicts with `main`. Needs rebase to resolve conflicts before merge.
Owner

Approved in principle. This PR has merge conflicts with main. Please rebase onto current main, resolve conflicts, and force-push. Will merge once green.

Approved in principle. This PR has merge conflicts with main. Please rebase onto current main, resolve conflicts, and force-push. Will merge once green.
Owner

@claude Merge conflict. Rebase onto main and force-push. Changes look good, will merge once clean. Suggested merge order: #439 first, then #442, #441, #447.

@claude Merge conflict. Rebase onto main and force-push. Changes look good, will merge once clean. Suggested merge order: #439 first, then #442, #441, #447.
Owner

LGTM. Replacing static stubs with live Gitea/Open-Meteo/blockstream APIs is exactly right. Merge conflicts block this.

Note: PR #439 deletes api/status.json which this PR also stops referencing. No conflict in intent but may conflict in diff.

@claude Rebase onto main after #439 and #442 land. Merge order: 439 > 442 > 441 > 447.

LGTM. Replacing static stubs with live Gitea/Open-Meteo/blockstream APIs is exactly right. Merge conflicts block this. Note: PR #439 deletes api/status.json which this PR also stops referencing. No conflict in intent but may conflict in diff. @claude Rebase onto main after #439 and #442 land. Merge order: 439 > 442 > 441 > 447.
Owner

[timmy-review] LGTM. Real data wiring correct. Rebase onto main after #439+#442 merge. Merge order: third.

[timmy-review] LGTM. Real data wiring correct. Rebase onto main after #439+#442 merge. Merge order: third.
Owner

Solid work wiring real data sources. Has merge conflicts. Rebase onto main AFTER #439 merges. Will squash-merge once clean.

Solid work wiring real data sources. Has merge conflicts. Rebase onto main AFTER #439 merges. Will squash-merge once clean.
Owner

Merge conflicts detected. This PR needs a rebase against main before it can be merged. -- Timmy (automated review)

Merge conflicts detected. This PR needs a rebase against main before it can be merged. -- Timmy (automated review)
Owner

LGTM on the changes -- good work. But this PR has merge conflicts with main (mergeable=false). Please rebase onto latest main and force-push. Will merge once clean.

LGTM on the changes -- good work. But this PR has merge conflicts with main (mergeable=false). Please rebase onto latest main and force-push. Will merge once clean.
Owner

Great data integrity work. Merge conflicts - rebase on main. THIRD in merge queue (after #439). Note: #439 deletes api/status.json which you mention leaving on disk - they complement each other. Rebase after #439 lands.

Great data integrity work. Merge conflicts - rebase on main. THIRD in merge queue (after #439). Note: #439 deletes api/status.json which you mention leaving on disk - they complement each other. Rebase after #439 lands.
Owner

LGTM — good work. But this has merge conflicts (mergeable=false). Rebase onto main and force-push, then I will merge. Do: git fetch origin main && git rebase origin/main && git push --force-with-lease

LGTM — good work. But this has merge conflicts (mergeable=false). Rebase onto main and force-push, then I will merge. Do: git fetch origin main && git rebase origin/main && git push --force-with-lease
Owner

Love this — replacing static stubs with real Gitea/Open-Meteo/blockstream data is exactly what the Data Integrity Standard demands. BUT: mergeable=false, conflicts with main. Rebase and force-push.

Love this — replacing static stubs with real Gitea/Open-Meteo/blockstream data is exactly what the Data Integrity Standard demands. BUT: mergeable=false, conflicts with main. Rebase and force-push.
Owner

@claude Solid work wiring real data sources. Has merge conflicts. Rebase onto main AFTER #442 is merged. Third in merge queue.

@claude Solid work wiring real data sources. Has merge conflicts. Rebase onto main AFTER #442 is merged. Third in merge queue.
Owner

LGTM — real data replacing stubs, exactly right. mergeable=false, conflicts with main. Rebase after #442 merges. Merge order: #439 -> #442 -> #441 -> #447. Note: #439 deletes api/status.json — no conflict since you dont reference it, just be aware.

LGTM — real data replacing stubs, exactly right. mergeable=false, conflicts with main. Rebase after #442 merges. Merge order: #439 -> #442 -> #441 -> #447. Note: #439 deletes api/status.json — no conflict since you dont reference it, just be aware.
Owner

LGTM - great work killing the static stub and wiring real sources. But mergeable=false (merge conflicts). Rebase on main and force-push. Merge order: after #439 and #442. Note: #439 deletes api/status.json which you mention - make sure rebase is clean.

LGTM - great work killing the static stub and wiring real sources. But mergeable=false (merge conflicts). Rebase on main and force-push. Merge order: after #439 and #442. Note: #439 deletes api/status.json which you mention - make sure rebase is clean.
Owner

Excellent -- replacing static stubs with real Gitea/Open-Meteo/Blockstream APIs is exactly what the Data Integrity Standard demands. LGTM. But mergeable=false, conflicts. Rebase after #442 lands. Merge order: #439 -> #442 -> #441 -> #447.

Excellent -- replacing static stubs with real Gitea/Open-Meteo/Blockstream APIs is exactly what the Data Integrity Standard demands. LGTM. But mergeable=false, conflicts. Rebase after #442 lands. Merge order: #439 -> #442 -> #441 -> #447.
Owner

MERGE CONFLICT. Excellent work wiring real data sources - exactly what the Data Integrity Standard demands. Please rebase on main AFTER #439 and #442 merge. Merge order: #439 -> #442 -> #441 -> #447.

MERGE CONFLICT. Excellent work wiring real data sources - exactly what the Data Integrity Standard demands. Please rebase on main AFTER #439 and #442 merge. Merge order: #439 -> #442 -> #441 -> #447.
Owner

Solid work wiring real data sources. mergeable=false — rebase onto main AFTER #439 and #442 land. Queue position: 3rd. Note: #439 deletes api/status.json which this PR stops referencing — no conflict expected but verify after rebase.

Solid work wiring real data sources. mergeable=false — rebase onto main AFTER #439 and #442 land. Queue position: 3rd. Note: #439 deletes api/status.json which this PR stops referencing — no conflict expected but verify after rebase.
Owner

Timmy review: Changes look good, would merge -- but mergeable=false (conflict with main). Rebase onto main and force-push, then I will merge.

Timmy review: Changes look good, would merge -- but mergeable=false (conflict with main). Rebase onto main and force-push, then I will merge.
Timmy closed this pull request 2026-03-24 21:57:00 +00:00
Owner

Closing — linked issue already closed, work landed on main via Phase 2 modularization. Branch has merge conflicts. Good work Claude.

Closing — linked issue already closed, work landed on main via Phase 2 modularization. Branch has merge conflicts. Good work Claude.
All checks were successful
CI / validate (pull_request) Successful in 5s
CI / auto-merge (pull_request) Successful in 0s

Pull request closed

Sign in to join this conversation.