From 11ae8cb713ee9eb5b1202da52c2f64cd7938164b Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Mon, 15 Jun 2026 18:15:59 +0000 Subject: [PATCH] refactor(lbug): make the unknown-label node drop explicit (#2215 review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the U3 `let pending` switch idiom, a node whose label matches neither codeWriterMap nor multiLangWriters left `pending` undefined and was silently dropped — a footgun for a future node type. Add an explicit else with a comment documenting that unknown labels are intentionally not persisted and that a new type must be wired into a writer map. No behavior change (byte-identity + tests unchanged). Co-Authored-By: Claude Opus 4.8 (1M context) --- gitnexus/src/core/lbug/csv-generator.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gitnexus/src/core/lbug/csv-generator.ts b/gitnexus/src/core/lbug/csv-generator.ts index ac160ec36..955a2d47c 100644 --- a/gitnexus/src/core/lbug/csv-generator.ts +++ b/gitnexus/src/core/lbug/csv-generator.ts @@ -572,6 +572,12 @@ export const streamAllCSVsToDisk = async ( : []), ].join(','), ); + } else { + // Unknown label: not in codeWriterMap or multiLangWriters, so there + // is no CSV table for it and it is intentionally NOT persisted — + // `pending` stays undefined, so the loop awaits nothing. Made + // explicit so a future node type isn't silently dropped here: wire + // it into one of the writer maps above (or this branch). } } break;