feat: promote draft decisions when creating plans
Promote referenced drafts deterministically with system provenance, causal Plan links, supersession history and recovery from publication failures. Preserve direct human approval and historical records. Add JVM and native regression coverage and update the portable protocol. Record the WRK-0007 importer decision and six-step plan, and complete WRK-0008 with verification evidence.
This commit is contained in:
@@ -66,6 +66,12 @@ public final class VerificationService {
|
||||
var byId = new HashMap<String, Decision>(); all.forEach(d -> byId.put(d.id(), d));
|
||||
for (var d : all) {
|
||||
if (!work.artifacts().containsAll(d.evidence())) issues.add("Missing decision evidence: " + d.id());
|
||||
for (var approval : d.approvals()) if (approval.origin() == Decision.ApprovalOrigin.SYSTEM_PLAN) {
|
||||
String target = approval.status() == Decision.Status.SUPERSEDED ? d.supersededBy() : d.id();
|
||||
if (!work.plans().contains(approval.planId())) issues.add("Missing promoting Plan for " + d.id() + ": " + approval.planId());
|
||||
else if (!plans.history(root, id, approval.planId()).getFirst().decisions().contains(target))
|
||||
issues.add("Promoting Plan does not reference its decision: " + d.id() + "/" + approval.planId());
|
||||
}
|
||||
if (d.revises() != null) {
|
||||
var parent = byId.get(d.revises());
|
||||
if (parent == null) issues.add("Missing revised decision: " + d.revises());
|
||||
@@ -295,7 +301,7 @@ public final class VerificationService {
|
||||
for (var survey : new SurveyService().list(root, id)) if (survey.questions().isEmpty())
|
||||
actions.add(new Action("ADD_QUESTION", id, "Add questions with suggestions to " + survey.id(), "aie survey question " + id + " " + survey.id() + " --help"));
|
||||
for (var decision : decisions.list(root, id)) if (decision.approvalStatus() == Decision.Status.DRAFT)
|
||||
actions.add(new Action("REVIEW_DECISION", id, "Discuss and obtain human approval for " + decision.id(), "aie decision show " + id + " " + decision.id()));
|
||||
actions.add(new Action("REVIEW_DECISION", id, "Review " + decision.id() + "; accept explicitly or create a Plan from it", "aie decision show " + id + " " + decision.id()));
|
||||
for (var plan : plans.list(root, id)) {
|
||||
if (plan.status() == Plan.Status.COMPLETED || plan.status() == Plan.Status.CANCELLED) continue;
|
||||
if (plan.steps().isEmpty()) actions.add(new Action("ADD_STEP", id, "Add explicit steps to " + plan.id(), "aie plan step add " + id + " " + plan.id() + " --help"));
|
||||
|
||||
Reference in New Issue
Block a user