36 lines
1.2 KiB
Python
Executable File
36 lines
1.2 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Validate Steev Profile child workspace shell."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
REQUIRED = ["AGENTS.md", "README.md", "WORKBOARD.yaml"]
|
|
|
|
|
|
def main() -> int:
|
|
errors: list[str] = []
|
|
for rel in REQUIRED:
|
|
if not (ROOT / rel).exists():
|
|
errors.append(f"missing:{rel}")
|
|
board = ROOT / "WORKBOARD.yaml"
|
|
if board.exists():
|
|
text = board.read_text(encoding="utf-8")
|
|
for snippet in ["STEEV-WORK-001", "status: candidate", "owner: jp"]:
|
|
if snippet not in text:
|
|
errors.append(f"workboard_missing:{snippet}")
|
|
agents = ROOT / "AGENTS.md"
|
|
if agents.exists():
|
|
text = agents.read_text(encoding="utf-8")
|
|
for snippet in ["child-local", "not Cortex OS Core authority", "python3 tools/validate_steev_child.py"]:
|
|
if snippet not in text:
|
|
errors.append(f"agents_missing:{snippet}")
|
|
result = {"ok": not errors, "validator": "steev-child-v1", "checked": REQUIRED, "errors": errors, "warnings": []}
|
|
print(json.dumps(result, indent=2, sort_keys=True))
|
|
return 0 if result["ok"] else 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|