ouroboros/tests/test_external_workspace_documentation.py
Ouroboros 17f2b26272 Document the books as books, and bound the byte proof to history
Four descriptions now described the shape the split replaced.

The ARCHITECTURE §1 row for `reference_books.py` still claimed legacy monolith
composition "during migration" and a validator that "serves docs-only CI" with
no production caller. It now names what is true: the membership both books
carry, the pure path question (`book_path_role` / `book_entrypoint_for`) that
every consumer asks instead of keeping its own chapter list, and the tracked-
tree validator run that makes a missing chapter, an unlisted one or a lost
authored introduction red in the suite. The `context_layout.py` row states view
intent and why a compact view addresses the physical chapter. The context-
delivery registry rows in "Core Governance Artifacts", the Low-mode sentence in
"Context fitting, retry, and compaction", and the truncation invariant that
defined "navigation map" all follow.

The "Documentation contract" section gains the canonical-book maintenance rule
it did not need before: one membership list and no second manifest, an authored
introduction on every source (it IS the compact view, so there is no second
editable summary corpus), WHY stays in the chapter that owns it, and readers ask
for a view rather than for a file — with the reason spelled out, because reading
an entrypoint with `read_text()` and treating the result as the book is a pin
that passes while testing nothing.

The byte proof moves onto history, where it belongs. It compared the working
tree against the recorded digests, which made every later ordinary edit to a
chapter a false red — a booby trap under a documentation contract whose own
rule is that a change REPLACES the description of the node it touched. It now
resolves both sides from Git: the base commit's monolith against the chapters of
the commit that ADDED the transfer table, found by content so a rebase cannot
strand it on a rewritten SHA (`quick-test` and `full-test` check out with
`fetch-depth: 0` for exactly this class of proof). Beside it sits a structural
half with no time bound: the base's `##` titles are the chapters' H1 titles, in
order, one each — so a lost, merged or re-titled chapter stays red forever while
an edit to a chapter body does not.

Co-authored-by: Ouroboros <311266734+ouroboros-agent@users.noreply.github.com>
2026-09-15 19:20:44 +03:00

20 lines
983 B
Python

"""The public workspace contract must keep ordinary folders visible."""
from pathlib import Path
from tests._governance_docs_shared import architecture_text
ROOT = Path(__file__).resolve().parents[1]
def test_external_workspace_docs_distinguish_plain_folders_from_git_operations():
readme = (ROOT / "README.md").read_text(encoding="utf-8")
architecture = architecture_text(ROOT)
control = (ROOT / "ouroboros" / "tools" / "control.py").read_text(encoding="utf-8")
assert "ordinary folders or separate Git worktree roots" in readme
assert "ordinary file and process work runs directly" in readme
assert "Ordinary folders support direct file/process work" in architecture
assert "ordinary folder or Git worktree root" in control
assert "ordinary file and process work is supported directly" in control
assert "External workspaces must be separate Git worktree roots" not in readme
assert "must be a git worktree root outside" not in control