Repository navigation
feat: forge-v2 shared contracts for protocol 14 (core + collab, consensus writer gates) - #7
Merged
Merged
Conversation
|
Warning Review limit reachedNext included review available in 36 minutes. View limit detailsLimit 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. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (12)
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. Comment |
…col 14 forge-core (repos, maintainer/writer membership, refs, packs, config, releases, labels, wrapped repo keys) and forge-collab (issues, PRs, comments, reviews, events, check runs, webhooks, profile, stars, follows) replace the per-repo contract template and the registry. Write-path types are gated at consensus with ownerRefersTo lookups on the membership documents; grants are owner-only through a $ownerId propertyAgreement against the repo. Audit-critical types are non-deletable because PV14 does not reference-check deletes. forge-collab names forge-core through FORGE_CORE_CONTRACT_ID, substituted at deploy. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…4.2.0-beta.4 tools/contract-validate is a standalone crate (its own workspace, so the main workspace's pinned SDK is untouched). Under PlatformVersion 14 it parses each contract with full validation, applies the create transition's basic-structure rules, ports drive-abci's registration-time reference validation so forge-collab's references into forge-core are checked against the in-memory core contract, checks well-formed and malformed sample documents, and reports the signed-shape create transition size and registration fee. negative.sh applies 14 single-rule mutations and requires the validator to refuse each one. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ct group Registers forge-core with a DataContractCreate v1 that creates the contract group and enrols the contract, then substitutes forge-core's id into forge-collab and registers it enrolled in the same group. Supports devnet (devnetName, explicit DAPI addresses; moutai's are built in), testnet and mainnet through evo-sdk 4.2.0-beta.4, pinned in forge-contracts/sdk-v2 apart from the v1 script's SDK. It checks the network runs protocol 14, rebuilds each contract with full validation before signing, records each step in deployments/<network>.json before and after broadcasting so a rerun resumes, verifies the group and both enrolments on chain, and has --dry-run and --self-test (the id derivation checked against the Rust validator's vector). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ured cost docs/contracts/forge-v2.md covers who can write each type and where that is enforced, why audit types are non-deletable under protocol 14, the private-repo key envelope, which v1 client rules consensus now replaces and which remain, and the measured sizes and fees. data-contracts.md points to it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
chunk is now non-deletable: Platform-tier storage is permanent and repack on that tier only consolidates. release is maintainer-gated. The unique indexes of packManifest, manifestPart and chunk include $ownerId, so no writer can claim another's slot, and repoKey is unique on (repoId, memberId, epoch, $ownerId). repo gains an editable displayName beside the immutable name slug. webhook is mutable with repoId and hookId immutable, so disabling a hook is an in-place replace re-checked against the maintainer gate. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The contract group id is derived from forge-core's broadcast nonce and recorded with it, so a resumed deploy never reuses a stale group id. Nonces are masked to their low 40 bits as rs-dpp does. A step found on chain has its record completed (status, cost from the pre-broadcast balance, owner) instead of being skipped. A disabled CRITICAL key is refused. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e validator Ports drive-abci's identityPublicKey leaf and key-id reference checks (40125), and re-parses each contract's serialization format with full validation as a node does. negative.sh pins cargo +1.98.1 and adds three mutations for the new checks. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tform storage Names the client rules consensus leaves in place: event kinds by role, gap-tolerant issue/PR numbering that ignores far-ahead squatters, approvals only from members, the pack reader rule (hash-verified, maintainer copies first), the repoKey reader rule (maintainer writer, verified key-check value) and plaintext-or-enc. Records that Platform chunks are permanent and that dg repack/GC must stop deleting them, and updates the measured sizes and fees. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…g cost On moutai the balance read right after broadcastAndWait returned the pre-transition value, so forge-collab was recorded at 0 DASH. The script now polls until the balance changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
forge-core GdZYaEntYPiW9dvUGCHyeqN7H7qEocbSkuj81n341i3L and forge-collab 9fCcSGF3UmajGCNHuuDGz2ou3Gm3EXhrwB3SRS9ocm4Y, enrolled in contract group 23iVLZABbVQ5a4heSa6GLVbVqSWr74JTSESSMTEYNd6o, registered by the moutai DEPLOYER for 1.120868 DASH in total. forge-collab's cost comes from a balance re-read, because the script's own read was stale. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
PastaPastaPasta
force-pushed
the
feat/forge-v2-contracts
branch
from
September 25, 2026 06:39
ab754dd to
9b8996c
Compare
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 25, 2026
Review #1: a page out of refNameHash order, holding a row at or below its '> last' bound, or a round that would not advance 'last' now stops the scan at once, and the answer comes from the reflog read of both types alone, deduplicated by $id (it used to keep paging and union). Both clients; a mock node that ignores the bound is covered. Review #7: the module docs now say what the prevOid check cannot see (a missing newest update or a whole ref) and that a 100+ update ref's equality read still carries protocol 13's same-$createdAt boundary gap until forge-v2. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Sep 27, 2026
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]>
This was referenced Sep 29, 2026
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 1, 2026
issues-paging (AXWiBed2j4e687ahukRWK81CwMExp4KLh6hJUqbnqmAx) is seeded on sakura by F1OWNER AQTWh1SA… with #7 assigned to F1COLLAB AJpWoHMx…, and explore-fill-01..25 by explore-filler EKL1ysqq…, so the r1-r4 and g2 specs have their data. e2e/README records the sakura ids. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Oct 4, 2026
PastaPastaPasta
added a commit
that referenced
this pull request
Oct 28, 2026
- A board spanning repositories showed each card's whole owner/name label: a 44-character identity id that truncated the number away on cards and cut table titles to one letter. Cards, table rows, roadmap lines and the item panel now show `name #12` (ItemRef), the full label as the tooltip; repo: matches an owner's whole id or DPNS name for every repository, not a shortened id nobody can type. - The table's Group picker had no None, and picking Status cleared the grouping: a table could not be grouped by Status at all. - A roadmap could not be switched to plot two date fields when the board has an iteration field: a Dates picker sets view.date. - The item panel sat 12px down the viewport (the page's space-y margin on a fixed layer); it stayed open on "Item not on this board" after Remove; its link read "Open issue" beside the state "Open issue". - A keyboard move into another column lost the focus (the card's new element renders after the drop); it is now refocused there. - A label defined from the item panel showed the fallback colour on the cards until a reload: the page reads the definitions again when an item carries a label they lack. - Light-theme contrast: the drag ghost's dark-mode note and the card and settings grips (lib/design/contrast.test.ts). - "Show archived" shows only archived items: renamed "Only archived". The filter box's example names this board's columns and fields; a single unresolved qualifier "names nothing"; settings no longer says closed items go to Done on a board without one; quick add says "Puts #7 in Done" (it moves an item already on the board). - Settings' column and field rows line up whatever chips they carry; the new-board templates read from the top; the Boards list puts the most recently changed board first; the issue sidebar's controls share one height; the roadmap's today marker no longer crosses header labels. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the protocol-14 forge-v2 data contracts (roadmap decision D-A): two shared contracts, forge-core and forge-collab, joined in one PV14 contract group. They replace the per-repo contract template and the registry. Also adds an offline validator that checks both against rs-dpp
v4.2.0-beta.4underPlatformVersion14, a deploy script, and the spec. Both contracts are registered on devnet moutai.forge-contracts/contracts/forge-core.json:repo,maintainer,writer,refUpdate,protectedRefUpdate,config,packManifest,manifestPart,chunk,release,label,repoKeyforge-contracts/contracts/forge-collab.json:issue,patch,comment,review,event,checkRun,webhook,profile,star,follow(star/followareindexOnly)tools/contract-validate: a standalone Rust crate with its own workspace, plusnegative.shforge-contracts/scripts/deploy-v2.mjs: evo-sdk4.2.0-beta.4, pinned inforge-contracts/sdk-v2docs/contracts/forge-v2.md: the model, enforcement, client rules, private-repo key envelope, and measured costAccess control, enforced at consensus
maintainer/writerrepoIdrefers to a permanentrepowithpropertyAgreement {"$ownerId":"$ownerId"}. Deleting the membership document revokes it.ownerRefersToof deletable lookups on(repoId, memberId):refUpdate,packManifest,manifestPart,chunk,label,checkRunprotectedRefUpdate,config,release,repoKey,webhookeventis gated by maintainer OR writer OR the author of the target issue/PR. The author path is a permanent lookup on a uniqueauthor($ownerId, repoId, number)index, tied totargetIdwith{"targetId":"$id"}.repo,refUpdate,protectedRefUpdate,config,packManifest,manifestPart,chunk,repoKey,issue,patch,event.dg repack/GC must stop deleting chunks and manifests (follow-up).$ownerId, so no writer can front-run another's slot. Readers pick the hash-verified copy, maintainers' copies first.The rules left to clients are named in forge-v2.md §6:
enc.Validation (offline, protocol 14)
The validator:
DataContractCreatev1 and round-trips it through the node's untrusted decoder.negative.sh(cargo +1.98.1) applies 17 single-rule mutations; each is refused with the expected error.Deployed on devnet moutai
Deployer
8HGxMu4atPn4jThH5h9X1MajzhoD3PRnzCRGrAsFcLcV; the ids are recorded inforge-contracts/deployments/devnet-moutai.json.GdZYaEntYPiW9dvUGCHyeqN7H7qEocbSkuj81n341i3L9fCcSGF3UmajGCNHuuDGz2ou3Gm3EXhrwB3SRS9ocm4Y23iVLZABbVQ5a4heSa6GLVbVqSWr74JTSESSMTEYNd6o: owner and both enrolments verified on chainA second run found both contracts on chain and broadcast nothing.
Test plan
cargo +1.98.1 run --manifest-path tools/contract-validate/Cargo.toml -- forge-contracts/contracts/forge-core.json forge-contracts/contracts/forge-collab.jsontools/contract-validate/negative.shcargo clippy --locked -- -D warningsandcargo fmt --checkon the validatornode forge-contracts/scripts/deploy-v2.mjs --self-test(JS id derivation matches the rs-dpp vector)🤖 Generated with Claude Code