Feat/tier4 ai admin endpoints - #7
Merged
Merged
Conversation
CODEX.md was renamed to CLAUDE.md in 38a0b36 so Claude Code would auto-load it, but the H1 and all 15 cross-references still named the old file. A reader following any of them looked for a file that is not there. The engine-side Go comments already said CLAUDE.md. Co-Authored-By: Claude Code <noreply@anthropic.com>
GET /v1/admin/digest builds cryden's report for a window ending now and records nothing, so asking twice leaves no trace. DIGEST_INTERVAL_HOURS turns on a scheduler that writes each report to this repo's own digest_runs table, which GET /v1/admin/digest/history reads back. Co-Authored-By: Claude Code <noreply@anthropic.com>
GET /v1/admin/support/diagnose reports why one account cannot sign in, from its own recorded history: the lock and its expiry, consecutive failed attempts, live sessions and the failures behind them. The report is cryden's, passed through verbatim; an unknown address is the answer rather than a 404, which is the engine's own distinction. Co-Authored-By: Claude Code <noreply@anthropic.com>
GET /v1/admin/config-tuning calls admin.BuildTuningReport directly for the structured suggestions, and accepts GET only — applying one means pre-filling a settings field a human saves, never this endpoint. Passing the lockout knobs to the engine is a real behaviour change: cryden does not default them, so the engine ran with both at zero. Co-Authored-By: Claude Code <noreply@anthropic.com>
Records the digest, support diagnosis and tuning endpoints in CURRENT-STATE.md and NEXT.md, and logs the session in PROGRESS.md — including that 012 has never been applied anywhere and that passing the lockout knobs to the engine changes what every deployment does. Co-Authored-By: Claude Code <noreply@anthropic.com>
Credentials for the AI features are this repo's to store — cryden's ai.LLMProvider and ai.QueryableStore are interfaces it never implements — so migrations/013_settings holds them as AES-GCM ciphertext, sealed by cryden's own encryptor. The store deals in opaque bytes and has no helper that could write a plaintext credential. SETTINGS_ENCRYPTION_KEY is its own key, not a reuse of ENCRYPTION_KEY. Co-Authored-By: Claude Code <noreply@anthropic.com>
cryden ships no provider on purpose, so this repo brings one: the answer is constrained to a JSON schema whose enums are built from cryden's own allowlists rather than restated, so a model that asked for password_hash could not express it. cryden still validates every intent — this is the second lock, not the first. Tested against a local fake in the Messages API's wire shape, not the live service. Co-Authored-By: Claude Code <noreply@anthropic.com>
cryden's ai.QueryableStore asks for a read-only Postgres role by name, and that is the guarantee that holds when the allowlist has a bug — so the role is verified by attempting a write and confirming the server refuses it, not by reading a checkbox or a role attribute. A refusal is a pass, a success is a refusal, and anything else is "could not verify" rather than a pass. Co-Authored-By: Claude Code <noreply@anthropic.com>
GET/PUT/DELETE /v1/admin/settings/llm-provider and .../database-provider, storing both through settings.Secrets so neither credential reaches the table unsealed. PUT database-provider connects with the supplied credentials and refuses to store anything until the server has rejected a write on that connection, which is the read-only check NEXT.md asks for by name. Co-Authored-By: Claude Code <noreply@anthropic.com>
The widget config endpoint stores which entities the widget answers over, and aiprovider.ScopedProvider is what makes that setting real: cryden's widget.Ask scopes every intent to the calling user but does so over all of ai.AllowedEntities, so narrowing that is a host decision and belongs here. Co-Authored-By: Claude Code <noreply@anthropic.com>
openapi goes to 1.5 — the first version with admin endpoints that write, and the first whose responses depend on a non-cryden deployment setting. Three paths, five schemas, and a README section on why the read-only database is checked by attempting a write rather than by a checkbox. Co-Authored-By: Claude Code <noreply@anthropic.com>
NEXT.md marks the three Stage 2 endpoints built with what was and was not done against each bullet; CURRENT-STATE gains the Stage 2 section; and PROGRESS carries the honest verification note — CheckReadOnly has never run against a real Postgres, the Anthropic provider has never called Anthropic, and 013_settings has never been applied. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
No description provided.