Skip to content

fix: use real daily data for growth chart instead of synthetic exponential (PILOT-8)#7

Merged
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-8-20260529-025600
May 29, 2026
Merged

fix: use real daily data for growth chart instead of synthetic exponential (PILOT-8)#7
TeoSlayer merged 1 commit into
mainfrom
openclaw/pilot-8-20260529-025600

Conversation

@matthew-pilot
Copy link
Copy Markdown
Collaborator

What

Replaces the synthetic exponential growth chart on the homepage with real data points from the API's daily[] array.

Before

The chart generated 10 synthetic ticks on a purely mathematical exponential curve (EXP_K=4.2). The comment at index.astro:13 said it plainly: // Chart - synthetic exponential curve, W1=0 → NOW=liveAgents. Always 10 ticks. The real s.daily data from the API was fetched but only used for the growth percentage — never for the chart line itself.

After

  • Uses real s.daily[i].online_nodes entries as chart data points
  • Labels use actual dates (M/D) instead of synthetic W1..Wn labels
  • Falls back to synthetic exponential only when the API returns <2 daily entries
  • Polyline through real data instead of 200-point sampled exponential

Ticket

PILOT-8 — Website page integrity sweep (Philip flagged growth graph as "overfitted for exponential growth, raises red flags")

Scope

src/pages/index.astro | 116 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 74 insertions(+), 42 deletions(-)

…ntial curve (PILOT-8)

The agent growth chart on the homepage was rendering a purely synthetic
exponential curve (EXP_K=4.2) rather than actual data points from the
API's daily[] array. This made the chart appear overfitted and
misleading - Philip flagged this in PILOT-8.

Changes:
- Build-time chart: use s.daily entries (online_nodes) as data points
- Runtime refresh: same real-data approach in the JavaScript refresh
- Fallback to synthetic exponential only when API returns <2 daily entries
- Chart labels use actual dates (M/D) instead of synthetic W1..Wn labels
- Polyline through real data instead of 200-point sampled exponential curve
@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

Status: PR is OPEN, MERGEABLE. CI 2/2 passing (build ✅, snyk ✅). Canary: not configured for this repo (website has no canary workflow). Linked ticket PILOT-8 (Website page integrity sweep) is in QA/IN-REVIEW — Phase 1 inventory complete (Artemii), Phase 2 implementation pending. Last operator activity: Teodor Calin at 2026-05-29 03:06 UTC (triage comment on PILOT-8). No blocking reviews or merge conflicts.

@matthew-pilot
Copy link
Copy Markdown
Collaborator Author

Diff walkthrough — src/pages/index.astro (+74/−42)

Build-time chart (lines 68–132)

Removed (old): Synthetic exponential curve — EXP_K=4.2, 10 ticks for (let i = 0; i < TICKS; i++). Used finalVal * (Math.exp(EXP_K * t) - 1) / (Math.exp(EXP_K) - 1), producing misleading growth curve from arbitrary math.

Added (new, lines 71–92): Real s.daily[] data loop. Iterates actual API entries, reads online_nodes (preferred) or total_nodes (fallback), skips invalid/zero values. Labels use real dates via new Date(ts * 1000)M/D format instead of synthetic W1Wn. Last entry labeled NOW. Fallback to old synthetic curve only when s.daily.length < 2 (line 98).

Line 124–129 (polyline): Old code sampled the exponential function at 200 points for a smooth curve. New code draws straight segments directly through real data points (coords array), one segment per data point.

Page text fix (line 505)

Minor: Ellipsis character replaced with ... — likely a linter or consistency fix.

Runtime refresh (lines 961–1080)

Same pattern in the JavaScript rebuildChart() function:

  • Removed: EXP_K=4.2 synthetic curve, 200-sample polyline
  • Added (lines 1008–1026): Uses dailyEntries array (passed from s.daily at line 1110) to build real data points. Same date labels, same NOW for last entry.
  • Added (lines 1028–1041): Fallback synthetic curve retained for API failure
  • Line 1110 (call site): Changed from rebuildChart(activeN)rebuildChart(activeN, s.daily) — passing real daily data into the function

Net effect: The growth chart now shows actual node-count trajectory from the API, not a pre-fitted exponential. Philip flagged the old chart as "overfitted for exponential growth, raises red flags" — this fix makes it data-driven with a safety fallback.

@TeoSlayer
Copy link
Copy Markdown
Contributor

TeoSlayer commented May 29, 2026

🌐 Preview: https://openclaw-pilot-8-20260529-02.pilotprotocol.pages.dev/

HTTP 200 · branch openclaw/pilot-8-20260529-025600 · Cloudflare auto-deploy via ci.yml.


⚠️ Change of direction — please remove the growth chart entirely instead of fixing the data source.

The synthetic-vs-real-data debate misses the point: a homepage growth curve raises "is this overfitted?" questions either way (Philip's original flag), and even the real-data version still implies a forward projection viewers will read as marketing. Cleaner to drop it.

Scope (single file, deletions only — small tier):

  • src/pages/index.astro — delete the chart <section>/<svg> block + the scoped .chart-* <style> rules
  • Delete the build-time generator (~lines 68–132, the EXP_K/finalVal block)
  • Delete the runtime rebuildChart() (~lines 1007–1080) and the caller rebuildChart(activeN, s.daily) at line 1110
  • Keep the surrounding hero copy / metrics

Filed as PILOT-227 so triage picks it up cleanly — close this PR when the replacement PR opens.

@TeoSlayer TeoSlayer merged commit 310489b into main May 29, 2026
2 checks passed
@TeoSlayer
Copy link
Copy Markdown
Contributor

@matthew-pilot fix — remove the growth chart entirely from src/pages/index.astro, but keep the surrounding text and numbers (node count, agent count, etc.). The chart is the SVG block + the EXP_K generator + the rebuildChart runtime function. Push as an additional commit on this branch.

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.

2 participants