Skip to content

JVNAUTOSCI-2609: add actor-scoped telemetry read delegation - #325

Merged
witbrock merged 1 commit into
mainfrom
codex/JVNAUTOSCI-2609-telemetry-read-delegation
Jul 28, 2026
Merged

witbrock merged 1 commit into
mainfrom
codex/JVNAUTOSCI-2609-telemetry-read-delegation

Conversation

@witbrock

Copy link
Copy Markdown
Member

What changed

  • Added short-lived, signed, audience- and tool-bound read delegations for exact conversation, history-entry, diagnostics, and live-progress telemetry targets.
  • Preserved the existing actor/global-admin denials for raw identifiers, global lists, workflow traces, and control operations.
  • Added canonical target read-back, actor/namespace/organisation/session/history validation, expiry and tamper checks, bounded pagination, provenance, and shared-conversation owner handling.
  • Updated conversation, LLM, and Thinking copy controls to emit only server-issued executable descriptors, with explicit unavailable status and no raw-ID authority fallback.
  • Replaced request-wide/full-history telemetry locator reads with exact $slice and compact Mongo projections.
  • Updated the MCP manifest, capability matrix, and regression coverage, including real stdio handler tests.

Why

Copied telemetry locators identified the right persisted turn but external Vontology stdio MCP could not dereference those identifiers without trusted operator/admin context. This adds a narrow bearer delegation for the authenticated actor and exact selected target without widening global telemetry authority.

Impact

An authenticated owner or authorised invitee can copy a locator and let an external coding agent fetch the exact persisted debug or diagnostics artefact through the real stdio MCP path. Large artefacts are canonical-JSON paginated. Actor B, raw-ID, tampered, expired, wrong-tool, wrong-audience, cross-session, cross-namespace, and global-list/control attempts continue to fail closed.

Validation

  • 136 backend tests passed across the telemetry, stdio, MCP catalogue/contract, chat-history, diagnostics, and related turn-record suites.
  • 15 dedicated frontend tests passed; 2 central chatTab copy-control tests passed.
  • Ruff, frontend static lint, Python compile, JSON validation, and git diff --check passed.
  • Real external MCP stdio process retrieved the exact persisted 11.2M-character diagnostics artefact in bounded form; the same raw request ID returned workflow_global_admin_authority_required.
  • Live browser replay verified conversation, LLM, and Thinking copies all emit actor-bound vontology_stdio_mcp descriptors and no global workflow-trace descriptor.
  • The broader turn-record test file retains 11 pre-existing benchmark/dashboard authority failures; one was reproduced unchanged on a detached clean origin/main worktree.

Copilot AI review requested due to automatic review settings July 28, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces short-lived, signed, actor-scoped telemetry read delegations so external vontology stdio MCP clients can fetch exact conversation/turn debug and diagnostics artefacts without requiring operator/global-admin context, while preserving existing denials for broad listings and control-plane operations.

Changes:

  • Added signed bindings + verification for conversation/history/turn telemetry references (audience/tool/actor/expiry/target bound) and surfaced them via a new /von/history/turn_telemetry_access endpoint.
  • Updated frontend copy/clipboard payloads to emit only server-issued executable MCP descriptors (with explicit retrieval_status) and removed raw-ID authority fallbacks and workflow-trace descriptors.
  • Added bounded/paginated stdio reads and expanded backend/frontend regression coverage plus MCP manifest/docs updates.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/frontend/chatTabThinkingDiagnosticsCopy.test.js Updates thinking/diagnostics copy expectations to use server-issued turn telemetry access descriptors.
tests/frontend/chatTabLlmDebugWorkflowExecution.test.js Adjusts LLM debug copy tests for server delegation availability/unavailability and removal of workflow trace descriptors.
tests/frontend/chatTabConversationLlmTelemetryCopy.test.js Adds coverage ensuring only server-issued conversation delegations are copied and raw tools are stripped.
tests/backend/test_von_history_telemetry_locator_endpoint.py Adds endpoint tests for issuing actor-bound turn telemetry access descriptors and auth failures.
tests/backend/test_turn_execution_diagnostics_workflow_trace_refs.py Ensures delegated exact-history lookups avoid request-wide history scans.
tests/backend/test_telemetry_read_delegation_stdio.py New end-to-end stdio handler tests for delegated reads, failure modes, and pagination.
tests/backend/test_mcp_stdio_server_exposes_workflow_tools.py Updates expected denial/error code set for sensitive workflow handlers.
tests/backend/test_internal_mcp_locator_tools_gateway.py Tightens gateway behaviour to reject emitted conversation-ref wrappers as authority.
tests/backend/test_conversation_scope_binding_service.py Adds unit coverage for delegation audience/tool/actor binding and expiry checks.
tests/backend/test_chat_history_service_segments.py Adds coverage for compact telemetry locator projections excluding large debug payloads.
src/frontend/web/von_interface/static/js/test/chatTab.test.js Updates frontend integration-style tests for new retrieval_status and empty mcp_access defaults.
src/frontend/web/von_interface/static/js/chatTab.js Implements delegation fetch + filtering in copy controls and adds turn telemetry access fetch helper.
src/backend/services/turn_execution_diagnostics_service.py Adds exact delegated history resolution path and emits delegated MCP access descriptors.
src/backend/services/conversation_telemetry_locator_service.py Issues per-turn delegated MCP access locators and switches to compact chat-history projections.
src/backend/services/conversation_scope_binding_service.py Implements signed read-delegation claims (audience/tool/actor/expiry/nonce) and verification helpers.
src/backend/services/chat_history_service.py Adds compact Mongo projection helper for locator building (get_chat_history_telemetry_locator_projection).
src/backend/server/routes/von_routes.py Adds /von/history/turn_telemetry_access route for minting actor-bound telemetry delegations.
src/backend/mcp_server/vontology_mcp.json Extends MCP schema for delegation refs plus bounded pagination (offset/limit) inputs.
src/backend/integrations/internal_mcp/catalogue.py Adds delegated-read authorisation + bounded JSON paging for large telemetry artefacts.
docs/engineering/workflow_mcp_capability_matrix.md Documents delegated telemetry read availability and non-expansion of control/list authorities.
Comments suppressed due to low confidence (1)

src/frontend/web/von_interface/static/js/chatTab.js:32759

  • _getWorkflowExecutionTelemetry(debugData) is computed and passed into buildLlmDebugLocatorPayload, but buildLlmDebugLocatorPayload no longer accepts/uses workflowExecutionTelemetry. This is now unnecessary work on every LLM debug copy.

Comment on lines +13535 to +13546
locator = build_turn_telemetry_mcp_access_locator(
request_id=request_id,
delegated_actor_user_id=user_concept_id,
delegated_actor_namespace=actor_namespace,
history_owner_user_id=owner_user_id,
read_namespace=owner_namespace,
organisation_concept_id=organisation_concept_id,
chat_session_id=resolved_session_id,
history_index=resolved_history_index,
include_diagnostics=diagnostics_available,
include_live_progress=isinstance(live_progress, Mapping),
)
Comment on lines +254 to +259
hydrated = hydrate_debug_payload_blob_refs(llm_debug, fail_soft=True)
target_llm_debug = (
dict(hydrated.payload)
if isinstance(hydrated.payload, Mapping)
else dict(llm_debug)
)
Copilot AI review requested due to automatic review settings July 28, 2026 21:28
@witbrock
witbrock force-pushed the codex/JVNAUTOSCI-2609-telemetry-read-delegation branch from 5cbae5b to a5b469e Compare July 28, 2026 21:28
@witbrock
witbrock marked this pull request as ready for review July 28, 2026 21:31
@witbrock
witbrock merged commit 14f2d07 into main Jul 28, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/backend/server/routes/von_routes.py:13546

  • The endpoint accepts include_live_progress (the frontend always sends it), but the route currently ignores the requested value and unconditionally includes a live-progress delegation whenever it had to fall back to live progress. This makes the query param misleading and can cause callers that explicitly set include_live_progress=false to still receive a live-progress tool descriptor.
        chat_session_id=resolved_session_id,
        history_index=resolved_history_index,
        include_diagnostics=diagnostics_available,
        include_live_progress=isinstance(live_progress, Mapping),
    )

src/frontend/web/von_interface/static/js/chatTab.js:33637

  • hydrateTurnHistoryLocationFromConversationLocator now always fetches the server conversation locator as long as a sessionId exists, even when both requestId and history_location are already present. In the clipboard path, you immediately call fetchTurnTelemetryMcpAccess afterwards, so this extra locator fetch becomes redundant network latency/work for the common case where the turn already has the needed identifiers.

@witbrock
witbrock deleted the codex/JVNAUTOSCI-2609-telemetry-read-delegation branch August 3, 2026 11:58
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.

2 participants