Files
aios/tests/platform/test_environment_profile.py
T
AIOS Governed Continuation 7e1649808d
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)
feat(r2+g5): R2+R2.1 unified platform convergence candidate + G5 import/execution-mode fixes
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.
2026-09-14 22:33:41 +08:00

31 lines
1.2 KiB
Python

from __future__ import annotations
from pathlib import Path
import importlib.util
import sys
ROOT=Path(__file__).resolve().parents[2]
spec=importlib.util.spec_from_file_location("envprof",ROOT/"scripts/platform/aios_environment_profile.py")
M=importlib.util.module_from_spec(spec); sys.modules[spec.name]=M; spec.loader.exec_module(M)
def test_environment_profile_schema_is_secret_safe_and_structured():
p=M.collect("test-host")
d=p.to_dict()
assert d["schema_version"]=="aios.environment-profile.v2"
assert d["host_id"]=="test-host"
assert set(d["capabilities"]) >= {
"posix","systemd","systemd_load_credential","sudo_noninteractive","git","python","node"
}
assert set(d["filesystem"]) == {"case_sensitive","line_ending_default"}
assert d["completeness"]=="CAPABILITY_DISCOVERY_ONLY"
assert d["g0_exit_eligible"] is False
assert all("token" not in x.lower() and "secret=" not in x.lower() for x in d["credential_mechanisms"])
def test_missing_requirements_are_computed(monkeypatch):
monkeypatch.setattr(M, "_systemd_running", lambda: False)
p=M.collect("h", requirements=("systemd","git"))
d=p.to_dict()
assert "systemd" in d["missing_requirements"]
assert d["completeness"]=="REQUIREMENTS_EVALUATED"