Realign stale thesis tests to the 7-member positioning group
ensure_positioning_framings adds 5 Architect framings to the core positioning variant group alongside Option A/B, so the group holds 7 candidates and choose_variant retires 6. The two thesis tests still asserted the pre-framings count of 2 — the tests were stale, not the seed. Realign them, document the 2+5=7 seed structure in the thesis guide, and refresh AGENTS.md Current state (13/13 tests green).
This commit is contained in:
@@ -35,12 +35,14 @@ def main():
|
||||
c = sqlite3.connect(db)
|
||||
c.row_factory = sqlite3.Row
|
||||
|
||||
# choose-variant: pick Option A in the positioning group -> Option B retired
|
||||
# choose-variant: pick Option A in the positioning group -> every other option retired.
|
||||
# The group holds Option A/B plus the 5 Architect framings (ensure_positioning_framings) = 7.
|
||||
opts = c.execute("SELECT id, title FROM thesis_nodes WHERE variant_group='positioning' AND deleted_at IS NULL").fetchall()
|
||||
check(len(opts) == 2, f"positioning starts with 2 options (got {len(opts)})")
|
||||
check(len(opts) == 7, f"positioning starts with 7 options: Option A/B + 5 Architect framings (got {len(opts)})")
|
||||
a = next(o for o in opts if "Option A" in (o["title"] or ""))
|
||||
res = at.choose_variant(a["id"], db=db)
|
||||
check(res.get("retired_siblings") == 1, "choose_variant retired the 1 sibling")
|
||||
expected_retired = len(opts) - 1 # 6: Option B + the 5 framings
|
||||
check(res.get("retired_siblings") == expected_retired, f"choose_variant retired the {expected_retired} siblings (got {res.get('retired_siblings')})")
|
||||
live = c.execute("SELECT COUNT(*) FROM thesis_nodes WHERE variant_group='positioning' AND deleted_at IS NULL").fetchone()[0]
|
||||
check(live == 1, f"positioning now has 1 live option (got {live})")
|
||||
check(c.execute("SELECT status FROM thesis_nodes WHERE id=?", (a["id"],)).fetchone()[0] == "approved",
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
Runs the real init_db against a throwaway DB (applies migration 0002 and the
|
||||
auto-seed), then asserts the Workshop substrate: a core line, one line per segment,
|
||||
the Option A/B banner as a 2-member variant group, the pillars/proof, and the
|
||||
segments table — and that re-seeding is a no-op.
|
||||
the positioning variant group (Option A/B banner + the 5 Architect framings seeded
|
||||
by ensure_positioning_framings), the pillars/proof, and the segments table — and
|
||||
that re-seeding is a no-op.
|
||||
|
||||
Run: cd backend && python3 test_thesis_seed.py
|
||||
"""
|
||||
@@ -47,7 +48,11 @@ def main():
|
||||
check("throughline" in types, "core has a throughline node")
|
||||
check("proof_point" in types, "core has a proof_point node")
|
||||
variants = [n for n in nodes if n["variant_group"] == "positioning"]
|
||||
check(len(variants) == 2, f"Option A/B banner is a 2-member variant group (got {len(variants)})")
|
||||
banner = [n for n in variants if (n["title"] or "").startswith(("Option A", "Option B"))]
|
||||
framings = [n for n in variants if "(Architect," in (n["title"] or "")]
|
||||
check(len(banner) == 2, f"Option A/B banner present in positioning group (got {len(banner)})")
|
||||
check(len(framings) == 5, f"five Architect positioning framings seeded into the group (got {len(framings)})")
|
||||
check(len(variants) == 7, f"positioning variant group = Option A/B + 5 framings = 7 (got {len(variants)})")
|
||||
pillars = [n for n in nodes if n["node_type"] == "claim" and n["title"] and n["title"][0] in "123"]
|
||||
check(len(pillars) == 3, f"three pillar claims (got {len(pillars)})")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user