From 45990a5211c60fb1dbedadee8cfb84791f2edaa7 Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:43:23 +0300 Subject: [PATCH 1/6] site: publish compact verified Upstream result on served VSM Index page --- scripts/sync-vsm-oss-metrics.cjs | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/scripts/sync-vsm-oss-metrics.cjs b/scripts/sync-vsm-oss-metrics.cjs index 71790ca..2b3cacc 100644 --- a/scripts/sync-vsm-oss-metrics.cjs +++ b/scripts/sync-vsm-oss-metrics.cjs @@ -9,6 +9,8 @@ const pagePath = fs.existsSync(templatePath) ? templatePath : path.join(root, 'v const START = ''; const END = ''; const INDEX_METRICS_END = ''; +const PUBLIC_START = ''; +const PUBLIC_END = ''; const stylesheetVersion = 'vsm-index-metrics.css?v=20260922-vsm-oss'; function argValue(name) { @@ -197,8 +199,38 @@ if (updated.includes(START) || updated.includes(END)) { updated = updated.replace(INDEX_METRICS_END, `${INDEX_METRICS_END}\n${section}`); } + +// The full Organization metrics template is source-only and excluded from Pages. +// Keep a small independently source-verified entry on the *served* Index page. +const servedPage = path.join(root, 'vsm-index.html'); +const servedOriginal = requiredFile(servedPage); +const publicSection = `${PUBLIC_START} +
+

04 / UPSTREAM CONTRIBUTIONS

+

What made it upstream?

+

Only source-verified changes merged by external maintainers count here. They are not deployment or measured user benefit.

+ ${outcomeEvidence || '

Verified merged changes: evidence-gated; no count is claimed.

'} +

See all external PR statuses · Source and counting rules

+
+${PUBLIC_END}`; +let servedUpdated; +if (servedOriginal.includes(PUBLIC_START) || servedOriginal.includes(PUBLIC_END)) { + if (servedOriginal.split(PUBLIC_START).length !== 2 + || servedOriginal.split(PUBLIC_END).length !== 2 + || servedOriginal.indexOf(PUBLIC_START) > servedOriginal.indexOf(PUBLIC_END)) { + throw new Error('Missing or duplicate public Upstream markers'); + } + servedUpdated = servedOriginal.replace( + new RegExp(PUBLIC_START + '[\\s\\S]*?' + PUBLIC_END), publicSection); +} else { + if (servedOriginal.split('').length !== 2 + || !servedOriginal.includes('
', publicSection + '\n
'); +} if (checkOnly) { - if (updated !== original) { + if (updated !== original || servedUpdated !== servedOriginal) { console.error(`VSM OSS metrics are stale against ${sourcePath}. Run node scripts/sync-vsm-oss-metrics.cjs --source ${sourcePath}`); process.exitCode = 1; } else { @@ -206,5 +238,6 @@ if (checkOnly) { } } else { if (updated !== original) fs.writeFileSync(pagePath, updated); + if (servedUpdated !== servedOriginal) fs.writeFileSync(servedPage, servedUpdated); console.log(`Synced VSM OSS metrics for ${snapshot.scope.length} repository surfaces.`); } From 33ceacd994856fa71389d8a9feda3ed55482cb41 Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:43:45 +0300 Subject: [PATCH 2/6] site: preserve full metrics in test-only single-page fallback --- scripts/sync-vsm-oss-metrics.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sync-vsm-oss-metrics.cjs b/scripts/sync-vsm-oss-metrics.cjs index 2b3cacc..3cae2fc 100644 --- a/scripts/sync-vsm-oss-metrics.cjs +++ b/scripts/sync-vsm-oss-metrics.cjs @@ -203,7 +203,7 @@ if (updated.includes(START) || updated.includes(END)) { // The full Organization metrics template is source-only and excluded from Pages. // Keep a small independently source-verified entry on the *served* Index page. const servedPage = path.join(root, 'vsm-index.html'); -const servedOriginal = requiredFile(servedPage); +const servedOriginal = pagePath === servedPage ? updated : requiredFile(servedPage); const publicSection = `${PUBLIC_START}

04 / UPSTREAM CONTRIBUTIONS

From c393e58506b1aa801c629d3c545ba6b8b5060a1b Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:43:56 +0300 Subject: [PATCH 3/6] test: assert public page contains verified evidence, not only internal template --- tests/vsm-oss-metrics-sync.test.cjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/vsm-oss-metrics-sync.test.cjs b/tests/vsm-oss-metrics-sync.test.cjs index 43c2454..95f48a1 100644 --- a/tests/vsm-oss-metrics-sync.test.cjs +++ b/tests/vsm-oss-metrics-sync.test.cjs @@ -34,7 +34,7 @@ test('VSM Index renders organization-owned VSM OSS activity without calculating const script = path.join(dir, 'scripts', 'sync-vsm-oss-metrics.cjs'); const source = path.join(dir, 'vsm-oss-metrics.json'); put(script, fs.readFileSync(path.join(root, 'scripts', 'sync-vsm-oss-metrics.cjs'), 'utf8')); - put(path.join(dir, 'vsm-index.html'), '
index
table
'); + put(path.join(dir, 'vsm-index.html'), '
index
table
'); const scope = [ 'opensiro/vsm-harness-profile', @@ -112,6 +112,8 @@ test('VSM Index renders organization-owned VSM OSS activity without calculating assert.match(page, /href="https:\/\/github.com\/chankov\/agent-fleet\/pull\/43"/); assert.match(page, /href="https:\/\/github.com\/SethGammon\/Citadel\/pull\/366"/); assert.match(page, /2 source-verified merged changes/); + assert.match(page, /id="upstream-verified"/); + assert.match(page, /See all external PR statuses/); assert.match(page, /not deployment or measured user benefit/); assert.match(page, /blob\/main\/docs\/METRICS.md/); assert.match(page, /Engineering activity non-KPI<\/span>/); @@ -129,7 +131,7 @@ test('renderer rejects snapshots that promote engineering activity to KPI', () = const script = path.join(dir, 'scripts', 'sync-vsm-oss-metrics.cjs'); const source = path.join(dir, 'snapshot.json'); put(script, fs.readFileSync(path.join(root, 'scripts', 'sync-vsm-oss-metrics.cjs'), 'utf8')); - put(path.join(dir, 'vsm-index.html'), ''); + put(path.join(dir, 'vsm-index.html'), '
'); put(source, JSON.stringify({ scope: ['opensiro/x'], repositories: {}, publication: { window_change_semantics: 'net canonical state change, not gross event count', engineering_activity_is_productivity_kpi: true } })); try { const run = spawnSync(process.execPath, [script, '--source', source], { cwd: dir, encoding: 'utf8' }); From aa11d84981d17bd4930225ccaff85239320e8a20 Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:47:50 +0300 Subject: [PATCH 4/6] site: fit exact PR/native-CI links inside 18KB served-page budget --- scripts/sync-vsm-oss-metrics.cjs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/sync-vsm-oss-metrics.cjs b/scripts/sync-vsm-oss-metrics.cjs index 3cae2fc..e8ca925 100644 --- a/scripts/sync-vsm-oss-metrics.cjs +++ b/scripts/sync-vsm-oss-metrics.cjs @@ -200,19 +200,25 @@ if (updated.includes(START) || updated.includes(END)) { } -// The full Organization metrics template is source-only and excluded from Pages. -// Keep a small independently source-verified entry on the *served* Index page. +// The source-only HTML template is omitted from Pages. Add just a bounded +// source-linked summary to the served page without violating its 18 KB budget. const servedPage = path.join(root, 'vsm-index.html'); const servedOriginal = pagePath === servedPage ? updated : requiredFile(servedPage); -const publicSection = `${PUBLIC_START} -
-

04 / UPSTREAM CONTRIBUTIONS

-

What made it upstream?

-

Only source-verified changes merged by external maintainers count here. They are not deployment or measured user benefit.

- ${outcomeEvidence || '

Verified merged changes: evidence-gated; no count is claimed.

'} -

See all external PR statuses · Source and counting rules

-
-${PUBLIC_END}`; +const outcome = snapshot.repositories['opensiro/upstream'] && + snapshot.repositories['opensiro/upstream'].metrics.verified_external_outcomes; +const compactEvidence = outcomeEvidence ? ( + '

Verified merged changes: ' + + escapeHtml(String(outcome.value)) + ' (not measured benefit). ' + + outcome.accepted.slice(0, 2).map((record) => { + const parts = record.external_pr_url.split('/'); + return '' + + escapeHtml(parts[4] + ' #' + parts[6]) + ' ' + + 'CI'; + }).join(' · ') + + ' · All PRs

' +) : '

Verified merges: evidence-gated. ' + + 'Other PR states

'; +const publicSection = PUBLIC_START + '\n' + compactEvidence + '\n' + PUBLIC_END; let servedUpdated; if (servedOriginal.includes(PUBLIC_START) || servedOriginal.includes(PUBLIC_END)) { if (servedOriginal.split(PUBLIC_START).length !== 2 From 8f8f0920c3d4a981f3115ae7ee4d6e6767ada69f Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:48:00 +0300 Subject: [PATCH 5/6] test: exercise valid served HTML and compact direct PR/CI links --- tests/vsm-oss-metrics-sync.test.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vsm-oss-metrics-sync.test.cjs b/tests/vsm-oss-metrics-sync.test.cjs index 95f48a1..7574714 100644 --- a/tests/vsm-oss-metrics-sync.test.cjs +++ b/tests/vsm-oss-metrics-sync.test.cjs @@ -113,7 +113,7 @@ test('VSM Index renders organization-owned VSM OSS activity without calculating assert.match(page, /href="https:\/\/github.com\/SethGammon\/Citadel\/pull\/366"/); assert.match(page, /2 source-verified merged changes/); assert.match(page, /id="upstream-verified"/); - assert.match(page, /See all external PR statuses/); + assert.match(page, /All PRs/); assert.match(page, /not deployment or measured user benefit/); assert.match(page, /blob\/main\/docs\/METRICS.md/); assert.match(page, /Engineering activity non-KPI<\/span>/); @@ -147,7 +147,7 @@ test('rendered merged-change evidence rejects benefit inflation or mutable recei const script = path.join(dir, 'scripts', 'sync-vsm-oss-metrics.cjs'); const source = path.join(dir, 'snapshot.json'); put(script, fs.readFileSync(path.join(root, 'scripts', 'sync-vsm-oss-metrics.cjs'), 'utf8')); - put(path.join(dir, 'vsm-index.html'), ''); + put(path.join(dir, 'vsm-index.html'), '
'); const row = repo('verified_external_outcomes', 1, { '24h': { status: 'source_unavailable_at_baseline', value: null }, '7d': { status: 'source_unavailable_at_baseline', value: null }, From c6a1158691bc4e5a3daed588f540c6f4cbf7a94e Mon Sep 17 00:00:00 2001 From: alexruidan <41616537+xLagerFeuer@users.noreply.github.com> Date: Thu, 12 Nov 2026 01:50:08 +0300 Subject: [PATCH 6/6] site: keep served summary below strict 18KB performance budget --- scripts/sync-vsm-oss-metrics.cjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/sync-vsm-oss-metrics.cjs b/scripts/sync-vsm-oss-metrics.cjs index e8ca925..3ba178d 100644 --- a/scripts/sync-vsm-oss-metrics.cjs +++ b/scripts/sync-vsm-oss-metrics.cjs @@ -212,8 +212,7 @@ const compactEvidence = outcomeEvidence ? ( + outcome.accepted.slice(0, 2).map((record) => { const parts = record.external_pr_url.split('/'); return '' - + escapeHtml(parts[4] + ' #' + parts[6]) + ' ' - + 'CI'; + + escapeHtml(parts[4] + ' #' + parts[6]) + ''; }).join(' · ') + ' · All PRs

' ) : '

Verified merges: evidence-gated. '