Wire-contract documentation and the CI check that keeps it honest.
* cli/README.md gains a verbatim --help block (top-level + subtrees),
an Exit codes table covering 0/1/2/3/4/5/6/7/10/124/130, a "Status
vs check" verb-pair subtable, and a "doc wait" paragraph spelling out
the four exit codes (0 / 1 / 124 / 130). The api passthrough note
trims storage provider out of the deep-config list now that
kb create --storage-provider is a polished flag.
* cli/AGENTS.md becomes the contributor guide: build/test, CRUD flag
conventions, the status/check verb pattern, long-poll wait commands,
the SetAgentHelp pattern, and a full Error code reference with 35
typed codes mapped to namespaces, exit codes, retryable / hint
guidance. Reference section is bracketed by HTML markers so a CI
parity test can keep it in sync with AllCodes().
* cli/internal/cmdutil/errors_doc_test.go enforces parity: every code
in AllCodes() must appear in AGENTS.md inside the markers, and
AGENTS.md must not reference codes that no longer exist. Fails CI
if a new typed code is added without documentation.
* CHANGELOG.md gets the v0.6 entry: BREAKING (--json / --no-stream /
WEKNORA_SDK_DEBUG / kb create --name), Added (--format / --jq /
doc wait / --log-level / kb-and-agent status & check / multi-id
delete / api --paginate / MCP schema extension / SetAgentHelp /
signal-aware ctx / kb create --storage-provider / new operation.*
namespace), Changed (multi-id partial-failure exit code, doc upload
FlagError, --log-level FlagError, multi-id stdout cleanup, README /
AGENTS.md changes), with a Migration from v0.5 section walking
every BREAKING through its v0.6 replacement.
New subtree (chunk list / view / delete) exposes RAG retrieval
debugging primitives with SDK-grounded field set (23 Chunk fields).
Pagination follows v0.4 canon: --limit / --page-size (1..1000) /
--all-pages.
- chunk list --doc <id>: enumerate by ChunkIndex (separate from
search chunks which is hybrid retrieval; Long help documents the
distinction)
- chunk view <id>: scope-less render via /chunks/by-id route; full
content verbatim
- chunk delete <id> --doc <id>: scope-flag + scope-id; L-13
destructive; 404 NOT idempotent; resource.not_found /
auth.forbidden / input.confirmation_required typed exit codes
documented in Long help
MCP server gains chunk_list as 10th curated tool. Schema deliberately
exposes only doc_id + limit (no pagination workflow on MCP); response
includes truncated_at_limit flag when total > limit.
cli/AGENTS.md MCP curation rationale rewritten: curated read-only is
a deliberate product call because the server side does not yet
enforce per-token scope. When server scope ships, mutation tools can
land in the MCP surface.
Shared helper cli/internal/text/timeago_string.go (FuzzyAgoStr)
extracted from session list during the C2 quality-review pass.