feat: add tabular Work summaries and CSV exports
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/AI Engineering/pipeline/head There was a failure building this commit
build / jvm (push) Canceled after 0s
build / native (macos-15, macos-arm64) (push) Canceled after 0s
build / native (ubuntu-24.04, linux-x86_64) (push) Canceled after 0s
build / native (windows-2025, windows-x86_64) (push) Canceled after 0s

This commit is contained in:
Nilton Constantino
2026-11-16 15:59:26 +00:00
parent f296d252c6
commit a7e3a2fdfc
21 changed files with 642 additions and 5 deletions
@@ -270,6 +270,22 @@ public final class VerificationService {
public record WorkSummary(String id, String title, Work.Status status, boolean archived, ValidationReport validation, List<Action> nextActions) {}
public record ProjectStatus(int schemaVersion, ProjectConfig.Identity project, boolean onboarded, List<WorkSummary> works,
CompatibilityService.Summary compatibility) {}
/** Read-only projection for human listings; the full JSON contracts remain unchanged. */
public record Overview(Work work, String steps, ValidationReport validation, List<Action> nextActions) {}
public List<Overview> overview(Path root, List<Work> selected) {
return selected.stream().map(w -> {
var validation = work(root, w.id());
String progress = "unavailable";
try {
var steps = plans.list(root, w.id()).stream().flatMap(p -> p.steps().stream()).toList();
progress = steps.stream().filter(s -> s.status() == Plan.Status.COMPLETED).count() + "/" + steps.size();
} catch (ProtocolException failure) {
if (validation.valid()) throw failure;
// Keep repairable Works visible without claiming a zero-step plan.
}
return new Overview(w, progress, validation, actions(root, w, validation));
}).toList();
}
public ProjectStatus status(Path root, boolean all) {
return new ProjectStatus(1, projects.load(root).project(), ProtocolGuide.installed(root), works.list(root).stream()
.filter(w -> all || !w.archived()).map(w -> new WorkSummary(w.id(), w.title(), w.status(), w.archived(), work(root, w.id()), actions(root, w))).toList(),
@@ -282,8 +298,10 @@ public final class VerificationService {
selected.forEach(w -> result.addAll(actions(root, w))); return List.copyOf(result);
}
private List<Action> actions(Path root, Work work) {
return actions(root, work, work(root, work.id()));
}
private List<Action> actions(Path root, Work work, ValidationReport validation) {
String id = work.id(); var actions = new ArrayList<Action>();
var validation = work(root, id);
if (!validation.valid()) return List.of(new Action(work.epic() ? "RECONCILE_EPIC" : "REPAIR_PROTOCOL", id,
String.join("; ", validation.issues()), work.epic() ? "aie epic reconcile " + id : "aie work validate " + id));
if (work.archived()) return List.of(new Action("REOPEN", id, "Reopen only when new work is needed", "aie work reopen " + id + " --help"));