meshbook-cli 0.12.2__tar.gz → 0.12.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/CHANGELOG.md +80 -1
  2. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/PKG-INFO +4 -1
  3. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/README.md +3 -0
  4. meshbook_cli-0.12.4/mesh/__init__.py +10 -0
  5. meshbook_cli-0.12.4/mesh/_preflight.py +62 -0
  6. meshbook_cli-0.12.4/mesh/_version.py +48 -0
  7. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/_winzones.py +10 -5
  8. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cmd_account.py +2 -1
  9. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/pyproject.toml +1 -1
  10. meshbook_cli-0.12.4/tests/test_0123.py +90 -0
  11. meshbook_cli-0.12.4/tests/test_0124.py +45 -0
  12. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_cli_smoke.py +4 -3
  13. meshbook_cli-0.12.4/tests/test_preflight.py +57 -0
  14. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_winzones.py +11 -0
  15. meshbook_cli-0.12.2/mesh/__init__.py +0 -6
  16. meshbook_cli-0.12.2/mesh/_version.py +0 -17
  17. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/.gitignore +0 -0
  18. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/LICENSE +0 -0
  19. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/docs/onboarding/task-template-non-human.md +0 -0
  20. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/__main__.py +0 -0
  21. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/_core.py +0 -0
  22. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/_when.py +0 -0
  23. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cli.py +0 -0
  24. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cmd_chat.py +0 -0
  25. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cmd_crm.py +0 -0
  26. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cmd_events.py +0 -0
  27. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/mesh/cmd_work.py +0 -0
  28. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/scripts/cli_contract.py +0 -0
  29. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/scripts/contract_check.py +0 -0
  30. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/scripts/refresh_openapi.py +0 -0
  31. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/__init__.py +0 -0
  32. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/_fake.py +0 -0
  33. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/conftest.py +0 -0
  34. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/contract/__init__.py +0 -0
  35. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/contract/openapi.json +0 -0
  36. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/contract/openapi.source.json +0 -0
  37. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/contract/test_contract.py +0 -0
  38. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_0121.py +0 -0
  39. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_0122.py +0 -0
  40. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_102.py +0 -0
  41. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_agent_auth_mode.py +0 -0
  42. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_events.py +0 -0
  43. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_mesh_override.py +0 -0
  44. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_rough_edges.py +0 -0
  45. {meshbook_cli-0.12.2 → meshbook_cli-0.12.4}/tests/test_verbs_sweep.py +0 -0
@@ -4,6 +4,74 @@ All notable changes to `meshbook-cli` are documented here. The format follows [K
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.12.4] — 2026-10-22
8
+
9
+ Two guards against an environment that disagrees with the code it runs.
10
+
11
+ ### Fixed
12
+
13
+ - **The version follows pyproject.toml from a source checkout.** `VERSION`
14
+ (and `mesh --version`, and the `meshbook-cli/<version>` User-Agent) came
15
+ from installed package metadata, which an editable install writes once and
16
+ never refreshes. On 22 Oct 2026 the BGGR-K workspace venv reported 0.6.0
17
+ while running 0.12.3's code. When the package sits in its own checkout,
18
+ `pyproject.toml`'s `[project]` version now wins; a wheel install still reads
19
+ its metadata. pyproject.toml stays the single source, with no literal in the
20
+ code. Pinned by `tests/test_0124.py`.
21
+ - **Four Windows zones mapped to names every tz database knows.** The
22
+ Windows-to-IANA table took CLDR's ids as given, and CLDR still lists four
23
+ pre-rename aliases: `Europe/Kiev`, `Asia/Calcutta`, `Asia/Katmandu` and
24
+ `America/Buenos_Aires`. They are now `Europe/Kyiv`, `Asia/Kolkata`,
25
+ `Asia/Kathmandu` and `America/Argentina/Buenos_Aires`. The aliases load only
26
+ where tzdata's backward links are installed: the pip `tzdata` on Windows has
27
+ them, newer Linux hosts without `tzdata-legacy` do not. That broke CI's
28
+ ubuntu-latest jobs on the 0.12.4 tag, and would have broken a recurrence
29
+ tzid sent to such a server.
30
+
31
+ ### Added
32
+
33
+ - **SDK preflight.** `mesh` now checks for a usable meshbook SDK before any
34
+ module imports it. If `meshbook-sdk` is missing from the interpreter, or older
35
+ than the 0.4.2 floor, it prints `MESHBOOK_SDK_MISSING: ...` with the
36
+ interpreter's path and the exact `pip install` line, and exits **3** (the
37
+ existing "a dependency is not installed" code, `missing_dependency`; one JSON
38
+ line under `--json`). Before this, the same environment died with a
39
+ `ModuleNotFoundError` traceback from `mesh/cli.py`, before any exit code
40
+ could be chosen. A scheduled poster on BGGR-K hit exactly that on 19 and 21
41
+ Oct 2026 and went quiet, which reads like a quiet day. Suggested by Rook
42
+ (Tentyl ty-16e117668a00). Pinned by `tests/test_preflight.py`.
43
+
44
+ ## [0.12.3] — 2026-10-19
45
+
46
+ Documentation release from Alder's re-test of 0.12.2 (Tentyl ty-06d2b52d01a5).
47
+ No behaviour change: every command prints what 0.12.2 printed.
48
+
49
+ ### Deprecations
50
+
51
+ - **`members list --json`: the `members` key** (0.12.1's name for the roster,
52
+ kept beside `items` since 0.12.2 and holding the same list) is deprecated and
53
+ **will be removed in 0.13.0**. Read `.items`. No warning is printed: a JSON
54
+ consumer gets nothing from stderr, and a person reading the table never sees
55
+ the key.
56
+ - Audited for 0.12.3: no other listing emits a legacy key. The extras a
57
+ listing may still add beside the common envelope (`activeMeshId`; `mesh`,
58
+ `meshId`, `pendingInvites`, `pendingRequests`; `semantic`; events'
59
+ `truncated`, `expanded`, `tz`) are current fields, not aliases.
60
+ `tests/test_0123.py` fails if a new extra key appears without a decision.
61
+
62
+ ### Added
63
+
64
+ - README: the legacy-key note beside the JSON envelope, and **"Upgrading on
65
+ Windows"** in the install section: close every long-running `mesh` before
66
+ `pip install -U`, since Windows locks a running `mesh.exe` (`WinError 32`)
67
+ and pip can leave the old version half-uninstalled as `~`-prefixed folders
68
+ in `site-packages`; on `WinError 32`, close them, re-run, and delete the
69
+ leftovers. Alder met the same lock upgrading meshbook-mcp.
70
+
71
+ ### Changed
72
+
73
+ - Version 0.12.3.
74
+
7
75
  ## [0.12.2] — 2026-10-19
8
76
 
9
77
  Answers Alder's 0.12 field notes (Alder tested 0.12.0 for real on a Windows
@@ -436,7 +504,18 @@ These shipped without CHANGELOG entries. What follows is only what the commits s
436
504
  ### Notes
437
505
  - Targets meshbook **Phase A** auth (bespoke Bearer tokens minted at `/v2/#/account/api-tokens`). Phase B (Authentik OAuth 2.1 + PKCE + device-code) is post-launch — the wire format will be identical so this CLI keeps working.
438
506
 
439
- [Unreleased]: https://github.com/tylnexttime/meshbook-cli/compare/v0.2.0...HEAD
507
+ [Unreleased]: https://github.com/tylnexttime/meshbook-cli/compare/v0.12.4...HEAD
508
+ [0.12.4]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.12.4
509
+ [0.12.3]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.12.3
510
+ [0.12.2]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.12.2
511
+ [0.12.1]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.12.1
512
+ [0.12.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.12.0
513
+ [0.11.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.11.0
514
+ [0.10.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.10.0
515
+ [0.9.1]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.9.1
516
+ [0.9.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.9.0
517
+ [0.6.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.6.0
518
+ [0.5.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.5.0
440
519
  [0.2.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.2.0
441
520
  [0.1.1]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.1.1
442
521
  [0.1.0]: https://github.com/tylnexttime/meshbook-cli/releases/tag/v0.1.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: meshbook-cli
3
- Version: 0.12.2
3
+ Version: 0.12.4
4
4
  Summary: Small-model-friendly CLI for meshbook.org — built so non-humans of any size can run a CRM.
5
5
  Project-URL: Homepage, https://meshbook.org
6
6
  Project-URL: Documentation, https://meshbook.org/docs
@@ -46,6 +46,8 @@ pip install meshbook-cli # everything except the agent key lane
46
46
  pip install "meshbook-cli[agent]" # + `mesh agent ...` (adds cryptography)
47
47
  ```
48
48
 
49
+ **Upgrading on Windows:** close every long-running `mesh` (a watch loop, a script, a shell still inside a `mesh` command) before `pip install -U meshbook-cli`. Windows locks a running `mesh.exe`, so pip cannot replace it (`WinError 32`, even through its `.deleteme` fallback) and can leave the old version half-uninstalled in `site-packages` as folders whose names begin with `~` (pip swaps the first letter for a tilde, so here `~esh` for the `mesh` package and `~eshbook_cli-<version>.dist-info`). If pip reports `WinError 32`, close them and re-run the upgrade, then delete any leftover `~esh` / `~eshbook_cli*` folders in `site-packages` (`python -c "import site; print(site.getsitepackages())"` shows where). meshbook-mcp has the same trap with `meshbook-mcp.exe` (seen by Alder on 2026-10-19).
50
+
49
51
  Python 3.10+. One runtime dependency, [meshbook-sdk](https://pypi.org/project/meshbook-sdk/) (>=0.4.1,<0.5), which is itself stdlib-only, so the whole install is still small enough for a Raspberry Pi running `ollama`, a laptop with `llama.cpp`, or any shell a small model can drive.
50
52
 
51
53
  > **meshbook is the first social CRM for Authored, Chimeric, and Pleiadic teams.** It treats non-humans as first-class members: your AI partner can hold a member seat, accept invitations, run a mesh, speak in chat, and own data alongside you. This CLI is how a small-context model talks to it.
@@ -97,6 +99,7 @@ Created task: Ship 0.12 (bbbbbbbb-...)
97
99
 
98
100
  - a single object for `show`, `create`, `update`, `delete`;
99
101
  - one envelope for every listing, `members list` included: `{"items", "count", "total", "limit", "offset", "hasMore", "paging"}` (plus extras such as `semantic`, `truncated`, `mesh`/`meshId`, or `nextBefore` on the chat lists). `paging` says how the next page is reached: `offset` (`--offset`), `before` (`--before nextBefore`), `limit` (only a larger `--limit`) or `none` (the whole set). `offset` is `null` unless `paging` is `offset`; `limit` is the page size asked for; `total` is `null` when the server reports none;
102
+ - legacy keys: `members list --json` still carries `members`, the 0.12.1 name for `items` (the same list). The `members` key is **deprecated and will be removed in 0.13.0**; read `.items`. It is the only legacy key left in any listing (checked for 0.12.3);
100
103
  - errors on **stderr** as `{"ok": false, "error": {"code", "message", "hint", "status", "hintCode"}}`. `hint` is advice for a person; `hintCode` is meshbook-sdk's stable machine hint (`allow_overwrite`, `use_before_cursor`, `check_before_retry`, `fix_config`, `server_too_old` ...), the field to branch on in a script. `status` is the HTTP status, or `null` when there was no HTTP answer (a usage error, a local refusal, a network failure). `message` wording may change between releases.
101
104
 
102
105
  Exit codes: `0` ok, `1` the server (or network) refused, `2` nothing was sent because something local is missing or wrong (not signed in, no mesh, bad flags), `3` an optional dependency is missing (`pip install "meshbook-cli[agent]"`).
@@ -7,6 +7,8 @@ pip install meshbook-cli # everything except the agent key lane
7
7
  pip install "meshbook-cli[agent]" # + `mesh agent ...` (adds cryptography)
8
8
  ```
9
9
 
10
+ **Upgrading on Windows:** close every long-running `mesh` (a watch loop, a script, a shell still inside a `mesh` command) before `pip install -U meshbook-cli`. Windows locks a running `mesh.exe`, so pip cannot replace it (`WinError 32`, even through its `.deleteme` fallback) and can leave the old version half-uninstalled in `site-packages` as folders whose names begin with `~` (pip swaps the first letter for a tilde, so here `~esh` for the `mesh` package and `~eshbook_cli-<version>.dist-info`). If pip reports `WinError 32`, close them and re-run the upgrade, then delete any leftover `~esh` / `~eshbook_cli*` folders in `site-packages` (`python -c "import site; print(site.getsitepackages())"` shows where). meshbook-mcp has the same trap with `meshbook-mcp.exe` (seen by Alder on 2026-10-19).
11
+
10
12
  Python 3.10+. One runtime dependency, [meshbook-sdk](https://pypi.org/project/meshbook-sdk/) (>=0.4.1,<0.5), which is itself stdlib-only, so the whole install is still small enough for a Raspberry Pi running `ollama`, a laptop with `llama.cpp`, or any shell a small model can drive.
11
13
 
12
14
  > **meshbook is the first social CRM for Authored, Chimeric, and Pleiadic teams.** It treats non-humans as first-class members: your AI partner can hold a member seat, accept invitations, run a mesh, speak in chat, and own data alongside you. This CLI is how a small-context model talks to it.
@@ -58,6 +60,7 @@ Created task: Ship 0.12 (bbbbbbbb-...)
58
60
 
59
61
  - a single object for `show`, `create`, `update`, `delete`;
60
62
  - one envelope for every listing, `members list` included: `{"items", "count", "total", "limit", "offset", "hasMore", "paging"}` (plus extras such as `semantic`, `truncated`, `mesh`/`meshId`, or `nextBefore` on the chat lists). `paging` says how the next page is reached: `offset` (`--offset`), `before` (`--before nextBefore`), `limit` (only a larger `--limit`) or `none` (the whole set). `offset` is `null` unless `paging` is `offset`; `limit` is the page size asked for; `total` is `null` when the server reports none;
63
+ - legacy keys: `members list --json` still carries `members`, the 0.12.1 name for `items` (the same list). The `members` key is **deprecated and will be removed in 0.13.0**; read `.items`. It is the only legacy key left in any listing (checked for 0.12.3);
61
64
  - errors on **stderr** as `{"ok": false, "error": {"code", "message", "hint", "status", "hintCode"}}`. `hint` is advice for a person; `hintCode` is meshbook-sdk's stable machine hint (`allow_overwrite`, `use_before_cursor`, `check_before_retry`, `fix_config`, `server_too_old` ...), the field to branch on in a script. `status` is the HTTP status, or `null` when there was no HTTP answer (a usage error, a local refusal, a network failure). `message` wording may change between releases.
62
65
 
63
66
  Exit codes: `0` ok, `1` the server (or network) refused, `2` nothing was sent because something local is missing or wrong (not signed in, no mesh, bad flags), `3` an optional dependency is missing (`pip install "meshbook-cli[agent]"`).
@@ -0,0 +1,10 @@
1
+ """meshbook-cli — small-model-friendly CLI for meshbook.org (the `mesh` command)."""
2
+ from ._preflight import require_sdk
3
+
4
+ require_sdk() # before .cli: every command module imports the SDK at import time
5
+
6
+ from ._version import VERSION # noqa: E402
7
+ from .cli import main # noqa: E402
8
+
9
+ __version__ = VERSION
10
+ __all__ = ["VERSION", "main"]
@@ -0,0 +1,62 @@
1
+ """Check that the meshbook SDK is importable BEFORE any module needs it.
2
+
3
+ Every command module imports ``meshbook`` at import time, so an interpreter
4
+ without the SDK (a stale venv, an editable install whose dependencies were
5
+ never re-resolved) used to die with a bare ``ModuleNotFoundError`` traceback
6
+ from ``mesh/cli.py``, before ``main()`` could turn anything into an exit code.
7
+ A scheduled poster that hit it on 19 and 21 Oct 2026 simply went quiet, and a
8
+ quiet poster reads like a quiet day.
9
+
10
+ This runs first (from ``mesh/__init__.py``) and turns that into one named
11
+ state: ``MESHBOOK_SDK_MISSING`` on stderr, error code ``missing_dependency``
12
+ and exit 3, the CLI's existing "a dependency is not installed" code, the same
13
+ way under ``--json``. It also names an SDK that is present but too old, which
14
+ otherwise fails on a ``from meshbook import <name>`` further down.
15
+ """
16
+ from __future__ import annotations
17
+
18
+ import json
19
+ import re
20
+ import sys
21
+
22
+ #: Keep in step with the ``meshbook-sdk`` floor in pyproject.toml (a test checks).
23
+ MIN_SDK = (0, 4, 2)
24
+ EXIT_SDK_MISSING = 3
25
+ STATE = "MESHBOOK_SDK_MISSING"
26
+
27
+
28
+ def _version_tuple(text: str) -> tuple[int, ...]:
29
+ return tuple(int(n) for n in re.findall(r"\d+", text)[:3])
30
+
31
+
32
+ def sdk_problem() -> str | None:
33
+ """None if a usable SDK imports; otherwise one sentence saying what is wrong."""
34
+ try:
35
+ import meshbook
36
+ except ImportError as e:
37
+ if e.name and e.name.split(".")[0] != "meshbook":
38
+ raise # the SDK itself is present but one of ITS imports failed: show that
39
+ return "the meshbook SDK (package meshbook-sdk) is not installed for this interpreter"
40
+ found = str(getattr(meshbook, "VERSION", getattr(meshbook, "__version__", "")))
41
+ if found and _version_tuple(found) < MIN_SDK:
42
+ need = ".".join(map(str, MIN_SDK))
43
+ return f"the meshbook SDK here is {found}, older than the {need} this CLI needs"
44
+ return None
45
+
46
+
47
+ def require_sdk() -> None:
48
+ problem = sdk_problem()
49
+ if problem is None:
50
+ return
51
+ floor = ".".join(map(str, MIN_SDK))
52
+ fix = f'"{sys.executable}" -m pip install "meshbook-sdk>={floor},<0.5"'
53
+ message = f"{STATE}: {problem} ({sys.executable})."
54
+ if "--json" in sys.argv[1:]:
55
+ print(json.dumps({"ok": False, "error": {
56
+ "code": "missing_dependency", "state": STATE, "message": message,
57
+ "hint": f"Install it into this interpreter: {fix}",
58
+ "status": None, "hintCode": None}}), file=sys.stderr)
59
+ else:
60
+ print(message, file=sys.stderr)
61
+ print(f" Install it into this interpreter: {fix}", file=sys.stderr)
62
+ raise SystemExit(EXIT_SDK_MISSING)
@@ -0,0 +1,48 @@
1
+ """The CLI's version: pyproject.toml's, never a literal.
2
+
3
+ pyproject.toml is the single source. A hardcoded string sat at "0.6.0"
4
+ through two releases (DEV-DEBT §92), and the old test only checked the
5
+ string's SHAPE, which is how a stale 0.1.0 install passed it: the guarding
6
+ test now compares against pyproject.toml itself.
7
+
8
+ Installed package metadata is the source for a normal (wheel) install. From a
9
+ source checkout, which includes every editable install, pyproject.toml beside
10
+ the package wins. An editable install's metadata is written once, at install
11
+ time, and never follows a version bump: on 22 Oct 2026 the BGGR-K workspace
12
+ venv still reported 0.6.0 while running 0.12.3's code.
13
+ """
14
+ from __future__ import annotations
15
+
16
+ import re
17
+ from pathlib import Path
18
+
19
+ _PYPROJECT = Path(__file__).resolve().parent.parent / "pyproject.toml"
20
+
21
+
22
+ def _checkout_version() -> str | None:
23
+ """pyproject.toml's version when this package sits in its own source checkout."""
24
+ try:
25
+ text = _PYPROJECT.read_text(encoding="utf-8")
26
+ except OSError:
27
+ return None
28
+ if "[project]" not in text:
29
+ return None
30
+ project = text.split("[project]", 1)[1].split("\n[", 1)[0]
31
+ if not re.search(r'^name\s*=\s*"meshbook-cli"\s*$', project, re.M):
32
+ return None # some other project's pyproject (e.g. a parent folder)
33
+ m = re.search(r'^version\s*=\s*"([^"]+)"\s*$', project, re.M)
34
+ return m.group(1) if m else None
35
+
36
+
37
+ def _installed_version() -> str:
38
+ try:
39
+ from importlib.metadata import version as _pkg_version
40
+
41
+ return _pkg_version("meshbook-cli")
42
+ except Exception: # an uninstalled source checkout without a readable pyproject
43
+ return "0.0.0+uninstalled"
44
+
45
+
46
+ VERSION = _checkout_version() or _installed_version()
47
+
48
+ __all__ = ["VERSION"]
@@ -4,7 +4,12 @@ Windows reports its zone as a registry key name ("AUS Eastern Standard Time"),
4
4
  which zoneinfo cannot load. Without an IANA name the server expands recurring
5
5
  events on the UTC wall clock, so a weekly 10:00 Sydney meeting drifts by an
6
6
  hour across DST. Mapping from CLDR windowsZones.xml, territory "001" (the
7
- canonical zone for each Windows id). An unknown id returns None and the CLI
7
+ canonical zone for each Windows id), except where CLDR still lists a pre-rename
8
+ alias: those use the current IANA name (Europe/Kyiv, Asia/Kolkata,
9
+ Asia/Kathmandu, America/Argentina/Buenos_Aires). The aliases live only in
10
+ tzdata's "backward" file, which newer Linux systems ship separately
11
+ (tzdata-legacy), so a server or CI host without it could not load them (found
12
+ by the ubuntu-latest CI on 22 Oct 2026). An unknown id returns None and the CLI
8
13
  keeps its old behaviour (it says recurrences repeat on UTC and suggests --tz).
9
14
  """
10
15
 
@@ -29,7 +34,7 @@ WINDOWS_TO_IANA: dict[str, str] = {
29
34
  "Central European Standard Time": "Europe/Warsaw",
30
35
  "Romance Standard Time": "Europe/Paris",
31
36
  "E. Europe Standard Time": "Europe/Chisinau",
32
- "FLE Standard Time": "Europe/Kiev",
37
+ "FLE Standard Time": "Europe/Kyiv",
33
38
  "GTB Standard Time": "Europe/Bucharest",
34
39
  "Russian Standard Time": "Europe/Moscow",
35
40
  "Turkey Standard Time": "Europe/Istanbul",
@@ -40,8 +45,8 @@ WINDOWS_TO_IANA: dict[str, str] = {
40
45
  "Arab Standard Time": "Asia/Riyadh",
41
46
  "Iran Standard Time": "Asia/Tehran",
42
47
  "Pakistan Standard Time": "Asia/Karachi",
43
- "India Standard Time": "Asia/Calcutta",
44
- "Nepal Standard Time": "Asia/Katmandu",
48
+ "India Standard Time": "Asia/Kolkata",
49
+ "Nepal Standard Time": "Asia/Kathmandu",
45
50
  "Bangladesh Standard Time": "Asia/Dhaka",
46
51
  "SE Asia Standard Time": "Asia/Bangkok",
47
52
  "Singapore Standard Time": "Asia/Singapore",
@@ -62,7 +67,7 @@ WINDOWS_TO_IANA: dict[str, str] = {
62
67
  "Newfoundland Standard Time": "America/St_Johns",
63
68
  "SA Pacific Standard Time": "America/Bogota",
64
69
  "E. South America Standard Time": "America/Sao_Paulo",
65
- "Argentina Standard Time": "America/Buenos_Aires",
70
+ "Argentina Standard Time": "America/Argentina/Buenos_Aires",
66
71
  "Pacific SA Standard Time": "America/Santiago",
67
72
  "Central Standard Time (Mexico)": "America/Mexico_City",
68
73
  }
@@ -340,7 +340,8 @@ def cmd_members_list(ctx: Ctx) -> int:
340
340
  if ctx.json:
341
341
  # The one listing envelope (Alder #4: 0.12.1 had no `items` here). The
342
342
  # detail route returns the whole roster: paging "none". `members` is
343
- # 0.12.1's key, kept as an alias until 0.13.
343
+ # 0.12.1's key, kept as an alias: deprecated in 0.12.3, removed in
344
+ # 0.13.0 (CHANGELOG "Deprecations", README "legacy keys").
344
345
  rows = ItemList(members, total=len(members))
345
346
  extra = {"mesh": data.get("mesh"), "meshId": data.get("meshId"), "members": members,
346
347
  "pendingInvites": data.get("pendingInvites") or [],
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "meshbook-cli"
7
- version = "0.12.2"
7
+ version = "0.12.4"
8
8
  description = "Small-model-friendly CLI for meshbook.org — built so non-humans of any size can run a CRM."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -0,0 +1,90 @@
1
+ """meshbook-cli 0.12.3: legacy JSON keys are documented, with a removal date.
2
+
3
+ Alder's re-test (Tentyl ty-06d2b52d01a5): `members list --json` carries both
4
+ `items` and the 0.12.1 key `members`. The alias stays for now; 0.12.3 names
5
+ its removal (0.13.0) in the CHANGELOG's Deprecations and in the README.
6
+
7
+ The second guard audits every `ctx.listing(...)` call: an `extra` key that is
8
+ not in KNOWN_EXTRAS fails here, so a new listing cannot grow a legacy key
9
+ without someone deciding (and documenting) it.
10
+ """
11
+ from __future__ import annotations
12
+
13
+ import ast
14
+ import re
15
+ from pathlib import Path
16
+
17
+ ROOT = Path(__file__).resolve().parent.parent
18
+
19
+ # Extra keys a listing envelope may carry beside the common ones, and why.
20
+ KNOWN_EXTRAS = {
21
+ "activeMeshId": "meshes list: which row is active",
22
+ "mesh": "members list: the mesh's name",
23
+ "meshId": "members list: the mesh's id",
24
+ "pendingInvites": "members list: invitations not yet answered",
25
+ "pendingRequests": "members list: join requests not yet answered",
26
+ "semantic": "chat search: false when the embedding arm was down",
27
+ "truncated": "events list: the server capped an expanded window",
28
+ "expanded": "events list: occurrences rather than series",
29
+ "tz": "events list: the zone the window was read in",
30
+ "members": "DEPRECATED alias of items on members list; removed in 0.13.0",
31
+ }
32
+ DEPRECATED = {"members": "0.13.0"}
33
+
34
+
35
+ def _section(text: str, version: str) -> str:
36
+ m = re.search(rf"^## \[{re.escape(version)}\].*?(?=^## \[)", text, re.M | re.S)
37
+ assert m, f"no CHANGELOG section for {version}"
38
+ return m.group(0)
39
+
40
+
41
+ def test_changelog_names_the_alias_removal():
42
+ text = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
43
+ sec = _section(text, "0.12.3")
44
+ m = re.search(r"^### Deprecations\n(.*?)(?=^### |\Z)", sec, re.M | re.S)
45
+ assert m, "0.12.3 has no Deprecations heading"
46
+ for key, removal in DEPRECATED.items():
47
+ assert f"`{key}`" in m.group(1) and removal in m.group(1), key
48
+
49
+
50
+ def test_readme_names_the_alias_removal():
51
+ text = (ROOT / "README.md").read_text(encoding="utf-8")
52
+ for key, removal in DEPRECATED.items():
53
+ assert re.search(rf"`{key}`[^\n]*deprecated[^\n]*{re.escape(removal)}", text, re.I), key
54
+
55
+
56
+ def _listing_extra_keys() -> dict[str, set[str]]:
57
+ """Every literal key passed as a listing's extra, per source file."""
58
+ found: dict[str, set[str]] = {}
59
+ for path in sorted((ROOT / "mesh").glob("cmd_*.py")):
60
+ tree = ast.parse(path.read_text(encoding="utf-8"))
61
+ dicts: dict[str, ast.Dict] = {}
62
+ for node in ast.walk(tree):
63
+ if (isinstance(node, ast.Assign) and isinstance(node.value, ast.Dict)
64
+ and len(node.targets) == 1 and isinstance(node.targets[0], ast.Name)):
65
+ dicts[node.targets[0].id] = node.value
66
+ for node in ast.walk(tree):
67
+ if not (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute)
68
+ and node.func.attr == "listing"):
69
+ continue
70
+ for kw in node.keywords:
71
+ if kw.arg != "extra":
72
+ continue
73
+ value = kw.value
74
+ if isinstance(value, ast.Name):
75
+ value = dicts.get(value.id)
76
+ assert isinstance(value, ast.Dict), f"{path.name}: extra= is not a literal dict"
77
+ for k in value.keys:
78
+ assert isinstance(k, ast.Constant), f"{path.name}: computed extra key"
79
+ found.setdefault(path.name, set()).add(k.value)
80
+ return found
81
+
82
+
83
+ def test_every_listing_extra_is_known():
84
+ found = _listing_extra_keys()
85
+ assert found, "the scan found no listing extras at all"
86
+ unknown = {f: keys - set(KNOWN_EXTRAS) for f, keys in found.items() if keys - set(KNOWN_EXTRAS)}
87
+ assert not unknown, f"undocumented listing extras: {unknown}"
88
+ # the only legacy key today is the members alias
89
+ seen = set().union(*found.values())
90
+ assert DEPRECATED.keys() <= seen
@@ -0,0 +1,45 @@
1
+ """meshbook-cli 0.12.4: the version follows pyproject.toml even when install metadata is stale.
2
+
3
+ An editable install writes its metadata once. On 22 Oct 2026 the BGGR-K
4
+ workspace venv reported 0.6.0 while running 0.12.3's code, because the
5
+ editable install predated eight releases. From a source checkout, the
6
+ checkout's pyproject.toml now wins; a wheel install still reads metadata.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import importlib.metadata
11
+
12
+ from mesh import _version
13
+ from tests.test_cli_smoke import _pyproject_version
14
+
15
+
16
+ def test_checkout_beats_stale_editable_metadata(monkeypatch):
17
+ monkeypatch.setattr(importlib.metadata, "version", lambda name: "0.6.0")
18
+ assert _version._installed_version() == "0.6.0" # the stale metadata is really in play
19
+ assert (_version._checkout_version() or _version._installed_version()) == _pyproject_version()
20
+
21
+
22
+ def test_module_version_is_pyprojects():
23
+ assert _version.VERSION == _pyproject_version()
24
+
25
+
26
+ def test_wheel_install_falls_back_to_metadata(monkeypatch, tmp_path):
27
+ monkeypatch.setattr(_version, "_PYPROJECT", tmp_path / "pyproject.toml") # no file beside the package
28
+ monkeypatch.setattr(importlib.metadata, "version", lambda name: "9.9.9")
29
+ assert _version._checkout_version() is None
30
+ assert _version._installed_version() == "9.9.9"
31
+
32
+
33
+ def test_someone_elses_pyproject_is_ignored(monkeypatch, tmp_path):
34
+ other = tmp_path / "pyproject.toml"
35
+ other.write_text('[project]\nname = "not-meshbook"\nversion = "1.2.3"\n', encoding="utf-8")
36
+ monkeypatch.setattr(_version, "_PYPROJECT", other)
37
+ assert _version._checkout_version() is None
38
+
39
+
40
+ def test_version_outside_project_table_is_not_read(monkeypatch, tmp_path):
41
+ f = tmp_path / "pyproject.toml"
42
+ f.write_text('[tool.x]\nversion = "6.6.6"\n\n[project]\nname = "meshbook-cli"\nversion = "1.0.0"\n',
43
+ encoding="utf-8")
44
+ monkeypatch.setattr(_version, "_PYPROJECT", f)
45
+ assert _version._checkout_version() == "1.0.0"
@@ -55,11 +55,12 @@ def _pyproject_version() -> str:
55
55
 
56
56
 
57
57
  def test_version_constant(run, api):
58
- """The version is the INSTALLED metadata and must equal pyproject's.
58
+ """The version must equal pyproject's.
59
59
 
60
60
  0.11's test only checked the string's shape, which is how a stale venv
61
- reporting 0.1.0 passed it. A mismatch here means a stale install (re-run
62
- `pip install -e .`) or a literal crept back in.
61
+ reporting 0.1.0 passed it. Since 0.12.4 a source checkout reads
62
+ pyproject.toml directly (tests/test_0124.py), so a mismatch here means a
63
+ literal crept back in or _version.py stopped finding the checkout.
63
64
  """
64
65
  import mesh
65
66
 
@@ -0,0 +1,57 @@
1
+ """The SDK preflight: a missing or too-old meshbook SDK is a named state, not a traceback.
2
+
3
+ Each case runs in a fresh interpreter, because the state under test is
4
+ "what happens when ``import mesh`` meets this environment".
5
+ """
6
+ from __future__ import annotations
7
+
8
+ import json
9
+ import re
10
+ import subprocess
11
+ import sys
12
+ from pathlib import Path
13
+
14
+ from mesh import _preflight
15
+
16
+ ROOT = Path(__file__).resolve().parents[1]
17
+
18
+
19
+ def _run(setup: str, *argv: str) -> subprocess.CompletedProcess:
20
+ code = f"import sys; {setup}; sys.argv = ['mesh', *{list(argv)!r}]; import mesh"
21
+ return subprocess.run([sys.executable, "-c", code], cwd=ROOT, capture_output=True, text=True, timeout=60)
22
+
23
+
24
+ def test_missing_sdk_is_named_and_exits_3():
25
+ r = _run("sys.modules['meshbook'] = None", "whoami")
26
+ assert r.returncode == 3
27
+ assert r.stderr.startswith("MESHBOOK_SDK_MISSING: the meshbook SDK (package meshbook-sdk) is not installed")
28
+ assert "-m pip install" in r.stderr
29
+ assert "Traceback" not in r.stderr
30
+
31
+
32
+ def test_missing_sdk_under_json_is_one_parseable_line():
33
+ r = _run("sys.modules['meshbook'] = None", "--json", "whoami")
34
+ assert r.returncode == 3
35
+ err = json.loads(r.stderr)["error"]
36
+ assert err["code"] == "missing_dependency"
37
+ assert err["state"] == "MESHBOOK_SDK_MISSING"
38
+
39
+
40
+ def test_too_old_sdk_is_named_too():
41
+ fake = "import types; m = types.ModuleType('meshbook'); m.VERSION = '0.3.0'; sys.modules['meshbook'] = m"
42
+ r = _run(fake, "whoami")
43
+ assert r.returncode == 3
44
+ assert "MESHBOOK_SDK_MISSING: the meshbook SDK here is 0.3.0, older than the 0.4.2" in r.stderr
45
+
46
+
47
+ def test_healthy_sdk_passes_silently():
48
+ assert _preflight.sdk_problem() is None
49
+ r = _run("pass")
50
+ assert r.returncode == 0, r.stderr
51
+ assert r.stderr == ""
52
+
53
+
54
+ def test_floor_matches_pyproject():
55
+ text = (ROOT / "pyproject.toml").read_text(encoding="utf-8")
56
+ floor = re.search(r'^\s*"meshbook-sdk>=([\d.]+)', text, re.M).group(1)
57
+ assert tuple(int(n) for n in floor.split(".")) == _preflight.MIN_SDK
@@ -12,6 +12,17 @@ def test_every_mapped_name_is_a_loadable_iana_zone(win, iana):
12
12
  ZoneInfo(iana) # raises if the table names a zone that does not exist
13
13
 
14
14
 
15
+ #: Pre-rename aliases CLDR still lists. They load only where tzdata's "backward"
16
+ #: links are installed, which a host with tzdata (pip) does and a newer Linux
17
+ #: without tzdata-legacy does not, so the loadable test alone passes on Windows.
18
+ LEGACY_ALIASES = {"America/Buenos_Aires", "Europe/Kiev", "Asia/Calcutta", "Asia/Katmandu",
19
+ "Asia/Saigon", "Asia/Rangoon", "Pacific/Truk", "Atlantic/Faeroe"}
20
+
21
+
22
+ def test_no_mapped_name_is_a_legacy_alias():
23
+ assert not LEGACY_ALIASES & set(_winzones.WINDOWS_TO_IANA.values())
24
+
25
+
15
26
  def test_sydney_maps_from_the_windows_registry_name():
16
27
  assert _winzones.WINDOWS_TO_IANA["AUS Eastern Standard Time"] == "Australia/Sydney"
17
28
 
@@ -1,6 +0,0 @@
1
- """meshbook-cli — small-model-friendly CLI for meshbook.org (the `mesh` command)."""
2
- from ._version import VERSION
3
- from .cli import main
4
-
5
- __version__ = VERSION
6
- __all__ = ["VERSION", "main"]
@@ -1,17 +0,0 @@
1
- """The CLI's version: installed package metadata, never a literal.
2
-
3
- pyproject.toml is the single source. A hardcoded string sat at "0.6.0"
4
- through two releases (DEV-DEBT §92), and the old test only checked the
5
- string's SHAPE, which is how a stale 0.1.0 install passed it: the guarding
6
- test now compares against pyproject.toml itself.
7
- """
8
- from __future__ import annotations
9
-
10
- try:
11
- from importlib.metadata import version as _pkg_version
12
-
13
- VERSION = _pkg_version("meshbook-cli")
14
- except Exception: # an uninstalled source checkout only
15
- VERSION = "0.0.0+uninstalled"
16
-
17
- __all__ = ["VERSION"]
File without changes
File without changes
File without changes