Add Steev agent contract blocks
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
@@ -199,6 +200,42 @@ GOVERNED_BOUNDARY_SNIPPETS = [
|
||||
"broad goal-completion claim",
|
||||
]
|
||||
|
||||
AGENT_CONTRACT_SNIPPETS = [
|
||||
"# Steev Profile Endgoal",
|
||||
"## Universal Cortex OS Agent Contract",
|
||||
"## Repo-Custom Agent Contract",
|
||||
"child-local personal-agent profile workspace",
|
||||
"not Cortex OS Core authority",
|
||||
"Profile Exposure authority",
|
||||
"memory-domain authority",
|
||||
"browser-host authority",
|
||||
"Do not install or start Steev",
|
||||
"read raw messages",
|
||||
"read mail bodies",
|
||||
"write durable memory",
|
||||
"python3 tools/validate_steev_child.py",
|
||||
]
|
||||
|
||||
README_CONTRACT_SNIPPETS = [
|
||||
"## Cortex OS Boundary",
|
||||
"child-local personal-agent profile workspace",
|
||||
"does not own Core truth",
|
||||
"Profile Exposure authority",
|
||||
"credential authority",
|
||||
"send authority",
|
||||
"memory-domain authority",
|
||||
"Do not install or start Steev",
|
||||
"mutate `~/.hermes`",
|
||||
"read raw messages",
|
||||
"write durable memory",
|
||||
]
|
||||
|
||||
|
||||
def has_snippet(text: str, snippet: str) -> bool:
|
||||
normalized_text = re.sub(r"\s+", " ", text)
|
||||
normalized_snippet = re.sub(r"\s+", " ", snippet)
|
||||
return normalized_snippet in normalized_text
|
||||
|
||||
|
||||
def read_text(rel: str) -> str:
|
||||
return (ROOT / rel).read_text(encoding="utf-8")
|
||||
@@ -260,6 +297,9 @@ def main() -> int:
|
||||
"PACR-013",
|
||||
"PACR-014",
|
||||
"PACR-015",
|
||||
"STEEV-WORK-003",
|
||||
"Steev Agent Contract Enforcement",
|
||||
"status: validated",
|
||||
"status: candidate",
|
||||
"owner: jp",
|
||||
]:
|
||||
@@ -268,9 +308,15 @@ def main() -> int:
|
||||
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:
|
||||
for snippet in AGENT_CONTRACT_SNIPPETS:
|
||||
if not has_snippet(text, snippet):
|
||||
errors.append(f"agents_missing:{snippet}")
|
||||
readme = ROOT / "README.md"
|
||||
if readme.exists():
|
||||
text = readme.read_text(encoding="utf-8")
|
||||
for snippet in README_CONTRACT_SNIPPETS:
|
||||
if not has_snippet(text, snippet):
|
||||
errors.append(f"readme_missing:{snippet}")
|
||||
|
||||
manifest = ROOT / "manifest.yaml"
|
||||
if manifest.exists():
|
||||
|
||||
Reference in New Issue
Block a user