fix: cli.py help-patch NameError under a future typer, new record's kb/ paths (#148, #150)
CI / verify (push) Successful in 1m46s
Release / release (push) Successful in 38s

cli.py's typer._click.core.format_help patch was applied a second time
outside the try/except that exists to let a future typer without
typer._click degrade to plain Click help instead of crashing on import.
That second, unconditional line referenced two names the failed import
never defines, so the exact case the fallback exists for raised
NameError on every invocation instead. Removed; a subprocess test with
a targeted import hook (not sys.modules poisoning, which breaks typer
itself, and not importlib.reload, which would stay green against the
bug) pins that the fallback now actually falls back.

The new command's cli_contract record promised kb/concepts/<Name>.md
and kb/sources/Source - <Name>.md - both types have since grown a
layout: that files a page under a subtype-computed subdirectory, the
same rule an entity or a project already follows. Notes for concept
and source now name the subdirectory and where it comes from;
comparison was checked against its type-spec and left alone. Also
found and fixed: new source's example line omitted source_type,
fidelity and authority, so it could never succeed as written. A new
test reads each variant's note out of the record and checks the
written path against the pattern it promises, instead of against a
path re-typed into the test - which is what let the existing per-type
path tests stay green through this exact drift.

tools/CONTRACT.md regenerated via `wikitool docs contract --apply`;
pytest (1550), docs verify and instructions verify all green.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
This commit is contained in:
torbenandClaude Sonnet 5 committed 2026-09-26 23:02:11 +02:00
1 parent b8ed8bd610
commit 6c0ebcc4f0
7 files changed
+240 -13

No files matched your search

+1 -1
View File
@@ -1 +1 @@
7.1.0-beta.28
7.1.0-beta.30