idle-draft: strip :line-range suffixes before citation existence check
First pilot rejected valid citations like SPEC.md:1-80 — the form the research template itself mandates. 5 new test cases (83 total). Claude-Session: https://claude.ai/code/session_01YQDoWNM7XPPii28khFWoMc
This commit is contained in:
@@ -409,6 +409,26 @@ bad_text = "# Research: topic\n\nSee /home/nonexistent-user/definitely-not-here.
|
||||
ok, why = m.validate_output("research", bad_text)
|
||||
check("citation validation: rejects research output citing a dead path", ok is False, why)
|
||||
|
||||
ranged_good_text = f"# Research: topic\n\nSee {real_path}:12-18 for detail.\n"
|
||||
ok, why = m.validate_output("research", ranged_good_text)
|
||||
check("citation validation: accepts existing path cited with a :12-18 line range", ok is True, why)
|
||||
|
||||
bare_good_text = f"# Research: topic\n\nSee {real_path} for detail.\n"
|
||||
ok, why = m.validate_output("research", bare_good_text)
|
||||
check("citation validation: accepts existing path cited bare (no line range)", ok is True, why)
|
||||
|
||||
ranged_bad_text = "# Research: topic\n\nSee /home/nonexistent-user/definitely-not-here.md:1-20 for detail.\n"
|
||||
ok, why = m.validate_output("research", ranged_bad_text)
|
||||
check("citation validation: rejects nonexistent path cited with a :1-20 line range", ok is False, why)
|
||||
|
||||
bare_bad_text = "# Research: topic\n\nSee /home/nonexistent-user/definitely-not-here.md for detail.\n"
|
||||
ok, why = m.validate_output("research", bare_bad_text)
|
||||
check("citation validation: rejects nonexistent path cited bare (no line range)", ok is False, why)
|
||||
|
||||
noisy_text = f"# Research: topic\n\nSee ({real_path}), also `{real_path}`, and {real_path}, again.\n"
|
||||
ok, why = m.validate_output("research", noisy_text)
|
||||
check("citation validation: accepts existing path with trailing comma/backtick noise", ok is True, why)
|
||||
|
||||
ok, why = m.validate_output("research", "")
|
||||
check("citation validation: rejects empty output", ok is False, why)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user