One function

needs_extraction in Ar9av/obsidian-wiki

The author described this change as fix(extract): check missing output before the --since gate. It counts as a record because the check below fails on the code as it stood at 754d91746 and passes on 69ff8cc36, with nothing else changed between the two runs.

Fix saved2026-07-03
Sharing licenceMIT · LICENSE
Change size+5 3

What the code was meant to do, written into the code itself as a docstring

Return True if the source JSONL should be (re)extracted. Idempotent staleness check keyed on the output file: (re)extract when the output is missing or the source is newer than it, so the extractor does not depend on the caller passing the right --since. --since only narrows the scan range; it never suppresses extraction of a file with a fresh output.

The change

1010 depend on the caller passing the right --since. --since only narrows the
1111 scan range; it never suppresses extraction of a file with a fresh output.
1212 """
13+ # A missing output is always (re)extracted, regardless of --since.
14+ if not os.path.exists(out_path):
15+ return True
1316 mtime = os.path.getmtime(source_path)
14- # --since narrows the scan range: skip files not modified since the cutoff.
17+ # --since narrows the scan range: among files that already have an output,
18+ # skip those not modified since the cutoff.
1519 if since_ts is not None and mtime < since_ts:
1620 return False
17- if not os.path.exists(out_path):
18- return True
1921 # Re-extract if the source changed after the output was last written.
2022 return mtime > os.path.getmtime(out_path)

The check that tells the two apart

failpass·tests/test_extract_staleness.py::ExtractStalenessTest::test_missing_output_reextracted_despite_since_gate

Check file tests/test_extract_staleness.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it754d91746763caaa232163c7a046baa225e596f9
Broken version dated2026-07-03
Modulescripts.extract-jsonl
Units changedneeds_extraction
Fingerprint5148f5c618ae2b5a
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in Ar9av/obsidian-wiki