Correct two documentation details introduced in 37b1ce53fe against the actual handlers in internal/api/:
- GET /api/agents/agent/{agent_id}/config: clarify that withholdProbeSecretsFromOtherTokens redacts assigned HTTP check credentials and request bodies only for other API tokens, while organization administrator browser/proxy sessions (record == nil) also receive them.
- GET /api/ai/cost/summary, POST /api/ai/test*, POST /api/ai/patrol/preflight, and POST /api/ai/patrol/readiness: note that their handlers call ensureSettingsReadScope/ensureSettingsWriteScope, which also enforce instance admin / instance-wide token authority.
Contract-Neutral: Documentation accuracy correction and docs-only test assertions aligned to existing internal/api/ handlers with no runtime behavior change.
Change-source: pulse-maintainer
Correct docs/API.md (and its frontend-modern/public/docs/API.md mirror)
against the registered route handlers in internal/api/router_routes_*.go,
internal/api/agent_ingest.go, internal/api/router.go, and
internal/config/truenas.go:
- Document GET /api/config as authenticated with monitoring:read instead
of Public Config, and note authentication on GET /simple-stats and
GET /ws (monitoring:read and organization membership rechecked every 10s).
- Update PUT /api/truenas/connections/{id} to match ScopeConfigured and
docs/TRUENAS.md (setting monitorDatasets, monitorPools, and
monitorReplication all to false is preserved as all off) and document
POST /api/truenas/connections/preview and /{id}/preview.
- Align /api/settings/relay* and /api/onboarding/* auth, scope
(relay:mobile:access or settings:read), and Relay+ license boundaries
with router_routes_ai_relay.go and docs/RELAY.md.
- Document enforced admin and scope rules for /api/system/settings,
/api/config/system, /api/system/mock-mode, /api/server/info,
/api/agent/version, /api/agents/*/report, GET /api/agents/agent/{id}/config,
and AI/Patrol/cost endpoints (/api/ai/models, /api/ai/test*,
/api/ai/execute*, /api/ai/patrol/autonomy*, /api/ai/patrol/preflight,
/api/ai/patrol/readiness, /api/ai/cost/*, /api/ai/debug/context).
- Add router- and config-anchored regression checks in
scripts/tests/test_api_reference_routes.py.
Contract-Neutral: Documentation accuracy correction and docs-only test coverage aligned to existing registered routes and config semantics with no runtime behavior change.
Change-source: pulse-maintainer
Update Help guides (with byte-for-byte in-app mirrors in
frontend-modern/public/docs/) and add source-bound doc regression tests:
- Scheduler and Alerting Help (docs/ALERTING.md, docs/API.md,
docs/api/SCHEDULER_HEALTH.md, docs/monitoring/ADAPTIVE_POLLING.md,
docs/monitoring/PROMETHEUS_METRICS.md,
docs/operations/ADAPTIVE_POLLING_ROLLOUT.md,
scripts/tests/test_watchdog_help_docs.py): document the shared worker
execution-boundary fence landed in #5379 so operators know both local
per-monitor workers and the POLL_TASK_WORKERS process dispatcher skip
provider setup for claims retired after dequeue or slot admission while
preserving any explicit replacement's own due time.
- Server update, teardown, and agent-capabilities API Help (docs/API.md,
docs/AUTO_UPDATE.md, scripts/tests/test_api_reference_routes.py):
document POST /api/updates/rollback, GET /api/updates/release-notes and
its asset route, POST /api/auto-unregister, GET /api/agent/capabilities,
and the exact scopes, body limits, cache headers, and status codes of
the update API routes.
- Security registration Help CI repair (SECURITY.md,
frontend-modern/public/docs/SECURITY.md,
scripts/tests/test_security_docs.py): move the command-enabled install
token agent:exec ceiling note out of the two-item Auto-Registration
Security bullet list into a standalone paragraph so
registrationSecurityGuide.test.ts passes again on main after #5383, and
guard the two-bullet list shape in Python doc tests.
Contract-Neutral: Documentation, shipped in-app Help mirrors, and doc verification tests aligned with already-landed runtime behavior; no runtime, API, schema, or UI contract changes.
Change-source: pulse-maintainer
Move the organization ownership limit and attention suppression reason length doc checks from frontend-modern/src/utils/__tests__/docsLinks.test.ts into scripts/tests/test_api_reference_routes.py so docsLinks.test.ts stays within the source-text-test-audit read baseline.
Contract-Neutral: Relocate doc reference assertions to Python test suite without changing runtime or contract behavior
Distinguish saved expiry, an expired credential and an unavailable record without changing a token or widening access. Keep Created and Last used separate from expiry and preserve existing token-route guidance in place. Link the new section from the existing expiry wording.
Contract-Neutral: Document existing metadata reads and expiry semantics only. No routes, scopes, storage, authentication or runtime behaviour change.
Change-source: pulse-maintainer
Show how temporary API access can expire and that an omitted lifetime leaves a token without expiry. Keep the existing monitoring-read example, scope defaults and editing/rotation rules visible at the same phone anchor, with a keyboard-accessible link to the existing lifetime option.
Contract-Neutral: Document existing token expiry semantics without changing routes, scopes, storage or runtime behaviour.
Change-source: pulse-maintainer
Explain that omitted or null create scopes request full access while an empty list is rejected. Keep the monitoring-read example and distinguish rename-only preservation from scope-change authority. Shorten existing edit prose without dropping its identity, expiry, organization or rotation rules.
Contract-Neutral: Clarify existing API token defaults and editing semantics without changing routes, grants or runtime behaviour.
Change-source: pulse-maintainer
The route inventory treated RequireOrgAdmin routes as unauthenticated
"bare" routes, and the agent diagnostics contract and the API
reference anchors still named RequireAdmin for routes that now opt
into organization authority. The security-privacy contract still said
org managers receive reportingRead through ensureAdminSession; it now
names the org-bound routes' check and records that instance
administration refuses organization owners. The agent-lifecycle
contract notes that agent routes declare that authority explicitly.
Follows the token authority fixes. The API reference now says:
- agent uninstall is a collector's own-token removal, or an admin session;
- AI narration of reports needs ai:execute from API-token callers, for
single and fleet reports, and otherwise falls back to the deterministic
summary;
- API-token callers manage only the tokens in their own organizations,
and only an instance-wide token can create, edit, rotate or delete
another instance-wide token;
- quick setup that would change credentials needs an instance-wide
token from API-token callers.
Adds the missing entry for POST /api/security/tokens/<id>/rotate, which
the regenerate entry already points scoped tokens to.
test_api_reference_routes.py pins each statement to the code that
enforces it, so the reference and the gates cannot drift apart. Each pin
fails when the code or the reference is reverted.
Contract-Neutral: Customer docs corrected to match shipped behaviour; no runtime, API or contract change.
Follows the token scope fixes. POST /api/security/regenerate-token now
needs an instance-wide full-access token from API-token callers and
replaces every stored token; the reference says so and points scoped
tokens at the per-token rotate route. POST /api/resources/{id}/link,
/unlink and /report-merge need monitoring:write.
test_api_reference_routes.py pins each of these to the code that
enforces it, so the reference and the gates cannot drift apart again.
Each pin fails when the code or the reference is reverted.
Contract-Neutral: Customer docs corrected to match shipped behaviour; no runtime, API or contract change.
The API reference marked the Patrol stream, manual run, acknowledge,
snooze, suppress, suppressions and dismissed routes "(Pro)" and promised
a 402 when unlicensed. None of them is licence-gated: Patrol and
managing its findings are free (ai_patrol is a free feature, and the
frontend offers these controls on every plan). Only governed fixes need
Pro. The routes now show the scope they actually require and the
reference says what Community gets, including the one-full-run-per-hour
cap on manual runs.
Also corrects the findings routes: reinvestigate is Pro and needs the
ai_autofix entitlement and a Patrol mode above Watch only, and
reapprove is retired and always answers 410.
scripts/tests/test_api_reference_routes.py gains checks that a Patrol
route documented without a paid label has no licence wrapper in its
registration, and that reapprove is documented as retired. Each fails
when its claim is reverted.
Contract-Neutral: Customer docs corrected to match shipped behaviour; no runtime, API or contract change.
Audited every HTTP route the server registers against docs/API.md.
Where a documented route and the code disagreed, or an integrator-facing
route was missing, the reference now matches the code.
- Auth and scope labels: notifications, SSO providers, license
activate/clear, security reset-lockout, availability targets, agent
profiles (every method needs settings:write for tokens), relay settings
and the resource metadata routes (no admin requirement).
- Behaviour: POST /api/notifications/test targets one channel per request,
the storage detail route is GET /api/storage/{storageId} (not a list at /api/storage/), token
rename-only updates are accepted, validate-token moved out of the Audit
Log (Pro) section because it has no licence gate, and the setup script
is public.
- Retired routes: /api/ai/remediation/execute and /rollback always answer
410 Gone, as approve already documented.
- Newly documented: GET /api/ai/patrol/runs/{id}, POST
/api/availability-history, POST /api/agents/agent/{id}/allow-reenroll,
PUT /api/truenas/connections/{id} and its /test route.
scripts/tests/test_api_reference_routes.py pins the corrections to the
router so later drift fails a test: every scope named on a route line must
exist in pkg/auth/scopes.go, the newly documented routes must exist in the
router, and the retired routes must say 410. It fails on the previous
reference and passes on this one.
Each doc is mirrored under frontend-modern/public/docs and updated in
both places. Labels where the docs and the code disagree about licence
gating are left alone; that needs a product decision, not a doc edit.
Contract-Neutral: Customer docs corrected to match shipped behaviour; no runtime, API or contract change.