Skip to content

feat: forge-community contract id in forge-web, forge-core, dg and forge-relay - #156

Merged
PastaPastaPasta merged 1 commit into
wipe/beta7from
feat/wipe-contract-resolution
Sep 29, 2026
Merged

PastaPastaPasta merged 1 commit into
wipe/beta7from
feat/wipe-contract-resolution

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

What

Every client learns the third contract, forge-community (WIPE-PLAN §2.4), on top of the three-contract schema (#154). Target: wipe/beta7.

Deployment ids

  • ForgeIds.community comes from v2.forgeCommunity in the deployment file: forge-core network.rs, web lib/deployments.ts, deploy-v2.mjs communityId().
  • A file without that record predates the split, so community falls back to forge-collab's id. That is why the current moutai file behaves exactly as before.
  • A forgeCommunity record that is not registered means a half-finished deploy, and is not a deployment.
  • forgeCommunitySuperseded joins the superseded-in-group set.
  • Rust gains ForgeIds::all(), contains() and a test_forge() fixture. The web gains ForgeContractKind and contractKind().

Routing

  • Web: COMMUNITY_TYPES and contractOf in lib/repo/source.ts, plus the direct call sites: stars, beats, watches and follows in social.ts, trending.ts, writes.ts, first-write.ts, mine.ts, and the chrome.ts / discovery.ts composites.
  • forge-core: community_contract() for star/starBeat/watch/policy/checkRun, and webhooks.rs.
  • forge-relay: Contracts.community for checkRun streams, webhook discovery and the relay identity's key bound.
  • dg: doctor lists and verifies all three.

Keys and grants

  • KeyScope.community. A shipped wallet grants one contract per approval, so a forge-collab key does not cover forge-community on a three-contract deployment. A group-bound key covers all three.
  • The write guard opens the grant sheet on the contract the write needs (openLogin('grant', kind), captured when the sheet opens). The sheet's copy comes from that kind. The keys panel asks for the next missing grant (collab, then community).
  • Session hints stored without community fail isScope, so they re-verify once.

Group trust

  • dg check_pair / is_known and web group-trust.ts require forge-community as a whole-contract member, and know it.

CI

  • dg ci runner new binds (forge-community, checkRun).
  • CheckRuns reads and writes community.
  • CheckReport::changes is monotonic, to match the contract: startedAt is set on the first non-queued report (the report's own time, otherwise now), completedAt on completion, and nothing is ever removed.
  • run_to_update never replaces a completed run, or a started run with a queued report. Those become new runs.
  • The plan retries its read only when nothing matches, not when the match is final.
  • seed_check_run.rs and the relay's ci_consumer write both times.

Seeds (WIPE-PLAN §2.8, the split part)

  • seed-v2-fixture, seed-trending and verify-c1 write star, starBeat, watch, policy and checkRun to forge-community.
  • The dead beta.5 "VerifiedDocuments snapshot" catches are gone (platform#5136).
  • seed-v2's collab-reseed check keys on collab+community.

Docs

  • The forge-v2.md group-trust "pending" note is removed.
  • errors.md, BUILDING.md, wallet-login.md and the relay README are updated. The relay's ENCRYPTION key must be unbound or bound to forge-community.

Behaviour change to note

CI reports on a pre-split deployment: dg ci report no longer re-queues a started run or re-opens a completed run by --external-id; either one is now a new run. This matches forge-community's rules, but it also applies on the current moutai contracts, where forge-community is forge-collab and the rules are absent. There, a re-run that used to reset one document now creates a new one. Readers take the newest run per name, so checks show the same result.

Verified offline

  • cargo test --workspace: green. New tests cover three-contract ids, group trust without community, run_to_update final vs no-match, monotonic changes, and a first start set without a report time.
  • cargo clippy --workspace --all-targets: clean. cargo fmt --check: clean.
  • forge-web: vitest 2,838 passed, 19 skipped (175 files); tsc and pnpm lint clean. New tests cover contractOf routing, COMMUNITY_TYPES matching the schema, three-contract key scope, nextGrant/contractKind, group trust, forgeV2Ids with community, communityId, and trending reading community.
  • deploy-v2.mjs --self-test: ok. Seed scripts: node --check.

Nothing ran against a devnet. The playwright job is red until fixtures exist on the new chain.

🤖 Generated with Claude Code

@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: 1f24f5ba-9732-4816-bd2a-d127b798284f

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.

…rge-relay

Every client learns the third contract (WIPE-PLAN 2.4): ForgeIds.community from the deployment file (forge-collab's id on a pre-split file), social and CI types routed to forge-community, key scope and wallet grants per contract with the grant sheet naming the contract a write needs, group trust requiring all three, runner keys bound to (forge-community, checkRun), monotonic checkRun reports, and the seeds writing star, beat, watch, policy and checkRun to forge-community.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta
PastaPastaPasta force-pushed the feat/wipe-contract-resolution branch from 053a540 to 3326877 Compare September 29, 2026 17:54
@PastaPastaPasta
PastaPastaPasta merged commit e86fb62 into wipe/beta7 Sep 29, 2026
15 of 16 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]>
@PastaPastaPasta
PastaPastaPasta deleted the feat/wipe-contract-resolution branch September 29, 2026 18: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