Skip to content

feat: build manifests, dg verify-app, and a notice on unpublished builds - #374

Merged
PastaPastaPasta merged 7 commits into
masterfrom
feat/p0-e7-app-integrity
Oct 5, 2026
Merged

PastaPastaPasta merged 7 commits into
masterfrom
feat/p0-e7-app-integrity

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

What

App integrity for the hosted web app:

  • A per-file build manifest for every web build. pnpm build and pnpm build:ipfs now write forge-manifest.json: every file of the build with its SHA-256, plus the commit, network and variant. The site serves it at its root.
    • The Pages deploy attests the manifest with a GitHub build-provenance attestation (actions/attest-build-provenance).
    • Each release publishes the IPFS build's manifest as forge-web-<version>.manifest.json. It is listed in SHA256SUMS, so the release attestation covers it. The two IPFS builds must produce the same manifest.
  • dg verify-app <url> fetches the site's manifest. It trusts the manifest only when GitHub holds an attestation of it from this repository's CI, or when --manifest <file|url> gives one you got yourself, such as a release's from dg release download. It then fetches and hashes every listed file. An unpublished manifest, or a missing or changed file, fails with E504, and each failing file is named. --json is supported. The nightly workflow runs it against forge.dashhq.org.
  • A notice when you unlock a private repo on an unpublished build. On a locked private repo, and in Settings → Private repos, the app looks up its own manifest's attestation. When GitHub has none, it shows: "This copy of Forge isn't a published build, so it could read anything you unlock here. How to verify a copy". Nothing shows while it checks, for a published build, or when the check can't run.

Why

Roadmap E7 / TS-12. A bad deploy, or a compromised host or DNS, is the undefended way to read private repos. Until now, checking a deployed copy meant rebuilding it by hand.

How

  • forge-web/scripts/build-manifest.mjs writes the manifest deterministically (sorted, no times), so the IPFS CID stays reproducible. ipfs-release.sh extracts it next to the CAR.
  • crates/dg/src/verify_app.rs: looks up the manifest through GET /repos/PastaPastaPasta/dash-forge/attestations/sha256:<digest>, honouring GITHUB_TOKEN/GH_TOKEN. File paths are percent-encoded, and 12 files are fetched at once.
  • forge-web/lib/build-check.ts makes the same lookup from the browser (api.github.com allows CORS) once per page load. BuildIntegrityNotice renders the result.
  • Docs: docs/guides/verify-the-app.md (new "Check a deployed copy" section, the release asset table, the maintainer's Forge release command) and docs/errors.md (E504).

How tested

  • Rust: cargo fmt --check, clippy --workspace --all-targets -D warnings, cargo test --workspace. New tests: the comparison, path encoding and manifest format.
  • Web: tsc, eslint --max-warnings=0, vitest (5654 passed). New tests: the build manifest, and the attestation check's published, unpublished and unknown outcomes and site root.
  • Local end to end: built the site and served out/, then:
    • dg verify-app http://127.0.0.1:8765 --manifest out/forge-manifest.json matched 174 of 174 files;
    • after one byte was appended to index.html it reported differs: index.html and exited 5 with E504;
    • without --manifest it reported "the site's build is not a published one", because GitHub has no attestation for a local build.
  • The notice, signed in on sakura (owner 4cakPSW…) against the local unattested build, in dark, light and 390 px. axe found no violations.
    Evidence: /Users/pasta/workspace/dash-forge-qa/evidence/p0/integrity-dx/e7-notice/ (01 dark, 04 light, 07 mobile, axe-*.json).

Limits

  • Until this merges and Pages redeploys, forge.dashhq.org has no manifest, so the nightly check and the in-app notice start working after the first deploy.
  • The attestation lookup trusts GitHub's API. It does not verify the Sigstore signature itself; gh attestation verify does, and both the output and the guide name it.
  • The check covers what the run was served. A host can serve different bytes to different visitors. The in-app notice catches mistakes and unofficial copies; it is not a defence against a malicious build, which can leave the notice out.
  • Cloudflare headers and CAA are owner actions, documented in docs: license texts, security policy, contributing guide, web dev setup and hosting headers #358 (docs/hosting.md).

🤖 Generated with Claude Code

PastaPastaPasta and others added 3 commits October 4, 2026 13:05
Every build now writes forge-manifest.json: each file it made with its SHA-256, plus its commit, network and variant. The Pages deploy attests the manifest's digest with a GitHub build-provenance attestation, and each release publishes the IPFS build's manifest as forge-web-<version>.manifest.json, in SHA256SUMS and so under the release attestation. Both IPFS builds must produce the same manifest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
dg verify-app <url> reads the site's forge-manifest.json, trusts it only when this repository's CI attested it on GitHub (or when --manifest names one you got yourself, such as a release's from dg release download), then fetches and hashes every file it lists. A missing or changed file, or an unpublished manifest, fails with E504. The nightly workflow runs it against forge.dashhq.org.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…uild

Where a private repository's key is unlocked (a locked private repo, Settings → Private repos), the app looks up its own manifest's attestation and, when GitHub has none, notes that this copy isn't a published build and could read what is unlocked, with a link to the verify guide. Nothing shows while checking or when the check cannot run.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2795a62d-a857-4391-aa98-ca7084e9edf8
📥 Commits

Reviewing files that changed from the base of the PR and between cfb9b29 and ecde023.

📒 Files selected for processing (18)
  • .github/workflows/nightly.yml
  • .github/workflows/pages.yml
  • .github/workflows/release.yml
  • .github/workflows/web-ipfs.yml
  • crates/dg/src/errors.rs
  • crates/dg/src/main.rs
  • crates/dg/src/verify_app.rs
  • docs/errors.md
  • docs/guides/verify-the-app.md
  • forge-web/components/build-integrity-notice.tsx
  • forge-web/components/encryption-key-panel.tsx
  • forge-web/components/repo/private-repo-state.tsx
  • forge-web/lib/build-check.test.ts
  • forge-web/lib/build-check.ts
  • forge-web/package.json
  • forge-web/scripts/build-manifest.mjs
  • forge-web/scripts/build-manifest.test.ts
  • forge-web/scripts/ipfs-release.sh
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Review fixes. The Pages build runs third-party npm code, so it now holds no deploy or attestation permission: a separate job, master only, attests the manifest it uploads. dg verify-app asks for files as a browser does, so content injected only for browsers is caught; --commit requires the build you expect, since any published build passes otherwise; a fetch failure is E504 like the rest of the check; --json says whether --manifest was a file or a URL. The nightly check retries once after a deploy's propagation window. The web check asks again after an unknown result, and both reuse existing SHA-256 and GitHub API helpers.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

@coderabbitai review


🤖 Posted autonomously by Claude on behalf of pasta.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@PastaPastaPasta
PastaPastaPasta merged commit 2c7371c into master Oct 5, 2026
34 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/p0-e7-app-integrity branch October 5, 2026 03:59
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