Skip to content

feat(web): issue/PR state from transitions, proved counts, dense numbering, upstream numbers - #158

Merged
PastaPastaPasta merged 10 commits into
wipe/beta7from
feat/wipe-transitions-web
Sep 29, 2026
Merged

PastaPastaPasta merged 10 commits into
wipe/beta7from
feat/wipe-transitions-web

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

What

forge-web now uses the fresh beta.7 registration's transition design (WIPE-PLAN §2.5 and §2.6, web side). It builds on the rules and vectors from #155. The target is wipe/beta7.

Issue and PR state is a transition

  • Writers. setTargetState does close, reopen, merge, draft and ready through lib/repo/transitions.ts writeTransition.
    • It reads the target's proved state code and writes the one legal move (nextTransition). asAuthor is 0 for a member and the target's number for its author.
    • On a stale membership it falls back to the author (40120). On a state rule refusal (c1…c5) it re-reads once.
    • The intent is keyed by the action. A retry after a landed write returns without writing, so a resumed browser merge finishes.
  • Merges. The browser merge (lib/merge/runner.ts) and "Mark as merged" record a member's merge transition.
  • Draft PRs. A draft PR is the patch followed by the author's kind-14 transition, and patch.draft is gone. If the draft mark fails, DraftMarkError names the PR that already landed. The form opens that PR instead of posting a second one.
  • Retired paths. authorEvent now carries only the review kinds. The event-state writes (addAuthorEvent, stateEventRoute) and the TS event-state folds are removed.

Readers

  • Header counts (useTargetCounts): three proved requests, namely the issue total, the patch total, and one transition count with kind in [1,2,11..17] + groupBy ['kind']. Totals keep the L-37 read-after-write floor. Kind keys are decoded at any integer width.
  • List rows (Issues and Pulls lists, issue index): one proved sum per page (targetId in [≤100], groupBy ['targetId'], summable delta) gives every row's state. Labels and assignees still fold the member event feed. A row whose event log is incomplete keeps its proved state and says "labels unverified".
  • Issue index.
    • The Closed tab's candidates come from issue-close transitions.
    • Open/Closed are the proved counts less the issues this reader skips.
    • The index no longer seeds the PR list with a feed that lacks author events. That seed made the list lose head updates.
  • Thread pages. The composite reads the target's transitions, which go into the timeline ("closed this", "merged this at …"). A read past 100 continues on perTarget alone.
  • D-9. A member-recorded merge whose oid never was a base tip reads Merged, with "merge commit not found on the base". The "Mark as merged" copy says the same.
  • Inbox. It reads a transition feed alongside event. The backfill is windowed on the client, because perTarget has no time.

Dense numbering (§2.6)

Code review

  • The code-review-validator and code-simplifier gates ran (Opus). Their findings are fixed in b5b328a:
    • a second PR after a failed draft mark;
    • false errors on retry;
    • the >100 transition read;
    • escaped rule names;
    • the seeded feed dropping author events;
    • counts that included hidden issues;
    • the upstream-decoy page;
    • stale "state unverified" wording;
    • dead code.
  • One open question from the review: upstreamNumber trusts the owner and any current member (ISS-02 as specified), while trustedOrigin (FG-6) trusts the owner and maintainers only. I left both as specified.

Tested offline

  • vitest: 2870 passed, tsc clean, next lint clean.
  • New tests:
    • transitions.test.ts: the move data per role and state, author fallback, stale retry, a landed retry that writes nothing, key decoding at any width, and batches of 100.
    • upstream.test.ts: trust and decoy-proof resolution.
    • numbered-retry.test.ts: a dense retry, the single sequence, and a draft PR as patch + transition with DraftMarkError.
    • v2.test.ts: the sum query per list page, the three count requests, the D-9 label, and >100 transitions.
    • issue-index.test.ts: request budgets.
    • inbox.test.ts: the transition feed and its window.
  • Playwright specs are updated in wording only. They run live on the new devnet (bonsia) after registration.

The live checks (proofs, key encodings from a real node, consensus refusal texts, fees, reseeding the fixtures) are in WIPE-PLAN.md §3.1.

🤖 Generated with Claude Code

PastaPastaPasta and others added 10 commits September 29, 2026 11:29
…ng, upstream numbers

Tests not yet migrated.

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

Keeps both FG-6's imported origin and the upstream number; the mirror trust set is the provenance trust set; author events in tests use review kinds.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mpotent transition retries, proved counts

- createPatch's DraftMarkError is caught by the form (it opens the landed PR); unconfirmed draft marks say so.

- writeTransition keys its intent by the action and returns without writing when the target already shows the action's outcome (a resumed browser merge finishes); one author fallback and one stale-state retry, escaped rule names matched.

- Thread pages continue a >100 transition read on perTarget alone; incomplete rows keep their proved state (labels unverified, not state).

- The issue index no longer seeds a feed without author events (the PR list lost head updates); open counts subtract skipped issues and are cached per index; header totals keep the L-37 floor; kind counts decode any integer width; ?upstream= reads the index to its end.

- Retired TS folds and numbering removed; dead list-version counter removed.

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

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 88b674a7-c27d-41d2-ba3b-fc01b4bd66f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@PastaPastaPasta
PastaPastaPasta merged commit 3454332 into wipe/beta7 Sep 29, 2026
5 of 6 checks passed
PastaPastaPasta added a commit that referenced this pull request Sep 29, 2026
…munity in its fixtures

#158 merged after #156 and was not rebuilt on it: DOC gained a second transition key (TS1117) and two new test fixtures lack ForgeIds.community, so wipe/beta7's typecheck fails.

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