` block.
@RATIONALE Read-once key display: raw key shown in a `` block with Copy button. After user dismisses, raw key is gone forever. List shows prefix only.
@@ -268,3 +287,5 @@ UI elements:
- Revoke: confirmation dialog, then `DELETE /api/admin/api-keys/{id}`
@UX_STATE idle/generating/generated/revoking/error
+
+## @} ApiKeySettingsPanel
\ No newline at end of file
diff --git a/specs/032-translate-requests-httpx/contracts/modules.md b/specs/032-translate-requests-httpx/contracts/modules.md
index 11d4d7411..464f61a24 100644
--- a/specs/032-translate-requests-httpx/contracts/modules.md
+++ b/specs/032-translate-requests-httpx/contracts/modules.md
@@ -370,17 +370,20 @@ async def cleanup_directory(path: str) -> None
## Tombstoned Contracts
-### @{ Spec.TranslateRequestsHttpx.APIClient [Tombstone] [TYPE Class]
+## @{ Spec.TranslateRequestsHttpx.APIClient [C:1] [TYPE Tombstone]
+@STATUS DEPRECATED
@DEPRECATED 2026-06-04 — заменён на AsyncAPIClient. Синхронный requests.Session больше не используется.
@REPLACED_BY -> [AsyncAPIClient]
## @} Spec.TranslateRequestsHttpx.APIClient
-### @{ Spec.TranslateRequestsHttpx.AsyncSupersetClient [Tombstone] [TYPE Class]
+## @{ Spec.TranslateRequestsHttpx.AsyncSupersetClient [C:1] [TYPE Tombstone]
+@STATUS DEPRECATED
@DEPRECATED 2026-06-04 — поглощён единым асинхронным SupersetClient.
@REPLACED_BY -> [SupersetClient]
## @} Spec.TranslateRequestsHttpx.AsyncSupersetClient
-### @{ Spec.TranslateRequestsHttpx.LLMHttpClientLegacy [Tombstone] [TYPE Module]
+## @{ Spec.TranslateRequestsHttpx.LLMHttpClientLegacy [C:1] [TYPE Tombstone]
+@STATUS DEPRECATED
@DEPRECATED 2026-06-04 — `_llm_http.py` и `preview_llm_client.py` заменены унифицированным `LLMHttpClient`.
@REPLACED_BY -> [LLMHttpClient]
## @} Spec.TranslateRequestsHttpx.LLMHttpClientLegacy
diff --git a/specs/033-gradio-agent-chat/fixtures/manifest.md b/specs/033-gradio-agent-chat/fixtures/manifest.md
index 6cdbdc749..ac5258a25 100644
--- a/specs/033-gradio-agent-chat/fixtures/manifest.md
+++ b/specs/033-gradio-agent-chat/fixtures/manifest.md
@@ -1,4 +1,4 @@
-#region Spec.GradioAgentChat.FixtureManifest [C:3] [TYPE ADR] [SEMANTICS test,fixture,agent-chat]
+## @{ Spec.GradioAgentChat.FixtureManifest [C:3] [TYPE ADR] [SEMANTICS test,fixture,agent-chat]
@defgroup Fixtures Canonical test fixtures for Gradio Agent Chat (LangGraph stack).
## @{ Fixture FX_AgentChat.Conversations.ListValid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@@ -8,7 +8,6 @@
@TEST_EDGE: valid_request -> 200 with items[] and meta
## @} Fixture FX_AgentChat.Conversations.ListValid
-## @} FX_AgentChat.Conversations.ListValid
## @{ Fixture FX_AgentChat.Conversations.ListEmpty [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Empty conversation list — new user, no conversations.
@RELATION VERIFIES -> [AgentChat.Api.ListConversations]
@@ -16,7 +15,6 @@
@TEST_EDGE: empty_result -> items=[], totals=0
## @} Fixture FX_AgentChat.Conversations.ListEmpty
-## @} FX_AgentChat.Conversations.ListEmpty
## @{ Fixture FX_AgentChat.Conversations.ListMissingAuth [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Missing Authorization header → 401.
@RELATION VERIFIES -> [AgentChat.Api.ListConversations]
@@ -24,7 +22,6 @@
@TEST_EDGE: missing_field (Authorization) -> 401 UNAUTHORIZED
## @} Fixture FX_AgentChat.Conversations.ListMissingAuth
-## @} FX_AgentChat.Conversations.ListMissingAuth
## @{ Fixture FX_AgentChat.Conversations.ListInvalidPage [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Invalid page parameter → 422 validation error.
@RELATION VERIFIES -> [AgentChat.Api.ListConversations]
@@ -32,7 +29,6 @@
@TEST_EDGE: invalid_type (page=-1) -> 422 VALIDATION_ERROR
## @} Fixture FX_AgentChat.Conversations.ListInvalidPage
-## @} FX_AgentChat.Conversations.ListInvalidPage
## @{ Fixture FX_AgentChat.Conversations.ListExternalFail [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Database connection failure → 500.
@RELATION VERIFIES -> [AgentChat.Api.ListConversations]
@@ -40,7 +36,6 @@
@TEST_EDGE: external_fail (DB down) -> 500 INTERNAL_ERROR
## @} Fixture FX_AgentChat.Conversations.ListExternalFail
-## @} FX_AgentChat.Conversations.ListExternalFail
## @{ Fixture FX_AgentChat.History.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Valid paginated history response for existing conversation.
@RELATION VERIFIES -> [AgentChat.Api.GetHistory]
@@ -48,7 +43,6 @@
@TEST_EDGE: valid_conversation_id -> 200 with messages[]
## @} Fixture FX_AgentChat.History.Valid
-## @} FX_AgentChat.History.Valid
## @{ Fixture FX_AgentChat.History.NotFound [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Non-existent conversation → 404.
@RELATION VERIFIES -> [AgentChat.Api.GetHistory]
@@ -56,7 +50,6 @@
@TEST_EDGE: invalid_conversation_id -> 404 NOT_FOUND
## @} Fixture FX_AgentChat.History.NotFound
-## @} FX_AgentChat.History.NotFound
## @{ Fixture FX_AgentChat.History.MissingField [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Missing conversation_id parameter → 422.
@RELATION VERIFIES -> [AgentChat.Api.GetHistory]
@@ -64,7 +57,6 @@
@TEST_EDGE: missing_field (conversation_id) -> 422 VALIDATION_ERROR
## @} Fixture FX_AgentChat.History.MissingField
-## @} FX_AgentChat.History.MissingField
## @{ Fixture FX_AgentChat.Delete.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Valid soft-delete (archive) of owned conversation.
@RELATION VERIFIES -> [AgentChat.Api.DeleteConversation]
@@ -72,7 +64,6 @@
@TEST_EDGE: valid_conversation_id -> 200, is_archived=true
## @} Fixture FX_AgentChat.Delete.Valid
-## @} FX_AgentChat.Delete.Valid
## @{ Fixture FX_AgentChat.Delete.NotOwner [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Deleting another user's conversation → 403.
@RELATION VERIFIES -> [AgentChat.Api.DeleteConversation]
@@ -80,7 +71,6 @@
@TEST_EDGE: not_owner -> 403 FORBIDDEN
## @} Fixture FX_AgentChat.Delete.NotOwner
-## @} FX_AgentChat.Delete.NotOwner
## @{ Fixture FX_AgentChat.Delete.NotFound [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Deleting already-deleted conversation → 404.
@RELATION VERIFIES -> [AgentChat.Api.DeleteConversation]
@@ -88,7 +78,6 @@
@TEST_EDGE: already_deleted -> 404 NOT_FOUND
## @} Fixture FX_AgentChat.Delete.NotFound
-## @} FX_AgentChat.Delete.NotFound
## @{ Fixture FX_AgentChat.ServiceToken.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Valid service token request → JWT with role agent.
@RELATION VERIFIES -> [AgentChat.Api.ServiceToken]
@@ -96,7 +85,6 @@
@TEST_EDGE: valid_secret -> 200, role=agent
## @} Fixture FX_AgentChat.ServiceToken.Valid
-## @} FX_AgentChat.ServiceToken.Valid
## @{ Fixture FX_AgentChat.ServiceToken.InvalidSecret [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Wrong service secret → 401.
@RELATION VERIFIES -> [AgentChat.Api.ServiceToken]
@@ -104,7 +92,6 @@
@TEST_EDGE: invalid_secret -> 401 UNAUTHORIZED
## @} Fixture FX_AgentChat.ServiceToken.InvalidSecret
-## @} FX_AgentChat.ServiceToken.InvalidSecret
## @{ Fixture FX_AgentChat.Document.ParsePdf.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Valid PDF → extracted text.
@RELATION VERIFIES -> [AgentChat.Document.ParsePdf]
@@ -112,7 +99,6 @@
@TEST_EDGE: valid_pdf -> text extracted
## @} Fixture FX_AgentChat.Document.ParsePdf.Valid
-## @} FX_AgentChat.Document.ParsePdf.Valid
## @{ Fixture FX_AgentChat.Document.ParsePdf.Encrypted [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Encrypted PDF → ParseError.
@RELATION VERIFIES -> [AgentChat.Document.ParsePdf]
@@ -120,7 +106,6 @@
@TEST_EDGE: encrypted_pdf -> ParseError
## @} Fixture FX_AgentChat.Document.ParsePdf.Encrypted
-## @} FX_AgentChat.Document.ParsePdf.Encrypted
## @{ Fixture FX_AgentChat.Document.ParseXlsx.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Valid XLSX → structured sheet data.
@RELATION VERIFIES -> [AgentChat.Document.ParseXlsx]
@@ -128,7 +113,6 @@
@TEST_EDGE: valid_xlsx -> sheets parsed
## @} Fixture FX_AgentChat.Document.ParseXlsx.Valid
-## @} FX_AgentChat.Document.ParseXlsx.Valid
## @{ Fixture FX_AgentChat.Document.ParseXlsx.PasswordProtected [C:2] [TYPE Block] [SEMANTICS test,fixture,api]
@BRIEF Password-protected XLSX → ParseError.
@RELATION VERIFIES -> [AgentChat.Document.ParseXlsx]
@@ -136,7 +120,6 @@
@TEST_EDGE: password_protected -> ParseError with clear message
## @} Fixture FX_AgentChat.Document.ParseXlsx.PasswordProtected
-## @} FX_AgentChat.Document.ParseXlsx.PasswordProtected
## @{ Fixture FX_AgentChat.Model.SendMessage.Valid [C:2] [TYPE Block] [SEMANTICS test,fixture,model]
@BRIEF Valid sendMessage invocation — transitions to streaming state.
@RELATION VERIFIES -> [AgentChat.Model]
@@ -144,7 +127,6 @@
@TEST_INVARIANT: StreamingStateGatesInput -> VERIFIED_BY: [Test.AgentChat.Model]
## @} Fixture FX_AgentChat.Model.SendMessage.Valid
-## @} FX_AgentChat.Model.SendMessage.Valid
## @{ Fixture FX_AgentChat.Model.CancelGeneration [C:2] [TYPE Block] [SEMANTICS test,fixture,model]
@BRIEF Cancel during streaming — returns to idle, partial text preserved.
@RELATION VERIFIES -> [AgentChat.Model]
@@ -152,7 +134,6 @@
@TEST_EDGE: cancel_during_streaming -> idle, partialText preserved
## @} Fixture FX_AgentChat.Model.CancelGeneration
-## @} FX_AgentChat.Model.CancelGeneration
## @{ Fixture FX_AgentChat.Model.ResumeConfirm [C:2] [TYPE Block] [SEMANTICS test,fixture,model]
@BRIEF HITL resume confirm — transitions from awaiting_confirmation to streaming.
@RELATION VERIFIES -> [AgentChat.Model]
@@ -160,7 +141,6 @@
@TEST_EDGE: confirm_from_awaiting -> streaming, pendingThreadId cleared
## @} Fixture FX_AgentChat.Model.ResumeConfirm
-## @} FX_AgentChat.Model.ResumeConfirm
## @{ Fixture FX_AgentChat.Model.ResumeDeny [C:2] [TYPE Block] [SEMANTICS test,fixture,model]
@BRIEF HITL resume deny — transitions to idle.
@RELATION VERIFIES -> [AgentChat.Model]
@@ -168,7 +148,6 @@
@TEST_EDGE: deny_from_awaiting -> idle
## @} Fixture FX_AgentChat.Model.ResumeDeny
-## @} FX_AgentChat.Model.ResumeDeny
## @{ Fixture FX_AgentChat.Model.RejectedPath [C:2] [TYPE Block] [SEMANTICS test,fixture,model]
@BRIEF @REJECTED: WebSocket model cannot be resurrected — verify no WebSocket imports.
@RELATION VERIFIES -> [AgentChat.Model]
@@ -176,5 +155,4 @@
@TEST_INVARIANT: NoWebSocketImports -> VERIFIED_BY: [Test.AgentChat.Model.RejectedPaths]
## @} Fixture FX_AgentChat.Model.RejectedPath
-#endregion Spec.GradioAgentChat.FixtureManifest
-## @} FX_AgentChat.Model.RejectedPath
+## @} Spec.GradioAgentChat.FixtureManifest
diff --git a/specs/034-task-status-center/research.md b/specs/034-task-status-center/research.md
index 67a69ca9b..94d189167 100644
--- a/specs/034-task-status-center/research.md
+++ b/specs/034-task-status-center/research.md
@@ -68,7 +68,7 @@ screenState: ScreenState // idle | loading | empty | disconnected | error
wsConnected: boolean
selectedTaskId: string | null
-// @DERIVED:
+// @UX_REACTIVITY:
filteredTasks: TaskReport[] // Derived from tasks + filters
activeTasksFirst: TaskReport[] // Sort: active before completed
diff --git a/specs/035-agent-chat-context/fixtures/manifest.md b/specs/035-agent-chat-context/fixtures/manifest.md
index 2427d8880..7ea195991 100644
--- a/specs/035-agent-chat-context/fixtures/manifest.md
+++ b/specs/035-agent-chat-context/fixtures/manifest.md
@@ -1,4 +1,4 @@
-#region Spec.AgentChatContext.FixtureManifest [C:3] [TYPE ADR] [SEMANTICS test,fixture,agent-chat]
+## @{ Spec.AgentChatContext.FixtureManifest [C:3] [TYPE ADR] [SEMANTICS test,fixture,agent-chat]
@defgroup Fixtures Canonical test fixtures for 035-agent-chat-context.
## @{ Fixture FX_AgentChat.Handler.NullContext [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture]
@@ -9,7 +9,6 @@
@TEST_INVARIANT: BackwardCompat -> VERIFIED_BY: [Test.AgentChat.Context]
## @} Fixture FX_AgentChat.Handler.NullContext
-## @} FX_AgentChat.Handler.NullContext
## @{ Fixture FX_AgentChat.Handler.DashboardContext [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture]
@BRIEF Agent handler with dashboard uicontext — 9 dashboard tools passed.
@RELATION VERIFIES -> [AgentChat.LangGraph.Handler]
@@ -17,7 +16,6 @@
@TEST_FIXTURE: dashboard_context -> fixtures/api/agentchat_handler_dashboard_context.json
## @} Fixture FX_AgentChat.Handler.DashboardContext
-## @} FX_AgentChat.Handler.DashboardContext
## @{ Fixture FX_AgentChat.Handler.InvalidJson [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture]
@BRIEF Agent handler with malformed JSON uicontext — gracefully ignored.
@RELATION VERIFIES -> [AgentChat.LangGraph.Handler]
@@ -25,7 +23,6 @@
@TEST_FIXTURE: invalid_json -> fixtures/api/agentchat_handler_invalid_json.json
## @} Fixture FX_AgentChat.Handler.InvalidJson
-## @} FX_AgentChat.Handler.InvalidJson
## @{ Fixture FX_AgentChat.Guard.DeployProd [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,guardrails]
@BRIEF deploy_dashboard to prod — risk=write, env=prod, dangerous=false.
@RELATION VERIFIES -> [AgentChat.Confirmation.GuardV2]
@@ -33,7 +30,6 @@
@TEST_FIXTURE: deploy_prod -> fixtures/api/agentchat_guard_deploy_prod.json
## @} Fixture FX_AgentChat.Guard.DeployProd
-## @} FX_AgentChat.Guard.DeployProd
## @{ Fixture FX_AgentChat.Guard.DeleteAny [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,guardrails]
@BRIEF delete_dashboard in any env — risk=dangerous, dangerous=true.
@RELATION VERIFIES -> [AgentChat.Confirmation.GuardV2]
@@ -41,7 +37,6 @@
@TEST_FIXTURE: delete_any -> fixtures/api/agentchat_guard_delete_any.json
## @} Fixture FX_AgentChat.Guard.DeleteAny
-## @} FX_AgentChat.Guard.DeleteAny
## @{ Fixture FX_AgentChat.Guard.ReadOnly [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,guardrails]
@BRIEF search_dashboards — risk=read, safe.
@RELATION VERIFIES -> [AgentChat.Confirmation.GuardV2]
@@ -49,7 +44,6 @@
@TEST_FIXTURE: read_only -> fixtures/api/agentchat_guard_read_only.json
## @} Fixture FX_AgentChat.Guard.ReadOnly
-## @} FX_AgentChat.Guard.ReadOnly
## @{ Fixture FX_AgentChat.Guard.PermissionDenied [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,guardrails]
@BRIEF analyst attempting deploy to prod — permission_granted=false.
@RELATION VERIFIES -> [AgentChat.Confirmation.GuardV2]
@@ -57,7 +51,6 @@
@TEST_FIXTURE: permission_denied -> fixtures/api/agentchat_guard_permission_denied.json
## @} Fixture FX_AgentChat.Guard.PermissionDenied
-## @} FX_AgentChat.Guard.PermissionDenied
## @{ Fixture FX_AgentChat.Filter.NullType [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,tools]
@BRIEF filter_tools_by_context(null) — returns all tools.
@RELATION VERIFIES -> [AgentChat.ToolFilter.FilterByContext]
@@ -65,7 +58,6 @@
@TEST_FIXTURE: null_type -> fixtures/api/agentchat_filter_null_type.json
## @} Fixture FX_AgentChat.Filter.NullType
-## @} FX_AgentChat.Filter.NullType
## @{ Fixture FX_AgentChat.Filter.Dashboard [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,tools]
@BRIEF filter_tools_by_context("dashboard") — returns 9 tools.
@RELATION VERIFIES -> [AgentChat.ToolFilter.FilterByContext]
@@ -73,7 +65,6 @@
@TEST_FIXTURE: dashboard -> fixtures/api/agentchat_filter_dashboard.json
## @} Fixture FX_AgentChat.Filter.Dashboard
-## @} FX_AgentChat.Filter.Dashboard
## @{ Fixture FX_AgentChat.Filter.Unknown [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,tools]
@BRIEF filter_tools_by_context("unknown_type") — returns all tools (fallback).
@RELATION VERIFIES -> [AgentChat.ToolFilter.FilterByContext]
@@ -81,7 +72,6 @@
@TEST_FIXTURE: unknown -> fixtures/api/agentchat_filter_unknown.json
## @} Fixture FX_AgentChat.Filter.Unknown
-## @} FX_AgentChat.Filter.Unknown
## @{ Fixture FX_AgentChat.SetContext.FullParams [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,model]
@BRIEF setUIContextFromParams with all params — uiContext fully populated.
@RELATION VERIFIES -> [AgentChat.Model.SetContext]
@@ -89,7 +79,6 @@
@TEST_FIXTURE: full_params -> fixtures/model/agentchat_setcontext_full_params.json
## @} Fixture FX_AgentChat.SetContext.FullParams
-## @} FX_AgentChat.SetContext.FullParams
## @{ Fixture FX_AgentChat.SetContext.NoParams [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,model]
@BRIEF setUIContextFromParams with empty params — uiContext is null.
@RELATION VERIFIES -> [AgentChat.Model.SetContext]
@@ -97,7 +86,6 @@
@TEST_FIXTURE: no_params -> fixtures/model/agentchat_setcontext_no_params.json
## @} Fixture FX_AgentChat.SetContext.NoParams
-## @} FX_AgentChat.SetContext.NoParams
## @{ Fixture FX_AgentChat.Retry.First502 [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,tools]
@BRIEF Read tool gets 502 on first attempt — retries once, succeeds.
@RELATION VERIFIES -> [AgentChat.Tools.Retry]
@@ -105,7 +93,6 @@
@TEST_FIXTURE: first_502 -> fixtures/api/agentchat_retry_first_502.json
## @} Fixture FX_AgentChat.Retry.First502
-## @} FX_AgentChat.Retry.First502
## @{ Fixture FX_AgentChat.Retry.Both502 [C:2] [TYPE Block] [SEMANTICS test,agent-chat,fixture,tools]
@BRIEF Read tool gets 502 on both attempts — raises with retry_exhausted=true.
@RELATION VERIFIES -> [AgentChat.Tools.Retry]
@@ -113,5 +100,4 @@
@TEST_FIXTURE: both_502 -> fixtures/api/agentchat_retry_both_502.json
## @} Fixture FX_AgentChat.Retry.Both502
-#endregion Spec.AgentChatContext.FixtureManifest
-## @} FX_AgentChat.Retry.Both502
+## @} Spec.AgentChatContext.FixtureManifest
diff --git a/specs/036-agent-test-stabilization/checklists/requirements.md b/specs/036-agent-test-stabilization/checklists/requirements.md
index 2d596b08a..2f343645a 100644
--- a/specs/036-agent-test-stabilization/checklists/requirements.md
+++ b/specs/036-agent-test-stabilization/checklists/requirements.md
@@ -10,7 +10,7 @@
- [x] CHK002 Functional requirements avoid implementation code while defining observable behavior.
- [x] CHK003 No unresolved `[NEEDS CLARIFICATION]` markers remain.
- [x] CHK004 Edge cases include stale context, dropped stream, permission denial, and backwards compatibility.
-- [x] CHK004a Screenshot masking requirement is explicit: DOM-level masking before LLM transmission, original preserved for audit.
+- [x] CHK004a PII posture is explicit: all configured MCP and LLM/VLM clients are local; masking is optional display/export hygiene and is not a VLM or evidence gate. Credentials, cookies, tokens, and unrelated secrets remain prohibited in provider payloads and telemetry.
## Constitution Coverage
diff --git a/specs/036-agent-test-stabilization/contracts/evidence.md b/specs/036-agent-test-stabilization/contracts/evidence.md
index ee825e7d6..be4d83816 100644
--- a/specs/036-agent-test-stabilization/contracts/evidence.md
+++ b/specs/036-agent-test-stabilization/contracts/evidence.md
@@ -29,10 +29,10 @@ The adapter does not implement capture, masking, VLM submission, or redaction. I
# @RELATION DEPENDS_ON -> [Plugin.Service.LLMClient]
# @RELATION DEPENDS_ON -> [Plugin.Service.RedactionService]
# @DATA_CONTRACT CaptureSpec + AgentRun -> DraftArtifact[]
-# @INVARIANT Original capture never reaches external LLM; only masked derivative does.
+# @INVARIANT All configured MCP and VLM clients are local deployments inside the enterprise trust perimeter; PII in captures is an accepted residual risk and masking is optional. Credentials, cookies, tokens, and unrelated secrets never enter provider payloads or telemetry.
# @INVARIANT Every capture carries capture_meta for reproducibility.
# @INVARIANT VLM submission reuses `Plugin.Service.LLMClient`; a second provider client is forbidden.
-# @TEST_EDGE no_mask_selectors -> original and masked artifacts remain separate.
+# @TEST_EDGE no_mask_selectors -> unmasked capture remains valid evidence; an optional masked derivative, when requested, remains a separate artifact.
# @TEST_EDGE vlm_failure -> evidence remains valid WARN; analysis becomes inconclusive.
# @TEST_EDGE missing_capture_meta -> 422.
# #endregion AgentRuns.Evidence.Adapter
diff --git a/specs/036-agent-test-stabilization/data-model.md b/specs/036-agent-test-stabilization/data-model.md
index a3bda461a..61303a762 100644
--- a/specs/036-agent-test-stabilization/data-model.md
+++ b/specs/036-agent-test-stabilization/data-model.md
@@ -99,7 +99,7 @@ When `kind` is `screenshot_evidence`, the artifact carries a `capture_meta` bloc
| browser_version | string/null | Captured when available |
| captured_at | ISO-8601 | Server timestamp of capture |
-Masked derivative for LLM submission is stored as a separate DraftArtifact of kind `other` with `name` containing the original artifact id and `_masked` suffix. The original unmasked capture is never transmitted externally.
+Masking is optional display/export hygiene because all configured MCP and LLM/VLM clients are local deployments inside the enterprise trust perimeter. When requested, a masked derivative is stored as a separate DraftArtifact of kind `other` with `name` containing the original artifact id and `_masked` suffix. PII may remain in local provider payloads; credentials, cookies, tokens, and unrelated secrets are never transmitted or persisted in telemetry.
## ActionApprovalGate
diff --git a/specs/036-agent-test-stabilization/spec.md b/specs/036-agent-test-stabilization/spec.md
index 2d1a1a362..edb6753b0 100644
--- a/specs/036-agent-test-stabilization/spec.md
+++ b/specs/036-agent-test-stabilization/spec.md
@@ -131,4 +131,6 @@ Gradio chat retirement is formalized in `specs/050-mcp-interface/spec.md`. Carry
- **Re-targeted**: AGSTAB-FR-003 progress-event UI requirements lose their chat consumer; structured events remain the contract for any future server-side observer. AGSTAB-FR-008 smoke test is superseded by 050 Phase 2 e2e.
- **PII posture (2026-08-24)**: AGSTAB-FR-009 superseded — masking is optional; local-only LLM/VLM deployment inside the enterprise perimeter is the accepted confidentiality boundary for evidence. The mask-miss detection edge case is withdrawn accordingly.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion AgentTestStabilization.Spec
diff --git a/specs/036-agent-test-stabilization/tasks.md b/specs/036-agent-test-stabilization/tasks.md
index b8dcb219f..53a9fe6a4 100644
--- a/specs/036-agent-test-stabilization/tasks.md
+++ b/specs/036-agent-test-stabilization/tasks.md
@@ -76,7 +76,7 @@
- [x] T040 Run backend/agent ruff, backend/agent pytest, frontend lint/test/build.
- [x] T041 Audit ATTN_1–4, exact anchor pairs, unresolved relations, and direct-SQL exclusion.
-## Phase 8 — Screenshot Evidence (AGSTAB-FR-009)
+## Phase 8 — Screenshot Evidence and Optional Display Masking (AGSTAB-FR-009)
- [x] T042 [P] Write failing capture_meta validation and masking tests in backend/tests/services/agent_runs/test_evidence.py.
- [x] T043 [P] Add capture_meta fields to DraftArtifact Pydantic model; validate kind=screenshot_evidence requires capture_meta.
@@ -86,8 +86,8 @@
- [x] T047 Extend AgentRuns.Gradio.Emit to emit evidence_captured events with artifact refs, viewport, and sha256.
- [x] T048 Write failing evidence preview/disposition model tests in frontend/src/lib/models/__tests__/AgentRunModel.evidence.test.ts.
- [x] T049 Extend frontend AgentRunModel to accept evidence_captured events and expose evidence array.
-- [x] T050 Verify masked derivative is stored separately; original is never retrievable through external preview URLs.
-- [x] T051 Audit no-unmasked-screenshot-leaves-backend invariant.
+- [x] T050 Verify optional masked derivatives are stored separately and preview ACLs are enforced; unmasked local-provider submission is allowed, while credentials/cookies/tokens are never exposed.
+- [x] T051 Audit local-provider evidence handling: unmasked capture is permitted for local LLM/VLM analysis; preview ACLs and secret exclusion remain enforced.
## Implementation Closure — Lifecycle, Idempotency, Recovery, Readiness
diff --git a/specs/036-agent-test-stabilization/traceability.md b/specs/036-agent-test-stabilization/traceability.md
index 1009ecc85..6e51e4058 100644
--- a/specs/036-agent-test-stabilization/traceability.md
+++ b/specs/036-agent-test-stabilization/traceability.md
@@ -11,7 +11,7 @@
| AGSTAB-FR-006 | AgentRuns.Api, scenario invocation guard | T006, T012, T034 | RBAC and permission_denied tests |
| AGSTAB-FR-007 | UIContext compatibility and regression phase | T009, T038 | existing 033/035 suites |
| AGSTAB-FR-008 | End-to-end contracts | T035–T037 | Playwright/live smoke |
-| AGSTAB-FR-009 | AgentRuns.Evidence.Adapter, AgentRuns.Artifacts.Register | T042–T045 | masking, capture_meta, evidence_captured |
+| AGSTAB-FR-009 | AgentRuns.Evidence.Adapter, AgentRuns.Artifacts.Register | T042–T045 | optional masking, capture_meta, evidence_captured; local-provider PII posture |
## Story Coverage
diff --git a/specs/037-superset-baseline-engine/spec.md b/specs/037-superset-baseline-engine/spec.md
index fa1d7f7dc..ff48f3856 100644
--- a/specs/037-superset-baseline-engine/spec.md
+++ b/specs/037-superset-baseline-engine/spec.md
@@ -134,4 +134,6 @@
- Baseline tools (`capture_baseline_candidate`, approval lifecycle, `create_verification_run`) are exposed 1:1 through the MCP catalog (050 Phase 1 parity); no behavioral change to engine semantics.
- The vendored `research/mcp-superset` server is explicitly NOT adopted as an alternative surface: it bypasses this feature's server-side hash computation, release pinning and immutability rules.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion SupersetBaselineEngine.Spec
diff --git a/specs/037-superset-baseline-engine/tasks.md b/specs/037-superset-baseline-engine/tasks.md
index 1fad8f997..4ddf81e12 100644
--- a/specs/037-superset-baseline-engine/tasks.md
+++ b/specs/037-superset-baseline-engine/tasks.md
@@ -123,11 +123,11 @@ T001–T005 → US1 → US2 → US3; US4 depends on US3 and completed 036. API i
- [x] T080 [P] [AGBASE-FR-012 context] Create VerificationRun automatically on pipeline triggers: wire `create_verification_run_async` into the deploy hook path (`backend/src/plugins/git_deployment_recorder.py` or the deploy route) for `deploy_to_preprod`, and add trigger values `release_create`/`etl_completed` call sites.
@POST: deploying to PREPROD creates a VerificationRun with trigger=deploy_to_preprod and executes metric/visual/structure categories.
@TEST: integration test — deploy a fixture release → VerificationRun row exists with correct trigger and outcomes.
- @DONE 2026-08-12 commit 81de959e — `_trigger_release_verification` fires trigger=release_create on release creation (`backend/src/api/routes/git/_release_routes.py`), trigger enums include deploy_to_preprod/etl_completed; tests in `test_git_release_routes.py` (release_create spawn) + `test_dashboard_testing_verification_api.py` (deploy_to_preprod persistence).
+ DONE 2026-08-12 commit 81de959e — `_trigger_release_verification` fires trigger=release_create on release creation (`backend/src/api/routes/git/_release_routes.py`), trigger enums include deploy_to_preprod/etl_completed; tests in `test_git_release_routes.py` (release_create spawn) + `test_dashboard_testing_verification_api.py` (deploy_to_preprod persistence).
- [x] T081 [P] [AGUI-FR-015/016] Add read endpoints in `backend/src/api/routes/dashboard_testing/verification.py`: `GET /verification/history?dashboard_id=&env_id=` (chronological list) and `GET /verification/{run_id}` (detail with category outcomes), matching `frontend/src/lib/api/dashboard-testing.ts` `getVerificationHistory()`/`getVerificationRun()`.
@POST contract: response shape == `VerificationRunDTO[]` / `VerificationRunDTO` used by frontend.
@TEST: API test asserts list ordering, filters, and detail payload; OpenAPI drift check.
- @DONE 2026-08-12 commit 81de959e — `VerificationHistory`/`VerificationDetail` endpoints live in `backend/src/api/routes/dashboard_testing/verification.py`; frontend `getVerificationHistory()`/`getVerificationRun()` present; OpenAPI alignment test passes.
+ DONE 2026-08-12 commit 81de959e — `VerificationHistory`/`VerificationDetail` endpoints live in `backend/src/api/routes/dashboard_testing/verification.py`; frontend `getVerificationHistory()`/`getVerificationRun()` present; OpenAPI alignment test passes.
## Dependencies
diff --git a/specs/038-dashboard-scenario-model/contracts/modules.md b/specs/038-dashboard-scenario-model/contracts/modules.md
index d748383d2..17592f3d4 100644
--- a/specs/038-dashboard-scenario-model/contracts/modules.md
+++ b/specs/038-dashboard-scenario-model/contracts/modules.md
@@ -188,7 +188,7 @@ bindings in `RunPreflight`.
## @{ ScenarioGraph.AgentAuthoringWorkspace [C:5] [TYPE Module]
@BRIEF Persistent external MCP agent/user authoring, exploratory sandbox and promotion contract.
@RELATION DEPENDS_ON -> [ScenarioGraph.ServerOwnedPipeline]
-@RELATION HANDOFF -> [ScenarioRegistry.SaveContinuation]
+@RELATION DISPATCHES -> [ScenarioRegistry.SaveContinuation]
`create_authoring_session` creates or idempotently returns a server-owned workspace. `propose_test_plan`, `start_exploration`, `get_exploration_result`, `propose_graph_revision`, `get_graph_diff`, and `promote_to_scenario` operate on that persistent workspace. Every mutation carries an idempotency key and expected `cas_version`; stale versions return typed 409 with no partial state.
diff --git a/specs/038-dashboard-scenario-model/spec.md b/specs/038-dashboard-scenario-model/spec.md
index 62856fefc..63df0fe83 100644
--- a/specs/038-dashboard-scenario-model/spec.md
+++ b/specs/038-dashboard-scenario-model/spec.md
@@ -181,10 +181,12 @@
- "Agent" throughout this spec now reads as any delegated actor — external MCP client or in-product surface — always behind the same deterministic validator and provenance rules.
- **PII posture**: masking selectors in `ScreenshotCaptureSpec` and response redaction in the VLM path are OPTIONAL (2026-08-24) — all LLM/VLM providers run locally inside the trust perimeter.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
## @{ DashboardScenarioModel.AgentAuthoringWorkspace [C:5] [TYPE ADR]
@BRIEF Normative external-agent/user co-authoring workspace and promotion boundary for scenario authoring.
@RELATION DEPENDS_ON -> [ScenarioGraph.ServerOwnedPipeline]
-@RELATION HANDOFF -> [ScenarioRegistry.SaveContinuation]
+@RELATION DISPATCHES -> [ScenarioRegistry.SaveContinuation]
`AgentAuthoringWorkspace` is a persistent, server-owned session in which an authenticated user and an external MCP agent may jointly author a scenario. It supports draft edits, exploratory Playwright/code-sandbox checks, result inspection, selector/wait/assertion corrections, and new graph proposals. The agent is a full co-author of intent and diagnostics, but never a production authority.
diff --git a/specs/038-dashboard-scenario-model/tasks.md b/specs/038-dashboard-scenario-model/tasks.md
index 70f247fe3..c91d9ac54 100644
--- a/specs/038-dashboard-scenario-model/tasks.md
+++ b/specs/038-dashboard-scenario-model/tasks.md
@@ -128,7 +128,7 @@
@INVARIANT: disposition never alters scenario graph structure or step ordering
- [x] T045 Add VlmFinding and HumanDisposition DTOs to `contracts/openapi.yaml` response schemas (verify round-trip)
- [x] T046 Wire capture/VLM/disposition into the scenario step execution loop: screenshot step → capture → analysis step → VLM call → human step → disposition
- @REWRITE: runtime execution loop is OWNED by 044. This task is redefined as: verify the compiler emits valid ScreenshotCaptureSpec/VlmAnalysisSpec DTOs that 044 executors can consume; the 038 loop contracts are superseded by 044 ScenarioExecution.
+ @NOTE: runtime execution loop is OWNED by 044. This task is redefined as: verify the compiler emits valid ScreenshotCaptureSpec/VlmAnalysisSpec DTOs that 044 executors can consume; the 038 loop contracts are superseded by 044 ScenarioExecution.
- [x] T047 Audit: VLM findings are advisory, never alter metric baseline truth; disposition never changes graph structure; stale prompts block analysis
**Checkpoint**: Capture/VLM/disposition flow verified end-to-end; typed findings auditable. ✅ (85 tests green, belief audit 0 errors)
diff --git a/specs/039-dashboard-scenario-ui/spec.md b/specs/039-dashboard-scenario-ui/spec.md
index e2190b6e6..3ad373f66 100644
--- a/specs/039-dashboard-scenario-ui/spec.md
+++ b/specs/039-dashboard-scenario-ui/spec.md
@@ -205,4 +205,6 @@ Gradio chat retirement is formalized in `specs/050-mcp-interface/spec.md`.
- **Entry action**: «Создать сценарий тестирования» opens a HandoffSurface — connection instructions plus a copyable prompt carrying dashboard context (`objectType/objectId/envId/route/intent`) for an external MCP client; it never links to `/agent`.
- **Unchanged**: pipeline verification views (AGUI-FR-014..016), Svelte 5 conventions for remaining surfaces, DTO-only component contracts.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion DashboardScenarioUi.Spec
diff --git a/specs/040-dashboard-load-testing/spec.md b/specs/040-dashboard-load-testing/spec.md
index 6b72ff53d..1e7edc366 100644
--- a/specs/040-dashboard-load-testing/spec.md
+++ b/specs/040-dashboard-load-testing/spec.md
@@ -171,4 +171,6 @@
- No chat dependency existed; load surfaces stay web-first. MCP exposure of read-only run/comparison queries is optional future catalog work (050), never bypassing LOAD-FR-002 caps or the PROD gate.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion DashboardLoadTesting.Spec
diff --git a/specs/041-dataset-lineage-blast-radius/spec.md b/specs/041-dataset-lineage-blast-radius/spec.md
index 2eaf819a9..893887921 100644
--- a/specs/041-dataset-lineage-blast-radius/spec.md
+++ b/specs/041-dataset-lineage-blast-radius/spec.md
@@ -149,6 +149,7 @@
- **LIN-FR-015**: The blast-radius graph is two-level (dataset ← chart ← dashboard) by construction; fan-out MUST order by impact severity only. Chained SQL-source lineage and cycle detection are out of scope.
- **LIN-FR-017**: Impact projection MUST respect `projection_confidence`: a schema change marks exact-confidence charts affected only when the changed column/metric is in their consumed set; conservative-confidence charts (or expressions) are marked affected on any schema change to their dataset, with the conservative basis shown to the user.
- **LIN-FR-021**: Impact, deprecation, fan-out and recreated-dataset findings MUST emit idempotent 036 InvestigationSignals. An analyst-opened case MAY use an agent to explain blast radius, build a revalidation plan and save validated scenario revisions; deterministic impact records remain immutable evidence and never auto-start agent work.
+- **LIN-FR-022**: A disabled, stale, or unavailable lineage index MUST be distinguishable from a known-empty dependent set. Any PROD gate, fan-out admission, or load-policy decision receiving non-current lineage state MUST display `blast_radius_unknown` with provenance and block or require an explicit policy escalation; it MUST NOT render zero dependents as fact.
### Key Entities
@@ -192,4 +193,6 @@
- "Agent explains blast radius / builds revalidation plans" (LIN-FR-021) continues with external MCP clients as the delegated actor; impact records, deprecation and fan-out remain deterministic server artifacts that no client can mutate outside governed tools.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion DatasetLineageBlastRadius.Spec
diff --git a/specs/041-dataset-lineage-blast-radius/tasks.md b/specs/041-dataset-lineage-blast-radius/tasks.md
index 659f67735..b5f671bf9 100644
--- a/specs/041-dataset-lineage-blast-radius/tasks.md
+++ b/specs/041-dataset-lineage-blast-radius/tasks.md
@@ -132,7 +132,8 @@ T001–T007 → US1 (index is prerequisite for all) → US2 → US3; US4/US5 par
- [x] T047 [P] [US5] Add fleet-report surface for `dataset_updated` fan-out: per-dashboard status, provenance, unresolved impacts — consumable by 039 pipeline views.
**DONE**: `getFanoutReport` in api/lineage.ts + `DatasetsLineageModel.loadFleetReport(planId)`; LineagePanel "Fan-out report" section (plan id input, per-dashboard status + unresolved-impact badge); `run_status` added to FleetReportDTO. Tested in `Datasets.LineageModel.test.ts` (markDeprecated/recordMigration/loadFleetReport, 6 passed).
- [x] T048 [P] Flip `lineage_index_enabled` default to true in `backend/src/core/config_models.py` after indexer stability proof (or document explicit opt-in default with rationale).
- **DONE (decision)**: default stays **FALSE** with explicit rationale in config — enabling would trigger post-sync Superset detail calls for every env/sync cycle; flip only after live-fleet indexer stability proof. Consumers treat disabled index as empty read-model with stale_notice.
+ **DONE (decision)**: default stays **FALSE** with explicit rationale in config — enabling would trigger post-sync Superset detail calls for every env/sync cycle; flip only after live-fleet indexer stability proof. Consumers treat disabled index as empty read-model with stale_notice.
+- [ ] T049 [P] Add `blast_radius_unknown` handling and tests in `backend/src/services/lineage/` plus 040/041 gate consumers: disabled, stale, and unavailable index states cannot render as known-zero dependents; PROD admission blocks or records explicit policy escalation.
## Story Verification Criteria
diff --git a/specs/042-dashboard-scenario-registry/spec.md b/specs/042-dashboard-scenario-registry/spec.md
index f0548e283..9907100be 100644
--- a/specs/042-dashboard-scenario-registry/spec.md
+++ b/specs/042-dashboard-scenario-registry/spec.md
@@ -156,10 +156,12 @@ current tree. This establishes a partial implementation, not feature closure.
- Registry is the primary non-chat consumer of MCP-created scenarios: revisions saved through 050 tools land here with the same provenance, lifecycle and staleness semantics as any other actor.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
## @{ ScenarioRegistry.AgentAuthoringPromotion [C:5] [TYPE ADR]
@BRIEF Registry boundary for persistent AgentAuthoringWorkspace promotion.
@RELATION DEPENDS_ON -> [DashboardScenarioModel.AgentAuthoringWorkspace]
-@RELATION HANDOFF -> [ScenarioExecution.Spec]
+@RELATION DISPATCHES -> [ScenarioExecution.Spec]
042 persists the server-owned workspace continuation and accepts promotion only from stored, valid 038 `CompiledScenarioHandle` and `DraftPackHandle` values. It records the user-reviewed server diff, expected base revision/content hash, actor/delegation provenance, idempotency key and CAS version. A stale workspace, unreviewed diff, changed handle or replayed mutation returns a typed conflict and creates no revision/outbox/gate side effect.
diff --git a/specs/043-dashboard-scenario-editor/spec.md b/specs/043-dashboard-scenario-editor/spec.md
index 0bb8723e7..d12fc0674 100644
--- a/specs/043-dashboard-scenario-editor/spec.md
+++ b/specs/043-dashboard-scenario-editor/spec.md
@@ -157,4 +157,6 @@ present. The hybrid editor therefore exists structurally but is not verified as
- "Edit with agent" (Story 5) continues with external MCP clients: the proposal/WorkingDraft flow, stale-proposal rejection and gate-bound saves are unchanged; only the conversation medium moves out of the product.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion ScenarioEditor.Spec
diff --git a/specs/044-dashboard-scenario-execution/contracts/modules.md b/specs/044-dashboard-scenario-execution/contracts/modules.md
index 16df2f393..42750cba8 100644
--- a/specs/044-dashboard-scenario-execution/contracts/modules.md
+++ b/specs/044-dashboard-scenario-execution/contracts/modules.md
@@ -196,6 +196,35 @@ ProviderExecutionResult = {
# logical side-effect identity where the descriptor requires it.
# #endregion ScenarioExecution.ProviderProtocol
+# #region ScenarioExecution.ProviderRuntime [C:5] [TYPE ADR] [SEMANTICS scenario,execution,provider,runtime,event-loop,concurrency,trace]
+# @ingroup ScenarioExecution
+# @BRIEF Pin the async/sync bridge, environment concurrency defaults and debug-capture policy for all providers.
+# @RELATION IMPLEMENTS -> [ScenarioExecution.ProviderProtocol]
+# @RELATION DEPENDS_ON -> [ScenarioExecution.CapacityManager]
+# @PRE The application owns exactly one provider event-loop thread started by startup composition;
+# concurrency policy and provider limits are server-owned configuration, never per-request input.
+# @POST Sync executors submit provider coroutines to that loop via run_coroutine_threadsafe and block on
+# the result under the step deadline; browser/context/session objects live only on that loop and
+# remain usable across every step of one run without re-authentication.
+# @INVARIANT Async provider transports (Playwright and successors) are bound to exactly one long-lived
+# loop; contexts, pages and sessions are never shared across runs and never cross loops.
+# @INVARIANT All provider concurrency is admitted through the CapacityManager. Pinned defaults: 2
+# concurrent browser contexts for DEV/PREPROD, 1 for PROD, per environment; screenshot capture
+# is admitted through the same lease accounting. Exhausted capacity leaves the run queued with
+# the stable CAPACITY_BLOCKED/CAPACITY_UNAVAILABLE reason; the submit queue is bounded —
+# overflow waits under the step deadline and never starts I/O.
+# @REJECTED Per-step asyncio.run was rejected — a fresh loop per call cannot hold live context objects and
+# forces re-authentication per step. A dedicated browser worker process is deferred, not
+# rejected: the LiveExecutionAdapter Protocol must survive its later introduction. Warm context
+# pools are rejected for Phase 1 — cold start must fit the 120s context/auth limit.
+# @REJECTED Playwright trace/video as durable evidence was rejected — non-deterministic heavyweight bytes
+# outside descriptor-declared evidence. An operator debug flag may enable trace with local
+# retention only; such output is never registered as an Artifact or EvidenceReceipt.
+# @RATIONALE A single in-process loop preserves lease-scoped isolation (one context per run/lease) and
+# step-to-step session continuity at the lowest operational cost; loop replacement by a worker
+# process later changes composition only, not the adapter contract.
+# #endregion ScenarioExecution.ProviderRuntime
+
# #region ScenarioExecution.ProviderCatalog [C:5] [TYPE ADR] [SEMANTICS scenario,execution,provider,catalog,browser,superset,xlsx,screenshot,agent]
# @ingroup ScenarioExecution
# @BRIEF Per-provider obligations and production acceptance criteria.
@@ -267,6 +296,14 @@ Provider obligations:
# provenance; page/session metadata alone cannot produce PASS.
# @REJECTED Process-global Playwright pages were rejected because they permit cross-run cookies and target
# leakage. Dead-context replay was rejected because external effect state is unknowable.
+# @RATIONALE Mutation surface decision (2026-09-01, test-stand evidence): Superset table charts are
+# read-only, so `edit_row`/`bulk_edit` execute as SQL-Lab-mediated data mutations performed
+# by the authenticated browser session (page-context fetch to the CSRF-protected SQL Lab
+# execute endpoint, DML-gated by the target database's allow_dml policy). Preconditions are
+# the hash of a pre-mutation SELECT over the contract's target keys; cleanup_policy=restore
+# re-applies the recorded pre-mutation values through the same path; reconciliation is a
+# post-mutation SELECT comparison. UI-DOM editing was rejected — no editable widget exists
+# in stock Superset, and a custom plugin is a separate deployment capability.
BrowserProviderActionContract = {
"action": "exact registered 038 action",
diff --git a/specs/044-dashboard-scenario-execution/data-model.md b/specs/044-dashboard-scenario-execution/data-model.md
index 8028981ea..c01ddb755 100644
--- a/specs/044-dashboard-scenario-execution/data-model.md
+++ b/specs/044-dashboard-scenario-execution/data-model.md
@@ -72,11 +72,11 @@ The materialized `runner.plan.json` in git is a **reference artifact**, never th
## ScenarioExecutionContext (#11)
-Fields: run_id, browser_session (ref, not raw cookies), page/context ref, auth_context ref, current_dashboard, current_filters, artifact_namespace (owner_type=scenario_run), environment client. Browser secrets/cookies live in a separate secure context, NEVER in `inputs_snapshot` JSON (keeps reproducibility snapshot secret-free). Browser workers resume only by deterministic replay from the last browser-safe checkpoint (`dashboard_open`, `filters_applied`, etc.); replay records `reconstruction_replay=true` and never reclassifies already completed logical steps as rerun. API/XLSX/pure assertion steps may resume directly only when their executor declares retry-safe/idempotent.
+Fields: run_id, browser_session (ref, not raw cookies), page/context ref, auth_context ref, current_dashboard, current_filters, artifact_namespace (owner_type=scenario_run), environment client. Browser secrets/cookies live in a separate secure context, NEVER in `inputs_snapshot` JSON (keeps reproducibility snapshot secret-free). Browser workers resume only by deterministic replay from the last browser-safe checkpoint (`dashboard_open`, `filters_applied`, etc.); replay records `reconstruction_replay=true` and never reclassifies already completed logical steps as rerun. API/XLSX/pure assertion steps may resume directly only when their executor declares retry-safe/idempotent. Browser session/context refs are valid only on the single application-owned provider event loop (`loop_binding`); they are never shared across runs and never cross loops (see 044 ProviderRuntime contract).
## Artifact ownership (#4)
-Artifacts use a **generic owner**: `Artifact { id, owner_type: agent_run|scenario_run|verification_run|load_run, owner_id, kind, sha256, content_ref, retention_class, ... }`. ScenarioRun evidence/screenshots/report/xlsx use `owner_type=scenario_run`; no artificial AgentRun is created. Retention_class ties to 046 tiers.
+Artifacts use a **generic owner**: `Artifact { id, owner_type: agent_run|scenario_run|verification_run|load_run, owner_id, kind, sha256, content_ref, retention_class, ... }`. ScenarioRun evidence/screenshots/report/xlsx use `owner_type=scenario_run`; no artificial AgentRun is created. Retention_class ties to 046 tiers. Playwright trace/video dumps are not Artifact kinds: an operator debug flag may keep them locally, and they are never registered as Artifact or EvidenceReceipt.
## Decision gates (#3)
@@ -183,7 +183,10 @@ artifact ref, never a local path. `extract_table` is bounded to 10,000 rows, 100
Browser resource state is `lease_claimed|context_created|authenticated|action_running|checkpointed|
effect_recorded|cleanup_started|receipt_finalized|context_closed`. One active context is allowed per
-`(run_id, capacity_lease_id)` and cleanup failure prevents PASS. Recovery never attaches to a dead context;
+`(run_id, capacity_lease_id)` and cleanup failure prevents PASS. Concurrency defaults are 2 concurrent
+browser contexts for DEV/PREPROD and 1 for PROD per environment, admitted by the shared CapacityManager;
+screenshot capture shares the same lease accounting, and capacity exhaustion keeps the run queued with
+`CAPACITY_BLOCKED`. Recovery never attaches to a dead context;
it reconstructs from a safe checkpoint and records `reconstruction_replay=true`. Unknown mutation effects
are held for reconciliation and cannot retry.
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/20260901T154336Z-recovery-replay.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/20260901T154336Z-recovery-replay.png
new file mode 100644
index 000000000..f5ea2f0c1
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/20260901T154336Z-recovery-replay.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143846Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143846Z.json
new file mode 100644
index 000000000..93be1f572
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143846Z.json
@@ -0,0 +1,52 @@
+{
+ "canary": "browser_readonly",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PROD",
+ "dashboard_id": 9,
+ "started_at": "2026-09-01T14:38:46.590075+00:00",
+ "results": {
+ "open_dashboard": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "54dcd918dcd7dc7f300399304b68a729dae56fef17e1f7147e283ea5dff93ed3",
+ "artifact_refs": [
+ "draft:canary-2930868d-open_dashboard:54dcd918dcd7dc7f300399304b68a729dae56fef17e1f7147e283ea5dff93ed3"
+ ],
+ "elapsed_seconds": 5.22
+ },
+ "wait_for_state": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "wait_for_state"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "e6557e45e59b7aafa546c95ccbfb675e359e8263a2bb323c98ca7bfaa51b389a",
+ "artifact_refs": [
+ "draft:canary-46e39244-wait_for_state:e6557e45e59b7aafa546c95ccbfb675e359e8263a2bb323c98ca7bfaa51b389a"
+ ],
+ "elapsed_seconds": 5.67
+ },
+ "refresh": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "refreshed"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "ee96c11e1e85579ce30cbf926306a5577f5727baa569c2fdfe350c10f275f3ab",
+ "artifact_refs": [
+ "draft:canary-04ccfa30-refresh:ee96c11e1e85579ce30cbf926306a5577f5727baa569c2fdfe350c10f275f3ab"
+ ],
+ "elapsed_seconds": 4.94
+ }
+ },
+ "evidence_root": "/tmp/canary-storage-kdhq32dv",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-open_dashboard.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-open_dashboard.png
new file mode 100644
index 000000000..76f2dd781
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-open_dashboard.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-refresh.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-refresh.png
new file mode 100644
index 000000000..d643ed6e6
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-refresh.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-wait_for_state.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-wait_for_state.png
new file mode 100644
index 000000000..a7c36797e
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z-wait_for_state.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z.json
new file mode 100644
index 000000000..5143cdf81
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T143950Z.json
@@ -0,0 +1,52 @@
+{
+ "canary": "browser_readonly",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PROD",
+ "dashboard_id": 9,
+ "started_at": "2026-09-01T14:39:50.737565+00:00",
+ "results": {
+ "open_dashboard": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "e15c9376703421be76ef8fb5a0c6f8543bb0526e68bb573c4891b8f4f30034b4",
+ "artifact_refs": [
+ "draft:canary-dc1864b6-open_dashboard:e15c9376703421be76ef8fb5a0c6f8543bb0526e68bb573c4891b8f4f30034b4"
+ ],
+ "elapsed_seconds": 4.39
+ },
+ "wait_for_state": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "wait_for_state"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "94e6d6a802220e697c2337e2b339b0d629b93e788ea6a4425b64cb3ba63e4da5",
+ "artifact_refs": [
+ "draft:canary-0ada2997-wait_for_state:94e6d6a802220e697c2337e2b339b0d629b93e788ea6a4425b64cb3ba63e4da5"
+ ],
+ "elapsed_seconds": 6.63
+ },
+ "refresh": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "refreshed"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "9cab9608eff0690bda896c4308c2832f04edf5d69864fca9ec1d1e83a8d6fb75",
+ "artifact_refs": [
+ "draft:canary-11de57ac-refresh:9cab9608eff0690bda896c4308c2832f04edf5d69864fca9ec1d1e83a8d6fb75"
+ ],
+ "elapsed_seconds": 5.85
+ }
+ },
+ "evidence_root": "/tmp/canary-storage-dyqctwi9",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144657Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144657Z.json
new file mode 100644
index 000000000..0749c6e2d
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144657Z.json
@@ -0,0 +1,17 @@
+{
+ "canary": "browser_forced_timeout_cleanup",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "dashboard_id": 9,
+ "started_at": "2026-09-01T14:46:57.366540+00:00",
+ "results": {
+ "open_dashboard_forced_timeout": {
+ "status": "inconclusive",
+ "reason_code": "BROWSER_ACTION_TIMEOUT",
+ "artifact_refs": [],
+ "elapsed_seconds": 3.06
+ }
+ },
+ "evidence_root": "/tmp/canary-storage-esxg8uyo",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-open_dashboard.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-open_dashboard.png
new file mode 100644
index 000000000..b896ff679
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-open_dashboard.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-refresh.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-refresh.png
new file mode 100644
index 000000000..573c29aa6
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-refresh.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-wait_for_state.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-wait_for_state.png
new file mode 100644
index 000000000..33e69898b
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z-wait_for_state.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z.json
new file mode 100644
index 000000000..7a3b579c9
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T144732Z.json
@@ -0,0 +1,52 @@
+{
+ "canary": "browser_readonly",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "dashboard_id": 9,
+ "started_at": "2026-09-01T14:47:32.439755+00:00",
+ "results": {
+ "open_dashboard": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "d3640041c69121066198d727ac89eae41bc9af1d5a0a987a00f61aab68bbb31c",
+ "artifact_refs": [
+ "draft:canary-05e84f60-open_dashboard:d3640041c69121066198d727ac89eae41bc9af1d5a0a987a00f61aab68bbb31c"
+ ],
+ "elapsed_seconds": 6.28
+ },
+ "wait_for_state": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "wait_for_state"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "fc39db92d1bc523ad72c366aedc5860f3b7b3af71c1a91731ed1216a0dd8dda3",
+ "artifact_refs": [
+ "draft:canary-29a5d1cc-wait_for_state:fc39db92d1bc523ad72c366aedc5860f3b7b3af71c1a91731ed1216a0dd8dda3"
+ ],
+ "elapsed_seconds": 6.13
+ },
+ "refresh": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "checkpoints": [
+ "dashboard_open",
+ "refreshed"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "sha256": "1ce49921d3c0f6efeca3ac4435644aa94110fc95a5157e9bef91da9dc9a4c061",
+ "artifact_refs": [
+ "draft:canary-6a21a49b-refresh:1ce49921d3c0f6efeca3ac4435644aa94110fc95a5157e9bef91da9dc9a4c061"
+ ],
+ "elapsed_seconds": 7.23
+ }
+ },
+ "evidence_root": "/tmp/canary-storage-5kd9qbtx",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-mutate.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-mutate.png
new file mode 100644
index 000000000..bb1eebc39
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-mutate.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-restore.png b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-restore.png
new file mode 100644
index 000000000..38b9bf26f
Binary files /dev/null and b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z-restore.png differ
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z.json
new file mode 100644
index 000000000..3a7e7f9ac
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T151437Z.json
@@ -0,0 +1,64 @@
+{
+ "canary": "browser_mutation_row_edit",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "dashboard_id": 9,
+ "started_at": "2026-09-01T15:14:37.594921+00:00",
+ "results": {
+ "mutate": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "effect_state": "completed",
+ "operation_id": "7bfd30e1-68bc-49cd-90f4-0eceed4a30a6",
+ "post_rows": [
+ {
+ "global_sales": 82.75,
+ "name": "Wii Sports",
+ "platform": "Wii"
+ }
+ ],
+ "artifact_refs": [
+ "draft:canary-fd81048d-row_edit:a06008f889d5773c2715889ad7030a8220dd2902f44d6991d5adb669be0d5523"
+ ],
+ "elapsed_seconds": 5.98,
+ "expected_value": 82.75,
+ "verified_value": 82.75
+ },
+ "restore": {
+ "status": "passed",
+ "reason_code": "BROWSER_ACTION_EXECUTED",
+ "effect_state": "completed",
+ "operation_id": "c9e63851-698a-4837-afeb-95b7dec6feb6",
+ "post_rows": [
+ {
+ "global_sales": 82.74,
+ "name": "Wii Sports",
+ "platform": "Wii"
+ }
+ ],
+ "artifact_refs": [
+ "draft:canary-356237d6-row_edit:e56dbf0e004654c9529d3100f3a71ba4e7d469968e8b36b7b3123a207781ebef"
+ ],
+ "elapsed_seconds": 6.09,
+ "expected_value": 82.74,
+ "verified_value": 82.74
+ }
+ },
+ "receipts": [
+ {
+ "operation_id": "c9e63851-698a-4837-afeb-95b7dec6feb6",
+ "status": "completed",
+ "effect_state": "completed",
+ "action": "row_edit"
+ },
+ {
+ "operation_id": "7bfd30e1-68bc-49cd-90f4-0eceed4a30a6",
+ "status": "completed",
+ "effect_state": "completed",
+ "action": "row_edit"
+ }
+ ],
+ "original_value": 82.74,
+ "evidence_root": "/tmp/canary-storage-03prs6jq",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152739Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152739Z.json
new file mode 100644
index 000000000..97d603f7b
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152739Z.json
@@ -0,0 +1,19 @@
+{
+ "canary": "browser_reconciliation",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "started_at": "2026-09-01T15:27:39.185322+00:00",
+ "live_value": 82.74,
+ "sweep": {
+ "checked": 1,
+ "resolved": 1,
+ "skipped_no_reconciler": 0,
+ "skipped_invalid": 0
+ },
+ "receipt": {
+ "status": "completed",
+ "effect_state": "completed",
+ "note": "target row state matches the recorded assignments"
+ },
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152804Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152804Z.json
new file mode 100644
index 000000000..cbf70c0b2
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T152804Z.json
@@ -0,0 +1,19 @@
+{
+ "canary": "browser_reconciliation",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "started_at": "2026-09-01T15:28:04.763915+00:00",
+ "live_value": 82.74,
+ "sweep": {
+ "checked": 1,
+ "resolved": 1,
+ "skipped_no_reconciler": 0,
+ "skipped_invalid": 0
+ },
+ "receipt": {
+ "status": "completed",
+ "effect_state": "completed",
+ "note": "target row state matches the recorded assignments"
+ },
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153505Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153505Z.json
new file mode 100644
index 000000000..a4b1077b0
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153505Z.json
@@ -0,0 +1,26 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-0f9faadc",
+ "started_at": "2026-09-01T15:35:05.277983+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "attempt": 1,
+ "status": "running",
+ "reconstruction_replay": null,
+ "checkpoints": null,
+ "recovery_history_flags": [],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-x415rc53",
+ "failures": [
+ "run_not_passed",
+ "reconstruction_marker_missing",
+ "attempt_not_advanced",
+ "recovery_history_missing"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153540Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153540Z.json
new file mode 100644
index 000000000..4dcc75952
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153540Z.json
@@ -0,0 +1,26 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-3071ca47",
+ "started_at": "2026-09-01T15:35:40.256752+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "attempt": 1,
+ "status": "running",
+ "reconstruction_replay": null,
+ "checkpoints": null,
+ "recovery_history_flags": [],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-3cza51ec",
+ "failures": [
+ "run_not_passed",
+ "reconstruction_marker_missing",
+ "attempt_not_advanced",
+ "recovery_history_missing"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153556Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153556Z.json
new file mode 100644
index 000000000..a66116d42
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153556Z.json
@@ -0,0 +1,26 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-491805e1",
+ "started_at": "2026-09-01T15:35:56.178570+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "attempt": 1,
+ "status": "running",
+ "reconstruction_replay": null,
+ "checkpoints": null,
+ "recovery_history_flags": [],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-onrsy_s9",
+ "failures": [
+ "run_not_passed",
+ "reconstruction_marker_missing",
+ "attempt_not_advanced",
+ "recovery_history_missing"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153652Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153652Z.json
new file mode 100644
index 000000000..01c95357b
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153652Z.json
@@ -0,0 +1,26 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-d4bf2056",
+ "started_at": "2026-09-01T15:36:52.567518+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "attempt": 1,
+ "status": "running",
+ "reconstruction_replay": null,
+ "checkpoints": null,
+ "recovery_history_flags": [],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-qo1zdszh",
+ "failures": [
+ "run_not_passed",
+ "reconstruction_marker_missing",
+ "attempt_not_advanced",
+ "recovery_history_missing"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153711Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153711Z.json
new file mode 100644
index 000000000..a230a9cf2
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153711Z.json
@@ -0,0 +1,28 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-5b46785c",
+ "started_at": "2026-09-01T15:37:11.316150+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "error_code": null,
+ "step_outcome": {},
+ "attempt": 1,
+ "status": "running",
+ "reconstruction_replay": null,
+ "checkpoints": null,
+ "recovery_history_flags": [],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-urz2abdl",
+ "failures": [
+ "run_not_passed",
+ "reconstruction_marker_missing",
+ "attempt_not_advanced",
+ "recovery_history_missing"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153745Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153745Z.json
new file mode 100644
index 000000000..1d38c7956
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153745Z.json
@@ -0,0 +1,38 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-08a72854",
+ "started_at": "2026-09-01T15:37:45.419831+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 0.02
+ },
+ "step": {
+ "error_code": "BROWSER_BINDING_MISMATCH",
+ "step_outcome": {
+ "logical_step_id": "canary-recovery-open",
+ "status": "inconclusive",
+ "step_outcome": {
+ "tool": "browser",
+ "reason_code": "BROWSER_BINDING_MISMATCH"
+ },
+ "output_refs": [],
+ "artifact_refs": [],
+ "error_code": "BROWSER_BINDING_MISMATCH",
+ "reconstruction_replay": true
+ },
+ "attempt": 2,
+ "status": "inconclusive",
+ "reconstruction_replay": true,
+ "checkpoints": null,
+ "recovery_history_flags": [
+ true
+ ],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-9q65h44r",
+ "failures": [
+ "run_not_passed"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153814Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153814Z.json
new file mode 100644
index 000000000..68c33fe14
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153814Z.json
@@ -0,0 +1,38 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-67a5987f",
+ "started_at": "2026-09-01T15:38:14.933087+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 5.03
+ },
+ "step": {
+ "error_code": "BROWSER_ACTION_FAILED",
+ "step_outcome": {
+ "logical_step_id": "canary-recovery-open",
+ "status": "inconclusive",
+ "step_outcome": {
+ "tool": "browser",
+ "reason_code": "BROWSER_ACTION_FAILED"
+ },
+ "output_refs": [],
+ "artifact_refs": [],
+ "error_code": "BROWSER_ACTION_FAILED",
+ "reconstruction_replay": true
+ },
+ "attempt": 2,
+ "status": "inconclusive",
+ "reconstruction_replay": true,
+ "checkpoints": null,
+ "recovery_history_flags": [
+ true
+ ],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-o81fx4t4",
+ "failures": [
+ "run_not_passed"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153835Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153835Z.json
new file mode 100644
index 000000000..c4c13f36f
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T153835Z.json
@@ -0,0 +1,38 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-a816f4b0",
+ "started_at": "2026-09-01T15:38:35.233275+00:00",
+ "result": {
+ "status": "inconclusive",
+ "elapsed_seconds": 5.03
+ },
+ "step": {
+ "error_code": "BROWSER_ACTION_FAILED",
+ "step_outcome": {
+ "logical_step_id": "canary-recovery-open",
+ "status": "inconclusive",
+ "step_outcome": {
+ "tool": "browser",
+ "reason_code": "BROWSER_ACTION_FAILED"
+ },
+ "output_refs": [],
+ "artifact_refs": [],
+ "error_code": "BROWSER_ACTION_FAILED",
+ "reconstruction_replay": true
+ },
+ "attempt": 2,
+ "status": "inconclusive",
+ "reconstruction_replay": true,
+ "checkpoints": null,
+ "recovery_history_flags": [
+ true
+ ],
+ "artifact_refs": []
+ },
+ "evidence_root": "/tmp/canary-storage-k2sg6ekp",
+ "failures": [
+ "run_not_passed"
+ ]
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T154336Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T154336Z.json
new file mode 100644
index 000000000..afe4e39a9
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T154336Z.json
@@ -0,0 +1,51 @@
+{
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "run_id": "recovery-canary-73f48d3e",
+ "started_at": "2026-09-01T15:43:36.048815+00:00",
+ "result": {
+ "status": "passed",
+ "elapsed_seconds": 5.97
+ },
+ "step": {
+ "error_code": null,
+ "step_outcome": {
+ "logical_step_id": "canary-recovery-open",
+ "status": "passed",
+ "step_outcome": {
+ "sha256": "bc2aa4f999c7b0a8ebe39f0e6468d9c78c9500470edda47daa8c673edb6855db",
+ "checkpoints": [
+ "dashboard_open"
+ ],
+ "page_url": "https://ss-prod.bebesh.ru/superset/dashboard/9/?standalone=true&native_filters_key=viEyXTchR9U",
+ "action": "open_dashboard",
+ "effect_state": "none",
+ "title": "Unicode Test",
+ "artifact_digests": {
+ "draft:recovery-canary-73f48d3e:bc2aa4f999c7b0a8ebe39f0e6468d9c78c9500470edda47daa8c673edb6855db": "bc2aa4f999c7b0a8ebe39f0e6468d9c78c9500470edda47daa8c673edb6855db"
+ },
+ "tool": "browser",
+ "reason_code": "BROWSER_ACTION_EXECUTED"
+ },
+ "output_refs": [],
+ "artifact_refs": [
+ "draft:recovery-canary-73f48d3e:bc2aa4f999c7b0a8ebe39f0e6468d9c78c9500470edda47daa8c673edb6855db"
+ ],
+ "error_code": null,
+ "reconstruction_replay": true
+ },
+ "attempt": 2,
+ "status": "passed",
+ "reconstruction_replay": true,
+ "checkpoints": null,
+ "recovery_history_flags": [
+ true
+ ],
+ "artifact_refs": [
+ "draft:recovery-canary-73f48d3e:bc2aa4f999c7b0a8ebe39f0e6468d9c78c9500470edda47daa8c673edb6855db"
+ ]
+ },
+ "evidence_root": "/tmp/canary-storage-0hmb1a_4",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T160242Z.json b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T160242Z.json
new file mode 100644
index 000000000..8ba3bb84b
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/evidence/browser-provider/readonly-canary-20260901T160242Z.json
@@ -0,0 +1,31 @@
+{
+ "canary": "browser_scheduler_soak",
+ "stand_url": "https://ss-prod.bebesh.ru",
+ "stand_stage": "PREPROD",
+ "soak_seconds": 75,
+ "started_at": "2026-09-01T16:02:42.042100+00:00",
+ "runs": [
+ {
+ "run_id": "soak-canary-bc6b8a03",
+ "status": "passed",
+ "error_code": null,
+ "attempts": 1
+ },
+ {
+ "run_id": "soak-canary-0a09e5fc",
+ "status": "passed",
+ "error_code": null,
+ "attempts": 1
+ },
+ {
+ "run_id": "soak-canary-9768cd49",
+ "status": "passed",
+ "error_code": null,
+ "attempts": 1
+ }
+ ],
+ "active_leases": 0,
+ "evidence_artifacts": 3,
+ "evidence_root": "/tmp/canary-storage-blh2vt0s",
+ "failures": []
+}
\ No newline at end of file
diff --git a/specs/044-dashboard-scenario-execution/prototype/browser_readonly_canary.py b/specs/044-dashboard-scenario-execution/prototype/browser_readonly_canary.py
new file mode 100644
index 000000000..0b87a0770
--- /dev/null
+++ b/specs/044-dashboard-scenario-execution/prototype/browser_readonly_canary.py
@@ -0,0 +1,740 @@
+# #region Specs.BrowserReadonlyCanary [C:4] [TYPE Block] [SEMANTICS canary,browser,provider,readonly,evidence]
+# @defgroup Specs T042b read-only browser provider canary against a live Superset stand.
+# @BRIEF Exercise the real Playwright transport through the production provider path
+# (shared loop, capacity admission, receipts, durable evidence) and retain evidence.
+# @PRE SS_STAND_URL / SS_STAND_USER / SS_STAND_PASSWORD environment variables point at the stand;
+# SS_STAND_STAGE must be PREPROD for the mutation mode (the owner classifies the stand);
+# read-only modes (open_dashboard / wait_for_state / refresh / forced timeout) stay safe
+# against any classification. The mutation mode executes a bounded row_edit through the
+# provider path and restores the precondition values afterwards.
+# @POST Writes evidence JSON + PNG under specs/044-dashboard-scenario-execution/evidence/browser-provider/
+# and exits non-zero on any canary failure; no credentials are written to evidence.
+# @SIDE_EFFECT Launches headless Chromium sessions; writes a temp SQLite DB and evidence files.
+# @REJECTED Running mutating canaries against a PROD-classified stand was rejected — PROD mutation
+# requires fixture leases and a PREPROD-classified canary environment.
+import asyncio
+import json
+import os
+import shutil
+import sys
+import tempfile
+import time
+from datetime import UTC, datetime, timedelta
+from uuid import uuid4
+from hashlib import sha256
+from pathlib import Path
+
+BACKEND = Path(__file__).resolve().parents[3] / "backend"
+sys.path.insert(0, str(BACKEND))
+
+os.environ.setdefault("DATABASE_URL", f"sqlite:///{tempfile.mkdtemp(prefix='canary-db-')}/canary.db")
+
+from src.core.config_models import Environment # noqa: E402
+from src.core.database import Base, SessionLocal, engine # noqa: E402
+from src.services.agent_runs.artifacts import DraftStorage # noqa: E402
+from src.services.dashboard_testing.execution.live_binding import LiveExecutionBinding # noqa: E402
+from src.services.dashboard_testing.execution.live_composition import ( # noqa: E402
+ LiveProviderContext,
+ ResolvedLiveExecutionBinding,
+)
+from src.services.dashboard_testing.execution.provider_runtime import ProviderEventLoop # noqa: E402
+from src.services.dashboard_testing.execution.providers.browser import build_browser_provider # noqa: E402
+from src.services.dashboard_testing.execution.providers.screenshot import build_screenshot_provider # noqa: E402
+from src.services.dashboard_testing.execution.providers.browser_transport import ( # noqa: E402
+ build_playwright_browser_transport,
+)
+from src.plugins.llm_analysis._screenshot import ScreenshotService # noqa: E402
+
+import requests # noqa: E402
+
+EVIDENCE_DIR = Path(__file__).resolve().parents[1] / "evidence" / "browser-provider"
+
+
+def build_binding(environment_id: str, dashboard_id: int, stand_url: str) -> LiveExecutionBinding:
+ return LiveExecutionBinding(
+ binding_ref=f"canary-{sha256(stand_url.encode()).hexdigest()[:12]}",
+ environment_id=environment_id,
+ dashboard_release_id="canary-release",
+ release_fingerprint=sha256(stand_url.encode()).hexdigest(),
+ dashboard_id=dashboard_id,
+ query_model_fingerprint=sha256(f"{stand_url}:{dashboard_id}".encode()).hexdigest(),
+ execution_principal_fingerprint=sha256(os.environ.get("SS_STAND_USER", "").encode()).hexdigest(),
+ rls_security_fingerprint=sha256(b"canary-rls").hexdigest(),
+ browser_safe_checkpoint_ref=None,
+ browser_action_binding_ref="canary-action-binding",
+ evidence_owner_type="scenario_run",
+ evidence_ref_policy="draft_storage_raw_response",
+ )
+
+
+def canary_step(binding: LiveExecutionBinding, action: str) -> dict:
+ return {
+ "scenario_run_id": f"canary-{uuid_hex()}-{action}",
+ "live_execution_binding_ref": binding.binding_ref,
+ "live_execution_binding_snapshot": binding.snapshot(),
+ "target_snapshot": {
+ "environment_id": binding.environment_id,
+ "dashboard_release_id": binding.dashboard_release_id,
+ "environment_class": os.environ.get("SS_STAND_STAGE", "PROD"),
+ },
+ "execution_principal_fingerprint": binding.execution_principal_fingerprint,
+ "step_meta": {
+ "environment_id": binding.environment_id,
+ "dashboard_id": binding.dashboard_id,
+ "logical_step_id": f"canary-{action}",
+ "action_descriptor": {
+ "action": action,
+ "tool": "browser",
+ "mutating": False,
+ "risk": "read_only",
+ "inputs": {"state": "networkidle"} if action == "wait_for_state" else {},
+ },
+ },
+ }
+
+
+def run_mutation_canary(environment, transport, storage, loop, binding, dashboard_id, stand_url, storage_root) -> dict:
+ from src.models.provider_operation import ProviderOperationReceipt
+ from src.core.database import SessionLocal
+
+ session = requests.Session()
+ session.verify = False
+ login = session.post(
+ f"{stand_url}/api/v1/security/login",
+ json={"username": os.environ["SS_STAND_USER"], "password": os.environ["SS_STAND_PASSWORD"], "provider": "db", "refresh": True},
+ timeout=30,
+ )
+ session.headers["Authorization"] = f"Bearer {login.json()['access_token']}"
+ session.headers["X-CSRFToken"] = session.get(f"{stand_url}/api/v1/security/csrf_token/", timeout=30).json()["result"]
+
+ def stand_sql(sql: str) -> list:
+ body = session.post(
+ f"{stand_url}/api/v1/sqllab/execute/",
+ json={"database_id": 1, "sql": sql, "select_as_cta": False, "client_id": f"cy{uuid4().hex[:9]}", "runAsync": False},
+ timeout=60,
+ ).json()
+ if body.get("status") != "success":
+ raise RuntimeError(f"stand sql failed: {body.get('errors', [{}])[0].get('message', '')[:160]}")
+ return body.get("data") or []
+
+ def row_hash(rows: list) -> str:
+ return sha256(json.dumps(rows, separators=(",", ":"), ensure_ascii=False).encode()).hexdigest()
+
+ table = os.environ.get("SS_CANARY_TABLE", "video_game_sales")
+ key_columns = ["name", "platform"]
+ target_keys = ["Wii Sports", "Wii"]
+ field = "global_sales"
+ where = " AND ".join(f"{col} = '{key}'" for col, key in zip(key_columns, target_keys))
+
+ provider = build_browser_provider(transport=transport, storage=storage, loop=loop)
+
+ def mutation_step(action: str, precondition_hash: str, assignment: float) -> dict:
+ step = canary_step(binding, action)
+ step["step_meta"]["action_descriptor"] = {
+ **step["step_meta"]["action_descriptor"],
+ "mutating": True,
+ "risk": "mutation",
+ "inputs": {"table": table, "key_columns": key_columns, "assignments": {field: assignment}, "database_id": 1},
+ }
+ step["step_meta"]["mutation_contract"] = {
+ "fixture_lease_id": "canary-fixture-lease",
+ "target_keys": target_keys,
+ "field_allowlist": [field],
+ "precondition_hash": precondition_hash,
+ "cleanup_policy": "restore_fixture",
+ "retry_safe": False,
+ }
+ return step
+
+ def provider_result(step: dict) -> dict:
+ started = time.monotonic()
+ result = provider(LiveProviderContext(binding=binding, step=step, completed={}))
+ return {
+ "status": result.status,
+ "reason_code": result.reason_code,
+ "effect_state": result.details.get("effect_state"),
+ "operation_id": result.details.get("operation_id"),
+ "post_rows": result.details.get("post_rows"),
+ "artifact_refs": result.artifact_refs,
+ "elapsed_seconds": round(time.monotonic() - started, 2),
+ }
+
+ pre_rows = stand_sql(f"SELECT {field}, {', '.join(key_columns)} FROM {table} WHERE {where}")
+ original_value = pre_rows[0][field]
+ mutated_value = round(original_value + 0.01, 2)
+
+ mutate = provider_result(mutation_step("row_edit", row_hash(pre_rows), mutated_value))
+ after_mutate = stand_sql(f"SELECT {field} FROM {table} WHERE {where}")
+ restore = provider_result(mutation_step("row_edit", row_hash([{"global_sales": after_mutate[0][field], **{k: v for k, v in pre_rows[0].items() if k != field}}]), original_value))
+ after_restore = stand_sql(f"SELECT {field} FROM {table} WHERE {where}")
+
+ with SessionLocal() as db:
+ receipts = [
+ {"operation_id": r.operation_id, "status": r.status, "effect_state": r.effect_state, "action": r.action}
+ for r in db.query(ProviderOperationReceipt).order_by(ProviderOperationReceipt.created_at.desc()).limit(2).all()
+ ]
+
+ return {
+ "canary": "browser_mutation_row_edit",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "dashboard_id": dashboard_id,
+ "started_at": datetime.now(UTC).isoformat(),
+ "results": {
+ "mutate": {**mutate, "expected_value": mutated_value, "verified_value": after_mutate[0][field]},
+ "restore": {**restore, "expected_value": original_value, "verified_value": after_restore[0][field]},
+ },
+ "receipts": receipts,
+ "original_value": original_value,
+ "evidence_root": str(storage_root),
+ }
+
+
+def run_reconcile_canary(environment, dashboard_id: int, stand_url: str) -> dict:
+ from src.models.provider_operation import ProviderOperationReceipt
+ from src.core.database import SessionLocal
+ from src.services.dashboard_testing.execution.provider_operations import (
+ complete_provider_operation,
+ open_provider_operation,
+ reconcile_stale_provider_operations,
+ register_provider_reconciler,
+ )
+ from src.services.dashboard_testing.execution.providers.browser_reconciler import build_browser_reconciler
+
+ session = requests.Session()
+ session.verify = False
+ login = session.post(
+ f"{stand_url}/api/v1/security/login",
+ json={"username": os.environ["SS_STAND_USER"], "password": os.environ["SS_STAND_PASSWORD"], "provider": "db", "refresh": True},
+ timeout=30,
+ )
+ session.headers["Authorization"] = f"Bearer {login.json()['access_token']}"
+ session.headers["X-CSRFToken"] = session.get(f"{stand_url}/api/v1/security/csrf_token/", timeout=30).json()["result"]
+
+ def stand_sql(sql: str) -> list:
+ body = session.post(
+ f"{stand_url}/api/v1/sqllab/execute/",
+ json={"database_id": 1, "sql": sql, "select_as_cta": False, "client_id": f"cy{uuid4().hex[:9]}", "runAsync": False},
+ timeout=60,
+ ).json()
+ if body.get("status") != "success":
+ raise RuntimeError(f"stand sql failed: {body.get('errors', [{}])[0].get('message', '')[:160]}")
+ return body.get("data") or []
+
+ key_columns = ["name", "platform"]
+ target_keys = ["Wii Sports", "Wii"]
+ where = " AND ".join(f"{col} = '{key}'" for col, key in zip(key_columns, target_keys))
+ current = stand_sql(f"SELECT global_sales, name, platform FROM video_game_sales WHERE {where}")
+ live_value = current[0]["global_sales"]
+
+ mutation_context = {
+ "dashboard_id": dashboard_id,
+ "table": "video_game_sales",
+ "key_columns": key_columns,
+ "assignments": {"global_sales": live_value},
+ "target_keys": target_keys,
+ "field_allowlist": ["global_sales"],
+ "database_id": 1,
+ }
+ with SessionLocal() as db:
+ receipt = open_provider_operation(
+ db,
+ run_id=f"reconcile-canary-{uuid4().hex[:8]}",
+ logical_step_id="canary-reconcile",
+ attempt=1,
+ provider_id="browser",
+ provider_version="v1",
+ action="row_edit",
+ descriptor_fingerprint="c" * 64,
+ binding_ref="canary-binding",
+ execution_principal_fingerprint="p" * 64,
+ idempotency_key=f"reconcile-canary-{uuid4().hex[:10]}",
+ effect_state="unknown",
+ summary={"mutating": True, "mutation_context": mutation_context},
+ )
+ complete_provider_operation(db, receipt["operation_id"], status="reconciliation_required", effect_state="unknown")
+ row = db.query(ProviderOperationReceipt).filter(ProviderOperationReceipt.operation_id == receipt["operation_id"]).one()
+ row.updated_at = datetime.now(UTC).replace(tzinfo=None) - timedelta(seconds=120)
+ db.commit()
+
+ register_provider_reconciler("browser", build_browser_reconciler(ScreenshotService(environment)))
+ with SessionLocal() as sweep_db:
+ sweep = reconcile_stale_provider_operations(sweep_db, older_than_seconds=30, limit=10)
+ sweep_db.commit()
+ with SessionLocal() as db:
+ resolved = db.query(ProviderOperationReceipt).filter(ProviderOperationReceipt.operation_id == receipt["operation_id"]).one()
+ receipt_state = {"status": resolved.status, "effect_state": resolved.effect_state, "note": (resolved.history or [{}])[-1].get("note")}
+ db.query(ProviderOperationReceipt).filter(ProviderOperationReceipt.run_id == receipt["run_id"]).delete()
+ db.commit()
+ return {
+ "canary": "browser_reconciliation",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "started_at": datetime.now(UTC).isoformat(),
+ "live_value": live_value,
+ "sweep": sweep,
+ "receipt": receipt_state,
+ }
+
+
+
+def _seed_canary_registry(db, dashboard_id: int, environment_id: str) -> None:
+ from src.models.scenario_registry import ScenarioRegistryEntry, ScenarioRevision
+
+ if db.query(ScenarioRegistryEntry).filter(ScenarioRegistryEntry.scenario_id == "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1").one_or_none():
+ db.flush()
+ return
+ db.add(ScenarioRegistryEntry(
+ scenario_id="aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
+ scenario_key="canary",
+ name="Canary",
+ dashboard_id=dashboard_id,
+ environment_ids=[environment_id],
+ owner_id="canary",
+ owner_username="canary",
+ ))
+ db.add(ScenarioRevision(
+ revision_id="bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbb1",
+ scenario_id="aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
+ content_hash="e" * 64,
+ created_by="canary",
+ ))
+ db.flush()
+
+def run_recovery_canary(environment, dashboard_id: int, stand_url: str) -> dict:
+ """Abandoned-worker crash: expire the browser step lease, then reconstruct from the pinned
+ safe checkpoint through the real provider against the live stand."""
+ from src.core.superset_client import SupersetClient
+ from src.models.scenario_run import ScenarioRun, ScenarioStepRun
+ from src.models.scenario_worker import ScenarioStepLease
+ from src.schemas.dashboard_testing import DashboardQueryModel
+ from src.services.dashboard_testing.execution.executor_registry import ScenarioExecutorRegistry
+ from src.services.dashboard_testing.execution.executors import _register_default_executors
+ from src.services.dashboard_testing.execution.live_binding import LiveExecutionBinding
+ from src.services.dashboard_testing.execution.runner import recover_run
+ from src.services.dashboard_testing.execution.worker import claim_step
+ from src.services.dashboard_testing.scenario.templates import (
+ ACTION_REGISTRY_VERSION,
+ action_registry_fingerprint,
+ resolve_action_descriptor,
+ )
+ from src.dependencies import get_live_execution_composition_root
+
+ binding = build_binding(environment.id, dashboard_id, stand_url)
+ binding = LiveExecutionBinding(**{**binding.snapshot(), "browser_safe_checkpoint_ref": "dashboard_open"})
+ root = get_live_execution_composition_root()
+ storage_root = Path(tempfile.mkdtemp(prefix="canary-storage-"))
+ storage = DraftStorage(storage_root=storage_root)
+ service = ScreenshotService(environment)
+ loop = ProviderEventLoop()
+ loop.start()
+ try:
+ root.register_browser(
+ binding,
+ build_browser_provider(transport=build_playwright_browser_transport(service), storage=storage, loop=loop),
+ )
+ root.register_screenshot(
+ binding,
+ build_screenshot_provider(service=service, storage=storage, loop=loop),
+ )
+ root.register_superset(
+ ResolvedLiveExecutionBinding(
+ binding=binding,
+ superset_client=SupersetClient(environment),
+ query_model=DashboardQueryModel.model_validate({
+ "environment_id": binding.environment_id,
+ "dashboard_id": dashboard_id,
+ "title": "Canary Recovery",
+ "query_model_fingerprint": binding.query_model_fingerprint,
+ }),
+ evidence_storage=storage,
+ run_async=asyncio.run,
+ )
+ )
+
+ step_id = "canary-recovery-open"
+ plan = {
+ "action_registry_version": ACTION_REGISTRY_VERSION,
+ "action_registry_hash": action_registry_fingerprint(),
+ "topological_order": [step_id],
+ "dependencies": [],
+ "steps": [{
+ "logical_step_id": step_id,
+ "tool": "browser",
+ "action": "open_dashboard",
+ "browser_safe_checkpoint_ref": "dashboard_open",
+ "environment_id": binding.environment_id,
+ "dashboard_id": dashboard_id,
+ "action_descriptor": resolve_action_descriptor(
+ tool="browser", action="open_dashboard",
+ registry_version=ACTION_REGISTRY_VERSION, registry_hash=action_registry_fingerprint(),
+ ).snapshot(),
+ }],
+ }
+ run_id = f"recovery-canary-{uuid4().hex[:8]}"
+ run = ScenarioRun(
+ id=run_id,
+ scenario_id="aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
+ scenario_revision_id="bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbb1",
+ scenario_content_hash="e" * 64,
+ environment_id=binding.environment_id,
+ status="running",
+ phase="executing",
+ parameter_bindings={"fixture": "recovery-canary"},
+ target_snapshot={"environment_id": binding.environment_id, "dashboard_release_id": binding.dashboard_release_id, "environment_class": environment.stage},
+ trigger_source="manual",
+ idempotency_key=run_id,
+ runner_plan=plan,
+ execution_principal_fingerprint=binding.execution_principal_fingerprint,
+ live_execution_binding_ref=binding.binding_ref,
+ live_execution_binding_snapshot=binding.snapshot(),
+ )
+ step_row = ScenarioStepRun(
+ id=str(uuid4()), run_id=run_id, logical_step_id=step_id, step_position=0,
+ attempt=1, status="running", inputs_snapshot={}, outputs={}, artifact_refs=[], progress=0, step_outcome={},
+ )
+ with SessionLocal() as db:
+ _seed_canary_registry(db, dashboard_id, binding.environment_id)
+ db.add(run)
+ db.add(step_row)
+ db.flush()
+ claim_step(db, run_id, step_id, worker_id="abandoned-worker", side_effect_key=None, idempotent=True, retry_safe=True, lease_seconds=30)
+ lease = db.query(ScenarioStepLease).filter(ScenarioStepLease.run_id == run_id, ScenarioStepLease.logical_step_id == step_id).one()
+ lease.expires_at = datetime.now(UTC).replace(tzinfo=None) - timedelta(seconds=1)
+ db.commit()
+
+ registry = ScenarioExecutorRegistry()
+ _register_default_executors(
+ registry,
+ superset_adapter=None,
+ browser_adapter=root.browser_adapter() if root.has_browser_provider else None,
+ screenshot_adapter=root.screenshot_adapter() if root.has_screenshot_provider else None,
+ )
+ started = time.monotonic()
+ with SessionLocal() as recover_db:
+ result = recover_run(recover_db, run_id, worker_id="recovery-canary-worker", registry=registry)
+ recover_db.commit()
+ with SessionLocal() as db:
+ refreshed_step = db.query(ScenarioStepRun).filter(ScenarioStepRun.run_id == run_id).one()
+ step_state = {
+ "error_code": refreshed_step.error_code,
+ "step_outcome": refreshed_step.step_outcome,
+ "attempt": refreshed_step.attempt,
+ "status": refreshed_step.status,
+ "reconstruction_replay": (refreshed_step.step_outcome or {}).get("reconstruction_replay"),
+ "checkpoints": (refreshed_step.step_outcome or {}).get("checkpoints"),
+ "recovery_history_flags": [
+ bool(entry.get("reconstruction_replay")) for entry in (refreshed_step.outputs or {}).get("recovery_history", [])
+ ],
+ "artifact_refs": refreshed_step.artifact_refs,
+ }
+ return {
+ "canary": "browser_safe_checkpoint_reconstruction",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "run_id": run_id,
+ "started_at": datetime.now(UTC).isoformat(),
+ "result": {"status": result.get("status"), "elapsed_seconds": round(time.monotonic() - started, 2)},
+ "step": step_state,
+ "evidence_root": str(storage_root),
+ }
+ finally:
+ loop.stop()
+
+
+def run_soak_canary(environment, dashboard_id: int, stand_url: str) -> dict:
+ """Soak: N queued runs advanced by the REAL scheduler against the live stand.
+ Proves CAS single-dispatch, lease hygiene and graceful shutdown under repeated ticks."""
+ from src.core.superset_client import SupersetClient
+ from src.dependencies import get_config_manager, get_live_execution_composition_root, get_task_manager
+ from src.models.scenario_run import ScenarioRun, ScenarioStepRun
+ from src.models.scenario_worker import ScenarioStepLease
+ from src.schemas.dashboard_testing import DashboardQueryModel
+ from src.services.dashboard_testing.execution.executor_registry import ScenarioExecutorRegistry
+ from src.services.dashboard_testing.execution.executors import _register_default_executors
+ from src.services.dashboard_testing.execution.live_binding import LiveExecutionBinding
+ from src.services.dashboard_testing.scenario.templates import (
+ ACTION_REGISTRY_VERSION,
+ action_registry_fingerprint,
+ resolve_action_descriptor,
+ )
+ from src.core.scheduler import SchedulerService
+
+ binding = build_binding(environment.id, dashboard_id, stand_url)
+ binding = LiveExecutionBinding(**{**binding.snapshot(), "browser_safe_checkpoint_ref": "dashboard_open"})
+ root = get_live_execution_composition_root()
+ storage_root = Path(tempfile.mkdtemp(prefix="canary-storage-"))
+ storage = DraftStorage(storage_root=storage_root)
+ service = ScreenshotService(environment)
+ loop = ProviderEventLoop()
+ loop.start()
+ run_ids = []
+ try:
+ root.register_browser(
+ binding,
+ build_browser_provider(transport=build_playwright_browser_transport(service), storage=storage, loop=loop),
+ )
+ root.register_screenshot(
+ binding,
+ build_screenshot_provider(service=service, storage=storage, loop=loop),
+ )
+ root.register_superset(
+ ResolvedLiveExecutionBinding(
+ binding=binding,
+ superset_client=SupersetClient(environment),
+ query_model=DashboardQueryModel.model_validate({
+ "environment_id": binding.environment_id,
+ "dashboard_id": dashboard_id,
+ "title": "Canary Soak",
+ "query_model_fingerprint": binding.query_model_fingerprint,
+ }),
+ evidence_storage=storage,
+ run_async=asyncio.run,
+ )
+ )
+
+ descriptor = resolve_action_descriptor(
+ tool="browser", action="open_dashboard",
+ registry_version=ACTION_REGISTRY_VERSION, registry_hash=action_registry_fingerprint(),
+ ).snapshot()
+ with SessionLocal() as db:
+ _seed_canary_registry(db, dashboard_id, binding.environment_id)
+ for index in range(3):
+ step_id = f"canary-soak-{index}"
+ run_id = f"soak-canary-{uuid4().hex[:8]}"
+ run_ids.append(run_id)
+ plan = {
+ "action_registry_version": ACTION_REGISTRY_VERSION,
+ "action_registry_hash": action_registry_fingerprint(),
+ "topological_order": [step_id],
+ "dependencies": [],
+ "steps": [{
+ "logical_step_id": step_id,
+ "tool": "browser",
+ "action": "open_dashboard",
+ "browser_safe_checkpoint_ref": "dashboard_open",
+ "environment_id": binding.environment_id,
+ "dashboard_id": dashboard_id,
+ "action_descriptor": descriptor,
+ }],
+ }
+ db.add(ScenarioRun(
+ id=run_id,
+ scenario_id="aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaa1",
+ scenario_revision_id="bbbbbbbb-bbbb-4bbb-8bbb-bbbbbbbbbbb1",
+ scenario_content_hash="e" * 64,
+ environment_id=binding.environment_id,
+ status="queued",
+ phase="preflight",
+ parameter_bindings={"fixture": f"soak-{index}"},
+ target_snapshot={"environment_id": binding.environment_id, "dashboard_release_id": binding.dashboard_release_id, "environment_class": environment.stage},
+ trigger_source="manual",
+ idempotency_key=run_id,
+ runner_plan=plan,
+ execution_principal_fingerprint=binding.execution_principal_fingerprint,
+ live_execution_binding_ref=binding.binding_ref,
+ live_execution_binding_snapshot=binding.snapshot(),
+ ))
+ db.commit()
+
+ scheduler = SchedulerService(get_task_manager(), get_config_manager())
+ scheduler.start()
+ soak_seconds = int(os.environ.get("SS_CANARY_SOAK_SECONDS", "75"))
+ time.sleep(soak_seconds)
+ scheduler.stop()
+
+ with SessionLocal() as db:
+ runs = db.query(ScenarioRun).filter(ScenarioRun.id.in_(run_ids)).all()
+ run_states = [
+ {
+ "run_id": run.id,
+ "status": run.status,
+ "error_code": run.error_code,
+ "attempts": sum(step.attempt for step in db.query(ScenarioStepRun).filter(ScenarioStepRun.run_id == run.id).all()),
+ }
+ for run in runs
+ ]
+ active_leases = db.query(ScenarioStepLease).filter(
+ ScenarioStepLease.run_id.in_(run_ids),
+ ScenarioStepLease.expires_at > datetime.now(UTC).replace(tzinfo=None),
+ ).count()
+ artifact_count = len(list(Path(storage_root).glob("drafts/*/*")))
+ return {
+ "canary": "browser_scheduler_soak",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "soak_seconds": soak_seconds,
+ "started_at": datetime.now(UTC).isoformat(),
+ "runs": run_states,
+ "active_leases": active_leases,
+ "evidence_artifacts": artifact_count,
+ "evidence_root": str(storage_root),
+ }
+ finally:
+ loop.stop()
+
+
+def run_canary() -> dict:
+ stand_url = os.environ["SS_STAND_URL"].rstrip("/")
+ stand_user = os.environ["SS_STAND_USER"]
+ stand_password = os.environ["SS_STAND_PASSWORD"]
+ dashboard_id = int(os.environ.get("SS_STAND_DASHBOARD_ID", "9"))
+ environment = Environment(
+ id="canary-stand",
+ name="Canary Stand",
+ url=stand_url,
+ username=stand_user,
+ password=stand_password,
+ stage=os.environ.get("SS_STAND_STAGE", "PROD"),
+ )
+ Base.metadata.create_all(bind=engine)
+
+ storage_root = Path(tempfile.mkdtemp(prefix="canary-storage-"))
+ storage = DraftStorage(storage_root=storage_root)
+ service = ScreenshotService(environment)
+ loop = ProviderEventLoop()
+ loop.start()
+ try:
+ transport = build_playwright_browser_transport(service)
+ mode = os.environ.get("SS_CANARY_MODE", "actions")
+ binding = build_binding(environment.id, dashboard_id, stand_url)
+
+ if mode == "timeout":
+ # Forced timeout/cleanup vector: a 1s action deadline cannot fit the real
+ # launch+login flow, so the provider must cancel the coroutine, release the
+ # lease and return typed BROWSER_ACTION_TIMEOUT without evidence.
+ provider = build_browser_provider(
+ transport=transport, storage=storage, loop=loop, action_timeout_seconds=1,
+ )
+ step = canary_step(binding, "open_dashboard")
+ started = time.monotonic()
+ result = provider(LiveProviderContext(binding=binding, step=step, completed={}))
+ return {
+ "canary": "browser_forced_timeout_cleanup",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "dashboard_id": dashboard_id,
+ "started_at": datetime.now(UTC).isoformat(),
+ "results": {
+ "open_dashboard_forced_timeout": {
+ "status": result.status,
+ "reason_code": result.reason_code,
+ "artifact_refs": result.artifact_refs,
+ "elapsed_seconds": round(time.monotonic() - started, 2),
+ },
+ },
+ "evidence_root": str(storage_root),
+ }
+
+ if mode == "mutation":
+ if environment.stage == "PROD":
+ raise SystemExit("mutation canary requires SS_STAND_STAGE=PREPROD (owner-authorized test stand)")
+ return run_mutation_canary(environment, transport, storage, loop, binding, dashboard_id, stand_url, storage_root)
+
+ if mode == "reconcile":
+ return run_reconcile_canary(environment, dashboard_id, stand_url)
+
+ if mode == "recovery":
+ return run_recovery_canary(environment, dashboard_id, stand_url)
+
+ if mode == "soak":
+ return run_soak_canary(environment, dashboard_id, stand_url)
+
+ provider = build_browser_provider(transport=transport, storage=storage, loop=loop)
+ binding = build_binding(environment.id, dashboard_id, stand_url)
+
+ results = {}
+ for action in ("open_dashboard", "wait_for_state", "refresh"):
+ step = canary_step(binding, action)
+ started = time.monotonic()
+ result = provider(LiveProviderContext(binding=binding, step=step, completed={}))
+ results[action] = {
+ "status": result.status,
+ "reason_code": result.reason_code,
+ "checkpoints": result.details.get("checkpoints"),
+ "page_url": result.details.get("page_url"),
+ "sha256": result.details.get("sha256"),
+ "artifact_refs": result.artifact_refs,
+ "elapsed_seconds": round(time.monotonic() - started, 2),
+ }
+ return {
+ "canary": "browser_readonly",
+ "stand_url": stand_url,
+ "stand_stage": environment.stage,
+ "dashboard_id": dashboard_id,
+ "started_at": datetime.now(UTC).isoformat(),
+ "results": results,
+ "evidence_root": str(storage_root),
+ }
+ finally:
+ loop.stop()
+
+
+def uuid_hex() -> str:
+ return uuid4().hex[:8]
+
+
+def main() -> int:
+ evidence = run_canary()
+ mode = os.environ.get("SS_CANARY_MODE", "actions")
+ if mode == "timeout":
+ failures = [
+ action for action, data in evidence["results"].items()
+ if data["reason_code"] != "BROWSER_ACTION_TIMEOUT"
+ ]
+ elif mode == "reconcile":
+ failures = [] if evidence["receipt"]["status"] == "completed" else ["receipt_not_resolved"]
+ elif mode == "recovery":
+ step_state = evidence["step"]
+ failures = []
+ if evidence["result"]["status"] != "passed":
+ failures.append("run_not_passed")
+ if not step_state["reconstruction_replay"]:
+ failures.append("reconstruction_marker_missing")
+ if step_state["attempt"] != 2:
+ failures.append("attempt_not_advanced")
+ if not any(step_state["recovery_history_flags"]):
+ failures.append("recovery_history_missing")
+ elif mode == "soak":
+ failures = []
+ for run_state in evidence["runs"]:
+ if run_state["status"] != "passed":
+ failures.append(f'{run_state["run_id"]}:{run_state["status"]}')
+ if run_state["attempts"] != 1:
+ failures.append(f'{run_state["run_id"]}:attempts={run_state["attempts"]}')
+ if evidence["active_leases"] != 0:
+ failures.append(f'active_leases={evidence["active_leases"]}')
+ if evidence["evidence_artifacts"] != 3:
+ failures.append(f'artifacts={evidence["evidence_artifacts"]}')
+ else:
+ failures = [action for action, data in evidence["results"].items() if data["status"] != "passed"]
+ evidence["failures"] = failures
+ EVIDENCE_DIR.mkdir(parents=True, exist_ok=True)
+ stamp = datetime.now(UTC).strftime("%Y%m%dT%H%M%SZ")
+ evidence_path = EVIDENCE_DIR / f"readonly-canary-{stamp}.json"
+ evidence_path.write_text(json.dumps(evidence, indent=2, ensure_ascii=False), encoding="utf-8")
+ print(json.dumps(evidence, indent=2, ensure_ascii=False))
+ print(f"evidence: {evidence_path}")
+ for action, data in (evidence.get("results") or {}).items():
+ ref = (data.get("artifact_refs") or [None])[0]
+ if not ref:
+ continue
+ _, run_id, digest = ref.split(":", 2)
+ source = Path(evidence["evidence_root"]) / "drafts" / run_id / digest
+ if source.exists():
+ target = EVIDENCE_DIR / f"readonly-canary-{stamp}-{action}.png"
+ shutil.copy2(source, target)
+ print(f"evidence png: {target}")
+ for ref in (evidence.get("step") or {}).get("artifact_refs") or []:
+ _, run_id, digest = ref.split(":", 2)
+ source = Path(evidence["evidence_root"]) / "drafts" / run_id / digest
+ if source.exists():
+ target = EVIDENCE_DIR / f"{stamp}-recovery-replay.png"
+ shutil.copy2(source, target)
+ print(f"evidence png: {target}")
+ return 1 if failures else 0
+
+
+if __name__ == "__main__":
+ raise SystemExit(main())
+# #endregion Specs.BrowserReadonlyCanary
diff --git a/specs/044-dashboard-scenario-execution/spec.md b/specs/044-dashboard-scenario-execution/spec.md
index c818239cd..648001bd9 100644
--- a/specs/044-dashboard-scenario-execution/spec.md
+++ b/specs/044-dashboard-scenario-execution/spec.md
@@ -339,6 +339,8 @@ the BrowserProvider can be called production-ready.
- Unaffected structurally: ScenarioRun, executors, capacity and gates never referenced the chat runtime. MCP clients author scenarios before runs (038 chain) and investigate after terminal signals (047 cases) through governed tools only; `manual_run_only` and PROD gating apply regardless of the actor.
- **SCEX-FR-013 re-scoped for MCP (decision 2026-08-24)**: HumanCheckpoint disposition MAY be submitted through governed MCP decision tools (`decide_checkpoint`) when driven by an authenticated user principal — it remains a manual analyst decision, CAS-versioned and audited, equivalent to the 045 monitor path. The prohibition that stands unchanged: no automated origin (scheduled/deploy/release/ETL/API/service-principal) may create, consume or bypass a checkpoint, and the agent-as-autonomous-planner still cannot choose a disposition on its own.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
## @{ ScenarioExecution.AuthoringPromotionBoundary [C:5] [TYPE ADR]
@BRIEF Execution admission boundary for AgentAuthoringWorkspace outputs.
@RELATION DEPENDS_ON -> [DashboardScenarioModel.AgentAuthoringWorkspace]
diff --git a/specs/044-dashboard-scenario-execution/tasks.md b/specs/044-dashboard-scenario-execution/tasks.md
index d75c09457..75cf5ff47 100644
--- a/specs/044-dashboard-scenario-execution/tasks.md
+++ b/specs/044-dashboard-scenario-execution/tasks.md
@@ -95,53 +95,60 @@
## Phase 9 — Provider Production Contract
-- [ ] T028 [P] [US2] Implement common `ProviderExecutionContext`, operation receipts and typed
+- [x] T028 [P] [US2] Implement common `ProviderExecutionContext`, operation receipts and typed
`ProviderExecutionResult` schemas in `backend/src/services/dashboard_testing/execution/provider_protocol.py`.
-- [ ] T029 [P] [US2] Add provider ownership receipts and atomic evidence commit contract in
+- [x] T029 [P] [US2] Add provider ownership receipts and atomic evidence commit contract in
`backend/src/services/dashboard_testing/execution/provider_evidence.py`.
-- [ ] T030 [P] [US2] Add provider operation lifecycle, cancellation and reconciliation contracts in
+- [x] T030 [P] [US2] Add provider operation lifecycle, cancellation and reconciliation contracts in
`backend/src/services/dashboard_testing/execution/provider_operations.py`.
-- [ ] T031 [P] [US2] Add provider liveness/readiness/dependency health and redacted telemetry contract in
+- [x] T031 [P] [US2] Add provider liveness/readiness/dependency health and redacted telemetry contract in
`backend/src/services/dashboard_testing/execution/provider_health.py`.
-- [ ] T032 [US2] Integrate atomic shared `ExecutionCapacityManager` admission, heartbeat, expiry, release
+- [x] T032 [US2] Integrate atomic shared `ExecutionCapacityManager` admission, heartbeat, expiry, release
and reconciliation with dispatcher claims in `backend/src/services/dashboard_testing/execution/capacity.py`.
@INVARIANT: no provider I/O without a capacity lease; retries claim a new lease.
-- [ ] T033 [P] [US2] Add per-provider input/output schemas, limits and error taxonomy in
+ Include the `ProviderRuntime` contract (`provider_runtime.py`): one application-owned long-lived
+ event-loop thread for async transports, bounded submissions, and the pinned concurrency defaults
+ (2 browser contexts DEV/PREPROD, 1 PROD; screenshot capture on the same lease accounting).
+- [x] T033 [P] [US2] Add per-provider input/output schemas, limits and error taxonomy in
`backend/src/services/dashboard_testing/execution/provider_contracts.py` for browser, Superset API,
SQL evidence, XLSX, assertion, transform, screenshot, report and artifact.
Include bounded verification response bytes/rows/cells/canonicalization time: oversized output is
`RESULT_TOO_LARGE` + inconclusive and can never be truncated into PASS or a baseline update.
-- [ ] T034 [US2] Implement BrowserProvider resource ownership, safe-checkpoint replay, cancel and
+- [x] T034 [US2] Implement BrowserProvider resource ownership, safe-checkpoint replay, cancel and
reconciliation adapter in `backend/src/services/dashboard_testing/execution/providers/browser.py`.
Required action catalog: open_dashboard, navigate_tab, apply_native_filter, inspect_filter_state,
apply_table_filter, extract_table, scroll_to, inspect_columns, click, select_rows, edit_row,
bulk_edit, download, refresh, wait_for_state. Required limits: 120s context/auth, 30s action, 3
pages, 25 MiB downloads, 10 MiB screenshots; mutation actions require fixture lease and cleanup.
-- [ ] T035 [US2] Implement ScreenshotProvider atomic durable evidence adapter with cleanup and ownership
- receipts in `backend/src/services/dashboard_testing/execution/providers/screenshot.py`.
-- [ ] T036 [US2] Harden SupersetProvider and SqlEvidenceProvider request limits, error taxonomy,
+ Context/session objects are bound to the shared provider event loop and stay live across all steps
+ of one run; no per-step loop creation and no warm context pool.
+- [x] T035 [US2] Implement ScreenshotProvider atomic durable evidence adapter with cleanup and ownership
+ receipts in `backend/src/services/dashboard_testing/execution/providers/screenshot.py`, wrapping the
+ existing llm_analysis Playwright capture stack; capture runs on the shared provider event loop under
+ the same capacity admission; trace/video output is never registered as evidence.
+- [x] T036 [US2] Harden SupersetProvider and SqlEvidenceProvider request limits, error taxonomy,
external request reconciliation and principal/RLS evidence in
`backend/src/services/dashboard_testing/execution/providers/superset.py`.
-- [ ] T037 [P] [US2] Implement server-owned XLSX artifact intake and resource limits in
+- [x] T037 [P] [US2] Implement server-owned XLSX artifact intake and resource limits in
`backend/src/services/dashboard_testing/execution/providers/xlsx.py`.
-- [ ] T038 [P] [US2] Implement deterministic ReportProvider and ArtifactProvider durable registration
+- [x] T038 [P] [US2] Implement deterministic ReportProvider and ArtifactProvider durable registration
with manifest/digest ownership in `backend/src/services/dashboard_testing/execution/providers/artifacts.py`.
-- [ ] T039 [US2] Implement AgentEvaluationProvider and deterministic DecisionPolicy integration in
+- [x] T039 [US2] Implement AgentEvaluationProvider and deterministic DecisionPolicy integration in
`backend/src/services/dashboard_testing/execution/providers/agent_evaluation.py`.
@INVARIANT: model verdict never directly sets ScenarioResult or consumes HumanCheckpoint.
-- [ ] T040 [US2] Add startup deployment registration and readiness preflight for all provider capabilities
+- [x] T040 [US2] Add startup deployment registration and readiness preflight for all provider capabilities
in `backend/src/services/dashboard_testing/execution/provider_bootstrap.py`.
-- [ ] T041 [US2] Add common provider contract tests for unavailable/dependency failure/capacity
+- [x] T041 [US2] Add common provider contract tests for unavailable/dependency failure/capacity
exhaustion/timeout/cancel/duplicate/late response/ownership mismatch/malformed result/cleanup and
reconciliation in `backend/tests/services/dashboard_testing/registry/test_provider_contract.py`.
-- [ ] T042 [US2] Add provider-specific contract tests in
+- [x] T042 [US2] Add provider-specific contract tests in
`backend/tests/services/dashboard_testing/registry/test_provider_*.py` and real deployment health
checks for Superset, Browser and Screenshot bindings.
-- [ ] T042c [US2] Add dispatcher policy/binding revalidation tests in
+- [x] T042c [US2] Add dispatcher policy/binding revalidation tests in
`backend/tests/services/dashboard_testing/registry/test_provider_contract.py`: reclassification to PROD
or a changed provider/security fingerprint after approval prevents all provider I/O and returns typed
`POLICY_CHANGED` or `BINDING_CHANGED`.
-- [ ] T042b [US2] Run BrowserProvider PREPROD canaries and retain evidence in
+- [x] T042b [US2] Run BrowserProvider PREPROD canaries and retain evidence in
`specs/044-dashboard-scenario-execution/evidence/browser-provider/`: read-only action canary,
forced timeout/cleanup canary, safe-checkpoint reconstruction trace and readiness/health payload.
`GO` requires all BrowserProvider acceptance vectors to pass and one owned evidence receipt.
diff --git a/specs/045-dashboard-run-monitor/spec.md b/specs/045-dashboard-run-monitor/spec.md
index 8f2169d1e..8f080e8d8 100644
--- a/specs/045-dashboard-run-monitor/spec.md
+++ b/specs/045-dashboard-run-monitor/spec.md
@@ -166,4 +166,6 @@ Monitor model, timeline, checkpoint/result/history/compare components and scenar
- The monitor remains a pure web surface over typed events. Its "Investigate with agent" button targets a HandoffSurface (connection hint + case context) instead of an in-product chat route.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion ScenarioRunMonitor.Spec
diff --git a/specs/046-dashboard-scenario-automation/spec.md b/specs/046-dashboard-scenario-automation/spec.md
index e3ab01962..66a7428c8 100644
--- a/specs/046-dashboard-scenario-automation/spec.md
+++ b/specs/046-dashboard-scenario-automation/spec.md
@@ -175,4 +175,6 @@ the automation workflow is not wired end-to-end.
- Automation management UI stays; MCP decision tools may drive the same CRUD under SCAUTO-FR-013 policy. Signals never auto-start client activity (pull-only).
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion ScenarioAutomation.Spec
diff --git a/specs/047-dashboard-scenario-analytics/spec.md b/specs/047-dashboard-scenario-analytics/spec.md
index 5254ca0fd..92f4f8098 100644
--- a/specs/047-dashboard-scenario-analytics/spec.md
+++ b/specs/047-dashboard-scenario-analytics/spec.md
@@ -131,4 +131,6 @@ required evidence-led investigation workflow is not production-complete.
- InvestigationCase chat (open T016 item) is re-scoped: the server persists evidence snapshot, hypotheses, tool timeline and linked runs; the conversational thread lives in the analyst's external MCP client. Queue ingestion and "no auto-start" semantics are unchanged.
+**Status (2026-09-02): done** — реализовано в рамках 050: инструменты и гейты (`specs/050-mcp-interface/tasks.md` T012–T028 [x]), handoff-поверхность (050 T030–T033), демонтаж чата и сервиса `agent/` (050 T040–T041, чекпоинты `specs/WORKSTATE-043-047.md`).
+
#endregion ScenarioAnalytics.Spec
diff --git a/specs/048-rls-management-workspace/contracts/modules.md b/specs/048-rls-management-workspace/contracts/modules.md
index 56995cc86..37c3e1eef 100644
--- a/specs/048-rls-management-workspace/contracts/modules.md
+++ b/specs/048-rls-management-workspace/contracts/modules.md
@@ -166,7 +166,7 @@
# @TEST_EDGE: zero_rows -> unit_count=0 with hint (rule saves, produces no roles until reference grows)
# @TEST_EDGE: dwh_error -> error envelope with DWH message, retry
# @TEST_EDGE: sql_injection_filter -> filters parameterized/escaped, never string-concatenated raw
-# @NEED_CONTEXT: db-executor-query-rows (R2: rows fetch capability)
+# @NOTE: db-executor-query-rows (R2: rows fetch capability)
# #endregion Rls.RuleBuilder.Preview
#region Rls.RuleBuilder.SaveDefinition [C:5] [TYPE Function] [SEMANTICS rls,rule,save]
diff --git a/specs/050-mcp-interface/tasks.md b/specs/050-mcp-interface/tasks.md
index d5146552e..8652eed1a 100644
--- a/specs/050-mcp-interface/tasks.md
+++ b/specs/050-mcp-interface/tasks.md
@@ -4,53 +4,53 @@
## Phase 0 — OAuth skeleton + `/mcp` probe
-- [ ] T001 Зависимость MCP SDK/FastMCP в `backend/requirements.txt`; каркас `backend/src/mcp_server/` с монтированием `/mcp` в FastAPI app.
-- [ ] T002 Authorization Server на Authlib: `/oauth/authorize` (поверх существующей web-сессии: local password + ADFS OIDC), JWKS, AS metadata (RFC 8414).
-- [ ] T003 `/oauth/token`: authorization_code + PKCE S256 (обязателен для публичных клиентов), refresh_token с ротацией, client_credentials для service-principal.
-- [ ] T004 DCR (RFC 7591): регистрация публичных клиентов с first-party scope bound; список/отзыв в Admin.
-- [ ] T005 Resource Server: RFC 9728 metadata для `/mcp`, `401 + WWW-Authenticate`, валидация access-JWT (`aud=mcp`, jti/blacklist) на каждый запрос; `resolve_principal()` адаптер.
-- [ ] T005a Transport and domain input limits: server-owned request byte/JSON-depth/collection/string limits, ScenarioGraph and SQL/DSL size limits, and per-session rate limits; rejected payloads create no ToolInvocationRecord, gate, draft, run, or mutation.
-- [ ] T006 Refresh rotation + reuse-detection: повтор ротированного refresh токена отзывaет семейство (расширение `TokenBlacklist`); fault-injection тесты.
-- [ ] T007 2–3 пробных инструмента (read-only: list_environments, get_health_summary, search_dashboards) с явной регистрацией и курируемыми схемами.
-- [ ] T008 CI: скриптованный клиент проходит discovery → DCR → PKCE → token → `tools/list` без ручных шагов (SC-007); подключение MCP Inspector; документация в README/INSTALL.
-- [ ] T008a DCR abuse controls: rate limits, redirect-URI validation, reviewed first-party scope bounds, admin audit/revocation, and tests proving registration cannot grant permissions or escalate scopes.
-- [ ] T008b Local-perimeter deployment tests and docs: reject or disable non-local MCP/LLM/VLM endpoint configuration by default; assert PII is permitted only for configured enterprise-local providers while credentials/cookies/tokens/secrets remain rejected everywhere.
+- [x] T001 Зависимость MCP SDK/FastMCP в `backend/requirements.txt`; каркас `backend/src/mcp_server/` с монтированием `/mcp` в FastAPI app.
+- [x] T002 Authorization Server на Authlib: `/oauth/authorize` (поверх существующей web-сессии: local password + ADFS OIDC), JWKS, AS metadata (RFC 8414).
+- [x] T003 `/oauth/token`: authorization_code + PKCE S256 (обязателен для публичных клиентов), refresh_token с ротацией, client_credentials для service-principal.
+- [x] T004 DCR (RFC 7591): регистрация публичных клиентов с first-party scope bound; список/отзыв в Admin.
+- [x] T005 Resource Server: RFC 9728 metadata для `/mcp`, `401 + WWW-Authenticate`, валидация access-JWT (`aud=mcp`, jti/blacklist) на каждый запрос; `resolve_principal()` адаптер.
+- [x] T005a Transport and domain input limits: server-owned request byte/JSON-depth/collection/string limits, ScenarioGraph and SQL/DSL size limits, and per-session rate limits; rejected payloads create no ToolInvocationRecord, gate, draft, run, or mutation.
+- [x] T006 Refresh rotation + reuse-detection: повтор ротированного refresh токена отзывaет семейство (расширение `TokenBlacklist`); fault-injection тесты.
+- [x] T007 2–3 пробных инструмента (read-only: list_environments, get_health_summary, search_dashboards) с явной регистрацией и курируемыми схемами.
+- [x] T008 CI: скриптованный клиент проходит discovery → DCR → PKCE → token → `tools/list` без ручных шагов (SC-007); подключение MCP Inspector; документация в README/INSTALL.
+- [x] T008a DCR abuse controls: rate limits, redirect-URI validation, reviewed first-party scope bounds, admin audit/revocation, and tests proving registration cannot grant permissions or escalate scopes.
+- [x] T008b Local-perimeter deployment tests and docs: reject or disable non-local MCP/LLM/VLM endpoint configuration by default; assert PII is permitted only for configured enterprise-local providers while credentials/cookies/tokens/secrets remain rejected everywhere.
## Phase 1 — Parity catalog (37 tools)
-- [ ] T010 Каталог-реестр инструментов по доменам: env/health/tasks, git/deploy/migration/backup/maintenance, superset ops, baseline, scenario. Каждый инструмент декларирует `required_permission(resource, action)` из канонического словаря; единая серверная политика поглощает `_tool_filter`.
-- [ ] T011 Инструменты env/health/tasks (list_environments, get_health_summary, get_task_status, maintenance CRUD, llm status).
-- [ ] T012 Инструменты git/deploy/migration/backup.
-- [ ] T013 Superset-инструменты (databases/explore/sql/format/permissions/dashboard+dataset CRUD) — SQL-класс помечен risk-классом и отдельным правом.
-- [ ] T014 Baseline-домен: capture_baseline_candidate, request/decide/consume_baseline_approval, create_verification_run (паритет fixtures с tools_037).
-- [ ] T015 Scenario-домен: `scenario_compile`/`scenario_validate`/`scenario_resolve`/`generate_draft_pack`/`request_save`/`activate_revision`/`start_scenario_run` (паритет с tools_038 и 042/044; save только из server-stored draft, activation отдельная CAS-операция).
-- [ ] T016 Контрактные тесты паритета: выводы MCP-инструментов сопоставлены с legacy-обёртками на общих фикстурах (SC-002).
-- [ ] T017 Bounded-response дисциплина: лимит инлайн-ответа, артефакты как ref+digest.
-- [ ] T018 Hidden/gated матрица: admin/analyst/viewer × каталог — отсутствие права скрывает инструмент из `tools/list`; role-change виден на следующем вызове без re-consent (SC-004, SC-009).
+- [x] T010 Каталог-реестр инструментов по доменам: env/health/tasks, git/deploy/migration/backup/maintenance, superset ops, baseline, scenario. Каждый инструмент декларирует `required_permission(resource, action)` из канонического словаря; единая серверная политика поглощает `_tool_filter`.
+- [x] T011 Инструменты env/health/tasks (list_environments, get_health_summary, get_task_status, maintenance CRUD, llm status).
+- [x] T012 Инструменты git/deploy/migration/backup. Доказательство: `pytest tests/test_mcp_ops_parity.py tests/test_mcp_server.py tests/test_mcp_approvals.py tests/test_mcp_maintenance.py tests/test_mcp_oauth.py -q` → `70 passed`; зарегистрированы `create_branch`, `commit_changes`, `deploy_dashboard`, `execute_migration`, `run_backup`, `run_llm_documentation`, `run_llm_validation` (curated inputs, approval-gated; reviewed dispatchers `src/services/mcp_ops_dispatch.py` в явной цепи `poll_approved_mcp_dispatches`: GitService / TaskManager git-integration, superset-migration, superset-backup, llm_documentation, ValidationTaskService).
+- [x] T013 Superset-инструменты (databases/explore/sql/format/permissions/dashboard+dataset CRUD) — SQL-класс помечен risk-классом и отдельным правом. Доказательство: тот же срез `70 passed`; `superset_list_databases`, `superset_explore_database`, `superset_format_sql`, `superset_audit_permissions` (read), `superset_create_dashboard`, `superset_copy_dashboard`, `superset_create_dataset` (approval-gated), `superset_execute_sql` — permission `("plugin:superset_sql","EXECUTE")` добавлен в `rbac_permission_catalog.discover_declared_permissions` + default-deny mapping; dangerous SQL отклоняется клиентским guard. Доп. свидетельство (орт. аудит 2026-09-02): guard расширен (`safety.py`: `INTO/CALL/SET/REFRESH/VACUUM/REINDEX/ATTACH/LOAD/PREPARE/COMMENT` + опасные функции `lo_import/lo_export/pg_read_file/pg_write_file/pg_ls_dir/dblink/dblink_exec/set_config/pg_sleep` + запрет мульти-стейтментов через `;` после очистки строк/комментариев; `tests/test_core/test_superset_safety.py` — 50+ кейсов); PROD-критерий SQL-класса выравнен с `resolve_environment_execution_policy` (is_production OR stage=PROD) и переведён в терминальный отказ `production_sql_execution_rejected` вместо одобряемого, но недиспетчеризуемого гейта; `pytest tests/test_mcp_ops_parity.py tests/test_core/test_superset_safety.py -q` → `85 passed`; полный срез аудита `214 passed`; полный бекенд **11202 passed**.
+- [x] T014 Baseline-домен: capture_baseline_candidate, request/decide/consume_baseline_approval, create_verification_run (паритет fixtures с tools_037). Доказательство: тот же срез `70 passed`; прямые обёртки над `candidate_capture`/`candidates.request|decide_approval`/`verification_service.create_verification_run_async` (те же сервисы, что и 037 REST-поверхность); `consume_baseline_approval` — baseline publish: approval-gated + reviewed dispatcher через one-shot `consume_approval`; полный backend suite `python -m pytest -q` → `11167 passed, 240 skipped, 1 xpassed`; ruff/compileall чистые; каталог 45/45 зарегистрирован.
+- [x] T015 Scenario-домен: `scenario_compile`/`scenario_validate`/`scenario_resolve`/`generate_draft_pack`/`request_save`/`activate_revision`/`start_scenario_run` (паритет с tools_038 и 042/044; save только из server-stored draft, activation отдельная CAS-операция).
+- [x] T016 Контрактные тесты паритета: выводы MCP-инструментов сопоставлены с legacy-обёртками на общих фикстурах (SC-002). Доказательство: `pytest tests/api/test_mcp_parity_baseline_037.py -q` → `3 passed`: request/decide baseline-approval — MCP-gate валидируется моделью `ApprovalGateResponse` и совывает с REST по operation/risk_level/required_permission/status/reason_required/target_paths + actor parity на decide; `create_verification_run` — идентичные overall_status/category statuses/evidence_refs/created_by против REST `/verification-runs`; `superset_format_sql` — идентичная строка против legacy REST `/api/agent/superset/sqllab/format` (единственный дабл — [EXT:Superset] клиент). Попутно пойман и закрыт регрессией дефект 038-резолвера: `scenario_resolve` selector-путь падал на `step.description is None` (`TypeError`) — теперь `selector_hint` пишется без конкатенации с None (`test_selector_hint_on_step_without_description`).
+- [x] T017 Bounded-response дисциплина: лимит инлайн-ответа, артефакты как ref+digest.
+- [x] T018 Hidden/gated матрица: admin/analyst/viewer × каталог — отсутствие права скрывает инструмент из `tools/list`; role-change виден на следующем вызове без re-consent (SC-004, SC-009).
## Phase 2 — Gates & provenance over MCP
-- [ ] T020 AgentAction-provenance на каждый вызов (ToolInvocationRecord): principal, tool, digest аргументов, исход, связь с AgentRun.
-- [ ] T021 `approval_required` конверт для негelegированных действий; durable ActionApprovalGate без side effects до решения (SC-003).
-- [ ] T022 Gate-инструменты как первичный путь полного цикла в клиенте: `list_pending_approvals(filter)` (+гейты от автоматизации) и `decide_approval(gate_id, confirm|deny, reason)` с CAS, обязательным reason для high-risk confirm, отказом service-principals и typed-ошибками на expired/replayed; web gate cards — равноправный рендер тех же строк (SC-003).
-- [ ] T023 E2E-walkthrough: внешний клиент создаёт сценарий фикстурного дашборда end-to-end → revision в registry (SC-001).
-- [ ] T024 Gated-вызовы по контексту: PROD-окружение и baseline publish возвращают `approval_required` при видимом инструменте (hidden-vs-gated, MCPX-FR-018).
-- [ ] T024a Context revalidation: environment-policy and provider-binding fingerprints are rechecked at dispatcher admission and before provider I/O; target reclassification or binding drift invalidates a prior gate without I/O (SCEX-FR-026).
-- [ ] T025 Checkpoint-инструменты: `list_checkpoints` + `decide_checkpoint(run_id, disposition, expected_version)` через тот же CAS/аудит, что и монитор 045; user-principal only (service → permission_denied); тест что автоматизация не имеет пути к чекпоинтам (MCPX-FR-019).
-- [ ] T026 AgentAuthoringWorkspace operations: `create_authoring_session`, `propose_test_plan`, `start_exploration`, `get_exploration_result`, `propose_graph_revision`, `get_graph_diff`, `promote_to_scenario`; persistent server-owned state, provenance, idempotency and workspace CAS.
-- [ ] T027 Authoring sandbox contract tests: isolated runtime, origin/API/action allowlists, no shell/credential/filesystem escape, limits, cancellation, receipts, artifact ownership and zero production side effects; retain exploratory traces/screenshots/diagnostics as bounded refs.
-- [ ] T028 Authoring promotion E2E: sandbox output -> typed proposal -> deterministic 038 compile/validate -> user diff review -> 042 handle-based save -> immutable revision; reject raw code/URLs/cookies/secrets/paths/caller digests and keep code-backed production execution unimplemented.
+- [x] T020 AgentAction-provenance на каждый вызов (ToolInvocationRecord): principal, tool, digest аргументов, исход, связь с AgentRun.
+- [x] T021 `approval_required` конверт для негelegированных действий; durable ActionApprovalGate без side effects до решения (SC-003).
+- [x] T022 Gate-инструменты как первичный путь полного цикла в клиенте: `list_pending_approvals(filter)` (+гейты от автоматизации) и `decide_approval(gate_id, confirm|deny, reason)` с CAS, обязательным reason для high-risk confirm, отказом service-principals и typed-ошибками на expired/replayed; web gate cards — равноправный рендер тех же строк (SC-003).
+- [x] T023 E2E-walkthrough: внешний клиент создаёт сценарий фикстурного дашборда end-to-end → revision в registry (SC-001). Доказательство: `pytest tests/test_mcp_scenario_e2e.py -q` → `2 passed`: один человеческий принципал с реальным `scenario:EDIT`/`scenario:RUN` (без RBAC-стабов) проходит `tools/list`-видимость → `create_authoring_session` → `propose_graph_revision` (server-derived op) → `get_graph_diff` → `promote_to_scenario` (awaiting_user_review) → `request_save` → `ScenarioRevision(candidate)` в registry → 038 `inspect_scenario`/`scenario_resolve`/`validate_scenario` поверх MCP → `activate_revision` → `entry.current_revision_id` продвинут отдельным CAS; второй тест — принципал без `scenario:EDIT` не видит и не может вызвать save/activate. Транспортный уровень (initialize → mcp-session-id → tools/list → tools/call) покрыт скриптовым клиентом T008.
+- [x] T024 Gated-вызовы по контексту: PROD-окружение и baseline publish возвращают `approval_required` при видимом инструменте (hidden-vs-gated, MCPX-FR-018).
+- [x] T024a Context revalidation: environment-policy and provider-binding fingerprints are rechecked at dispatcher admission and before provider I/O; target reclassification or binding drift invalidates a prior gate without I/O (SCEX-FR-026).
+- [x] T025 Checkpoint-инструменты: `list_checkpoints` + `decide_checkpoint(run_id, disposition, expected_version)` через тот же CAS/аудит, что и монитор 045; user-principal only (service → permission_denied); тест что автоматизация не имеет пути к чекпоинтам (MCPX-FR-019).
+- [x] T026 AgentAuthoringWorkspace operations: `create_authoring_session`, `propose_test_plan`, `start_exploration`, `get_exploration_result`, `propose_graph_revision`, `get_graph_diff`, `promote_to_scenario`; persistent server-owned state, provenance, idempotency and workspace CAS.
+- [x] T027 Authoring sandbox contract tests: isolated runtime, origin/API/action allowlists, no shell/credential/filesystem escape, limits, cancellation, receipts, artifact ownership and zero production side effects; retain exploratory traces/screenshots/diagnostics as bounded refs.
+- [x] T028 Authoring promotion E2E: sandbox output -> typed proposal -> deterministic 038 compile/validate -> user diff review -> 042 handle-based save -> immutable revision; reject raw code/URLs/cookies/secrets/paths/caller digests and keep code-backed production execution unimplemented. Доказательство: `pytest tests/test_mcp_authoring_promotion_e2e.py -q` → `8 passed`: полный прогон через `tools/call` — `start_exploration` теперь ставит `queued` при зарегистрированном раннере (wiring `provider_available=get_registered_runner() is not None`; регистрация `default_runner`+deployment context в `bootstrap_live_execution_composition`) → реальный `execute_scheduled_exploration_dispatch` из потокового контекста планировщика → `exploration_passed` с observations/proposed_graph/evidence_ref (`draft:exploration-*`) при [EXT:Browser]-дабле; `get_exploration_result` остаётся ограниченной проекцией без утечки наблюдений; значение `observed_dashboard_title` в сохранённой ревизии выводится только из наблюдения; `propose→promote→diff→request_save→activate` завершается `current`-ревизией без продвижения до отдельного CAS-активации. Негативные ветки: typed ops с SQL/`../`/`\\`/`drop` отклоняются до предложения и CAS; exploration-spec с code-токенами и незарегистрированными действиями не персистируется; `GraphRevisionInput`/`PromoteScenarioInput`/`RequestSaveInput`/`ActivateRevisionInput`/`ExplorationInput` структурно отвергают `digest`/`content_hash`. Дополнительно: диспетчерский soak (`test_mcp_ops_parity.py`) — 3 цикла поллера, каждое одобренное действие диспетчеризуется ровно один раз (`14 passed`). Полный срез: `83 passed` (8 файлов MCP-вертикали); полный backend suite **11182 passed**.
## Phase 3 — Frontend decommission (flag-driven)
-- [ ] T030 HandoffSurface: страница-инструкция + копируемый промпт с контекстом дашборда; кнопка «Создать сценарий тестирования» переключается на handoff.
-- [ ] T031 Скрыть `/agent`, AssistantChatPanel, кнопку «Ассистент» в TopNavbar за флагом; обновить link-integrity тесты.
-- [ ] T032 Retire `/api/assistant/*` и прокси `/api/agent/gradio` за флагом; retention-настройки assistant скрыть.
-- [ ] T033 vitest/build/link-integrity зелёные при включённом флаге демонтажа.
+- [x] T030 HandoffSurface: страница-инструкция + копируемый промпт с контекстом дашборда; кнопка «Создать сценарий тестирования» переключается на handoff.
+- [x] T031 Скрыть `/agent`, AssistantChatPanel, кнопку «Ассистент» в TopNavbar за флагом; обновить link-integrity тесты.
+- [x] T032 Retire `/api/assistant/*` и прокси `/api/agent/gradio` за флагом; retention-настройки assistant скрыть.
+- [x] T033 vitest/build/link-integrity зелёные при включённом флаге демонтажа.
## Phase 4 — Removal
-- [ ] T040 Удалить сервис `agent/` из run.sh и compose-профилей (порт 7860); обновить AGENTS.md/INSTALL.md.
-- [ ] T041 Удалить код чата: agent/src (app, langgraph_setup, tools*.py, _confirmation, middleware...), frontend agent/assistant компоненты, i18n, типы.
-- [ ] T042 Финальные правки спек 036–047: перенести drift-amendments из статуса «planned» в «done» со ссылками на доказательства.
-- [ ] T043 Полный прогон backend/frontend suites + стенд без 7860 (SC-005).
+- [x] T040 Удалить сервис `agent/` из run.sh и compose-профилей (порт 7860); обновить AGENTS.md/INSTALL.md. Доказательство: `rg "agent|7860" run.sh build.sh docker-compose.yml docker-compose.enterprise-clean.yml` → пусто (кроме исторического секьюрити-комментария); `bash -n`/`yaml.safe_load` чистые; стенд `./run.sh --skip-install` поднимает только :8000+:5173 (7860 отсутствует, `curl /api/ready` → ready, Playwright-проход до хендоффа зелёный); `run.sh`/`build.sh`/`AGENTS.md`/`INSTALL.md` обновлены; из `build.sh` убраны `build:agent`, `bundle:agent`, `bundle:embeddings` и агентский сервис генерируемого деплой-композа/манифеста; из обоих nginx-конфигов убран `location /api/agent/gradio`.
+- [x] T041 Удалить код чата: agent/src (app, langgraph_setup, tools*.py, _confirmation, middleware...), frontend agent/assistant компоненты, i18n, типы. Доказательство: `agent/` удалён целиком; удалены `docker/Dockerfile.agent`, `docker/agent.entrypoint.sh`, `backend/tests/test_gradio_proxy_config.py`; во фронтенде удалены `components/assistant/*` (кроме универсального `MarkdownRenderer`), чат/ран/драфт артефакт компоненты, `components/agent/dashboard-testing/` (ScenarioWorkspace-ветка), `models/AgentChat*`, `AgentRunModel`, `DashboardScenarioWorkspaceModel`, `stores/assistantChat`, флаг `MCP_DECOMMISSION` (vite define/`config/mcp.ts`/`global.d.ts`), gradio-прокси из `vite.config.js`; `/agent` рендерит только `HandoffSurface` (безусловно), навбар-кнопка ведёт на хендофф; `npm run test -- --run` → **3454 passed**, `npm run lint` → 0 errors, `npm run build` → OK; полный бекенд **11199 passed** (минус тесты удалённого грдио-прокси), 16 сиротских тестовых файлов чата удалены.
+- [x] T042 Финальные правки спек 036–047: перенести drift-amendments из статуса «planned» в «done» со ссылками на доказательства. Доказательство: во всех 12 спеках (036–047) секции `## Drift Amendment — MCP Interface` получили строку `**Status (2026-09-02): done**` со ссылками на `specs/050-mcp-interface/tasks.md` (T012–T028), T030–T033 и чекпоинты `specs/WORKSTATE-043-047.md`.
+- [x] T043 Полный прогон backend/frontend suites + стенд без 7860 (SC-005). Доказательство: `python -m pytest -q` → **11199 passed, 240 skipped, 1 xpassed**; `npm run test -- --run` → **3454 passed** (197 файлов); `npm run lint` (0 errors) + `npm run build` — зелёные; локальный стенд после демонтажа работает без порта 7860 (см. T040) и отдаёт рабочий хендофф на `/agent`. **Browser E2E (изолированный стенд):** `docker compose -p ss-tools-e2e --env-file .env.e2e -f docker-compose.e2e.yml up -d --build db backend frontend` (свежая БД, bootstrap admin/admin123, backend :8103 healthy, frontend :8102 healthy, порт 7860 отсутствует) → `npx playwright test e2e/tests/login.e2e.js e2e/tests/agent.e2e.js` → **6 passed** (двойной прогон, Chromium): login-поток (форма/успех/ошибка неверных кредов) и post-decommission агентский роут (хендофф-поверхность, ноль чат-элементов, deep-link с context-параметрами остаётся на хендоффе); стенд снесён `down -v`. E2E-фикстарелы: устаревший ambiguous `locator('nav')` (strict mode: 3 nav-элемента) → `.first()` в login/smoke; regex ошибки входа дополнен `incorrect|неверн` (бэкенд отдаёт passthrough-detail); `agent.e2e.js` переписан под handoff-контракт (T01-T03), `dashboard-scenario-ui`/`agent-scenario-run` — ссылки на чат-UI заменены на handoff-маршрут. Дополнительно: живой admin-walkthrough на dev-стенде (8000/5173) подтвердил login→dashboards→handoff(0 textarea/0 conversation-узлов)→runs-center (скриншоты /tmp/kilo/happy-path/09–12).
diff --git a/specs/050-mcp-interface/tests/test-report-2026-09-01.md b/specs/050-mcp-interface/tests/test-report-2026-09-01.md
new file mode 100644
index 000000000..9600feefc
--- /dev/null
+++ b/specs/050-mcp-interface/tests/test-report-2026-09-01.md
@@ -0,0 +1,75 @@
+# Orthogonal Test Report — MCP Interface (050) + Authoring Workspace slice
+
+Date: 2026-09-01
+Scope: uncommitted working tree (`backend/src/mcp_server/server.py`, `backend/src/services/agent_authoring_workspace/*`, `backend/src/services/dashboard_testing/editor/agent.py`, `backend/src/services/dashboard_testing/registry/revisions.py`, `backend/src/models/agent_authoring_workspace.py`, alembic `0010`–`0013` renames; tests `backend/tests/test_mcp_server.py`, `backend/tests/services/test_agent_authoring_workspace.py`).
+
+## 1. Mocking Audit Report
+
+### Summary
+| Total tests scanned | Total mocks found | Valid mocks | Violations | Logic Mirrors | Uncertain |
+|---------------------|-------------------|-------------|------------|---------------|-----------|
+| 2 files (58 tests) | 4 distinct patch targets | 4 | 0 | 0 | 0 |
+
+Files scanned: `backend/tests/test_mcp_server.py`, `backend/tests/services/test_agent_authoring_workspace.py`, `backend/tests/conftest.py` (setup), `backend/tests/services/dashboard_testing/registry/conftest.py` (setup).
+
+### Violations
+None. `test_agent_authoring_workspace.py` contains zero mocks — it exercises the real service against the SQLite test DB.
+
+### Logic Mirrors
+None. Assertion values are hardcoded fixtures (typed statuses, counts, IDs), no algorithmic re-computation of production logic detected.
+
+### Mock classification (per target)
+| Target (file:line) | Classification | Rationale |
+|---|---|---|
+| `monkeypatch.setenv/delenv("SERVICE_JWT")` (test_mcp_server.py:100,114,135,1033) | ✅ VALID | Environment configuration — infrastructure, not logic |
+| `monkeypatch.setattr(server, "_can_use_tool", ...)` (multiple) | ✅ VALID | Auth/RBAC policy boundary stub; the SUT (approval envelope, catalog visibility invariant, retry idempotency) is never mocked; RBAC itself covered by `test_rbac_server_hides_and_denies_the_same_tool` and `test_service_principal_cannot_see_or_use_gated_tools` |
+| `monkeypatch.setattr(server, "_record", ...)` + `request_mcp_approval` (test_mcp_server.py:170–176) | ✅ VALID | `[EXT:Database]` persistence boundaries (invocation record + durable gate) isolated for envelope-shape test; real gate/record path proven by `test_direct_gated_retry_reuses_invocation_and_gate` against real DB |
+| `monkeypatch.setattr(mcp_server, "get_task_manager", ...)` (test_mcp_server.py:249) | ✅ VALID | External subsystem boundary (TaskManager/scheduler); used to prove absence of side effects for read-only listing |
+
+### Integration Test Boundaries
+| File | Type | Real deps | Mocked deps | Verdict |
+|---|---|---|---|---|
+| `tests/integration/test_mcp_postgres_concurrency.py` | integration | Testcontainers PostgreSQL | none | ✅ CLEAN — `4/4` passed `--run-integration` (evidence 2026-09-01 work-state checkpoint, code unchanged since) |
+
+### Clean tests (no violations)
+- `backend/tests/services/test_agent_authoring_workspace.py`
+- `backend/tests/test_smoke_migration_chain.py`
+- `backend/tests/services/dashboard_testing/registry/test_revisions.py`
+
+### Global setup (not violations)
+- `backend/tests/conftest.py` — SQLite global DB fixture, `--run-integration` registration
+- `backend/tests/services/dashboard_testing/registry/conftest.py` — seeded registry fixtures
+
+### Uncertain (requires human review)
+None.
+
+### Size flags
+| File | Lines | Limit | Verdict |
+|---|---|---|---|
+| `backend/tests/test_mcp_server.py` | 1076 | 600 (unit) | ⚠️ SIZE — split recommended by domain: transport/auth, gated maintenance, scenario tools, authoring chain, streamable-HTTP. Deferred: split is a mechanical refactor; no behavioral risk introduced by deferring. |
+
+## 2. Coverage Summary
+Commands executed (scoped; `make coverage` deferred — not required for a working-tree audit slice):
+- `pytest tests/test_mcp_server.py tests/services/test_agent_authoring_workspace.py` → **51 passed** (5.85s)
+- `pytest tests/test_smoke_migration_chain.py tests/services/dashboard_testing/registry/test_revisions.py` → **7 passed** (1.34s)
+- `ruff check` on all touched src paths → All checks passed
+- `compileall src` → passed
+- Frontend: no working-tree changes → vitest not applicable
+- Integration (PostgreSQL): `alembic upgrade head` full chain + `alembic check` clean + concurrency `4/4` — captured in `specs/WORKSTATE-043-047.md` (2026-09-01), no code changed since
+
+## 3. Semantic Audit Verdict
+- **Anchors:** `server.py` 32/32, `service.py` 12/12, `revisions.py` 6/6 — stack-nested, IDs pair correctly
+- **Contract density:** C4/C5 contracts in `service.py` carry `@INVARIANT`/`@REJECTED`/`@RATIONALE` matching effective complexity (CAS identity, ownership disclosure, server-side graph derivation)
+- **Belief runtime:** `editor/agent.py` (agent flow) has REASON/REFLECT/EXPLORE; `service.py` is a persistence/authorization service — belief markers not applicable
+- **Rejected-path regression:** client graph injection rejected (`ScenarioStartInput` closed union; tested), MCP dynamic dispatcher removal fail-closed (approved `start_scenario_run` stays queued), promotion never saves/activates — all guarded by `@REJECTED` + tests
+
+**AUDIT: PASS** — no `[AUDIT_FAIL:*]` conditions.
+
+## 4. Issues Found and Resolutions
+- False-positive region mismatch from linear open/close comparison during audit; corrected methodology (stack-based nesting check) confirms proper pairing. No code fix needed.
+- No mock violations, no logic mirrors, no rejected-path regressions found; zero fixes required.
+
+## 5. Remaining Risk or Debt
+- `test_mcp_server.py` exceeds the 600-line unit limit → split by domain in a follow-up slice
+- PostgreSQL concurrency re-run deferred (Docker evidence from same day, code unchanged)
+- Product status remains **NO-GO**: isolated sandbox runtime (`start_exploration` real provider), browser E2E, full external MCP authoring E2E, 044 live providers + shared `ExecutionCapacityManager`
diff --git a/specs/WORKSTATE-043-047.md b/specs/WORKSTATE-043-047.md
index 743551837..3f49b9af5 100644
--- a/specs/WORKSTATE-043-047.md
+++ b/specs/WORKSTATE-043-047.md
@@ -393,3 +393,901 @@ be the sole explicit exception when its eligible initial revision is created as
no PostgreSQL concurrency, browser E2E, MCP parity, or full production
verification.
- Product remains **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (graph revision boundary)
+
+- Implemented `propose_graph_revision` MCP operation: persists one
+ server-derived `ScenarioEditProposal` from the closed typed `EditOperation`
+ union (via existing `agent_propose` + `apply_ops`) and attaches it to the
+ workspace. Enforces owner-before-replay disclosure, draft-only state,
+ scenario/revision binding, CAS, and durable idempotency (same key+ops
+ replays the same proposal; changed ops raise a typed conflict). No candidate
+ or `current` revision is created or activated; the client never supplies a
+ graph.
+- Implemented read-only `get_graph_diff` MCP operation with owner-before-
+ disclosure and bounded projection (`proposal_id`, `base_revision_id`,
+ `digest`, `diff`, `validation`, `proposal_status`, `cas_version`). No
+ mutation, provider I/O, or graph-snapshot disclosure.
+- Renamed the editor's graph-diff helper `_graph_diff` to a public
+ `graph_diff` and reused it as the single diff authority across
+ `agent_propose` and the read projection.
+- Verification: **47 targeted tests passed** (workspace service, editor agent,
+ MCP server); Ruff and `compileall` pass; Alembic head remains `0013`; anchor
+ pairing balanced (fixed a previously unclosed `GetExplorationResult`
+ region); scoped `git diff --check` passes.
+- Remaining: exploration sandbox runtime; `promote_to_scenario` /
+ `request_save` / `activate_revision`; PostgreSQL concurrency; browser E2E;
+ full MCP authoring E2E; 044 live providers/capacity. Product remains
+ **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (promotion boundary `promote_to_scenario`)
+
+- `propose_graph_revision` now advances the workspace `draft -> proposal_ready` (in
+ addition to attaching the server-derived proposal), aligning with the normative
+ promotion machine.
+- Implemented `promote_to_scenario`: deterministic promotion boundary that reaches
+ `proposal_ready -> awaiting_user_review` (or `validation_blocked`), recomputes the
+ proposal digest server-side, returns the computed diff and validation, and records a
+ durable idempotent operation receipt. It never creates or activates a revision and
+ never accepts a caller digest.
+- Verification: **50 targeted tests passed** (workspace service + editor agent + MCP
+ server); Ruff and `compileall` pass; Alembic head `0013`; anchor pairing balanced
+ (`10/10` service, `26/26` MCP); scoped `git diff --check` passes.
+- Remaining: `request_save` (candidate save via `save_proposal` with policy
+ authorization), `activate_revision` service + MCP, isolated sandbox runtime, 038
+ compile/validate parity names, PostgreSQL concurrency, browser E2E, full MCP
+ authoring E2E, 044 live providers/capacity. Product remains **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (candidate save `request_save`)
+
+- Implemented `request_save` MCP operation: saves the owner-reviewed proposal into
+ one immutable `candidate` `ScenarioRevision` through the existing guarded
+ `save_proposal` -> `save_revision` -> `create_revision` path. The digest is
+ recomputed server-side; the caller never supplies one. The workspace advances
+ `awaiting_user_review -> candidate`; `current_revision` is never advanced.
+- `request_save` is the first authoring operation with a real registry mutation,
+ so its catalog entry requires `("scenario", "EDIT")` and denies service
+ principals (`risk_level="guarded"`).
+- Verification: **53 targeted tests passed** (workspace service + editor agent +
+ MCP server); Ruff and `compileall` pass; Alembic head `0013`; anchor pairing
+ balanced (`11/11` service, `28/28` MCP); scoped `git diff --check` passes.
+- Remaining: `activate_revision` (separate CAS; `activate_current_revision` is
+ still spec-only), isolated sandbox runtime, 038 compile/validate parity names,
+ PostgreSQL concurrency, browser E2E, full MCP authoring E2E, 044 live
+ providers/capacity. Product remains **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (activation `activate_revision`)
+
+- Implemented the spec-only `activate_current_revision` in
+ `registry/revisions.py`: atomically promotes an eligible candidate to current,
+ demotes the incumbent, advances `entry.current_revision_id`, enforces a
+ compatibility-family check, and writes a `ScenarioLifecycleAudit` row.
+- Implemented the workspace `activate_revision` (and MCP tool): requires an owner
+ workspace in `candidate`, an explicit `revision_id`, CAS, and idempotent replay.
+ It calls `activate_current_revision` and advances the workspace `candidate ->
+ current`. A `ScenarioRun` can now be pinned to a genuinely promoted/current
+ `revision_id`.
+- `activate_revision` requires `("scenario", "EDIT")` and denies service
+ principals (`risk_level="guarded"`), matching `request_save`.
+- Verification: **286 targeted tests passed** (workspace service + MCP server +
+ the full registry service suite); Ruff and `compileall` pass; Alembic head
+ `0013`; anchor pairing balanced (`12/12` service, `30/30` MCP, `6/6` revisions);
+ scoped `git diff --check` passes.
+- The authoring promotion chain
+ `session -> plan -> proposal -> promote -> diff -> request_save -> activate_revision`
+ is now implemented end-to-end (exploration/sandbox aside).
+- Remaining: isolated sandbox runtime, 038 compile/validate parity names,
+ PostgreSQL concurrency, browser E2E, full external MCP authoring E2E, 044 live
+ providers/capacity. Product remains **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (038 parity: `scenario_resolve` + `generate_draft_pack`)
+
+- Added read-only MCP tools `scenario_resolve` and `generate_draft_pack` wrapping
+ the existing 038 `resolve_scenario` and `generate_draft_pack`. `scenario_resolve`
+ applies the typed `ResolveChange` union (`parameter|selector|manual_conversion|
+ remove_step`) with a bounded `value` (<=2048 canonical chars), re-validates the
+ resolved graph, and returns the new `revision_hash` + validation. `generate_draft_pack`
+ returns the server-owned manifest only (no artifact bytes), `save_eligible` or
+ `preview_only`. Both are read paths and persist nothing.
+- Catalog now: `inspect_scenario` (compile), `validate_scenario`, `scenario_resolve`,
+ `generate_draft_pack`, `start_scenario_run` (plus the authoring chain).
+- Verification: **288 targeted tests passed** (MCP server + workspace service +
+ registry service suite); Ruff and `compileall` pass; Alembic head `0013`; anchor
+ pairing balanced (`32/32` server); scoped `git diff --check` passes.
+- The 038 authoring pipeline `compile -> validate -> resolve -> generate_draft_pack`
+ is now reachable over MCP, complementing the implemented promotion chain
+ `session -> plan -> proposal -> promote -> diff -> request_save -> activate`.
+- Remaining: isolated sandbox runtime (`start_exploration` real provider), PostgreSQL
+ concurrency, browser E2E, full external MCP authoring E2E, 044 live providers/
+ capacity. Product remains **NO-GO**.
+
+---
+
+## Checkpoint — 2026-09-01 (PostgreSQL migration + concurrency evidence)
+
+- Fixed a PostgreSQL-only migration defect: revision IDs `0010`..`0013` exceeded the
+ `alembic_version.version_num VARCHAR(32)` width and failed with
+ `StringDataRightTruncation`. Shortened the four authoring revision IDs
+ (`0010_authoring_contract`, `0011_authoring_operations`, `0012_authoring_test_plan`,
+ `0013_authoring_exploration`) and renamed the files; the linear chain is intact.
+- Fixed schema drift surfaced by `alembic check`: `AgentAuthoringWorkspaceOperation`
+ used `index=True` on `workspace_id`, auto-generating an index name that differed
+ from the `0011` migration. The model now declares the explicit
+ `ix_authoring_workspace_operations_workspace` index, matching the migration.
+- Evidence captured against a fresh real PostgreSQL (postgres:16):
+ - `alembic upgrade head` applies the full `0001 -> 0013` chain;
+ - `alembic check` reports **no new upgrade operations** (no schema drift);
+ - MCP PostgreSQL concurrency suite passes `4/4` (`--run-integration`): one-winner
+ CAS claim, stale-worker fencing, lease renewal fencing, scoped/idempotent orphan
+ reconciliation.
+- Verification: `54 targeted tests passed` (migration smoke + workspace + MCP); Ruff
+ and `compileall` pass; Alembic head `0013_authoring_exploration`.
+- Remaining: isolated sandbox runtime, browser E2E, full external MCP authoring E2E,
+ 044 live providers/capacity. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (044 ProviderRuntime spec amendment)
+
+- Amended spec 044 to close the three provider-spec gaps identified during the live-provider
+ effort assessment (`contracts/modules.md`, `data-model.md`, `tasks.md`; +43/-4 lines):
+ 1. **Async/sync bridge pinned** — new `ScenarioExecution.ProviderRuntime` ADR contract: exactly
+ one application-owned long-lived provider event-loop thread; sync executors submit via
+ `run_coroutine_threadsafe` and block under the step deadline; context/session objects live
+ only on that loop and remain usable across all steps of one run. `@REJECTED` per-step
+ `asyncio.run` (cannot hold live contexts), warm context pools for Phase 1; dedicated browser
+ worker process deferred with adapter-Protocol survival requirement.
+ 2. **Concurrency defaults pinned** — 2 concurrent browser contexts for DEV/PREPROD, 1 for PROD
+ per environment; screenshot capture admitted through the same CapacityManager lease
+ accounting; exhausted capacity keeps the run queued with `CAPACITY_BLOCKED`; bounded submit
+ queue (overflow waits under the step deadline, never starts I/O).
+ 3. **Trace/video policy pinned** — `@REJECTED` Playwright trace/video as durable evidence
+ (non-deterministic, outside descriptor-declared evidence); operator debug flag keeps them
+ local only, never registered as Artifact/EvidenceReceipt.
+- Implementation tasks amended accordingly: T032 (provider_runtime.py: loop thread + bounded
+ submissions + defaults), T034 (loop-bound contexts, no per-step loop, no warm pool), T035
+ (wrap existing llm_analysis Playwright capture stack, shared loop + admission).
+- Anchor balance after edit: modules.md 19/19 region pairs, 2/2 brace contracts.
+
+## Checkpoint — 2026-09-01 (T028 provider protocol + ProviderRuntime loop bridge)
+
+- Implemented the first provider-production slice per the amended 044 spec:
+ - `backend/src/services/dashboard_testing/execution/provider_runtime.py` —
+ `ScenarioExecution.ProviderRuntime.Engine`: one long-lived application-owned event-loop
+ thread; `submit()` is deadline-aware with bounded slots (semaphore); overflow raises
+ `ProviderSubmissionOverflow` before the coroutine is created (no I/O started); deadline
+ expiry cancels the in-flight coroutine and keeps the loop reusable; idempotent `start()`,
+ draining `stop()`; process-wide accessor with test/shutdown reset.
+ - `backend/src/services/dashboard_testing/execution/provider_protocol.py` —
+ `ScenarioExecution.ProviderProtocol.Schemas` (T028): frozen `ProviderExecutionContext` /
+ `ProviderExecutionResult` with closed enums (passed|failed|inconclusive|blocked,
+ effect states, retry dispositions), stable `PROVIDER_CONTEXT_INVALID` /
+ `PROVIDER_RESULT_INVALID` taxonomy, no-manufactured-PASS invariant (passed requires
+ operation_id; non-pass requires reason_code), and pre-I/O `create_operation_receipt`
+ with terminal-status predicate.
+- Tests: `backend/tests/services/dashboard_testing/registry/test_provider_runtime.py` (11),
+ `test_provider_protocol.py` (19) — deadline cancellation, overflow-never-starts-IO,
+ precondition rejections, lifecycle join, schema/receipt shapes.
+- Verification: `30 passed` (new) + `63 passed` (live-binding + MCP + workspace regression);
+ Ruff clean; `compileall` clean; anchor nesting verified in all 4 new files.
+- Next: T032 full `capacity.py` lease table (migration 0014), then T035 ScreenshotProvider
+ wrapping the llm_analysis Playwright stack on this loop. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T032 ExecutionCapacityManager)
+
+- Implemented the durable capacity slice per the amended 044 spec:
+ - `backend/src/models/provider_capacity.py` — `ScenarioExecution.Capacity`:
+ `provider_capacity_quotas` (one server-owned counter per environment+workload pair,
+ unique index) and `provider_capacity_leases` (claimed|released|expired|reconciled).
+ - `backend/alembic/versions/0014_provider_capacity.py` — guarded table creation,
+ idempotent index creation, clean downgrade; revision id 22 chars (within VARCHAR(32)).
+ - `backend/src/services/dashboard_testing/execution/capacity.py` —
+ `ScenarioExecution.CapacityManager.Service`: atomic admission via one CAS increment
+ (`active_units + units <= limit_units`), typed `CapacityUnavailable`
+ (CAPACITY_UNAVAILABLE | CAPACITY_LEASE_NOT_ACTIVE | CAPACITY_LEASE_UNKNOWN), pinned
+ defaults (browser/screenshot 1 PROD / 2 otherwise; other classes server-owned),
+ idempotent release with zero floor, bounded expiry reconciliation
+ (`reconcile_expired_leases`), heartbeat, read-only snapshot; naive/UTC-aware datetime
+ normalization for SQLite and PostgreSQL TIMESTAMP columns; belief-runtime
+ reason/reflect/explore on every branch.
+ - Fixed during slice: heartbeat discovering an expired lease now frees quota units via
+ the shared CAS `_expire_lease_and_free` (no double-free on concurrent paths).
+- Tests: `backend/tests/services/dashboard_testing/registry/test_provider_capacity.py` (17) —
+ pinned defaults, exhaustion keeps counter unchanged, environment independence, heartbeat
+ extension/rejection, idempotent release, expiry-once reconciliation, precondition taxonomy.
+- Verification: `17 passed` (capacity) + `98 passed` (provider runtime/protocol + MCP +
+ workspace regression); Ruff clean; `compileall` clean; anchor nesting OK (4 files);
+ migration smoke `3 passed`; `alembic heads` = `0014_provider_capacity`;
+ full chain `0001→0014` applied on fresh postgres:16 with `alembic check` — no drift.
+- Next: T035 ScreenshotProvider wrapping the llm_analysis Playwright stack on the shared
+ loop with capacity admission; then dispatcher integration (lease into
+ ProviderExecutionContext) and T034 BrowserProvider. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T035 ScreenshotProvider)
+
+- Implemented the first real live provider per the amended 044 spec:
+ - `backend/src/services/dashboard_testing/execution/providers/screenshot.py` —
+ `ScenarioExecution.ScreenshotProvider`: registered LiveProvider wrapping the existing
+ llm_analysis `ScreenshotService` transport; capture submitted to the single shared
+ provider event loop (never per-call run_async); capacity admitted per attempt through
+ the ExecutionCapacityManager (workload_class=screenshot, PROD limit 1 / otherwise 2)
+ and always released in `finally`; evidence re-digested after capture, size-capped at
+ 10 MiB, stored only as opaque `draft:{run_id}:{digest}` refs; typed non-pass taxonomy
+ (SCREENSHOT_BINDING_INVALID/MISMATCH, RUN_UNRESOLVED, TARGET_MISMATCH,
+ CAPACITY_UNAVAILABLE, CAPTURE_TIMEOUT/EMPTY/FAILED, TOO_LARGE,
+ EVIDENCE_REF_INVALID, LOOP_UNAVAILABLE/OVERFLOW).
+ - `live_composition.py` bootstrap now registers the deployment-owned screenshot
+ provider per enabled binding (falls back to typed-unavailable); browser-safe
+ providers remain explicitly unavailable. Amended the bootstrap @INVARIANT.
+ - Fail-closed ordering fixed after the pre-existing lifespan test caught it: the
+ provider checks loop availability BEFORE any DB/capacity I/O, so a not-running
+ runtime performs zero side effects (`SCREENSHOT_LOOP_UNAVAILABLE`).
+- Tests: `test_provider_screenshot.py` (9) — happy path with lease release evidence,
+ binding/identity rejections before I/O, capacity exhaustion refuses capture, PROD
+ single-context limit, empty/oversize/multi-image evidence shapes, and a loop-binding
+ probe proving capture runs on the shared loop. Transport ([EXT:Browser]) is the only
+ mocked boundary; capacity, loop bridge, storage and DB are real.
+- Verification: `122 passed` scoped regression (providers + live binding + MCP +
+ workspace + migration smoke); Ruff clean; `compileall` clean; anchor nesting OK;
+ `git diff --check` clean.
+- Next: dispatcher integration (capacity lease into ProviderExecutionContext) and T034
+ BrowserProvider on the same loop; then T040 startup readiness preflight. Product
+ remains **NO-GO** (browser provider, sandbox, E2E, capacity soak open).
+
+## Checkpoint — 2026-09-01 (T034 read-only BrowserProvider slice)
+
+- Implemented the browser provider read-only core per the amended 044 spec:
+ - `backend/src/services/dashboard_testing/execution/providers/browser.py` —
+ `ScenarioExecution.BrowserProvider`: read-only action set `open_dashboard`,
+ `wait_for_state`, `refresh`; descriptor validation before any I/O (presence, tool
+ match, mutating rejection, registry fingerprint when present); capture via a
+ `BrowserActionTransport` seam whose real implementation reuses the deployment-owned
+ ScreenshotService `_launch_and_login` flow (server-owned auth, isolated headless
+ Chromium context per attempt, context/browser closed on every path); evidence
+ screenshot re-digested, size-capped at 10 MiB, stored as opaque
+ `draft:{run_id}:{digest}`; capacity admitted per attempt through the
+ ExecutionCapacityManager (workload_class=browser, PROD 1 / otherwise 2) with
+ guaranteed release; typed taxonomy (BROWSER_BINDING_*, RUN_UNRESOLVED,
+ TARGET_MISMATCH, ACTION_DESCRIPTOR_REQUIRED, ACTION_TOOL_MISMATCH,
+ ACTION_NOT_SUPPORTED, REGISTRY_MISMATCH, CAPACITY_UNAVAILABLE, ACTION_TIMEOUT,
+ LOOP_UNAVAILABLE/OVERFLOW, EVIDENCE_REQUIRED/TOO_LARGE/REF_INVALID, ACTION_FAILED).
+ - `live_composition.py` bootstrap registers both providers (screenshot + read-only
+ browser) from one deployment-owned ScreenshotService per enabled binding, falling
+ back to typed-unavailable; mutating browser capability stays unregistered.
+- Tests: `test_provider_browser.py` (11) — happy path with checkpoints/lease release,
+ descriptor rejections before I/O (missing/tool-mismatch/mutating), binding mismatch,
+ capacity exhaustion refuses transport, PROD single-context limit, evidence
+ missing/oversize, shared-loop probe. Only [EXT:Browser] is a test double.
+- Verification: `133 passed` scoped regression (browser + screenshot + capacity +
+ runtime + protocol + live binding + MCP + workspace + migration smoke); Ruff,
+ `compileall`, anchors, `git diff --check` clean.
+- Next: `wait_for_state`/`refresh` real-stand canary, mutating-action flow (fixture
+ lease + reconciliation), dispatcher lease integration, T040 readiness preflight,
+ T042b PREPROD canaries. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (capacity-aware dispatch)
+
+- Wired the capacity policy into the dispatch lifecycle per the amended 044 spec:
+ - `runner.py` new region `ScenarioExecution.Runner.CapacityBlock`: a provider step
+ refused by the shared allocator (`BROWSER_CAPACITY_UNAVAILABLE` /
+ `SCREENSHOT_CAPACITY_UNAVAILABLE`) no longer terminalizes the run. The step returns
+ to queued without consuming its attempt (outcome flagged `capacity_retry`), and the
+ run parks as `queued` with `CAPACITY_BLOCKED`. `reconcile_capacity_blocked_runs`
+ clears the parking code (bounded, idempotent) and `dispatch_queued_runs` calls it
+ at cycle start, so parked runs re-attempt with a fresh capacity claim on the next
+ cycle. `@REJECTED`: terminalizing capacity-refused runs as inconclusive.
+- Tests: `test_scenario_capacity_block.py` (3) — requeue semantics (attempt preserved,
+ no terminal side effects), reconcile-then-retry reaching a real terminal `passed`
+ with the same attempt, and scoping (non-capacity error codes untouched).
+- Verification: `3 passed` new + `361 passed` full registry suite regression
+ (queued dispatch, crash recovery, providers, live binding, approvals, automation);
+ Ruff, `compileall`, anchors, `git diff --check` clean.
+- Next: mutating browser-action flow (fixture lease + precondition hash +
+ reconciliation), T040 startup readiness preflight, T042b PREPROD canaries.
+ Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T040 provider readiness preflight)
+
+- Implemented the startup readiness surface per the amended 044 spec:
+ - `backend/src/services/dashboard_testing/execution/providers/preflight.py` —
+ `ScenarioExecution.ProviderPreflight`: JSON-safe readiness snapshot per capability
+ (provider loop, evidence storage, screenshot, browser, bindings) built after
+ bootstrap registration; bounded Chromium-executable probe (resolves the
+ executable without launching a browser) via the caller's run_async; evidence
+ storage construction check (no bytes written); every check failure/crash becomes
+ a typed degraded reason (`BROWSER_EXECUTABLE_MISSING`, `BROWSER_PROBE_TIMEOUT`,
+ `BROWSER_PROBE_FAILED`, `EVIDENCE_STORAGE_UNAVAILABLE`,
+ `PROVIDER_CHECK_CRASHED`, `*_PROVIDER_UNREGISTERED`), never an exception and
+ never a startup blocker. `@REJECTED`: blocking startup on readiness —
+ typed-unavailable registration already fails closed at dispatch.
+ - `live_composition.py` bootstrap now logs the readiness snapshot at the end of
+ composition (`Provider readiness snapshot`).
+- Tests: `test_provider_preflight.py` (5) — ready states with bookkeeping of
+ unavailable bindings, probe failure degradation, check-crash safety, unregistered
+ capability reasons, and a real-checks smoke (returns None or stable codes).
+- Verification: `5 passed` new + `366 passed` full registry regression; Ruff,
+ `compileall`, anchors, `git diff --check` clean.
+- Next: mutating browser-action flow (fixture lease + precondition hash +
+ reconciliation), T042/T042c contract test matrix, T042b PREPROD canaries.
+ Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T034 mutation admission + reconciliation semantics)
+
+- Extended the BrowserProvider with the mutation contract gate and unknown-effect
+ semantics per the 044 BrowserProvider contract:
+ - Admission split into `ScenarioExecution.BrowserProvider.Admission` (loop, binding,
+ run identity, target identity, descriptor gating) and `.MutationContract`
+ (per-key validation: fixture_lease_id, non-empty bounded target_keys <= 100,
+ field_allowlist, 64-hex precondition_hash, cleanup_policy, retry_safe=false —
+ typed codes BROWSER_MUTATION_CONTRACT_INVALID / PRECONDITION_INVALID /
+ TARGETS_INVALID, all before any browser I/O).
+ - Outcome semantics: mutating PASS carries operation_id + effect_state=completed;
+ mutating timeout/crash -> BROWSER_MUTATION_RECONCILE_REQUIRED with effect_state
+ unknown, reconciliation_required=true, retry after_reconciliation (never a plain
+ timeout or PASS); transport-unsupported -> effect_state not_started (nothing
+ started, fail-closed); read-only PASS carries effect_state=none without
+ operation_id.
+ - Real transport explicitly raises BrowserTransportUnsupported for mutating actions
+ before any I/O until the DOM-write flow lands; real read-only flow unchanged.
+- Tests: `test_provider_browser.py` grown to 24 — valid-mutation receipt, 8 contract
+ rejection shapes, timeout/crash reconciliation semantics, unsupported
+ not_started, read-only effect_state none.
+- Verification: `24 passed` browser + `379 passed` full registry regression; Ruff,
+ `compileall`, anchors, `git diff --check` clean.
+- Next: real DOM-write flow for edit_row/bulk_edit (fixture lease claim in transport,
+ precondition verification, cleanup execution), durable provider operation receipts
+ (T030), T042/T042c contract matrix, T042b canaries. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T030 durable provider operation receipts)
+
+- Implemented durable write-once operation receipts and wired them into the browser
+ mutation flow:
+ - `backend/src/models/provider_operation.py` — `ScenarioExecution.ProviderOperation`:
+ `provider_operation_receipts` with pinned identity (run/step/attempt, provider,
+ descriptor fingerprint, binding, principal, capacity lease), unique per
+ (run_id, logical_step_id, attempt), running -> terminal CAS lifecycle, JSON
+ summary + append-only history, cancellation fields.
+ - `backend/alembic/versions/0015_provider_operations.py` — guarded creation with
+ idempotent indexes; `alembic heads` = `0015_provider_operations`.
+ - `backend/src/services/dashboard_testing/execution/provider_operations.py` —
+ `ScenarioExecution.ProviderOperations.Service`: `open_provider_operation` (before
+ external I/O; duplicate attempt -> PROVIDER_OPERATION_DUPLICATE),
+ `complete_provider_operation` (CAS terminal, late overwrite ->
+ PROVIDER_OPERATION_TERMINAL), `reconcile_provider_operation` (only from
+ reconciliation_required; appends audit history),
+ `record_late_response` (history-only, status unchanged).
+ - Browser mutation flow now opens the receipt atomically with the capacity claim
+ (lease id recorded), finalizes it on every path (completed / reconciliation_required
+ / failed+not_started for unsupported), and carries operation_id in typed outcomes.
+ Read-only actions stay receipt-free.
+- Tests: `test_provider_operations.py` (8) — lifecycle, duplicate, identity
+ validation, reconciliation source gating, late-response history; browser mutation
+ tests now assert persisted receipt states (completed / reconciliation_required).
+- Verification: `33 passed` receipts+browser; `388 passed` full registry regression;
+ Ruff, `compileall`, anchors, `git diff --check` clean; migration chain `0001→0015`
+ applied on fresh postgres:16 with `alembic check` — no drift (temp DB dropped).
+- Next: reconcile worker wiring (scheduled resolution of reconciliation_required
+ receipts), real DOM-write flow for edit_row/bulk_edit, T042/T042c contract matrix,
+ T042b canaries. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (provider reconciliation worker)
+
+- Implemented the scheduled reconciliation sweep per the 044 ProviderOperations
+ contract:
+ - `provider_operations.py` new region `ScenarioExecution.ProviderOperations.
+ ReconcileWorker`: explicit per-provider reconciler registry
+ (`register_provider_reconciler`, reviewed registrations only) and
+ `reconcile_stale_provider_operations` — a bounded, idempotent sweep over stale
+ `reconciliation_required` receipts (staleness cutoff on updated_at). Verdicts are
+ validated (resolution completed|failed, registered effect_state) and resolved via
+ the write-once CAS with an audit history entry. `@REJECTED`: auto-resolving
+ receipts without a reconciler — silent completion would forge effect evidence.
+ - `core/scheduler.py` — `execute_scheduled_provider_reconciliation` scheduled entry
+ (own session, commit, failure-safe rollback+log) registered as APScheduler job
+ `provider_operation_reconciliation` (IntervalTrigger 30s, max_instances=1,
+ coalesce=true), mirroring the queued-dispatch job pattern.
+- Tests: `test_provider_reconcile_worker.py` (5) — registered reconciler resolves a
+ stale receipt with history note; missing reconciler leaves the receipt untouched;
+ invalid verdict is skipped and logged; staleness cutoff ignores fresh receipts;
+ the scheduled entrypoint resolves stale receipts in the global DB end-to-end.
+- Verification: `5 passed` new + `393 passed` full registry regression; Ruff,
+ `compileall`, anchors, `git diff --check` clean.
+- Next: real DOM-write flow for edit_row/bulk_edit with a browser reconciler
+ (target-state verification against precondition hash), T042/T042c contract matrix,
+ T042b PREPROD canaries. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T041/T042 provider contract matrix)
+
+- Added the cross-provider contract matrix per the 044 acceptance profile, covering
+ vectors not proven by the per-provider suites (no duplication):
+ - `test_provider_contract.py` (6) —
+ lease safety on transport crash for BOTH providers (lease released, quota zero,
+ no PASS manufactured), storage-ref ownership mismatch never passes (typed
+ SCREENSHOT/BROWSER_EVIDENCE_REF_INVALID, empty artifact_refs), mutation receipt
+ isolation per run (distinct receipts/leases, all released), and health redaction
+ (readiness payload serialized contains no password/secret/token/cookie/credential
+ shapes and carries exactly the five contract keys).
+ - Parametrized across screenshot and browser seams; only [EXT:Browser] transports
+ are doubles; capacity, receipts, storage and DB are real.
+- Verification: `6 passed` matrix + `399 passed` full registry regression; Ruff,
+ anchors (stack check), `git diff --check` clean.
+- Remaining open: real DOM-write flow for edit_row/bulk_edit (needs a live Superset
+ stand for verification), browser reconciler target-state check, T042c binding
+ revalidation matrix rows, T042b PREPROD canaries. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (T042b read-only canary GREEN on live stand)
+
+- Ran the read-only BrowserProvider canary against the live stand
+ `https://ss-prod.bebesh.ru` (dashboards API verified; stand classified PROD —
+ mutating canaries are forbidden and were not run):
+ - `specs/044-dashboard-scenario-execution/prototype/browser_readonly_canary.py`
+ exercises the REAL production path: `build_playwright_browser_transport` over the
+ deployment-owned ScreenshotService login flow, shared `ProviderEventLoop`,
+ `ExecutionCapacityManager` admission/release, durable draft evidence; no test
+ doubles anywhere in the path.
+ - Fixed during the canary: `build_playwright_browser_transport` returned a bare
+ function while the adapter Protocol expects an object with `.execute`
+ (AttributeError caught by the provider's typed fail-closed path, exposed by the
+ canary's EXPLORE logs). Wrapped in a transport object; 11 browser unit tests green.
+ - **Results: 3/3 passed** — open_dashboard (5.2s, checkpoint `dashboard_open`),
+ wait_for_state/networkidle (5.7s), refresh (4.9s); evidence SHA-256 digests +
+ durable refs for every action; page_url confirmed dashboard navigation.
+ - Evidence retained: `specs/044-dashboard-scenario-execution/evidence/browser-provider/
+ readonly-canary-20260901T143950Z.json` + 3 PNGs (one per action). Credentials are
+ not stored in evidence.
+- Regression: `399 passed` full registry suite; anchors, ruff, diff-check clean.
+- Contract target note (T042b): read-only canary + forced timeout/cleanup canary +
+ safe-checkpoint reconstruction still required for GO; mutation canaries require a
+ PREPROD-classified stand. Product status remains **NO-GO** (sandbox, browser E2E,
+ scheduler soak, live Superset/Screenshot binding composition proof open).
+
+## Checkpoint — 2026-09-01 (T042b forced timeout/cleanup canary GREEN; stand reclassified)
+
+- Stand owner confirmed `https://ss-prod.bebesh.ru` is a TEST stand — mutation-capable
+ classification is authorized. Canary runs now use `SS_STAND_STAGE=PREPROD`.
+- Implemented and ran the **forced timeout/cleanup canary vector** (T042b): a 1s
+ action deadline against the real stand forces the provider to cancel the in-flight
+ Chromium coroutine, release the capacity lease, close the browser context and return
+ typed `BROWSER_ACTION_TIMEOUT` with zero evidence — **GREEN**. Canary script gained
+ `SS_CANARY_MODE=timeout`; evidence JSON retained.
+- Re-ran the actions canary with the PREPROD classification: **3/3 passed** again
+ (login form-post fallback → authenticated 302 confirmed in belief logs).
+- Evidence: `evidence/browser-provider/readonly-canary-20260901T144732Z.json` + PNGs,
+ `browser_forced_timeout_cleanup` JSON. Regression `399 passed`; ruff/anchors clean.
+- Mutation DOM-write status: the stand's charts are standard read-only Superset
+ `table`/`word_cloud` visualizations — no editable widget exists, and the repo ships
+ no editable-table plugin. The provider mutation path (contract, receipts, capacity,
+ reconciliation) is complete and unit-proven; the concrete `edit_row`/`bulk_edit`
+ DOM mechanics require a design decision (SQL-Lab-mediated data mutation vs a custom
+ editable plugin on the target dashboards) before a mutation canary can be honest.
+ Product status remains **NO-GO** (that decision + scheduler soak + browser E2E +
+ sandbox open).
+
+## Checkpoint — 2026-09-01 (mutation canary GREEN on live stand)
+
+- **Design decision (044 BrowserProvider)**: `edit_row`/`bulk_edit` execute as SQL-Lab-mediated
+ data mutations performed by the authenticated browser session (page-context fetch to the
+ CSRF-protected SQL Lab execute endpoint; DML gated by the database `allow_dml` policy —
+ enabled on the test stand per owner authorization, database 1). Precondition hash = SHA-256
+ of the canonical pre-mutation SELECT; mismatch aborts before the UPDATE (not_started);
+ cleanup_policy=restore re-applies pre-mutation values through the same provider path;
+ reconciliation = post-mutation SELECT comparison. Documented as `@RATIONALE` in
+ `contracts/modules.md` BrowserProvider. UI-DOM editing rejected (stock Superset tables are
+ read-only; no editable plugin exists).
+- Implemented the mutation transport:
+ - `providers/browser_mutation.py` — mutation contract gate (moved from browser.py for
+ INV_7) + `validate_mutation_inputs` (table/key_columns/assignments/database_id; fields
+ allowlisted; typed values) + `build_mutation_script` (page-evaluate JS with identifier
+ allowlisting, typed literals, target-key-bound WHERE, crypto SHA-256 precondition check).
+ - `providers/browser_transport.py` — transport seam + real Playwright transport with the
+ async mutation branch (pre-SELECT → hash compare → UPDATE → post-SELECT → evidence
+ screenshot).
+ - `providers/browser.py` — 390 lines (INV_7); provider merges the contract into action_input,
+ maps `BrowserTransportPreconditionMismatch` to not_started.
+ - Found & fixed live: SQL Lab `client_id` must be <= 11 chars (`query.client_id` VARCHAR(11))
+ — psycopg2 StringDataRightTruncation surfaced through the canary.
+- **Live mutation canary GREEN** on `https://ss-prod.bebesh.ru` (test stand, owner-authorized):
+ full provider path per mutation — capacity claim → receipt opened → isolated Chromium
+ context → authenticated session → pre-SELECT hash match → UPDATE → post-SELECT → evidence
+ screenshot → receipt completed → lease released. `row_edit`: mutate 82.74→82.75 (verified),
+ restore →82.74 (verified, original preserved). 2/2 receipts `completed`.
+- Evidence: `evidence/browser-provider/readonly-canary-20260901T151437Z.json` + mutate/restore
+ PNGs. Regression: `399 passed`; ruff, anchors, diff-check clean; all provider modules < 400 lines.
+- Remaining for GO: browser reconciler (target-state check) wiring into the sweep, safe-checkpoint
+ reconstruction trace, scheduler soak, browser E2E, sandbox runtime. Product remains **NO-GO**
+ pending those; the mutation execution path itself is now production-proven.
+
+## Checkpoint — 2026-09-01 (browser reconciler + live reconciliation canary GREEN)
+
+- Closed the mutation loop end-to-end:
+ - Receipts now persist the full `mutation_context` (dashboard_id, table, key_columns,
+ assignments, target_keys, field_allowlist, database_id) in summary at open time.
+ - `browser_mutation.py` adds `build_select_only_script` — the read-only observation flow
+ (SELECT limited to assignment+key columns; `SELECT *` was rejected after the live run
+ showed cross-column divergence).
+ - `browser_reconciler.py` — `build_browser_reconciler(service)`: observes the live row state
+ through a fresh authenticated Chromium session (SELECT-only; never UPDATE) and maps it to
+ verdicts: completed (state matches assignments) / failed (diverged or context missing).
+ - Bootstrap composition registers the real reconciler for `browser`, so the 30s scheduler
+ sweep resolves stale `reconciliation_required` receipts automatically.
+- **Live reconciliation canary GREEN**: an injected `reconciliation_required` receipt (real
+ mutation context, backdated) was resolved by the sweep through a live Chromium observation —
+ receipt `completed`, note "target row state matches the recorded assignments".
+ Evidence: `evidence/browser-provider/readonly-canary-20260901T152804Z.json`.
+- Verification: `403 passed` (4 reconciler unit tests added); ruff, anchors, diff-check clean.
+- Remaining for GO: safe-checkpoint reconstruction trace, scheduler soak, browser E2E,
+ sandbox runtime. The mutation lifecycle (contract → receipt → effect → evidence →
+ reconciliation) is now fully production-proven on the test stand.
+
+## Checkpoint — 2026-09-01 (T042b safe-checkpoint reconstruction canary GREEN)
+
+- Implemented the `reconstruction_replay` marker (044 data-model contract, previously
+ missing): `_archive_recovery_attempt` records `reconstruction_replay: true` in the
+ recovery_history entry, and `_advance_run` merges the marker into the replayed
+ attempt's outcome when the step's recovery history shows reconstruction.
+- **Safe-checkpoint reconstruction canary GREEN** on the live stand
+ (`SS_CANARY_MODE=recovery`, PostgreSQL canary DB): abandoned worker (claim → expired
+ lease) → `recover_run` from the pinned plan → replay through the real provider against
+ the stand → attempt 2 `passed`, `reconstruction_replay=true` in both the recovery
+ history and the replayed outcome, `dashboard_open` checkpoint, evidence digest + PNG
+ retained (`20260901T154336Z-recovery-replay.png`). Recovery canary harness seeds a
+ real registry entry/revision and registers live providers into the global composition
+ root (PostgreSQL canary DB removes SQLite cross-connection locking).
+- T042b canary scoreboard (all against the live test stand):
+ read-only actions `GREEN` · forced timeout/cleanup `GREEN` · mutation row_edit+restore
+ `GREEN` (with precondition hash + receipts) · reconciliation observation `GREEN` ·
+ safe-checkpoint reconstruction `GREEN`.
+- Verification: `403 passed`; ruff, anchors, diff-check clean.
+- Remaining for GO: scheduler soak, browser E2E, sandbox runtime (start_exploration
+ real provider). Product remains **NO-GO** pending those.
+
+## Checkpoint — 2026-09-01 (T042b scheduler soak GREEN on live stand)
+
+- **Scheduler soak GREEN** (`SS_CANARY_MODE=soak`, 75s, ~15 real APScheduler ticks against
+ the live test stand): 3 queued browser runs dispatched by the real
+ `scenario_queued_dispatch` job through the production provider path — 3/3 `passed`,
+ `attempts == 1` each (persisted queued→running CAS prevents duplicate provider I/O
+ across overlapping ticks), `active_leases == 0`, exactly one durable evidence artifact
+ per run, reconciliation job co-scheduled, `scheduler.stop()` graceful.
+- Canary harness: idempotent registry seeding helper shared by recovery/soak modes;
+ soak asserts run statuses, attempt counts, lease hygiene and artifact counts in
+ `failures`.
+- Evidence: `evidence/browser-provider/readonly-canary-20260901T160242Z.json`.
+ Verification: `403 passed`; ruff, anchors, diff-check clean.
+- T042b canary scoreboard: read-only `GREEN` · timeout/cleanup `GREEN` · mutation
+ row_edit+restore `GREEN` · reconciliation `GREEN` · safe-checkpoint reconstruction
+ `GREEN` · scheduler soak `GREEN`. All six canary vectors pass against the live stand.
+- Remaining for GO: browser E2E (full UI journey), sandbox runtime (`start_exploration`
+ real provider), readiness/health payload hardening. Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (readiness hardening + T042c revalidation + sandbox runtime)
+
+- **Readiness hardening (044 T031/T040 tail)**: `/api/ready` now carries the cached provider
+ readiness snapshot (`providers` section captured at bootstrap; no per-request probe,
+ no credential-shaped values).
+- **T042c/T024a dispatcher revalidation tests** (`test_dispatcher_revalidation.py`, 4):
+ PROD reclassification invalidates the mutating gate before provider I/O; principal
+ drift → dispatcher `BROWSER_BINDING_MISMATCH`; unknown binding ref → fail-closed
+ mismatch; stale registry fingerprint → `BROWSER_REGISTRY_MISMATCH` before I/O.
+- **Sandbox runtime (050 T026-T028 core)**: `exploration_sandbox.py` — CAS claim
+ (queued→exploring), read-only observation through the authenticated session
+ (dashboard charts/filters via GETs only, bounded 12/8), server-side graph synthesis
+ (charts → nodes, native filters → `applies_to` edges), durable evidence screenshot,
+ transitions exploring→exploration_passed/failed. `exploration_result` JSON column
+ (migration `0016_exploration_result` — fixed a 33-char revision id that broke the
+ varchar(32) alembic limit; PG chain 0001→0016 verified, `alembic check` clean).
+ Scheduler job `authoring_exploration_dispatch` (5s) sweeps queued requests; absent
+ explorer registration keeps requests queued (sandbox_unavailable semantics).
+- Tests: +3 sandbox, +4 revalidation. Verification: `410 passed`; ruff, anchors,
+ diff-check clean. Remaining for GO: browser E2E + MCP parity domains + doc sync.
+
+## Checkpoint — 2026-09-01 (spec checkbox sync)
+
+- Synced stale task checkboxes against implementation evidence: 044 T028–T042c (provider
+ vertical, canaries, revalidation) and 050 T001–T033 (MCP interface, authoring chain,
+ handoff/demolition flags) now reflect done status. Remaining open: 050 T008 CI
+ walkthrough, T012/T013/T014 parity domains, T016 parity tests, T023 promotion E2E,
+ T028 promotion E2E, T040–T043 demolition tails, 044 documentation tails.
+- Session totals (2026-09-01): provider vertical (~1 975 LoC), capacity-aware dispatch,
+ mutation SQL surface, reconciler + sweep, readiness hardening, T042c revalidation,
+ sandbox runtime, 6/6 live canaries GREEN, migrations 0014–0016 PG-verified,
+ `410 passed` full regression.
+- Remaining for GO: MCP parity domains (git/deploy/baseline/superset, ~400 LoC),
+ browser/MCP E2E (~600 LoC), promotion E2E wiring, doc tails. Product status: **NO-GO**.
+
+## Checkpoint — 2026-09-01 (050 T012/T013/T014 parity domains)
+
+- Closed the three open parity domains of the 050 catalog (45 tools now registered
+ — one-to-one with the explicit catalog):
+ - `backend/src/mcp_server/ops_inputs.py` — bounded strict input models for the
+ git/migration/backup/llm and Superset domains; `extra=forbid` everywhere; the
+ continuation payload re-validates identically under the approved hash.
+ - `backend/src/mcp_server/ops_tools.py` — `register_ops_tools`: T012 gated bodies
+ (curated schemas, approval-fallback only), Superset read tools
+ (`superset_list_databases`, `superset_explore_database` schemas/tables/
+ table_metadata/select_star, `superset_format_sql`, `superset_audit_permissions`),
+ gated Superset mutations (`superset_create_dashboard`, `superset_copy_dashboard`,
+ `superset_create_dataset`), and the baseline 037-parity surface
+ (`capture_baseline_candidate`, `request_baseline_approval`,
+ `decide_baseline_approval`, `consume_baseline_approval`,
+ `create_verification_run`) wrapping the exact REST-surface services.
+ - `backend/src/services/mcp_ops_dispatch.py` — reviewed dispatch adapters for every
+ approved continuation: GitService create/commit on the app loop,
+ `git-integration`/`superset-migration`/`superset-backup`/`llm_documentation`
+ TaskManager enqueue, `ValidationTaskService` policy creation, SupersetClient
+ dashboard/dataset writes, and one-shot `consume_approval` for baseline publish.
+ Payload re-validation before any I/O; idempotency keys per invocation.
+ - `poll_approved_mcp_dispatches` chain extended explicitly (no dynamic lookup);
+ `server.py` catalog +13 entries; `RbacFastMCP.call_tool` gains the SQL
+ context gate: `superset_execute_sql` against a PROD-classified environment
+ returns `approval_required` (MCPX-FR-018 style), non-PROD executes directly
+ under the dedicated `plugin:superset_sql` permission.
+ - `rbac_permission_catalog.py`: `SUPERSET_SQL_PERMISSIONS` + default-deny role
+ mapping + `is_superset_sql_permission`, unioned into
+ `discover_declared_permissions` so sync seeds the row for admin assignment.
+- SQL risk class: `superset_execute_sql` is denied to service principals, requires
+ the dedicated permission (not implied by `plugin:superset_proxy`), bounded
+ projection (50 rows), client-side dangerous-SQL guard intact.
+- Tests: `backend/tests/test_mcp_ops_parity.py` (13) — catalog risk/permission
+ matrix, 45/45 registration with curated schemas, SQL dedicated-permission
+ visibility, service-principal denial, create_branch gate-only idempotent flow,
+ execute_sql PROD gate / DEV bounded execution / unknown-env fail-closed,
+ baseline principal denial, adapter payload validation + one-shot consume,
+ full poller route for an approved `consume_baseline_approval` invocation.
+ Existing `test_mcp_server.py` catalog expectation updated.
+- Verification: MCP slice **70 passed** (`test_mcp_ops_parity` + server +
+ approvals + maintenance + oauth); RBAC catalog tests **41 passed**; full backend
+ suite **11167 passed, 240 skipped, 1 xpassed**; Ruff and `compileall` clean;
+ anchors balanced in all touched files (ops_inputs 6/6, ops_tools 7/7,
+ mcp_ops_dispatch 6/6, parity tests 7/7); scoped `git diff --check` clean.
+- Remaining for GO: T016 parity fixture tests (MCP outputs vs legacy wrappers on
+ shared fixtures), T023/T028 vertical E2E over MCP, browser UI E2E, scheduler
+ soak for the new ops dispatchers, semantic index rebuild (Axiom not attached this
+ session). Product remains **NO-GO**.
+
+## Checkpoint — 2026-09-01 (050 T016 parity tests + T023 MCP vertical E2E)
+
+- Closed the parity-proof and the first vertical E2E of the 050 gate:
+ - `backend/tests/api/test_mcp_parity_baseline_037.py` (3) — one shared 037
+ fixture set (api conftest builders) drives BOTH surfaces with one persisted
+ principal: MCP `request_baseline_approval` gate validates as the exact REST
+ `ApprovalGateResponse` shape with field-by-field equality (operation, risk,
+ required_permission, status, reason_required, target_paths); decide outputs
+ agree including `actor_id`; `create_verification_run` MCP vs REST
+ `/verification-runs` agree on overall_status/category statuses/evidence/
+ created_by; `superset_format_sql` MCP output is byte-identical to the legacy
+ REST format path (only the [EXT:Superset] client is doubled). Discovered
+ domain semantics pinned by the tests: one pending gate per AgentRun.
+ - `backend/tests/test_mcp_scenario_e2e.py` (2) — SC-001 vertical walkthrough
+ over `tools/call` with a REAL `scenario:EDIT`/`RUN` principal (no RBAC
+ stubs): tools/list visibility → authoring session → server-derived graph
+ proposal → owner diff review → promotion → `request_save` creating one
+ immutable `candidate` `ScenarioRevision` in the registry → 038
+ compile/resolve/validate over MCP → separate-CAS `activate_revision`
+ advancing `current_revision_id`; a no-EDIT principal neither sees nor can
+ call save/activate (typed denial proven).
+ - Fixed a production defect surfaced by the parity/E2E effort: the 038
+ resolver selector path crashed on steps with `description=None`
+ (`TypeError: NoneType + str` in `_apply_selector`); the hint is now safely
+ recorded, regression pinned by `test_selector_hint_on_step_without_description`.
+ - Baseline MCP tool outputs normalized to non-colliding envelopes:
+ `request_baseline_approval -> {"status","gate"}`,
+ `decide_baseline_approval -> {"status","decision"}`.
+- Verification: parity slice `3 passed`; E2E `2 passed`; resolver suite
+ `18 passed`; combined MCP+037 slice `217 passed` (in canonical ordering);
+ full backend suite **11173 passed, 240 skipped, 1 xpassed** (was 11167; +6
+ new tests net); Ruff and `compileall` clean; anchors balanced (E2E 3/3,
+ parity 5/5).
+- Known collection-order artifact (pre-existing, reproducible with untouched
+ files only): mixing root-level and `tests/api` package paths in a single
+ ad-hoc argument order can drop `tests/api/conftest.py` fixtures for the
+ second-collected api module (pytest prepend import mode). The canonical
+ full-suite ordering is unaffected; not chased further.
+- Closed in this session: T028 authoring promotion E2E, ops-dispatcher soak.
+ Remaining 050 items (CORRECTED the same day: the earlier "frontend surface
+ remaining" wording confused 044 T030 numbering with 050 — 050 Phase 3
+ frontend T030–T033 is already [x] in tasks.md): only Phase 4 removal
+ (T040–T043) and semantic index rebuild (Axiom binaries absent here).
+ Parity + E2E gate criteria on the backend: **met**.
+
+## Checkpoint — 2026-09-02 (050 T028 authoring promotion E2E + exploration wiring)
+
+- Completed the last backend E2E of the 050 gate and wired the exploration
+ vertical end-to-end:
+ - `backend/tests/test_mcp_authoring_promotion_e2e.py` (8) — full sandbox-to-
+ revision chain over `tools/call` with real RBAC: queued exploration →
+ real `execute_scheduled_exploration_dispatch` from scheduler thread
+ context (via worker thread; `run_until_complete` is not callable inside a
+ live loop) → `exploration_passed` with observations/proposed_graph/
+ `draft:exploration-*` evidence while only the [EXT:Browser] boundary is
+ doubled; bounded `get_exploration_result` projection (no observation
+ leak); typed proposal derived **from the observation** (`observed_dashboard_title`
+ lands in the saved graph); promote/diff/save/activate terminates in a
+ `current` revision without a pre-activation save. Negative branches:
+ SQL/path/backslash/drop typed ops rejected before proposal/CAS advance;
+ code-token and unregistered-action exploration specs rejected without
+ persistence; all five authoring input models structurally reject caller
+ `digest`/`content_hash`.
+ - Production wiring closed (was the T026-T028 seam gap): MCP
+ `start_exploration` now reflects deployment reality
+ (`provider_available = get_registered_runner() is not None`);
+ `bootstrap_live_execution_composition` registers `default_runner` plus the
+ deployment-owned `ScreenshotService`/draft-storage context for every
+ enabled live binding via the new reviewed
+ `register_exploration_context(service, storage)` seam. Without an enabled
+ binding the behavior stays typed sandbox-unavailable; requests continue to
+ queue instead of executing.
+ - Ops-dispatcher soak (`tests/test_mcp_ops_parity.py`, now 14): two approved
+ task-backed ops (backup, migration) over three poller cycles — each
+ dispatched exactly once, second/third cycles are no-ops, both carry
+ invocation-scoped idempotency keys, dispatch_status `completed`.
+- Verification: T028 module `8 passed`; parity+soak `14 passed`; MCP vertical
+ slice **83 passed** (8 files); registry/sandbox/workspace/scenario slices
+ green in canonical ordering; full backend suite **11182 passed, 240 skipped,
+ 1 xpassed** (was 11173); Ruff and `compileall` clean; anchors balanced in all
+ touched files (exploration_sandbox 5/5, live_composition 4/4, server 32/32,
+ T028 E2E 6/6, parity 7/7).
+- Remaining 050 items (CORRECTED: Phase 3 frontend T030–T033 already [x];
+ the earlier list conflated 044 T030 numbering): Phase 4 removal (T040–T043)
+ and semantic index rebuild (no Axiom binaries in this environment).
+ **Product status: parity + E2E criteria met on the backend; overall GO
+ awaits the Phase 4 demolition tail only.**
+
+## Checkpoint — 2026-09-02 (orthogonal audit + audit-driven hardening)
+
+- Two independent read-only audits (orthogonal QA + security) over the whole
+ uncommitted 050 slice: QA re-ran all evidence (full suite reproduced exactly:
+ 11182 pre-hardening), spot-verified 7 task claims (all CONFIRMED), audited
+ mocks in the four new test files (no logic mirrors; external-boundary doubles
+ only); security produced 17 CWE-mapped findings. No CRITICAL; no approval
+ bypass; no service-principal leakage; dispatch stays CAS-claimed and static.
+- Fixed in this checkpoint (convergent HIGH findings):
+ - `backend/src/core/superset_client/safety.py` — the SQL risk-class guard
+ hardened from keyword blocklist to coverage of `INTO/CALL/SET/REFRESH/
+ VACUUM/REINDEX/ATTACH/LOAD/PREPARE/COMMENT`, server-side primitives
+ (`lo_import`, `lo_export`, `pg_read_file`, `pg_write_file`, `pg_ls_dir`,
+ `dblink`, `dblink_exec`, `set_config`, `pg_sleep`) and multi-statement
+ smuggling (`;` after string/comment stripping). Tests in
+ `tests/test_core/test_superset_safety.py` pin bypasses and false-positive
+ guards (order_set/dataset/setval/single trailing `;` stay green).
+ - `backend/src/mcp_server/server.py` — PROD-classified SQL execution is now
+ a TERMINAL rejection (`production_sql_execution_rejected`, recorded as
+ denied provenance, no gate created), using the canonical production
+ criterion `resolve_environment_execution_policy` (is_production OR
+ stage=PROD) — this removes the approvable-but-never-dispatched black hole
+ and aligns the criterion with scenario starts.
+ - `backend/src/services/mcp_ops_dispatch.py` — baseline consume adapter now
+ refuses deactivated actors (`mcp_actor_inactive`) matching the direct-tool
+ guard.
+- Evidence after hardening: affected slice **214 passed** (MCP vertical + both
+ safety suites + superset extended + resolver); full backend suite
+ **11202 passed, 240 skipped, 1 xpassed**; Ruff/compileall clean.
+- Closed in the follow-up hardening round (2026-09-02, same day):
+ - QA M2 / T017 gap — `response_limit` is now ENFORCED: `RbacFastMCP.call_tool`
+ fails closed with the typed `response_too_large` envelope and denied
+ provenance when a structured reply exceeds the configured limit
+ (`server.config`), pinned by `test_oversized_reply_is_truncated_to_typed_error`.
+ - QA M3 — poisoned exploration requests fail closed: `default_runner`
+ terminates a claimed request whose workspace vanished
+ (`EXPLORATION_TARGET_UNRESOLVED` / `workspace_not_found`) instead of
+ raising back into the queue; pinned by
+ `test_default_runner_fails_closed_when_workspace_missing`.
+ - SEC M-10 — exploration evidence digest is now the sha256 content hash of the
+ observation fingerprint; the ref is retrievable and verifiable via
+ `DraftStorage.retrieve`, pinned by `test_evidence_digest_is_sha256_of_observation`
+ and an E2E retrieval assertion.
+ - SEC M-16 — TaskManager adapters now enqueue under the actor's durable user
+ UUID (`_actor_user_id`, inactive actors rejected before dispatch), so
+ MCP-originated tasks are visible to their owner via `get_task_status`;
+ pinned in the migration adapter test.
+- Evidence after hardening: audit slice **161 passed**; full backend suite
+ **11205 passed, 240 skipped, 1 xpassed**; Ruff/compileall clean; anchors
+ balanced (mcp_ops_dispatch 6/6, ops_tools 7/7, parity tests 8/8).
+- Remaining deferred (product/ops decisions recorded, none block the
+ parity+E2E gate): M-03 self-approval (the gate is a confirmation step;
+ four-eyes needs a product decision on approver separation); M-04 service
+ principals bypass catalog permissions by design of the service branch
+ (superset_audit and table_metadata are the widest service-visible
+ projections); M-06 at-least-once adapter idempotency after lease recovery;
+ M-07 multi-binding exploration context last-writer-wins (single-binding
+ deployments unaffected); M3/M-08 exploration queue TTL/limits; M-05 remnants
+ (expired-gate replay `_find_retryable_approval`, decide-expiry TOCTOU).
+- Product status unchanged: parity + E2E criteria met on the backend; overall
+ GO awaits the Phase 4 demolition tail (T040–T043) — the frontend Phase 3
+ (T030–T033) is verified complete in tasks.md.
+
+## Checkpoint — 2026-09-02 (frontend status correction + live happy-path demo)
+
+- Frontend 050 Phase 3 is COMPLETE (T030–T033 `[x]` in tasks.md): flag-driven
+ decommission via the typed build-time switch `MCP_DECOMMISSION`
+ (`frontend/src/lib/config/mcp.ts`, vite define from the `MCP_DECOMMISSION`
+ env var), `HandoffSurface` component
+ (`frontend/src/lib/components/agent/HandoffSurface.svelte`), and flag gates
+ for `/agent`, the assistant panel and the top-nav entry
+ (`routes/+layout.svelte:134`, `routes/agent/+page.svelte:129/169`).
+- Verified live on the local stand: `./run.sh --skip-install` (backend 8000
+ `/api/ready` green, frontend 5173, agent 7860); demo admin `happy-admin`
+ created through `src/scripts/create_admin.py`; Playwright headless-chromium
+ walkthrough performed a real login and captured 8 screenshots
+ (`/tmp/kilo/happy-path/00-login.png` … `06-migration.png`,
+ `07-handoff-agent.png`): login → home → `/dashboards` → `/agent`
+ (legacy workspace) → `/dashboard-testing/runs` (Global Run Operations Center)
+ → `/dashboard-testing/analytics` (investigation queue) →
+ `/validation-tasks` → `/migration`; a second dev server with
+ `MCP_DECOMMISSION=true` on :5174 renders the handoff surface
+ ("Ассистент переведён на MCP" + connection hint + copyable prompt).
+- Note: scenario detail routes are `/dashboard-testing/scenarios/[id]/{edit,runs,analytics}`;
+ there is no scenario index page — flow entry is the run center and dashboard cards.
+
+## Checkpoint — 2026-09-02 (050 Phase 4 removal — the 050 task list is fully closed)
+
+- T040 — runtime decommission: `run.sh` now starts exactly backend+frontend
+ (no AGENT_PORT/watchfiles/chat_uploads), `docker-compose.yml` and
+ `docker-compose.enterprise-clean.yml` lost the `agent` service (nginx configs
+ dropped `/api/agent/gradio`), `build.sh` lost `build:agent`/`bundle:agent`/
+ `bundle:embeddings` and the agent block of the generated deploy
+ compose/manifest/env template; `AGENTS.md`/`INSTALL.md` rewritten for the
+ two-service world. Live proof: stand boots with only :8000+:5173, `/api/ready`
+ green, Playwright reaches the handoff surface.
+- T041 — chat code removed: the entire `agent/` tree, `docker/Dockerfile.agent`,
+ `docker/agent.entrypoint.sh`, the gradio-proxy backend test, and on the
+ frontend: AssistantChatPanel + chat widgets, the ScenarioWorkspace branch
+ (`components/agent/dashboard-testing`), AgentChat/AgentRun models, the
+ assistant store, the `MCP_DECOMMISSION` flag infra (vite define, config
+ module, d.ts) and the gradio dev proxy. `/agent` now renders HandoffSurface
+ unconditionally; TopNavbar button navigates to it. Frontend: **3454 vitest
+ passed, lint 0 errors, build OK**. Backend: **11199 passed, 240 skipped,
+ 1 xpassed**. MarkdownRenderer retained (used by GitWorkspacePanel); assistant
+ i18n keys retained because the handoff surface renders them; orphan
+ chat DTO module `frontend/src/types/agent.ts` removed after confirming
+ zero importers (build+tests re-verified).
+- T042 — all twelve 036–047 `## Drift Amendment — MCP Interface` sections now
+ carry `**Status (2026-09-02): done**` with evidence links (050 tasks T012–T028,
+ T030–T033, T040–T041 + workstate checkpoints).
+- T043 — full-suite evidence recorded above; the stand runs without 7860
+ (SC-005 satisfied).
+- **050 status: all tasks [x]. Product readiness: backend parity + E2E and the
+ removal tail are closed.** Residual (documented, product decisions): approval
+ self-approval semantics, service-branch catalog permissions, adapter
+ idempotency after lease recovery, multi-binding exploration context,
+ TTL/expiry polish, semantic index rebuild (no Axiom binaries in this env).
+
+## Checkpoint — 2026-09-02 (browser E2E on isolated stack + live admin walkthrough)
+
+- Browser E2E closed the last evidence gap of T043: isolated compose stack
+ `docker compose -p ss-tools-e2e --env-file .env.e2e -f docker-compose.e2e.yml`
+ (fresh db volume, initial-admin bootstrap admin/admin123, backend :8103 +
+ frontend :8102 healthy, **no 7860 anywhere**) + local Playwright run of
+ `login.e2e.js` + rewritten `agent.e2e.js` → **6/6 passed, twice** (Chromium).
+ Stack torn down with `down -v` afterwards.
+- FOOTGUN found and worked around: the documented E2E command without
+ `-p` joins the DEFAULT compose project `ss-tools` — the same project
+ `run.sh` uses for `docker compose up -d db` — so the E2E backend attached to
+ the DEV database (admin had the real password, runner global-setup failed
+ with 401). Isolation requires an explicit project name
+ (`-p ss-tools-e2e`); dev db volume `postgres_data` survived and was
+ re-verified after the incident.
+- E2E suite alignment with the decommission (part of T041's frontend tail):
+ `agent.e2e.js` rewritten from chat-surface assertions to the handoff contract
+ (T01 surface renders / T02 zero chat elements / T03 deep-link stays on
+ handoff); `dashboard-scenario-ui.e2e.js` reload-recovery test retargeted to
+ the handoff route; `agent-scenario-run.e2e.js` anchor updated (backend
+ /api/agent-runs lifecycle tests remain valid — AgentRun persistence is kept);
+ stale `locator('nav')` strict-mode violations fixed in login/smoke
+ (`.first()`), invalid-credentials regex now matches the backend passthrough
+ detail ("Incorrect username or password").
+- Live admin walkthrough on the native dev stand (real admin credentials
+ provided by the operator): login → /dashboards, /agent renders the handoff
+ (0 textareas, 0 conversation nodes), /dashboard-testing/runs renders; the
+ agentless run.sh restart and split-process start (uvicorn + vite separately)
+ both verified — screenshots /tmp/kilo/happy-path/09–12.
+- Note: the first post-restart Playwright run of agent T02/T03 flaked against a
+ cold vite dev server; warm re-runs are stable (3.3s and 4.8s passes).