feat: add tabular Work summaries and CSV exports

This commit is contained in:
2026-11-16 15:59:26 +00:00
parent 1e440c12ee
commit 3c75ce70f6
21 changed files with 642 additions and 5 deletions
@@ -164,10 +164,26 @@ public final class EngineeringCli implements Runnable {
}
@Command(name = "status", mixinStandardHelpOptions = true, description = "Inspect Works, validation and suggested next actions.")
int status(@Option(names = "--all", description = "Include archived Works.") boolean all,
@Option(names = "--format", defaultValue = "markdown") Format format) { return emit(verification.status(root(), all), format); }
@Option(names = "--format", defaultValue = "markdown", description = "Output: ${COMPLETION-CANDIDATES}.") Listing.Format format) {
Path root = root();
if (format == Listing.Format.json) return emit(verification.status(root, all), Format.json);
var state = new CompatibilityService().inspect(root).summary();
var selected = works.list(root).stream().filter(w -> all || !w.archived()).toList();
if (format != Listing.Format.csv) {
String name = projects.load(root).project().name();
String details = (format == Listing.Format.markdown ? Listing.markdown(name) : Listing.singleLine(name)) + " | Onboarded: " + ProtocolGuide.installed(root)
+ " | Compatibility: " + state.state();
output.println(format == Listing.Format.markdown ? "# Project status\n\n" + details + "\n" : details + "\n");
}
output.print(Listing.works(verification.overview(root, selected), format)); return 0;
}
@Command(name = "next-actions", mixinStandardHelpOptions = true, description = "Suggest deterministic next actions; does not execute them.")
int nextActions(@Parameters(index = "0", arity = "0..1") String id,
@Option(names = "--format", defaultValue = "markdown") Format format) { return emit(verification.nextActions(root(), id), format); }
@Option(names = "--format", defaultValue = "markdown", description = "Output: ${COMPLETION-CANDIDATES}.") Listing.Format format) {
var actions = verification.nextActions(root(), id);
if (format == Listing.Format.json) return emit(actions, Format.json);
output.print(Listing.actions(actions, format)); return 0;
}
@Command(name = "project", mixinStandardHelpOptions = true, description = "Inspect and validate the engineering project.")
public class ProjectCommands {
@Command(name = "compatibility", mixinStandardHelpOptions = true,
@@ -216,7 +232,13 @@ public final class EngineeringCli implements Runnable {
return emit(works.create(root(), title, description, goal, motivation, safe(constraints), safe(criteria), safe(repositories), author), Format.markdown);
}
@Command(name = "list", mixinStandardHelpOptions = true)
int list(@Option(names = "--format", defaultValue = "markdown") Format format) { return emit(works.list(root()), format); }
int list(@Option(names = "--open", description = "Only nonterminal, unarchived Works (OPEN, ACTIVE, BLOCKED).") boolean open,
@Option(names = "--format", defaultValue = "markdown", description = "Output: ${COMPLETION-CANDIDATES}.") Listing.Format format) {
Path root = root();
var selected = works.list(root).stream().filter(w -> !open || (!w.terminal() && !w.archived())).toList();
if (format == Listing.Format.json) return emit(selected, Format.json);
output.print(Listing.works(verification.overview(root, selected), format)); return 0;
}
@Command(name = "show", mixinStandardHelpOptions = true)
int show(@Parameters(index = "0") String id, @Option(names = "--format", defaultValue = "markdown") Format format) { return emit(works.load(root(), id), format); }
@Command(name = "update", mixinStandardHelpOptions = true, description = "Update specified Work fields, preserving history and references.")