Skip to content

CI: retain main-process output and measured host logs - #353

Merged
SSFSKIM merged 15 commits into
masterfrom
e2e-main-stdio-host-log
Oct 29, 2026
Merged

SSFSKIM merged 15 commits into
masterfrom
e2e-main-stdio-host-log

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

The existing red/flaky/requested-evidence upload now has the app's main-process output, and measured uploads retain the engine host's log as well as their samples. Green non-measured jobs still upload nothing new.

What changes

  • Each eligible launchMaws launch retains distinct main-process-<id>.stdout.log and .stderr.log files for its Playwright attempt. Capture attaches as soon as _electron.launch resolves, before waiting for the first window. It adds listeners without replacing the quit specs' or scene hooks' listeners. Relaunches do not overwrite one another. Each stream retains a 256 KiB head plus 256 KiB rolling tail, with the exact dropped-byte count marked; utility extraction works only on those bounded buffers. Raw bytes stay in a mode-0700 per-launch staging directory inside the private profile and are copied into the attempt output only after the final engine-provenance check.
  • Cleanup retains supervisor/host.log and its rotated generation after stopping the profile's processes, before deleting its temporary directory, including failed-launch cleanup. These become engine-host-<id>.log and .previous.log, each with the same bounded head/tail budget. All promoted streams and host logs pass through the shared public-evidence redactor before any public write. Cut boundary-line fragments are omitted so losing a credential prefix cannot defeat redaction. If either host generation already existed at launch, neither is published: a fixed .host-excluded.log marker explains the omission. No profile, credentials, lock or journal is copied.
  • The utility host used by artifacts-perf has no detached log: main forwards its output with [engine-host]. Cleanup extracts just those lines from the already-captured streams into .utility.log; main-only and pty-host lines stay out. Each stream's line order is preserved; this is not a merged timestamped trace.
  • measured-e2e-<slug> now includes test-results/**/*.json, test-results/**/*.jsonl, and test-results/**/engine-host-*.log. The narrow log pattern avoids uploading the main streams, HTML and screenshots on every green measured job. Upload conditions, successful-checkout guards and seven-day retention are unchanged.
  • This also closes two gaps in CI: keep flaky-pass reports and measured e2e samples #346: artifacts-perf already wrote JSONL, which the JSON-only path omitted; tool-time-heavy-live wrote no sample file at all. The heavy guard now saves timing-only JSON after every case, including partial/unanswered calls on a failure, without tool arguments, results or journal payloads. It is a scripted Vitest workload, not a paid engine launch.

Coverage and limits

The shared built, packaged and alternate-root launch branches are covered when their engine is known test-owned: the helper's generated replay stub or a spec's exact explicitly declared synthetic binary. An inherited/explicit unknown override is not trusted merely because its filename or directory looks like a fixture. The local-latency spec declares the wrapper it writes. Effective Settings binaryPath is checked after preparation and again at cleanup, including machine/legacy settings precedence; unreadable, malformed, unsupported or oversized settings reject raw retention. The conservative guard recognizes machine v1, unified v20 and client v21 envelopes; older/future formats are excluded rather than duplicating the full nested product schema. The environment fallback must independently name the same known synthetic binary, so a deeper product-parser rejection still cannot select an unknown fallback. A rejected final check leaves only a fixed engine-host-<id>.excluded.log marker, never the configured path or captured bytes. Initial/final checks do not observe a transient engine switch restored before cleanup; this residual is handled by independently redacting every promoted diagnostic, not by runtime tracking. All measured Playwright groups that launch an engine host go through that helper: artifacts-perf, daemon-idle/baseline/enrolled/aba, local-latency/daemon, dashboard/design/document/presentation scale, document-scale-repeat and presentations-drag. The floor, mawsd-alone and spine-alone groups do not run an engine host. Their existing evidence is unchanged.

Paths deliberately left out:

  • The only spec-local _electron.launch is c12-prerun's explicit owner-store case: the owner's state is not public artifact material.
  • sigusr1.spec.ts uses child_process.spawn to start the built/packaged main app without Playwright's inspector. Its special stdout-ignore/stderr-assertion path is unchanged, not part of generic capture.
  • Live, real-engine, owner-profile and credentialed groups are excluded from generic main/host capture.
  • The custom synthetic overrides in ux2-shell, widgets, sessions-available, two settings cases and one browser-cua case have not yet declared their explicit synthetic-engine opt-in, so capture stays off. sessions.spec.ts's later binaryPath change causes final discard. These are missing diagnostics, not unsafe publication; follow-up can opt each test-owned binary in.

Capture begins when Playwright exposes the process; output before _electron.launch returns, or from a launch that never returns a process, is not promised. The safety cost of private staging is intentional: worker death or job cancellation before finish() promotes nothing, so those runs retain neither main streams nor host output. An ordinary Playwright test timeout still runs fixture teardown and retains its evidence when that cleanup completes.

Public-artifact safety

Main logs startup failures as error objects (src/main/index.ts); the detached host routes console output and stray stdout/stderr to its log, and session failures include upstream error messages. These are not a safe public-log schema for credentialed runs. Rather than claim regex redaction is complete, raw capture is disabled for the workflow's LIVE_E2E, LIVE_GUARD_E2E and MAC_SECRET_E2E lists, with local-run guards for live/prerun/Discover/OAuth scenes and real-engine/owner-profile launch options. The heavy guard's numeric/timestamp/name projection is the deliberate exception: it starts no real engine and exports no payloads.

The audit did not establish that a credential has already escaped. It found a pre-existing exposure path in p1-live's stderr sitting notes, which the architect asked to close in this PR. The separate redaction commit shares the journal export redactor with sitting notes and their console echo, adding bearer-token recognition alongside known environment secrets, provider keys and non-fixture emails. Known secrets are matched in raw and JSON-escaped forms, longest-first, and serialized Bearer whitespace is recognized too. The 300-character cut is retained after redaction with the child environment, so truncating an environment credential cannot leak its prefix.

Live stderr/public-output inventory:

  • e2e/p1-live.spec.ts: terminal-resume stderr → test-results/live-p1/live-s6.txt; now sanitized before truncation and again at the sitting-log boundary.
  • e2e/p1-live-keep-quit.spec.ts: only quit-guard: main-process lines are retained through the same sitting logger → test-results/live-s5; now inherits redaction. test/live/maws-ask-interrupt.live.test.ts → test-results/live-s1 inherits it too.
  • e2e/plugins-library-live.spec.ts: engine CLI stderr on failure can reach setup notes or the Playwright report through an error; now sanitized at the CLI result boundary.
  • test/live/support/live.ts: raw engine timeout errors can carry collected stderr into test reports; now sanitized with the launch environment. Exported journals and test/live/maws-tools.live.test.ts's engine stdout already used redactJournal and now share the enhanced implementation.
  • Live scene journal copies in composer/agent-tools/document/presentation/design/dashboard support remain in their private temporary scratch roots, not the uploaded directories. Connector probes' path-scrubbed diagnostic journals and the IME probe's non-engine stderr were inspected but are not live-engine public-stream captures. The OAuth fixture's retained-output secret checks and Discover's selected tool-name metadata are unchanged.

This does not claim that regexes make arbitrary credentialed main/host logs safe: the new generic capture remains disabled there. The shared redactor closes the existing bounded diagnostic-note/export paths rather than enabling those raw streams.

Verification

  • RED: the new helper was absent; utility-host extraction then failed on a missing host file. Workflow selection failed specifically for engine-host logs and later artifacts-perf.jsonl before their upload patterns were added.
  • GREEN on behavioral head 8fe0a1dd60db6648a132fa622e1c967c3ab3ea4c: 112 focused Node tests across scripts/e2e-process-evidence.test.mjs, scripts/live-public-evidence.test.mjs and .github/scripts/gate-plan.test.mjs. Real child-process streams prove both outputs survive and an independent stderr listener receives identical bytes. Coverage includes head/tail budgets and cut lines, private staging, fresh/inherited host generations and rotation, effective settings/fallback guards, transient-switch diagnostic redaction, serialized S6/S1 notes, partial timing projections and both upload conditions/file selections.
  • Hosted e2e:transcript passed on the reviewed behavioral head 8fe0a1dd6, run 40895385571, with evidence requested. Downloaded e2e-transcript: 74 main-process files for 37 launches (79,106 bytes total), 37 host logs (45,646 bytes), zero exclusion markers. Every stderr file includes a real quit-report. A typical host log is 1,231 bytes; stream files range from 177 to 4,483 bytes. The whole compressed artifact is 1,256,651 bytes. An obvious-marker scan found no bearer credentials or sk-ant keys. This verifies the final redaction/staging/provenance path actually retains ordinary hosted launches.
  • That run's typecheck, lint and build passed; its sole static failure was gitleaks treating the deliberately synthetic CUSTOM_SECRET test assignment as an embedded API key. Final head 431ea2ef89a838453b8367e31ec45b34b5aa5dbc only constructs the same test canary value at runtime; application/capture code and scanner rules are unchanged. Its 18 capture tests pass. Final-head static is green, run 40898134057: typecheck, lint, build and gate-script tests passed. The hosted and measured proofs remain applicable to this test-only adjustment.
  • Redaction RED: the existing export redactor leaked a synthetic bearer token into saved notes and console. GREEN: three additional focused Node cases verify file/console output, JSON preservation, account emails/provider keys/environment secrets and redaction before the 300-character cut.
  • Follow-up review fixes are committed separately: unknown-engine exclusion, bounded capture, settings recheck/private staging, universal promotion-time redaction, inherited-host-log refusal, supported Settings/fallback validation, and serialized-note redaction. Each behavioral finding has observed RED/GREEN evidence. The controller's final verification review of the last four fixes returned correct, no material findings, with 23 focused capture/redaction tests passing.
  • Earlier 7267aed43 static also passed run 40892176675, before the authorized mini proof below. No full unit suite, paid live suite or heavy-guard measured run is claimed by these focused checks.
  • With CI-opt's GO after green static, mini run 40893467592 passed e2e:local-latency-daemon on 7267aed439f3df77e4ba9088f48dd910d244f0ca. It ran on ci-kit-mac-mini from 14:38:25 to 14:41:01Z without --evidence. The only artifact is measured-e2e-local-latency-daemon (6,824-byte zip): local-latency.json (66,045 bytes) and an engine-host log (1,357 bytes), no main streams or HTML. The log includes idle: collected in 24 ms and 16 ms, followed by clean stopAll. The JSON records valid=true, no reasons, 600/600 markers, delta-to-frame p50/p95 24.7/37.1 ms and round-trip p50/p95 1.2/1.6 ms over 200 samples, load 3.645. This group produces JSON rather than JSONL: JSONL inclusion is tested by the workflow tests, not demonstrated by this live artifact. The final safety fixes preserve fresh-profile measured publication while sanitizing it; CI-opt accepted this measured proof without a second mini run.
  • Mini window validity, independently checked against CI-opt's 5-second sampler on the mini (~/.local/share/ci-analysis/window-1029/burst.log) and the run's entries in ~/Library/Logs/ci-kit/mac-runner-hooks.log, read over read-only SSH: first settle 14:38:35–14:39:06Z (31 s, initial load 2.91); the build burst reached 4.71–4.96 between 14:39:34 and 14:39:59Z, before the second settle and outside the measurement. Second settle was 14:40:05–14:40:36Z (31 s, released at 3.65). The command window, 14:40:36–14:40:57Z, had 1-minute load readings 3.65, 3.67, 4.18, 4.08 and 4.16 at approximately five-second steps: maximum 4.18, below Rule B's 4.7. A corespotlightd sample at 14:40:10Z showed 126.4% CPU during settling; the measured window still stayed at or below 4.18. The artifact's own validity verdict agrees with this host-side read.
  • No Electron or full suite ran on the MacBook; no Mac configuration, TCC or keychain settings changed.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)

Preserve per-launch stdout/stderr and the stopped host log, exclude credentialed scenes from raw capture, and persist the heavy tool guard’s timing samples.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
artifacts-perf uses a utility host whose output main forwards, and records its samples as JSONL. Keep both alongside the detached host evidence without widening to arbitrary logs.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T14:08:05.808942Z 252d55a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Capture only the launch-owned replay stub or an explicitly named test-owned synthetic engine. Preserve local-latency diagnostics while excluding c3-stall's installed engine override.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Share the journal export redactor with sitting logs and their console echo, redact bearer credentials, and sanitize CLI failure and raw-process timeout diagnostics. Preserve the 300-character terminal stderr cut after redaction.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Retain 256 KiB of startup plus a 256 KiB rolling tail per stream, with explicit dropped-byte counts. Extract utility-host lines from bounded retained bytes at cleanup without rereading growing files or changing other stream listeners.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Check effective settings after launch preparation and again at cleanup. Fail closed for unknown engines or unreadable settings, removing this launch's captures and leaving a non-sensitive exclusion marker. Bound settings reads and preserve explicitly owned synthetic overrides.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Keep bounded stream heads under a private per-launch profile directory until cleanup rechecks engine provenance. Publish only approved captures and remove staging on either approval or rejection, so worker death cannot bypass the finish backstop through public artifact collection.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Apply the shared public-evidence redactor with launch secrets before writing main streams, utility lines, or host generations to test-results. Bound host reads and discard cut-line fragments so lost credential prefixes cannot bypass redaction.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Match raw and serialized environment secrets longest-first, and redact bearer credentials after escaped whitespace without disturbing JSON syntax.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Refuse both host generations when either existed at capture construction, including after rotation. Preserve the eligible launch's main streams and emit a fixed artifact-compatible host exclusion marker.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Accept only current machine, last-unified, or current-client envelopes with valid engine provenance fields. Require the environment fallback to name the same declared synthetic binary, independently of any deeper product-schema rejection. Keep settings reads bounded.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Keep the same credential-redaction regression without presenting a fixture assignment as an embedded API key to the public-tree scanner. Scanner rules and application behavior are unchanged.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 6e90f5e into master Oct 29, 2026
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
…est-owned engines and the host log for measured groups, redacted (#353); tracker: process-evidence coverage, the design-systems seed's error-level line, the remote mode row's three halves

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 29, 2026
#353: the measured artifact keeps the hosts' logs)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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.

1 participant