Files
Open_Ultra_SAST/tests/test_removed_plane_references.py
T
Marius CiepluchandClaude Opus 5.5 f4bd984fda docs(harnessx-removal): the plane replaces HarnessX in README, docs and specs (task 8)
README: "Configuring the HarnessX agentic plane" becomes "The agentic
plane (ax)" (ousast plane run|status|doctor|remember, per-task Model,
budget and egress, pointer to ops/ax/README.md, one tagged retirement
line); "The HarnessX self-improving cycle" becomes "The self-improving
cycle", and its MetaAgent paragraph is replaced by the memory proposer
(`ousast improve --memory`, provenance, train-on-test guard). The fusion
panel_model/decider_model lines and the [harnessx] spend caps are gone.
The README reference test now passes without its strict xfail.

docs/examples.md section 6 runs the plane; docs/threat-model.md describes
the per-task EgressPolicy, the usd/calls budgets and the start-request
credential path. RELEASE_NOTES.md gets an Unreleased entry: HarnessX
removed, the retired keys and their errors, the silent loss of the
second hunter for users who set [models] hunter, and the plane as the
agentic path.

Dated retirement notes (2026-09-30) head the requirements, design and
brief of harnessx-self-improving-rulesets, learning-harness,
three-stage-scan and openrouter-sast-harness, and follow the spec table
in steering/overview.md; history is unchanged. All tasks are checked, so
spec.json moves to implementation-complete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
2026-09-30 12:45:29 +02:00

52 lines
2.2 KiB
Python

"""Requirement 2.4 of the removal spec: the removed agentic plane is named only in its retirement notes.
A case-insensitive search of ``src/``, ``tests/``, ``pyproject.toml`` and the README may match only lines tagged
``retired 2026-..``: the retired-key table and the one warning in ``config.py``, the retirement tests, and the README's
plane section. The spec's own slug (its directory name, the equality instrument's file name) is a citation of the
removal, not a use of the plane, and is not counted. The pattern is built at runtime so this file does not match it.
"""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
_NAME = "harness" + "x"
_PATTERN = re.compile(_NAME, re.IGNORECASE)
_SPEC_SLUG = re.compile(_NAME + r"[-_]removal", re.IGNORECASE)
_TAG = re.compile(r"retired 2026-\d\d-\d\d", re.IGNORECASE)
def _untagged(paths: list[Path]) -> list[str]:
offenders = []
for path in paths:
try:
text = path.read_text(encoding="utf-8")
except (UnicodeDecodeError, OSError):
continue
for number, line in enumerate(text.splitlines(), 1):
if _PATTERN.search(_SPEC_SLUG.sub("", line)) and not _TAG.search(line):
offenders.append(f"{path.relative_to(ROOT)}:{number}: {line.strip()[:120]}")
return offenders
def _tree(*roots: str) -> list[Path]:
return sorted(p for root in roots for p in (ROOT / root).rglob("*") if p.is_file() and "__pycache__" not in p.parts)
def test_no_harnessx_outside_retirement_notes() -> None: # the Req 2.4 check itself, retired 2026-09-30
offenders = _untagged([*_tree("src", "tests"), ROOT / "pyproject.toml"])
assert offenders == [], "the removed plane is named outside a tagged retirement note:\n" + "\n".join(offenders)
def test_the_retirement_notes_exist() -> None:
"""The search is not vacuous: the one warning and the retired keys are where the design puts them."""
config = (ROOT / "src/openultrasast/config.py").read_text()
assert _PATTERN.search(config) and _TAG.search(config)
def test_the_readme_names_the_removed_plane_only_in_its_retirement_note() -> None:
offenders = _untagged([ROOT / "README.md"])
assert offenders == [], "\n".join(offenders)