Skip to content

Show WebVM target artifacts in VS Code Explorer#26

Merged
konard merged 3 commits intomainfrom
issue-25-891aa8cfdd35
May 9, 2026
Merged

Show WebVM target artifacts in VS Code Explorer#26
konard merged 3 commits intomainfrom
issue-25-891aa8cfdd35

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented May 9, 2026

Fixes #25.

Summary

  • Keep /workspace/target visible in the VS Code Explorer by syncing target artifact metadata instead of pruning the directory.
  • Store target artifacts as metadata-only IndexedDB entries so Explorer can show the tree without copying generated binaries/intermediates into the browser workspace.
  • Align the generated sync hook and baked disk bash profile, add regression coverage, and replace the issue Improve transparency between VS Code UI and WebVM, so it works naturally and as user expects. #25 case study with evidence, screenshots, logs, and research notes.

Root Cause

The guest sync hook introduced for issue #21 used this traversal:

find /workspace -path /workspace/target -prune -o -path /workspace/.git -prune -o -print

That kept prompt-time sync fast, but it also made the browser workspace incomplete. Cargo created target/ in the WebVM, but VS Code never received tree entries for it.

Fix

  • web/glue/workspace-sync.js now traverses /workspace/target and emits target files as skipped metadata records with sizes.
  • web/glue/workspace-fs.js now supports metadata-only files, shows them through stat()/readDirectory(), rejects content reads with Unavailable, and excludes them from WebVM priming snapshots.
  • web/disk/Dockerfile.disk now bakes the same sync protocol into /root/.bash_profile.
  • web/tests/workspace-sync.test.mjs reproduces the old prune behavior and verifies target metadata visibility/refresh.
  • web/tests/e2e/local-pages-e2e.test.mjs asserts that the warm-disk workspace tree includes target when browser e2e runs.

Reproduction Evidence

  • docs/case-studies/issue-25/verification/focused-before.log shows the focused regression test failing before the fix because /workspace/target was still pruned.
  • docs/case-studies/issue-25/screenshots/local-target-visible.png is the reporter's local VS Code reference.
  • docs/case-studies/issue-25/screenshots/rust-web-box-target-hidden.png is the reporter's rust-web-box failure screenshot.

Local VS Code shows target

rust-web-box previously hid target

Verification

  • node --test web/tests/workspace-sync.test.mjs passed: 8 tests.
  • node --test web/tests passed: 179 passed, 3 skipped because local Playwright/browser-commander or live URL was not configured.
  • Generated sync hook passed bash -n.
  • git diff --check passed.
  • cargo fmt --check passed.
  • cargo clippy --all-targets --all-features passed.
  • cargo test --all-features --verbose passed.
  • cargo test --doc --verbose passed.
  • rust-script scripts/check-file-size.rs passed.
  • cargo build --release --verbose passed.
  • cargo package --list --allow-dirty passed.
  • rust-script scripts/check-changelog-fragment.rs passed with PR-like env vars.
  • rust-script scripts/check-version-modification.rs passed with PR-like env vars.

Notes

Target file contents are intentionally not mirrored into IndexedDB. Opening a metadata-only target artifact from Explorer returns Unavailable rather than fake file contents, while cargo run continues to use the real files in the WebVM filesystem.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #25
@konard konard self-assigned this May 9, 2026
@konard konard changed the title [WIP] Improve transparency between VS Code UI and WebVM, so it works naturally and as user expects. Show WebVM target artifacts in VS Code Explorer May 9, 2026
@konard konard marked this pull request as ready for review May 9, 2026 04:58
@konard
Copy link
Copy Markdown
Member Author

konard commented May 9, 2026

Working session summary

Implemented and pushed the fix to PR #26: #26

What changed:

  • /workspace/target is no longer pruned from guest-to-browser sync.
  • Target artifacts now appear in VS Code Explorer as metadata-only files with sizes, avoiding large artifact body sync.
  • Metadata-only entries are excluded from WebVM priming snapshots, so fake target files are not written back into the VM.
  • Updated generated sync hook, baked disk hook, regression tests, e2e assertion, changelog, and issue Improve transparency between VS Code UI and WebVM, so it works naturally and as user expects. #25 case study evidence.

Verification:

  • Local focused regression: node --test web/tests/workspace-sync.test.mjs passed, 8 tests.
  • Local full web tests: node --test web/tests passed, 179 passed and 3 skipped due missing local browser/live-url setup.
  • Rust checks passed: fmt, clippy, tests, doc tests, release build, package list, file-size, changelog/version policy checks.
  • Fresh CI on SHA 8d7a4f7 passed:
    • CI/CD Pipeline 25592287951, created 2026-05-09T04:58:06Z
    • Build disk image 25592287800, created 2026-05-09T04:58:05Z
    • Deploy GitHub Pages 25592287799, created 2026-05-09T04:58:05Z
  • PR is ready for review and mergeable cleanly.

Research sources recorded in the case study:
Cargo build cache: https://doc.rust-lang.org/cargo/reference/build-cache.html
Cargo incremental profiles: https://doc.rust-lang.org/cargo/reference/profiles.html#incremental
VS Code Explorer behavior: https://code.visualstudio.com/docs/getstarted/userinterface#_explorer-view
CheerpX filesystem docs: https://cheerpx.io/docs/guides/File-System-support


This summary was automatically extracted from the AI working session output.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 9, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $17.150118

📊 Context and tokens usage:

  • 532.1K / 1.1M (51%) input tokens, 46.1K / 128K (36%) output tokens

Total: (532.1K + 9.8M cached) input tokens, 46.1K output tokens, $17.150118 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (56381KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented May 9, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit 7bd8cca into main May 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve transparency between VS Code UI and WebVM, so it works naturally and as user expects.

1 participant