WARDEN-WP-0044-T02: warden case plan; close WP-0044-T01 and WP-0043-T02
warden case plan resolves an accepted, materialized SecurityCase against its acknowledged type: warden, attended and owner steps, type defaults, conditions, rendered entry points and verification. Executes nothing; refuses unmaterialized cases, missing or unreviewed lanes and secret or type-fixed parameters. T01 closes on net-kingdom's R8 option 1 and the founder's acknowledgement of the type (memo r4). WP-0043-T02 closes on railiance-platform b77cb41. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: opus Assistant-Process: 427672@bnt-lap001 Assistant-Session: a0a2367e-4697-440c-a4e5-9713c009f6d8
This commit is contained in:
parent
6258d73732
commit
9a85405e7a
5 changed files with 446 additions and 8 deletions
|
|
@ -2243,3 +2243,32 @@ def case_check_type(
|
|||
if report.findings:
|
||||
console.print(summarize(report.findings), markup=False)
|
||||
raise typer.Exit(0 if report.plannable else 1)
|
||||
|
||||
|
||||
@case_app.command("plan")
|
||||
def case_plan(
|
||||
case_file: Annotated[Path, typer.Argument(help="SecurityCase yaml (accepted and materialized)")],
|
||||
type_file: Annotated[
|
||||
Optional[Path],
|
||||
typer.Option("--type", help="type.yaml (default: ../security-case-types/<type>/type.yaml beside the case)"),
|
||||
] = None,
|
||||
output_json: Annotated[bool, typer.Option("--json", help="Output JSON")] = False,
|
||||
) -> None:
|
||||
"""Print a case's run (warden, attended, owner steps and verification); executes nothing (exit 1 if refused)."""
|
||||
from warden.case_plan import CaseError, default_type_path, format_plan, load_case, plan_case
|
||||
from warden.case_type import load_type
|
||||
|
||||
try:
|
||||
case_doc = load_case(case_file)
|
||||
type_path = type_file or default_type_path(case_file, str((case_doc.get("spec") or {}).get("type", "")))
|
||||
plan = plan_case(case_doc, load_type(type_path), _load_catalog())
|
||||
except CaseError as exc:
|
||||
err.print(str(exc), markup=False)
|
||||
raise typer.Exit(1)
|
||||
except (OSError, ValueError, yaml.YAMLError) as exc:
|
||||
err.print(f"[red]{exc}[/red]")
|
||||
raise typer.Exit(2)
|
||||
if output_json:
|
||||
print(json.dumps(plan.as_dict(), indent=2))
|
||||
else:
|
||||
console.print(format_plan(plan), markup=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue