From 5ecc6df3dc3d8803a711685ddd5e0a2c25acff16 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 18 Jun 2026 07:03:23 -0700 Subject: [PATCH] =?UTF-8?q?dataforth(datasheet):=20Fix=202=20=E2=80=94=20p?= =?UTF-8?q?ublish=20the=2068=20STAGE-3-clean=20DSCA=20models=20to=20Hoffma?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restarted testdatadb service (new template live), canary-pushed 1 cert (updated, 0 errors), then re-pushed all PASS certs for the 68 Final-Test-content-clean models via uploadBySerialNumbers from a fresh node process. Result over 30,423 PASS certs: updated=26022 unchanged=2738 created=0 errors=0 skipped=1663. The 26,022 updates replace the old defective DSCA renders on the live site with the rebuilt, byte-content-validated ones. The 1,663 skips are the count-guard correctly refusing any individual cert whose value count != its template row count (ambiguous) — never publishing misaligned data. Artifacts: push-clean68.js (driver), dsca-clean68-models.json (the published set). NOT yet published: the 26 last-digit-diff models, the ~32 ambiguous/null layout families, and the 231 untemplated models. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../dataforth-dos/dsca-clean68-models.json | 1 + projects/dataforth-dos/tools/push-clean68.js | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 projects/dataforth-dos/dsca-clean68-models.json create mode 100644 projects/dataforth-dos/tools/push-clean68.js diff --git a/projects/dataforth-dos/dsca-clean68-models.json b/projects/dataforth-dos/dsca-clean68-models.json new file mode 100644 index 00000000..2a464d9c --- /dev/null +++ b/projects/dataforth-dos/dsca-clean68-models.json @@ -0,0 +1 @@ +["DSCA30-01","DSCA30-03","DSCA30-06","DSCA30-07","DSCA30-08","DSCA30-08C","DSCA30-09","DSCA30-09C","DSCA30-1944","DSCA30-1945","DSCA30-1946","DSCA31-02","DSCA31-03","DSCA31-06","DSCA31-07","DSCA31-11","DSCA31-12","DSCA31-1273","DSCA31-13","DSCA31-13C","DSCA31-15","DSCA32-01","DSCA32-01C","DSCA32-01E","DSCA34-01","DSCA34-02C","DSCA34-04","DSCA34-04C","DSCA34-05","DSCA34-1858","DSCA36-01","DSCA36-02","DSCA36-03","DSCA36-04","DSCA36-04C","DSCA36-1949","DSCA38-03","DSCA38-09E","DSCA38-1544","DSCA38-15C","DSCA38-16","DSCA38-18C","DSCA40-03","DSCA40-05","DSCA40-05C","DSCA40-06","DSCA40-1951","DSCA40-1952","DSCA41-01","DSCA41-02","DSCA41-03","DSCA41-05C","DSCA41-06","DSCA41-09","DSCA41-13","DSCA41-14","DSCA41-15","DSCA41-15E","DSCA42-01","DSCA42-01C","DSCA42-02","DSCA47E-08C","DSCA47J-01C","DSCA47J-03","DSCA47K-05","DSCA47K-13","DSCA47K-14","DSCA47T-1928"] \ No newline at end of file diff --git a/projects/dataforth-dos/tools/push-clean68.js b/projects/dataforth-dos/tools/push-clean68.js new file mode 100644 index 00000000..da46e497 --- /dev/null +++ b/projects/dataforth-dos/tools/push-clean68.js @@ -0,0 +1,27 @@ +// Fix 2 publish — re-push the 68 STAGE-3 Final-Test-clean DSCA models to Hoffman. +// Idempotent (Updated/Unchanged/Created); renderContent uses the new template; +// null renders (count-guard) + FAIL certs + unregistered models auto-skip. +const db = require('./database/db'); +const { uploadBySerialNumbers } = require('./database/upload-to-api'); +const clean = require('./_clean-models.json'); + +(async () => { + const ph = clean.map((_, i) => '$' + (i + 1)).join(','); + const rows = await db.query( + `SELECT serial_number FROM test_records WHERE overall_result='PASS' AND model_number IN (${ph}) ORDER BY serial_number`, + clean, + ); + const sns = rows.map(r => r.serial_number); + console.log(`[PUSH] ${sns.length} PASS serials across ${clean.length} clean models`); + const CHUNK = 1000; + const tot = { created: 0, updated: 0, unchanged: 0, errors: 0, skipped: 0 }; + for (let i = 0; i < sns.length; i += CHUNK) { + const chunk = sns.slice(i, i + CHUNK); + const r = await uploadBySerialNumbers(chunk); + for (const k of Object.keys(tot)) tot[k] += r[k] || 0; + console.log(`[PUSH] ${Math.min(i + CHUNK, sns.length)}/${sns.length} cumulative ` + + `created=${tot.created} updated=${tot.updated} unchanged=${tot.unchanged} errors=${tot.errors} skipped=${tot.skipped}`); + } + console.log('[PUSH] COMPLETE ' + JSON.stringify(tot)); + await db.close(); +})().catch(e => { console.error('ERR', e.message, e.stack); process.exit(1); });