test(b-gate): the surface arms hold in an extract too, and one arm owns the git-manifest denominator
Three of the new row-3 arms pinned 512 files and the literal source label, which only a tree WITH git metadata can answer; a clean extract (git archive | tar -x) would have turned all three red for the same reason the three already-named extraction artefacts go red. The property they test holds in both worlds, so they now assert it there: main.py, examples/, spikes/ and contexts/ are inside the guard whichever manifest was read, and the row prints whatever denominator it measured. The exact number and the label belong to ONE arm — the one whose subject IS the git manifest. In an extract it is an extraction artefact of the same class as the others, and says so in its docstring. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
59f35fde22
commit
2d957a93c5
1 changed files with 18 additions and 7 deletions
|
|
@ -780,24 +780,32 @@ def test_the_door_rule_claims_only_kinds_the_gate_can_verify() -> None:
|
|||
|
||||
|
||||
def test_the_published_surface_is_the_repo_manifest_and_not_a_handlist() -> None:
|
||||
"""A10: main.py, examples/, spikes/ og contexts/ er publisert, men lå utenfor roots."""
|
||||
files, source = gate.published_files(_REPO, _manifest())
|
||||
"""A10: main.py, examples/, spikes/ og contexts/ er publisert, men lå utenfor roots.
|
||||
|
||||
Armen holder i BEGGE verdener — arbeidstreet (git-manifestet) og et rent uttrekk (filtreet),
|
||||
som er nøyaktig det publiserte. Den nøyaktige nevneren pinnes av armen under, som er den ene
|
||||
som trenger repoets egen git-metadata."""
|
||||
files, _source = gate.published_files(_REPO, _manifest())
|
||||
names = {str(p.relative_to(_REPO)) for p in files}
|
||||
assert "main.py" in names and "CLAUDE.md" in names and "llms.txt" in names
|
||||
assert any(n.startswith("examples/") for n in names)
|
||||
assert any(n.startswith("spikes/") for n in names)
|
||||
assert any(n.startswith("contexts/") for n in names)
|
||||
assert len(files) == _PUBLISHED_TODAY, len(files)
|
||||
assert "git" in source
|
||||
assert len(files) > 400, len(files)
|
||||
|
||||
|
||||
def test_the_surface_count_matches_an_independent_count_of_the_manifest() -> None:
|
||||
"""Den ENE armen som trenger repoets egen git-metadata: i et rent uttrekk («not a git
|
||||
repository») finnes ikke manifestet å telle mot, og armen er da et uttrekksartefakt — samme
|
||||
klasse som de tre som allerede er navngitt. Nevneren pinnes HER, ikke i armen over."""
|
||||
tracked = subprocess.run(
|
||||
["git", "ls-files", "-z"], cwd=_REPO, capture_output=True, text=True, check=True
|
||||
).stdout.split("\0")
|
||||
mine = {t for t in tracked if t}
|
||||
files, _ = gate.published_files(_REPO, _manifest())
|
||||
assert len(mine) == _PUBLISHED_TODAY, len(mine)
|
||||
files, source = gate.published_files(_REPO, _manifest())
|
||||
assert {str(p.relative_to(_REPO)) for p in files} == mine
|
||||
assert "git-manifestet" == source
|
||||
|
||||
|
||||
def test_a_surface_without_its_sentinel_is_not_measured_instead_of_green(tmp_path: Path) -> None:
|
||||
|
|
@ -812,9 +820,12 @@ def test_a_surface_without_its_sentinel_is_not_measured_instead_of_green(tmp_pat
|
|||
|
||||
|
||||
def test_the_row_names_which_manifest_it_read() -> None:
|
||||
"""Nevneren står i radens EGEN tekst, sammen med hvor lista kom fra og hvor mange filer som
|
||||
ikke lot seg avkode — «0 treff» uten nevner er ikke et bevis."""
|
||||
row = gate.score_no_claude_path(_CONFIG["no_claude_path"], _REPO)
|
||||
assert str(_PUBLISHED_TODAY) in row.reason
|
||||
assert "git" in row.reason
|
||||
files, source = gate.published_files(_REPO, _manifest())
|
||||
assert f"over {len(files)} publiserte filer" in row.reason
|
||||
assert source in row.reason
|
||||
assert f"{_UNDECODABLE_TODAY} ulesbare" in row.reason
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue