feat(workbench): land M00–M06 runtime contracts and read-only view
Add capabilities/selection/usage/DocumentView/locator/RunContext with honest probes, LLM messages+cancel, sse-live cancel bridge, and CI workbench_contracts gate; record design evidence for verified slices. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
663a8ba2c0
commit
03396afd02
41 files changed
+2997
-68
No files matched your search
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"schema": "DocumentViewV1",
|
||||
"schema_version": 1,
|
||||
"document": {
|
||||
"id": "knowledge/example.mq.md",
|
||||
"title": "知识标题",
|
||||
"source_revision": "sha256:requested-source",
|
||||
"semantic_digest": "sha256:semantic-facts",
|
||||
"generation_id": null,
|
||||
"presentation_token": "opaque-token"
|
||||
},
|
||||
"execution": {"state": "not_run", "run_id": null},
|
||||
"render": {"format": "sanitized_html", "fragment": "<article class=\"mq-document\"></article>", "renderer_version": "1"},
|
||||
"outline": [],
|
||||
"nodes": [],
|
||||
"refs": [],
|
||||
"diagnostics": [{"code": "partial", "message": "missing dependency"}],
|
||||
"completeness": "partial",
|
||||
"capabilities": {"read_only": true, "has_semantics": true, "executed": false}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"ok": false,
|
||||
"error": {
|
||||
"code": "view.document_unsupported_format",
|
||||
"message": "binary formats require extract adapter",
|
||||
"retryable": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"schema": "KnowledgeLocatorV1",
|
||||
"schema_version": 1,
|
||||
"resolution": "stale",
|
||||
"precision": "document",
|
||||
"locator": {
|
||||
"schema": "KnowledgeLocatorV1",
|
||||
"schema_version": 1,
|
||||
"project_id": "/authorized/project",
|
||||
"document_id": "knowledge/example.mq.md",
|
||||
"source_revision": "sha256:old",
|
||||
"artifact_id": "mq://project/example/function",
|
||||
"relation": "cites"
|
||||
},
|
||||
"target": null,
|
||||
"candidates": [],
|
||||
"diagnostics": [{"code": "source_revision_mismatch", "message": "expected sha256:old, actual sha256:new"}],
|
||||
"label": "该来源已变化"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"schema": "KnowledgeLocatorV1",
|
||||
"schema_version": 1,
|
||||
"resolution": "version_unavailable",
|
||||
"precision": "none",
|
||||
"locator": {
|
||||
"schema": "KnowledgeLocatorV1",
|
||||
"schema_version": 1,
|
||||
"project_id": "/authorized/project",
|
||||
"document_id": "knowledge/example.mq.md",
|
||||
"generation_id": "generation-missing",
|
||||
"artifact_id": "mq://project/example/function",
|
||||
"relation": "cites"
|
||||
},
|
||||
"target": null,
|
||||
"candidates": [],
|
||||
"diagnostics": [{"code": "generation_unavailable", "message": "snapshot not retained"}],
|
||||
"label": "引用版本不可用"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"schema": "ModelCallUsageV1",
|
||||
"schema_version": 1,
|
||||
"call_id": "call-2",
|
||||
"attempt_id": "attempt-1",
|
||||
"parent_call_id": null,
|
||||
"run_id": "run-1",
|
||||
"turn_id": "turn-1",
|
||||
"workspace_scope": "ws-1",
|
||||
"purpose": "answer",
|
||||
"selection_id": "sel-1",
|
||||
"provider_id": "provider-1",
|
||||
"model_id": "model-2",
|
||||
"requested_model": "example-model",
|
||||
"resolved_model": "example-model",
|
||||
"status": "cancelled",
|
||||
"usage_state": "partial",
|
||||
"measurement_source": "provider",
|
||||
"input_tokens": 100,
|
||||
"output_tokens": 12,
|
||||
"total_tokens": 112,
|
||||
"cached_input_tokens": null,
|
||||
"reasoning_output_tokens": null,
|
||||
"revision": 2,
|
||||
"diagnostics": []
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"schema": "ModelCallUsageV1",
|
||||
"schema_version": 1,
|
||||
"call_id": "call-1",
|
||||
"attempt_id": "attempt-1",
|
||||
"parent_call_id": null,
|
||||
"run_id": "run-1",
|
||||
"turn_id": "turn-1",
|
||||
"workspace_scope": "ws-1",
|
||||
"purpose": "answer",
|
||||
"selection_id": "sel-1",
|
||||
"provider_id": "provider-1",
|
||||
"model_id": "model-2",
|
||||
"requested_model": "example-model",
|
||||
"resolved_model": "example-model",
|
||||
"status": "succeeded",
|
||||
"usage_state": "unknown",
|
||||
"measurement_source": "none",
|
||||
"input_tokens": null,
|
||||
"output_tokens": null,
|
||||
"total_tokens": null,
|
||||
"cached_input_tokens": null,
|
||||
"reasoning_output_tokens": null,
|
||||
"revision": 1,
|
||||
"diagnostics": []
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"schema": "ModelSelectionV1",
|
||||
"schema_version": 1,
|
||||
"error": {
|
||||
"code": "llm.selection_missing",
|
||||
"message": "selection_id required in strict mode",
|
||||
"retryable": false
|
||||
},
|
||||
"partial": {
|
||||
"model_id": "model-2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"schema": "ModelSelectionV1",
|
||||
"schema_version": 1,
|
||||
"selection_id": "sel-1",
|
||||
"provider_id": "provider-1",
|
||||
"model_id": "model-2",
|
||||
"provider_revision": 3,
|
||||
"model_revision": 5,
|
||||
"adapter": "openai-compatible",
|
||||
"endpoint_ref": "endpoint-local-1",
|
||||
"credential_ref": "credential-local-1",
|
||||
"credential_version": 2,
|
||||
"upstream_model_id": "example-model",
|
||||
"parameters": {"max_output_tokens": 2048},
|
||||
"fallback_policy": "disabled",
|
||||
"auth_mode": "api_key"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"schema": "RuntimeEventV1",
|
||||
"schema_version": 1,
|
||||
"event_id": "evt-9",
|
||||
"seq": 9,
|
||||
"run_id": "run-1",
|
||||
"parent_run_id": null,
|
||||
"turn_id": "turn-1",
|
||||
"workspace_scope": "ws-1",
|
||||
"timestamp": "2026-10-25T01:00:04Z",
|
||||
"type": "run.cancelled",
|
||||
"payload": {"reason": "user_stop", "usage_state": "partial"}
|
||||
}
|
||||
Reference in new issue
Block a user