4 Commits

Author SHA1 Message Date
Nicolò Boschi 163fbb0ede feat(api)!: retire the bank profile and background endpoints (#4127)
* feat(api)!: retire the bank profile and background endpoints

GET/PUT /v1/default/banks/{bank_id}/profile and
POST /v1/default/banks/{bank_id}/background have been deprecated for
several releases. They now answer 410 Gone with the replacement call in
the detail, joining the two endpoints (entity regenerate, synchronous
document export) that already do.

The routes stay in the OpenAPI spec with unchanged signatures, so no
generated SDK method disappears from under a caller — only the behaviour
changes.

Disposition traits and the reflect mission are bank configuration, and
already were: _get_bank_profile_authenticated overlaid config on top of
the legacy DB columns. The `name` these endpoints also returned is a
display-only label available on the bank list.

To make the config API a complete replacement, GET .../config is no
longer gated on HINDSIGHT_API_ENABLE_BANK_CONFIG_API — that flag now
gates only the writes (PATCH/DELETE). A bank must always be able to read
its own resolved settings.

Clients migrated in the same change:
- control plane: bank-profile-view and bank-config-view read disposition
  and mission from the config API, the display name comes from the
  filtered bank list, and the dead /api/profile proxy route is gone.
- hindsight-cli: `bank disposition`, `bank set-disposition` and the
  hidden `bank background` move to the config API. `background` warns
  that it now replaces the mission rather than LLM-merging into it —
  nothing replaces that merge — and its `--no-update-disposition` flag
  is accepted but ignored, as the server stopped inferring disposition
  from the mission long ago.
- TS wrapper: getBankProfile carries a @deprecated pointer.

* test(control-plane): cover the composed bank profile, and drop its extra fetch

bank-context only needs the display name, so it reads the id-filtered bank
list directly instead of going through getBankProfile, which would also
fetch the bank config it has no use for.

* feat(cli)!: drop the deprecated `bank background` command

The server endpoint is gone, and the LLM merge it performed has no
replacement — `bank mission` sets the mission outright. Keeping the
command as an alias would have silently turned a merge into an
overwrite, so it is removed rather than repointed.

* fix(ci): update the CLI coverage manifest, doc example and TS client test

- .openapi-coverage.toml: the three retired operations move to [skip]
  alongside export_documents_sync_removed, and the stale add_bank_background
  / update_bank_disposition field sections are dropped. The CLI helper is
  renamed set_bank_disposition so it no longer satisfies the coverage grep
  by name while calling update_bank_config underneath.
- cli-reference.sh: the two `bank background` snippets become one
  `bank mission`, the command that replaces them.
- main_operations.test.ts: TestBankProfile asserts the 410 and reads the
  same data back from the bank config. try/catch rather than .rejects,
  since this file runs under both jest and Deno's @std/expect shim.

* style: rustfmt the CLI edits, and say why the 410 handlers keep unused params
2026-09-04 18:09:05 +02:00
Evo ddef3d8c6b docs(cli): replace removed opinion fact-type with observation in recall example (#1917) 2026-06-05 11:23:12 +02:00
DK09876 d405b4feed ci: finalize test for the documentation code (#57)
* Fix main-methods.py: entities is a dict, use .items() and .canonical_name

* Migrate docs to use CodeSnippet components

- Convert quickstart.md, retain.md, recall.md, reflect.md, memory-banks.md to .mdx
- Use CodeSnippet to pull code from validated example scripts
- Add missing 'name' parameter to create_bank calls
- Fix main-methods.py entities iteration (dict not list)
- Remove retain-new.mdx demo file

* Migrate existing docs to match testing pattern with code snippet and add CLI tests to the CI

* Fix doc-id issue + add main-method tests

* CLI fixes

* Update openAPI json

* Fix rust build issues

* increase sleep time for Hindsight to process the document

* Added a polling sleep instead of fixed

* Delete immediately fails, so create the doc a earlier in the test to get the doc ready

* Add debug logs

* Remove debug logs
2025-12-19 12:17:59 -07:00
DK09876 8ecb5d3a0c Add documentation code validation system (#43)
* Add documentation code validation system

- Create runnable example scripts in examples/api/ (19 files)
- Add CodeSnippet component for extracting marked sections
- Add raw-loader dependency for importing source files
- Create sample retain-new.mdx showing new approach
- Add README documenting coverage and gaps

* Fix wheel glob expansion in test-doc-examples CI job

* Fix CI issue

* Fix wheel path - uv build outputs to repo root dist/

* Fix: use explicit shell expansion for wheel install

* Fix: run cd in subshell so install runs from repo root

* Add documentation code validation CI job

- Use uv sync + uv run pattern (matches existing CI)
- Add requests to test dependencies for cleanup scripts

* Fix async API client usage in documents.py example

* Fix main-methods.py: RecallResult and ReflectFact don't have weight attribute

* Fix opinions.py: use actual API attributes instead of non-existent ones

* Fix example scripts: remove non-existent API attributes

- recall.py: remove .weight, fix entities iteration (dict not list)
- retain.mjs: remove result.async check
2025-12-18 10:21:38 +01:00