Adopt spec v0.2: schema, semantic validator, operating modes; workplans updated
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 295952@bnt-lap001 Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
parent
b6868a3a58
commit
79996ab249
15 changed files with 1090 additions and 64 deletions
|
|
@ -26,6 +26,10 @@ class Pack:
|
|||
def id(self) -> str:
|
||||
return str(self.data.get("id", self.path.parent.name))
|
||||
|
||||
@property
|
||||
def spec(self) -> str:
|
||||
return str(self.data.get("spec", ""))
|
||||
|
||||
@property
|
||||
def ok(self) -> bool:
|
||||
return not self.errors
|
||||
|
|
@ -97,6 +101,9 @@ def load(path: Path) -> Pack:
|
|||
return Pack(path, {}, [f"invalid YAML: {e}"])
|
||||
if not isinstance(data, dict):
|
||||
return Pack(path, {}, ["manifest must be a mapping"])
|
||||
if data.get("spec") == "runbook-pack/v0.2":
|
||||
from . import v2
|
||||
return Pack(path, data, v2.validate(data))
|
||||
errs = _schema_errors(data)
|
||||
if not errs:
|
||||
errs = _semantic_errors(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue