Conversation
shaun0927
added a commit
that referenced
this pull request
Apr 16, 2026
Commit 5527d3f ("Stabilize the stacked headless smoke jobs") accidentally re-declared `wsToHttpUrl` in `src/flutter/vm-service-discovery.ts` — the documented implementation at lines 99-102 is preceded by an identical undocumented copy at lines 89-92. ts-loader surfaces this as TS2323 + TS2393 during `npm run build`, which in turn fails the `lint` and `test` jobs in `.github/workflows/ci.yml` (both run `npm run build` through the `prepare` hook). Remove the undocumented duplicate; keep the documented one. Verified: - `npm run build:src` now compiles cleanly (0 errors). - `npx jest tests/unit/flutter-vm-service.test.ts` — 21/21 pass. - `git blame` confirms the duplicate was introduced on 2026-04-16 and not used by any caller outside the file itself. This hotfix unblocks CI on develop and on every in-flight PR (#575, #576, #577). Refs: #540 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
…w-list (#540) Adds `src/ci/audit-log-posture.ts` with `scanAuditLog()` / `assertAuditLogPosture()` — extracts `backendKind` values from `~/.opensafari/audit.log` (or `$OPENSAFARI_AUDIT_LOG`) regardless of whether they live at the top level or inside a stringified `args_summary`, and asserts the set is a subset of `{flutter-vm, simhid, webkit}`. Two test suites exercise it: - `tests/unit/audit-log-posture.test.ts` — 10 fixture-driven cases covering absent log, empty log, top-level + nested extraction, disallowed kinds, case-insensitive applescript detection, malformed JSONL tolerance, and the assert wrapper. - `tests/integration/audit-log-backend-kind.live.test.ts` — runs against the real audit log produced by earlier live smoke steps in the same CI job. Default `npm test` skips it (integration tests are excluded in `jest.config.js`); the smoke workflow invokes it explicitly via `--runTestsByPath`. Refs: #540 acceptance criterion "Telemetry: backendKind in {'flutter-vm','simhid','webkit'} only (`applescript` = 0)". Follow-up: wire the live suite into each smoke job in `.github/workflows/headless-smoke.yml` in a separate PR so the workflow change stays reviewable. Verified: - `npx jest tests/unit/audit-log-posture.test.ts --no-coverage` → 10/10 pass. - Helper tolerates both `"backendKind":"simhid"` and `\"backendKind\":\"simhid\"`. Refs: #540 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33054e9 to
6a2607b
Compare
shaun0927
commented
Apr 16, 2026
Owner
Author
shaun0927
left a comment
There was a problem hiding this comment.
Code review: P0=0, P1=0, P2=2 (vacuous pass semantics + path traversal — both CI-only). Well-structured posture helper with 10 thorough unit tests. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/ci/audit-log-posture.ts— tolerant parser that pulls everybackendKindvalue out of~/.opensafari/audit.log(or\$OPENSAFARI_AUDIT_LOG) whether it lives at the top level or inside a stringifiedargs_summary, and exposesscanAuditLog()/assertAuditLogPosture().tests/unit/audit-log-posture.test.ts— 10 fixture-driven cases covering all branches (10/10 pass locally).tests/integration/audit-log-backend-kind.live.test.ts— runs against the real audit log produced by the live smoke jobs; defaultnpm testskips it (excluded injest.config.js).Refs: #540 — moves the acceptance-criteria box "Telemetry:
backendKind in {'flutter-vm','simhid','webkit'}only (applescript= 0)" into a shape that can be asserted in CI. Workflow wiring is a follow-up so this PR stays a pure library addition.Why
Unit B (PR #576) already centralises the "no applescript" check. This PR adds the positive-side constraint — every recorded backend must come from the allowed set — with a testable helper that the smoke jobs can call after their live steps land.
Test plan
Known red CI
`develop` currently fails `npm run build` because of a duplicate `wsToHttpUrl` in `src/flutter/vm-service-discovery.ts` (introduced by commit `5527d3f7`). That is unrelated to this PR but will break this PR's CI until a hotfix lands. I'm opening that hotfix as a separate PR immediately after.
🤖 Generated with Claude Code