From 1c00b9401354f13717e5689545f879c2b2652853 Mon Sep 17 00:00:00 2001 From: Costin Cozianu Date: Thu, 5 Nov 2026 00:13:18 +0000 Subject: [PATCH] Tests: move seventeen capsule-reading legacy tests to the mirror, expected to fail inside a capsule Seventeen tests failed in the owner's capsule after the sync with main at cc8f1288, and fail the same on a clean checkout of main: thirteen inherit the capsule's mounted launcher settings, where a vendor download is accepted; three read this checkout's live .devcapsule configuration; one walks an ignored directory under the test resources. Each reads a precondition from outside itself, against Unit Tests rule 2. The owner's disposition: mark them expected to fail with the reason "TODO: fix the wrong approach to testing" and move them out of the legacy files so the convention gate keeps holding. Each test leaves its legacy file verbatim, with a one-line docstring naming its cause, for a mirror file under tests/unit/devcapsule/legacy_refactoring/, one per legacy file; the targets are the temporary package devcapsule/legacy_refactoring, eight modules holding nothing but the docstring that says why they exist. The marker holds only inside a capsule, so on the hosted workflow and on a host these remain the tests they were. The one body change is the path to devcapsule-src in test_replaced_scope_word_is_absent, taken from the mirror file's deeper place. Verified in a capsule: nox -s tests green, the checker at 108 legacy files holding 1447 legacy tests, 30 files following the convention, 0 breaches; nox -s typecheck green. The fix of each test against its real unit is queued on the maintenance workstream, the private-home fixture first. Co-Authored-By: Claude Fable 5.1 --- CURRENT-STATUS.md | 2 +- .../devcapsule/legacy_refactoring/__init__.py | 1 + .../capability_commands_v2.py | 12 ++ .../legacy_refactoring/capability_minimums.py | 12 ++ .../legacy_refactoring/console_channel.py | 12 ++ .../environment_realization.py | 12 ++ .../devcapsule/legacy_refactoring/home.py | 12 ++ .../legacy_refactoring/project_init.py | 12 ++ .../repository_manifest_compatibility.py | 12 ++ .../devcapsule/legacy_refactoring/trust.py | 12 ++ .../tests/test_capability_commands_v2.py | 17 -- .../tests/test_capability_minimums.py | 13 -- devcapsule-src/tests/test_console_channel.py | 32 ---- .../tests/test_environment_realization.py | 15 -- devcapsule-src/tests/test_home.py | 20 --- devcapsule-src/tests/test_project_init.py | 19 --- .../test_repository_manifest_compatibility.py | 78 --------- devcapsule-src/tests/test_trust.py | 120 ------------- .../devcapsule/legacy_refactoring/__init__.py | 0 .../test_capability_commands_v2.py | 36 ++++ .../test_capability_minimums.py | 33 ++++ .../test_console_channel.py | 52 ++++++ .../test_environment_realization.py | 35 ++++ .../legacy_refactoring/test_home.py | 38 +++++ .../legacy_refactoring/test_project_init.py | 40 +++++ .../test_repository_manifest_compatibility.py | 101 +++++++++++ .../legacy_refactoring/test_trust.py | 157 ++++++++++++++++++ .../2026-09-18-maintenance/CURRENT-STATUS.md | 76 ++++++++- 28 files changed, 665 insertions(+), 316 deletions(-) create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/__init__.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/capability_commands_v2.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/capability_minimums.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/console_channel.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/environment_realization.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/home.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/project_init.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/repository_manifest_compatibility.py create mode 100644 devcapsule-src/devcapsule/legacy_refactoring/trust.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/__init__.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_commands_v2.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_minimums.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_console_channel.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_environment_realization.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_home.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_project_init.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_repository_manifest_compatibility.py create mode 100644 devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_trust.py diff --git a/CURRENT-STATUS.md b/CURRENT-STATUS.md index 34c2de5e..70d1ca9e 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 | active 2026-11-04; #335 and #336 merged; first legacy test move, PR #337, awaits the owner's merge; 0.3.1 queue preserved | `ws-maintenance/base-consent-test`; earlier slice branches merged and closed; `release-0.3.0` closed and retained | [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-04; #335, #336 and #337 merged; seventeen capsule-reading tests marked expected to fail at the owner's direction, fix queued; 0.3.1 queue preserved | `ws-maintenance/base-consent-test`; earlier slice branches merged and closed; `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/devcapsule-src/devcapsule/legacy_refactoring/__init__.py b/devcapsule-src/devcapsule/legacy_refactoring/__init__.py new file mode 100644 index 00000000..914d0eda --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/__init__.py @@ -0,0 +1 @@ +"""Temporary target modules for legacy tests under refactoring; see each module's docstring. Deleted when empty.""" diff --git a/devcapsule-src/devcapsule/legacy_refactoring/capability_commands_v2.py b/devcapsule-src/devcapsule/legacy_refactoring/capability_commands_v2.py new file mode 100644 index 00000000..01f3f640 --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/capability_commands_v2.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_capability_commands_v2.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_capability_commands_v2.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/capability_minimums.py b/devcapsule-src/devcapsule/legacy_refactoring/capability_minimums.py new file mode 100644 index 00000000..22973479 --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/capability_minimums.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_capability_minimums.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_capability_minimums.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/console_channel.py b/devcapsule-src/devcapsule/legacy_refactoring/console_channel.py new file mode 100644 index 00000000..06eb586f --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/console_channel.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_console_channel.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_console_channel.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/environment_realization.py b/devcapsule-src/devcapsule/legacy_refactoring/environment_realization.py new file mode 100644 index 00000000..446daa41 --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/environment_realization.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_environment_realization.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_environment_realization.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/home.py b/devcapsule-src/devcapsule/legacy_refactoring/home.py new file mode 100644 index 00000000..6b25bc8f --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/home.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_home.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_home.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/project_init.py b/devcapsule-src/devcapsule/legacy_refactoring/project_init.py new file mode 100644 index 00000000..e61e042e --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/project_init.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_project_init.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_project_init.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/repository_manifest_compatibility.py b/devcapsule-src/devcapsule/legacy_refactoring/repository_manifest_compatibility.py new file mode 100644 index 00000000..7d41d586 --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/repository_manifest_compatibility.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_repository_manifest_compatibility.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_repository_manifest_compatibility.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/devcapsule/legacy_refactoring/trust.py b/devcapsule-src/devcapsule/legacy_refactoring/trust.py new file mode 100644 index 00000000..cf32283c --- /dev/null +++ b/devcapsule-src/devcapsule/legacy_refactoring/trust.py @@ -0,0 +1,12 @@ +"""Temporary target module while the legacy tests of ``tests/test_trust.py`` are refactored. + +This module serves only as the mirror target of +``tests/unit/devcapsule/legacy_refactoring/test_trust.py`` under *Unit Tests* +rule 1 of ``WORKFLOW-LOCAL.md``. It holds no code. The tests mirrored here are +the ones marked expected to fail on 2026-11-04 with the reason +``TODO: fix the wrong approach to testing``; each is rewritten against its +real unit as the maintenance workstream refactors it, and this module is +deleted when the last one leaves. +""" + +__all__: list[str] = [] diff --git a/devcapsule-src/tests/test_capability_commands_v2.py b/devcapsule-src/tests/test_capability_commands_v2.py index c10f5e2c..bbc883ff 100644 --- a/devcapsule-src/tests/test_capability_commands_v2.py +++ b/devcapsule-src/tests/test_capability_commands_v2.py @@ -179,23 +179,6 @@ def test_run_choices_reach_plan_and_save_only_when_requested(project, matrix, sa assert path.read_bytes() == before -@pytest.mark.parametrize("origin", ["project", "checkout", "run"]) -def test_resolution_grants_no_consent_and_no_partial_save(project, matrix, tmp_path, origin): - assert config(project, "ide", "frontend-ide") == 0 - assert config(project, "authorize", "base-image", "default") == 0 - assert config(project, "add", "assistant") == 0 - if origin == "project": - assert config(project, "recommend", "assistant", "claude-code") == 0 - assert config(project, "use", "assistant", "default") == 0 - elif origin == "checkout": - assert config(project, "use", "assistant", "claude-code") == 0 - before = snapshot(tmp_path) - flags = RunFlags(providers=(("assistant", "claude-code"),) if origin == "run" else (), memory="6g", save=True) - with pytest.raises(DecisionPending, match="claude"): - prepare_launch(project, flags, interactive=False) - assert snapshot(tmp_path) == before - - def test_changed_resolution_keeps_component_consent(project, matrix): assert config(project, "ide", "frontend-ide") == 0 assert config(project, "authorize", "base-image", "default") == 0 diff --git a/devcapsule-src/tests/test_capability_minimums.py b/devcapsule-src/tests/test_capability_minimums.py index b0ab2a4b..189a1a5e 100644 --- a/devcapsule-src/tests/test_capability_minimums.py +++ b/devcapsule-src/tests/test_capability_minimums.py @@ -287,19 +287,6 @@ def test_every_owner_preview_leaves_all_files_unchanged(project: Path, tmp_path: assert snapshot(tmp_path) == before -def test_offered_agent_still_needs_consent_and_can_be_omitted(project: Path, tmp_path: Path, capsys) -> None: - write_project(project, MANIFEST.replace('"python>=3.14", ', '')) - assert cli.main(["project", "--path", str(project), "init", "--ide", "frontend-ide", "--authorize", "base-image", "default"]) == 0 - owner_commands.offer_tools(project, ["claude-code-agent"]) - before = snapshot(tmp_path) - assert cli.main(["project", "--path", str(project), "run", "--print-command", "--no-update-check"]) == 3 - assert "claude-code" in capsys.readouterr().err - assert snapshot(tmp_path) == before - assert cli.main(["project", "--path", str(project), "config", "omit", "claude-code-agent"]) == 0 - prepared = prepare_launch(project, RunFlags(), interactive=False, print_only=True) - assert "claude-code" not in prepared.selected.lock["components"] - - def test_owner_drop_recognizes_a_handwritten_component_alias(project: Path) -> None: manifest_path, lock_path = write_project(project, MANIFEST.replace('"python>=3.14", ', '')) lock_path.write_text(render_toml(generate_lock(CapabilityPolicy.read(load_toml(manifest_path)), MATRIX))) diff --git a/devcapsule-src/tests/test_console_channel.py b/devcapsule-src/tests/test_console_channel.py index e2dac13c..1a891d03 100644 --- a/devcapsule-src/tests/test_console_channel.py +++ b/devcapsule-src/tests/test_console_channel.py @@ -541,35 +541,3 @@ def test_capability_requests_apply_without_host_confirmation(arguments): @pytest.mark.parametrize("arguments", [["agent", "add", "codex"], ["tool", "omit", "browser-automation"]]) def test_deleted_channel_verbs_are_refused(arguments): assert classify(arguments)[0] is Disposition.REFUSE - - -def test_channel_records_capability_choices_and_preserves_vendor_consent(project, tmp_path, capsys): - from devcapsule.configuration.capabilities import LocalCapabilities - assert config(project, "offer", "browser-automation") == 0 - channel = tmp_path / "channel" - channel.mkdir() - def send(identifier, *arguments): - request(channel, identifier, *arguments) - assert sweep(channel, project, record_path(project)) == 1 - return result(channel, identifier) - assert send("000001-add", "add", "claude-code-agent")["status"] == "recorded" - assert "claude-code-agent" in LocalCapabilities.read(load_toml(record_path(project))).selected - assert send("000002-omit", "omit", "browser-automation")["status"] == "recorded" - assert "browser-automation" in LocalCapabilities.read(load_toml(record_path(project))).without - assert send("000003-restore", "restore", "browser-automation")["status"] == "recorded" - assert "browser-automation" not in LocalCapabilities.read(load_toml(record_path(project))).without - assert send("000004-ide", "ide", "frontend-ide")["status"] == "recorded" - assert send("000005-use", "use", "frontend-ide", "vscode")["status"] == "recorded" - assert LocalCapabilities.read(load_toml(record_path(project))).providers == {"frontend-ide": "vscode"} - # Single-provider capabilities still refuse `use` through the same command path. - for index, (capability, component) in enumerate((("python-ide", "pycharm"), ("vscode-ide", "vscode")), start=6): - expected_status, expected_text = run_config(project, ["use", capability, component]) - assert expected_status == 2 and "choice" in expected_text - refused = send(f"00000{index}-use", "use", capability, component) - assert refused["status"] == "refused" and expected_text.strip() in refused["text"] - capsys.readouterr() - assert config(project, "show", "--json") == 0 - listing = json.loads(capsys.readouterr().out) - assert any(row["name"] == "claude-code-download" and row["pending"] for row in listing["rows"]) - assert any(row["name"] == "vscode-download" and row["pending"] for row in listing["rows"]) - assert deferred_requests(record_path(project)) == [] diff --git a/devcapsule-src/tests/test_environment_realization.py b/devcapsule-src/tests/test_environment_realization.py index 7c0f45e9..f95a82da 100644 --- a/devcapsule-src/tests/test_environment_realization.py +++ b/devcapsule-src/tests/test_environment_realization.py @@ -223,21 +223,6 @@ def test_realize_environment_requires_exact_locked_base_authorization(tmp_path: materialize.assert_not_called() -def test_realize_environment_requires_explicit_claude_download_authorization( - tmp_path: Path, -) -> None: - selected = resolved_project(tmp_path) - select_claude_code(selected, authorized=False) - obtain = Mock() - materialize = Mock() - - with pytest.raises(CliError, match="claude-code-download"): - realize_environment(selected, obtain_image=obtain, materialize=materialize) - - obtain.assert_not_called() - materialize.assert_not_called() - - def test_realize_environment_allows_terms_bound_claude_download_authorization( tmp_path: Path, ) -> None: diff --git a/devcapsule-src/tests/test_home.py b/devcapsule-src/tests/test_home.py index 32901366..b8a044c0 100644 --- a/devcapsule-src/tests/test_home.py +++ b/devcapsule-src/tests/test_home.py @@ -190,23 +190,3 @@ def test_malformed_settings_stop_run_before_project_discovery(home: Path, conten assert cli.main(["project", "run", "--print-command"]) == 2 assert str(path) in capsys.readouterr().err assert list(home.iterdir()) == [path] and path.read_text() == content - - -@pytest.mark.parametrize("folder", ["devcapsule", "tests", "docs"]) -def test_replaced_scope_word_is_absent(folder: str) -> None: - package = Path(__file__).resolve().parents[1] - root = package.parent / "docs" if folder == "docs" else package / folder - forbidden = "work" + "station" - failures = [] - for path in root.rglob("*"): - if not path.is_file() or "__pycache__" in path.parts or ".pytest_cache" in path.parts: - continue - if path.is_relative_to(package / "tests" / "resources" / "compat"): - continue - try: - text = path.read_text() - except UnicodeError: - continue - if forbidden in text.lower(): - failures.append(str(path.relative_to(root))) - assert failures == [] diff --git a/devcapsule-src/tests/test_project_init.py b/devcapsule-src/tests/test_project_init.py index d6ab8cc1..8c040460 100644 --- a/devcapsule-src/tests/test_project_init.py +++ b/devcapsule-src/tests/test_project_init.py @@ -345,25 +345,6 @@ def test_require_tool_refuses_personal_and_unknown_names_without_touching_the_ma assert manifest_path.read_text(encoding="utf-8") == before -def test_a_selected_agent_brings_its_own_acquisition_gate(tmp_path: Path, capsys) -> None: - project = tmp_path / "fresh-project" - project.mkdir() - with patch.dict(os.environ, isolated_env(tmp_path), clear=False): - assert cli.main(full_init_command(project)) == 0 - capsys.readouterr() - - # The agent is the developer's; resolving without its vendor's channel names the channel (D-0011). - assert cli.main(["project", "--path", str(project), "config", "add", "claude-code-agent"]) == 0 - assert run_until_prepared(project) == 3 - assert "home trust accept claude-code" in capsys.readouterr().err - - assert cli.main(["project", "--path", str(project), "config", "authorize", "claude-code-download", "true"]) == 0 - assert run_until_prepared(project) == 0 - from devcapsule.configuration.storage import lock_for - lock = lock_for(project, read_toml(project / ".devcapsule" / "devcapsule.toml"))[1] - assert lock["components"]["claude-code"]["version"] - - def test_init_repairs_a_deleted_checkout_config_tree(tmp_path: Path, capsys) -> None: project = tmp_path / "fresh-project" project.mkdir() diff --git a/devcapsule-src/tests/test_repository_manifest_compatibility.py b/devcapsule-src/tests/test_repository_manifest_compatibility.py index 69e7a8c0..260d8d32 100644 --- a/devcapsule-src/tests/test_repository_manifest_compatibility.py +++ b/devcapsule-src/tests/test_repository_manifest_compatibility.py @@ -49,81 +49,3 @@ def test_repository_manifest_declares_only_released_runtime_effects(): f"{name} declares runtime-effect {effect!r}, which {LATEST_RELEASED_CLIENT} " "rejects; rely on a reserved name or wait for the release that knows it" ) - - -@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") -def test_repository_needs_are_supported_by_released_launcher(): - manifest = tomllib.loads(REPOSITORY_MANIFEST.read_text(encoding="utf-8")) - unknown = set(manifest["capabilities"]["need"]) - RELEASED_CAPABILITIES - assert not unknown, ( - f"repository needs {sorted(unknown)}, unsupported by {LATEST_RELEASED_CLIENT}; " - "test unreleased capabilities in a disposable project instead" - ) - - -@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") -def test_repository_locks_have_released_runtime_templates(): - locks = sorted(REPOSITORY_MANIFEST.parent.glob("devcapsule.*.lock")) - assert locks, "the repository commits its platform lock" - for path in locks: - lock = tomllib.loads(path.read_text(encoding="utf-8")) - components = lock["components"] - assert components["interactive-surface"] in RELEASED_SURFACES, ( - f"{path.name} selects a surface unknown to {LATEST_RELEASED_CLIENT}" - ) - unknown = set(components) - {"interactive-surface"} - RELEASED_COMPONENTS - assert not unknown, ( - f"{path.name} needs runtime templates for {sorted(unknown)} missing from " - f"{LATEST_RELEASED_CLIENT}; restoring only the manifest is insufficient" - ) - - -@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") -def test_repository_lock_is_launchable_by_this_launcher(): - """The committed lock, written by an earlier matrix, still launches here. - - Precondition: ``.devcapsule/devcapsule.linux-amd64.lock`` as committed, - generated by whatever matrix the launcher of its day embedded; as a rule - an earlier generation than the development matrix in this tree. - - Action: read it the way ``project run`` does before it touches Docker, - ``parse_locked_environment``, which validates every artifact declaration - and looks up every component's runtime template. - - Postcondition: no error; the environment names the lock's interactive - surface and base, and one validated artifact set for every other - locally materialized component the lock lists. - - The lock carries its own URLs and checksums, so the embedded matrix plays - no part: a lock may lag the catalog, or pin versions the catalog has since - retired, and must still launch. Nothing here asserts that the lock is the - matrix's newest selection; that is repository housekeeping, done by a - launcher command on the host. This test imports the development reader on - purpose: it is the reader that must stay liberal. - - TODO: this proves only that this repository's own lock still reads. The - contract is wider: every project initialized by an earlier release must - keep launching with a new one, manifest, lock and checkout record alike. - The test that enforces it, over configurations captured from each - released client, is the work item - engineering-docs/bugs/devcapsule/2026-10-18-no-test-proves-old-projects-launch-with-new-releases.md. - """ - - locks = sorted(REPOSITORY_MANIFEST.parent.glob("devcapsule.*.lock")) - assert locks, "the repository commits its platform lock" - for path in locks: - lock = tomllib.loads(path.read_text(encoding="utf-8")) - components = lock["components"] - surface = components["interactive-surface"] - materialized = { - component_id - for component_id, table in components.items() - if component_id not in ("interactive-surface", surface) - and table.get("delivery-policy") == "local-materialization" - } - - environment = parse_locked_environment(lock) - - assert environment.component_id == surface, path.name - assert environment.base_reference == lock["base"]["reference"], path.name - assert {item.component_id for item in environment.ancillary_artifacts} == materialized, path.name diff --git a/devcapsule-src/tests/test_trust.py b/devcapsule-src/tests/test_trust.py index a571b562..b8911c81 100644 --- a/devcapsule-src/tests/test_trust.py +++ b/devcapsule-src/tests/test_trust.py @@ -108,55 +108,6 @@ def test_the_record_round_trips_and_covers_only_what_was_accepted() -> None: HomeTrust.read({"channels": {"x": {"origins": []}}}) -def test_trust_list_accept_and_withdraw(project: Path, capsys) -> None: - assert config(project, "ide", "python-ide") == 0 - assert config(project, "check") == 3 - assert config(project, "trust", "list") == 0 - out = capsys.readouterr().out - assert "devcapsule-base" in out and "not yet" in out and str(settings_path()) in out - assert cli.main(["home", "trust", "accept", "devcapsule-base", "--yes"]) == 0 - out = capsys.readouterr().out - assert "Trust DevCapsule to supply the base images" in out and "Recorded for this DevCapsule home" in out - assert load_toml(settings_path())["trust"]["channels"]["devcapsule-base"]["vendor"] == "DevCapsule" - assert config(project, "show") == 0 - assert "home trust (devcapsule-base)" in capsys.readouterr().out - assert config(project, "check") == 0 - capsys.readouterr() - assert config(project, "trust", "list", "--json") == 0 - listed = json.loads(capsys.readouterr().out) - assert [(row["channel"], row["trusted"]) for row in listed["channels"]] == [("devcapsule-base", True)] - assert withdraw("devcapsule-base") == 0 - assert config(project, "check") == 3 - assert withdraw("devcapsule-base") == 0 - assert accept(project, "codex") == 2 - assert "its channels: devcapsule-base" in capsys.readouterr().err - - -def test_run_trust_flag_records_the_channel_before_the_questions(project: Path) -> None: - with pytest.raises(DecisionPending, match="--trust devcapsule-base"): - prepare_launch(project, RunFlags(ide="python-ide"), interactive=False) - assert not settings_path().exists() - prepared = prepare_launch(project, RunFlags(ide="python-ide", trust=("devcapsule-base",)), interactive=False) - assert prepared.selected.resolution["authorization"]["base-image"]["reference"].startswith("docker.io/mycodespaceai/devcapsule-base@") - assert "devcapsule-base" in load_toml(settings_path())["trust"]["channels"] - assert "Accepted the channel devcapsule-base for this home." in prepared.notes - # Printing the command stages the acceptance for the plan and writes nothing. - assert withdraw("devcapsule-base") == 0 - prepare_launch(project, RunFlags(ide="python-ide", trust=("devcapsule-base",)), print_only=True) - assert not HomeTrust.read(load_trust()).channels - # With another decision pending and no terminal, the flag's acceptance is staged with the other answers: nothing is written. - with pytest.raises(DecisionPending, match="Nothing was written"): - prepare_launch(project, RunFlags(trust=("devcapsule-base",)), interactive=False) # the IDE is still unchosen - assert not HomeTrust.read(load_trust()).channels - # Declined at the prompt: nothing recorded, the launch is still pending. - assert config(project, "ide", "python-ide") == 0 - prompts = io.StringIO() - with pytest.raises(DecisionPending): - prepare_launch(project, RunFlags(), interactive=True, input_stream=io.StringIO("n\n"), output_stream=prompts) - assert "Not accepted. Accept later:" in prompts.getvalue() - assert not HomeTrust.read(load_trust()).channels - - def test_a_trusted_vendor_covers_every_version_and_a_denial_still_wins(project: Path, capsys) -> None: pin_claude_code(project, "1.0.0") assert reviews(project)["claude-code-download"].status == "missing-required" @@ -206,25 +157,6 @@ def test_acceptance_binds_integrity_and_preserves_previously_accepted_origins() assert not HomeTrust.read(document).covers(channel) -def test_changed_artifact_origin_asks_and_lists_the_previous_acceptance(project: Path, capsys) -> None: - pin_claude_code(project, "1.0.0") - assert accept(project, "claude-code") == 0 - lock = load_toml(lock_path(project)) - lock["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://mirror.example.test/claude" - lock_path(project).write_text(render_toml(lock)) - assert reviews(project)["claude-code-download"].status == "missing-required" - capsys.readouterr() - assert config(project, "trust", "list") == 0 - text = capsys.readouterr().out - assert "not covered" in text and "https://mirror.example.test" in text - assert "Accepted origins: https://downloads.example.test" in text - assert "SHA-256" in text and "Anyone who uses this home uses this acceptance" in text - assert accept(project, "claude-code") == 0 - assert reviews(project)["claude-code-download"].status == "trusted" - pin_claude_code(project, "1.1.0") - assert reviews(project)["claude-code-download"].status == "trusted" - - @pytest.mark.parametrize("broken", ["http", "file", "credentials", "digest", "artifacts", "terms"]) def test_unverifiable_lock_cannot_create_or_widen_acceptance(project: Path, broken: str, capsys) -> None: pin_claude_code(project, "1.0.0") @@ -248,38 +180,6 @@ def test_unverifiable_lock_cannot_create_or_widen_acceptance(project: Path, brok assert settings_path().read_bytes() == before -@pytest.mark.parametrize("via", ["flag", "terminal"]) -def test_acceptance_uses_the_checkout_version_set_not_the_shared_lock(project: Path, via: str, capsys) -> None: - from devcapsule.configuration.derivation import load_state - from devcapsule.configuration.file_formats import canonical_digest - assert config(project, "ide", "python-ide") == 0 - assert accept(project, BASE_CHANNEL) == 0 - pin_claude_code(project, "1.0.0") - _, manifest = manifest_for(project) - manifest["capabilities"]["required"].append("claude-code-agent") - (project / ".devcapsule/devcapsule.toml").write_text(render_toml(manifest)) - state = load_state(project, manifest) - selected = state.composed_lock() - selected["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://selected.example.test/claude" - record_path = checkout_record_paths(manifest, project)[0] - record = load_toml(record_path) - record["version-set"] = {"format": 1, "lock": render_toml(selected), "recommendation-digest": canonical_digest(state.shared_lock)} - record_path.write_text(render_toml(record)) - capsys.readouterr() - assert config(project, "trust", "list", "--json") == 0 - listed = json.loads(capsys.readouterr().out) - channel = next(row for row in listed["channels"] if row["channel"] == "claude-code") - assert channel["origins"] == ["https://selected.example.test"] - flags, interactive = RunFlags(trust=("claude-code",) if via == "flag" else ()), via == "terminal" - output = io.StringIO() - prepared = prepare_launch(project, flags, interactive=interactive, input_stream=io.StringIO("y\n"), output_stream=output) - assert prepared.selected.resolution["authorization"]["claude-code-download"] is True - if via == "terminal": - assert "https://selected.example.test" in output.getvalue() - assert "https://downloads.example.test" not in output.getvalue() - assert load_trust()["channels"]["claude-code"]["origins"] == ["https://selected.example.test"] - - def test_trusted_base_replaces_old_published_consent_through_realization(project: Path, monkeypatch, capsys) -> None: from tests.test_upgrade_recovery import OLD_BASE, install_external_fakes, invoke assert config(project, "ide", "python-ide") == 0 @@ -443,23 +343,3 @@ def test_terminal_acceptance_stays_staged_if_a_later_answer_is_missing(project: assert "Trust will be saved when all required answers are complete" in output.getvalue() assert "this DevCapsule home" in output.getvalue() assert snapshot(tmp_path) == before - - -def test_run_does_not_replay_trust_flags_after_an_upgrade_changes_the_channel(project: Path, monkeypatch) -> None: - from tests.test_upgrade_recovery import install_external_fakes, invoke - assert config(project, "ide", "python-ide") == 0 - pin_claude_code(project, "1.0.0") - _, manifest = manifest_for(project) - manifest["capabilities"]["required"].append("claude-code-agent") - (project / ".devcapsule/devcapsule.toml").write_text(render_toml(manifest)) - launch = install_external_fakes(monkeypatch, []) - monkeypatch.setattr("sys.stdin.isatty", lambda: False) - def upgrade(root: Path, *, refresh: bool) -> bool: - lock = load_toml(lock_path(root)) - lock["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://unaccepted.example.test/claude" - lock_path(root).write_text(render_toml(lock)) - return True - monkeypatch.setattr("devcapsule.commands.project.offer_upgrades", upgrade) - assert invoke(project, "run", "--trust", BASE_CHANNEL, "--trust", "claude-code", "--no-update-check") == 3 - launch.assert_not_called() - assert load_trust()["channels"]["claude-code"]["origins"] == ["https://downloads.example.test"] diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/__init__.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_commands_v2.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_commands_v2.py new file mode 100644 index 00000000..ba51d22e --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_commands_v2.py @@ -0,0 +1,36 @@ +"""Legacy tests of ``tests/test_capability_commands_v2.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/capability_commands_v2.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +import pytest +from devcapsule.commands._run_flow import RunFlags, prepare_launch +from devcapsule.compat import DecisionPending +from tests.test_run_flow import project, config +from tests.test_capability_commands_v2 import matrix, snapshot +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.parametrize("origin", ["project", "checkout", "run"]) +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_resolution_grants_no_consent_and_no_partial_save(project, matrix, tmp_path, origin): + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + assert config(project, "ide", "frontend-ide") == 0 + assert config(project, "authorize", "base-image", "default") == 0 + assert config(project, "add", "assistant") == 0 + if origin == "project": + assert config(project, "recommend", "assistant", "claude-code") == 0 + assert config(project, "use", "assistant", "default") == 0 + elif origin == "checkout": + assert config(project, "use", "assistant", "claude-code") == 0 + before = snapshot(tmp_path) + flags = RunFlags(providers=(("assistant", "claude-code"),) if origin == "run" else (), memory="6g", save=True) + with pytest.raises(DecisionPending, match="claude"): + prepare_launch(project, flags, interactive=False) + assert snapshot(tmp_path) == before diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_minimums.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_minimums.py new file mode 100644 index 00000000..6dff360a --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_capability_minimums.py @@ -0,0 +1,33 @@ +"""Legacy tests of ``tests/test_capability_minimums.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/capability_minimums.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +from pathlib import Path +import pytest +from devcapsule import cli +from devcapsule.commands._run_flow import RunFlags, prepare_launch +from devcapsule.configuration import owner_commands +from tests.test_capability_minimums import MANIFEST, project, snapshot, write_project +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_offered_agent_still_needs_consent_and_can_be_omitted(project: Path, tmp_path: Path, capsys) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + write_project(project, MANIFEST.replace('"python>=3.14", ', '')) + assert cli.main(["project", "--path", str(project), "init", "--ide", "frontend-ide", "--authorize", "base-image", "default"]) == 0 + owner_commands.offer_tools(project, ["claude-code-agent"]) + before = snapshot(tmp_path) + assert cli.main(["project", "--path", str(project), "run", "--print-command", "--no-update-check"]) == 3 + assert "claude-code" in capsys.readouterr().err + assert snapshot(tmp_path) == before + assert cli.main(["project", "--path", str(project), "config", "omit", "claude-code-agent"]) == 0 + prepared = prepare_launch(project, RunFlags(), interactive=False, print_only=True) + assert "claude-code" not in prepared.selected.lock["components"] diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_console_channel.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_console_channel.py new file mode 100644 index 00000000..2f7713e2 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_console_channel.py @@ -0,0 +1,52 @@ +"""Legacy tests of ``tests/test_console_channel.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/console_channel.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +import json +import pytest +from devcapsule.commands._console_channel import run_config, sweep +from devcapsule.configuration.console_requests import deferred_requests +from devcapsule.configuration.storage import load_toml +from tests.test_console_channel import config, project, record_path, request, result +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_channel_records_capability_choices_and_preserves_vendor_consent(project, tmp_path, capsys): + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + from devcapsule.configuration.capabilities import LocalCapabilities + assert config(project, "offer", "browser-automation") == 0 + channel = tmp_path / "channel" + channel.mkdir() + def send(identifier, *arguments): + request(channel, identifier, *arguments) + assert sweep(channel, project, record_path(project)) == 1 + return result(channel, identifier) + assert send("000001-add", "add", "claude-code-agent")["status"] == "recorded" + assert "claude-code-agent" in LocalCapabilities.read(load_toml(record_path(project))).selected + assert send("000002-omit", "omit", "browser-automation")["status"] == "recorded" + assert "browser-automation" in LocalCapabilities.read(load_toml(record_path(project))).without + assert send("000003-restore", "restore", "browser-automation")["status"] == "recorded" + assert "browser-automation" not in LocalCapabilities.read(load_toml(record_path(project))).without + assert send("000004-ide", "ide", "frontend-ide")["status"] == "recorded" + assert send("000005-use", "use", "frontend-ide", "vscode")["status"] == "recorded" + assert LocalCapabilities.read(load_toml(record_path(project))).providers == {"frontend-ide": "vscode"} + # Single-provider capabilities still refuse `use` through the same command path. + for index, (capability, component) in enumerate((("python-ide", "pycharm"), ("vscode-ide", "vscode")), start=6): + expected_status, expected_text = run_config(project, ["use", capability, component]) + assert expected_status == 2 and "choice" in expected_text + refused = send(f"00000{index}-use", "use", capability, component) + assert refused["status"] == "refused" and expected_text.strip() in refused["text"] + capsys.readouterr() + assert config(project, "show", "--json") == 0 + listing = json.loads(capsys.readouterr().out) + assert any(row["name"] == "claude-code-download" and row["pending"] for row in listing["rows"]) + assert any(row["name"] == "vscode-download" and row["pending"] for row in listing["rows"]) + assert deferred_requests(record_path(project)) == [] diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_environment_realization.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_environment_realization.py new file mode 100644 index 00000000..982bdd63 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_environment_realization.py @@ -0,0 +1,35 @@ +"""Legacy tests of ``tests/test_environment_realization.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/environment_realization.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +from pathlib import Path +from unittest.mock import Mock +import pytest +from devcapsule.compat import CliError +from devcapsule.environment_realization import realize_environment +from tests.test_environment_realization import resolved_project, select_claude_code +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_realize_environment_requires_explicit_claude_download_authorization( + tmp_path: Path, +) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + selected = resolved_project(tmp_path) + select_claude_code(selected, authorized=False) + obtain = Mock() + materialize = Mock() + + with pytest.raises(CliError, match="claude-code-download"): + realize_environment(selected, obtain_image=obtain, materialize=materialize) + + obtain.assert_not_called() + materialize.assert_not_called() diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_home.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_home.py new file mode 100644 index 00000000..db3f57d5 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_home.py @@ -0,0 +1,38 @@ +"""Legacy tests of ``tests/test_home.py`` marked expected to fail on 2026-11-04, moved verbatim but for one path. + +The path to ``devcapsule-src`` is taken from this file's place in the mirror, four levels deeper +than the legacy file's. +Mirror of ``devcapsule/legacy_refactoring/home.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +from pathlib import Path +import pytest +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.parametrize("folder", ["devcapsule", "tests", "docs"]) +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_replaced_scope_word_is_absent(folder: str) -> None: + """Legacy test, moved verbatim and expected to fail: it walks the checkout's resources, ignored directories included, instead of constructing its input.""" + package = Path(__file__).resolve().parents[4] # devcapsule-src; parents[1] in the legacy file's place + root = package.parent / "docs" if folder == "docs" else package / folder + forbidden = "work" + "station" + failures = [] + for path in root.rglob("*"): + if not path.is_file() or "__pycache__" in path.parts or ".pytest_cache" in path.parts: + continue + if path.is_relative_to(package / "tests" / "resources" / "compat"): + continue + try: + text = path.read_text() + except UnicodeError: + continue + if forbidden in text.lower(): + failures.append(str(path.relative_to(root))) + assert failures == [] diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_project_init.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_project_init.py new file mode 100644 index 00000000..f91d5668 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_project_init.py @@ -0,0 +1,40 @@ +"""Legacy tests of ``tests/test_project_init.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/project_init.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +from tests.launch_preparation import run_until_prepared +import os +from pathlib import Path +from unittest.mock import patch +import pytest +from devcapsule import cli +from tests.test_project_init import full_init_command, isolated_env, read_toml +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_a_selected_agent_brings_its_own_acquisition_gate(tmp_path: Path, capsys) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + project = tmp_path / "fresh-project" + project.mkdir() + with patch.dict(os.environ, isolated_env(tmp_path), clear=False): + assert cli.main(full_init_command(project)) == 0 + capsys.readouterr() + + # The agent is the developer's; resolving without its vendor's channel names the channel (D-0011). + assert cli.main(["project", "--path", str(project), "config", "add", "claude-code-agent"]) == 0 + assert run_until_prepared(project) == 3 + assert "home trust accept claude-code" in capsys.readouterr().err + + assert cli.main(["project", "--path", str(project), "config", "authorize", "claude-code-download", "true"]) == 0 + assert run_until_prepared(project) == 0 + from devcapsule.configuration.storage import lock_for + lock = lock_for(project, read_toml(project / ".devcapsule" / "devcapsule.toml"))[1] + assert lock["components"]["claude-code"]["version"] diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_repository_manifest_compatibility.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_repository_manifest_compatibility.py new file mode 100644 index 00000000..41392327 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_repository_manifest_compatibility.py @@ -0,0 +1,101 @@ +"""Legacy tests of ``tests/test_repository_manifest_compatibility.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/repository_manifest_compatibility.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +import tomllib +import pytest +from devcapsule.materialization import parse_locked_environment +from tests.test_repository_manifest_compatibility import LATEST_RELEASED_CLIENT, RELEASED_CAPABILITIES, RELEASED_COMPONENTS, RELEASED_SURFACES, REPOSITORY_MANIFEST +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_repository_needs_are_supported_by_released_launcher(): + """Legacy test, moved verbatim and expected to fail: it reads this checkout's live .devcapsule configuration instead of constructing its input.""" + manifest = tomllib.loads(REPOSITORY_MANIFEST.read_text(encoding="utf-8")) + unknown = set(manifest["capabilities"]["need"]) - RELEASED_CAPABILITIES + assert not unknown, ( + f"repository needs {sorted(unknown)}, unsupported by {LATEST_RELEASED_CLIENT}; " + "test unreleased capabilities in a disposable project instead" + ) + + + +@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_repository_locks_have_released_runtime_templates(): + """Legacy test, moved verbatim and expected to fail: it reads this checkout's live .devcapsule configuration instead of constructing its input.""" + locks = sorted(REPOSITORY_MANIFEST.parent.glob("devcapsule.*.lock")) + assert locks, "the repository commits its platform lock" + for path in locks: + lock = tomllib.loads(path.read_text(encoding="utf-8")) + components = lock["components"] + assert components["interactive-surface"] in RELEASED_SURFACES, ( + f"{path.name} selects a surface unknown to {LATEST_RELEASED_CLIENT}" + ) + unknown = set(components) - {"interactive-surface"} - RELEASED_COMPONENTS + assert not unknown, ( + f"{path.name} needs runtime templates for {sorted(unknown)} missing from " + f"{LATEST_RELEASED_CLIENT}; restoring only the manifest is insufficient" + ) + + + +@pytest.mark.skipif(not REPOSITORY_MANIFEST.is_file(), reason="not a repository checkout") +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_repository_lock_is_launchable_by_this_launcher(): + """The committed lock, written by an earlier matrix, still launches here. + + Precondition: ``.devcapsule/devcapsule.linux-amd64.lock`` as committed, + generated by whatever matrix the launcher of its day embedded; as a rule + an earlier generation than the development matrix in this tree. + + Action: read it the way ``project run`` does before it touches Docker, + ``parse_locked_environment``, which validates every artifact declaration + and looks up every component's runtime template. + + Postcondition: no error; the environment names the lock's interactive + surface and base, and one validated artifact set for every other + locally materialized component the lock lists. + + The lock carries its own URLs and checksums, so the embedded matrix plays + no part: a lock may lag the catalog, or pin versions the catalog has since + retired, and must still launch. Nothing here asserts that the lock is the + matrix's newest selection; that is repository housekeeping, done by a + launcher command on the host. This test imports the development reader on + purpose: it is the reader that must stay liberal. + + TODO: this proves only that this repository's own lock still reads. The + contract is wider: every project initialized by an earlier release must + keep launching with a new one, manifest, lock and checkout record alike. + The test that enforces it, over configurations captured from each + released client, is the work item + engineering-docs/bugs/devcapsule/2026-10-18-no-test-proves-old-projects-launch-with-new-releases.md. + """ + + locks = sorted(REPOSITORY_MANIFEST.parent.glob("devcapsule.*.lock")) + assert locks, "the repository commits its platform lock" + for path in locks: + lock = tomllib.loads(path.read_text(encoding="utf-8")) + components = lock["components"] + surface = components["interactive-surface"] + materialized = { + component_id + for component_id, table in components.items() + if component_id not in ("interactive-surface", surface) + and table.get("delivery-policy") == "local-materialization" + } + + environment = parse_locked_environment(lock) + + assert environment.component_id == surface, path.name + assert environment.base_reference == lock["base"]["reference"], path.name + assert {item.component_id for item in environment.ancillary_artifacts} == materialized, path.name diff --git a/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_trust.py b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_trust.py new file mode 100644 index 00000000..800e4806 --- /dev/null +++ b/devcapsule-src/tests/unit/devcapsule/legacy_refactoring/test_trust.py @@ -0,0 +1,157 @@ +"""Legacy tests of ``tests/test_trust.py`` marked expected to fail on 2026-11-04, moved verbatim. + +Mirror of ``devcapsule/legacy_refactoring/trust.py``, a temporary target that holds no code. +Each test here reads a precondition from outside itself, against *Unit Tests* rule 2; the +maintenance workstream rewrites each against its real unit and this file shrinks to nothing. +""" +from __future__ import annotations + +import io +import json +from pathlib import Path +import pytest +from devcapsule import cli +from devcapsule.commands._run_flow import RunFlags, prepare_launch +from devcapsule.compat import DecisionPending +from devcapsule.configuration.file_formats import render_toml +from devcapsule.configuration.storage import checkout_record_paths, load_toml, load_trust, manifest_for, settings_path +from devcapsule.configuration.trust import BASE_CHANNEL, HomeTrust +from tests.test_trust import accept, config, lock_path, pin_claude_code, project, reviews, withdraw +from devcapsule.runtime_configuration import CONTEXT_PATH + +IN_CAPSULE = CONTEXT_PATH.is_file() +"""The marker holds only inside a capsule, where these tests inherit its state; elsewhere they are the tests they were.""" + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_trust_list_accept_and_withdraw(project: Path, capsys) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + assert config(project, "ide", "python-ide") == 0 + assert config(project, "check") == 3 + assert config(project, "trust", "list") == 0 + out = capsys.readouterr().out + assert "devcapsule-base" in out and "not yet" in out and str(settings_path()) in out + assert cli.main(["home", "trust", "accept", "devcapsule-base", "--yes"]) == 0 + out = capsys.readouterr().out + assert "Trust DevCapsule to supply the base images" in out and "Recorded for this DevCapsule home" in out + assert load_toml(settings_path())["trust"]["channels"]["devcapsule-base"]["vendor"] == "DevCapsule" + assert config(project, "show") == 0 + assert "home trust (devcapsule-base)" in capsys.readouterr().out + assert config(project, "check") == 0 + capsys.readouterr() + assert config(project, "trust", "list", "--json") == 0 + listed = json.loads(capsys.readouterr().out) + assert [(row["channel"], row["trusted"]) for row in listed["channels"]] == [("devcapsule-base", True)] + assert withdraw("devcapsule-base") == 0 + assert config(project, "check") == 3 + assert withdraw("devcapsule-base") == 0 + assert accept(project, "codex") == 2 + assert "its channels: devcapsule-base" in capsys.readouterr().err + + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_run_trust_flag_records_the_channel_before_the_questions(project: Path) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + with pytest.raises(DecisionPending, match="--trust devcapsule-base"): + prepare_launch(project, RunFlags(ide="python-ide"), interactive=False) + assert not settings_path().exists() + prepared = prepare_launch(project, RunFlags(ide="python-ide", trust=("devcapsule-base",)), interactive=False) + assert prepared.selected.resolution["authorization"]["base-image"]["reference"].startswith("docker.io/mycodespaceai/devcapsule-base@") + assert "devcapsule-base" in load_toml(settings_path())["trust"]["channels"] + assert "Accepted the channel devcapsule-base for this home." in prepared.notes + # Printing the command stages the acceptance for the plan and writes nothing. + assert withdraw("devcapsule-base") == 0 + prepare_launch(project, RunFlags(ide="python-ide", trust=("devcapsule-base",)), print_only=True) + assert not HomeTrust.read(load_trust()).channels + # With another decision pending and no terminal, the flag's acceptance is staged with the other answers: nothing is written. + with pytest.raises(DecisionPending, match="Nothing was written"): + prepare_launch(project, RunFlags(trust=("devcapsule-base",)), interactive=False) # the IDE is still unchosen + assert not HomeTrust.read(load_trust()).channels + # Declined at the prompt: nothing recorded, the launch is still pending. + assert config(project, "ide", "python-ide") == 0 + prompts = io.StringIO() + with pytest.raises(DecisionPending): + prepare_launch(project, RunFlags(), interactive=True, input_stream=io.StringIO("n\n"), output_stream=prompts) + assert "Not accepted. Accept later:" in prompts.getvalue() + assert not HomeTrust.read(load_trust()).channels + + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_changed_artifact_origin_asks_and_lists_the_previous_acceptance(project: Path, capsys) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + pin_claude_code(project, "1.0.0") + assert accept(project, "claude-code") == 0 + lock = load_toml(lock_path(project)) + lock["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://mirror.example.test/claude" + lock_path(project).write_text(render_toml(lock)) + assert reviews(project)["claude-code-download"].status == "missing-required" + capsys.readouterr() + assert config(project, "trust", "list") == 0 + text = capsys.readouterr().out + assert "not covered" in text and "https://mirror.example.test" in text + assert "Accepted origins: https://downloads.example.test" in text + assert "SHA-256" in text and "Anyone who uses this home uses this acceptance" in text + assert accept(project, "claude-code") == 0 + assert reviews(project)["claude-code-download"].status == "trusted" + pin_claude_code(project, "1.1.0") + assert reviews(project)["claude-code-download"].status == "trusted" + + + +@pytest.mark.parametrize("via", ["flag", "terminal"]) +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_acceptance_uses_the_checkout_version_set_not_the_shared_lock(project: Path, via: str, capsys) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + from devcapsule.configuration.derivation import load_state + from devcapsule.configuration.file_formats import canonical_digest + assert config(project, "ide", "python-ide") == 0 + assert accept(project, BASE_CHANNEL) == 0 + pin_claude_code(project, "1.0.0") + _, manifest = manifest_for(project) + manifest["capabilities"]["required"].append("claude-code-agent") + (project / ".devcapsule/devcapsule.toml").write_text(render_toml(manifest)) + state = load_state(project, manifest) + selected = state.composed_lock() + selected["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://selected.example.test/claude" + record_path = checkout_record_paths(manifest, project)[0] + record = load_toml(record_path) + record["version-set"] = {"format": 1, "lock": render_toml(selected), "recommendation-digest": canonical_digest(state.shared_lock)} + record_path.write_text(render_toml(record)) + capsys.readouterr() + assert config(project, "trust", "list", "--json") == 0 + listed = json.loads(capsys.readouterr().out) + channel = next(row for row in listed["channels"] if row["channel"] == "claude-code") + assert channel["origins"] == ["https://selected.example.test"] + flags, interactive = RunFlags(trust=("claude-code",) if via == "flag" else ()), via == "terminal" + output = io.StringIO() + prepared = prepare_launch(project, flags, interactive=interactive, input_stream=io.StringIO("y\n"), output_stream=output) + assert prepared.selected.resolution["authorization"]["claude-code-download"] is True + if via == "terminal": + assert "https://selected.example.test" in output.getvalue() + assert "https://downloads.example.test" not in output.getvalue() + assert load_trust()["channels"]["claude-code"]["origins"] == ["https://selected.example.test"] + + + +@pytest.mark.xfail(IN_CAPSULE, reason="TODO: fix the wrong approach to testing") +def test_run_does_not_replay_trust_flags_after_an_upgrade_changes_the_channel(project: Path, monkeypatch) -> None: + """Legacy test, moved verbatim and expected to fail: it inherits the capsule's mounted launcher settings instead of constructing its own home.""" + from tests.test_upgrade_recovery import install_external_fakes, invoke + assert config(project, "ide", "python-ide") == 0 + pin_claude_code(project, "1.0.0") + _, manifest = manifest_for(project) + manifest["capabilities"]["required"].append("claude-code-agent") + (project / ".devcapsule/devcapsule.toml").write_text(render_toml(manifest)) + launch = install_external_fakes(monkeypatch, []) + monkeypatch.setattr("sys.stdin.isatty", lambda: False) + def upgrade(root: Path, *, refresh: bool) -> bool: + lock = load_toml(lock_path(root)) + lock["components"]["claude-code"]["artifacts"]["linux-amd64"]["url"] = "https://unaccepted.example.test/claude" + lock_path(root).write_text(render_toml(lock)) + return True + monkeypatch.setattr("devcapsule.commands.project.offer_upgrades", upgrade) + assert invoke(project, "run", "--trust", BASE_CHANNEL, "--trust", "claude-code", "--no-update-check") == 3 + launch.assert_not_called() + assert load_trust()["channels"]["claude-code"]["origins"] == ["https://downloads.example.test"] 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 9245b40f..8766e9fb 100644 --- a/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md +++ b/engineering-docs/wip/2026-09-18-maintenance/CURRENT-STATUS.md @@ -4,7 +4,7 @@ Mnemonic: `maintenance` Start date: 2026-09-18 -State: active 2026-11-04; #335 and #336 merged; first legacy test moved under the new rule, delivered for the owner's merge; 0.3.1 queue preserved +State: active 2026-11-04; #335, #336 and #337 merged; seventeen capsule-reading tests marked expected to fail at the owner's direction, their fix queued here; 0.3.1 queue preserved Definition read: WORKFLOW.md@d2ccbbe43dfa, WORKFLOW-LOCAL.md@65501b3407db @@ -16,6 +16,79 @@ Branch association: `ws-maintenance/base-consent-test` from main 445469f1; `ws-m Requirements: `R-PRODUCT-006`, `R-COMPAT-001`, `R-PRODUCT-002`, `R-CONSOLE-001` +## Seventeen tests expected to fail for reading the capsule — 2026-11-04 + +The owner ran the unit suite in the capsule after syncing +`ws-wrapped-projects/wrap` with `main` at `cc8f1288`: 17 failed, 2809 +passed. A clean checkout of `main` fails the same tests, so no workstream +broke them; each reads a precondition from outside the test, which *Unit +Tests* rule 2 forbids. The owner's disposition: mark every one of them +expected to fail with the reason `TODO: fix the wrong approach to testing` +and assign the fix to this workstream. Three causes: + +1. **The capsule's mounted launcher settings.** Inside a capsule + `mounted_settings_path` in `devcapsule/runtime_configuration.py` + answers `/etc/devcapsule/home/settings.toml` whenever the launch context + file exists, and the owner's capsule has accepted the Claude Code + download there. `private_user_directories` in `tests/conftest.py` + redirects `HOME` and the XDG variables but has no hold on that path, so + every test that assumes no accepted vendor channel sees one. Pointing + `HOME_PATH` at an empty directory makes them pass. Thirteen tests: + six in `tests/test_trust.py`, three in + `tests/test_capability_commands_v2.py`, one each in + `tests/test_capability_minimums.py`, `tests/test_console_channel.py`, + `tests/test_environment_realization.py` and `tests/test_project_init.py`. + This is the private-home fixture already noted in + `engineering-docs/development/unit-tests.md` for the 0.3.1 fixture slice. +2. **The live repository configuration.** The three tests in + `tests/test_repository_manifest_compatibility.py` load this checkout's + `.devcapsule/devcapsule.toml`; the owner's uncommitted schema-2 rewrite + renames `need` to `required` and they raise `KeyError`. +3. **An ignored directory under the resources.** `test_replaced_scope_word_is_absent` + in `tests/test_home.py` walks `tests/resources` and finds a `.venv` + inside the `fastapi-webapp` sample project, vendored pip sources included. + +The marker is on the 14 functions (three are parametrized). As written in +the eight legacy files the convention gate refused it, 14 breaches of the +form `changed in a legacy file`, since rule 5 never marks a legacy test +expected to fail and the gate compares each function's source, decorators +included, with the base. The owner's second disposition: move the marked +tests out of the legacy files into the mirror, against a dummy target +where the unit has none. So each test left its legacy file verbatim, with +a one-line docstring naming its cause, and sits in +`tests/unit/devcapsule/legacy_refactoring/test_.py`, one +file per legacy file because their `project` fixtures and `config` and +`snapshot` helpers collide by name; each imports its fixtures and helpers +from the legacy module as the existing mirror files do. The targets are +the temporary package `devcapsule/legacy_refactoring/`, eight modules +holding no code but a docstring saying why they exist; each is deleted +when its last test is rewritten against its real unit, and the package +with the last module. The owner's worry at the merge, that the move undermines the safety +the bad tests still gave, is answered by the marker's condition: it is +`pytest.mark.xfail(IN_CAPSULE, ...)`, with `IN_CAPSULE` the presence of +the launch context file, so the tests are expected to fail only inside a +capsule, where they inherit its state, and run as the tests they were on +the hosted workflow and on any host. The one change to a body is in +`test_replaced_scope_word_is_absent`, whose path to `devcapsule-src` is +taken from the mirror file's deeper place. Verified in the capsule: `nox -s tests` green, the +checker at 108 legacy files holding 1447 legacy tests, 30 files following +the convention, 0 breaches; `nox -s typecheck` green. Nothing committed; +the move is in the owner's checkout. + +Two environment findings from the same run, both for the owner: + +- Under `devcapsule-src/.venv`, `tests/test_console_channel.py` fails 16 + tests that pass under the nox session's own environment. The venv's + site-packages still carries `devcapsule-0.2.15.dist-info`, so a + subprocess started outside `devcapsule-src`, as the console channel's + `config` command is, reports itself as 0.2.15 and is refused by the + 0.3.0 home. The documented one-module command + `.venv/bin/python -m pytest tests/.py` is therefore unreliable in + this checkout until the editable install is redone: + `.venv/bin/python -m pip install -e . --no-deps` from `devcapsule-src`. +- The suite used about 215 MB of the capsule's 2 GB `/tmp`; no scratch + relocation is needed. + ## The first legacy test moves — 2026-11-04 The owner had marked `test_consent_names_the_contract_and_the_recipe_source` @@ -178,6 +251,7 @@ coordination mail at 35e5c6a599cd. GitHub Latest now resolves to v0.3.0. | Item | Owner | Disposition / next action | |---|---|---| +| Seventeen tests reading the capsule, the repository config or an ignored directory | maintenance | Marked expected to fail on 2026-11-04 at the owner's direction, reason `TODO: fix the wrong approach to testing`, and moved to `tests/unit/devcapsule/legacy_refactoring/` against the temporary targets in `devcapsule/legacy_refactoring/`. Next: rewrite each against its real unit, the private-home fixture first, and delete the targets as they empty. See *Seventeen tests expected to fail for reading the capsule* above. | | [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. |