[PR #3532] [GUI] Export Official App Contracts For Tray And Web Companions #4671

Open
opened 2026-11-07 15:38:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3532
Author: @medking82
Created: 10/21/2026
Status: 🔄 Open

Base: main ← Head: codex/app-surface-contract-20261021


📝 Commits (3)

  • e53b903 [GUI] Add opt-in App surface contract export and verification
  • 8932fa9 Expand reviewed App surface ownership and consumption guidance
  • a251782 Validate App Surface Contracts On 0.2.2

📊 Changes

14 files changed (+1345 additions, -0 deletions)

View changed files

➕ tools/app-surface-contract/.gitignore (+2 -0)
➕ tools/app-surface-contract/CONSUMING.md (+82 -0)
➕ tools/app-surface-contract/README.md (+143 -0)
➕ tools/app-surface-contract/assets.mjs (+138 -0)
➕ tools/app-surface-contract/assets.test.mjs (+93 -0)
➕ tools/app-surface-contract/cli.mjs (+32 -0)
➕ tools/app-surface-contract/contract.mjs (+259 -0)
➕ tools/app-surface-contract/contract.test.mjs (+300 -0)
➕ tools/app-surface-contract/examples/context.jpg (+0 -0)
➕ tools/app-surface-contract/examples/effort.jpg (+0 -0)
➕ tools/app-surface-contract/examples/fixture.mjs (+68 -0)
➕ tools/app-surface-contract/surfaces.mjs (+73 -0)
➕ tools/app-surface-contract/validation-app-0.2.2.json (+78 -0)
➕ tools/app-surface-contract/validation-app-0.2.2.md (+77 -0)

📄 Description

Problem and result

Optional Tray and Web companions can drift from the official App when they maintain separate catalogs or replace bundled frontend files. This opt-in offline helper reads official capability metadata, exports byte-identical Web assets and verifies the candidate against a fresh App/Control source identity.

The earlier helper rejected official App 0.2.2 before reading metadata. This follow-up explicitly validates App 0.2.1 and 0.2.2 and reports the inspected version in surface.appVersion. Unknown versions and changed interfaces still return needs_validation.

Scope discussion: #3531. Maintainer scope agreement remains pending. Tray #3365 and Local Model Extension #3373/#3369 remain separate. This tool does not add private account, deployment or Codex synchronization code to Strata.

Approach

All changes remain under tools/app-surface-contract/, based on main 9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4. Product source, startup, dependencies, defaults, installer and updater are unchanged.

  • Read the trusted installed Host's own Control resolver, selected bundled Python, read-only strata_models and NATIVE_FIELDS. Nested allowlists exclude private configuration, paths, commands, credentials and unknown fields.
  • Validate reviewed route/method/owner-call anchors for 14 ownership areas before importing metadata modules. App 0.2.1 and 0.2.2 use the same reviewed anchors; the surface records the actual inspected App version. These descriptors remain source-anchors-only, not a complete API schema or live API validation.
  • Export exclusively into a new directory outside the App. Verification requires a pinned manifest, complete asset inventory and fresh App/Control source identity. Links, traversal, extra files, changed bytes and source drift remain rejected.
  • Preserve native ownership and state boundaries described in Consuming The Contract. Reasoning Effort and installation stay with official Composer/App/Control.

Examples

These unchanged anonymous simulated examples use official App 0.2.1 assets and an explicitly invoked read-only loopback fixture. They do not depict App 0.2.2 rendering, inference or performance. All mutations, including Chat, return 501.

Official Context Choices

Official Composer Effort

Validation

Submitted follow-up: a251782251f686602e84ae7299f99168729269ab, Windows x64, Node v24.18.0. Commands omit the local windowless runner. App 0.2.2 acceptance report and sanitized source/hash receipt.

Passed:

  • node --test tools/app-surface-contract/contract.test.mjs tools/app-surface-contract/assets.test.mjs: 19 passed, 0 failed, 0 skipped. Covers App 0.2.2 snapshot/export/fresh verification, version identity, route/method/owner-anchor mutations on both versions, unknown-version rejection, privacy, source/Control/Python drift, inventory integrity and no overwrite.
  • Actual installed official App 0.2.2 / selected Control 0.1.47: CLI snapshot and inspectApp/readCapabilities, exportCandidate, fresh inspection and verifyCandidate passed. 75 official frontend files verified byte-for-byte; all 14 ownership areas accepted. App and surface both reported 0.2.2.
  • Preserved SHA256 for 184 Host files, 3 selected Control files and 4 existing private configuration files. No private paths, raw configuration or hardware catalog is published. Source fingerprint and manifest pin are recorded in the receipt.
  • git diff --check passed. git diff 9de04cd4 -- . ':!tools/app-surface-contract' is empty; default product files remain byte-identical to the recorded base. Local Markdown links, recorded source hashes and evidence privacy checks passed.

Failed:

The new App 0.2.2 regression and actual installed CLI snapshot first reproduced official_app_version_needs_validation. Both pass with this change. No unresolved failure remains in the listed local checks.

Not run:

Real model download/load/inference, GPU allocation, Idle timing, App install/update/reboot, native Tray interaction, App 0.2.2 browser/rendering acceptance or production Web deployment. macOS/Linux installed-App acceptance and process-timeout termination remain unverified. No engine backend source is changed, so no CUDA/HIP/SYCL/Metal build was run.

Upstream Actions are reported separately. The previous Title area run was action_required; it executed no test jobs and is not counted as a local or CI test pass.

Limits

The explicit support list is App 0.2.1 and 0.2.2. String anchors and source identity do not prove all API payloads, permissions, UI layouts, model residency, effective Context, client adoption or private bridge correctness. Checksums identify the trusted installation; they do not replace vendor signatures. There is no automatic updater, polling worker or deployment activation.

Maintainer scope input remains requested in #3531. No acceptance of the separate companion proposals or future App versions is assumed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3532 **Author:** [@medking82](https://github.com/medking82) **Created:** 10/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/app-surface-contract-20261021` --- ### 📝 Commits (3) - [`e53b903`](https://github.com/Niko1221/Strata/commit/e53b903456c4f7fe82e356dcd335b5feeb25a446) [GUI] Add opt-in App surface contract export and verification - [`8932fa9`](https://github.com/Niko1221/Strata/commit/8932fa9c08b748f8378eb90af5d4dd34d153e6a9) Expand reviewed App surface ownership and consumption guidance - [`a251782`](https://github.com/Niko1221/Strata/commit/a251782251f686602e84ae7299f99168729269ab) Validate App Surface Contracts On 0.2.2 ### 📊 Changes **14 files changed** (+1345 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/app-surface-contract/.gitignore` (+2 -0) ➕ `tools/app-surface-contract/CONSUMING.md` (+82 -0) ➕ `tools/app-surface-contract/README.md` (+143 -0) ➕ `tools/app-surface-contract/assets.mjs` (+138 -0) ➕ `tools/app-surface-contract/assets.test.mjs` (+93 -0) ➕ `tools/app-surface-contract/cli.mjs` (+32 -0) ➕ `tools/app-surface-contract/contract.mjs` (+259 -0) ➕ `tools/app-surface-contract/contract.test.mjs` (+300 -0) ➕ `tools/app-surface-contract/examples/context.jpg` (+0 -0) ➕ `tools/app-surface-contract/examples/effort.jpg` (+0 -0) ➕ `tools/app-surface-contract/examples/fixture.mjs` (+68 -0) ➕ `tools/app-surface-contract/surfaces.mjs` (+73 -0) ➕ `tools/app-surface-contract/validation-app-0.2.2.json` (+78 -0) ➕ `tools/app-surface-contract/validation-app-0.2.2.md` (+77 -0) </details> ### 📄 Description ## Problem and result Optional Tray and Web companions can drift from the official App when they maintain separate catalogs or replace bundled frontend files. This opt-in offline helper reads official capability metadata, exports byte-identical Web assets and verifies the candidate against a fresh App/Control source identity. The earlier helper rejected official App 0.2.2 before reading metadata. This follow-up explicitly validates App 0.2.1 and 0.2.2 and reports the inspected version in `surface.appVersion`. Unknown versions and changed interfaces still return `needs_validation`. ## Related discussion Scope discussion: #3531. **Maintainer scope agreement remains pending.** Tray #3365 and Local Model Extension #3373/#3369 remain separate. This tool does not add private account, deployment or Codex synchronization code to Strata. ## Approach All changes remain under `tools/app-surface-contract/`, based on main `9de04cd44e927a9a3df6bbc0e94fc1be8b844ba4`. Product source, startup, dependencies, defaults, installer and updater are unchanged. - Read the trusted installed Host's own Control resolver, selected bundled Python, read-only `strata_models` and `NATIVE_FIELDS`. Nested allowlists exclude private configuration, paths, commands, credentials and unknown fields. - Validate reviewed route/method/owner-call anchors for 14 ownership areas before importing metadata modules. App 0.2.1 and 0.2.2 use the same reviewed anchors; the surface records the actual inspected App version. These descriptors remain `source-anchors-only`, not a complete API schema or live API validation. - Export exclusively into a new directory outside the App. Verification requires a pinned manifest, complete asset inventory and fresh App/Control source identity. Links, traversal, extra files, changed bytes and source drift remain rejected. - Preserve native ownership and state boundaries described in [Consuming The Contract](https://github.com/medking82/Strata/blob/a251782251f686602e84ae7299f99168729269ab/tools/app-surface-contract/CONSUMING.md). Reasoning Effort and installation stay with official Composer/App/Control. ## Examples These unchanged anonymous simulated examples use official App **0.2.1** assets and an explicitly invoked read-only loopback fixture. They do not depict App 0.2.2 rendering, inference or performance. All mutations, including Chat, return 501. ![Official Context Choices](https://raw.githubusercontent.com/medking82/Strata/e53b903456c4f7fe82e356dcd335b5feeb25a446/tools/app-surface-contract/examples/context.jpg) ![Official Composer Effort](https://raw.githubusercontent.com/medking82/Strata/e53b903456c4f7fe82e356dcd335b5feeb25a446/tools/app-surface-contract/examples/effort.jpg) ## Validation Submitted follow-up: `a251782251f686602e84ae7299f99168729269ab`, Windows x64, Node v24.18.0. Commands omit the local windowless runner. [App 0.2.2 acceptance report](https://github.com/medking82/Strata/blob/a251782251f686602e84ae7299f99168729269ab/tools/app-surface-contract/validation-app-0.2.2.md) and [sanitized source/hash receipt](https://github.com/medking82/Strata/blob/a251782251f686602e84ae7299f99168729269ab/tools/app-surface-contract/validation-app-0.2.2.json). **Passed:** - `node --test tools/app-surface-contract/contract.test.mjs tools/app-surface-contract/assets.test.mjs`: **19 passed, 0 failed, 0 skipped**. Covers App 0.2.2 snapshot/export/fresh verification, version identity, route/method/owner-anchor mutations on both versions, unknown-version rejection, privacy, source/Control/Python drift, inventory integrity and no overwrite. - Actual installed official **App 0.2.2 / selected Control 0.1.47**: CLI snapshot and `inspectApp`/`readCapabilities`, `exportCandidate`, fresh inspection and `verifyCandidate` passed. **75 official frontend files** verified byte-for-byte; all **14 ownership areas** accepted. App and surface both reported 0.2.2. - Preserved SHA256 for **184 Host files, 3 selected Control files and 4 existing private configuration files**. No private paths, raw configuration or hardware catalog is published. Source fingerprint and manifest pin are recorded in the receipt. - `git diff --check` passed. `git diff 9de04cd4 -- . ':!tools/app-surface-contract'` is empty; default product files remain byte-identical to the recorded base. Local Markdown links, recorded source hashes and evidence privacy checks passed. **Failed:** The new App 0.2.2 regression and actual installed CLI snapshot first reproduced `official_app_version_needs_validation`. Both pass with this change. No unresolved failure remains in the listed local checks. **Not run:** Real model download/load/inference, GPU allocation, Idle timing, App install/update/reboot, native Tray interaction, App 0.2.2 browser/rendering acceptance or production Web deployment. macOS/Linux installed-App acceptance and process-timeout termination remain unverified. No engine backend source is changed, so no CUDA/HIP/SYCL/Metal build was run. Upstream Actions are reported separately. The previous `Title area` run was `action_required`; it executed no test jobs and is not counted as a local or CI test pass. ## Limits The explicit support list is App 0.2.1 and 0.2.2. String anchors and source identity do not prove all API payloads, permissions, UI layouts, model residency, effective Context, client adoption or private bridge correctness. Checksums identify the trusted installation; they do not replace vendor signatures. There is no automatic updater, polling worker or deployment activation. Maintainer scope input remains requested in #3531. No acceptance of the separate companion proposals or future App versions is assumed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4671
No description provided.