@antoneeo/course-creator 0.1.0-beta.13 → 0.1.0-beta.15

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.
@@ -615,6 +615,11 @@ class Grounds:
615
615
  return [{"kind": "untraceable", "path": rel}]
616
616
  seen = seen | {rel}
617
617
  if rel.startswith("corpus/given/"):
618
+ # F-084: a document this project SENT is our own declaration, not
619
+ # ground for a fact about the product.
620
+ side = self._meta(rel + ".meta.md")
621
+ if _v(side, "provenance").upper() == "DECLARED":
622
+ return [{"kind": "declared", "path": rel}]
618
623
  return [{"kind": "document", "path": rel}]
619
624
  if not _inside(self.docs, rel) or not (self.docs / rel).is_file():
620
625
  return [{"kind": "untraceable", "path": rel}]
@@ -643,6 +648,8 @@ def ground_class(leaves):
643
648
  return "statement"
644
649
  if "untraceable" in kinds:
645
650
  return "untraceable"
651
+ if "declared" in kinds:
652
+ return "declared"
646
653
  if "kb" in kinds:
647
654
  return "imported"
648
655
  return "documents"
@@ -707,12 +714,15 @@ def build_kb(docs):
707
714
  kind, rest = _kind(r)
708
715
  f = {"text": r["claim"], "valid": r["valid"], "qty": r["qty"], "about": r["about"],
709
716
  "origin": (r["prov"] or "").strip().lower(), "topic": slug,
710
- "state": {"SUPERSEDED": "superseded", "CONTESTED": "contested"}.get(kind, "ok")}
717
+ "state": {"SUPERSEDED": "superseded", "CONTESTED": "contested",
718
+ "DIVERGES": "diverges"}.get(kind, "ok")}
711
719
  if kind == "SUPERSEDED":
712
720
  f["successors"] = _ids(rest)
713
721
  f["chain_ends"] = chain_ends(r["id"], by_id)
714
722
  if kind == "CONTESTED":
715
723
  f["with"] = _ids(rest)
724
+ if kind == "DIVERGES":
725
+ f["diverges_from"] = _ids(rest)
716
726
  srcs = []
717
727
  for src in r["source"].split(";"):
718
728
  src = src.strip()
@@ -1246,7 +1256,9 @@ def chronology(docs, pages):
1246
1256
  text = _text(docs / rel) if (docs / rel).is_file() else None
1247
1257
  if text is not None:
1248
1258
  for row in sdlc_core.parse_review_log(text)[0]:
1249
- add(row["date"], "review", "%s — %s: %s" % (
1259
+ # F-085: a `post-merge` row is the owner's defect report, not a review
1260
+ kind = "defect" if row["tier"].lower().startswith("post-merge") else "review"
1261
+ add(row["date"], kind, "%s — %s: %s" % (
1250
1262
  row["doc_key"], row["tier"], row["verdict"]), rel)
1251
1263
  for p in sorted(docs.glob("architecture/ADR_*.md")):
1252
1264
  rel = "architecture/" + p.name
@@ -1269,7 +1281,9 @@ def chronology(docs, pages):
1269
1281
  continue
1270
1282
  if kind == "source":
1271
1283
  name = p.name[:-len(suffix)]
1272
- add(date, kind, name, rel, source=name)
1284
+ # F-084: a DECLARED sidecar's date is the day it was SENT
1285
+ sent = _v(fm, "provenance").upper() == "DECLARED"
1286
+ add(date, "sent" if sent else kind, name, rel, source=name)
1273
1287
  else:
1274
1288
  add(date, kind, title_of(rel, text), rel)
1275
1289
  # Most recent first. Within one day a document's later entry is the more recent