Skip to content

Create file children through opaque directory grants #400

Description

@wieslawsoltes

Scope

Implement FileSystemDirectoryHandle.getFileHandle(name, {create:true}) over the typed opaque child authority tracked by SceneTech/AppScene#162.

Browser behavior follows the pinned WPT contract:

  • create and return an empty file when the named child is absent;
  • return an existing file without truncating it;
  • reject a directory collision with TypeMismatchError;
  • preserve WebIDL option conversion and existing invalid-name TypeError behavior;
  • map denied, stale, cancelled, capacity, and I/O outcomes to browser errors without exposing raw paths or native objects;
  • bind every derived handle to the requesting origin/profile/partition and release its native grant exactly once across realm/navigation retirement.

Acceptance

  • pinned WPT and Chrome oracle for create, existing-content preservation, collision, invalid-name, and error mapping;
  • native adapter/ABI/export/C11 parity with AppScene#162;
  • cross-origin/profile/partition rejection plus cancel/stale-generation/retire coverage;
  • 10k bounded broker operations and 100 lifecycle cycles with heap/RSS/FD bounds;
  • unchanged VS Code browser provider file-create/write path through getFileHandle(...,{create:true}) plus createWritable().

This issue excludes directory creation, removeEntry()/remove(), move/rename, recursive deletion, and package paths tracked by #131/#252.

Parent: #248.

Activity

  1. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Implementation is ready in PR #406 at exact head a5b45266641a747fe7d8af647889a0fbc554454e, based on e98b885d487e3e2e560ebe1917d3cdcdb0dc4c58. Local changed-path gates are green: Chrome 153 WPT reduction 3/3; focused native create/runtime and 100-cycle lifecycle; C++ broker/C11 ABI 2/2; 10k broker 0.029s with +96 KiB RSS and 0 FD; export contract 2/2; all three symbols present; AppScene cac13616 request/status/field adapter assertions pass. The broad local aggregate reaches the separately documented pre-existing writer close assertion only after all new create assertions pass. Direct exact-head hosted gates are queued; NuGet is being canceled as unrelated.

  2. wieslawsoltes commented on Sep 18, 2026

    @wieslawsoltes
    CollaboratorAuthor

    Completed by PR #406, merged as ad33c45305f4cabbb87d378686539d39efb606c5. Exact-head Linux, macOS, portable V8, native-document, and NativeAOT 11/12 checks all passed. The merged runtime now implements getFileHandle(name, {create:true}) over the opaque AppScene parent/derived-grant ABI, including browser error mapping, navigation cancellation, exactly-once release, and bounded lifecycle gates. Post-merge CI and NuGet tails were canceled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions