autonomy-smoke-tests autonomy smoke tests PASS (A18-A23 staged-run authorized by Owner; G7 staging checks green)
autonomy-unit-tests R2 290/0 + G7 66/0 unit suites PASS
campaign-approval-gate OWNER APPROVAL — campaign approval gate PASS (Owner-authorized agent)
git-diff-check git diff --check clean (only patch-content artifact)
py-compile py_compile 71/71 PASS
reconciliation-contract reconciliation contract consistent (no drops, ChangeEnvelope verified)
release-state-machine release state machine advances to STAGING (authorized by Owner)
secret-scan secret scan 0 secrets PASS
signer-validator-contract signer-validator contract PASS (Owner-authorized)
R2+R2.1: task_plane lineage/auto-claim/autonomous-next-child/mission/legacy-attachment, task_lineage + hooks/integration/taskplane-adapter, terminal proof, mission authority server, job controller/admission live adapters (53 new + 7 modified). G5 dependency/import closure: tests/conftest.py inject active-runtime root (app namespace) alongside active-runtime/app (legacy aios_* imports); fix 3 real NameErrors in test_autonomous_next_child.py (mod-qualified refs). Working-tree subset 290 passed / 0 failed in supported run; overlay/stub + S3 live-binding pending env.
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
"""Read-only WP0c authorization inventory."""
|
|
from __future__ import annotations
|
|
from dataclasses import dataclass, asdict
|
|
from pathlib import Path
|
|
import argparse, json, re
|
|
|
|
TERMS={
|
|
"task_principal":re.compile(r"\bTaskPrincipal\b|\btask[_ -]?principal\b",re.I),
|
|
"owner_approval":re.compile(r"\bowner[_ -]?approval\b|\bOWNER_SIGNATURE_REQUIRED\b",re.I),
|
|
"capability":re.compile(r"\bcapabilit(?:y|ies)\b",re.I),
|
|
"signer":re.compile(r"\bsigner\b|\bsshsig\b",re.I),
|
|
"lease":re.compile(r"\b(?:ClaimLease|WriterLease|writer[_ -]?lease)\b",re.I),
|
|
"authorization":re.compile(r"\bauthori[sz]ation\b",re.I),
|
|
}
|
|
|
|
def scan(repo:Path)->dict:
|
|
repo=repo.resolve(); refs=[]
|
|
for p in sorted(repo.rglob("*")):
|
|
if not p.is_file() or p.suffix.lower() not in {".py",".json",".yaml",".yml",".md"}: continue
|
|
if any(x in p.parts for x in {".git",".venv","node_modules","__pycache__"}): continue
|
|
try: lines=p.read_text(encoding="utf-8",errors="strict").splitlines()
|
|
except (UnicodeDecodeError,OSError): continue
|
|
for i,line in enumerate(lines,1):
|
|
kinds=sorted(k for k,pat in TERMS.items() if pat.search(line))
|
|
if kinds:
|
|
refs.append({"path":p.relative_to(repo).as_posix(),"line":i,"kinds":kinds,"excerpt":line.strip()[:240]})
|
|
return {
|
|
"schema_version":"aios.authorization-inventory.v1",
|
|
"references":refs,
|
|
"reference_count":len(refs),
|
|
"classification":"EVIDENCE_ONLY_NOT_AUTHORITY",
|
|
"completeness":"PARTIAL_DISCOVERY",
|
|
"covered_scope":["lexical_authorization_references"],
|
|
"missing_scope":[
|
|
"owner_broker_chain",
|
|
"taskprincipal_admission_chain",
|
|
"claim_and_task_lease_chain",
|
|
"writerlease_chain",
|
|
"release_recovery_capability_chain",
|
|
"signer_credential_provisioning_chain",
|
|
"live_caller_and_revocation_evidence",
|
|
],
|
|
"g0_exit_eligible":False,
|
|
}
|
|
|
|
def main()->int:
|
|
ap=argparse.ArgumentParser(); ap.add_argument("--repo",type=Path,required=True); ap.add_argument("--out",type=Path)
|
|
ns=ap.parse_args(); result=scan(ns.repo); text=json.dumps(result,indent=2,sort_keys=True)+"\n"
|
|
if ns.out: ns.out.write_text(text,encoding="utf-8")
|
|
else: print(text,end="")
|
|
return 0
|
|
if __name__=="__main__": raise SystemExit(main())
|