4 Commits
Author SHA1 Message Date
james.maesandClaude Opus 4.7 439e1ee2f5 ci: build hygiene — webview cleanup + OpenSSF Scorecard (#46, #178) (#194)
* ci(build-webview): sweep stale hashed chunks before rsync (#46)

Vite emits content-hashed asset names (e.g. `index-CXPb0I5z.js`), so the
active bundle filename rotates on every source/dependency edit. The
existing rsync runs without `--delete` (to preserve `bus-harness.html`
and `.gitignore`), so old chunks accumulated in
`App/Resources/webview/assets/` — observed 9 stale `index-*.js` /
`.js.map` pairs locally before this fix.

Add an explicit `rm -f` of the asset glob (JS + JS map + CSS + CSS map)
before the rsync drops the fresh bundle. The preserved files
(`bus-harness.html`, `index.html`, `.gitignore`) live one level up in
`$DEST`, not in `$DEST/assets`, so the rm cannot reach them.

Verified locally: `bash scripts/build-webview.sh` now leaves exactly one
`index-*.js` + `.js.map` in `assets/` (matching the reference in
`index.html`).

Refs #46

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* ci(scorecard): add OpenSSF Scorecard workflow + README badge (#178)

Adds `.github/workflows/scorecard.yml` running `ossf/scorecard-action@v2.4.0`
on:
- Weekly cron (Mondays 06:00 UTC) for posture drift detection
- Push to develop for prompt regression visibility
- workflow_dispatch for ad-hoc runs

Permissions follow the canonical Scorecard set (`id-token: write`,
`contents: read`, `security-events: write`) with top-level `read-all` and
job-scoped writes. Results are published to the OpenSSF public dataset
(powers the README badge URL) and uploaded as SARIF to code-scanning.

The workflow consumes no untrusted user inputs in `run:` blocks, so it is
not exposed to workflow-injection patterns documented in
github.blog/security/.../how-to-catch-github-actions-workflow-injections.

README.md gains the standard Scorecard badge next to the existing
license/platform/swift badges.

Refs #178

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 09:29:48 -05:00
james.maes a73c9aa352 fix(build-webview): add Nix profile paths to PATH so script finds pnpm
The Xcode build phase 'Build webview bundle' couldn't find pnpm when it
was installed under any standard Nix profile location (~/.nix-profile/bin,
/etc/profiles/per-user/$USER/bin, /run/current-system/sw/bin) — the
hard-coded PATH only listed Homebrew, /usr/local, ~/.local/bin, and nvm.

Add the three canonical Nix profile paths to the PATH export so the App-build
gate works identically for users on Homebrew, npm-global, nvm, OR Nix.
Updates the FATAL hint to mention Nix as a third install option.

Surfaced during Phase 6 Wave 4 verification: scripts/check-app-builds.sh
failed identically on develop and worktree with `pnpm not found`. Root
cause was environmental (pnpm uninstalled since prior session) but the
script's PATH was the latent fragility.
2026-04-27 14:08:13 -05:00
james.maes fa76fc64e6 fix(05-build): build-webview.sh PATH prepend for Xcode IDE GUI env
Xcode IDE GUI build phases don't inherit the user's shell PATH (only
xcodebuild from a terminal does). pnpm at /opt/homebrew/bin was
unreachable from Xcode → 'pnpm: command not found' →
PhaseScriptExecution failed.

Prepend /opt/homebrew/bin + /usr/local/bin + ~/.local/bin to PATH and
add an explicit pnpm-availability check with an actionable error
message. CLI builds unaffected (PATH was already correct there).

Verified: bash scripts/build-webview.sh still works from the terminal.
2026-04-26 05:54:41 -05:00
james.maesandClaude Opus 4.7 a9a1b86ef9 feat(03-05): build-webview.sh + project.yml pre-build wiring + commit index.html
- scripts/build-webview.sh (exec): pnpm install (content-hash-cached) +
  @jarvis/bus build + @jarvis/hud build + rsync dist/ -> App/Resources/webview/
  with --exclude bus-harness.html (preserved for 02-04 parity script) and
  --exclude .gitignore (preserves the assets/ ignore pattern).
- project.yml: adds two preBuildScripts after check-no-evaluate-javascript:
    * Check single-writer HUD state (HUD-08)
    * Build webview bundle
  Ordering stays: existing parity/protocol/no-eval checks → single-writer
  lint → webview build → (postBuildScripts: pre-codesign verify → codesign
  → post-codesign verify → pbxproj lint).
- App/Resources/webview/.gitignore: ignore assets/ (regenerated every build).
- App/Resources/webview/index.html: committed entry point (R3F bundle).

Assets are NOT committed — they rebuild from webview/packages/hud/ on every
xcodebuild via the new pre-build script.

xcodebuild build -configuration Debug succeeds end-to-end; built app
has Contents/Resources/webview/index.html + assets/index-*.js with
relative (./assets/) paths.

packages/Bus swift test: 47/47 green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 15:47:24 -05:00