Rendered from specs/S02-workspace-trust.md — edit it there, not here.
S02 — Workspace Trust Integration
Overview
The extension is declared as untrustedWorkspaces: limited in its manifest because the preview feature shells out to a local Python interpreter, which represents an arbitrary code execution vector in untrusted workspaces.
Requirements
Manifest Declaration
- S02-SR-01 The extension manifest MUST declare
capabilities.untrustedWorkspaces.supported = "limited"with a description explaining that preview is disabled in untrusted workspaces. - S02-SR-02 The extension manifest MUST declare
capabilities.virtualWorkspaces.supported = falsebecause the extension requires disk access and a local Python interpreter.
Preview and Live Update
- S02-SR-03
openJsonSchemaMUST checkvscode.workspace.isTrustedbefore callinggenerateDocHTML. - S02-SR-04 When the workspace is untrusted and the command is invoked explicitly (not via auto-preview) the extension MUST show a warning message explaining why preview is disabled and MUST offer a Manage Workspace Trust button that calls
workbench.trust.manage. - S02-SR-05 When the workspace is untrusted and the command is invoked via auto-preview (
silent = true) the extension MUST return silently without showing any notification. - S02-SR-06
scheduleLiveUpdateMUST be a no-op in untrusted workspaces.
Permitted in Untrusted Workspaces
- S02-SR-07 Schema validation (AJV, no Python subprocess) MUST work in untrusted workspaces.
- S02-SR-08 Schema binding (reads/writes VS Code settings) MUST work in untrusted workspaces.
- S02-SR-09 Schema inference (pure JS via genson-js) MUST work in untrusted workspaces.
- S02-SR-10 Auth configuration (credential storage) MUST work in untrusted workspaces.
Acceptance Criteria
- Launching VS Code in Restricted Mode and running JSON Schema: Preview shows the workspace trust warning — not a Python error.
- Validate This File and Bind Schema… work normally in Restricted Mode.
Requirement traceability
Status of each requirement in specs/traceability.json. Test coverage is auto-discovered from [ID] tags in test titles and is not listed here.
| Requirement | Status | Implementation | Note |
|---|---|---|---|
S02-SR-01 | implemented | package.json | capabilities.untrustedWorkspaces = limited, preview-disabled description |
S02-SR-02 | implemented | package.json | capabilities.virtualWorkspaces = false |
S02-SR-03 | manual | src/PreviewWebPanel.ts | VS Code API-bound; verified by manual / E2E testing |
S02-SR-04 | manual | src/extension.ts | VS Code API-bound; verified by manual / E2E testing |
S02-SR-05 | manual | package.json | VS Code API-bound; verified by manual / E2E testing |
S02-SR-06 | manual | src/PreviewWebPanel.ts | VS Code API-bound; verified by manual / E2E testing |
S02-SR-07 | implemented | src/ValidationManager.ts | validation runs with workspace.isTrusted=false (no Python) |
S02-SR-08 | manual | src/extension.ts | VS Code API-bound; verified by manual / E2E testing |
S02-SR-09 | manual | src/PreviewWebPanel.ts | VS Code API-bound; verified by manual / E2E testing |
S02-SR-10 | manual | package.json | VS Code API-bound; verified by manual / E2E testing |