Skip to content

inspection_envelope and render_inspection_json are in __all__ with no user documentation #128

Description

@codeforester

Problem

base_cli.__all__ exports two symbols with no user-facing documentation anywhere in the repository:

  • inspection_envelope — creates a structured JSON envelope for read-only inspection commands
  • render_inspection_json — renders that envelope to stdout

These are backed by lib/python/base_cli/inspection.py. The inspection schema (schema_version / command / status / data / error) is distinct from the success/error envelopes documented in docs/json-contracts.md.

docs/api-stability.md states:

The supported Python facade is import base_cli. The names in base_cli.__all__ are the public facade; documented names in the explicitly exported modules are public as well.

The key word is documented. These two symbols are in __all__ and therefore carry a stability commitment, but they have no documentation — not in json-contracts.md, not in output-contracts.md, not in the README, not in any doc file. This directly contradicts the stability contract.

Concrete impact

A consumer who discovers inspection_envelope from IDE autocomplete or dir(base_cli) has no way to know:

  • What an "inspection command" is vs. a regular command
  • What the envelope schema looks like
  • When to use it vs. success_envelope / error_envelope
  • What version guarantees apply to the schema

Fix

Add a dedicated section to docs/json-contracts.md documenting:

  1. What an inspection command is (read-only, state-querying, idempotent)
  2. The envelope schema with a concrete example
  3. When to use inspection_envelope vs. success_envelope
  4. The schema_version value and stability guarantee

If these symbols are not yet ready for a stability commitment, move them to base_cli.experimental and remove from __all__ until they are documented.

Metadata

Metadata

Assignees

Labels

documentationDocumentation improvements

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions