@biffo/cli 0.263.0 → 0.264.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/practices-corpus.mjs +20 -2
package/package.json
CHANGED
|
@@ -161,10 +161,28 @@ export function slugify(text) {
|
|
|
161
161
|
*/
|
|
162
162
|
export function writeEvidenceEntry(row, opts = {}) {
|
|
163
163
|
const dir = opts.dir ?? EVIDENCE_DIR
|
|
164
|
-
|
|
164
|
+
// `undefined` means "nobody said"; `null` means "known to be unknown". Both
|
|
165
|
+
// must reach the stored field as null rather than today's date.
|
|
166
|
+
//
|
|
167
|
+
// This used to read `opts.date ?? row.date ?? new Date()…` and write that
|
|
168
|
+
// single value to BOTH the filename and the row. The module docstring says
|
|
169
|
+
// the opposite in as many words — "Rows citing nothing keep `date: null` —
|
|
170
|
+
// never a guess, because a fabricated date would corrupt exactly the ranking
|
|
171
|
+
// this exists to enable" — and `--extract` even passes `date: row.date ??
|
|
172
|
+
// null` to say so explicitly. `null ?? today` discarded that.
|
|
173
|
+
//
|
|
174
|
+
// It was invisible while rows were extracted the day they were written, and
|
|
175
|
+
// surfaced on 2026-08-09 when extracting five rows also swept up eighteen
|
|
176
|
+
// older ones and stamped every one with that day. `--enrich` recovers real
|
|
177
|
+
// dates from the cited issues afterwards, and it can only do that for rows
|
|
178
|
+
// whose date is *absent*; a fabricated one looks recovered and is skipped.
|
|
179
|
+
const date = opts.date ?? row.date ?? null
|
|
165
180
|
const slug = opts.slug ?? slugify(row.summary) ?? 'entry'
|
|
166
181
|
mkdirSync(dir, { recursive: true })
|
|
167
|
-
|
|
182
|
+
// The filename is used only for sorting and uniqueness — every reader parses
|
|
183
|
+
// the JSON body — so an undated row says so here too, rather than carrying a
|
|
184
|
+
// date prefix that the data it contains denies.
|
|
185
|
+
const file = `${date ?? 'undated'}-${slug || 'entry'}.json`
|
|
168
186
|
const path = join(dir, file)
|
|
169
187
|
try {
|
|
170
188
|
writeFileSync(path, `${JSON.stringify({ ...row, date }, null, 2)}\n`, { flag: 'wx' })
|