admission: a report's spec is always its own campaign's, so its status check is never skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-08 21:57:38 +01:00
commit e77e0f361b
2 changed files with 1 additions and 10 deletions

View file

@ -657,7 +657,7 @@ fn check(docs: &Docs<'_>, staged: &Staged, mind: &Slug, import: Option<&ImportSo
}
return Err(MindRefusal::CutReportWithoutSpec { report: key.into() });
};
if !(historic && root_and_local(&report.cut_spec.0).0 != root) && !docs.in_force(K::CutSpec, &report.cut_spec.0) {
if !docs.in_force(K::CutSpec, &report.cut_spec.0) {
return Err(MindRefusal::CitesResolvedDocument { kind: K::CutSpec, id: report.cut_spec.0.clone() });
}
if report.repo != spec.repo {

View file

@ -782,15 +782,6 @@ fn receiver_with_superseded(root: &str, opening: Vec<D>, closing: Vec<D>, old: P
mind
}
#[test]
fn an_imported_report_may_cite_another_campaigns_spec_superseded_since() {
let (old, new) = (spec_ref(OTHER_ROOT, 1), spec_ref(OTHER_ROOT, 2));
let mut mind = receiver_with_superseded(OTHER_ROOT, vec![spec_of(OTHER_ROOT, 1)], vec![spec_of(OTHER_ROOT, 2)], old.clone(), new);
committed(import(&mut mind, vec![campaign(&[REPO])], vec![]));
let (_, writes) = committed(import(&mut mind, vec![report_citing(&old)], vec![]));
assert_eq!(writes.len(), 1);
}
#[test]
fn an_imported_report_citing_its_own_campaigns_superseded_spec_is_refused() {
let (old, new) = (spec_ref(CAMPAIGN, 1), spec_ref(CAMPAIGN, 2));