Skip to content

Tighten Storybook manifest provenance and credential isolation - #4490

Merged
Jason Morse (JasonVMo) merged 11 commits into
mainfrom
user/jasonvmo/desktop-manifest-trust
Nov 12, 2026
Merged

Jason Morse (JasonVMo) merged 11 commits into
mainfrom
user/jasonvmo/desktop-manifest-trust

Conversation

@JasonVMo

@JasonVMo Jason Morse (JasonVMo) commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • iOS
  • macOS
  • win32 (Office)
  • windows
  • android

Description of changes

Part of #4445, under #4435.

  • Centralize strict, versioned generated contracts. Public v3 manifests contain neither nonce; independent bridge and attachment credentials live in OS owner-private storage, with only bridge data projected into Metro.
  • Pin the resolved helper and generated bytes through an independent inherited parent handoff. The actual channel child re-verifies helper provenance before spawning; editable manifest hashes are not authority.
  • Move Windows/Win32 smoke lease publication, replacement, and cleanup into a trusted Node helper using protected-DACL storage. PowerShell supplies OS-observed identity and retains only a digest receipt. Smoke control uses the shared v3 parser.
  • Derive Windows project namespaces from the verified helper's OS-selected per-user known-folder root instead of trusting hosted workspace ancestry. Preserve all protected-DACL/reparse/root checks and normalize Windows path/drive casing without weakening the independent byte-digest bindings.
  • Keep the Windows bridge projection protected even when the workspace is on another drive. Metro indexes only the constant workspace stub; a digest-keyed custom transformer rechecks and supplies the pinned private buffer to the consumer's original worker/Babel/minifier. No cross-volume private watch folder or public generated source copy is created; macOS resolution is unchanged.
  • Forward the private-storage adapter through the command factory so portable Linux/Windows CLI fixtures never accidentally invoke a native host adapter. Unsupported production credential platforms fail closed; bounded Windows refusal reasons are now visible.
  • Resolve existing generated directories once so symlinked projects and macOS /var aliases work while subsequent ancestor replacement still fails closed with an actionable diagnostic.
  • Add controlled Metro/process/smoke regressions, update the minimal WDIO fixture, and correct the qualification ledger.

Verification

Validation used the default macOS TMPDIR without an override. Initial CI run 43145388693 exposed dropped CLI fixture injection on Linux and unsafe-storage refusal in both Win32 smoke lanes. Run 43150784347 on ca27c1b0b confirms those fixes: JS PR, all macOS lanes, Windows/Win32 PR, and Windows native-helper setup passed; all three Storybook Windows lanes opened the protected per-user namespace.

Those three lanes then failed bundling because Metro's file map recombined a C: private source relative to a D: workspace into D:\C:\.... The new transformer keeps that private source outside the file map. Regression fixtures exercise path.win32 cross-drive and case semantics, digest tampering, nonce cache invalidation, and unchanged delegation. Supplemental controlled fixtures passed the actual consumer worker/Babel/minifier and full minified metro.runBuild for both Windows targets, explicitly excluding the private source from the file map. These JavaScript results are not native Windows qualification.

The prior setup build/handshake/UIA timeouts did not recur. This diff changes none of those native paths; the subsequent passing setup supports runner flakiness rather than a product timeout change.

The following exact commands were run from the repository root:

Workspace / check Exact commands Result
Desktop driver cd packages/agentic/desktop-driver && yarn format && yarn lint && yarn build && TF_BUILD=1 yarn test Passed; 1,222 tests passed, 66 skipped
Storybook integration cd packages/agentic/storybook-desktop && yarn format && yarn lint && yarn build && TF_BUILD=1 yarn test Passed; 387 tests passed, 4 Windows-only skips
Storybook runtime cd packages/agentic/storybook-desktop-runtime && yarn format && yarn lint && yarn build && TF_BUILD=1 yarn test Passed; 37 tests passed
Final transformer cache binding TF_BUILD=1 yarn workspace @fluentui-react-native/storybook-desktop-runtime test metro Passed; 11 tests
Qualification ledger yarn workspace @fluentui-react-native/desktop-test format Passed
Repository root yarn lage test-links --verbose --grouped Passed; 90 tasks
Repository root yarn clean-lage-cache; TF_BUILD=1 yarn lage buildci --concurrency 4 Passed; 178 tasks; both commands held the shared native lock
Repository safeguards yarn lint-repo; yarn check-agent-instructions; yarn change:check; git diff --check Passed
PowerShell parser checks ParseFile for both smoke scripts Not run: pwsh is not installed

Cross-volume fix and aggregate-qualified source: e760a36de. Local evidence: apps/storybook/artifacts/f6/crossdrive-*.log. TF_BUILD=1 selects the existing in-band Jest mode; it does not disable agentic tests. Both clean-cache and aggregate commands held the shared native lock.

Earlier native qualification, before review fixes: the locked FURN_NATIVE_DRIVER_TEST=1 yarn workspace @fluentui-react-native/desktop-driver test --runInBand passed 1,240 tests with 47 platform/capability skips. The stable-signed helper doctor was ready but reported Accessibility/PostEvent unavailable. The following root commands passed under the shared lock; prep selected the already installed Ruby JSON 2.18 through a worktree-local preload. No shared tools or privacy settings changed.

  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook build-driver --macos — passed.
  • yarn workspace @fluentui-react-native/agentic-components-storybook desktop-driver doctor --platform macos --permissions — passed (ready, with the permission limitations above).
  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook bundle --macos — passed.
  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook bundle --macos --paper — passed.
  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook prep --macos — passed after selecting installed JSON 2.18; initial JSON 3.1 selection failed on missing JSON.fast_generate.
  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook prep --macos --paper — passed.

The following exact consumer commands, from the repository root, are failed / Accessibility-blocked, not passes:

  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook smoke --macos --mode stories-and-tests --input accessible --reporter json
  • yarn workspace @fluentui-react-native/agentic-components-storybook storybook smoke --macos --paper --mode stories-and-tests --input accessible --reporter json

Both built/launched the app and reached bridge epoch recording, then failed on Accessibility apiDisabled (-25211) and no supported click mode; zero tests executed. AppleEvent cleanup timed out (-1712); each exact worktree-owned leftover app PID was verified, terminated, and confirmed gone. They were not repeated during review. Evidence: apps/storybook/artifacts/desktop/65fb216f-89ee-43db-86a6-333b3d91331e/run.json (Fabric) and cfab6e50-9b38-45d3-b114-05b3ea995037/run.json (Paper).

Windows CI sufficient: yes, for F6's changed paths. Same-branch run 43156299266 passed every check on 58ec7ab4fb7ce6e449d0e351ecb02352bf88f319 on November 12, 2026. Full job logs and downloaded terminal run.json reports, not only green job conclusions, confirm:

Lane / job Complete story index Authored tests Terminal aggregate
Windows Fabric accessible / 130976919836 215/215 rendered 40/40 passed 255 selected, executed, passed
Win32 Paper accessible / 130976919943 188/188 rendered 45/45 passed 233 selected, executed, passed
Win32 Paper physical / 130976920038 188/188 rendered 100 passed; 1 quarantined unsupported (#4373) 289 selected; 288 executed/passed; 1 unsupported

All three reports have zero failed, skipped, incomplete, retried, or flaky tests and zero groups not run. Unique passing navigation IDs match the full rendered index; there was no early stop. The quarantine is not counted as a pass.

The five checks are mandatory gates in all three executed native paths, rather than separately logged success messages:

  1. v3 control: completed traversal and authored tests run through storybook-control.cjs's strict shared v3 parser.
  2. Trusted helper: native Storybook/WebDriver readiness and completed native traversal follow the channel child's mandatory inherited-handoff and helper re-verification, before private-storage helpers or the native service start.
  3. Protected-DACL lease lifecycle: the scripts require successful trusted Node publication/digest receipts before control and propagate cleanup-helper failures. All lanes exercise publication, native consumption, and receipt-checked cleanup; Fabric also relaunches and replaces the lease between stories/tests, while Win32 uses a single incarnation. The Windows job additionally passed the real NTFS private-storage contract, including ACL/junction/hard-link/root-swap refusals and exclusive publication/removal (full log line 436). This is guarded native execution and native boundary coverage, not an independent post-run ACL dump.
  4. Private runtime resolution: successful minified bundles across the hosted D: workspace / C: private-store split exercise the transformer's private-buffer read/digest check and original-worker delegation, followed by successful runtime rendering.
  5. Live bridge authentication: all 215/188/188 native selections require nonce/instance/endpoint/target/manifest/epoch-matched hello and correlated render-ready responses; readiness alone is not the evidence.

Full-log anchors (bundle, native readiness, all stories, authored tests, terminal totals): Windows 655, 669–670, 709, 1230, 2295; Win32 accessible 502, 508–510, 511, 1097, 1118; Win32 physical 499, 505–507, 508, 1809, 1845. Artifact IDs 13916946307 / 13917010025 / 13916318019 contain main smoke run.json reports 414aa6f1-a539-4d67-9aa4-a92db05b58a4 / 00cae5a0-ef44-45cf-aaa9-68485ecf2403 / e5767c29-e4b1-4a9b-9685-8cdf8e0d3ee1, respectively. The F6 ledger records the artifact names and detailed gate/evidence mapping.

Limits: collected channel stderr includes non-terminal bridge-unavailable navigation diagnostics on Windows and an authenticated-epoch lease-invalid diagnostic on Win32 physical. Buffered output does not establish their original timing. These results do not claim diagnostic-free operation or general bridge-recovery qualification. The local macOS Accessibility block and missing local pwsh parser check remain as recorded above; no local smoke was repeated. This PR remains draft pending the documentation follow-up's CI and the coordinator's readiness decision.

The documentation-only qualification follow-up aadc2f359 passed the exact ledger-format, root link-check, and repository-safeguard commands listed above (90 link tasks passed). Package/source/native suites were not rerun for this reporting-only change. Local evidence: apps/storybook/artifacts/f6/qualification-docs-{format,links,checks}.log.

Before After
Editable manifest hashes authorized helper selection; bridge and attach reused a nonce; consumers drifted between schemas. Independent parent provenance, purpose-separated owner-private credentials, strict shared v3 parsing, and protected lease publication/cleanup.
/var and symlinked project paths failed with a generic storage error. Existing generated parents resolve once; canonical ancestor swaps still fail closed and identify the offending path.
Portable command fixtures dropped their storage adapter; hosted Windows publication depended on workspace ancestor trust. Injection is preserved; Windows selects a protected per-user namespace through the native helper.
Metro tried to index a C: private source relative to a D: workspace, producing D:\C:\.... Only the workspace stub enters Metro's file map; a pinned-buffer transformer preserves protected source storage and the original worker pipeline.

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility
  • Voiceover
  • Internationalization and Right-to-left Layouts

Keep bridge and attachment credentials in OS-private records, validate centralized generated contracts, and pin the spawning child's helper to the independent parent handoff. Load runtime identity from a private data-only module.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prepare the Storybook-owned call site for F10-M's native process identity verification without relocating channel or lease ownership.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accept the extractor's declared/derived inputSource metadata while keeping authored case options strict. Cover realistic resolved descriptors and reject unsupported metadata; this fixes the consumer smoke's publication failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document portable and signed-native contract coverage, successful Fabric/Paper preparation, explicit Accessibility-blocked consumer outcomes, cleanup, final aggregate validation, and Windows CI sufficiency without claiming unrun native passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route Windows smoke lease publication and cleanup through verified private storage, use the shared v3 control schema, and resolve generated directory aliases before creating private records. Cover receipt fencing, stock macOS paths, and symlink replacement; keep Windows qualification explicitly pending.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace superseded local temporary-directory qualification with default-TMPDIR package and aggregate evidence. Keep macOS consumer permission blocks and unobserved Windows/Win32 coverage explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 79 (+1) 80 (+1) 72.92k (-702b) 72.85k (-702b)
components-catalog 228 (+1) 229 (+1) 229.66k (+349b) 229.59k (+349b)
design-themed-root 55 (+4) 56 (+4) 56.26k (+998b) 56.18k (+998b)
design-color-lib 6 (+0) 6 (+0) 6.27k (+0b) 6.27k (+0b)
design-theme-state-legacy-source 49 (+1) 50 (+1) 52.96k (-841b) 52.89k (-841b)
design-legacy-theme 42 (+0) 42 (+0) 39.11k (+0b) 42.91k (+0b)
design-legacy-theme-from-flex 58 (+4) 58 (+4) 60.70k (+824b) 64.51k (+822b)
design-fluent-light-theme 7 (+0) 7 (+0) 18.74k (+0b) 22.59k (+0b)
design-fluent-theme 35 (+0) 35 (+0) 27.46k (+4b) 31.25k (-1b)
design-fluent-hc-theme 32 (+0) 32 (+0) 27.34k (+0b) 31.13k (+0b)
design-flex-theme 29 (-4) 29 (-4) 14.30k (-9.07k) 14.29k (-9.07k)
design-flex-cool-theme 26 (New) 26 (New) 12.51k (New) 12.50k (New)
design-flex-warm-theme 26 (-7) 26 (-7) 12.28k (-11.15k) 12.27k (-11.15k)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Forward injected storage through the CLI factory and select host adapters explicitly. Derive protected Windows namespaces from the helper-selected per-user root, preserve Metro access outside the workspace, and report bounded refusal reasons without weakening native ACL checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record default-TMPDIR package results, the locked 178-task aggregate, and the unconfirmed Windows refusal and timeout diagnoses. Keep native Windows qualification explicitly pending.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a pinned-buffer transformer on the workspace stub for Windows and Win32 while preserving protected per-user storage and macOS resolution. Normalize Windows path identities and cover cross-drive, cache, delegation, and tamper cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants