feat: the hard wall between the assistant and its configuration, and audit attribution (X1/Y1) #40

Merged
KofTwentyTwo merged 4 commits from feature/x1-y1-channel-wall into develop 2026-10-14 14:02:37 +00:00
KofTwentyTwo commented 2026-10-14 13:20:02 +00:00 (Migrated from github.com)

This implements docs/DESIGN.md parts X and Y, phases X1 and Y1, on QQQ RC.6 after #19.

X1: the wall

  • Deny registration. Every assistant_* table, process, report and widget, plus every object the qbit produces, is denied to client channel assistant in two ways:

    • the assistant_* pattern in ClientChannelsMetaData;
    • QPermissionRules.withDeniedClients(assistant) on each object.

    Core's defaults for the security surfaces (authentik_*, audit*, *api_key*, *credential*, *secret*) stay in place.

  • Startup check. The instance fails to start if any of these objects is not denied (AssistantChannelWall.validate).

  • Attribution. Every UI API call carries assistant/<turnId>, or assistant/scheduled/<taskId> for scheduled runs. Confirm and explain-access carry the owning turn; explain-access is extension 1.1.0. Core sets the channel server side.

  • Tests.

    • An assistant.admin user acting through the assistant is denied on every configuration object: 403 on query, get, insert, update, delete and process init, and the objects are absent from list_tables and GET /metaData.
    • The same admin through Next UI (next-ui) is allowed.
    • The startup check fails when one object is deliberately left undenied.
    • The security-surface patterns are present.

Y1: audit attribution

  • assistant_tool_call.audit_href is an /app link to the written record's audit rows, filtered by clientChannel and built with the shared filter-link builder.
  • Tests. An assistant write (a confirmed pending action) audits the human actor with clientChannel = assistant/<turnId>. The same write made directly through the UI audits next-ui.
  • Host setup (README and UPGRADE): enable the audit client-channel field and add its column. The new audit_href column is TEXT. kof22 gets a feature changeset with its next adoption PR.

Tests

332 tests, 1 of them a Docker-only skip. ./mvnw verify is green with the JaCoCo gates, and 12 of the tests are new.

🤖 Generated with Claude Code

This implements `docs/DESIGN.md` parts **X** and **Y**, phases X1 and Y1, on QQQ RC.6 after #19. ### X1: the wall - **Deny registration.** Every `assistant_*` table, process, report and widget, plus every object the qbit produces, is denied to client channel `assistant` in two ways: - the `assistant_*` pattern in `ClientChannelsMetaData`; - `QPermissionRules.withDeniedClients(assistant)` on each object. Core's defaults for the security surfaces (`authentik_*`, `audit*`, `*api_key*`, `*credential*`, `*secret*`) stay in place. - **Startup check.** The instance fails to start if any of these objects is not denied (`AssistantChannelWall.validate`). - **Attribution.** Every UI API call carries `assistant/<turnId>`, or `assistant/scheduled/<taskId>` for scheduled runs. Confirm and explain-access carry the owning turn; explain-access is extension 1.1.0. Core sets the channel server side. - **Tests.** - An `assistant.admin` user acting **through the assistant** is denied on every configuration object: 403 on query, get, insert, update, delete and process init, and the objects are absent from `list_tables` and `GET /metaData`. - The **same admin through Next UI** (`next-ui`) is allowed. - The startup check fails when one object is deliberately left undenied. - The security-surface patterns are present. ### Y1: audit attribution - `assistant_tool_call.audit_href` is an `/app` link to the written record's audit rows, filtered by `clientChannel` and built with the shared filter-link builder. - **Tests.** An assistant write (a confirmed pending action) audits the **human** actor with `clientChannel = assistant/<turnId>`. The same write made directly through the UI audits `next-ui`. - **Host setup** (README and UPGRADE): enable the audit client-channel field and add its column. The new `audit_href` column is TEXT. kof22 gets a feature changeset with its next adoption PR. ### Tests 332 tests, 1 of them a Docker-only skip. `./mvnw verify` is green with the JaCoCo gates, and 12 of the tests are new. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.