acceptance matrix and workflow generation

This commit is contained in:
2026-05-14 16:01:32 +02:00
parent 4026f34174
commit 55405d8a5a
11 changed files with 1051 additions and 14 deletions

View File

@@ -11,6 +11,7 @@ from .history import find_snapshot, get_history, metric_trend, record_check_resu
from .lifecycle import add_artifact, create_infospace, load_infospace
from .markdown_adapter import validate_infospace_artifacts
from .semantics import list_entities, list_relations
from .workflow import load_workflows, plan_workflow, run_workflow
def build_parser() -> argparse.ArgumentParser:
@@ -62,6 +63,29 @@ def build_parser() -> argparse.ArgumentParser:
)
metrics.add_argument("root")
workflow = sub.add_parser("workflow", help="Inspect, plan, and run workflows")
workflow_sub = workflow.add_subparsers(dest="workflow_command", required=True)
workflow_inspect = workflow_sub.add_parser(
"inspect",
help="Inspect workflow declarations",
)
workflow_inspect.add_argument("root")
workflow_plan = workflow_sub.add_parser(
"plan",
help="Plan a workflow without writing outputs",
)
workflow_plan.add_argument("root")
workflow_plan.add_argument("workflow_id")
workflow_run = workflow_sub.add_parser(
"run",
help="Run a deterministic workflow",
)
workflow_run.add_argument("root")
workflow_run.add_argument("workflow_id")
return parser
@@ -150,6 +174,26 @@ def main(argv: list[str] | None = None) -> int:
run_collection_checks(infospace.artifacts),
)
_write_json(result.to_dict())
elif args.command == "workflow":
if args.workflow_command == "inspect":
_write_json(
{
"workflows": [
workflow.to_dict()
for workflow in load_workflows(Path(args.root))
]
}
)
elif args.workflow_command == "plan":
_write_json(
plan_workflow(Path(args.root), args.workflow_id).to_dict()
)
elif args.workflow_command == "run":
_write_json(
run_workflow(Path(args.root), args.workflow_id).to_dict()
)
else:
parser.error(f"Unhandled workflow command: {args.workflow_command}")
else:
parser.error(f"Unhandled command: {args.command}")
except InfospaceError as exc: