feat(cli): cover every OpenAPI endpoint and request-body param#968
Merged
nicoloboschi merged 1 commit intomainfrom Apr 10, 2026
Merged
feat(cli): cover every OpenAPI endpoint and request-body param#968nicoloboschi merged 1 commit intomainfrom
nicoloboschi merged 1 commit intomainfrom
Conversation
Wires the Rust CLI up to every endpoint exposed by the Hindsight OpenAPI
spec and adds CI enforcement so new endpoints or new request-body fields
cannot slip in without matching CLI coverage.
Endpoints
- New `hindsight webhook {list,create,update,delete,deliveries}` and
`hindsight audit {list,stats}` subcommands.
- `hindsight bank` gains `set-disposition`, `consolidation-recover`,
`export-template`, `import-template`, `template-schema`.
- `hindsight memory` gains `history` and per-memory `clear-observations`.
- `hindsight document update`, `hindsight operation retry` added.
- Brings CLI coverage from 46/62 to 62/62 operations.
Request-body parameters
- Expose missing flags that the CLI was silently hardcoding: directive
`--priority`; mental-model `--tags` / `--max-tokens` /
`--trigger-refresh-after-consolidation`; recall `--query-timestamp`;
reflect `--fact-types` / `--exclude-mental-models` /
`--exclude-mental-model-ids`; retain `--document-tags`.
CI enforcement
- New `cli-coverage-check` entry point in `hindsight-dev` parses
openapi.json and verifies that (a) every operationId is called from
hindsight-cli/src/ (the progenitor client method names match the
operationId), and (b) every request-body property is present in
main.rs as a clap field or `long = "..."` attribute.
- Intentional non-exposures live in `hindsight-cli/.openapi-coverage.toml`
under `[skip]` / `[fields.<op>]` with a reason each (38 documented
field skips for flattened structs, nested structs, or fields surfaced
via a different subcommand).
- New `check-cli-coverage` job in .github/workflows/test.yml, triggered
on cli/core/dev/ci path changes, runs the script on every PR.
- smoke-test.sh exercises the new webhook / audit / bank-template /
set-disposition / consolidation-recover commands.
r266-tech
added a commit
to r266-tech/hindsight
that referenced
this pull request
Apr 11, 2026
…commands PR vectorize-io#968 added full OpenAPI endpoint coverage (46/62 → 62/62) but cli.md was not updated. Add sections for: - Webhook management (list/create/update/delete/deliveries) - Audit logs (list with action/transport/date filters) - Operation management (list/get/cancel/retry) - Memory history and clear-observations - Document update - Bank set-disposition and consolidation-recover - New flags on recall (--tags, --query-timestamp) and reflect (--fact-types) Fixes vectorize-io#982
nicoloboschi
pushed a commit
that referenced
this pull request
Apr 13, 2026
…commands (#983) PR #968 added full OpenAPI endpoint coverage (46/62 → 62/62) but cli.md was not updated. Add sections for: - Webhook management (list/create/update/delete/deliveries) - Audit logs (list with action/transport/date filters) - Operation management (list/get/cancel/retry) - Memory history and clear-observations - Document update - Bank set-disposition and consolidation-recover - New flags on recall (--tags, --query-timestamp) and reflect (--fact-types) Fixes #982
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
webhook,audit, and bank-template subcommands plus memoryhistory/ per-memoryclear-observations,document update,operation retry,bank set-disposition/consolidation-recover.--priority; mental-model--tags/--max-tokens/--trigger-refresh-after-consolidation; recall--query-timestamp; reflect--fact-types/--exclude-mental-models/--exclude-mental-model-ids; retain--document-tags.cli-coverage-checkinhindsight-dev+ a new CI job that fails any PR where a new OpenAPI endpoint or request-body field isn't wired into the CLI (or explicitly skipped inhindsight-cli/.openapi-coverage.tomlwith a reason). Current state: 62 operations + 89 request params covered, with 38 fields explicitly skipped for documented reasons (flattened into several flags, nested structs, or surfaced via a different subcommand).Why
The CLI had silently fallen behind the API — 16 endpoints had no command at all (entire webhook + audit subsystems, bank templates, memory history, document update, operation retry, consolidation recovery, update_bank_disposition) and several commands hardcoded request-body fields that the API accepts. There was no automated check to catch the drift, so new endpoints kept slipping through.
How the CI check works
uv run cli-coverage-check(inhindsight-dev) parseshindsight-docs/static/openapi.jsonand cross-checks:operationIdis called somewhere inhindsight-cli/src/**/*.rs. The progenitor-generated client methods are named identically to the OpenAPIoperationId, so.<op_id>(is a strong signal.hindsight-cli/src/main.rsas a clap command variant field orlong = "..."attribute.hindsight-cli/.openapi-coverage.tomlunder[skip](operation-level) or[fields.<op_id>](field-level) — each entry must carry a reason string.Test plan
./scripts/hooks/lint.shpassescargo build+cargo testpass (76 tests)uv run cli-coverage-checkreportsOK: all 62 operations and 89 request params coveredhindsight --helpshows newwebhook,auditsubcommands;hindsight bank --helpshows new template/recover/set-disposition;hindsight memory --helpshowshistoryandclear-observationscheck-cli-coveragejob runs greenHINDSIGHT_CLI=... ./hindsight-cli/smoke-test.sh) exercises the new webhook / audit / bank-template / memory-history / operation-retry commands against a live API