> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anthid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AUDIT

# Documentation accuracy review

## 2026-09-18 review

Compared the public API handlers, shared request and response models, changes since the September 9 review, deployed OpenAPI exports, and streaming models at the `rust_types` revision pinned by `Cargo.lock` (`9829d4c`). Local protobuf definitions were also checked. This is a documentation and contract review, not a live authenticated trading test.

Market and strategy APIs are intentionally excluded at the owner's direction. They are private, under development, and access or feature gated. They have no public navigation or exports. The exporter also omits the private strategy entitlement from billing schemas.

### Corrections

| Area                     | Correction                                                                                                                                                                                                           | Evidence                                                                                                                                                     |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Missing public reference | Added the Instruments export, three endpoints, catalog guide, authentication, alias lookup, filtering, and cursor rules                                                                                              | Public `/v1/instruments/openapi.json`; `apps/instruments/src/api/handlers/instruments.rs`, `src/policy/instrument.rs`; `libs/crates/api/src/instruments_api` |
| Stream retention         | Documented one-hour expiry for terminal orders and zero positions, no public expiry event, and fresh cache reconstruction                                                                                            | Pinned `rust_types/src/streams/state/retention.rs`; `apps/streamer/src/services/subscription_manager/consumer.rs`                                            |
| Execution metadata       | Added optional execution identity, order totals, broker timestamp, resolved instrument, and applied command sequence                                                                                                 | Pinned `rust_types/src/broker/trade.rs`; `proto/trading/trading_models.proto`                                                                                |
| Reconnect guidance       | Preserve live updates while reconciling REST; filter current orders for open state; update all client guides and downloadable guidance                                                                               | Stream consumer; ledger latest-state handlers and models                                                                                                     |
| Daily returns            | Explain broker position reconciliation, recovered trades, unpriced inventory corrections, partial closes, dollar amounts, and fee exclusions                                                                         | `apps/ledger/src/services/orders/get_daily_returns.rs`, `reconcile.rs`, `realized.rs`; ledger query and response models                                      |
| Wire conventions         | Separate decimal values from integer counts, distinguish tagged union formats, document REST versus stream class casing, and correct bearer-token streaming support                                                  | Shared API models; protobuf subscription model; streamer authentication                                                                                      |
| MCP freshness            | Explain that publishing a new spec does not add it to the MCP service registry automatically                                                                                                                         | `apps/mcp/src/config/env.rs`, `src/services/api_spec.rs`                                                                                                     |
| Drift checks             | Share an explicit public service registry, require visible operations in navigation, resolve auth schemes, reject private/unregistered exports, add read-only export comparison, and stage all fetches before writes | `api-reference/scripts/services.mjs`, `generate-openapi.mjs`, `validate-reference.mjs`, `reference.test.mjs`                                                 |

The existing seven deployed exports match their checked-in contracts after publication filtering. The instrument export adds three operations, bringing validation to eight specs and 91 method/path pairs, including hidden operations. No new broker support is inferred from catalog schemas.

### Publication gaps and follow-up

* Notifications has two authenticated read handlers in source, but `https://api.anthid.com/v1/notifications/openapi.json` returned HTTP 404 during the audit. It remains outside public documentation pending confirmation of deployment and intended publication.
* The MCP default `API_SPECS` list has six services. After the docs publish, its configuration must include `billing` and `instruments` to index those references. No runtime configuration was changed here.
* The exporter still reports the existing retired-broker name in `BrokerCredentialVariant.description`. It explicitly describes an unsupported variant; retired credential variants remain structurally removed.

### Verification

Run from `anthid/` unless noted:

* `node apps/docs/api-reference/scripts/generate-openapi.mjs --check`: passed against all eight deployed public exports after publication filtering, without file changes.
* `node apps/docs/api-reference/scripts/generate-openapi.mjs --local --check`: passed; local publication processing is stable.
* `node apps/docs/api-reference/scripts/validate-reference.mjs`: passed for eight specs, 91 source endpoints, schema and security references, and navigation coverage.
* `node --test apps/docs/api-reference/scripts/reference.test.mjs`: seven tests passed, including missing navigation, missing source coverage, hidden operations, broken references, private exports, no-write checks, and failed-refresh preservation. The sandbox initially denied child Node processes; rerunning with the approved execution permission passed.
* `mint validate --telemetry false`, from `apps/docs/`: passed. The sandbox initially blocked Mintlify's network-interface check; rerunning with the approved execution permission passed.
* `mint broken-links --telemetry false`, from `apps/docs/`: passed with no broken links.
* `mint dev --port 3034 --telemetry false`, from `apps/docs/`: previewed the Instruments overview and generated list endpoint in the browser; confirmed navigation, rendered content, and examples. Stopped the preview afterward.
* `git diff --check`: passed.

Only `apps/docs` and its export/validation tooling changed. No Rust package or service binary, database schema, or stream contract changed. No authenticated broker calls, deployment, migrations, secrets, or production configuration changes were made. Publish the documentation through its normal release process; runtime contract deployment was not verified by this review.

## Previous review: 2026-09-09

Reviewed on 2026-09-09 against the monorepo implementations, the local shared protobuf definitions, and public REST OpenAPI exports.

## Changes and evidence

| Area            | Correction                                                                                                                                     | Implementation checked                                                                                                                             |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| OMS workflows   | Added the dashboard walkthrough, including order ticket, intent and order detail, streams, and analytics                                       | `apps/webapp/src/lib/routes.ts`, `apps/webapp/src/lib/navigation.ts`                                                                               |
| Positioning     | Described order and execution management through the API and dashboard; separated current analytics from roadmap work                          | `apps/marketing/src/content/hero.ts`, `apps/marketing/src/content/capabilities.ts`, dashboard navigation                                           |
| Controls        | Documented create-only evaluation, no automatic cancellation of resting orders, and stored but unenforced stale-order and loss/position limits | `apps/intents/src/services/control/submit_intent.rs`, `apps/controls/src/services/evaluate/engine.rs`, `risk.rs`, `time_window.rs`                 |
| HTTP retries    | Removed idempotent-submission promises from blog copy; documented that correlation keys do not deduplicate repeated creates                    | `libs/crates/extractors/src/ingress.rs`, `apps/intents/src/services/control/create_order.rs`, `apps/intents/src/database/create_intent.rs`         |
| Intent identity | Corrected downloadable guidance: replace and cancel append actions to the original intent                                                      | `apps/intents/src/services/control/replace.rs`, `cancel.rs`                                                                                        |
| Archival        | Explained asynchronous archival and cleanup; corrected the claim that the operational action trigger prohibits deletion                        | `apps/intents/src/database/terminal/sweep.rs`, `apps/intents/migrations/01_intent_action.sql`                                                      |
| Streaming       | Added primed order delivery, position priming, completion markers, and instrument filtering; corrected reconnect guidance                      | `apps/streamer/src/services/subscription_manager/consumer.rs`, `scope.rs`, shared `proto/trading/trading_service.proto`                            |
| Client examples | Corrected Node request casing, Rust subscription fields and exhaustive event matching; added priming guidance for all three clients            | Current shared protobuf messages; Node example's `keepCase: false` setting                                                                         |
| Limits          | Added billing claims reference and a guide distinguishing retained records from plan query windows                                             | `apps/billing/src/api/handlers/claims.rs`, `apps/billing/src/services/claims/mod.rs`, ledger migrations and services                               |
| API reference   | Refreshed public exports, added billing export, hid operator billing overrides, and added a repeatable source/navigation/reference check       | Seven services' `src/api/handlers` annotations and exported schemas                                                                                |
| Theme           | Default dark mode with the light/dark toggle available                                                                                         | `appearance.default: dark`, `appearance.strict: false`, [Mintlify appearance settings](https://www.mintlify.com/docs/organize/settings-appearance) |

The broker pages' Alpaca position limitation and current order-type coverage remain consistent with the adapter and intent request model. No new broker support is inferred from shared enum or schema names.

## Verification

Run from `anthid/` unless a different directory is noted:

* `node apps/docs/api-reference/scripts/generate-openapi.mjs`: fetched all seven public REST specifications. The exporter reports one upstream description mentioning the retired IBKR integration. The description explicitly says it is not a credential variant; no IBKR credential variant is exposed.
* `node apps/docs/api-reference/scripts/generate-openapi.mjs --local`: processing completed, including hiding the operator-only billing override route.
* `node apps/docs/api-reference/scripts/validate-reference.mjs`: passed for seven specs and 88 method/path pairs, local schema references, and navigation.
* `mint validate --telemetry false`, from `apps/docs/`: passed.
* `mint broken-links --telemetry false`, from `apps/docs/`: passed with no broken links.
* `cargo check --offline --manifest-path /tmp/anthid-docs-rust-check/Cargo.toml`: passed for the Rust server-streaming example and its event match, extracted into a temporary crate and generated against the local protobuf definitions. This did not connect to a broker or streaming service.
* `git diff --check`: passed.

Method/path parity does not prove deployed business behavior or schema equivalence with every Rust type. Streaming behavior was checked against source, not a live authenticated session. No broker orders, migrations, deployment, or credential/configuration changes were made. Only the docs app and its export/validation tooling are affected; no service binaries, database schemas, or stream contracts changed.
