Skip to content

Feat/tier4 ai admin endpoints - #7

Merged
raymondproguy merged 12 commits into
mainfrom
feat/tier4-ai-admin-endpoints
Sep 16, 2026
Merged

raymondproguy merged 12 commits into
mainfrom
feat/tier4-ai-admin-endpoints

Conversation

@raymondproguy

Copy link
Copy Markdown
Contributor

No description provided.

raymondproguy and others added 12 commits September 15, 2026 22:58
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>
@raymondproguy
raymondproguy merged commit 58a3415 into main Sep 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant