mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-17 16:37:30 +02:00
89 lines
2.8 KiB
Python
89 lines
2.8 KiB
Python
"""Contracts for the tracked AIWG workspace deployment manifest."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
from datetime import datetime
|
|
from pathlib import Path
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def _load_json(path: str) -> dict:
|
|
return json.loads((ROOT / path).read_text(encoding="utf-8"))
|
|
|
|
|
|
def _calendar_version(value: str) -> tuple[int, int, int]:
|
|
parts = value.split(".")
|
|
assert len(parts) == 3
|
|
return tuple(int(part) for part in parts)
|
|
|
|
|
|
def _assert_utc_timestamp(value: str) -> None:
|
|
assert value.endswith("Z")
|
|
parsed = datetime.fromisoformat(value.removesuffix("Z") + "+00:00")
|
|
assert parsed.utcoffset() is not None
|
|
|
|
|
|
def test_aiwg_manifest_requires_release_with_codex_size_fix():
|
|
config = _load_json(".aiwg/aiwg.config")
|
|
installation = config["installed"]["all"]
|
|
|
|
assert _calendar_version(installation["version"]) >= (2026, 8, 11)
|
|
assert installation["source"] == "bundled"
|
|
assert installation["deployedTo"]["codex"] == {
|
|
"agents": 0,
|
|
"commands": 50,
|
|
"skills": 31,
|
|
"rules": 2,
|
|
}
|
|
_assert_utc_timestamp(installation["installedAt"])
|
|
|
|
|
|
def test_bt6_maintainer_installation_matches_project_plugin():
|
|
config = _load_json(".aiwg/aiwg.config")
|
|
plugin = _load_json(".aiwg/plugins/bt6-maintainer/manifest.json")
|
|
installation = config["installed"]["bt6-maintainer"]
|
|
|
|
assert installation["version"] == plugin["version"]
|
|
assert installation["source"] == "project-local"
|
|
assert installation["localPath"] == ".aiwg/plugins/bt6-maintainer/"
|
|
assert installation["localType"] == plugin["type"]
|
|
assert installation["manifestVersion"] == plugin["manifestVersion"]
|
|
assert installation["deployedTo"]["codex"] == {
|
|
"agents": 5,
|
|
"commands": 0,
|
|
"skills": 5,
|
|
"rules": 1,
|
|
}
|
|
_assert_utc_timestamp(installation["installedAt"])
|
|
|
|
|
|
def test_workspace_authority_and_delivery_permissions_remain_explicit():
|
|
config = _load_json(".aiwg/aiwg.config")
|
|
|
|
assert config["providers"] == ["codex"]
|
|
assert config["workspace"]["name"] == "bt6-obliteratus-maintenance"
|
|
repositories = {repository["name"]: repository for repository in config["repos"]}
|
|
assert repositories["obliteratus"]["allowed"] == [
|
|
"read",
|
|
"write",
|
|
"commit",
|
|
"push",
|
|
"issue-comment",
|
|
"service-action",
|
|
]
|
|
assert repositories["bt6-aiwg-plugins"]["allowed"] == ["read"]
|
|
assert config["delivery"] == {
|
|
"mode": "pr-required",
|
|
"default_branch": "main",
|
|
"require_ci_green": True,
|
|
"auto_close_issues": True,
|
|
"issue_comment_on_cycle": True,
|
|
"force_push_policy": "never",
|
|
}
|
|
assert config["remotes"]["primary"] == "origin"
|
|
assert config["remotes"]["issue_tracker"] == "origin"
|
|
assert config["remotes"]["ci"] == "origin"
|