Skip to content

fix(version): metadata drift + agent-flag hardening (0.1.4)#7

Merged
igor-ctrl merged 3 commits into
mainfrom
fix/version-metadata-drift
May 5, 2026
Merged

fix(version): metadata drift + agent-flag hardening (0.1.4)#7
igor-ctrl merged 3 commits into
mainfrom
fix/version-metadata-drift

Conversation

@igor-ctrl
Copy link
Copy Markdown
Owner

@igor-ctrl igor-ctrl commented May 5, 2026

Summary

  • fix(version): read __version__ from package metadata so bcli --version no longer drifts from pyproject.toml. Bumps to 0.1.4.
  • fix(uv.lock): sync lockfile to 0.1.4 — was the cause of the failing uv sync --locked across Python 3.11/3.12/3.13.
  • feat(cli): mark --publisher, --group, --version as hidden=True on get/post/patch/delete/attach. They remain functional escape hatches for power users but disappear from --help, which stops AI agents from pattern-matching them into routine commands.
  • docs(AGENTS.md): add a "Don't write this" anti-recipe block showing the literal bloated invocation next to the minimal one, and explain why each redundant flag (--publisher/--group/--version, --all, -f json) is unnecessary — registry resolves the route, --all paginates everything, -f json is auto-detected via CLAUDECODE=1.

Test plan

  • uv run pytest tests/ -v — 432 passed, 5 skipped locally.
  • uv run bcli get --help — confirms --publisher/--group/--version no longer listed.
  • uv run bcli --dry-run get vendors --publisher x --group y --version v1.5 --top 1 — confirms hidden flags still accept input (escape hatch preserved).
  • CI green on Python 3.11 / 3.12 / 3.13 with the lockfile fix.

igor-ctrl added 3 commits May 5, 2026 07:25
src/bcli/_version.py had a hardcoded `__version__ = "0.1.0"` that the
release process didn't bump alongside `pyproject.toml`. The 0.1.3
release shipped with `bcli --version` reporting "0.1.0" — the wheel
contents and entry-point logic were correct, only the version string
was stale.

Switch _version.py to read from importlib.metadata.version("bc-cli"),
which is the canonical Python-packaging single source of truth.
pyproject.toml's `version` field is now the only place release.sh
needs to coordinate with — no duplicate constant to forget.

Bump pyproject.toml to 0.1.4 so the next release ships with both the
fix and a correct self-reported version. (Republishing 0.1.3 isn't
possible on PyPI — versions are immutable once published.)

Verified locally: `from bcli._version import __version__; print(__version__)`
returns "0.1.4" after `uv tool install`.
Previous commit 3ce5ea8 bumped pyproject.toml to 0.1.4 but did not
update uv.lock, so CI failed on `uv sync --locked` across all three
Python versions.
Stops AI agents from generating bloated invocations like
`bcli -c LLC get fixedAssets --publisher beautech --group finance --version v1.5 --all -f json`
when `bcli -c LLC get fixedAssets` is enough.

- Mark `--publisher`, `--group`, `--version` as `hidden=True` in
  get/post/patch/delete/attach commands. The flags still work as
  escape hatches for power users; they just don't appear in `--help`,
  so agents can't pattern-match them in.
- Extend AGENTS.md "Profiles do most of the work" to cover the
  registry-resolved route, then add a "Don't write this" anti-recipe
  block with the literal bad command and minimal alternative,
  explaining why each flag was redundant (registry resolves
  publisher/group/version; `--all` paginates everything; `-f json` is
  auto-detected via CLAUDECODE=1).
@igor-ctrl igor-ctrl changed the title fix(version): read __version__ from metadata, bump to 0.1.4 fix(version): metadata drift + agent-flag hardening (0.1.4) May 5, 2026
@igor-ctrl igor-ctrl merged commit d627b59 into main May 5, 2026
3 checks passed
@igor-ctrl igor-ctrl deleted the fix/version-metadata-drift branch May 5, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant