Skip to content

fix(web): show only what was verified; label actions for what they do - #6

Merged
PastaPastaPasta merged 2 commits into
masterfrom
fix/web-honest-ui
Sep 25, 2026
Merged

PastaPastaPasta merged 2 commits into
masterfrom
fix/web-honest-ui

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Problem

Roadmap Phase 0, invariant 4: the UI shows only what was verified, and a button's label says what the click does. In several places forge-web claimed more than it did:

  • Trust panel. repo-rail.tsx hard-coded refs: 'verified', packs: 'verified', and the landing page hard-coded a "verified" chip. The panel said "testnet" even on mainnet, and it did not say where the quorum keys come from, which is the one thing a trust-minimized client has to trust.
  • Merge. Any signed-in user saw a "Merge" button. It records a merge event and merges no code. The fold ignores that event unless the signer holds WRITE or MAINTAIN and the head has reached the base branch.
  • Star / Follow always started unset, whatever the viewer had actually done. Write failures were silently swallowed.
  • Archive had no handler. Neither the web app nor dg has an archive write.
  • Copy. Pages said bytes are "served from IPFS", offered "Review & merge in-browser", and described the backend choice as "where pack bytes live". None of this is true yet: git push always stores packs on Platform (roadmap gap 3).

What changed

Trust state comes from checks that actually ran (lib/view/trust.ts, lib/view/content-checks.ts)

  • evoSdkService.isTrusted records that the live connection is a *Trusted() connect, which proof-checks plain .query() reads (design-freeze-2 feat(mint-identity): mint funded identities on devnet moutai (PV14) #5). useSdk exposes it.
  • The browse reader already re-hashes every reconstructed object against its git id. A new onObject callback on BrowseReader reports verified | unchecked | failed. The fallback clone reports its whole-pack sha256 checks. Range fetches record the host that actually served the bytes. All of this goes into a per-repo session ledger, and the rail subscribes to it with useSyncExternalStore.
  • deriveTrust() is a pure function that maps the connection, the attested ref's folded state and the ledger to one of five states per link: verified | partial | unverified | pending | failed.
    • A diverged ref reads partial, because the page shows the newest head provisionally.
    • If no file bytes have been read yet, content reads pending, not verified.
    • Any hash mismatch reads failed and takes over the headline.
  • The panel copy is network-aware. It names the quorum-key endpoint (quorums.<network>.networks.dash.org) and says plainly that whoever controls that endpoint could vouch for false data.
  • The landing chip now reports only whether this session's connection proof-checks reads.

PR controls (lib/view/pull-actions.ts, components/repo/pull-content.tsx)

  • The button is now "Mark as merged", shown only to identities holding WRITE or MAINTAIN. Holdings come from the existing token-history reconstruction through the new readViewerHoldings / currentHoldings, which share the authz cache. A failed history read counts as unknown: the control is withheld and the page says why.
  • PullView.headOnBase is computed with the same historical-tips predicate the fold uses. The page and the confirm dialog say either "the head commit is already on <base>, so the mark counts now" or "push it to <base> first".
  • Close/reopen (on PRs and issues) is shown only to the author or a token holder. Those are the only identities whose event the fold would honour.
  • The timeline event now reads "marked this as merged".

Star / Follow (hooks/use-registry-toggle.ts)

  • The initial state is read from the viewer's own star/follow docs with the new hasStarred / isFollowing, which reuse the find_own query. The button offers no action until that state is known.
  • Read errors, write errors and "broadcast but not yet visible" are shown next to the button.
  • A star/follower count that failed to load now shows –, not a false 0.

Other

  • Removed the Archive button and the empty "Danger zone" section. The archived banner now reads "The owner has marked this repo archived." The config flag is display-only, so the banner no longer claims the repo is read-only.
  • The /new backend picker, the settings page and the backend badge now say that the mode is a recorded preference. git push stores packs on Platform whatever the mode says, and dg repack / dg reseed move them.
  • Corrected the landing, footer and meta copy.

Verification

Gate Result
pnpm install --frozen-lockfile pass
pnpm typecheck pass
pnpm lint pass (1 warning, already on master: <img> in markdown-view.tsx)
pnpm test pass: 239 passed, 3 skipped (live suites). 32 tests are new
pnpm build (static export) pass: 21/21 pages

New tests:

  • trust.test.ts: every state, headline precedence, and network/endpoint disclosure.
  • pull-actions.test.ts: the merge/close gating for holder, author, stranger, logged-out, loading and unknown-history viewers. One end-to-end case checks that when the gate says "counts now", foldPrState does merge, and that a stranger's identical event stays inert.
  • content-checks.test.ts: the ledger.
  • A BrowseReader test that onObject reports verified, failed (a lying locator) and unchecked.
  • Viewer-holdings tests: owner, maintainer, frozen maintainer, and a failed history.

A manual smoke test against live testnet used the built static export and the m1 fixture, logged out:

Not verified:

  • The PR page was not exercised live because the m1 fixture has no PRs. It is covered only by the unit tests.
  • Nothing was exercised signed in: the merge button as a holder, star/follow toggles and their error surfaces. That needs a funded testnet identity.
  • The failed / partial panel states were not seen in a browser; they are unit-tested only.
  • The Playwright e2e suite was not run. Its assertions (/assay|proof|sha256|verif|trust/i, the Verification status group) still match the new markup.
  • Mainnet copy is checked only in unit tests, because there is no mainnet registry.

🤖 Generated with Claude Code

The trust panel and landing chip now derive refs/content/source states (verified, partial, unverified, pending, failed) from checks that actually ran: whether the SDK connection is in proof-checking trusted mode, the attested ref's folded state, and a per-repo ledger fed by the browse reader's per-object hash check and the fallback clone's sha256 pack check. Copy is network-aware and discloses the quorum-key endpoint.

PR Merge is now 'Mark as merged', shown only to WRITE/MAINTAIN holders (token history), and states whether the head is already on the base branch. Close/reopen on issues and PRs are shown only to the author or token holders. Star/follow read the viewer's real initial state and surface read/write failures. The Archive button (no handler, no write path) is removed, and copy that overstated behaviour (IPFS serving, in-browser review/merge, backend routing) is corrected.

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

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 28 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 890c1685-594b-4a10-a8f0-7d4238123234

📥 Commits

Reviewing files that changed from the base of the PR and between f6c5bff and 0bd9dad.

📒 Files selected for processing (39)
  • forge-web/app/layout.tsx
  • forge-web/app/new/page.tsx
  • forge-web/app/page.tsx
  • forge-web/components/app-footer.tsx
  • forge-web/components/profile-content.tsx
  • forge-web/components/repo/issue-content.tsx
  • forge-web/components/repo/pull-content.tsx
  • forge-web/components/repo/pulls-content.tsx
  • forge-web/components/repo/repo-header.tsx
  • forge-web/components/repo/repo-rail.tsx
  • forge-web/components/repo/repo-scaffold.tsx
  • forge-web/components/repo/settings-content.tsx
  • forge-web/components/repo/star-button.tsx
  • forge-web/components/repo/timeline.tsx
  • forge-web/components/ui/backend-badge.tsx
  • forge-web/components/ui/trust-panel.tsx
  • forge-web/components/ui/verification-chip.tsx
  • forge-web/hooks/use-registry-toggle.ts
  • forge-web/hooks/use-sdk.ts
  • forge-web/lib/browse/browse.test.ts
  • forge-web/lib/browse/index.ts
  • forge-web/lib/browse/reader.ts
  • forge-web/lib/constants.ts
  • forge-web/lib/repo/index.ts
  • forge-web/lib/repo/issues.ts
  • forge-web/lib/repo/tokens.test.ts
  • forge-web/lib/repo/tokens.ts
  • forge-web/lib/repo/writes.ts
  • forge-web/lib/sdk/service.ts
  • forge-web/lib/view/browse-fallback.ts
  • forge-web/lib/view/browse-source.ts
  • forge-web/lib/view/content-checks.test.ts
  • forge-web/lib/view/content-checks.ts
  • forge-web/lib/view/index.ts
  • forge-web/lib/view/pull-actions.test.ts
  • forge-web/lib/view/pull-actions.ts
  • forge-web/lib/view/repo-view.ts
  • forge-web/lib/view/trust.test.ts
  • forge-web/lib/view/trust.ts

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.

… unreadable

The PR page already tells the viewer why Mark as merged is missing when the token history read fails; the issue page silently hid Close/Reopen from maintainers in the same case. Show the same kind of reason.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta merged commit 5376f46 into master Sep 25, 2026
2 checks passed
PastaPastaPasta added a commit that referenced this pull request Sep 25, 2026
…ailed

Review #6: the contrast scan now includes hover:/dark: variants and fails on fills it cannot resolve (Tailwind defaults, arbitrary values, tints) instead of skipping them. That found hover:bg-forge-600 behind white (3.56:1) on the primary button and the PR diff link; hover now darkens to forge-800 (7.31:1). The identity pill's avatar used hsl(h 45% 45%) behind a white initial (2.58:1 at hue 60); its lightness now steps down per hue until white clears 4.5:1, and the test checks all 360 hues.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Sep 29, 2026
Issues and PRs share one dense sequence, so the demo's PRs are #5 (approved), #6 (merged) and #7 (the review-parity draft). e2e/seed-summary.ts reads pulls {approved, merged, reviewParity} from $FORGE_SEED_SUMMARY, else forge-contracts/deployments/fixtures/devnet-<devnet>.json, lazily, and fails loudly without them. The explore jump-box case for an issue and a PR sharing a number is gone (a number is one or the other); the draft is read from its kind-14 transition.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta added a commit that referenced this pull request Sep 30, 2026
The live vitest tests read the fixture owners from the seed summary (v2.live, chrome.live were still on moutai's identity ids). A malformed seed summary no longer breaks every spec's import: seedRepo returns null and loadSeedPulls names the file. fg5-dash skips only when the dash mirror's name does not resolve, not on a transport failure. pulls-budget opens the merged PR by its dense number from the seed summary (#6, was #2). The docs say the hosted site and the nightly follow master's workflow files, so they move to bonsia at the cut-over.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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