Repository navigation
feat(contracts): schema RC1 for the bonsia registration (PR-1) - #170
Merged
Merged
Conversation
…t/refuse vectors forge-contracts/schema/build.py applies the RC1 items (WIPE-DECISIONS D-10..D-12) to the #154 base schemas behind flags: the O-01/O-02/O-03 layout, every P0/P1 rule except protected_ref, ref_ledger and label_tags, INV-11, CL-7, CL-8 (no cap), R-01 with @{ refused, COMM-9, topics capped at 20 and the vis stamp. Gate sizes (rs-dpp v4.2.0-beta.7): core 16,150 B, collab 16,475 B, community 16,496 B, all under the 17,408 B target. wherecheck.py mirrors drive-abci's registration-only reference checks (40121/40122/40126/40131/40137) with a mutation self-test. vectors.py writes 353 accept/refuse cases to forge-contracts/vectors/rc1/, each refusal naming its schema keyword or rule. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…d literal ids and bytes
contract-validate --vectors <dir> replaces the hand-written sample documents: every accepted case must pass and every refused one must fail for the reason it names (schema keyword, rule, maxBytes or code). A case may name its signer ("owner": byte or base58), and a document may write {"$id": "<base58>"} and {"$hex": "..."}.
negative.sh follows the RC1 layout (repoKey in collab; event, authorEvent in community), generates one without-<type>-<rule> mutation per rule a vector refuses by, and adds the new registration checks (vis where-pairs, consent and asMember findBy, check sources, reply agreement, one $def per type): 133 mutations, all rejected.
contracts.yml checks that build.py and vectors.py reproduce the committed files, runs wherecheck.py and its self-test, and passes --vectors. vectors.py fails when a rule has neither a refusing vector nor a live-only entry.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… layout) forge-community's events refer to forge-collab's issues and PRs through FORGE_COLLAB_CONTRACT_ID. deploy-v2 now substitutes every registered contract's id into the ones after it (core -> collab -> community); --only community uses the recorded forge-collab id, and --only collab warns when forge-community still names another forge-collab. The self-test loads each schema with only the earlier contracts' ids. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
repoKey is a forge-collab type and event a forge-community type (O-03, O-01): the wrap tests and private conformance vectors (Rust and TS) parse forge-collab with forge-core's placeholder filled, and the event late-rule tests read forge-community. The deploy-v2 test follows the new type split and the FORGE_COLLAB_CONTRACT_ID substitution. No vector or wrap builder changes: callers pass the collab contract for repoKey. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- build.py: a branch's first component is never `@` alone (git's HEAD); flag dependencies are enforced (a where on a stamp that is off would fail registration with 40126); --check refuses --off. - wherecheck.py: the 40137 checks of reference_lookup.rs (indexOnly target, a key a replace can move, system-property kinds), a reference to a later or unknown contract is 40121, documentsCanBeDeletedContractDefault and moderator delete, unported features fail closed; more self-test mutations. - vectors: byte caps (maxBytes, the 5120-byte field limit), enc without epoch, chunk part size and checkRun enums; '@' refused as a default branch. - contract-validate: a refused case must name its reason and an accepted one none. - negative.sh: generated rule mutations must fail for their rule, a type left with no rule drops the empty propertyConstraints, an empty rule list fails. - deploy-v2: --only community confirms the recorded forge-collab on chain before naming it; the self-test checks forge-community names forge-collab. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
forge-v2.md follows the RC1 build: the three-contract layout, the vis stamps and what each is proved against, consent and asMember, the lock bit (sum mod 16), packs, releases, topics, CI and hooks, a Frozen at mainnet section, measured sizes and fees, and the deploy order with the collab id substituted. Release assets are packManifest kind 4. economics.md and the mainnet runbook drop manifestPart, the deletable release and the two-contract readonly note. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…munity, repoKey to forge-collab The RC1 layout (O-01, O-02, O-03): the type-to-contract map matches the three schemas again, which source.test.ts checks against forge-community.json. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… a node's create does After the document schema a node's create runs validate_distinct_from_properties (10419) and validate_encrypted_property_shapes (10420) (drive-abci document create advanced structure v1). contract-validate --vectors now runs both, and the vectors refuse a starBeat on the signer's own repo, following yourself, a 40-byte wrap and a 33-byte webhook secret. The README no longer calls distinctFrom chain-only. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
PastaPastaPasta
added a commit
that referenced
this pull request
Sep 29, 2026
This was referenced Sep 29, 2026
Merged
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.
PR-1 of the RC1 plan (
design/SCOPE-DECISION.md, WIPE-DECISIONS D-10..D-12). It adds the schema RC1 for the fresh registration on bonsia: one combined build of forge-core, forge-collab and forge-community, the registration checks a contract parse cannot run, accept/refuse vectors for every rule, and the deploy and doc changes that go with them. PR-2 registers it on bonsia and runs the live suite.The build:
forge-contracts/schema/build.pyIt applies every RC1 item behind a flag to
schema/base/(the #154 build) and writesforge-contracts/contracts/*.jsonplusregistered/forge-core.v1.json. CI runsbuild.py --check, so a hand edit to a contract fails.event,authorEventandmilestonemove to forge-community.runnermoves to forge-community.repoKeymoves to forge-collab.FORGE_COLLAB_CONTRACT_ID.@{refused.visstamp.asMember).manifestPartandoffsetIndexPartsare removed).protected_ref(R-05),ref_ledger(O-09) andlabel_tags(O-10).viseverywhere.wherenaming a stamp that is off would fail registration with 40126.Sizes (rs-dpp v4.2.0-beta.7, full parse). No D-12 cut was needed.
The pinned wasm evo-sdk (beta.7) parses all three with full validation.
Registration-only checks:
forge-contracts/schema/wherecheck.pyThis mirrors drive-abci
data_contract_reference_validation/v0: 40121, 40122, 40126, 40131 and 40137. The 40137 check includes the target index kind,indexOnlyand moving key parts. A feature the mirror does not port makes it fail closed instead of passing.--self-testproves it sees each error through mutations. CI runs it next totools/contract-validate, which carries the Rust port of the same checks.Vectors:
forge-contracts/vectors/rc1/(389 cases)schema/vectors.pygenerates them, and every rule has either a refusing case or aLIVE_ONLYentry: rules that read a total, a time or a height are judged in PR-2's live suite. Each refused case names its reason: a schema keyword, a rule name,maxBytes, or a consensus code. The format is in the README; a case may also name another signer (owner) and use{"$id": "<base58>"}and{"$hex": …}.tools/contract-validate --vectorsreplaces the hand-written samples. It judges every case the way a node's create structure validation does: the document schema and rules, thendistinctFrom(10419) and theencryptedForshape (10420). A refusal must happen for the reason the case names.b7gate --casesin dash-forge-qa runs the same checks.negative.shgenerates one mutation per rule (each must fail for that rule) and adds the RC1 registration negatives: 133 mutations, all rejected.Deploy and clients
--only communityconfirms the recorded forge-collab on chain before naming it.repoKeyfrom forge-collab; the vectors themselves and the wrap builders are unchanged. The event late-rule tests read forge-community.source.tsroutesevent,authorEvent,milestoneandrunnerto forge-community, andrepoKeyto forge-collab.Docs
docs/contracts/forge-v2.mdis at RC1:visstamps and what each is proved against;The trust set for
upstreamNumberand imported provenance is now one rule: a writer proved to be a member on chain (R-04).Also updated:
release-asset-manifest.md(kind 4),economics.md, and the mainnet runbook, which covers readonly for all three contracts.Checks
cargo fmt,cargo clippy -D warningsandcargo test --workspaceall pass.tsc,vitest run(3,078) andlintall pass.build.py --check,vectors.py --check,wherecheck.pyand--self-test,contract-validate --vectorsandnegative.shall pass locally.playwright (read-only, devnet moutai)cannot pass anywhere right now.Review
code-review-validator found nothing blocking. Its should-fix items are in af0b430. Among them:
@is refused;why;--only communityreconciles.Two items were not taken:
The simplification pass's safe items are applied.
🤖 Generated with Claude Code