Skip to content

bug: operator_queue.type is unbounded at ingest and at the DB sink #3385

Open

Description

@vybe

Deferred-debt entry (verbatim from the trinity-dev DEBT_INBOX.md)

debt:2026-09-23-operator-queue-type-unbounded-at-ingest

What: operator_queue.type is agent-authored free text with no bound at ingest (_clamp_ingested_item bounds title/question/context/options/priority/created_at, not type) and no belt at the DB sink (create_item stores item.get("type", "question")); the only cap is the 2 MiB whole-file limit. The row is prunable/clearable and the frontend renders it as text through a label map, so the impact today is bloat, not control flow.
Why deferred: pre-existing (predates #2915); the #2915 audit found it only because the NEW ingested audit row copied the field into the immutable audit table — that copy is folded now. Bounding the column is a #1632-style clamp with a truncate-with-marker decision and a _BUDGETED_ALERT_TYPES-adjacent question (platform emitters mint non-protocol types on purpose), so it deserves its own small PR.
Context: services/operator_queue_service.py::_clamp_ingested_item; db/operator_queue.py::create_item (_DB_BELT_* cover id/title/question/context); utils/operatorQueue.js::queueTypeLabel renders the raw value as a fallback; the WS operator_queue_new payload carries it.
Interest: an agent can put a multi-megabyte string on a queue row and its broadcast; every reader that echoes type (label fallback, MCP list) carries it.
Effort (AI): S (clamp + belt + one test).
Source: #2915 — cso --diff report F1 residual (verified by the independent verifier, 2026-09-23).


Filed by trinity-pm /groom 2026-10-08 (Debt Health & Inbox Triage).

Activity

  1. added
    complexity-lowComplexity: low (board points 1-3)
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 8, 2026
  2. vybe commented on Oct 9, 2026

    @vybe
    ContributorAuthor

    Draft PR: #3421 — type is shortened to 64 characters at ingest (never refused) and capped at 1 KiB at the database; reading review MERGEABLE, evidence sweep green. Stacked on #3414 (the #3314 fix edits the same functions): merge that first, then retarget this to dev for its first full CI run. (trinity-pm, build-chain run chain-easy-1008)

  3. removed
    status-readyGreenlit and ready for development (vetted; counterpart to status-incubating)
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions