diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 926478e0..ca105a93 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -141,6 +141,13 @@ jobs: python -m pip install -r dev-requirements.txt python -m pip install -e . --no-deps + # Unit-test conventions of WORKFLOW-LOCAL.md: placement, docstrings, + # and legacy files that only shrink against the PR's exact base. + - name: Check test conventions + env: + DEVCAPSULE_DIFF_BASE: ${{ github.event.pull_request.base.sha || 'origin/main' }} + run: python scripts/validate_unittests_follow_conventions.py + - name: Run tests with coverage run: >- python -m pytest tests/ diff --git a/CURRENT-STATUS.md b/CURRENT-STATUS.md index 07ec736c..5990e590 100644 --- a/CURRENT-STATUS.md +++ b/CURRENT-STATUS.md @@ -11,7 +11,7 @@ coordination branch. Detailed state belongs in each linked status file. |---|---|---|---|---|---| | `workflow-improvements` | 2026-08-09 | Improve the multiple-stream workflow from concrete dogfood findings during the recursive E2E cycle | active 2026-10-30; Pair Review Loop naming implemented and packaging verified for 0.3.0; mainline and release integration pending | `ws-workflow-improvements/v1` | [workstream status](engineering-docs/wip/2026-08-09-workflow-improvements/CURRENT-STATUS.md) | | `project-management` | 2026-08-09 | Maintain project-wide priorities, sequencing, dependencies, and lifecycle coordination | paused 2026-10-11 at owner direction; consent and forced configuration before RC work; remaining diagnostics/image scope and release cut decisions retained | `ws-project-management/coordination` | [workstream status](engineering-docs/wip/2026-08-09-project-management/CURRENT-STATUS.md) | -| `maintenance` | 2026-09-18 | Own the defects no open workstream covers, on `main` and on maintained release lines, and drive maintenance releases | integrating final acceptance 2026-10-31; PR #332 awaits owner merge; RC9 accepted; final publication authorized after main integration | `ws-maintenance/0.3.0-acceptance` for final acceptance delivery; `release-0.3.0`, the workstream's selection from the cut to the final tag; `ws-maintenance/session-logs` and `ws-maintenance/log-rotation` are merged and closed; owner-directed slice `ws-maintenance/ci-gating-030` merged via #312 and closed; synchronization review `ws-maintenance/0.3.0-main-sync` merged via #318 and closed; owner-requested preparation `ws-maintenance/0.3.0-rc9-preparation` merged through #329 and #331 | [workstream status](engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md) | +| `maintenance` | 2026-09-18 | Own the defects no open workstream covers, on `main` and on maintained release lines, and drive maintenance releases | active 2026-11-03; unit-test conventions slice, PR #335, awaits the owner's merge; 0.3.1 queue preserved | `ws-maintenance/test-conventions`; `ws-maintenance/0.3.1-preparation` carried into it; `release-0.3.0` closed and retained | [workstream status](engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md) | | `component-upgrades` | 2026-09-21 | Deliver component distribution channels, developer-owned version sets and proven upgrade rollback; Codex first | paused 2026-10-02; consent design ruled (D-0011 to D-0013), 0.2.16 consent slice next; R-UPGRADE-002 follow-up retained | `ws-component-upgrades/v1` | [workstream status](engineering-docs/wip/2026-09-21-component-upgrades/CURRENT-STATUS.md) | | `sample-projects` | 2026-08-14 | Provide realistic sample projects as submodules that demonstrate ordinary adopter development inside DevCapsule | integrating 2026-10-22; AI Learning published; PR #252 reviewed and ready for human merge | `ws-sample-projects/ai-learning` | [workstream status](engineering-docs/wip/2026-08-14-sample-projects/CURRENT-STATUS.md) | | `contained-display` | 2026-08-19 | Own the capsule supervisor core (container entry process, supervised children, explicit session end, headless mode) and the capsule's own display environment, closing the host-session credential exposure — supervisor first, display as its first consumer | active; **the contained display shipped in v0.2.12 on 2026-09-14** (recipe-9 base, contained desktop by default, X11 passthrough behind `host-x11`); the X11 credential bug is resolved; remaining threads are records and follow-ups (reconnect, WSL2 opener, sample locks) | `ws-contained-display/display-transport` | [workstream status](engineering-docs/wip/2026-08-19-contained-display/CURRENT-STATUS.md) | diff --git a/WORKFLOW-LOCAL-humane.md b/WORKFLOW-LOCAL-humane.md index 3e4c5fd3..436798b6 100644 --- a/WORKFLOW-LOCAL-humane.md +++ b/WORKFLOW-LOCAL-humane.md @@ -122,6 +122,38 @@ remark exists because a capsule's `/tmp` is a 2 GB tmpfs that the gate's scratch overflows, which cost a resumed session a failed gate before the cause was found. +## Unit Tests + +**Rule.** A unit test file is named after its module and mirrors the +package tree; a test is a precondition it establishes, one call to a public +operation, and a postcondition the unit promises; every test says in a +docstring what contract it tests; existing files are marked legacy and only +shrink, a touched test is fixed and moved; the gate checks what a machine +can check and the reviewer checks the rest. + +**Intended effect.** A reader sees which unit a test tests from its path +and what it tests from its first line. A test fails only when the unit +breaks its contract, never because a release moved, a lock was regenerated, +or the capsule that runs it has already accepted a vendor's terms. + +**Motivation.** On 2026-11-03 the gate failed eighteen tests in the owner's +own capsule. None was a bug. Thirteen read the owner's accepted trust +record through the launcher's mounted settings, because the isolation +fixture moved the home and the product's fallback did not know. Four +asserted the repository's own lock, byte for byte, down to the release +candidate that built the base. One scanned every file under `tests/` and +found a forbidden word inside a sample project's virtualenv. These tests +had been written by three different models under pair review, and the +reviewer had named one of them "the right test". A test that copies the +value it finds is a change detector, not a contract: both a bug and an +intentional change fail it, and the fix is always to update the string. +The triple forces the precondition into the open, which is exactly what +the thirteen had left to chance. The mirror makes the unit obvious before +the first line is read. The legacy marker turns 1525 existing tests into a +debt that is paid at the moment someone is already in the file, rather than +a rewrite nobody will order. The gate carries the mechanical part because a +rule an agent must read is a rule an agent can skim. + ## Reasoning And Code Navigation **Rule.** Start from the contract, state the uncertainty, navigate from the diff --git a/WORKFLOW-LOCAL.md b/WORKFLOW-LOCAL.md index 65501b34..2ca37231 100644 --- a/WORKFLOW-LOCAL.md +++ b/WORKFLOW-LOCAL.md @@ -155,6 +155,43 @@ in [`INFORMATION-MODEL.md`](devcapsule-src/devcapsule/assets/project_workflow/de end-to-end suites are not in it. The [developer brief](DEVELOPING.md) says when they run. +## Unit Tests + +Owner direction, 2026-11-03, after eighteen tests failed in the owner's +capsule for reasons that were not bugs. + +1. A unit test file mirrors the module it tests: + `tests/unit//test_.py` tests `/.py` or + `/_.py` under `devcapsule-src`. The unit under test is that + module. A test of a heavier suite lives outside the mirror and carries + that suite's marker at module level. +2. A test is a Hoare triple. It establishes its precondition in its own + fixtures or asserts it first; a precondition inherited from the + repository's checkout, the host or the capsule that runs the test is not + a precondition. It performs one action: a call to one public operation + of the unit, or the raise it expects. It verifies a postcondition the + unit promises, never a value copied from a run. Release identifiers, + version strings and digests are not assertions of the unit suite. +3. Every test function has a docstring stating, in plain English, the + contract or the part of it under test. One line is enough when the body + is already plain; the reviewer decides that, not the author. +4. A unit with no declared public surface is not testable under rule 2 + until it declares one: `__all__`, or a module docstring that names the + public operations and leaves the rest private. +5. Existing test files carry `pytestmark = pytest.mark.legacy`. A legacy + file only loses test functions. A test function you change is brought + to rules 1 to 3 and moved to the mirror. A legacy test broken by a + legitimate change is fixed or replaced by a conforming one, never marked + expected to fail or deselected. No marker but `legacy` is added to a + legacy file. +6. The gate holds rules 1, 3 and 5: `scripts/validate_unittests_follow_conventions.py` runs in + the `tests` and `build` sessions and in `tests.yml`, comparing legacy + files with the pull request's base. Its summary line counts the legacy + files and tests; the count goes down and never up. +7. In a Pair Review Loop, the brief instructs the reviewer to verify rules + 1 to 4 on every new or changed test, and to name for each what would + make it fail for a reason that is not a bug. + ## Reasoning And Code Navigation 1. Start with the behavior's contract: ownership, inputs, preconditions, @@ -376,6 +413,8 @@ of `WORKFLOW.md`, in this checkout. the chat or the terminal of that session: at least when the partner starts, at each commit or gate it makes, and when it ends. The partner's own log is evidence, not a report. +9. Owner direction, 2026-11-03. The brief carries the reviewer's duty under + *Unit Tests*, rule 7, for every loop. ## Commit Authorship diff --git a/devcapsule-src/noxfile.py b/devcapsule-src/noxfile.py index 5f28d5e4..eca38273 100644 --- a/devcapsule-src/noxfile.py +++ b/devcapsule-src/noxfile.py @@ -52,6 +52,11 @@ def run_tests(session: nox.Session) -> None: session.run("python", "-m", "pytest", str(PROJECT_ROOT / "tests")) +def check_test_conventions(session: nox.Session) -> None: + """Hold the suite to *Unit Tests* in WORKFLOW-LOCAL.md; legacy files are compared with the diff base.""" + session.run("python", str(PROJECT_ROOT / "scripts" / "validate_unittests_follow_conventions.py")) + + def run_packaging_tests(session: nox.Session) -> None: session.run( "python", @@ -170,6 +175,7 @@ def run_typecheck(session: nox.Session) -> None: str(PROJECT_ROOT / "noxfile.py"), str(VERSION_SCRIPT), str(PROJECT_ROOT / "scripts" / "release-manifest.py"), + str(PROJECT_ROOT / "scripts" / "validate_unittests_follow_conventions.py"), str(PROJECT_ROOT / "scripts" / "release-protocol.py"), str(PROJECT_ROOT / "scripts" / "prepare-promotion.py"), ) @@ -357,6 +363,7 @@ def bump_version(session: nox.Session) -> None: def tests(session: nox.Session) -> None: install_locked(session) check_python_syntax(session) + check_test_conventions(session) run_tests(session) @@ -534,6 +541,7 @@ def build(session: nox.Session) -> None: check_python_syntax(session) check_shell_syntax(session) run_typecheck(session) + check_test_conventions(session) run_tests(session) run_smoke(session) build_test_pex(session) diff --git a/devcapsule-src/pyproject.toml b/devcapsule-src/pyproject.toml index 42f45b31..fd007a5c 100644 --- a/devcapsule-src/pyproject.toml +++ b/devcapsule-src/pyproject.toml @@ -94,6 +94,7 @@ markers = [ "contributor_e2e: launches a clean contributor container from a host or recursive capsule", "ide_smoke: launches a real IDE session per surface with the executable under test; opt-in through nox -s ide-smoke", "flaky: executes for visibility but has a temporarily non-blocking result", + "legacy: predates the unit-test conventions of WORKFLOW-LOCAL.md; the file only loses tests, see scripts/validate_unittests_follow_conventions.py", ] [tool.coverage.run] @@ -106,7 +107,7 @@ skip_covered = true [tool.mypy] python_version = "3.12" -files = ["devcapsule", "tests", "noxfile.py", "scripts/bump-version.py", "scripts/release-manifest.py", "scripts/ci_gate.py", "scripts/diff_coverage_annotations.py"] +files = ["devcapsule", "tests", "noxfile.py", "scripts/bump-version.py", "scripts/release-manifest.py", "scripts/ci_gate.py", "scripts/diff_coverage_annotations.py", "scripts/validate_unittests_follow_conventions.py"] # Sample projects are independent submodules with their own dependencies. They # are checked by their own tooling, not by DevCapsule's gate. exclude = "(^|/)tests/resources/sample_projects/" diff --git a/devcapsule-src/scripts/validate_unittests_follow_conventions.py b/devcapsule-src/scripts/validate_unittests_follow_conventions.py new file mode 100644 index 00000000..b1ef40fd --- /dev/null +++ b/devcapsule-src/scripts/validate_unittests_follow_conventions.py @@ -0,0 +1,231 @@ +"""Check the unit-test conventions that *Unit Tests* in WORKFLOW-LOCAL.md states. + +Run from ``devcapsule-src``:: + + python scripts/validate_unittests_follow_conventions.py [--base REF] + +The checks, in the order the section states its rules: + +1. **Placement.** A test file that is not legacy mirrors the module it + tests: ``tests/unit//test_.py`` tests ``/.py`` or + ``/_.py``, the path relative to ``devcapsule-src``. A file + outside the mirror that is not legacy must carry the marker of a heavier + suite at module level, since it is then not a unit test. +2. **Docstrings.** Every test function in a file that is not legacy has a + docstring. +3. **Legacy files only shrink.** A legacy file, one whose module-level + ``pytestmark`` includes ``legacy``, is compared with the base revision: + no test function is added, no test function's source changes, and no + marker is added. A legacy file the base does not have is refused. + +The base revision is ``--base``, else ``DEVCAPSULE_DIFF_BASE``, else +``origin/main``, compared at its merge base with ``HEAD``. The exit status +is 1 when any rule is broken, with one line per breach, and the summary +names how many legacy files and functions remain. +""" +from __future__ import annotations + +import argparse +import ast +import os +import subprocess +import sys +from dataclasses import dataclass, field +from pathlib import Path + +__all__ = ["TestModule", "parse_module", "mirrored_module", "check", "main"] + +LEGACY_MARKER = "legacy" +"""The module-level marker that exempts a file from rules 1 and 2 and subjects it to rule 3.""" + +HEAVIER_SUITE_MARKERS = frozenset({ + "integration", "e2e", "recursive_e2e", "contributor_e2e", "ide_smoke", "base_build_e2e", +}) +"""Markers of the suites that are not unit tests; a file carrying one may live outside the mirror.""" + +UNIT_MIRROR = Path("tests") / "unit" +"""The directory that mirrors ``devcapsule-src`` for unit tests.""" + +_EXCLUDED_PARTS = frozenset({"resources", "sample_projects"}) + + +@dataclass(frozen=True) +class TestModule: + """What the checker needs to know about one test file.""" + + path: Path + """Relative to ``devcapsule-src``.""" + markers: frozenset[str] + """Marker names in the module-level ``pytestmark``.""" + functions: dict[str, str] = field(default_factory=dict) + """Qualified test function name to its source, decorators included, lines right-stripped.""" + undocumented: tuple[tuple[str, int], ...] = () + """Test functions without a docstring, with the line of their ``def``.""" + + @property + def legacy(self) -> bool: + return LEGACY_MARKER in self.markers + + +def parse_module(path: Path, source: str) -> TestModule: + """Read the markers and test functions of one test file from its source.""" + tree = ast.parse(source, filename=str(path)) + lines = source.splitlines() + functions: dict[str, str] = {} + undocumented: list[tuple[str, int]] = [] + for qualified, node in _test_functions(tree): + start = min([node.lineno, *(decorator.lineno for decorator in node.decorator_list)]) + end = node.end_lineno or node.lineno + functions[qualified] = "\n".join(line.rstrip() for line in lines[start - 1:end]) + if not ast.get_docstring(node): + undocumented.append((qualified, node.lineno)) + return TestModule(path, frozenset(_module_markers(tree)), functions, tuple(undocumented)) + + +def _test_functions(tree: ast.Module) -> list[tuple[str, ast.FunctionDef | ast.AsyncFunctionDef]]: + found: list[tuple[str, ast.FunctionDef | ast.AsyncFunctionDef]] = [] + for node in tree.body: + if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)) and node.name.startswith("test"): + found.append((node.name, node)) + elif isinstance(node, ast.ClassDef) and node.name.startswith("Test"): + for member in node.body: + if isinstance(member, (ast.FunctionDef, ast.AsyncFunctionDef)) and member.name.startswith("test"): + found.append((f"{node.name}.{member.name}", member)) + return found + + +def _module_markers(tree: ast.Module) -> set[str]: + """The names in ``pytestmark = pytest.mark.x`` or ``pytestmark = [pytest.mark.x, ...]``.""" + names: set[str] = set() + for node in tree.body: + if not isinstance(node, ast.Assign): + continue + if not any(isinstance(target, ast.Name) and target.id == "pytestmark" for target in node.targets): + continue + values = node.value.elts if isinstance(node.value, (ast.List, ast.Tuple)) else [node.value] + for value in values: + name = _marker_name(value) + if name is not None: + names.add(name) + return names + + +def _marker_name(value: ast.expr) -> str | None: + if isinstance(value, ast.Call): + value = value.func + if (isinstance(value, ast.Attribute) and isinstance(value.value, ast.Attribute) + and value.value.attr == "mark" and isinstance(value.value.value, ast.Name) + and value.value.value.id == "pytest"): + return value.attr + return None + + +def mirrored_module(test_path: Path, project_root: Path) -> Path | None: + """The module ``tests/unit//test_.py`` tests, or None when there is none. + + ``/.py`` is preferred; ``/_.py`` lets a private + module keep its underscore without the test file doubling it. + """ + try: + relative = test_path.relative_to(UNIT_MIRROR) + except ValueError: + return None + if not relative.name.startswith("test_"): + return None + name = relative.name[len("test_"):] + for candidate in (relative.with_name(name), relative.with_name(f"_{name}")): + if (project_root / candidate).is_file(): + return candidate + return None + + +def check(modules: list[TestModule], base: dict[Path, TestModule | None], project_root: Path) -> list[str]: + """All breaches, one line each, for the given files against their base versions. + + ``base`` maps each legacy file's path to its parsed base version, or to + None when the base revision does not have the file. + """ + breaches: list[str] = [] + for module in modules: + if module.legacy: + breaches.extend(_check_legacy(module, base.get(module.path))) + continue + breaches.extend(_check_placement(module, project_root)) + for name, line in module.undocumented: + breaches.append(f"{module.path}:{line}: {name} has no docstring stating its contract") + return breaches + + +def _check_placement(module: TestModule, project_root: Path) -> list[str]: + if module.path.is_relative_to(UNIT_MIRROR): + if mirrored_module(module.path, project_root) is None: + return [f"{module.path}: no module under devcapsule-src is mirrored by this file name"] + return [] + if module.markers & HEAVIER_SUITE_MARKERS: + return [] + return [f"{module.path}: a unit test file lives under {UNIT_MIRROR}, named after its module; " + "a heavier suite's file carries that suite's marker at module level"] + + +def _check_legacy(module: TestModule, base: TestModule | None) -> list[str]: + if base is None: + return [f"{module.path}: marked legacy but the base revision has no such file; new tests follow the convention"] + breaches: list[str] = [] + for name, source in module.functions.items(): + if name not in base.functions: + breaches.append(f"{module.path}: {name} was added to a legacy file; put it in the mirror") + elif source != base.functions[name]: + breaches.append(f"{module.path}: {name} changed in a legacy file; fix it to the convention and move it to the mirror") + for marker in sorted(module.markers - base.markers - {LEGACY_MARKER}): + breaches.append(f"{module.path}: marker {marker!r} was added to a legacy file") + return breaches + + +def _test_files(project_root: Path) -> list[Path]: + return sorted( + path.relative_to(project_root) + for path in (project_root / "tests").rglob("test_*.py") + if not _EXCLUDED_PARTS & set(path.parts) + ) + + +def _git(project_root: Path, *arguments: str) -> str: + return subprocess.run(["git", *arguments], cwd=project_root, check=True, capture_output=True, text=True).stdout + + +def _base_version(project_root: Path, merge_base: str, path: Path) -> TestModule | None: + prefix = _git(project_root, "rev-parse", "--show-prefix").strip() + completed = subprocess.run( + ["git", "show", f"{merge_base}:{prefix}{path.as_posix()}"], + cwd=project_root, capture_output=True, text=True, + ) + if completed.returncode != 0: + return None + return parse_module(path, completed.stdout) + + +def main(argv: list[str] | None = None) -> int: + parser = argparse.ArgumentParser(description=__doc__.split("\n\n", 1)[0]) + parser.add_argument("--base", default=os.environ.get("DEVCAPSULE_DIFF_BASE") or "origin/main", + help="the revision legacy files are compared with, at its merge base with HEAD") + parser.add_argument("--project-root", type=Path, default=Path.cwd(), help="devcapsule-src") + arguments = parser.parse_args(argv) + root: Path = arguments.project_root.resolve() + try: + merge_base = _git(root, "merge-base", arguments.base, "HEAD").strip() + except subprocess.CalledProcessError as error: + print(f"test conventions: cannot resolve base {arguments.base!r}: {error.stderr.strip()}", file=sys.stderr) + return 1 + modules = [parse_module(path, (root / path).read_text(encoding="utf-8")) for path in _test_files(root)] + base = {module.path: _base_version(root, merge_base, module.path) for module in modules if module.legacy} + breaches = check(modules, base, root) + for breach in breaches: + print(breach, file=sys.stderr) + legacy = [module for module in modules if module.legacy] + print(f"test conventions: {len(legacy)} legacy files holding {sum(len(m.functions) for m in legacy)} legacy tests; " + f"{len(modules) - len(legacy)} files follow the convention; {len(breaches)} breaches") + return 1 if breaches else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/devcapsule-src/tests/configuration/test_adt.py b/devcapsule-src/tests/configuration/test_adt.py index b231831e..fcc6288c 100644 --- a/devcapsule-src/tests/configuration/test_adt.py +++ b/devcapsule-src/tests/configuration/test_adt.py @@ -13,6 +13,8 @@ from devcapsule.configuration import Configuration, Resolution, HostAccess, ProjectConfigurationError from devcapsule.configuration.file_formats import canonical_digest +pytestmark = pytest.mark.legacy + @pytest.fixture def predecessor_documents(): diff --git a/devcapsule-src/tests/configuration/test_architecture.py b/devcapsule-src/tests/configuration/test_architecture.py index 12965598..d8179043 100644 --- a/devcapsule-src/tests/configuration/test_architecture.py +++ b/devcapsule-src/tests/configuration/test_architecture.py @@ -3,6 +3,9 @@ from pathlib import Path from devcapsule import configuration +import pytest + +pytestmark = pytest.mark.legacy PACKAGE = "devcapsule.configuration" diff --git a/devcapsule-src/tests/configuration/test_contract.py b/devcapsule-src/tests/configuration/test_contract.py index 4d4d185b..74d1b78c 100644 --- a/devcapsule-src/tests/configuration/test_contract.py +++ b/devcapsule-src/tests/configuration/test_contract.py @@ -46,6 +46,8 @@ from devcapsule.launch.pycharm import DockerMode, PycharmRunOptions, build_run_config from tests.test_pycharm import base_env +pytestmark = pytest.mark.legacy + def declare_values(project, extra=''): path = project / '.devcapsule/devcapsule.toml' diff --git a/devcapsule-src/tests/configuration/test_history.py b/devcapsule-src/tests/configuration/test_history.py index 975c6fb9..5368c6d9 100644 --- a/devcapsule-src/tests/configuration/test_history.py +++ b/devcapsule-src/tests/configuration/test_history.py @@ -10,6 +10,9 @@ history_directory, record_known_good_configuration, ) +import pytest + +pytestmark = pytest.mark.legacy MANIFEST = { diff --git a/devcapsule-src/tests/configuration/test_invariants.py b/devcapsule-src/tests/configuration/test_invariants.py index c7d0e78e..b598cc45 100644 --- a/devcapsule-src/tests/configuration/test_invariants.py +++ b/devcapsule-src/tests/configuration/test_invariants.py @@ -46,6 +46,8 @@ from tests.test_pycharm import base_env from tests.test_upgrade_recovery import checkout, invoke, install_external_fakes +pytestmark = pytest.mark.legacy + def replace_document(path, edit): document = load_toml(path) diff --git a/devcapsule-src/tests/configuration/test_nodes.py b/devcapsule-src/tests/configuration/test_nodes.py index 8cd39d1f..4a1ac13d 100644 --- a/devcapsule-src/tests/configuration/test_nodes.py +++ b/devcapsule-src/tests/configuration/test_nodes.py @@ -16,6 +16,8 @@ ProjectConfigurationError, ) +pytestmark = pytest.mark.legacy + def example_manifest() -> dict: return { diff --git a/devcapsule-src/tests/e2e/test_built_base.py b/devcapsule-src/tests/e2e/test_built_base.py index a480e2e7..02c5911a 100644 --- a/devcapsule-src/tests/e2e/test_built_base.py +++ b/devcapsule-src/tests/e2e/test_built_base.py @@ -7,6 +7,8 @@ import pytest +pytestmark = pytest.mark.legacy + @pytest.mark.e2e @pytest.mark.base_build_e2e diff --git a/devcapsule-src/tests/e2e/test_component_cache.py b/devcapsule-src/tests/e2e/test_component_cache.py index 02b23048..e75aa1dc 100644 --- a/devcapsule-src/tests/e2e/test_component_cache.py +++ b/devcapsule-src/tests/e2e/test_component_cache.py @@ -21,6 +21,8 @@ from devcapsule.materialization import ArtifactSpec, ensure_materialized_surface from devcapsule.runtime_command import RuntimeCommand +pytestmark = pytest.mark.legacy + def docker(*args: str) -> str: completed = subprocess.run(["docker", *args], check=False, text=True, capture_output=True) diff --git a/devcapsule-src/tests/e2e/test_concurrent_auth.py b/devcapsule-src/tests/e2e/test_concurrent_auth.py index 42a5bb75..6cddfe6e 100644 --- a/devcapsule-src/tests/e2e/test_concurrent_auth.py +++ b/devcapsule-src/tests/e2e/test_concurrent_auth.py @@ -17,6 +17,8 @@ from tests.e2e.ide_session import SURFACES, command, ide_session, wait_for_console_url, wait_for_ide_window +pytestmark = pytest.mark.legacy + def connected(page: Any) -> None: page.evaluate("async () => { window.authSmokeUI = (await import('/app/ui.js')).default; }") diff --git a/devcapsule-src/tests/e2e/test_console_answers.py b/devcapsule-src/tests/e2e/test_console_answers.py index 5ba1a806..bbb8e222 100644 --- a/devcapsule-src/tests/e2e/test_console_answers.py +++ b/devcapsule-src/tests/e2e/test_console_answers.py @@ -25,6 +25,8 @@ from devcapsule.host_daemon import current_container, requires_translation, translate_bind_sources from tests.e2e.ide_session import SURFACES, command, ide_session, wait_for_console_url, workspace_root +pytestmark = pytest.mark.legacy + EVIDENCE_ROOT = Path(__file__).resolve().parents[2] / "dist" / "e2e-evidence" / "console-smoke" SURFACE = next(surface for surface in SURFACES if surface.name == "codium") diff --git a/devcapsule-src/tests/e2e/test_contributor_bootstrap.py b/devcapsule-src/tests/e2e/test_contributor_bootstrap.py index 302ecdaf..297e49f8 100644 --- a/devcapsule-src/tests/e2e/test_contributor_bootstrap.py +++ b/devcapsule-src/tests/e2e/test_contributor_bootstrap.py @@ -37,6 +37,8 @@ ) from tests.e2e.test_recursive_local_clone import LocalCloneProtocol, OwnedWorkspace +pytestmark = pytest.mark.legacy + REPO_ROOT = Path(__file__).resolve().parents[3] PLATFORM_LOCK = REPO_ROOT / ".devcapsule/devcapsule.linux-amd64.lock" diff --git a/devcapsule-src/tests/e2e/test_ide_comes_alive.py b/devcapsule-src/tests/e2e/test_ide_comes_alive.py index acd85cdd..01a65a59 100644 --- a/devcapsule-src/tests/e2e/test_ide_comes_alive.py +++ b/devcapsule-src/tests/e2e/test_ide_comes_alive.py @@ -20,6 +20,8 @@ from tests.e2e.ide_session import SURFACES, IdeSurface, capture_desktop, command, desktop_page_answers, ide_session, launched_ide, stop_session, wait_for_console_url, wait_for_ide_window +pytestmark = pytest.mark.legacy + EVIDENCE_ROOT = Path(__file__).resolve().parents[2] / "dist" / "e2e-evidence" / "ide-smoke" diff --git a/devcapsule-src/tests/e2e/test_interrupted_launch.py b/devcapsule-src/tests/e2e/test_interrupted_launch.py index 32b84bae..7cffab5c 100644 --- a/devcapsule-src/tests/e2e/test_interrupted_launch.py +++ b/devcapsule-src/tests/e2e/test_interrupted_launch.py @@ -32,6 +32,8 @@ workspace_root, ) +pytestmark = pytest.mark.legacy + EVIDENCE_ROOT = Path(__file__).resolve().parents[2] / "dist" / "e2e-evidence" / "ide-smoke" CODIUM = next(surface for surface in SURFACES if surface.name == "codium") EXIT_TIMEOUT = 120.0 diff --git a/devcapsule-src/tests/e2e/test_recursive_local_clone.py b/devcapsule-src/tests/e2e/test_recursive_local_clone.py index 7e56513a..5d17f47f 100644 --- a/devcapsule-src/tests/e2e/test_recursive_local_clone.py +++ b/devcapsule-src/tests/e2e/test_recursive_local_clone.py @@ -22,6 +22,8 @@ import pytest +pytestmark = pytest.mark.legacy + EMBEDDED_PEX = Path("/opt/devcapsule/bin/devcapsule.pex") OWNER_MARKER = ".devcapsule-e2e-owner.json" diff --git a/devcapsule-src/tests/e2e/test_recursive_successor_attached_launch.py b/devcapsule-src/tests/e2e/test_recursive_successor_attached_launch.py index b882c25d..dd433573 100644 --- a/devcapsule-src/tests/e2e/test_recursive_successor_attached_launch.py +++ b/devcapsule-src/tests/e2e/test_recursive_successor_attached_launch.py @@ -38,6 +38,8 @@ from tests.e2e.fresh_workspace import FreshWorkspace +pytestmark = pytest.mark.legacy + REPO_ROOT = Path(__file__).resolve().parents[3] # Realizing the environment may build the formation on first use. RUNNING_TIMEOUT = 900.0 diff --git a/devcapsule-src/tests/e2e/test_recursive_successor_lifecycle.py b/devcapsule-src/tests/e2e/test_recursive_successor_lifecycle.py index 0710f399..d4145d6f 100644 --- a/devcapsule-src/tests/e2e/test_recursive_successor_lifecycle.py +++ b/devcapsule-src/tests/e2e/test_recursive_successor_lifecycle.py @@ -21,6 +21,8 @@ ) from devcapsule.recursive_successor_plan import ExpectedSuccessorPlan +pytestmark = pytest.mark.legacy + REPO_ROOT = Path(__file__).resolve().parents[3] SOURCE_REVISION = "0" * 40 diff --git a/devcapsule-src/tests/e2e/test_required_ide_override.py b/devcapsule-src/tests/e2e/test_required_ide_override.py index c68594b0..d8d1dcda 100644 --- a/devcapsule-src/tests/e2e/test_required_ide_override.py +++ b/devcapsule-src/tests/e2e/test_required_ide_override.py @@ -28,6 +28,8 @@ wait_for_ide_window, workspace_root, ) +pytestmark = pytest.mark.legacy + EVIDENCE_ROOT = Path(__file__).resolve().parents[2] / "dist" / "e2e-evidence" / "ide-smoke" REQUIRED = next(surface for surface in SURFACES if surface.name == "pycharm") ALTERNATE = next(surface for surface in SURFACES if surface.name == "codium") diff --git a/devcapsule-src/tests/e2e/test_runtime_image.py b/devcapsule-src/tests/e2e/test_runtime_image.py index aace44b2..a32b4fb6 100644 --- a/devcapsule-src/tests/e2e/test_runtime_image.py +++ b/devcapsule-src/tests/e2e/test_runtime_image.py @@ -23,6 +23,8 @@ from devcapsule.images.build import render_build_context from devcapsule.materialization import ArtifactSpec, ImageDetails, ensure_materialized_surface +pytestmark = pytest.mark.legacy + DEFAULT_BASE_IMAGE = str(tomllib.loads( (Path(__file__).resolve().parents[3] / ".devcapsule/devcapsule.linux-amd64.lock").read_text() )["base"]["reference"]) diff --git a/devcapsule-src/tests/e2e/test_self_contained_pex.py b/devcapsule-src/tests/e2e/test_self_contained_pex.py index 6e16a57e..ac71ed4d 100644 --- a/devcapsule-src/tests/e2e/test_self_contained_pex.py +++ b/devcapsule-src/tests/e2e/test_self_contained_pex.py @@ -10,6 +10,8 @@ import tomllib +pytestmark = pytest.mark.legacy + # CI supplies the tag-derived version; local builds use the source baseline. PACKAGE_VERSION = os.environ.get("DEVCAPSULE_EXPECTED_RELEASE_VERSION") or tomllib.loads( (Path(__file__).resolve().parents[2] / "pyproject.toml").read_text( diff --git a/devcapsule-src/tests/e2e/test_session_diagnostics.py b/devcapsule-src/tests/e2e/test_session_diagnostics.py index db935ace..5c8cc5f1 100644 --- a/devcapsule-src/tests/e2e/test_session_diagnostics.py +++ b/devcapsule-src/tests/e2e/test_session_diagnostics.py @@ -34,6 +34,8 @@ workspace_root, ) +pytestmark = pytest.mark.legacy + EVIDENCE_ROOT = Path(__file__).resolve().parents[2] / "dist" / "e2e-evidence" / "diagnostics" CODIUM = next(surface for surface in SURFACES if surface.name == "codium") EXIT_TIMEOUT = 120.0 diff --git a/devcapsule-src/tests/integration/test_pex_runtime.py b/devcapsule-src/tests/integration/test_pex_runtime.py index 7048944c..ea58999e 100644 --- a/devcapsule-src/tests/integration/test_pex_runtime.py +++ b/devcapsule-src/tests/integration/test_pex_runtime.py @@ -15,6 +15,8 @@ import tomllib from devcapsule.host_open import HOST_OPEN_SOCKET_ENV, HostOpenBroker +pytestmark = pytest.mark.legacy + # The artifact under test is built from this tree, so compare against the # authored version, not installed metadata an editable install may have frozen. PACKAGE_VERSION = os.environ.get("DEVCAPSULE_EXPECTED_RELEASE_VERSION") or tomllib.loads( diff --git a/devcapsule-src/tests/integration/test_webconsole_install.py b/devcapsule-src/tests/integration/test_webconsole_install.py index 0a1bdc08..178b7fb4 100644 --- a/devcapsule-src/tests/integration/test_webconsole_install.py +++ b/devcapsule-src/tests/integration/test_webconsole_install.py @@ -11,6 +11,8 @@ from devcapsule.images import tooling +pytestmark = pytest.mark.legacy + @pytest.mark.integration @pytest.mark.parametrize("failure", ["", "revision", "runtime-lock", "build-lock", "package", "import", "help"]) diff --git a/devcapsule-src/tests/test_antigravity_cli_component.py b/devcapsule-src/tests/test_antigravity_cli_component.py index 06e9671d..146a84fc 100644 --- a/devcapsule-src/tests/test_antigravity_cli_component.py +++ b/devcapsule-src/tests/test_antigravity_cli_component.py @@ -12,6 +12,9 @@ AntigravityCliComponent, runtime_template, ) +import pytest + +pytestmark = pytest.mark.legacy def locked_metadata() -> dict[str, object]: diff --git a/devcapsule-src/tests/test_base_contract.py b/devcapsule-src/tests/test_base_contract.py index d77bd659..999d0c79 100644 --- a/devcapsule-src/tests/test_base_contract.py +++ b/devcapsule-src/tests/test_base_contract.py @@ -24,6 +24,8 @@ from devcapsule.configuration.authorization import authorization_declarations from devcapsule.resolution_matrix import MATRICES, compatibility_report, known_base_image +pytestmark = pytest.mark.legacy + REPO_ROOT = Path(__file__).resolve().parents[2] REPO_LOCK = REPO_ROOT / ".devcapsule" / "devcapsule.linux-amd64.lock" REPO_MANIFEST = REPO_ROOT / ".devcapsule" / "devcapsule.toml" diff --git a/devcapsule-src/tests/test_base_image.py b/devcapsule-src/tests/test_base_image.py index a68b6a17..c17f548f 100644 --- a/devcapsule-src/tests/test_base_image.py +++ b/devcapsule-src/tests/test_base_image.py @@ -21,6 +21,8 @@ from devcapsule.images.build import render_build_context from devcapsule.images.tooling import MAVEN_VERSION, TEMURIN_VERSION +pytestmark = pytest.mark.legacy + def pex_fixture( path: Path, diff --git a/devcapsule-src/tests/test_browser_components.py b/devcapsule-src/tests/test_browser_components.py index 53fd197e..334fd70c 100644 --- a/devcapsule-src/tests/test_browser_components.py +++ b/devcapsule-src/tests/test_browser_components.py @@ -16,6 +16,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + def test_intellij_selects_its_own_surface_and_browser() -> None: lock = tomllib.loads(MATRICES[Platform.LINUX_AMD64].resolve(["java-ide", "java", "browser-automation"]).render_lock()) diff --git a/devcapsule-src/tests/test_build_info.py b/devcapsule-src/tests/test_build_info.py index 46f3c7de..03d41792 100644 --- a/devcapsule-src/tests/test_build_info.py +++ b/devcapsule-src/tests/test_build_info.py @@ -12,6 +12,8 @@ from devcapsule import cli from devcapsule.build_info import BuildInfo, BuildInfoError, current_build_info, read_pex_build_info +pytestmark = pytest.mark.legacy + def test_public_build_identity_requires_canonical_github_commit_url() -> None: revision = "a" * 40 diff --git a/devcapsule-src/tests/test_capability_commands_v2.py b/devcapsule-src/tests/test_capability_commands_v2.py index 4dddf088..c10f5e2c 100644 --- a/devcapsule-src/tests/test_capability_commands_v2.py +++ b/devcapsule-src/tests/test_capability_commands_v2.py @@ -28,6 +28,8 @@ from devcapsule.resolution_matrix import MATRICES, Capability from tests.test_run_flow import project, config, record +pytestmark = pytest.mark.legacy + @pytest.fixture def matrix(monkeypatch): diff --git a/devcapsule-src/tests/test_capability_minimums.py b/devcapsule-src/tests/test_capability_minimums.py index 7164c9d1..b0ab2a4b 100644 --- a/devcapsule-src/tests/test_capability_minimums.py +++ b/devcapsule-src/tests/test_capability_minimums.py @@ -21,6 +21,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import Capability, MATRICES, ResolutionMatrix, _BasePin, _ComponentPin, _VerifiedEdge +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] GOLDEN = Path(__file__).parent / "resources" / "golden_locks" MANIFEST = '''devcapsule-schema-version = 2 diff --git a/devcapsule-src/tests/test_capability_policy.py b/devcapsule-src/tests/test_capability_policy.py index 835cf5f6..d5b21f4a 100644 --- a/devcapsule-src/tests/test_capability_policy.py +++ b/devcapsule-src/tests/test_capability_policy.py @@ -24,6 +24,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] diff --git a/devcapsule-src/tests/test_checkout_commands.py b/devcapsule-src/tests/test_checkout_commands.py index 9d10789d..8b1e5d71 100644 --- a/devcapsule-src/tests/test_checkout_commands.py +++ b/devcapsule-src/tests/test_checkout_commands.py @@ -17,6 +17,8 @@ from devcapsule.configuration.docker_arguments import arguments_path, read_arguments from devcapsule.configuration.capability_commands import paths +pytestmark = pytest.mark.legacy + @pytest.fixture def project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: diff --git a/devcapsule-src/tests/test_checkout_environment.py b/devcapsule-src/tests/test_checkout_environment.py index 447d1113..af36bcac 100644 --- a/devcapsule-src/tests/test_checkout_environment.py +++ b/devcapsule-src/tests/test_checkout_environment.py @@ -19,6 +19,8 @@ from devcapsule.materialization import parse_locked_environment from tests.test_project_commands import initialize_project, initialize_codium_project, LOCKED_BASE +pytestmark = pytest.mark.legacy + @pytest.fixture def project(tmp_path: Path) -> Path: root = tmp_path / "project" diff --git a/devcapsule-src/tests/test_ci_reporting.py b/devcapsule-src/tests/test_ci_reporting.py index e147ae19..1f394b73 100644 --- a/devcapsule-src/tests/test_ci_reporting.py +++ b/devcapsule-src/tests/test_ci_reporting.py @@ -13,6 +13,8 @@ import pytest import yaml +pytestmark = pytest.mark.legacy + ROOT = Path(__file__).parents[2] diff --git a/devcapsule-src/tests/test_claude_code_component.py b/devcapsule-src/tests/test_claude_code_component.py index 9e798985..33557826 100644 --- a/devcapsule-src/tests/test_claude_code_component.py +++ b/devcapsule-src/tests/test_claude_code_component.py @@ -11,6 +11,9 @@ ClaudeCodeComponent, runtime_template, ) +import pytest + +pytestmark = pytest.mark.legacy def locked_metadata() -> dict[str, object]: diff --git a/devcapsule-src/tests/test_cli.py b/devcapsule-src/tests/test_cli.py index e5957bd0..8da2fa6b 100644 --- a/devcapsule-src/tests/test_cli.py +++ b/devcapsule-src/tests/test_cli.py @@ -21,6 +21,8 @@ canonical_digest, ) +pytestmark = pytest.mark.legacy + def test_top_level_help_returns_success(capsys) -> None: result = cli.main(["--help"]) diff --git a/devcapsule-src/tests/test_codex_component.py b/devcapsule-src/tests/test_codex_component.py index 9f5c007e..b290557e 100644 --- a/devcapsule-src/tests/test_codex_component.py +++ b/devcapsule-src/tests/test_codex_component.py @@ -23,6 +23,8 @@ configuration_binding_declarations, ) +pytestmark = pytest.mark.legacy + def locked_components() -> dict[str, object]: return { diff --git a/devcapsule-src/tests/test_codium_component.py b/devcapsule-src/tests/test_codium_component.py index 2d9156fe..c3e3eb40 100644 --- a/devcapsule-src/tests/test_codium_component.py +++ b/devcapsule-src/tests/test_codium_component.py @@ -20,6 +20,8 @@ RuntimePlanError, ) +pytestmark = pytest.mark.legacy + def component_runtime() -> RuntimePlan: return RuntimePlan.for_component( diff --git a/devcapsule-src/tests/test_command_framework.py b/devcapsule-src/tests/test_command_framework.py index 9b996145..29a227c5 100644 --- a/devcapsule-src/tests/test_command_framework.py +++ b/devcapsule-src/tests/test_command_framework.py @@ -18,6 +18,8 @@ carrier_answers, ) +pytestmark = pytest.mark.legacy + class _Echo(Command): name = "echo" diff --git a/devcapsule-src/tests/test_command_output.py b/devcapsule-src/tests/test_command_output.py index 8cb47732..e4a2f8ea 100644 --- a/devcapsule-src/tests/test_command_output.py +++ b/devcapsule-src/tests/test_command_output.py @@ -9,6 +9,8 @@ from devcapsule.launch.command_output import preparation_diagnostics, render_command +pytestmark = pytest.mark.legacy + def test_shell_rendering_preserves_arguments_without_evaluating_them(tmp_path): marker = tmp_path / 'must-not-exist' diff --git a/devcapsule-src/tests/test_component_status.py b/devcapsule-src/tests/test_component_status.py index 6cee5389..67167161 100644 --- a/devcapsule-src/tests/test_component_status.py +++ b/devcapsule-src/tests/test_component_status.py @@ -19,6 +19,8 @@ from devcapsule.components.channels import ChannelReport, ChannelVersion from devcapsule.compat import CliError +pytestmark = pytest.mark.legacy + @pytest.fixture def feed(): diff --git a/devcapsule-src/tests/test_console_channel.py b/devcapsule-src/tests/test_console_channel.py index 153e611c..e2dac13c 100644 --- a/devcapsule-src/tests/test_console_channel.py +++ b/devcapsule-src/tests/test_console_channel.py @@ -21,6 +21,8 @@ from devcapsule.configuration.storage import checkout_record_paths, load_toml from devcapsule import runtime_configuration +pytestmark = pytest.mark.legacy + @pytest.fixture def project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: diff --git a/devcapsule-src/tests/test_console_runtime.py b/devcapsule-src/tests/test_console_runtime.py index 4e5953bc..ea3f3b2a 100644 --- a/devcapsule-src/tests/test_console_runtime.py +++ b/devcapsule-src/tests/test_console_runtime.py @@ -19,6 +19,8 @@ from tests.test_contained_display import contained_document from tests.test_runtime_entrypoint import SupervisorCapture, captured_supervisor, runtime_document # noqa: F401 +pytestmark = pytest.mark.legacy + CONSOLE = {"listen_address": "0.0.0.0", "port": 6081, "token_path": "/run/devcapsule-console-token"} diff --git a/devcapsule-src/tests/test_console_tools.py b/devcapsule-src/tests/test_console_tools.py index 52f0afcc..659b8025 100644 --- a/devcapsule-src/tests/test_console_tools.py +++ b/devcapsule-src/tests/test_console_tools.py @@ -14,6 +14,8 @@ from devcapsule.container_runtime import console as console_child from devcapsule.container_runtime.contract import ConsolePlan, Identity, RuntimePlan +pytestmark = pytest.mark.legacy + CLI_PREFIX = ["project", "checkout", "decisions"] diff --git a/devcapsule-src/tests/test_contained_display.py b/devcapsule-src/tests/test_contained_display.py index db95a812..c5da8d1d 100644 --- a/devcapsule-src/tests/test_contained_display.py +++ b/devcapsule-src/tests/test_contained_display.py @@ -27,6 +27,8 @@ from tests.test_runtime_entrypoint import SupervisorCapture, captured_supervisor, runtime_document +pytestmark = pytest.mark.legacy + _ = captured_supervisor # re-exported fixture diff --git a/devcapsule-src/tests/test_contributor_bootstrap_context.py b/devcapsule-src/tests/test_contributor_bootstrap_context.py index 08166892..3260a484 100644 --- a/devcapsule-src/tests/test_contributor_bootstrap_context.py +++ b/devcapsule-src/tests/test_contributor_bootstrap_context.py @@ -5,6 +5,9 @@ from devcapsule.recursive_dogfood import ContainerInspection, Mount from devcapsule.recursive_host import HostDaemonLaunchContext from tests.e2e.test_contributor_bootstrap import ContributorDockerContext +import pytest + +pytestmark = pytest.mark.legacy def test_contributor_host_uses_direct_owned_workspace_path(tmp_path: Path) -> None: diff --git a/devcapsule-src/tests/test_diagnostics.py b/devcapsule-src/tests/test_diagnostics.py index f3dab20e..077af5a0 100644 --- a/devcapsule-src/tests/test_diagnostics.py +++ b/devcapsule-src/tests/test_diagnostics.py @@ -28,6 +28,8 @@ ) from devcapsule.launch.session_logs import session_logs_root +pytestmark = pytest.mark.legacy + def _init_project(project: Path) -> dict[str, Any]: target = project / ".devcapsule" diff --git a/devcapsule-src/tests/test_display_client.py b/devcapsule-src/tests/test_display_client.py index 39ad9add..a5956cc6 100644 --- a/devcapsule-src/tests/test_display_client.py +++ b/devcapsule-src/tests/test_display_client.py @@ -19,6 +19,8 @@ ) from devcapsule.host_open import HOST_OPEN_SOCKET_ENV, HostOpenError +pytestmark = pytest.mark.legacy + def test_token_and_port_are_fresh_and_usable() -> None: token = new_display_token() diff --git a/devcapsule-src/tests/test_distribution_channels.py b/devcapsule-src/tests/test_distribution_channels.py index f027cb3c..1eaededa 100644 --- a/devcapsule-src/tests/test_distribution_channels.py +++ b/devcapsule-src/tests/test_distribution_channels.py @@ -15,6 +15,8 @@ from devcapsule.components.npm_channel import NpmChannel from devcapsule.materialization import ArtifactSpec, acquire_artifact +pytestmark = pytest.mark.legacy + @pytest.fixture def channel(monkeypatch): diff --git a/devcapsule-src/tests/test_dotnet_rider_components.py b/devcapsule-src/tests/test_dotnet_rider_components.py index de0145de..c8394755 100644 --- a/devcapsule-src/tests/test_dotnet_rider_components.py +++ b/devcapsule-src/tests/test_dotnet_rider_components.py @@ -16,6 +16,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + def lock(needs): return tomllib.loads(MATRICES[Platform.LINUX_AMD64].resolve(needs).render_lock()) diff --git a/devcapsule-src/tests/test_eclipse_component.py b/devcapsule-src/tests/test_eclipse_component.py index 7139056d..282d7787 100644 --- a/devcapsule-src/tests/test_eclipse_component.py +++ b/devcapsule-src/tests/test_eclipse_component.py @@ -10,6 +10,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES, ResolutionError +pytestmark = pytest.mark.legacy + def runtime(): return RuntimePlan.for_component(DEFINITION.runtime_template(), project_path="/workspace/project", diff --git a/devcapsule-src/tests/test_elicitation.py b/devcapsule-src/tests/test_elicitation.py index d36b27f2..079f5a05 100644 --- a/devcapsule-src/tests/test_elicitation.py +++ b/devcapsule-src/tests/test_elicitation.py @@ -19,6 +19,8 @@ ProjectConfigurationError, ) +pytestmark = pytest.mark.legacy + def _validator(value: str) -> str: if value == "invalid": diff --git a/devcapsule-src/tests/test_environment_realization.py b/devcapsule-src/tests/test_environment_realization.py index fd069bd9..c5cec44b 100644 --- a/devcapsule-src/tests/test_environment_realization.py +++ b/devcapsule-src/tests/test_environment_realization.py @@ -23,6 +23,8 @@ canonical_digest, ) +pytestmark = pytest.mark.legacy + BASE_REFERENCE = f"docker.io/example/devcapsule-base@sha256:{'b' * 64}" CANONICAL_IMAGE = "devcapsule-local-pycharm:0123456789abcdef0123" diff --git a/devcapsule-src/tests/test_home.py b/devcapsule-src/tests/test_home.py index 0319ca77..32901366 100644 --- a/devcapsule-src/tests/test_home.py +++ b/devcapsule-src/tests/test_home.py @@ -12,6 +12,8 @@ from devcapsule.platforms import Platform, XdgHomes from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + @pytest.fixture def home(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: diff --git a/devcapsule-src/tests/test_host_daemon.py b/devcapsule-src/tests/test_host_daemon.py index b727b9d0..0cc95607 100644 --- a/devcapsule-src/tests/test_host_daemon.py +++ b/devcapsule-src/tests/test_host_daemon.py @@ -24,6 +24,8 @@ ) from devcapsule.recursive_dogfood import ContainerInspection, Mount +pytestmark = pytest.mark.legacy + HOST_PROJECT = "/home/developer/work/project" HOST_HOME = "/home/developer/.local/share/devcapsule/home" diff --git a/devcapsule-src/tests/test_host_open.py b/devcapsule-src/tests/test_host_open.py index ebf52701..7d623d59 100644 --- a/devcapsule-src/tests/test_host_open.py +++ b/devcapsule-src/tests/test_host_open.py @@ -21,6 +21,8 @@ validate_host_url, ) +pytestmark = pytest.mark.legacy + def test_broker_forwards_one_exact_url_without_shell_parsing(tmp_path: Path) -> None: path = tmp_path / "host-open.sock" diff --git a/devcapsule-src/tests/test_ide_requirement_override.py b/devcapsule-src/tests/test_ide_requirement_override.py index b4d57a31..44c6393e 100644 --- a/devcapsule-src/tests/test_ide_requirement_override.py +++ b/devcapsule-src/tests/test_ide_requirement_override.py @@ -27,6 +27,8 @@ from devcapsule.resolution_matrix import MATRICES from devcapsule.version_sets import state_directory +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] CREATOR = "mailto:owner@example.test" diff --git a/devcapsule-src/tests/test_image_build.py b/devcapsule-src/tests/test_image_build.py index 95324353..f52260a3 100644 --- a/devcapsule-src/tests/test_image_build.py +++ b/devcapsule-src/tests/test_image_build.py @@ -13,6 +13,8 @@ ) from devcapsule.images.build import BuildxImageBuilder, ImageBuildSpec, normalize_pycharm_source, render_build_context +pytestmark = pytest.mark.legacy + def test_parse_pycharm_build_options_rejects_missing_source(tmp_path: Path) -> None: with pytest.raises(CliError, match="does not exist"): diff --git a/devcapsule-src/tests/test_image_metadata.py b/devcapsule-src/tests/test_image_metadata.py index 690c13bd..cdd7e977 100644 --- a/devcapsule-src/tests/test_image_metadata.py +++ b/devcapsule-src/tests/test_image_metadata.py @@ -5,6 +5,9 @@ from unittest.mock import patch from devcapsule.images.metadata import list_local_images, managed_labels +import pytest + +pytestmark = pytest.mark.legacy def fake_image( diff --git a/devcapsule-src/tests/test_isolation.py b/devcapsule-src/tests/test_isolation.py index e924b6f7..f32847de 100644 --- a/devcapsule-src/tests/test_isolation.py +++ b/devcapsule-src/tests/test_isolation.py @@ -2,19 +2,14 @@ from __future__ import annotations from pathlib import Path -import tomllib import pytest from tests.conftest import DOCKER_MARKERS -pytest_plugins = ["pytester"] - +pytestmark = pytest.mark.legacy -def test_docker_marker_list_matches_declared_suites() -> None: - config = tomllib.loads((Path(__file__).parents[1] / "pyproject.toml").read_text()) - declared = {entry.split(":", 1)[0] for entry in config["tool"]["pytest"]["ini_options"]["markers"]} - assert set(DOCKER_MARKERS) == declared - {"integration", "flaky"} +pytest_plugins = ["pytester"] @pytest.mark.parametrize("exported_xdg", [False, True], ids=["laptop", "capsule"]) diff --git a/devcapsule-src/tests/test_jetbrains_session.py b/devcapsule-src/tests/test_jetbrains_session.py index bfe9020c..ed79a645 100644 --- a/devcapsule-src/tests/test_jetbrains_session.py +++ b/devcapsule-src/tests/test_jetbrains_session.py @@ -9,6 +9,8 @@ from devcapsule.container_runtime.components.jetbrains import session_lock, recover_dead_socket from devcapsule.container_runtime.contract import RuntimePlan, Identity, RuntimePlanError +pytestmark = pytest.mark.legacy + def paths(tmp_path: Path) -> tuple[Path, Path]: config, system = tmp_path / "c", tmp_path / "s" diff --git a/devcapsule-src/tests/test_listing.py b/devcapsule-src/tests/test_listing.py index a2826794..2026c8f4 100644 --- a/devcapsule-src/tests/test_listing.py +++ b/devcapsule-src/tests/test_listing.py @@ -17,6 +17,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] SURFACES = {name: MATRIX.resolve_provider(name) or name for name in MATRIX.ide_capabilities()} diff --git a/devcapsule-src/tests/test_logs.py b/devcapsule-src/tests/test_logs.py index fdcc69b3..e3b90432 100644 --- a/devcapsule-src/tests/test_logs.py +++ b/devcapsule-src/tests/test_logs.py @@ -19,6 +19,8 @@ from devcapsule import logs +pytestmark = pytest.mark.legacy + @pytest.fixture(autouse=True) def clean_logging() -> Iterator[None]: diff --git a/devcapsule-src/tests/test_manifest_document.py b/devcapsule-src/tests/test_manifest_document.py index 6c1578e6..d8b70f89 100644 --- a/devcapsule-src/tests/test_manifest_document.py +++ b/devcapsule-src/tests/test_manifest_document.py @@ -19,6 +19,8 @@ from devcapsule.configuration.values import normalize_memory_size from pathlib import Path +pytestmark = pytest.mark.legacy + def document(**extra) -> dict: return { diff --git a/devcapsule-src/tests/test_manifest_schemas.py b/devcapsule-src/tests/test_manifest_schemas.py index 22db26f0..ece8b0ba 100644 --- a/devcapsule-src/tests/test_manifest_schemas.py +++ b/devcapsule-src/tests/test_manifest_schemas.py @@ -16,6 +16,8 @@ from devcapsule.configuration.storage import load_toml, manifest_for from tests.test_upgrade_recovery import checkout, invoke # noqa: F401 (the released v0.2.11 fixture) +pytestmark = pytest.mark.legacy + PROJECT = {"name": "Sample", "slug": "sample", "creator": "mailto:owner@example.test", "mount": "/workspace/sample"} diff --git a/devcapsule-src/tests/test_materialization.py b/devcapsule-src/tests/test_materialization.py index 748bf255..a9c49232 100644 --- a/devcapsule-src/tests/test_materialization.py +++ b/devcapsule-src/tests/test_materialization.py @@ -31,6 +31,8 @@ verify_materialized_image, ) +pytestmark = pytest.mark.legacy + def fixture_archive(path: Path) -> bytes: content = b"#!/bin/sh\n" diff --git a/devcapsule-src/tests/test_notifications.py b/devcapsule-src/tests/test_notifications.py index 760bb9df..fe1e6713 100644 --- a/devcapsule-src/tests/test_notifications.py +++ b/devcapsule-src/tests/test_notifications.py @@ -21,6 +21,8 @@ store_in_environment, ) +pytestmark = pytest.mark.legacy + DOCUMENT = { "format": 1, "id": "20261009t120000-abc123", "kind": "gate", "title": "Gate failed on main", "summary": "Two unit cases; see the **log**.", "link": "/records/engineering-docs/README.md", diff --git a/devcapsule-src/tests/test_noxfile.py b/devcapsule-src/tests/test_noxfile.py index 8b62233b..62560a44 100644 --- a/devcapsule-src/tests/test_noxfile.py +++ b/devcapsule-src/tests/test_noxfile.py @@ -10,6 +10,8 @@ import noxfile +pytestmark = pytest.mark.legacy + RELEASE_WORKFLOW = noxfile.REPO_ROOT / ".github" / "workflows" / "release-pex.yml" diff --git a/devcapsule-src/tests/test_owner_commands.py b/devcapsule-src/tests/test_owner_commands.py index 6291b2c2..27125725 100644 --- a/devcapsule-src/tests/test_owner_commands.py +++ b/devcapsule-src/tests/test_owner_commands.py @@ -19,6 +19,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] diff --git a/devcapsule-src/tests/test_persistence.py b/devcapsule-src/tests/test_persistence.py index 7bc398d2..dda089c8 100644 --- a/devcapsule-src/tests/test_persistence.py +++ b/devcapsule-src/tests/test_persistence.py @@ -8,6 +8,8 @@ from devcapsule.container_runtime.contract import Identity, RuntimePlanError from devcapsule.persistence import StateRoots, plan_component_persistence, prepare_persistence_directories +pytestmark = pytest.mark.legacy + def test_component_state_uses_lifecycle_roots_and_declared_destinations(tmp_path: Path) -> None: roots = StateRoots(tmp_path / "data", tmp_path / "state", tmp_path / "cache") diff --git a/devcapsule-src/tests/test_platforms.py b/devcapsule-src/tests/test_platforms.py index 3e410aca..d47a77c0 100644 --- a/devcapsule-src/tests/test_platforms.py +++ b/devcapsule-src/tests/test_platforms.py @@ -8,6 +8,8 @@ from devcapsule.platforms import Platform, UnsupportedPlatformError, XdgHomes +pytestmark = pytest.mark.legacy + def test_platform_values_are_the_wire_format() -> None: assert Platform.LINUX_AMD64.value == "linux-amd64" diff --git a/devcapsule-src/tests/test_postgresql_client_component.py b/devcapsule-src/tests/test_postgresql_client_component.py index 240cbab9..c9ab9ace 100644 --- a/devcapsule-src/tests/test_postgresql_client_component.py +++ b/devcapsule-src/tests/test_postgresql_client_component.py @@ -6,6 +6,8 @@ from devcapsule.components.catalog import COMPONENTS, selected_component_definitions from devcapsule.components.postgresql_client import DEFINITION, runtime_template +pytestmark = pytest.mark.legacy + def lock_metadata(**overrides: object) -> dict[str, object]: metadata: dict[str, object] = { diff --git a/devcapsule-src/tests/test_project.py b/devcapsule-src/tests/test_project.py index 115a2e5f..6b5c18e5 100644 --- a/devcapsule-src/tests/test_project.py +++ b/devcapsule-src/tests/test_project.py @@ -14,6 +14,8 @@ sanitize_name, ) +pytestmark = pytest.mark.legacy + def test_sanitize_name_matches_shell_launcher_rules() -> None: assert sanitize_name("example-project_1.2") == "example-project_1.2" diff --git a/devcapsule-src/tests/test_project_commands.py b/devcapsule-src/tests/test_project_commands.py index 9d817b30..0aa22760 100644 --- a/devcapsule-src/tests/test_project_commands.py +++ b/devcapsule-src/tests/test_project_commands.py @@ -30,6 +30,8 @@ ) from devcapsule.project import project_namespace +pytestmark = pytest.mark.legacy + LOCKED_BASE = f"docker.io/example/devcapsule-base@sha256:{'b' * 64}" diff --git a/devcapsule-src/tests/test_project_information.py b/devcapsule-src/tests/test_project_information.py index 5cbb34bf..3175a949 100644 --- a/devcapsule-src/tests/test_project_information.py +++ b/devcapsule-src/tests/test_project_information.py @@ -14,6 +14,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + @pytest.fixture def project(tmp_path, monkeypatch): diff --git a/devcapsule-src/tests/test_project_init.py b/devcapsule-src/tests/test_project_init.py index 9cd8ee99..d6ab8cc1 100644 --- a/devcapsule-src/tests/test_project_init.py +++ b/devcapsule-src/tests/test_project_init.py @@ -28,6 +28,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES, ResolutionMatrix +pytestmark = pytest.mark.legacy + def matrix_without_antigravity_validation() -> ResolutionMatrix: """The embedded matrix with the Antigravity CLI's validation removed. diff --git a/devcapsule-src/tests/test_project_runtime_plan.py b/devcapsule-src/tests/test_project_runtime_plan.py index c9b297b8..2e1495a0 100644 --- a/devcapsule-src/tests/test_project_runtime_plan.py +++ b/devcapsule-src/tests/test_project_runtime_plan.py @@ -21,6 +21,9 @@ ) from devcapsule.project_runtime_plan import project_runtime_plan from devcapsule_runtime.contract import RuntimePlan as LegacyRuntimePlan +import pytest + +pytestmark = pytest.mark.legacy def selected_project(tmp_path: Path) -> tuple[ResolvedProject, LockedEnvironment]: diff --git a/devcapsule-src/tests/test_pycharm.py b/devcapsule-src/tests/test_pycharm.py index 9d4e18b7..269414ce 100644 --- a/devcapsule-src/tests/test_pycharm.py +++ b/devcapsule-src/tests/test_pycharm.py @@ -53,6 +53,8 @@ from devcapsule.container_runtime.contract import ConsolePlan from devcapsule.display_client import display_url +pytestmark = pytest.mark.legacy + def base_env(tmp_path: Path) -> dict[str, str]: return { "DISPLAY": ":1", diff --git a/devcapsule-src/tests/test_recursive_dogfood.py b/devcapsule-src/tests/test_recursive_dogfood.py index f3e28169..bd0438b2 100644 --- a/devcapsule-src/tests/test_recursive_dogfood.py +++ b/devcapsule-src/tests/test_recursive_dogfood.py @@ -22,6 +22,8 @@ validate_container_name, ) +pytestmark = pytest.mark.legacy + def inspection_mapping( *, diff --git a/devcapsule-src/tests/test_recursive_host.py b/devcapsule-src/tests/test_recursive_host.py index dfed1573..eb508c7a 100644 --- a/devcapsule-src/tests/test_recursive_host.py +++ b/devcapsule-src/tests/test_recursive_host.py @@ -31,6 +31,8 @@ RecursiveStagingArea, ) +pytestmark = pytest.mark.legacy + @dataclass class HostLayout: diff --git a/devcapsule-src/tests/test_recursive_orchestrator.py b/devcapsule-src/tests/test_recursive_orchestrator.py index d4e941fe..58898f20 100644 --- a/devcapsule-src/tests/test_recursive_orchestrator.py +++ b/devcapsule-src/tests/test_recursive_orchestrator.py @@ -22,6 +22,8 @@ prepare_recursive_e2e_dry_run, ) +pytestmark = pytest.mark.legacy + @dataclass class RecursiveFixture: diff --git a/devcapsule-src/tests/test_recursive_successor.py b/devcapsule-src/tests/test_recursive_successor.py index 7392940e..3cd33d5d 100644 --- a/devcapsule-src/tests/test_recursive_successor.py +++ b/devcapsule-src/tests/test_recursive_successor.py @@ -31,6 +31,8 @@ matching_inspection, ) +pytestmark = pytest.mark.legacy + RUN_ID = "b2093d85912fa34ac1324e1da26a9dcd" CONTAINER_ID = "7e" * 32 diff --git a/devcapsule-src/tests/test_recursive_successor_plan.py b/devcapsule-src/tests/test_recursive_successor_plan.py index 7c713ebe..9e2d0ac3 100644 --- a/devcapsule-src/tests/test_recursive_successor_plan.py +++ b/devcapsule-src/tests/test_recursive_successor_plan.py @@ -29,6 +29,8 @@ compare_inspection, ) +pytestmark = pytest.mark.legacy + RUNTIME_PLAN_DESTINATION = "/etc/devcapsule/runtime-plan.json" RUNTIME_PLAN_DIGEST = "a" * 64 diff --git a/devcapsule-src/tests/test_release_compatibility.py b/devcapsule-src/tests/test_release_compatibility.py index ee431098..c6952ae3 100644 --- a/devcapsule-src/tests/test_release_compatibility.py +++ b/devcapsule-src/tests/test_release_compatibility.py @@ -20,6 +20,9 @@ from devcapsule.configuration.file_formats import ( canonical_digest, ) +import pytest + +pytestmark = pytest.mark.legacy FIXTURES = Path(__file__).parent / "resources" / "compat" diff --git a/devcapsule-src/tests/test_release_docs.py b/devcapsule-src/tests/test_release_docs.py index 642c275e..587172e4 100644 --- a/devcapsule-src/tests/test_release_docs.py +++ b/devcapsule-src/tests/test_release_docs.py @@ -8,6 +8,8 @@ import pytest import yaml +pytestmark = pytest.mark.legacy + SPEC = importlib.util.spec_from_file_location("release_docs", Path(__file__).parents[1] / "scripts/release-docs.py") assert SPEC and SPEC.loader MODULE = importlib.util.module_from_spec(SPEC) diff --git a/devcapsule-src/tests/test_release_manifest.py b/devcapsule-src/tests/test_release_manifest.py index a2900f60..5635a3fe 100644 --- a/devcapsule-src/tests/test_release_manifest.py +++ b/devcapsule-src/tests/test_release_manifest.py @@ -7,6 +7,8 @@ from tests.test_base_image import pex_fixture +pytestmark = pytest.mark.legacy + SPEC = importlib.util.spec_from_file_location( "release_manifest", Path(__file__).parents[1] / "scripts" / "release-manifest.py", diff --git a/devcapsule-src/tests/test_release_protocol.py b/devcapsule-src/tests/test_release_protocol.py index f5d61558..3c312f59 100644 --- a/devcapsule-src/tests/test_release_protocol.py +++ b/devcapsule-src/tests/test_release_protocol.py @@ -8,6 +8,8 @@ import pytest +pytestmark = pytest.mark.legacy + SPEC = importlib.util.spec_from_file_location("release_protocol", Path(__file__).parents[1] / "scripts/release-protocol.py") assert SPEC and SPEC.loader MODULE = importlib.util.module_from_spec(SPEC) diff --git a/devcapsule-src/tests/test_repository_manifest_compatibility.py b/devcapsule-src/tests/test_repository_manifest_compatibility.py index c315a2c7..69e7a8c0 100644 --- a/devcapsule-src/tests/test_repository_manifest_compatibility.py +++ b/devcapsule-src/tests/test_repository_manifest_compatibility.py @@ -16,6 +16,8 @@ from devcapsule.materialization import parse_locked_environment +pytestmark = pytest.mark.legacy + # Frozen from final v0.2.15, commit a15ff8b58f4af93845c17eaca22f9c9d29c8e000: # configuration/values.py, resolution_matrix.py and components/catalog.py. diff --git a/devcapsule-src/tests/test_resolution_matrix.py b/devcapsule-src/tests/test_resolution_matrix.py index 5e5f46b0..82ccfb58 100644 --- a/devcapsule-src/tests/test_resolution_matrix.py +++ b/devcapsule-src/tests/test_resolution_matrix.py @@ -33,6 +33,8 @@ _VerifiedEdge, ) +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] GOLDEN_ROOT = Path(__file__).parent / "resources" / "golden_locks" diff --git a/devcapsule-src/tests/test_retired_spellings.py b/devcapsule-src/tests/test_retired_spellings.py index f16f5b5f..7a58b434 100644 --- a/devcapsule-src/tests/test_retired_spellings.py +++ b/devcapsule-src/tests/test_retired_spellings.py @@ -6,6 +6,8 @@ from devcapsule import cli from tests.test_checkout_commands import project, runtime_project # noqa: F401 +pytestmark = pytest.mark.legacy + SPELLINGS = [ (("config", "capabilities", "--local", "python-ide"), "config ide"), diff --git a/devcapsule-src/tests/test_run_flow.py b/devcapsule-src/tests/test_run_flow.py index 92c0750e..7d63b9d1 100644 --- a/devcapsule-src/tests/test_run_flow.py +++ b/devcapsule-src/tests/test_run_flow.py @@ -18,6 +18,8 @@ from devcapsule.configuration.docker_arguments import arguments_path, read_arguments from devcapsule.configuration.storage import checkout_record_paths, load_toml, registered_checkouts, settings_path +pytestmark = pytest.mark.legacy + @pytest.fixture def project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: diff --git a/devcapsule-src/tests/test_runtime_artifact.py b/devcapsule-src/tests/test_runtime_artifact.py index 350ec861..4eda6d3a 100644 --- a/devcapsule-src/tests/test_runtime_artifact.py +++ b/devcapsule-src/tests/test_runtime_artifact.py @@ -11,6 +11,8 @@ from devcapsule.runtime_command import RuntimeCommand from tests.test_base_image import pex_fixture +pytestmark = pytest.mark.legacy + def test_packaged_launcher_supplies_itself_despite_source_override(tmp_path: Path, monkeypatch) -> None: launcher = pex_fixture(tmp_path / "launcher.pex") diff --git a/devcapsule-src/tests/test_runtime_contract_slots.py b/devcapsule-src/tests/test_runtime_contract_slots.py index 7f0ca4ed..2c738b12 100644 --- a/devcapsule-src/tests/test_runtime_contract_slots.py +++ b/devcapsule-src/tests/test_runtime_contract_slots.py @@ -22,6 +22,8 @@ RuntimePlanError, ) +pytestmark = pytest.mark.legacy + def template_mapping(component_id: str, container_path: str, *, overlay: bool = True) -> dict: return { diff --git a/devcapsule-src/tests/test_runtime_diagnose.py b/devcapsule-src/tests/test_runtime_diagnose.py index 768f1c04..48581054 100644 --- a/devcapsule-src/tests/test_runtime_diagnose.py +++ b/devcapsule-src/tests/test_runtime_diagnose.py @@ -23,6 +23,8 @@ scan_processes, ) +pytestmark = pytest.mark.legacy + _WS_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" diff --git a/devcapsule-src/tests/test_runtime_entrypoint.py b/devcapsule-src/tests/test_runtime_entrypoint.py index 974f6fd4..e2d65abd 100644 --- a/devcapsule-src/tests/test_runtime_entrypoint.py +++ b/devcapsule-src/tests/test_runtime_entrypoint.py @@ -21,6 +21,8 @@ from devcapsule.container_runtime.identity import foreground_command from devcapsule.container_runtime.supervisor import SupervisedChild +pytestmark = pytest.mark.legacy + def runtime_document(tmp_path: Path) -> dict[str, object]: return { diff --git a/devcapsule-src/tests/test_saved_docker_arguments.py b/devcapsule-src/tests/test_saved_docker_arguments.py index c3f653a6..86f1fc78 100644 --- a/devcapsule-src/tests/test_saved_docker_arguments.py +++ b/devcapsule-src/tests/test_saved_docker_arguments.py @@ -15,6 +15,8 @@ from tests.test_checkout_environment import project, config from tests.test_project_commands import initialize_codium_project, LOCKED_BASE +pytestmark = pytest.mark.legacy + def test_saved_args_replace_list_clear_and_share_hidden_env(project, tmp_path, capsys, monkeypatch): path = arguments_path(registered_checkouts()[0].record_path) diff --git a/devcapsule-src/tests/test_scenario_recorder.py b/devcapsule-src/tests/test_scenario_recorder.py index 885e2861..35f8a897 100644 --- a/devcapsule-src/tests/test_scenario_recorder.py +++ b/devcapsule-src/tests/test_scenario_recorder.py @@ -35,6 +35,8 @@ write_json_atomically, ) +pytestmark = pytest.mark.legacy + def test_eclipse_hello_time_debug_scenario_is_registered_and_valid(tmp_path: Path) -> None: assert "eclipse-hello-time-debug" in list_scenarios() diff --git a/devcapsule-src/tests/test_settings.py b/devcapsule-src/tests/test_settings.py index bc94f68c..bf103e08 100644 --- a/devcapsule-src/tests/test_settings.py +++ b/devcapsule-src/tests/test_settings.py @@ -8,6 +8,8 @@ from devcapsule.configuration import storage from devcapsule.configuration.file_formats import ProjectConfigurationError +pytestmark = pytest.mark.legacy + def test_empty_and_legacy_files_are_not_read(tmp_path: Path) -> None: env = {"DEVCAPSULE_CONFIG_HOME": str(tmp_path / "home")} diff --git a/devcapsule-src/tests/test_software_approvals.py b/devcapsule-src/tests/test_software_approvals.py index 8698e7f0..3838a38c 100644 --- a/devcapsule-src/tests/test_software_approvals.py +++ b/devcapsule-src/tests/test_software_approvals.py @@ -23,6 +23,8 @@ from devcapsule.configuration.storage import interrupted_activation, load_toml, manifest_for from tests.test_upgrade_recovery import checkout, install_external_fakes, invoke, review # noqa: F401 +pytestmark = pytest.mark.legacy + CLAUDE_TERMS = "https://www.anthropic.com/legal/commercial-terms" ANTIGRAVITY_TERMS = "https://antigravity.google/terms/" GUIDE = "https://devcapsule.mycodespace.ai/docs/current/configuration/software-approvals/" diff --git a/devcapsule-src/tests/test_sources.py b/devcapsule-src/tests/test_sources.py index d058c107..26ff9bc3 100644 --- a/devcapsule-src/tests/test_sources.py +++ b/devcapsule-src/tests/test_sources.py @@ -11,6 +11,8 @@ from devcapsule.configuration.manifest_schemas import ManifestV2, read_manifest from devcapsule.configuration.sources import WrappedSource, WrappedSources, java_line, source_path +pytestmark = pytest.mark.legacy + PROJECT = {"name": "FRC learning", "slug": "frc-learning", "creator": "mailto:owner@example.test", "mount": "/workspace/frc-learning"} diff --git a/devcapsule-src/tests/test_supervisor.py b/devcapsule-src/tests/test_supervisor.py index c2ba686f..0bb50b36 100644 --- a/devcapsule-src/tests/test_supervisor.py +++ b/devcapsule-src/tests/test_supervisor.py @@ -28,6 +28,8 @@ SupervisorError, ) +pytestmark = pytest.mark.legacy + DRIVER = Path(__file__).parent / "resources" / "supervisor_driver.py" REPO_ROOT = Path(__file__).resolve().parents[1] diff --git a/devcapsule-src/tests/test_trust.py b/devcapsule-src/tests/test_trust.py index 364221cf..a571b562 100644 --- a/devcapsule-src/tests/test_trust.py +++ b/devcapsule-src/tests/test_trust.py @@ -21,6 +21,8 @@ from devcapsule.configuration.file_formats import render_toml from devcapsule.configuration.trust import BASE_CHANNEL, Channel, HomeTrust, channels_for +pytestmark = pytest.mark.legacy + CLAUDE_TERMS = "https://www.anthropic.com/legal/commercial-terms" diff --git a/devcapsule-src/tests/test_unpacked_cache.py b/devcapsule-src/tests/test_unpacked_cache.py index 71661016..060a5ad7 100644 --- a/devcapsule-src/tests/test_unpacked_cache.py +++ b/devcapsule-src/tests/test_unpacked_cache.py @@ -11,6 +11,8 @@ from devcapsule.materialization import UNPACKED_MARKER, unpacked_tree +pytestmark = pytest.mark.legacy + DIGEST = "a" * 64 diff --git a/devcapsule-src/tests/test_upgrade_recovery.py b/devcapsule-src/tests/test_upgrade_recovery.py index fc3402ce..9cc3a23c 100644 --- a/devcapsule-src/tests/test_upgrade_recovery.py +++ b/devcapsule-src/tests/test_upgrade_recovery.py @@ -43,6 +43,8 @@ manifest_for, ) +pytestmark = pytest.mark.legacy + FIXTURE = Path(__file__).parent / "resources/compat/v0.2.11" OLD_LOCK = tomllib.loads((FIXTURE / "project/.devcapsule/devcapsule.linux-amd64.lock").read_text()) OLD_BASE = OLD_LOCK["base"]["reference"] diff --git a/devcapsule-src/tests/test_version_bump.py b/devcapsule-src/tests/test_version_bump.py index 93909de3..72841500 100644 --- a/devcapsule-src/tests/test_version_bump.py +++ b/devcapsule-src/tests/test_version_bump.py @@ -5,6 +5,8 @@ import pytest +pytestmark = pytest.mark.legacy + SCRIPT = Path(__file__).resolve().parents[1] / "scripts" / "bump-version.py" SPEC = importlib.util.spec_from_file_location("devcapsule_bump_version", SCRIPT) diff --git a/devcapsule-src/tests/test_version_sets.py b/devcapsule-src/tests/test_version_sets.py index 4dedf638..16b1a733 100644 --- a/devcapsule-src/tests/test_version_sets.py +++ b/devcapsule-src/tests/test_version_sets.py @@ -36,6 +36,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + def invoke(project, *args): return cli.main(["project", "--path", str(project), *map(str, args)]) diff --git a/devcapsule-src/tests/test_visual_smoke.py b/devcapsule-src/tests/test_visual_smoke.py index 7b4fc8e8..edfd3a67 100644 --- a/devcapsule-src/tests/test_visual_smoke.py +++ b/devcapsule-src/tests/test_visual_smoke.py @@ -12,6 +12,8 @@ from tests.e2e.ide_session import SURFACES, SessionFacts, wait_for_ide_window from tests.e2e.visual_smoke import drive_scenario +pytestmark = pytest.mark.legacy + def decision(action: str = "done") -> Decision: return Decision(action, 0, 0, "", 0, "test observation") diff --git a/devcapsule-src/tests/test_vscode_component.py b/devcapsule-src/tests/test_vscode_component.py index 7cf6a2a2..05e7868f 100644 --- a/devcapsule-src/tests/test_vscode_component.py +++ b/devcapsule-src/tests/test_vscode_component.py @@ -59,6 +59,8 @@ from devcapsule.platforms import Platform from devcapsule.resolution_matrix import MATRICES +pytestmark = pytest.mark.legacy + MATRIX = MATRICES[Platform.LINUX_AMD64] diff --git a/devcapsule-src/tests/test_workflow_bootstrap.py b/devcapsule-src/tests/test_workflow_bootstrap.py index 25fdb43b..e07883ca 100644 --- a/devcapsule-src/tests/test_workflow_bootstrap.py +++ b/devcapsule-src/tests/test_workflow_bootstrap.py @@ -14,6 +14,8 @@ project_workflow_type, ) +pytestmark = pytest.mark.legacy + REPO_ROOT = Path(__file__).resolve().parents[2] diff --git a/devcapsule-src/tests/test_workflow_coordination.py b/devcapsule-src/tests/test_workflow_coordination.py index fe0bf5e0..cfe72fe8 100644 --- a/devcapsule-src/tests/test_workflow_coordination.py +++ b/devcapsule-src/tests/test_workflow_coordination.py @@ -18,6 +18,8 @@ take, ) +pytestmark = pytest.mark.legacy + def git(root: Path, *args: str, stdin: str | None = None) -> str: return subprocess.run( diff --git a/devcapsule-src/tests/test_wrap.py b/devcapsule-src/tests/test_wrap.py index 72079858..bab7bbf9 100644 --- a/devcapsule-src/tests/test_wrap.py +++ b/devcapsule-src/tests/test_wrap.py @@ -14,6 +14,8 @@ from devcapsule.configuration.storage import load_toml from devcapsule.wrap import GUIDANCE_MARKER, WrapRequest, _add_submodule, wrap_project +pytestmark = pytest.mark.legacy + def git(cwd: Path, *args: str) -> str: return subprocess.run(["git", "-C", str(cwd), *args], capture_output=True, text=True, check=True).stdout.strip() diff --git a/devcapsule-src/tests/unit/__init__.py b/devcapsule-src/tests/unit/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/devcapsule-src/tests/unit/scripts/__init__.py b/devcapsule-src/tests/unit/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/devcapsule-src/tests/unit/scripts/test_validate_unittests_follow_conventions.py b/devcapsule-src/tests/unit/scripts/test_validate_unittests_follow_conventions.py new file mode 100644 index 00000000..7ec8388c --- /dev/null +++ b/devcapsule-src/tests/unit/scripts/test_validate_unittests_follow_conventions.py @@ -0,0 +1,211 @@ +"""Unit tests of ``scripts/validate_unittests_follow_conventions.py``, the gate's check of the unit-test conventions. + +Each test builds the suite it checks under ``tmp_path``; the rules under +test are the three *Unit Tests* in WORKFLOW-LOCAL.md states. +""" +from __future__ import annotations + +import importlib.util +import subprocess +import sys +from pathlib import Path +from typing import Any + +import pytest + +_SCRIPT = Path(__file__).resolve().parents[3] / "scripts" / "validate_unittests_follow_conventions.py" + + +def _load(path: Path) -> Any: + """The script as a module; registered in ``sys.modules`` so its dataclasses resolve their annotations.""" + spec = importlib.util.spec_from_file_location(path.stem, path) + assert spec and spec.loader + module = importlib.util.module_from_spec(spec) + sys.modules[spec.name] = module + spec.loader.exec_module(module) + return module + + +conventions = _load(_SCRIPT) + + +def _module(path: str, source: str) -> Any: + return conventions.parse_module(Path(path), source) + + +DOCUMENTED = 'def test_one():\n """It holds."""\n assert True\n' +UNDOCUMENTED = "def test_one():\n assert True\n" + + +def test_module_markers_are_read_from_pytestmark_in_both_forms() -> None: + """Precondition: a module assigns ``pytestmark`` a single marker or a list. + Action: parse it. Postcondition: every marker name is reported.""" + single = _module("tests/a.py", "import pytest\npytestmark = pytest.mark.legacy\n") + listed = _module("tests/b.py", "import pytest\npytestmark = [pytest.mark.e2e, pytest.mark.flaky(reason='x')]\n") + assert single.markers == {"legacy"} and single.legacy + assert listed.markers == {"e2e", "flaky"} and not listed.legacy + + +def test_a_test_function_is_recorded_with_its_decorators_and_without_trailing_whitespace() -> None: + """Precondition: a test function with a decorator and trailing spaces. + Action: parse it. Postcondition: its source starts at the decorator and + carries no trailing whitespace, so a whitespace-only edit is not a change.""" + source = "import pytest\n\n@pytest.mark.parametrize('x', [1])\ndef test_one(x): \n assert x\n" + module = _module("tests/a.py", source) + assert module.functions == {"test_one": "@pytest.mark.parametrize('x', [1])\ndef test_one(x):\n assert x"} + + +def test_methods_of_test_classes_are_qualified_by_their_class() -> None: + """Precondition: a ``Test`` class holding a test method. Action: parse. + Postcondition: the method is listed under ``Class.method``.""" + module = _module("tests/a.py", "class TestThing:\n def test_one(self):\n assert True\n") + assert list(module.functions) == ["TestThing.test_one"] + assert module.undocumented == (("TestThing.test_one", 2),) + + +def test_the_mirror_maps_a_test_file_to_its_public_or_private_module(tmp_path: Path) -> None: + """Precondition: ``devcapsule/a/b.py`` and ``devcapsule/a/_c.py`` exist. + Action: resolve the mirror for their test paths and for a stranger. + Postcondition: both modules resolve, the stranger does not.""" + (tmp_path / "devcapsule" / "a").mkdir(parents=True) + (tmp_path / "devcapsule" / "a" / "b.py").write_text("") + (tmp_path / "devcapsule" / "a" / "_c.py").write_text("") + assert conventions.mirrored_module(Path("tests/unit/devcapsule/a/test_b.py"), tmp_path) == Path("devcapsule/a/b.py") + assert conventions.mirrored_module(Path("tests/unit/devcapsule/a/test_c.py"), tmp_path) == Path("devcapsule/a/_c.py") + assert conventions.mirrored_module(Path("tests/unit/devcapsule/a/test_d.py"), tmp_path) is None + assert conventions.mirrored_module(Path("tests/test_b.py"), tmp_path) is None + + +def test_a_documented_test_in_the_mirror_of_an_existing_module_passes(tmp_path: Path) -> None: + """Precondition: a non-legacy, documented test file mirroring a real module. + Action: check. Postcondition: no breach.""" + (tmp_path / "devcapsule").mkdir() + (tmp_path / "devcapsule" / "thing.py").write_text("") + module = _module("tests/unit/devcapsule/test_thing.py", DOCUMENTED) + assert conventions.check([module], {}, tmp_path) == [] + + +def test_a_non_legacy_file_outside_the_mirror_needs_a_heavier_suite_marker(tmp_path: Path) -> None: + """Precondition: two documented files outside the mirror, one marked e2e. + Action: check. Postcondition: only the unmarked one is a breach, naming the mirror.""" + marked = _module("tests/test_flow.py", "import pytest\npytestmark = pytest.mark.e2e\n" + DOCUMENTED) + unmarked = _module("tests/test_flow2.py", DOCUMENTED) + breaches = conventions.check([marked, unmarked], {}, tmp_path) + assert len(breaches) == 1 and breaches[0].startswith("tests/test_flow2.py: a unit test file lives under tests/unit") + + +def test_a_mirror_file_naming_no_module_is_a_breach(tmp_path: Path) -> None: + """Precondition: a documented file in the mirror whose name matches no module. + Action: check. Postcondition: one breach naming the file.""" + module = _module("tests/unit/devcapsule/test_nothing.py", DOCUMENTED) + breaches = conventions.check([module], {}, tmp_path) + assert breaches == ["tests/unit/devcapsule/test_nothing.py: no module under devcapsule-src is mirrored by this file name"] + + +def test_an_undocumented_test_in_a_non_legacy_file_is_a_breach_at_its_line(tmp_path: Path) -> None: + """Precondition: a mirror file with one undocumented test on line 3. + Action: check. Postcondition: the breach names the function and the line.""" + (tmp_path / "devcapsule").mkdir() + (tmp_path / "devcapsule" / "thing.py").write_text("") + module = _module("tests/unit/devcapsule/test_thing.py", "import pytest\n\n" + UNDOCUMENTED) + assert conventions.check([module], {}, tmp_path) == [ + "tests/unit/devcapsule/test_thing.py:3: test_one has no docstring stating its contract" + ] + + +def test_a_legacy_file_is_exempt_from_placement_and_docstrings(tmp_path: Path) -> None: + """Precondition: an undocumented legacy file outside the mirror, unchanged from base. + Action: check against that base. Postcondition: no breach.""" + source = "import pytest\npytestmark = pytest.mark.legacy\n" + UNDOCUMENTED + module = _module("tests/test_old.py", source) + base = _module("tests/test_old.py", UNDOCUMENTED) + assert conventions.check([module], {module.path: base}, tmp_path) == [] + + +def test_a_legacy_file_may_lose_tests_but_not_gain_or_change_them(tmp_path: Path) -> None: + """Precondition: base holds tests a, b, c; the legacy file drops a, keeps b, changes c and adds d. + Action: check. Postcondition: c and d are breaches, a and b are not.""" + base = _module("tests/test_old.py", "def test_a():\n pass\ndef test_b():\n pass\ndef test_c():\n pass\n") + module = _module("tests/test_old.py", "import pytest\npytestmark = pytest.mark.legacy\n" + "def test_b():\n pass\ndef test_c():\n assert 1\ndef test_d():\n pass\n") + breaches = conventions.check([module], {module.path: base}, tmp_path) + assert breaches == [ + "tests/test_old.py: test_c changed in a legacy file; fix it to the convention and move it to the mirror", + "tests/test_old.py: test_d was added to a legacy file; put it in the mirror", + ] + + +def test_a_marker_other_than_legacy_cannot_be_added_to_a_legacy_file(tmp_path: Path) -> None: + """Precondition: base has no module marker; the legacy file adds legacy and skip. + Action: check. Postcondition: skip is a breach, legacy is not.""" + base = _module("tests/test_old.py", UNDOCUMENTED) + module = _module("tests/test_old.py", "import pytest\npytestmark = [pytest.mark.legacy, pytest.mark.skip]\n" + UNDOCUMENTED) + assert conventions.check([module], {module.path: base}, tmp_path) == [ + "tests/test_old.py: marker 'skip' was added to a legacy file" + ] + + +def test_a_legacy_file_the_base_lacks_is_refused(tmp_path: Path) -> None: + """Precondition: a legacy file with no base version. Action: check. + Postcondition: one breach saying new tests follow the convention.""" + module = _module("tests/test_new.py", "import pytest\npytestmark = pytest.mark.legacy\n" + UNDOCUMENTED) + breaches = conventions.check([module], {module.path: None}, tmp_path) + assert len(breaches) == 1 and breaches[0].endswith("new tests follow the convention") + + +def _git(root: Path, *arguments: str) -> None: + subprocess.run(["git", "-c", "user.name=t", "-c", "user.email=t@example.test", *arguments], + cwd=root, check=True, capture_output=True) + + +def test_main_compares_legacy_files_with_the_merge_base_and_exits_one_on_a_breach(tmp_path: Path) -> None: + """Precondition: a repository whose base commit holds a legacy test, then a + commit on a branch that changes that test's body. Action: run ``main`` with + the base ref. Postcondition: exit 1, the breach on stderr, the summary on stdout.""" + root = tmp_path / "devcapsule-src" + tests = root / "tests" + tests.mkdir(parents=True) + (tests / "test_old.py").write_text("import pytest\npytestmark = pytest.mark.legacy\n" + UNDOCUMENTED) + _git(root, "init", "-q", "-b", "main") + _git(root, "add", ".") + _git(root, "commit", "-q", "-m", "base") + _git(root, "checkout", "-q", "-b", "slice") + (tests / "test_old.py").write_text("import pytest\npytestmark = pytest.mark.legacy\ndef test_one():\n assert 1\n") + _git(root, "commit", "-q", "-am", "change") + status = conventions.main(["--base", "main", "--project-root", str(root)]) + assert status == 1 + + +def test_main_passes_a_suite_that_only_shrinks_its_legacy_files(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: + """Precondition: a repository whose branch removes one legacy test and adds a + documented mirror test of an existing module. Action: run ``main``. + Postcondition: exit 0 and the summary counts one legacy file with one test.""" + root = tmp_path / "devcapsule-src" + (root / "devcapsule").mkdir(parents=True) + (root / "devcapsule" / "thing.py").write_text("") + tests = root / "tests" + tests.mkdir() + (tests / "test_old.py").write_text("import pytest\npytestmark = pytest.mark.legacy\n" + UNDOCUMENTED + "def test_two():\n pass\n") + _git(root, "init", "-q", "-b", "main") + _git(root, "add", ".") + _git(root, "commit", "-q", "-m", "base") + _git(root, "checkout", "-q", "-b", "slice") + (tests / "test_old.py").write_text("import pytest\npytestmark = pytest.mark.legacy\n" + UNDOCUMENTED) + (tests / "unit" / "devcapsule").mkdir(parents=True) + (tests / "unit" / "devcapsule" / "test_thing.py").write_text(DOCUMENTED) + _git(root, "add", ".") + _git(root, "commit", "-q", "-m", "shrink") + status = conventions.main(["--base", "main", "--project-root", str(root)]) + assert status == 0 + assert "1 legacy files holding 1 legacy tests; 1 files follow the convention; 0 breaches" in capsys.readouterr().out + + +def test_main_fails_when_the_base_cannot_be_resolved(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: + """Precondition: a repository with no ref named ``nowhere``. Action: run ``main`` + with that base. Postcondition: exit 1 and a message naming the base.""" + root = tmp_path / "devcapsule-src" + (root / "tests").mkdir(parents=True) + _git(root, "init", "-q", "-b", "main") + _git(root, "commit", "-q", "--allow-empty", "-m", "base") + assert conventions.main(["--base", "nowhere", "--project-root", str(root)]) == 1 + assert "cannot resolve base 'nowhere'" in capsys.readouterr().err diff --git a/devcapsule-src/tests/unit/tests/__init__.py b/devcapsule-src/tests/unit/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/devcapsule-src/tests/unit/tests/test_conftest.py b/devcapsule-src/tests/unit/tests/test_conftest.py new file mode 100644 index 00000000..7dfcc6cb --- /dev/null +++ b/devcapsule-src/tests/unit/tests/test_conftest.py @@ -0,0 +1,21 @@ +"""Unit tests of ``tests/conftest.py``: the shared fixtures and the marker sets they key on.""" +from __future__ import annotations + +import tomllib +from pathlib import Path + +from tests.conftest import DOCKER_MARKERS + +_PYPROJECT = Path(__file__).resolve().parents[3] / "pyproject.toml" + +NON_DOCKER_MARKERS = frozenset({"integration", "flaky", "legacy"}) +"""The registered markers that never need Docker: process-boundary tests, visibility runs, legacy files.""" + + +def test_every_registered_marker_is_a_docker_marker_unless_it_is_a_known_non_docker_one() -> None: + """Precondition: ``pyproject.toml`` registers the suite's markers. Action: read + the registered names. Postcondition: ``DOCKER_MARKERS`` is exactly the registered + set minus the three non-Docker markers, so a Docker suite cannot be registered + without the isolation fixture learning that it keeps the developer's homes.""" + registered = {entry.split(":", 1)[0] for entry in tomllib.loads(_PYPROJECT.read_text())["tool"]["pytest"]["ini_options"]["markers"]} + assert set(DOCKER_MARKERS) == registered - NON_DOCKER_MARKERS diff --git a/engineering-docs/development/review-partner-loop.md b/engineering-docs/development/review-partner-loop.md index 9391781f..22f0c487 100644 --- a/engineering-docs/development/review-partner-loop.md +++ b/engineering-docs/development/review-partner-loop.md @@ -122,6 +122,12 @@ Improve it on your branch, focused on exactly three things, in this order: 3. Test coverage of the new and modified lines. Add tests where a branch is not exercised. Every test must fail if the line it covers is broken. Do not pad. +4. Every new or changed test against *Unit Tests* in `WORKFLOW-LOCAL.md`: + it lives in the mirror and names its unit; it establishes its own + precondition, calls one public operation and asserts a promised + postcondition; its docstring states the contract. For each, name what + would make it fail for a reason that is not a bug. A finding here is a + finding; "confined to tests" does not dismiss it. Stay inside the PR's scope: . Do not change . Do not widen ; if you believe it is wrong, diff --git a/engineering-docs/development/unit-tests.md b/engineering-docs/development/unit-tests.md index bdf1a256..be1afc81 100644 --- a/engineering-docs/development/unit-tests.md +++ b/engineering-docs/development/unit-tests.md @@ -2,6 +2,16 @@ [Development](README.md) · [Developer environment](developer-environment.md) · [Source layout](source-layout.md) · [Integration tests](integration-tests.md) · [End-to-end tests](e2e-tests.md) +## Conventions + +*Unit Tests* in [`WORKFLOW-LOCAL.md`](../../WORKFLOW-LOCAL.md) binds: a +unit test file mirrors its module under `tests/unit/`, a test is a +precondition, one call and a postcondition, and its docstring states the +contract. The companion explains why. `scripts/validate_unittests_follow_conventions.py` is the +gate's check; its summary line counts the files still marked `legacy`. The +flat files under `tests/` are those legacy files: they only lose tests, and +a test you change moves to the mirror with you. + ## Running them ```text @@ -105,11 +115,16 @@ so prefer the existing laws and an acceptance step for what the user sees. ## Fixtures -`tests/conftest.py` holds two fixtures and nothing else: +`tests/conftest.py` holds three fixtures and nothing else: - `host_launch_by_default`, autouse: makes launcher tests behave as if they run on the host, since the launcher translates bind sources when it finds itself inside a capsule and the suite is often run from one. +- `private_user_directories`, autouse: moves `HOME` and every XDG directory + under the test's `tmp_path` for non-Docker tests. Inside a capsule this is + not yet a private home: a home with no settings of its own reads the + launcher's mounted settings, so tests that assume no accepted vendor + channel fail there. Recorded on 2026-11-03 for the 0.3.1 fixture slice. - `built_pex`: the executable under test, `DEVCAPSULE_PEX_UNDER_TEST` when set, otherwise `dist/devcapsule-local.pex`; it fails with the Nox session to run when the file is missing. The integration and end-to-end suites use diff --git a/engineering-docs/releases/v0.3.0/README.md b/engineering-docs/releases/v0.3.0/README.md index 8b8a6f1d..38564385 100644 --- a/engineering-docs/releases/v0.3.0/README.md +++ b/engineering-docs/releases/v0.3.0/README.md @@ -1,6 +1,6 @@ # DevCapsule 0.3.0 — Release Work -Updated: 2026-10-31. Stage: **RC9 accepted with documented limits; mainline acceptance PR required before final publication**. +Updated: 2026-10-31. Stage: **0.3.0 complete: final downloads and production website verified**. Driver: **maintenance**. Product owner: Costin Cozianu. [Release notes](notes.md) · @@ -15,6 +15,46 @@ and questions; the bug records remain authoritative for individual status, ownership and technical evidence; the maintenance status file links here for resumption. +## Production handoff complete — 2026-10-31 + +The owner confirmed "All done". Independently checked +[production build-info](https://devcapsule.mycodespace.ai/build-info.json): +current 0.3.0, content 31d44fa4, and the exact reviewed candidate +website-candidate-41188626026-1 with archive digest feb14cb499782540f4d7b051122201650d787bb89cb76c217547702b60ab90ca. +[Verification record](website-verification.json). CLI and production website +delivery are complete. Earlier pending-promotion statements are historical. + +## Final delivery — 2026-10-31 + +[DevCapsule v0.3.0](https://github.com/ccozianu/devcapsule/releases/tag/v0.3.0) +was published at 09:25:15 UTC after owner merge of acceptance PR #332 at +main `31d44fa473a86f608110caa53ee38c6aef40a717`. +[Publication run 41188312058](https://github.com/ccozianu/devcapsule/actions/runs/41188312058) +passed all gates, packaged tests, staging and download verification. +The final tag points to accepted RC9 source +`475427da033633ff5ee0e44e09face700630bf36`, not the acceptance PR commit. + +The three public assets were downloaded independently into a fresh directory. +Checksum, `0.3.0` version, `v0.3.0` mnemonic, source SHA and embedded acceptance +record all match. Base references and frozen dependencies/Python match RC9. +Final PEX SHA-256: +`f59e05cdbb5ab157641aae5a27f269f963400a650c1ae3db1650e1881a6df714`. +[Verification facts](final-verification.json) and [final manifest](final-manifest.json). + +The workflow dispatched [test website run 41188626026](https://github.com/ccozianu/devcapsule/actions/runs/41188626026). +Build, deploy and candidate publication all passed. Live build-info names +main 31d44fa4, docs-0.3.0 at 7a813b80 and current version 0.3.0; the home, +current guides, versioned guides and release-note pages return HTTP 200. +[Website verification](website-verification.json). The public candidate is +[website-candidate-41188626026-1](https://github.com/ccozianu/devcapsule/releases/tag/website-candidate-41188626026-1), +with bundle SHA-256 feb14cb499782540f4d7b051122201650d787bb89cb76c217547702b60ab90ca. +The owner reviews [the test site](https://test-devcapsule.mycodespace.ai/) +and selects that candidate in **Publish production website** in +ccozianu/devcapsule-website. Production promotion was not performed here. +The release branch is closed and retained; corrections to released guides +belong on docs-0.3.0. Maintenance resumes on +`ws-maintenance/0.3.1-preparation` from the acceptance merge on main. + ## Final acceptance — 2026-10-31 Costin Cozianu answered "Yes to both questions, let's move ahead" after diff --git a/engineering-docs/releases/v0.3.0/final-manifest.json b/engineering-docs/releases/v0.3.0/final-manifest.json new file mode 100644 index 00000000..aa5fcd45 --- /dev/null +++ b/engineering-docs/releases/v0.3.0/final-manifest.json @@ -0,0 +1,59 @@ +{ + "artifacts": { + "devcapsule.pex": "f59e05cdbb5ab157641aae5a27f269f963400a650c1ae3db1650e1881a6df714" + }, + "base-references": [ + "docker.io/mycodespaceai/devcapsule-base@sha256:d7047ced8556cd35964fcc058a1101cf2b5b202f7a5daa2fdd434dcda5ed82c9" + ], + "frozen-inputs": { + "distributions": { + "annotated_types-0.7.0-py3-none-any.whl": "0266aff6ccf0882a4174e6e6a78b55166637f07d8f9cac1fb37e6a893d5bbc7a", + "pydantic-2.13.4-py3-none-any.whl": "25cebe815e819db0792fa7d04367035fcac696b03388e57c0a2a4c553f700429", + "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl": "a38810a1fc628ea053ad53c16ddaadbe6a87c15ddd66884428ed2d8652453462", + "python_on_whales-0.81.0-py3-none-any.whl": "599c82ffb08ca10c655ac95eb4369ded0c07ffb96a14293fa010b576c40d2b6c", + "typing_extensions-4.16.0-py3-none-any.whl": "9804846b9fd8a78a061cd71e718cb1bebeb66083ed04e6f44b8fa5d64fe6f569", + "typing_inspection-0.4.2-py3-none-any.whl": "99fc01324dbf9249637799994497d65831118f1ba48f220561939dafacf8a1bc" + }, + "files": { + "dev-requirements.txt": "d4ca1922d75b6730117488500283078cc6dcc428201dad9cc666ce55c7905685", + "pyproject.toml": "2ecbecb9867d6c2fc1fe2db5ce543dbb013e73fa1370f308a45b70332342cf39", + "requirements.txt": "1863b864ffbb44010d53a159231c45ded63c675a156ad3908a56b0ced98c4c72", + "scripts/build-pex.sh": "b3db63185ec330a1515e8f16b1b2802a32f2dccbec5fc18e83062673e6c2d13f" + }, + "python": { + "hash": "5acfa3e9ba26b51ae161c83aff278da915b590d22373a424b2ba55b8afe91fcc", + "name": "cpython-3.12.14+20260814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz" + } + }, + "prerelease": false, + "promotion": { + "main-revision": "31d44fa473a86f608110caa53ee38c6aef40a717", + "path": "engineering-docs/releases/v0.3.0.json", + "record": { + "accepted-by": "Costin Cozianu", + "candidate-sha256": "413b1d45bac9c39b6fa5fab68090e43550c9e255108de48b387c50a715c4fcf2", + "candidate-tag": "v0.3.0-rc9", + "evidence": [ + "On 2026-10-31 Costin Cozianu requested final 0.3.0 publication after the verified RC9 restart, then answered \"Yes to both questions, let's move ahead\" to the final scope/provider dispositions. C17 and the nine undecided September 28 documentation proposals move to 0.3.1 planning; RC9 is accepted with the documented provider/editor verification limits. This does not assert additional unobserved provider actions.", + "RC9 publication succeeded: https://github.com/ccozianu/devcapsule/actions/runs/41181720227 ; downloaded assets, checksum and source identity verified. Candidate source integrated through PR #331 at main 4b59b10daede8b77ff7c7aee753b9df483d62458.", + "Eight downloaded-PEX E2E tests passed, including clean-machine, component-cache, exact launcher delivery and runtime/display lifecycle; the two-capsule shared-browser authentication regression passed against the fixed published base. Evidence: engineering-docs/wip/2026-09-18-maintenance/evidence/2026-10-31-rc9/published/.", + "Owner restarted after clearing the saved RC0 local-base override. Running PEX matches RC9; actual environment layers match published base image 5405ee00017d77b907fb78c44eab94a819e536c4c0acb600b28dee86b2ff0e68; installed console security code matches the fix. Console authenticated/anonymous probes pass; host-X11 rather than noVNC is selected.", + "Nine in-capsule inspection commands pass across project root, descendant and /opt; unknown subcommand gives the correct diagnostic. Packaged RC9 passed 18 unpacked-cache/network regression cases; published-PEX recursive successor launches, inspects and cleans up in a fresh isolated workspace. Fresh Codium launch accepts run-once host networking with no project recommendation and saved access denied.", + "Full source gate before RC9: 2645 unit, 18 packaging and 374 console tests plus type/syntax/CLI/PEX/docs checks. Website checked 252 pages and 21031 links/assets/anchors. Release notes, promoted manifest and docs branch match RC9; release-docs check passes.", + "Final freshness recheck: Codex 0.166.0 and Antigravity 1.4.12 unchanged; Claude latest 2.1.316 versus tested 2.1.314. Hold tested RC9 pins for the requested final promotion; review newer Claude during 0.3.1 preparation. Provider/editor verification limits remain explicit." + ], + "integration": { + "baseline": "3c91183ffd2130f6c7b40d2f9e3fd41588f977eb", + "method": "ancestry" + }, + "schema-version": 1, + "source-revision": "475427da033633ff5ee0e44e09face700630bf36", + "tag": "v0.3.0" + } + }, + "release-branch": "release-0.3.0", + "schema-version": 2, + "source-revision": "475427da033633ff5ee0e44e09face700630bf36", + "tag": "v0.3.0", + "version": "0.3.0" +} diff --git a/engineering-docs/releases/v0.3.0/final-verification.json b/engineering-docs/releases/v0.3.0/final-verification.json new file mode 100644 index 00000000..128d9e0b --- /dev/null +++ b/engineering-docs/releases/v0.3.0/final-verification.json @@ -0,0 +1,33 @@ +{ + "verified_at": "2026-10-31T09:25:44.494947+00:00", + "release_url": "https://github.com/ccozianu/devcapsule/releases/tag/v0.3.0", + "workflow_url": "https://github.com/ccozianu/devcapsule/actions/runs/41188312058", + "identity": { + "build_mnemonic": "v0.3.0", + "schema_version": 2, + "source_repository": "https://github.com/ccozianu/devcapsule", + "source_revision": "475427da033633ff5ee0e44e09face700630bf36", + "source_url": "https://github.com/ccozianu/devcapsule/commit/475427da033633ff5ee0e44e09face700630bf36", + "version": "0.3.0" + }, + "sha256": "f59e05cdbb5ab157641aae5a27f269f963400a650c1ae3db1650e1881a6df714", + "download_directory": "/home/devcapsule/.cache/devcapsule-release-prep/0.3.0/published", + "checksum_verified": true, + "accepted_candidate": "v0.3.0-rc9", + "promotion_record_matches_main": true, + "base_and_frozen_inputs_match_candidate": true, + "acceptance_main_revision": "31d44fa473a86f608110caa53ee38c6aef40a717", + "publication_result": "success", + "release_is_draft": false, + "release_is_prerelease": false, + "assets": [ + "devcapsule.pex", + "devcapsule.pex.sha256", + "release-manifest.json" + ], + "test_website_run": "https://github.com/ccozianu/devcapsule/actions/runs/41188626026", + "test_website_result": "success; deployed content and candidate metadata verified", + "production_website_promotion": "completed by owner; live production metadata matches verified website candidate", + "website_candidate": "website-candidate-41188626026-1", + "website_candidate_url": "https://github.com/ccozianu/devcapsule/releases/tag/website-candidate-41188626026-1" +} diff --git a/engineering-docs/releases/v0.3.0/website-verification.json b/engineering-docs/releases/v0.3.0/website-verification.json new file mode 100644 index 00000000..4f4ce886 --- /dev/null +++ b/engineering-docs/releases/v0.3.0/website-verification.json @@ -0,0 +1,135 @@ +{ + "checked_at": "2026-10-31T09:27:25.859779+00:00", + "pages": { + "/build-info.json": { + "status": 200, + "url": "https://test-devcapsule.mycodespace.ai/build-info.json", + "body": { + "schema": 1, + "builtAt": "2026-10-31T09:25:45.948Z", + "content": { + "revision": "31d44fa473a86f608110caa53ee38c6aef40a717", + "dirty": false, + "sha256": "18cfb99c3fbd155abaf856588f0926bef653242ece1728e615fe45e336e5a3c2" + }, + "implementation": { + "revision": "2bcfe6e22de7563bb9492205b1695b3e6a701651", + "dirty": false + }, + "basePath": "/", + "mode": "production", + "contract": 1, + "current": "0.3.0", + "versions": [ + { + "version": "devel", + "status": "development", + "source": "main", + "revision": "31d44fa473a86f608110caa53ee38c6aef40a717" + }, + { + "version": "0.3.0", + "status": "supported", + "source": "docs-0.3.0", + "revision": "7a813b8050fe8975e4065f716c088d4a026b1cbe" + }, + { + "version": "0.2.15", + "status": "deprecated", + "source": "docs-0.2.15", + "revision": "9e43ec73009b343e9ff71e76438de0bec32f364a" + }, + { + "version": "0.2.14", + "status": "unsupported", + "source": "v0.2.14", + "revision": "abb785d7ad4069606fd3ab84009ca8efeabc22b9" + }, + { + "version": "0.2.12", + "status": "unsupported", + "source": "a989155385026b2e5f80cedb5edc8e1e0f4a6bbd", + "revision": "a989155385026b2e5f80cedb5edc8e1e0f4a6bbd" + } + ], + "page_count": 238 + } + }, + "/": { + "status": 200, + "url": "https://test-devcapsule.mycodespace.ai/", + "mentions_0_3_0": true, + "release_downloads": [] + }, + "/docs/current/": { + "status": 200, + "url": "https://test-devcapsule.mycodespace.ai/docs/current/", + "mentions_0_3_0": true, + "release_downloads": [] + }, + "/releases/": { + "status": 200, + "url": "https://test-devcapsule.mycodespace.ai/releases/", + "mentions_0_3_0": true, + "release_downloads": [] + }, + "/releases/v0.3.0/": { + "status": 200, + "mentions_0_3_0": true, + "release_links": [ + "https://github.com/ccozianu/devcapsule/actions/workflows/tests.yml", + "https://github.com/ccozianu/devcapsule/actions/workflows/tests.yml/badge.svg?branch=main", + "https://github.com/ccozianu/devcapsule/blob/31d44fa473a86f608110caa53ee38c6aef40a717/engineering-docs/releases/v0.3.0/notes.md", + "https://github.com/ccozianu/devcapsule/blob/main/DEVELOPING.md", + "https://github.com/ccozianu/devcapsule/blob/main/LICENSE", + "https://github.com/ccozianu/devcapsule/releases/tag/v0.3.0" + ] + }, + "/docs/0.3.0/": { + "status": 200, + "mentions_0_3_0": true, + "release_links": [ + "https://github.com/ccozianu/devcapsule/actions/workflows/tests.yml", + "https://github.com/ccozianu/devcapsule/actions/workflows/tests.yml/badge.svg?branch=main", + "https://github.com/ccozianu/devcapsule/blob/7a813b8050fe8975e4065f716c088d4a026b1cbe/DEVELOPING.md", + "https://github.com/ccozianu/devcapsule/blob/7a813b8050fe8975e4065f716c088d4a026b1cbe/docs/README.md", + "https://github.com/ccozianu/devcapsule/blob/7a813b8050fe8975e4065f716c088d4a026b1cbe/index.md", + "https://github.com/ccozianu/devcapsule/blob/main/DEVELOPING.md", + "https://github.com/ccozianu/devcapsule/blob/main/LICENSE" + ] + } + }, + "candidate": { + "schema": 1, + "tag": "website-candidate-41188626026-1", + "runId": "41188626026", + "runAttempt": "1", + "contentSha": "31d44fa473a86f608110caa53ee38c6aef40a717", + "websiteSha": "2bcfe6e22de7563bb9492205b1695b3e6a701651", + "digest": "sha256:feb14cb499782540f4d7b051122201650d787bb89cb76c217547702b60ab90ca" + }, + "workflow_result": "success", + "production_promotion": "completed by owner; independently verified", + "production": { + "checked_at": "2026-10-31T09:50:39.079808+00:00", + "url": "https://devcapsule.mycodespace.ai/build-info.json", + "current": "0.3.0", + "content": { + "revision": "31d44fa473a86f608110caa53ee38c6aef40a717", + "dirty": false, + "sha256": "18cfb99c3fbd155abaf856588f0926bef653242ece1728e615fe45e336e5a3c2" + }, + "implementation": { + "revision": "2bcfe6e22de7563bb9492205b1695b3e6a701651", + "dirty": false + }, + "promotion": { + "sourceRun": "https://github.com/ccozianu/devcapsule/actions/runs/41188626026", + "sourceRunAttempt": "1", + "release": "https://github.com/ccozianu/devcapsule/releases/tag/website-candidate-41188626026-1", + "archiveDigest": "sha256:feb14cb499782540f4d7b051122201650d787bb89cb76c217547702b60ab90ca", + "origin": "https://devcapsule.mycodespace.ai", + "transformation": "origin-only: canonical links, social metadata URLs, JSON-LD URLs, robots.txt sitemap reference, sitemap locations" + } + } +} diff --git a/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md b/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md index 2520b00e..56bec76e 100644 --- a/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md +++ b/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md @@ -4,18 +4,150 @@ Mnemonic: `maintenance` Start date: 2026-09-18 -State: integrating final acceptance 2026-10-31; PR #332 awaits owner merge; RC9 accepted with limits; final publication authorized after main integration +State: active 2026-11-03; unit-test conventions slice delivered for the owner's merge; 0.3.1 queue preserved Definition read: WORKFLOW.md@d2ccbbe43dfa, WORKFLOW-LOCAL.md@65501b3407db Integration target: `main` -Delivery method: pull request from `release-0.3.0` to `main` before each candidate tag, as the runbook rules; the owner merges; `gh` authorized to create, update and consult pull requests since 2026-10-08 +Delivery method: ordinary maintenance PRs to `main`; owner merges. No records-only PR. The 0.3.0 release is published; website production promotion remains owner-operated. -Branch association: `release-0.3.0` (retained release); `ws-maintenance/0.3.0-acceptance` (temporary mainline acceptance delivery), the release branch, the workstream's selection from the cut to the final tag; `ws-maintenance/session-logs` (PR #207) and `ws-maintenance/log-rotation` (PR #209, then #216) are merged to `main` and closed; `ws-maintenance/post-0.2.15` is merged through PR #172 and closed; release-0.2.15 is closed and retained +Branch association: `ws-maintenance/test-conventions`, from `ws-maintenance/0.3.1-preparation` merged with main b3f10b7d, carrying the 0.3.1 preparation records to main with this slice; `ws-maintenance/0.3.1-preparation` from main 31d44fa4; `release-0.3.0` closed after final publication and retained with its tags; `ws-maintenance/0.3.0-acceptance` merged through #332 and closed; earlier slice branches are historical Requirements: `R-PRODUCT-006`, `R-COMPAT-001`, `R-PRODUCT-002`, `R-CONSOLE-001` +## Unit-test conventions — 2026-11-03 + +The owner resumed from travel and ran `nox -s build` in the dogfood capsule: +18 failures, 2711 passed, none a product regression. Thirteen tests read the +owner's accepted claude-code channel through the launcher's mounted settings +at `/etc/devcapsule/home/settings.toml`, which `settings_source` consults +whenever a home has no settings of its own and no named home; the autouse +isolation fixture moves HOME and XDG but deletes `DEVCAPSULE_CONFIG_HOME`, +so inside a capsule every test's private home falls back to the mount. +Four tests read the repository's own manifest and lock, which the owner's +checkout carries migrated to schema 2 against a local base build. One +scanned `tests/` for a forbidden word and hit a sample project's `.venv`. +Verified: the thirteen pass with the launch context hidden, the four pass +on a clean worktree of HEAD. + +The owner's diagnosis, accepted: these tests state no contract. A hard-coded +value tests only that the file still says what it said; the precondition the +assertion hinges on was inherited from the machine. Measured over the +project's own suite: 1525 test functions, 61 with a docstring, 237 with more +than twelve lines before the first assertion, 29 asserting a version or +digest literal, 46 of 110 files named after a module; over the 0.3.0 cycle +the tests changed 13.3k lines against 12.7k in the product, with 9 of 402 +commits touching tests alone. Pair review had endorsed the dissected test by +name and dismissed its private monkeypatch as "confined to tests". + +Delivered on `ws-maintenance/test-conventions`, by owner order, as +[PR #335](https://github.com/ccozianu/devcapsule/pull/335) to `main`; +the owner merges: + +- *Unit Tests* in `WORKFLOW-LOCAL.md`: mirror placement, the Hoare triple + with the precondition established by the test, a docstring stating the + contract, a declared public surface as the precondition of testability, + the `legacy` marker on existing files that only shrink, fix-and-move on + touch, the reviewer's duty in the Pair Review Loop. The humane companion + carries the motivation. +- `scripts/validate_unittests_follow_conventions.py`, run in the `tests` and `build` sessions + and as a `tests.yml` step against the PR's base SHA: placement, docstrings, + and legacy files compared with the merge base. Its own tests are the first + mirror file, `tests/unit/scripts/test_validate_unittests_follow_conventions.py`, 15 cases in + triple form. Against the suite: 110 legacy files, 1525 legacy tests, 0 + breaches. +- All 110 existing test files marked `legacy`; the marker registered in + `pyproject.toml`; the review brief template and the unit-tests guide + updated, the guide's stale fixture list corrected. + +Out of this slice, queued: the isolation fixture should set +`DEVCAPSULE_CONFIG_HOME` so a capsule's mount is never consulted (joins the +release-independent fixtures item); the shared `project`, `config` and +`record` helpers imported across test modules move to the unit tree's +conftest before legacy tests start moving; a workstream for the measured +refactor of the legacy debt, module by module, with the owner choosing the +module; frameworks for contracts and property-based testing to be decided +inside its first slice. + +## Paused for travel — 2026-10-31 + +The owner requested a travel break. Maintenance is deliberately paused on +ws-maintenance/0.3.1-preparation. Final 0.3.0 artifacts and production website +are independently verified, the production handoff is complete, and no +release operation remains. The 0.3.1 queue below is preserved; implementation +has not started. No waiting mail was present at pause. Records are committed, +pushed and published; the active claim is released. + +Resume only on the owner's return. Read Open Threads and the 0.3.1 preparation +queue, recheck remote/main and live coordination state, then settle the first +slice. Release-independent test fixtures remain the proposed starting point. + +## 0.3.0 delivery complete — 2026-10-31 + +The owner confirmed production promotion complete ("All done"). Independent +HTTPS inspection of production build-info confirms current 0.3.0, content +31d44fa4 and the exact reviewed website-candidate-41188626026-1 with matching +bundle digest. [Evidence](../../releases/v0.3.0/website-verification.json). +No release handoff remains. Earlier pending-production statements below are +superseded. Maintenance remains on ws-maintenance/0.3.1-preparation; no new +implementation task was started by this release-closing checkpoint. + +## 0.3.0 published; 0.3.1 preparation — 2026-10-31 + +Verified owner merge of #332 at main 31d44fa473a86f608110caa53ee38c6aef40a717. +Validated acceptance identity/ancestry, exact candidate documentation and +matching docs-0.3.0 tree before creating v0.3.0 at accepted RC9 source +475427da033633ff5ee0e44e09face700630bf36. No release synchronization or source +change was needed. Final publication succeeded in +[run 41188312058](https://github.com/ccozianu/devcapsule/actions/runs/41188312058). +[The release](https://github.com/ccozianu/devcapsule/releases/tag/v0.3.0) is +public, non-draft and final, with all three assets. + +Independently downloaded/checksummed the final PEX and verified version, +mnemonic, source, embedded mainline acceptance, base and frozen build inputs. +Final PEX SHA-256 f59e05cdbb5ab157641aae5a27f269f963400a650c1ae3db1650e1881a6df714. +[Final verification](../../releases/v0.3.0/final-verification.json). +The release branch and tags are retained and closed for development. Local +release-side records remain at 4aedfb74; all their delivery reached main +through #332. Do not tag their tip or merge it over main's metadata. + +At the owner's direction to prepare 0.3.1, selected a fresh branch +ws-maintenance/0.3.1-preparation from fetched main 31d44fa4. This is still +maintenance. Main already carries 0.3.1.dev0, so no version bump or release +branch cut is needed. Its current workflow and local rules are unchanged +apart from the intentional main development-version frontmatter. New status +and release-verification records travel with the next deliverable, and live +state is published on coordination; no administrative PR is opened. + +Test-site run 41188626026 succeeded (build, deploy and candidate). Live +build-info and HTTP checks verify current 0.3.0, content main 31d44fa4 and +docs-0.3.0 at 7a813b80. [Website verification](../../releases/v0.3.0/website-verification.json). +The published candidate is website-candidate-41188626026-1, bundle SHA-256 +feb14cb499782540f4d7b051122201650d787bb89cb76c217547702b60ab90ca. +The owner reviews test-devcapsule.mycodespace.ai and promotes this candidate +through devcapsule-website's Publish production website workflow. This is the +remaining release handoff; production deployment was not performed here. +Delivery/routing notice sent to project-management and website through +coordination mail at 35e5c6a599cd. GitHub Latest now resolves to v0.3.0. + +### 0.3.1 preparation queue + +| Item | Owner | Disposition / next action | +|---|---|---| +| [Release-independent test fixtures](../../bugs/devcapsule/2026-10-31-release-dependent-test-fixtures.md) | maintenance | Confirmed minor, target 0.3.1; proposed first implementation slice. Use stable fixtures for behavior tests and retain independent real-pin/historical-contract checks. | +| [October 25 documentation order](../../work-orders/2026-10-25-documentation-orientation-and-concepts.md) | maintenance | Parts A and B assigned to 0.3.1; plan their delivery against the now-complete 0.3.0 guides. | +| C17 generic project-operation instructions | workflow-improvements | Moved to 0.3.1 planning by the owner's final disposition; scheduling mail delivered at 6fe8ac4cfbb9. Do not implement from maintenance. | +| Nine September 28 documentation proposals | project-management / user-docs | Moved to 0.3.1 planning; item-level choices still pending, not blanket implementation approval. | +| Claude Code freshness | maintenance | Final check found 2.1.316 versus accepted 2.1.314; recheck the vendor before a 0.3.1 pin update. No new pin selected yet. | +| Image/cache cleanup and empty-cache IDE reuse | maintenance | Excluded from 0.3.0; revisit scope in 0.3.1 planning. The older bug target still needs reconciliation with the recorded deferral. | +| Remaining open bug triage | maintenance | Legacy-lock IDE replacement, JSON-help/retired-command hints, old-project compatibility proof, unchanged-manifest writes; targets remain unassigned. The old workstation-command record is stale after the delivered home API and needs evidence-based reconciliation. | + +No 0.3.1 implementation, new release branch or candidate has been started. +The retained 0.9/1.0 bugs stay at their own targets; preparation does not +silently pull them into 0.3.1. The workstream intake contains only its README; +no mail waited at resumption. Earlier release sequences below are historical. + ## Acceptance delivery PR #332 — 2026-10-31 [PR #332](https://github.com/ccozianu/devcapsule/pull/332), @@ -2768,11 +2900,10 @@ launch was taken into intake and committed. No source was changed. ## Planned Next Step -Current: owner merges acceptance PR #332. Then verify remote main, -check accepted-source docs, tag v0.3.0 at RC9's exact source, await hosted -publication, download/check final assets and inspect the test-site dispatch. -No further publication approval is needed. Continue to 0.3.1 maintenance -preparation only after this final delivery. +Current: 0.3.0 delivery is complete. Maintenance is ready for 0.3.1 +planning from the queue above; the +release-independent fixture bug is the proposed first implementation slice. +No repeat 0.3.0 product testing is needed without new evidence of a problem. Historical candidate sequencing below must not override this direction. 1. The network-node slice, on `ws-maintenance/0.3.0-network-node` from @@ -3620,14 +3751,29 @@ claimed. No final release or graphical/end-user acceptance is claimed yet. ## Open Threads -- Final scope and acceptance are settled by the owner's "Yes to both" - response, recorded above. The ephemeral decision has been removed only - after preserving its outcomes here. Do not ask these choices again. -- Mainline acceptance integration is pending in PR #332. The human must merge the PR - under WORKFLOW-LOCAL.md; final tagging after that is already authorized. -- Release records are retained locally; the acceptance branch carries their - delivery and coordination carries live status. RC9's tag and published - source are unchanged. No final tag or 0.3.1 development branch exists yet. +- Paused for owner travel on 2026-10-31. No work continues during the break. +- On return, confirm the first 0.3.1 slice; release-independent test fixtures + are proposed. The nine documentation proposals still need item-level + decisions with project-management; C17 belongs to workflow-improvements. +- No unresolved 0.3.0 release operation remains. Final artifacts, accepted + source and production website provenance are preserved in release records. +- Scratch caches and raw logs are reproducible and not required to resume. + Credentials, tokened links and deleted console decision state are deliberately + not preserved in Git. All consequential decisions are in normal records. + + +- Final 0.3.0 and its production website are published and independently + verified. The owner promotion handoff is complete; no release action remains. +- Maintenance now selects ws-maintenance/0.3.1-preparation from main 31d44fa4. + Scope candidates and outstanding item-level decisions are listed above. + No implementation slice is underway; the fixture bug is proposed first. +- Final verification/status changes remain on this new branch for the next + deliverable; coordination carries live routing. No records-only PR. +- Preserve the accepted source, final/candidate tags, final manifest and + verification facts. Scratch downloads/logs can be reproduced. Credentials, + tokened links and obsolete console decision state are not durable records. + +Earlier threads below are historical and superseded by the current state: - RC9 is published from release 475427da and integrated through #331 at main 4b59b10d. Eight downloaded E2E checks and the shared-browser regression