fix(synthesis): namespace lead ids by kind to stop collisions (audit C-11)
Each stage (find_connections/gaps/improvements/propose_conjectures) numbered its leads from seq=1, so connection L-0001, gap L-0001 and improvement L-0001 all resolved to grounded/L-0001.md. The CLI concatenates them (connections + gaps + improvements) and write_leads writes in order, so later kinds silently overwrote earlier ones — survivors = max(per-kind count), not the sum. Reproduced: 4 distinct leads -> 2 files. _make_lead_id now takes the kind and emits L-C-/L-G-/L-I-/L-X- prefixes, keeping same-seq ids distinct across stages. Regression tests cover the format and the no-collision invariant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -76,7 +76,7 @@ def test_finalise_grounded_lead_succeeds_when_grounded(
|
||||
)
|
||||
assert lead is not None
|
||||
assert lead.kind == "connection"
|
||||
assert lead.id == "L-0001"
|
||||
assert lead.id == "L-C-0001" # kind-prefixed id (audit C-11)
|
||||
assert lead.confidence >= 0.5
|
||||
assert lead.status == "unverified"
|
||||
assert lead.suggested_validation == ""
|
||||
|
||||
Reference in New Issue
Block a user