harden runtime packaging and verification

This commit is contained in:
Sinabina
2026-07-17 12:09:49 -07:00
parent 20d2840bd3
commit d7357c288f
36 changed files with 801 additions and 265 deletions
+4 -2
View File
@@ -123,8 +123,10 @@ operations are setup, doctor, config, state
inspection/resume, Context.dev status/options/select/setup/smoke, cleanup,
upgrade/rollback, and uninstall.
The current managed-bundle audit records 107 components, 1,830 files,
459,056,031 bytes, and 50 launchers. Setup installs frozen production-only
The deterministic clean macOS arm64 managed-bundle audit records 110
components, 1,829 files, 450,044,315 bytes, and 50 capability launchers. This
is a platform-specific bundle measurement, not a universal byte count;
platform-native package payloads differ. Setup installs frozen production-only
dependencies; the development-only Claude Agent SDK is excluded. The
Sharp/ngrok dependency closure is included. The Hugging Face sidecar is
excluded and its package is development-only, so setup installs neither its
+15 -11
View File
@@ -138,7 +138,8 @@ checkout, the one host-neutral setup entrypoint is:
~/.gstack/bin/gstack doctor --json
```
`./setup` resolves a symlinked checkout, installs dependencies only when absent,
`./setup` resolves a symlinked checkout, reinstalls the frozen production
dependency set on every run,
builds missing allowlisted capabilities through the runtime-only build target,
validates and hashes every staged file, smoke-tests the CLI, atomically
activates the version, and writes stable POSIX and Windows launchers under
@@ -146,15 +147,18 @@ activates the version, and writes stable POSIX and Windows launchers under
Windows and includes the CoreDevice/iOS bundle only on Darwin. Add the bin
directory to `PATH` if the short `gstack` command is desired.
Twenty-one focused installer tests pass with 307 assertions. They cover
Twenty-four focused installer tests pass with 336 assertions. They cover
manifests, paths with spaces,
source-root symlinks, internal-link/path-escape rejection, failed build/
validation/smoke rollback, interrupted-pointer recovery, stable POSIX/Windows
launchers, runtime-only builder selection, managed uninstall, and the
host-neutral wrapper.
validation/smoke rollback including native-load rollback smoke,
interrupted-pointer recovery, stable POSIX/Windows launchers, runtime-only
builder selection, deterministic exact Sharp/ngrok platform closure, managed
uninstall, and the host-neutral wrapper.
The current managed-bundle audit records 107 components, 1,830 files,
459,056,031 bytes, and 50 launchers. Setup installs frozen production-only
The deterministic clean macOS arm64 managed-bundle audit records 110
components, 1,829 files, 450,044,315 bytes, and 50 capability launchers. This
is a platform-specific bundle measurement, not a universal byte count;
platform-native package payloads differ. Setup installs frozen production-only
dependencies and excludes the development-only Claude Agent SDK. The
Sharp/ngrok closure is included. The Hugging Face sidecar is excluded and its
package is development-only, so setup installs neither its inference runtime
@@ -162,10 +166,10 @@ nor model weights and reports the L4 capability unavailable.
| Platform | Source-level target | Candidate evidence |
|---|---|---|
| macOS | Node runtime + local browser + physical iOS where applicable | Runtime installer 21/307 and current bundle audit pass. The uninterrupted broad singleton run is green at 6,234 pass / 226 expected skips / 0 fail across 383 files. The signed-device gate remains pending. |
| Linux | Node runtime + local browser | Declared Dev Container GStack 2 suite passed at 130/0 with 1,070 assertions across 15 files. A clean Linux arm64 container used production-only install with the development SDK and model runtime absent, passed a local-browser journey and Sharp full-page screenshot, and uninstalled while preserving state. Native-host broad Linux remains pending. |
| Native Windows | Node runtime; curated free tests; browser fallback where retained | **Blocked:** native Windows CI pending. The local Windows-safe singleton lane is green at 2,813 pass / 57 expected skips / 0 fail across 213 files, but it is not native evidence. |
| Dev Container | Pure skills and optional runtime; browser only when container supports it | Declared image builds; generated freshness and the 130-test GStack 2 suite pass, as does the clean runtime install/browser smoke. Full broad Linux coverage remains pending. |
| macOS | Node runtime + local browser + physical iOS where applicable | Runtime installer 24/336 and deterministic clean macOS arm64 bundle audit pass. The uninterrupted broad singleton run is green at 6,240 pass / 226 expected skips / 0 fail across 383 files. The signed-device gate remains pending. |
| Linux | Node runtime + local browser | Declared Dev Container GStack 2 suite passed at 136/0 with 1,127 assertions across 15 files; log: `/tmp/gstack2-devcontainer-gate-candidate-final4.log`. The one-assertion difference from the focused macOS result is the platform-conditional read-only-mode check. A clean Linux arm64 container used production-only install with the development SDK and model runtime absent, passed a local-browser journey and Sharp full-page screenshot, and uninstalled while preserving state. Native-host broad Linux remains pending. |
| Native Windows | Node runtime; curated free tests; browser fallback where retained | **Blocked:** native Windows CI pending. The local Windows-safe singleton lane is green at 2,815 pass / 57 expected skips / 0 fail across 213 files, but it is not native evidence. |
| Dev Container | Pure skills and optional runtime; browser only when container supports it | Declared image builds; generated freshness and the 136-test GStack 2 suite pass, as does the clean runtime install/browser smoke. Full broad Linux coverage remains pending. |
The six portable skills remain useful when runtime installation fails. A
runtime failure must not remove or corrupt their standard-installer placement.
+4 -2
View File
@@ -103,8 +103,10 @@ support the claim and must follow the source system's retention policy.
## Models, images, and documents
The current managed-bundle audit records 107 components, 1,830 files,
459,056,031 bytes, and 50 launchers. Setup installs frozen production-only
The deterministic clean macOS arm64 managed-bundle audit records 110
components, 1,829 files, 450,044,315 bytes, and 50 capability launchers. This
is a platform-specific bundle measurement, not a universal byte count;
platform-native package payloads differ. Setup installs frozen production-only
dependencies. The Sharp/ngrok closure is included; the development-only Claude
Agent SDK is excluded. The Hugging Face sidecar is excluded and its package is
development-only, so setup installs neither its inference runtime nor model
+15 -12
View File
@@ -48,15 +48,18 @@ status.
three retained Claude Haiku live samples are classified `REGRESSION`; they
are preserved as noisy supplemental evidence, never cherry-picked as a
primary gate or represented as green.
- [x] The focused GStack 2 suite is green: 130 pass / 0 fail, 1,071
assertions across 15 files. This focused surface does not substitute for the
broad or native-platform gates.
- [x] The focused macOS GStack 2 suite is green: 136 pass / 0 fail, 1,128
assertions across 15 files. Log: `/tmp/gstack2-test-command-candidate-final2.log`.
This focused surface does not substitute for the broad or native-platform
gates.
- [x] Optional host-neutral runtime implemented with canonical paths,
repo/worktree state identity, locks, atomic writes, effect claims,
doctor/config/state/cleanup, migrations, upgrade/rollback, and uninstall.
- [x] Managed runtime installer coverage is green at 21 pass / 0 fail and 307
assertions. The current managed bundle audit records 107 components, 1,830
files, 459,056,031 bytes, and 50 launchers. Setup installs frozen
- [x] Managed runtime installer coverage is green at 24 pass / 0 fail and 336
assertions. The deterministic clean macOS arm64 managed-bundle audit records
110 components, 1,829 files, 450,044,315 bytes, and 50 capability launchers.
This is a platform-specific bundle measurement, not a universal byte count;
platform-native package payloads differ. Setup installs frozen
production-only dependencies; the development-only Claude Agent SDK is
excluded. The Sharp/ngrok closure is included. The Hugging Face sidecar is
excluded and its package is development-only, so setup installs neither its
@@ -103,10 +106,10 @@ status.
screenshot, status, and stop cleanup. The stop acknowledgement regression
has a 2 pass / 0 fail focused test.
- [x] The uninterrupted macOS broad suite is green under singleton isolation:
6,234 pass / 226 expected skips / 0 fail and 25,392 assertions across all
6,240 pass / 226 expected skips / 0 fail and 25,450 assertions across all
383 files. This includes the complete local-browser suite. The local
Windows-safe singleton lane is also green at 2,813 pass / 57 expected skips
/ 0 fail and 8,562 assertions across all 213 curated files; it is not native
Windows-safe singleton lane is also green at 2,815 pass / 57 expected skips
/ 0 fail and 8,586 assertions across all 213 curated files; it is not native
Windows evidence.
- [x] Architecture, privacy, Context.dev, host compatibility, upgrade/rollback,
migration, and governance documentation added.
@@ -120,8 +123,8 @@ status.
- [ ] Prove runtime-absent judgment behavior through an actual host invocation.
Runtime install failure and the real default capability lifecycle are covered.
- [ ] Complete native Linux and Windows matrices. The uninterrupted macOS
broad singleton run is green at 6,234/226/0 across 383 files, and the local
Windows-safe singleton lane is green at 2,813/57/0 across 213 files. Neither
broad singleton run is green at 6,240/226/0 across 383 files, and the local
Windows-safe singleton lane is green at 2,815/57/0 across 213 files. Neither
substitutes for native execution on its named platform.
- [ ] Integrate the passing complete local-browser suite and live journey into
final cancellation/leak evidence. The production dependency and managed
@@ -158,7 +161,7 @@ status.
| Host matrix | [HOST-COMPATIBILITY.md](./HOST-COMPATIBILITY.md) | 470/470 checks; six hosts Verified at installer layer; live v3/UI launch pending |
| Privacy boundary | [PRIVACY.md](./PRIVACY.md) | Implemented contract; full retained-tool egress audit pending |
| Physical iOS | [IOS-PHYSICAL-DEVICE.md](./IOS-PHYSICAL-DEVICE.md) | Preflight 9 pass / 1 deploy skip / 29 assertions; signing blocked; no app/pass artifact |
| Upgrade/recovery | [UPGRADE-AND-ROLLBACK.md](./UPGRADE-AND-ROLLBACK.md) | Runtime installer 21 pass / 307 assertions; current bundle audit recorded |
| Upgrade/recovery | [UPGRADE-AND-ROLLBACK.md](./UPGRADE-AND-ROLLBACK.md) | Runtime installer 24 pass / 336 assertions; deterministic clean macOS arm64 bundle audit recorded |
## Interpretation rules
+7 -7
View File
@@ -9,7 +9,7 @@ pass from deterministic, offline, or filesystem-only evidence.
| Command / probe | Observed result | What it proves / does not prove |
|---|---|---|
| Focused `bun test test/gstack2-*.test.ts` candidate run | **Exit 0: 130 pass / 0 fail**, 1,071 assertions across 15 files. Log: `/tmp/gstack2-direct-release.log`. | The focused GStack 2 routing/runtime/privacy/installer/upgrade and deterministic parity surface is green. It is not the broad repository or native-platform gate. |
| Focused macOS `bun test test/gstack2-*.test.ts` candidate run | **Exit 0: 136 pass / 0 fail**, 1,128 assertions across 15 files. Log: `/tmp/gstack2-test-command-candidate-final2.log`. | The focused GStack 2 routing/runtime/privacy/installer/upgrade and deterministic parity surface is green. It is not the broad repository or native-platform gate. |
| `bun test --timeout 30000 test/gstack2-skills.test.ts test/gstack2-skills-routing.test.ts` after regeneration | **Exit 0: 3 pass / 0 fail**, 81 assertions. | The pinned corpus/parity test and both 25-scenario structured-routing tests are green. This remains structural/fixture evidence, not specialist live execution. |
| `bun run scripts/gstack2/run-parity.ts`, 2026-07-17 rerun | **Exit 0: 4,681 checks passed**; 55 modules, 16 sections, 25 scenarios, 16 regressions, 78 assets. | Current source/render/provenance/contract/asset/fixture parity is green. It is deterministic parity, not live-host behavior. |
| Earlier regenerated structural parity checkpoint | **Exit 0: 2,403 checks passed** with the then-current 55/16/25/16/45 inventory. | Historical candidate checkpoint before later thin-prelude and asset coverage; superseded by the current 4,681-check rerun. |
@@ -27,18 +27,18 @@ pass from deterministic, offline, or filesystem-only evidence.
| Context.dev contract (`gstack2-runtime-context.test.ts`) | **22 pass / 0 fail**, 139 assertions. | Persists explicit host/local-browser/none choices without consent, rejects private/credential URLs and request material plus private DNS, proves zero lookup/fetch before mode+consent, validates documented endpoint paths and exact failure taxonomy, and makes search typed unsupported without network. |
| `gstack context smoke` | **Not run:** `CONTEXT_DEV_API_KEY` is not configured and no verified account key was available. | Live provider behavior, account verification, and actual credit metadata remain unverified. |
| Standard installer matrix | **PASS: 470/470 checks**, 16 install cases, two removal cases, `skills` CLI 1.5.19. | Project/global installs pass for six hosts, selected-skill and opt-in compatibility-alias cases, copies, and hashes. This remains installer/filesystem evidence. Committed artifact: [`evals/installation/install-matrix.json`](../../evals/installation/install-matrix.json). |
| `bun test test/gstack2-runtime-install.test.ts` | **Exit 0: 21 pass / 0 fail**, 307 assertions. | Managed allowlist, hashes, spaces, source/internal-link rejection, production-only frozen dependencies, capability closure, rollback/recovery, stable launchers, wrapper neutrality, and state-preserving uninstall pass. |
| Current managed runtime bundle audit | **107 components, 1,830 files, 459,056,031 bytes, 50 launchers.** | Setup includes the Sharp/ngrok closure and excludes the development-only Claude Agent SDK. The Hugging Face sidecar is outside the bundle and its package is development-only, so production setup installs neither its inference runtime nor model weights; the L4 capability reports unavailable. The standard skill installer remains Markdown-only. |
| Declared Dev Container plus `bun run test:gstack2` inside it | **Exit 0: 130 pass / 0 fail, 1,070 assertions across 15 files.** Log: `/tmp/gstack2-devcontainer-gate-release.log`. | Generated freshness, canonical-skill routing, parity, state, privacy, installer, recovery, and runtime behavior are green in the declared Linux container. The one-assertion difference from macOS is the platform-conditional read-only-mode check. This is not a native-host broad Linux run. |
| `bun test test/gstack2-runtime-install.test.ts` | **Exit 0: 24 pass / 0 fail**, 336 assertions. | Managed allowlist, hashes, spaces, source/internal-link rejection, production-only frozen dependencies, deterministic exact Sharp/ngrok platform closure, native-load rollback smoke, rollback/recovery, stable launchers, wrapper neutrality, and state-preserving uninstall pass. |
| Deterministic clean macOS arm64 managed runtime bundle audit | **110 components, 1,829 files, 450,044,315 bytes, 50 capability launchers.** | This is a platform-specific bundle measurement, not a universal byte count; platform-native package payloads differ. Setup includes the Sharp/ngrok closure and excludes the development-only Claude Agent SDK. The Hugging Face sidecar is outside the bundle and its package is development-only, so production setup installs neither its inference runtime nor model weights; the L4 capability reports unavailable. The standard skill installer remains Markdown-only. Committed artifact: [`evals/runtime-bundle/darwin-arm64.json`](../../evals/runtime-bundle/darwin-arm64.json); reproduce with `bun run scripts/gstack2/audit-runtime-bundle.ts --output evals/runtime-bundle/darwin-arm64.json`. |
| Declared Linux Dev Container plus `bun run test:gstack2` inside it | **Exit 0: 136 pass / 0 fail, 1,127 assertions across 15 files.** Log: `/tmp/gstack2-devcontainer-gate-candidate-final4.log`. | Generated freshness, canonical-skill routing, parity, state, privacy, installer, recovery, and runtime behavior are green in the declared Linux container. The one-assertion difference from macOS is the platform-conditional read-only-mode check. This is not a native-host broad Linux run. |
| `scripts/gstack2/runtime-install-smoke.sh` in the clean Linux arm64 container | **Pass:** production-only frozen dependencies installed with the development Agent SDK and Hugging Face/ONNX runtime absent; the managed Anthropic SDK, Sharp, and ngrok imports passed; prebuilt capabilities rebuilt; setup/doctor/version/design/PDF passed; a local-browser journey and Sharp full-page screenshot passed; uninstall preserved state. | Proves a source copy with spaces can build and complete the managed runtime lifecycle without Git history, an executable local-model stack, or Darwin-only iOS artifacts. It is not native Windows evidence. |
| Runtime lifecycle and external-effect matrix | **Pass:** real filesystem/subprocess tests cover clean install/uninstall, paths with spaces, source symlinks and internal-link rejection, macOS read-only reporting, interrupted-pointer rollback, crash-journal repair, last-known-good launcher recovery, and an actual local Git push that executes at most once across resume. | Closes the named local filesystem/recovery/idempotency gates. The aggregate live cancellation/leak gate remains open. |
| `bun test design/test` | **101 pass / 0 fail**, 381 assertions. | The retained design suite is green and is also included in the later uninterrupted broad pass. |
| `bun test make-pdf/test` plus combined-fixture render | **189 pass / 0 fail, 398 assertions;** four PDF pages rendered to PNG and visually inspected with no detected layout defect. | Retained strict PDF tests and a live internal render are green on this macOS host. Cross-platform visual equivalence remains a separate platform claim. |
| Diagram suites | **51 pass / 0 fail / 1 skip**, 120 assertions; the opt-in paid lane recorded two skips. | Offline Mermaid/SVG/PNG/Excalidraw coverage is green. Skipped paid-provider cases are not live evidence. |
| Isolated local-browser journey plus stop regression | Navigation, snapshot, screenshot, and status passed; stop returned success and left no observed process leak. `browse/test/stop-ack-before-shutdown.test.ts` is **2 pass / 0 fail**. | Provides one real local Chromium journey and a focused regression for acknowledging stop/restart before delayed shutdown. The complete browser suite is included in the later broad pass. |
| `bun test` through the strict singleton runner | **Exit 0: 6,234 pass / 226 expected skips / 0 fail**, 25,392 assertions; 383/383 shard headers and terminal single-file summaries. Log: `/tmp/gstack2-full-singleton-release2.log`. | One uninterrupted macOS broad pass after the browser lifecycle and retry-harness fixes. Expected skips are provider, credential, Poppler-environment, paid, or model-sidecar gates declared by their tests; external/live evidence remains separate. |
| Local `bun run test:windows` through singleton shards | **Exit 0: 2,813 pass / 57 expected skips / 0 fail**, 8,562 assertions; 213/213 shard headers and terminal single-file summaries. Log: `/tmp/gstack2-windows-singleton-release2.log`. | The curated Windows-safe subset is locally green under singleton isolation. This is not native Windows execution; native Windows CI remains blocked. |
| Forbidden production-scope audit | Production dependencies and the 107-component managed bundle contain no cloud-browser provider, Hugging Face/ONNX inference runtime, model weights, or alternative physical-iOS backend. Transformers remains development-only for retained tests; CoreDevice/`devicectl` is the sole physical-iOS path. | Deterministic dependency/bundle/backend evidence. It does not substitute for native-platform, signed-device, or live-provider behavior. |
| `bun test` through the strict singleton runner | **Exit 0: 6,240 pass / 226 expected skips / 0 fail**, 25,450 assertions; 383/383 shard headers and terminal single-file summaries. Log: `/tmp/gstack2-full-singleton-candidate-final.log`. | One uninterrupted macOS broad pass after the browser lifecycle and retry-harness fixes. Expected skips are provider, credential, Poppler-environment, paid, or model-sidecar gates declared by their tests; external/live evidence remains separate. |
| Local `bun run test:windows` through singleton shards | **Exit 0: 2,815 pass / 57 expected skips / 0 fail**, 8,586 assertions; 213/213 shard headers and terminal single-file summaries. Log: `/tmp/gstack2-windows-singleton-candidate-final2.log`. | The curated Windows-safe subset is locally green under singleton isolation. This is not native Windows execution; native Windows CI remains blocked. |
| Forbidden production-scope audit | Production dependencies and the 110-component managed bundle contain no cloud-browser provider, Hugging Face/ONNX inference runtime, model weights, or alternative physical-iOS backend. Transformers remains development-only for retained tests; CoreDevice/`devicectl` is the sole physical-iOS path. | Deterministic dependency/bundle/backend evidence. It does not substitute for native-platform, signed-device, or live-provider behavior. |
### Required final command ledger
+20 -14
View File
@@ -69,17 +69,21 @@ written under `$GSTACK_HOME/bin` (default `~/.gstack/bin`), alongside
`runtime-install.json`, which distinguishes managed paths from preserved
config, secrets, projects, and plans.
Twenty-one focused installer tests pass with 307 assertions. They cover paths
Twenty-four focused installer tests pass with 336 assertions. They cover paths
with spaces, a symlinked source root, internal-link rejection, runtime-only
builder selection, production dependency closure, failed build/validation/
smoke rollback, interrupted recovery, launchers, manifests, wrapper neutrality,
and state-preserving uninstall.
builder selection, deterministic exact Sharp/ngrok platform closure, failed
build/validation/smoke rollback including native-load rollback smoke,
interrupted recovery, launchers, manifests, wrapper neutrality, and
state-preserving uninstall.
The current managed-bundle audit records 107 components, 1,830 files,
459,056,031 bytes, and 50 launchers. The Sharp/ngrok closure is included. The
development-only Claude Agent SDK and Hugging Face sidecar are excluded; the
Hugging Face package is development-only. Setup therefore installs neither its
inference runtime nor model weights and reports the L4 capability unavailable.
The deterministic clean macOS arm64 managed-bundle audit records 110
components, 1,829 files, 450,044,315 bytes, and 50 capability launchers. This
is a platform-specific bundle measurement, not a universal byte count;
platform-native package payloads differ. The Sharp/ngrok closure is included.
The development-only Claude Agent SDK and Hugging Face sidecar are excluded;
the Hugging Face package is development-only. Setup therefore installs neither
its inference runtime nor model weights and reports the L4 capability
unavailable.
A separate clean Linux arm64 container smoke copied the source through a path
with spaces, installed only frozen production dependencies with the development
@@ -189,9 +193,11 @@ newer-schema refusal, and non-mutating cleanup preview. The standard installer
matrix separately passed 470/470 checks across six hosts, 16 installs, scopes,
selections, and two removals; its artifact is
[`evals/installation/install-matrix.json`](../../evals/installation/install-matrix.json).
The runtime installer is green at 21 pass / 0 fail and 307 assertions, and the
current 107-component bundle audit is recorded. The clean Linux Dev Container
install/uninstall smoke passed. Interrupted network acquisition/stage at OS
level, a passing live v3 host run, actual host UI execution, native-host Linux,
and native Windows runs remain gates. See
The runtime installer is green at 24 pass / 0 fail and 336 assertions, and the
deterministic clean macOS arm64 110-component bundle audit is recorded. Its
byte count is platform-specific because platform-native package payloads
differ. The clean Linux Dev Container install/uninstall smoke passed.
Interrupted network acquisition/stage at OS level, a passing live v3 host run,
actual host UI execution, native-host Linux, and native Windows runs remain
gates. See
[TEST-EVIDENCE.md](./TEST-EVIDENCE.md).