Implement offline catalog lane scaffold generation

Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a10391-6355-7b41-b0fa-3e14e874f091
This commit is contained in:
tegwick 2026-10-04 02:24:40 +02:00
parent 1b274bb136
commit dfe436e4e0
4 changed files with 424 additions and 0 deletions

View file

@ -702,6 +702,26 @@ def _print_entry_table(
console.print(table)
@route_app.command("scaffold")
def route_scaffold(
input_path: Annotated[Path, typer.Option("--input", help="Non-secret draft request YAML")],
output_dir: Annotated[Path, typer.Option("--output-dir", help="New staging directory")],
) -> None:
"""Generate validated draft catalog/playbook pointers offline."""
from warden.routing.scaffold import ScaffoldError, scaffold
from warden.routing.catalog import CatalogError
try:
paths = scaffold(input_path, output_dir)
except ScaffoldError as exc:
err.print(f"[red]Scaffold refused:[/red] {exc}")
raise typer.Exit(1)
except CatalogError:
err.print("[red]Scaffold refused:[/red] existing routing catalog is invalid")
raise typer.Exit(1)
console.print("Draft staging created: " + ", ".join(path.name for path in paths))
@route_app.command("list")
def route_list(
output_json: Annotated[bool, typer.Option("--json", help="Output JSON")] = False,