Skip to content

Commit 88f6b39

Browse files
committed
feat: scope browser tooling to workspace temporary storage
1 parent 0835284 commit 88f6b39

15 files changed

Lines changed: 376 additions & 41 deletions

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ jobs:
4242
- run: npm ci
4343
- run: npm run build
4444
- run: npx playwright install --with-deps chromium
45+
- run: npm run browser:doctor
4546
- run: npm run test:ui
4647
- uses: actions/upload-artifact@v7
4748
if: failure()
4849
with:
4950
name: browser-failures
50-
path: runtime/browser-results
51+
path: |
52+
runtime/browser-results
53+
.cache/verification/latest-browser.json
54+
include-hidden-files: true
5155
retention-days: 7
5256
if-no-files-found: ignore
5357
dependency-audit:

‎docs/CONTEXT.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ and external AI CLIs require a direct user request. Never merge old work implici
8282
- Existing Commons run 49092854-f9bd-4b7a-8d12-4ac5ea0e5f70 retains the approved,
8383
unmerged safe-timer change from job 811bdb98-bcbb-4b65-80b9-f19693aef6b4.
8484
Preserve it. 29 earlier lab experiments were verified before this release work.
85-
- Public source: antropos17/commit-zero at ae6569b; all three CI jobs passed after Commons retry repair. Preserve separate histories.
85+
- Public source: antropos17/commit-zero at 0835284; all three CI jobs passed after account recovery. Preserve separate histories.
8686
README GIF is a 15.8s condensed walkthrough of retained Sequence Kit work,
8787
not a continuous live recording. Static fallback included; desktop/mobile and all
8888
three CI jobs passed. Evidence: runtime/verification/github-readme-gif-2026-10-19.json.

‎docs/DEVELOPMENT.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
Append `-- --plan` to any suite to inspect its exact commands without running them.
3232
Area maps also list Playwright `.spec.mjs` files for navigation; area checks run
3333
only Node `.test.mjs` files. Run `npm run test:ui` for real browser coverage.
34+
`npm run browser:doctor` checks the configured Chromium executable, opens a
35+
fresh blank page, verifies its temporary profile is inside `.cache/tmp`, closes
36+
it and checks profile removal. It reports no application or sandbox qualification.
37+
No browser is downloaded automatically. The mutable report is
38+
`.cache/verification/latest-browser.json`; preserve an immutable copy when needed.
3439
`npm run benchmark:ui -- --history 1000 --samples 5` measures a labelled read-only
3540
chat fixture in cold browser contexts after `npm run build`. Use the same browser,
3641
viewport and parameters for comparison; it never opens a retained user store.
@@ -85,7 +90,12 @@ output under `.cache/tmp`. Child processes receive TEMP/TMP/TMPDIR explicitly.
8590
normal 180-request/minute API limiter active. `scripts/test-ui.mjs`
8691
checks that each browser spec is listed exactly once. Playwright global setup
8792
awaits child-service shutdown after each group; the production limit is not
88-
changed. Run a focused spec with `npx playwright test tests/browser/<name>.spec.mjs`.
93+
changed. Run a focused spec with
94+
`npm run test:browser -- tests/browser/<name>.spec.mjs` (and optional `--grep`).
95+
The runner applies workspace `TEMP`, `TMP` and `TMPDIR` before importing
96+
Playwright or starting children. Capture and benchmark helpers use the same
97+
setup. These process-local paths are ordinary same-user storage, not isolation.
98+
Existing files, symlinks or junctions at `.cache`/`.cache/tmp` are rejected.
8999
Recovery fixtures wait for the actual failed request to settle before retrying.
90100
The initial Commons retry test pauses polling with Playwright's clock and holds
91101
the retry response until busy/disabled assertions pass. Resume its clock before

‎docs/DISTRIBUTION.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ announcement posted elsewhere.
9494
Before publishing a release, replace the candidate version with an actual tag,
9595
link its exact commit and CI run, re-run the documented gates, and record real
9696
browser/model/sandbox coverage separately. No release was created by this note.
97-
Current implemented-code checkpoint: public `ae6569b`, [CI run 39220678511](https://github.com/antropos17/commit-zero/actions/runs/39220678511)
98-
passed the full gate, Chromium and runtime dependency audit after the Commons
99-
retry repair. Local frozen gate at `3bfcc8d` passed 72/72 Node tests, DOM/axe 2/2,
97+
Current implemented-code checkpoint: public `0835284`, [CI run 39222123250](https://github.com/antropos17/commit-zero/actions/runs/39222123250)
98+
passed the full gate, Chromium and runtime dependency audit after account
99+
recovery. Local frozen gate at `b027fab` passed 72/72 Node tests, DOM/axe 2/2,
100100
build and serving with source hash
101-
`26cf7d425e0bc517e4e67b52aa530f315823736ffc268f940052dd7474f47c73`;
102-
separate local Chrome coverage passed 12/12. The account-recovery addition awaits
103-
its full gate. Verify the final candidate revision before creating a release.
101+
`18a10d49f2f726f5005289d035fe01d558b70fa72f8cc55e81996a26d404b3b4`;
102+
separate local Chrome coverage passed 15/15. Browser tooling changes await
103+
their full gate. Verify the final candidate revision before creating a release.
104104
The checked capture set is already published at `98389bd`.
105105

106106
## Show HN fact sheet for a human author

‎docs/ECOSYSTEM-DECISIONS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ No substitute model is inferred from a familiar display name.
5353
| Generated-code execution | Docker daemon remains unavailable. Keep the digest/mount/resource plan source-tested and the product blocked. [Setup path and unverified properties](SANDBOX-ADAPTER.md). |
5454
| Collaboration failure/recovery | Seeded actors exercise actual HTTP contracts in disposable stores. [Commands, seeds and limits](SIMULATIONS.md). |
5555
| Browser/workflow feedback | Use real Chrome, scoped fixtures and frozen full gates; preserve the production limiter. [Comparable measurements and limits](WORKFLOW-MEASUREMENTS.md). |
56+
| Browser startup and temporary files | Reuse installed Playwright 1.64.1, apply workspace temporary variables before import/spawn, and inspect/remove a fresh Chrome profile in a separate readiness probe. [Primary launch reference, baseline and actual receipt](WORKFLOW-MEASUREMENTS.md#browser-temporary-paths-and-readiness). No new dependency or sandbox is introduced. |
5657
| Open-source distribution | Prepare real captures and channel-specific material, respect channel restrictions, and publish only source/docs. [Rules, drafts and assets](DISTRIBUTION.md). |

‎docs/HANDOFF-2026-10-19.md‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ tracks dated decisions and receipts; this file is the operational entry point.
88
## Repositories and state
99

1010
- Working repository: `X:\ai-github`, branch `codex/development-foundation`,
11-
latest fully checked local commit `3bfcc8d` at this checkpoint. The local data and model
11+
latest fully checked local commit `b027fab` at this checkpoint. The local data and model
1212
installation are here. Recheck status before acting; this file can age.
1313
- Public repository: [antropos17/commit-zero](https://github.com/antropos17/commit-zero),
14-
`main` at `ae6569ba672dfed53cefe8967aa516764473feae` after a normal push.
14+
`main` at `083528425ab1dcb32418bc993715e870f3ee68c7` after a normal push.
1515
Its separate checkout is `.cache/publication`. The histories are unrelated;
16-
the public tree matches local `3bfcc8d` (`46b22e1534ce4a2a2c520dc973e256e054f52f5e`).
17-
An account saved-list recovery/session-race unit is currently awaiting final gates.
16+
the public tree matches local `b027fab` (`597e18872e2d6d9853ac81e8560b046a40d37780`).
17+
A browser temporary-directory/readiness unit is currently awaiting final gates.
1818
Do not merge histories, reset the local branch or force push. Recheck remote
1919
before publishing anything else.
20-
- Public CI [run 39220678511](https://github.com/antropos17/commit-zero/actions/runs/39220678511)
21-
passed full gate, Chromium and runtime dependency audit for `ae6569b`. The
20+
- Public CI [run 39222123250](https://github.com/antropos17/commit-zero/actions/runs/39222123250)
21+
passed full gate, Chromium and runtime dependency audit for `0835284`. The
2222
preceding retry-fixture failure at `5f9f88e` is preserved in the mission log.
2323
- This mission has not run local or hosted model inference, spawned product
2424
agents, submitted promotional posts or created a new release. Prior retained
@@ -101,20 +101,22 @@ Timer proposal from job `811bdb98-bcbb-4b65-80b9-f19693aef6b4`. Preserve it.
101101

102102
## Evidence and limits
103103

104-
The pending account unit separates successful authentication from saved-list
104+
The account unit separates successful authentication from saved-list
105105
loading. `AccountProvider` scopes reads to the active identity and invalidates
106106
older reads after a bookmark write. `MyProfile` has known/loading/error states
107107
and explicit Refresh, with keyboard focus restored only if the user has not
108108
chosen another control. Three focused Chrome tests passed, including a held
109109
prior-account response. [Actual failure capture](media/account-unavailable-2026-10-19.png).
110-
Grouped Chrome passed 15/15 and `check:identity` passed 10/10; the frozen full
111-
gate remains before this unit is committed.
110+
Grouped Chrome passed 15/15, `check:identity` passed 10/10 and the frozen full
111+
gate passed before that unit was committed. Browser tooling now has shared
112+
temporary setup and a separate `browser:doctor`; its grouped Chrome 15/15 passed,
113+
with the frozen full gate and hosted browser-health evidence still pending.
112114

113-
- Latest local frozen full gate at `3bfcc8d`: 72/72 Node tests, compiled DOM/axe
115+
- Latest local frozen full gate at `b027fab`: 72/72 Node tests, compiled DOM/axe
114116
2/2, build and static serving passed. Stable source hash
115-
`26cf7d425e0bc517e4e67b52aa530f315823736ffc268f940052dd7474f47c73`;
116-
receipt `runtime/verification/commons-retry-full-2026-10-19.json` (ignored by Git).
117-
- Installed Chrome browser suite passed 12/12 at desktop and 390px. Real captures
117+
`18a10d49f2f726f5005289d035fe01d558b70fa72f8cc55e81996a26d404b3b4`;
118+
receipt `runtime/verification/account-recovery-full-2026-10-19.json` (ignored by Git).
119+
- Installed Chrome browser suite passed 15/15 at desktop and 390px. Real captures
118120
are `runtime/verification/commons-first-run-{desktop,narrow}-2026-10-19.png`,
119121
`commons-provider-offline-desktop-2026-10-19.png` and catalog captures. Tests
120122
used in-memory services; provider-health responses were controlled in the
@@ -181,7 +183,7 @@ gate remains before this unit is committed.
181183

182184
## Next work, in order
183185

184-
1. Complete account recovery: run grouped Chrome and `npm run check` on frozen source,
186+
1. Complete browser runtime tooling: run grouped Chrome and `npm run check` on frozen source,
185187
commit it, copy the unpublished local commit into the separate public
186188
checkout, compare Git trees, push without force and inspect public CI.
187189
Record exact SHA and receipt.
@@ -214,7 +216,7 @@ gate remains before this unit is committed.
214216
> `docs/HANDOFF-2026-10-19.md`, and `docs/MISSION-2026-10-19.md`. Recheck Git
215217
> state and `npm run doctor`; use `npm run map -- <area>`. Preserve all runtime
216218
> data, credentials, earlier model receipts, and separate Git histories.
217-
> First confirm public CI for `ae6569b` and complete any dirty account recovery or
219+
> First confirm public CI for `0835284` and complete any dirty browser runtime or
218220
> handoff unit. Then reproduce and improve one
219221
> concrete browser or transaction journey, using focused checks and the full
220222
> `npm run check` on frozen source. Keep model-backed catalog roles disabled;

‎docs/MISSION-2026-10-19.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Start: 03:46:17 UTC. Deadline: 15:46:17 UTC. Final integration reserve begins 14
1212

1313
## Current action
1414

15-
Finish account saved-list recovery and stale-response guards. Registration, keyboard refresh and two held-response races pass in Chrome; run grouped browser and frozen full gates, then publish through the existing separate checkout. Keep all new profiles disabled. The final integration reserve still begins at 14:16:17 UTC.
15+
Finish browser temporary-directory/readiness tooling. Actual Chrome profile containment/cleanup, missing executable, redirected-path fixtures and capture/benchmark entrypoints passed; run grouped Chrome and the frozen full gate, then publish. Keep all new profiles disabled. The final integration reserve still begins at 14:16:17 UTC.
1616

1717
## Decisions and limits
1818

@@ -79,6 +79,9 @@ Finish account saved-list recovery and stale-response guards. Registration, keyb
7979
- 08:08 UTC: Commons retry committed locally as `3bfcc8d` after full gate 72/72, stable source hash `26cf7d425e0bc517e4e67b52aa530f315823736ffc268f940052dd7474f47c73`; receipt `runtime/verification/commons-retry-full-2026-10-19.json`. Normal publication produced `ae6569b` with identical tree `46b22e1534ce4a2a2c520dc973e256e054f52f5e`. [CI run 39220678511](https://github.com/antropos17/commit-zero/actions/runs/39220678511) passed all three jobs, including the formerly failing retry browser fixture.
8080
- 08:13 UTC: real Chrome reproduced registration HTTP 200 followed by saved-list HTTP 503 leaving the signup page without a visible error; baseline trace is under `runtime/verification/account-recovery-baseline-2026-10-19`. Authentication now completes independently of the optional list. The profile distinguishes unknown/loading/failed/known lists and has explicit Refresh. Generation and owner guards reject delayed reads after a bookmark write or session change. Three focused Chrome tests passed, including keyboard focus recovery and preserving a different focus choice while pending. Focused UI passed DOM/axe 2/2, build and serving. Final grouped/browser and full gates remain; retained account stores are untouched.
8181

82+
- 08:20 UTC: account recovery committed locally as `b027fab` after full gate 72/72, stable source hash `18a10d49f2f726f5005289d035fe01d558b70fa72f8cc55e81996a26d404b3b4`; receipt `runtime/verification/account-recovery-full-2026-10-19.json`. Normal publication produced `0835284` with identical tree `597e18872e2d6d9853ac81e8560b046a40d37780`. [CI run 39222123250](https://github.com/antropos17/commit-zero/actions/runs/39222123250) passed all three jobs. Actual account error capture matches its runtime PNG by SHA-256 `63479869`.
83+
- 08:28 UTC: read-only baseline found Node's default temporary directory outside the workspace. New shared setup configures browser runners/capture/benchmark before import or child creation. Two host tests passed file/junction denial and caller-environment preservation, with no skips. Actual `browser:doctor` opened Chrome 155, observed its profile inside `.cache/tmp`, closed it and confirmed removal; a missing executable reported blocked. The first CDP attempt failed because Chrome required `--enable-automation`; the corrected probe passed, and both receipts are retained. `test:browser` passed account recovery 3/3; `check:tooling` passed 10/10. Launch capture and an 80-message/one-sample benchmark both exited cleanly; this is integration evidence, not a new speed comparison. [Details](WORKFLOW-MEASUREMENTS.md#browser-temporary-paths-and-readiness). Full grouped browser and frozen gates remain.
84+
8285
## Next checkpoint
8386

84-
Account recovery passed identity 10/10 and all 15 grouped Chrome tests. Run the frozen full gate, commit and publish, then measure and address workspace temporary-output handling in browser tools. Keep the final 90-minute reserve from 14:16:17 UTC.
87+
All 15 grouped Chrome tests passed through the workspace-temporary runner, and the added redirected-temp junction case passed without skips. Run the frozen full gate and final browser probe, commit and publish; then consolidate a reproducible source/publication/evidence preflight from the repeated manual release checks. Keep the final 90-minute reserve from 14:16:17 UTC.

‎docs/WORKFLOW-MEASUREMENTS.md‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,38 @@ or normal user database write was part of these measurements.
66

77
## Feedback loop
88

9+
### Browser temporary paths and readiness
10+
11+
Before the browser-runtime change, a read-only Node check returned
12+
`C:\Users\murtu\AppData\Local\Temp`. Installed Playwright 1.64.1 source uses
13+
`os.tmpdir()` for temporary profiles/artifacts; the old browser entrypoints did
14+
not set workspace variables. No baseline browser was launched for this check.
15+
Receipt: `runtime/verification/browser-temp-baseline-2026-10-19.json` includes
16+
the installed bundle digest and baseline local commit `b027fab`.
17+
18+
Decision: share process-local `TEMP`/`TMP`/`TMPDIR` setup before Playwright import
19+
or child creation. The [Playwright launch reference](https://playwright.dev/docs/api/class-browsertype#browser-type-launch),
20+
accessed 2026-10-19, documents temporary artifact/download cleanup after browser
21+
closure. `browser:doctor` checks the actual profile path through CDP rather than
22+
inferring it solely from those settings. This probe uses `--enable-automation`
23+
because the installed Chrome otherwise rejects command-line inspection.
24+
25+
One actual Chrome 155.0.8059.80 probe took 1,196 ms, opened only `about:blank`,
26+
observed a profile inside `X:\ai-github\.cache\tmp`, and confirmed removal after
27+
close. A missing-executable probe reported `blocked`; the first CDP attempt
28+
reported `failed` without claiming cleanup verification. Receipts are
29+
`runtime/verification/browser-doctor-{missing,cdp-baseline,profile}-2026-10-19.json`.
30+
This single observation is not a startup speedup or application acceptance test.
31+
No global Windows setting, existing browser profile or model was changed.
32+
33+
`test:browser` passed the three account recovery journeys through the new runner.
34+
Launch capture and an 80-message/one-sample UI benchmark also exited successfully;
35+
their integration receipts are `browser-temp-{launch,benchmark}-2026-10-19.json`
36+
under `runtime/verification`. That small benchmark is not a new timing comparison.
37+
The profile/path checks establish ordinary tool hygiene, not a security boundary.
38+
39+
### Earlier feedback measurements
40+
941
| Command | Observed samples | What it covers |
1042
| --- | --- | --- |
1143
| `npm run check:fast` | One current run: lint 689 ms, repository 95 ms, pure tests 1,334 ms (9/9) | Useful for quick pure-code feedback; excludes databases, build, DOM and serving. Not acceptance. |

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"db:verify-snapshot": "node scripts/store-snapshot.mjs verify",
2828
"diagnostics": "node scripts/diagnostics.mjs",
2929
"test:ui": "node scripts/test-ui.mjs",
30+
"test:browser": "node scripts/browser-runtime.mjs test",
31+
"browser:doctor": "node scripts/browser-runtime.mjs doctor",
3032
"test:dom": "node --test tests/interface.dom.mjs",
3133
"test:serve": "node scripts/smoke-build.mjs",
3234
"test:services": "node --test tests/services.test.mjs",

‎scripts/benchmark-ui.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
22
import { mkdir, readFile, writeFile } from "node:fs/promises";
33
import { performance } from "node:perf_hooks";
44
import { parseArgs } from "node:util";
5-
import { chromium } from "@playwright/test";
5+
import { browserTools } from "./browser-runtime.mjs";
66
import { startServices } from "./services.mjs";
77
import { fingerprint } from "./project-files.mjs";
88

@@ -17,6 +17,7 @@ if (!Number.isInteger(history) || history < 1 || history > 5000 ||
1717

1818
// A routed, read-only browser fixture measures client rendering, not storage or
1919
// provider throughput. Every service uses disposable in-memory databases.
20+
const { chromium } = await browserTools();
2021
const cluster = await startServices({ memory: true, staticRoot: "dist",
2122
ports: { gateway: 0, workspace: 0, identity: 0, ranking: 0 } });
2223
let browser;

0 commit comments

Comments
 (0)