[object Object]

← back to build-pages

home: velocity counter (commits in last 24h + last 7d) — 200-tick milestone

1af9c2a0eab47f31c8439b8a2098fd0d480b858a · 2026-05-13 17:07:53 -0700 · SteveStudio2

Files touched

Diff

commit 1af9c2a0eab47f31c8439b8a2098fd0d480b858a
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 17:07:53 2026 -0700

    home: velocity counter (commits in last 24h + last 7d) — 200-tick milestone
---
 server.js     | 14 ++++++++++++++
 test/smoke.js |  1 +
 2 files changed, 15 insertions(+)

diff --git a/server.js b/server.js
index a224341..9c6ef68 100644
--- a/server.js
+++ b/server.js
@@ -306,6 +306,19 @@ app.get('/', async (req, res, next) => {
     }));
     const totalCommits = entries.reduce((a, e) => a + e.count, 0);
     const totalIdeas   = entries.reduce((a, e) => a + e.ideas, 0);
+    // Velocity counters — commits in the last 1 day and last 7 days across
+    // the fleet. Uses _projectCache directly so no extra git work.
+    const now = Date.now();
+    const dayMs = 24 * 60 * 60 * 1000;
+    let last24 = 0, last7d = 0;
+    for (const e of entries) {
+      const b = _projectCache.get(e.slug); if (!b) continue;
+      for (const c of b.commits) {
+        const age = now - new Date(c.dateISO).getTime();
+        if (age < dayMs)     last24++;
+        if (age < 7 * dayMs) last7d++;
+      }
+    }
     const rows = entries.map(({ slug, p, count, latest, ideas }) => `<li class="bp-card">
         <a href="/p/${esc(slug)}"><h2>${esc(p.name)}</h2></a>
         <p>${esc(p.blurb)}</p>
@@ -350,6 +363,7 @@ app.get('/', async (req, res, next) => {
       <h1>build journals</h1>
       <p class="bp-lede">Every build, every commit, every line. Click into a project to see how it actually got made.</p>
       <p class="bp-meta">${entries.length} projects · ${totalCommits} commits · ${totalIdeas} design-rationale ideas surfaced</p>
+      <p class="bp-meta">velocity: <strong>${last24}</strong> commits in the last 24h · <strong>${last7d}</strong> in the last 7 days</p>
 
       <section class="bp-section">
         <h2>Recent across the fleet</h2>
diff --git a/test/smoke.js b/test/smoke.js
index 7069136..e7b40c7 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -94,6 +94,7 @@ function check(name, cond, hint = '') {
   check('home: recent rail',       /Recent across the fleet/.test(r.body));
   check('home: theme-color',       /name="theme-color"/.test(r.body));
   check('home: top skills rail',   /Top skills \+ agents/.test(r.body));
+  check('home: velocity line',     /velocity: <strong>\d+<\/strong>/.test(r.body));
   check('home: canonical',         /rel="canonical"/.test(r.body));
   check('home: og:title',          /property="og:title"/.test(r.body));
   check('home: WebSite JSON-LD',   /"@type":"WebSite"/.test(r.body));

← 83d2712 home: top skills + agents rail (fleet-wide tallies surfaced  ·  back to build-pages  ·  api: /api/fleet/velocity — rolling-window commit counts (las ba6940a →