From ad05e422a8a2b0d38914d89f9a0f763b366e484b Mon Sep 17 00:00:00 2001 From: Rodolphe Date: Fri, 11 Sep 2026 19:22:54 -0400 Subject: [PATCH] fix(demo): stop delaying the trust prompt; it cannot be avoided MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four fresh Codespaces on 2026-09-11 all opened untrusted and all raised "Do you trust the authors of the files in this folder?" as soon as the startup terminal asked to execute code. The ten-second wait added in #28 did not prevent it — it only moved the same modal later, after a pause in which the demo looked broken. So the terminal starts immediately again. The question arrives at once, DEMO.md says what to click, and nothing here pretends the prompt is avoidable: an earlier attempt via `security.workspace.trust.*` was ignored because those keys are user-scope by design. Co-Authored-By: Claude Opus 5 --- .devcontainer/arduino/devcontainer.json | 2 +- .devcontainer/cargo/devcontainer.json | 2 +- .devcontainer/cocoapods/devcontainer.json | 2 +- .devcontainer/conan/devcontainer.json | 2 +- .devcontainer/go/devcontainer.json | 2 +- .devcontainer/hex/devcontainer.json | 2 +- .devcontainer/maven/devcontainer.json | 2 +- .devcontainer/npm/devcontainer.json | 2 +- .devcontainer/nuget/devcontainer.json | 2 +- .devcontainer/opam/devcontainer.json | 2 +- .devcontainer/packagist/devcontainer.json | 2 +- .devcontainer/pub/devcontainer.json | 2 +- .devcontainer/pypi/devcontainer.json | 2 +- .devcontainer/rubygems/devcontainer.json | 2 +- .devcontainer/swift/devcontainer.json | 2 +- .devcontainer/vcpkg/devcontainer.json | 2 +- scripts/lib/devcontainer-spec.mjs | 30 +++++++++-------------- 17 files changed, 28 insertions(+), 34 deletions(-) diff --git a/.devcontainer/arduino/devcontainer.json b/.devcontainer/arduino/devcontainer.json index c6d72d8..4ea4fe6 100644 --- a/.devcontainer/arduino/devcontainer.json +++ b/.devcontainer/arduino/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "pipx install platformio && node scripts/prepare-demo.mjs arduino && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/cargo/devcontainer.json b/.devcontainer/cargo/devcontainer.json index f5a8e9c..d013f3d 100644 --- a/.devcontainer/cargo/devcontainer.json +++ b/.devcontainer/cargo/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": ".devcontainer/cargo/setup.sh && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/cocoapods/devcontainer.json b/.devcontainer/cocoapods/devcontainer.json index 68121e6..46f3500 100644 --- a/.devcontainer/cocoapods/devcontainer.json +++ b/.devcontainer/cocoapods/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "gem install cocoapods --no-document && node scripts/prepare-demo.mjs cocoapods && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/conan/devcontainer.json b/.devcontainer/conan/devcontainer.json index 623b86e..1190772 100644 --- a/.devcontainer/conan/devcontainer.json +++ b/.devcontainer/conan/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "pipx install conan && node scripts/prepare-demo.mjs conan && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/go/devcontainer.json b/.devcontainer/go/devcontainer.json index 5058d2c..c3f0ad8 100644 --- a/.devcontainer/go/devcontainer.json +++ b/.devcontainer/go/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs go && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/hex/devcontainer.json b/.devcontainer/hex/devcontainer.json index 9f9969e..56b8d02 100644 --- a/.devcontainer/hex/devcontainer.json +++ b/.devcontainer/hex/devcontainer.json @@ -16,7 +16,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs hex && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/maven/devcontainer.json b/.devcontainer/maven/devcontainer.json index 0455ba1..fb36e0f 100644 --- a/.devcontainer/maven/devcontainer.json +++ b/.devcontainer/maven/devcontainer.json @@ -19,7 +19,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs maven && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/npm/devcontainer.json b/.devcontainer/npm/devcontainer.json index 42e3a65..27c83ee 100644 --- a/.devcontainer/npm/devcontainer.json +++ b/.devcontainer/npm/devcontainer.json @@ -10,7 +10,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs npm && npm --prefix demos/npm install --no-audit --no-fund && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/nuget/devcontainer.json b/.devcontainer/nuget/devcontainer.json index 114c495..b70bd9f 100644 --- a/.devcontainer/nuget/devcontainer.json +++ b/.devcontainer/nuget/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs nuget && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/opam/devcontainer.json b/.devcontainer/opam/devcontainer.json index c5b7c50..ccbe3b5 100644 --- a/.devcontainer/opam/devcontainer.json +++ b/.devcontainer/opam/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs opam && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/packagist/devcontainer.json b/.devcontainer/packagist/devcontainer.json index 0a4b884..275c81c 100644 --- a/.devcontainer/packagist/devcontainer.json +++ b/.devcontainer/packagist/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs packagist && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/pub/devcontainer.json b/.devcontainer/pub/devcontainer.json index b555801..c07e87d 100644 --- a/.devcontainer/pub/devcontainer.json +++ b/.devcontainer/pub/devcontainer.json @@ -16,7 +16,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs pub && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/pypi/devcontainer.json b/.devcontainer/pypi/devcontainer.json index ba2b3ca..8fc7e5f 100644 --- a/.devcontainer/pypi/devcontainer.json +++ b/.devcontainer/pypi/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs pypi && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/rubygems/devcontainer.json b/.devcontainer/rubygems/devcontainer.json index 9cac847..8bc1289 100644 --- a/.devcontainer/rubygems/devcontainer.json +++ b/.devcontainer/rubygems/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs rubygems && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/swift/devcontainer.json b/.devcontainer/swift/devcontainer.json index 28794b0..d12b52b 100644 --- a/.devcontainer/swift/devcontainer.json +++ b/.devcontainer/swift/devcontainer.json @@ -16,7 +16,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs swift && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/.devcontainer/vcpkg/devcontainer.json b/.devcontainer/vcpkg/devcontainer.json index 4c82aec..514b7a0 100644 --- a/.devcontainer/vcpkg/devcontainer.json +++ b/.devcontainer/vcpkg/devcontainer.json @@ -15,7 +15,7 @@ }, "onCreateCommand": "node scripts/prepare-demo.mjs vcpkg && npm install -g @usedrift/cli", "waitFor": "onCreateCommand", - "postAttachCommand": "sleep 10 && drift analyze < /dev/null", + "postAttachCommand": "drift analyze < /dev/null", "customizations": { "vscode": { "extensions": [ diff --git a/scripts/lib/devcontainer-spec.mjs b/scripts/lib/devcontainer-spec.mjs index 1d0eb7c..5483ed8 100644 --- a/scripts/lib/devcontainer-spec.mjs +++ b/scripts/lib/devcontainer-spec.mjs @@ -132,24 +132,18 @@ export function buildDevcontainer(demo, allDemos) { // a GitHub issue or cut a branch for it, and here that parked the startup // terminal on a question, flagged it as needing attention, and left the // visitor one keypress from opening an issue on this repository. - // The sleep is about Workspace Trust, not about Drift. - // - // A Codespace can attach before trust has settled. Creating a terminal - // counts as executing code, so a terminal that starts in that window makes - // VS Code ask "Do you trust the authors of the files in this folder?" — and - // while that modal stands nothing else happens: the extension declares no - // untrusted-workspace support, so there is no panel, no analysis and no - // terminal until somebody answers it. Two of three Codespaces opened on - // 2026-09-11 hit exactly that; the one that did not had simply attached - // more slowly. - // - // There is no settings-based fix: `security.workspace.trust.*` is - // user-scope by design and is ignored from devcontainer, remote and - // workspace settings, which an earlier attempt here got wrong. So the - // terminal waits instead, which costs the demo ten seconds it was already - // spending on the first analysis, and DEMO.md says what to click if the - // question appears anyway. - postAttachCommand: 'sleep 10 && drift analyze < /dev/null', + // A fresh Codespace on this repository opens *untrusted*, and nothing here + // can change that. Creating a terminal counts as executing code, so this + // command is what makes VS Code ask "Do you trust the authors of the files + // in this folder?", and until the visitor answers there is no panel, no + // analysis and no terminal: the extension declares no untrusted-workspace + // support. Two attempts to configure the question away failed and were + // reverted — `security.workspace.trust.*` is user-scope by design and + // ignored from devcontainer settings, and delaying the terminal only moved + // the same modal later (four fresh Codespaces on 2026-09-11, all four + // prompted). So the terminal starts immediately, the question arrives at + // once rather than after a confusing pause, and DEMO.md says what to click. + postAttachCommand: 'drift analyze < /dev/null', customizations: { vscode: { extensions: ['drift.usedrift'],