Repository navigation
JVNAUTOSCI-2609: add actor-scoped telemetry read delegation - #325
Merged
Merged
Conversation
There was a problem hiding this comment.
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_accessendpoint. - 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 intobuildLlmDebugLocatorPayload, butbuildLlmDebugLocatorPayloadno longer accepts/usesworkflowExecutionTelemetry. 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) | ||
| ) |
witbrock
force-pushed
the
codex/JVNAUTOSCI-2609-telemetry-read-delegation
branch
from
July 28, 2026 21:28
5cbae5b to
a5b469e
Compare
witbrock
marked this pull request as ready for review
July 28, 2026 21:31
There was a problem hiding this comment.
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 setinclude_live_progress=falseto 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
hydrateTurnHistoryLocationFromConversationLocatornow always fetches the server conversation locator as long as a sessionId exists, even when bothrequestIdandhistory_locationare already present. In the clipboard path, you immediately callfetchTurnTelemetryMcpAccessafterwards, so this extra locator fetch becomes redundant network latency/work for the common case where the turn already has the needed identifiers.
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.
What changed
$sliceand compact Mongo projections.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
chatTabcopy-control tests passed.git diff --checkpassed.workflow_global_admin_authority_required.vontology_stdio_mcpdescriptors and no global workflow-trace descriptor.origin/mainworktree.