dataforth(datasheet): Fix 2 — data-driven DSCA load note (fixes DSCA39 footer artifact)

Root cause of the DSCA39 footer mismatch: the "Standard output load for test is
250 ohms." line is a footer note, not a parameter, but the STAGE 1 extractor
captured it as a (column-truncated) row "Standard output load for te". And the
renderer's OUTSIGTYPE==='CURRENT' emission was wrong on both ends — it printed the
note (after the underline, invisible to the validator gate) for many -C current
models whose staged originals never had it, and never placed it correctly for the
models that do.

Fix is data-driven, matching the rest of the template approach:
- derive-dsca-templates.js: detect the "Standard output load..." line, capture it
  as a per-model `loadNote` property, and exclude it from rows. Regenerated
  dsca-templates.json — surgically clean: only the 5 DSCA39 models changed (lost
  the truncated row, gained loadNote); all 121 others byte-identical.
- datasheet-exact.js: emit `dscaTpl.loadNote` (blank line + note) before the footer
  underline, only for models that have it; removed the OUTSIGTYPE-based emission.

STAGE 3 re-validation: FINAL-TEST CLEAN 85 -> 88, mismatches 9 -> 6, matches
2206 -> 2278. DSCA39-01/02/07 now fully clean; DSCA39-01 byte-content-verified.
No regression — the -C current models stayed clean and no longer carry the
spurious after-underline note.

The 6 remaining dirty models (DSCA38-05/-1793/-19C/-19E, DSCA39-05, DSCA39-1950)
are ALL retest data-vintage: the staged .TXT is an older test run than the DB
latest-wins record (Supply Current / Linearity differ by more than rounding).
Not render bugs — cannot be reconciled against an older sheet.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-18 07:31:48 -07:00
parent 9bef6fe920
commit 3372455b79
5 changed files with 26 additions and 56 deletions

View File

@@ -15,16 +15,23 @@ function extract(t) {
const cols = colSpans(sep); if (cols.length < 4) return null;
const [pc, mc, sc, stc] = cols;
const rows = [];
let loadNote = null;
for (let i = hi + 2; i < lines.length; i++) {
const l = lines[i];
if (/Check List|^\s*_{5,}/.test(l)) break;
if (!l.trim()) continue;
// The "Standard output load for test is ... ohms." line is a footer note, not
// a parameter row — it spans past the name column so column-slicing truncates
// it ("Standard output load for te"). Capture the full line as loadNote and
// keep it out of rows; the renderer emits it (before the footer underline)
// only for models whose staged original actually printed it.
if (/^Standard output load/i.test(l.trim())) { loadNote = l.trim(); continue; }
const name = (l.slice(pc[0], mc[0]) || '').trim();
const spec = (l.slice(sc[0], stc[0]) || '').trim();
if (!name && !spec) continue;
rows.push({ name, spec });
}
return { accOut, rows };
return { accOut, rows, loadNote };
}
(async () => {
const files = walk(STAGE, []);
@@ -40,7 +47,7 @@ function extract(t) {
}
const models = Object.keys(byModel).sort();
console.log('DSCA models templated: ' + models.length);
const out = {}; for (const m of models) out[m] = { accOut: byModel[m].accOut, rows: byModel[m].rows };
const out = {}; for (const m of models) { out[m] = { accOut: byModel[m].accOut, rows: byModel[m].rows }; if (byModel[m].loadNote) out[m].loadNote = byModel[m].loadNote; }
fs.writeFileSync(OUT, JSON.stringify(out));
console.log('wrote ' + OUT + ' (' + fs.statSync(OUT).size + ' bytes)');
const rc = {}; for (const m of models) { const n = byModel[m].rows.length; rc[n] = (rc[n] || 0) + 1; }