8FS-539 regression coverage — :func:`oct.scaffold.run_scaffold` must emit
9the canonical ``.option_c/`` dotdir layout (not the legacy root-level
10``.octrc.json`` + ``oc_diagnostics/debug_config.json`` + ``logs/``
11layout) and stamp a ``stage="compliant"`` ``oc_status.json`` so newly
12scaffolded projects are born migrated.
16- ``.option_c/`` + ``.option_c/logs/`` + ``.option_c/cache/`` exist.
17- ``.option_c/oc_status.json`` is a well-formed v1 schema blob with
19- Legacy paths (``.octrc.json``, ``oc_diagnostics/``, root-level
20 ``logs/``) are absent — the scaffold does not dual-write.
27 L3 — assertion details
32- All scaffold operations write to ``tmp_path``; no real project
33 directories are created.
36from __future__
import annotations
39from pathlib
import Path
41from oct.core.option_c_dir
import VALID_STAGES, load_oc_status
46 run_scaffold(
"demo", tmp_path, include_venv=
False)
47 project = tmp_path /
"demo"
49 assert (project /
".option_c").is_dir()
50 assert (project /
".option_c" /
"logs").is_dir()
51 assert (project /
".option_c" /
"cache").is_dir()
52 assert (project /
".option_c" /
"octrc.json").is_file()
53 assert (project /
".option_c" /
"debug_config.json").is_file()
54 assert (project /
".option_c" /
"oc_status.json").is_file()
58 run_scaffold(
"demo", tmp_path, include_venv=
False)
59 project = tmp_path /
"demo"
61 status = load_oc_status(project)
62 assert status
is not None
63 assert status.stage ==
"compliant"
64 assert status.stage
in VALID_STAGES
65 for pillar
in (
"linter",
"diagnostics",
"git",
"docs",
"tests",
"scaffold"):
66 assert pillar
in status.pillars, pillar
67 assert status.pillars[pillar][
"enabled"]
is True
69 assert status.migrated_from == {}
73 run_scaffold(
"demo", tmp_path, include_venv=
False)
75 (tmp_path /
"demo" /
".option_c" /
"oc_status.json").read_text(
79 assert raw[
"_schema_version"] ==
"1.0"
83 run_scaffold(
"demo", tmp_path, include_venv=
False)
84 project = tmp_path /
"demo"
88 assert not (project /
".octrc.json").exists()
89 assert not (project /
"oc_diagnostics").exists()
90 assert not (project /
"logs").exists()
test_scaffold_oc_status_schema_version_is_v1(Path tmp_path)
test_scaffold_oc_status_is_compliant_with_all_pillars(Path tmp_path)
test_scaffold_emits_option_c_dotdir(Path tmp_path)
test_scaffold_does_not_emit_legacy_paths(Path tmp_path)