fix: three more #142 command-record mismatches aligned to code (#146)
CI / verify (push) Successful in 1m10s
Release / release (push) Successful in 36s

Files changed:
- CHANGES.md
- VERSION
- kb/CONTRACT.md
- tools/CONTRACT.md
- tools/chemenu/commands/docs_verify.py
- tools/chemenu/commands/git_publish.py
- tools/chemenu/commands/lint.py
- tools/chemenu/commands/xref.py
- tools/chemenu/tests/test_cli.py
This commit is contained in:
torben committed 2026-09-26 18:06:34 +02:00
1 parent 20745399c0
commit 8d5fc6e941
9 files changed
+54 -19

No files matched your search

+5 -1
View File
@@ -1251,7 +1251,11 @@ def toc_command(
"Dry-run by default (says whether the file would change); `--apply` writes.",
"`docs verify` checks the result stays current.",
),
failures=(),
failures=(cli_contract.Failure(
cause="`tools/CONTRACT.md` is missing",
reaction="Not transient - restore the file, which carries hand-written prose around "
"the region this command does not generate, then retry",
),),
examples=(
"tools/wikitool docs contract",
"tools/wikitool docs contract --apply",
+3 -1
View File
@@ -1088,7 +1088,9 @@ def sync_command(
properties=cli_contract.Properties(
effect=cli_contract.Effect.WRITE,
idempotent=cli_contract.Idempotent.NO,
atomic="No - sequential git operations, but every gate runs before staging",
atomic="No - sequential git operations. Every gate runs before staging, except on the "
"one retry of a rejected push, where the rebase-review gate can exit 42 after the "
"commit: nothing is pushed, and the re-run with `--confirm-rebase` pushes that commit",
budget=cli_contract.Budget.COUNTED,
network=cli_contract.Network.YES,
gates=("mass-update", "publish-remote", "rebase-review"),
+1 -1
View File
@@ -75,7 +75,7 @@ __all__ = [
"areas to shard, reported with the split its subtype field would produce, and only "
"when that split puts every resulting area at or under the threshold.",
"Advisory only: source pages sitting in the `unclassified` catalog slot.",
"Advisory only: quote-limit overages (>2 blockquoted lines/page).",
"Advisory only: quote-limit overages (>2 blockquotes/page).",
"Prints only the sections that found something and always writes the full report to "
"`reports/Lint Report <date>.md` (or `--markdown`), naming the path. `--full` prints "
"everything; `--json` prints the findings and writes nothing.",
+2 -2
View File
@@ -153,8 +153,8 @@ def _check_authorised(source: Page, target: Page, label: str) -> None:
properties=cli_contract.Properties(
effect=cli_contract.Effect.WRITE,
idempotent=cli_contract.Idempotent.YES,
atomic="No - writes A then B, but both edits are idempotent, and both refusals happen "
"before either write",
atomic="Yes - a single write to A; B is never touched, and every refusal happens "
"before it",
budget=cli_contract.Budget.COUNTED,
),
notes=(
+8 -4
View File
@@ -343,9 +343,12 @@ def test_stderr_hint_follows_the_error_line_when_streams_are_merged(tmp_path):
`docs contract` against an empty `CHEMENU_ROOT` fails because
`tools/CONTRACT.md` does not exist there - no fixture kb, no write,
nothing to clean up. It is also the one real record with no exit-1 cause
of its own (Gitea #146), so this doubles as the real-command check for
the `see:` fallback."""
nothing to clean up. Its record used to carry no exit-1 cause of its own
(Gitea #146), so this used to double as the real-command check for the
`see:` fallback; the record now names this cause, so the hint is its own
reaction instead - the fallback itself stays covered by
`test_render_failure_hint_falls_back_to_a_bare_pointer` in
`test_cli_contract.py`, against a fixture record."""
tools_dir = Path(__file__).resolve().parents[2]
env = dict(os.environ)
env["CHEMENU_ROOT"] = str(tmp_path)
@@ -364,4 +367,5 @@ def test_stderr_hint_follows_the_error_line_when_streams_are_merged(tmp_path):
assert result.returncode == 1
lines = result.stdout.splitlines()
assert lines[0] == "ERROR tools/CONTRACT.md is missing."
assert lines[1] == "see: wikitool docs contract -h"
hint = cli_contract.render_failure_hint(cli_contract.get("docs contract"))
assert "\n".join(lines[1:]) == hint