feat(603): adopt OKF's optional stale-after and Sources decision-record metadata
Evaluated the Open Knowledge Format (GoogleCloudPlatform/knowledge-catalog okf v0.2, scaccogatto/okf-skills) as a replacement for our decision-record system and rejected it: its conformance rules are deliberately permissive exactly where ours are strict (broken links, unknown types and missing fields must all be tolerated; `deprecated` points at no successor), and its stable identity is the file path, which the breadcrumb rule tells agents not to trust. Adopted two of its optional families instead, additively: - `stale-after: YYYY-MM-DD` on the metadata line — marks a record asserting an outside-world fact as due for re-confirmation. Absolute date, no TTL. - `**Sources:**` in the metadata block — the evidence a record rests on, as distinct from `Signals:` (recall keywords). Neither is required; absence is never an error. A malformed `stale-after` is blocking (it would silently never fire), but a past-due record is only a non-blocking `::notice::` — going stale is the passage of time, not a defect in whatever commit is under test. The catalog's new "Review due" section renders the date only and never a clock-derived verdict, so it cannot drift `--check` red on a calendar boundary with no commit touching the corpus. No backfill: no existing record adopts either field here. fixes #603
This commit is contained in:
@@ -32,3 +32,18 @@ def test_legacy_record_is_unmigrated():
|
||||
def test_index_section_parses_as_heading():
|
||||
recs = dl.parse_file(FIX)
|
||||
assert any(r.heading == "Index" for r in recs)
|
||||
|
||||
|
||||
def test_parses_optional_stale_after_and_sources():
|
||||
recs = dl.parse_file(FIX)
|
||||
r = next(r for r in recs if r.key == "ci.peak-anon-measurement")
|
||||
assert r.stale_after == "2027-01-15"
|
||||
assert r.sources is not None
|
||||
assert "gitea run 4471" in r.sources
|
||||
|
||||
|
||||
def test_optional_fields_default_to_none_when_absent():
|
||||
recs = dl.parse_file(FIX)
|
||||
r = next(r for r in recs if r.key == "ci.runner-placement")
|
||||
assert r.stale_after is None
|
||||
assert r.sources is None
|
||||
|
||||
Reference in New Issue
Block a user