Skip to content

feat(schema): flip pattern validator to strict v2#156

Merged
Meyanis95 merged 4 commits into
masterfrom
feat/pattern-schema-v2-strict-flip
May 7, 2026
Merged

feat(schema): flip pattern validator to strict v2#156
Meyanis95 merged 4 commits into
masterfrom
feat/pattern-schema-v2-strict-flip

Conversation

@Meyanis95
Copy link
Copy Markdown
Collaborator

@Meyanis95 Meyanis95 commented Apr 23, 2026

Fourth and final PR for #150. Removes all v1 aliases from schema and validator. Requires #154 and #155 to merge first. Stacked on #155.

Summary by CodeRabbit

  • Documentation
    • Pattern documentation restructured for improved clarity with explicit intent, components, and protocol sections
    • Pattern reference links and cross-references reorganized across multiple patterns
    • Pattern validation now strictly enforces v2 standards—legacy v1 patterns will fail validation

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Review Change Stack

Warning

Rate limit exceeded

@Meyanis95 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 41 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7e137ed1-c4ae-47cf-8cf2-16c2adba21d2

📥 Commits

Reviewing files that changed from the base of the PR and between 451f3c4 and 00d63aa.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
  • scripts/validate-patterns.js

Walkthrough

This PR enforces strict v2 semantics for IPTF pattern frontmatter and structure. The JSON schema removes v1 aliases and deprecated fields, while the validator converts v2 mismatches to hard errors. Sixteen pattern markdown files are updated to v2 structure and reference cleanup.

Changes

Core V2 Schema and Validator Enforcement

Layer / File(s) Summary
V2 Schema Definition
scripts/schemas/pattern.json
JSON schema removes v1 aliases, deprecated CROPS keys (os, privacy, security), and conditional acceptance logic. Enforces only v2 single-letter CROPS keys (cr, o, p, s), v2 maturity values (research|concept|testnet|production), and standards/related_patterns structure. Deprecated v1 dependencies field removed.
V2 Validator Strict Error Enforcement
scripts/validate-patterns.js
Validation logic converts v2 frontmatter and structure violations from warnings to errors. Invalid maturity values, missing CROPS keys, invalid context usage, missing related pattern slugs, and deprecated section names (Ingredients, old Guarantees format) are now fileErrors. Required pattern sections changed to v2 form: ## Components only and ## Guarantees & threat model only.
Change Documentation
CHANGELOG.md
Unreleased entry documents schema validator strictness change: v1 alias keys, legacy maturity values, and v1 section/field names now fail validation instead of emitting warnings.

Pattern Documentation Migration to V2

Layer / File(s) Summary
Frontmatter Metadata Updates
patterns/pattern-eil.md, patterns/pattern-focil-eip7805.md, patterns/pattern-zk-wrappers.md
Pattern files update rollout-plan declarations, advance maturity values (pilottestnet), and convert crops_profile from legacy keys (os/privacy/security) to v2 single-letter format (cr/o/p/s).
Content Structure Reorganization to V2
patterns/pattern-social-recovery.md, patterns/pattern-zk-wrappers.md
Pattern bodies reorganized into v2 canonical structure: explicit Intent, Components (replacing Ingredients), Protocol, and Guarantees & threat model sections. Legacy "Ingredients/Protocol (concise)" combined format removed and re-expressed under new headings with clarified subsections.
See Also and Reference Cleanup
patterns/pattern-*.md (15 files)
Remove internal vendor relative links (../vendors/*) and deprecated domain references (post-quantum.md, identity domain pages). Consolidate cross-references to external documentation, EIP drafts, and cryptographic papers. Internal pattern relationships move from embedded See also bullets to structured frontmatter via related_patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • ethereum/iptf-map#152: Both PRs modify the same schema and validator files—feat(schema): pattern template v2 (schema + CI only) #152 added v2 schema with migration-aware warnings, while this PR tightens that logic to enforce v2 as strict errors.
  • ethereum/iptf-map#154: Both PRs target the same v2 pattern migration—this PR tightens schema/validation enforcement while #154 migrates pattern markdowns to that v2 shape.
  • ethereum/iptf-map#155: Both PRs perform v2 migration on many of the same pattern markdown files and See also reference cleanup; this PR also tightens the JSON schema and validator to treat v2 mismatches as errors.

Suggested reviewers

  • rymnc
  • oskarth
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description does not follow the provided template structure (checkboxes for change type, description section, checklist items). It contains only a one-sentence summary with dependency and stacking information. Expand the description to match the template: select change type (likely 'Update to existing content'), add a detailed description section, and complete the checklist items (duplication, link validation, accuracy).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(schema): flip pattern validator to strict v2' clearly summarizes the main change—enforcing strict v2 schema validation by removing v1 aliases from the pattern validator and schema.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pattern-schema-v2-strict-flip

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 and usage tips.

@Meyanis95 Meyanis95 self-assigned this Apr 24, 2026
Meyanis95 added a commit that referenced this pull request May 7, 2026
Closes #151's "schema validation" sequencing item. Companion to PR #160 (the
content migration). Lenient mode: warnings only until a future strict-flip
mirrors PR #156's role for patterns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Meyanis95 added a commit that referenced this pull request May 7, 2026
* feat(schema): approach template v2 (template + CI checks)

Closes #151's "schema validation" sequencing item. Companion to PR #160 (the
content migration). Lenient mode: warnings only until a future strict-flip
mirrors PR #156's role for patterns.

* fix(schema): address CodeRabbit round 1 on #161
Meyanis95 and others added 2 commits May 7, 2026 15:40
Schema: drop rollout-plan property; validator promotes top-level
additionalProperties errors to errors (was warnings).

Patterns: drop rollout-plan from eil and focil-eip7805. Minimal v1->v2
frontmatter and section migration on social-recovery and zk-wrappers
(authored in #153 before the migration sweep landed; missed by #154
and #155).

Patterns: remove internal repo links from See also across 11 cards;
drop inline pattern link from threshold-encrypted-mempool body prose.
Cross-references preserved via related_patterns.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Meyanis95 Meyanis95 force-pushed the feat/pattern-schema-v2-strict-flip branch from 805518b to 451f3c4 Compare May 7, 2026 20:09
@Meyanis95 Meyanis95 changed the base branch from feat/pattern-v2-migration-batch2 to master May 7, 2026 20:09
@Meyanis95 Meyanis95 marked this pull request as ready for review May 7, 2026 20:09
…wrappers

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
patterns/pattern-zk-wrappers.md (1)

1-21: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoff

Optional: lift post-quantum and related-patterns context into structured frontmatter.

The card already discusses PQ exposure in Trade-offs (line 55) and lists implementations/related patterns in See also (lines 65-68). The v2 schema accepts structured post_quantum, related_patterns, and open_source_implementations blocks (see the template and the sibling threshold-encrypted-mempool card). Promoting these from prose to frontmatter would make this card consistent with the rest of the v2 migration without changing semantics.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@patterns/pattern-zk-wrappers.md` around lines 1 - 21, The frontmatter should
be extended to include structured keys for post-quantum context and
related/implementation references instead of leaving them as prose; add
post_quantum (string/array), related_patterns (array of pattern slugs like
zk-tls, threshold-encrypted-mempool), and open_source_implementations (array) to
the YAML frontmatter at the top of patterns/pattern-zk-wrappers.md and migrate
the PQ discussion from the Trade-offs section and the entries from the See also
section into those new keys (preserve wording), ensuring the existing semantics
and values remain unchanged and that the new keys follow the v2 schema used by
sibling cards.
scripts/validate-patterns.js (1)

397-418: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Schema enum violations are still demoted to warnings — intentional?

Line 412 routes any AJV enum keyword failure to fileWarnings, except where it falls under /crops_profile and is rescued by isRequiredField. Net effect: a malformed layer, type, context, or post_quantum.risk value will warn but not error, which contradicts the "strict v2" framing for those fields. The high-value enums (maturity, status, crops_profile.{cr,o,p,s}) are already covered by explicit error paths, so this is a gap rather than a regression — worth a quick decision before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/validate-patterns.js` around lines 397 - 418, AJV enum violations are
currently routed to fileWarnings (in the validatePatternSchema.errors loop),
which lets invalid values for fields like layer, type, context, or
post_quantum.risk slip through as warnings; change the logic so enum failures
are treated as errors (push to fileErrors) for strict-v2 fields. Specifically,
modify the branch handling error.keyword === 'enum' so it pushes to fileErrors
instead of fileWarnings (or conditionally pushes to fileErrors when
error.instancePath matches the strict fields such as /layer, /type, /context,
/post_quantum/risk, and crops_profile paths), keeping the existing crops_profile
additionalProperties and isRequiredField handling intact. Ensure you reference
validatePatternSchema.errors, error.keyword === 'enum', isRequiredField,
fileErrors, fileWarnings, and error.instancePath when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 7: The changelog entry under [Unreleased] for "feat(schema): flip pattern
validator to strict v2..." is missing a markdown link to the changed file(s);
update that entry to include a markdown link to the relevant file(s) (e.g.,
validate-patterns.js and pattern.json or whichever schema file was modified)
alongside the PR reference (`#156`) so it follows the rule "include a markdown
link to the changed file, reference the PR number, and use a semantic prefix";
ensure the entry format matches the sibling entries that link to
validate-patterns.js and pattern.json.

In `@patterns/pattern-social-recovery.md`:
- Around line 15-21: The frontmatter currently sets "context: both" but lacks
the required "context_differentiation" field; add a top-level
"context_differentiation" entry that contains explicit "i2u" and "i2i"
descriptions (lift the I2U vs I2I text from the body—the user trust graph vs
institutional MPC quorum/governance policy—into the frontmatter) so the file
complies with the rule that when context is both you must supply differentiation
for both i2u and i2i.

In `@patterns/pattern-zk-wrappers.md`:
- Around line 15-21: The front matter sets "context: both" but omits the
required "context_differentiation" entries; update the YAML to include a
"context_differentiation" mapping with keys for "i2i" and "i2u" and provide the
appropriate differentiation values for each (e.g., brief descriptions or flags)
so the validator accepts the file; ensure the block is added alongside the
existing "context: both" and "crops_profile" entries to satisfy the rule that
both i2i and i2u must be filled.

In `@scripts/validate-patterns.js`:
- Around line 366-385: The validation currently checks the expected CROPS
single-letter keys via cropsFields (and pushes errors into fileErrors) but
doesn't explicitly flag v1 alias keys (e.g., "os", "privacy", "security") with a
targeted migration hint; update the block that reads cp =
frontmatter.crops_profile to also scan cp for any known v1 aliases and, if
found, push a specific fileErrors entry like "crops_profile: found deprecated v1
key '<alias>'; use '<newKey>' (cr/o/p/s) instead" so contributors get a clear
migration hint; use the existing cropsFields and cp/fileErrors variables to
locate and implement this check.

---

Outside diff comments:
In `@patterns/pattern-zk-wrappers.md`:
- Around line 1-21: The frontmatter should be extended to include structured
keys for post-quantum context and related/implementation references instead of
leaving them as prose; add post_quantum (string/array), related_patterns (array
of pattern slugs like zk-tls, threshold-encrypted-mempool), and
open_source_implementations (array) to the YAML frontmatter at the top of
patterns/pattern-zk-wrappers.md and migrate the PQ discussion from the
Trade-offs section and the entries from the See also section into those new keys
(preserve wording), ensuring the existing semantics and values remain unchanged
and that the new keys follow the v2 schema used by sibling cards.

In `@scripts/validate-patterns.js`:
- Around line 397-418: AJV enum violations are currently routed to fileWarnings
(in the validatePatternSchema.errors loop), which lets invalid values for fields
like layer, type, context, or post_quantum.risk slip through as warnings; change
the logic so enum failures are treated as errors (push to fileErrors) for
strict-v2 fields. Specifically, modify the branch handling error.keyword ===
'enum' so it pushes to fileErrors instead of fileWarnings (or conditionally
pushes to fileErrors when error.instancePath matches the strict fields such as
/layer, /type, /context, /post_quantum/risk, and crops_profile paths), keeping
the existing crops_profile additionalProperties and isRequiredField handling
intact. Ensure you reference validatePatternSchema.errors, error.keyword ===
'enum', isRequiredField, fileErrors, fileWarnings, and error.instancePath when
making the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0e216dfa-cffa-4a96-bb60-26b5242097c0

📥 Commits

Reviewing files that changed from the base of the PR and between 223c8e5 and 451f3c4.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • patterns/pattern-eil.md
  • patterns/pattern-focil-eip7805.md
  • patterns/pattern-l2-privacy-evaluation.md
  • patterns/pattern-mpc-custody.md
  • patterns/pattern-native-account-abstraction.md
  • patterns/pattern-pretrade-privacy-encryption.md
  • patterns/pattern-privacy-l2s.md
  • patterns/pattern-private-shared-state-cosnark.md
  • patterns/pattern-private-transaction-broadcasting.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-tee-zk-settlement.md
  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-user-controlled-viewing-keys.md
  • patterns/pattern-zk-tls.md
  • patterns/pattern-zk-wrappers.md
  • scripts/schemas/pattern.json
  • scripts/validate-patterns.js
💤 Files with no reviewable changes (12)
  • patterns/pattern-native-account-abstraction.md
  • patterns/pattern-eil.md
  • patterns/pattern-l2-privacy-evaluation.md
  • patterns/pattern-pretrade-privacy-encryption.md
  • patterns/pattern-privacy-l2s.md
  • patterns/pattern-private-transaction-broadcasting.md
  • patterns/pattern-focil-eip7805.md
  • patterns/pattern-user-controlled-viewing-keys.md
  • patterns/pattern-mpc-custody.md
  • patterns/pattern-tee-zk-settlement.md
  • patterns/pattern-private-shared-state-cosnark.md
  • patterns/pattern-zk-tls.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
CHANGELOG.md

⚙️ CodeRabbit configuration file

CHANGELOG.md: Entries must go under [Unreleased], include a markdown link to the changed file,
reference the PR number (#NNN), and use a semantic prefix (feat(pattern):, feat(vendor):, fix:, docs:, etc.).

Files:

  • CHANGELOG.md
patterns/pattern-*.md

⚙️ CodeRabbit configuration file

patterns/pattern-*.md: This is a pattern card.

Structure & frontmatter: Validate against the template at patterns/_template.md.
File naming rules are in patterns/README.md. Filename must start with pattern- in kebab-case.
Pattern names must be vendor-neutral (no vendor-specific names like aztec, nightfall, railgun, etc.).

CROPS alignment (CRITICAL):
crops_profile with all four fields (cr, os, privacy, security) is required — CI will reject patterns missing it.
Exception: meta/evaluation patterns that do not implement privacy directly may set crops_profile: "n/a" — flag if this is used on a pattern that clearly does implement a privacy primitive.
Valid enum values are defined in CONTRIBUTING.md § CROPS Evaluation and enforced by the JSON schema at scripts/schemas/pattern.json.

Your job is to review CROPS scores for plausibility, which CI cannot check:

  • A pattern requiring a centralized operator should not claim cr: high.
  • If the pattern involves I2U context, check that the CR score accounts for user escape paths per the CR rubric in CONTRIBUTING.md.
  • A pattern using proprietary components should not claim os: yes.
  • A pattern where the operator sees all user operations should not claim privacy: full.

Word limits: warn > 800, error > 1500.
Tone: factual and neutral per house style. No marketing language.

Files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
🧠 Learnings (12)
📚 Learning: 2026-03-18T09:21:53.725Z
Learnt from: rymnc
Repo: ethereum/iptf-map PR: 116
File: patterns/pattern-private-set-intersection-dh.md:38-40
Timestamp: 2026-03-18T09:21:53.725Z
Learning: In the ethereum/iptf-map repository, pattern documentation should keep the Protocol section high-level and concise. Do not include granular implementation steps (e.g., explicit point-validation sub-steps). If such concerns must be mentioned, use lightweight callouts in a separate Security Notes or Caveats section. Apply this guideline to all pattern docs under the patterns directory.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-03-20T05:29:08.871Z
Learnt from: rymnc
Repo: ethereum/iptf-map PR: 120
File: patterns/pattern-private-set-intersection-circuit.md:19-23
Timestamp: 2026-03-20T05:29:08.871Z
Learning: When reviewing Ethereum iPTF-Map pattern documentation, distinguish clearly between **censorship** and **liveness**: treat censorship as the operator blocking user inputs from being processed (this impacts CR score), while treat liveness as the operator withholding outputs after protocol participation (this does not directly affect CR score). For garbled-circuit PSI patterns specifically, if the **garbler withholds the output decoding table**, classify this as a **liveness** concern—not censorship—and therefore **do not** flag it as a “CR justification gap.”

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:49:47.740Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-lean-ethereum.md:4-4
Timestamp: 2026-05-04T14:49:47.740Z
Learning: In ethereum/iptf-map, pattern card markdown files under `patterns/` use v2 front-matter for the `maturity` field. When reviewing these files, treat `maturity` as a v2 enum and only consider it valid if it is one of: `research`, `concept`, `testnet`, or `production`. Do not flag `research` as invalid.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:50:03.967Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-privacy-l2s.md:4-4
Timestamp: 2026-05-04T14:50:03.967Z
Learning: In ethereum/iptf-map pattern cards using schema v2 (introduced in PR `#152`), validate the `maturity` field against the v2 enum values only: `research | concept | testnet | production`. The v1 enum (`PoC | pilot | prod`) is no longer applicable to v2-migrated pattern cards. When reviewing v2 pattern files, do not flag `production` as non-canonical (it is a valid v2 value).

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:50:03.935Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-mixnet-anonymity.md:4-4
Timestamp: 2026-05-04T14:50:03.935Z
Learning: In this repo’s pattern files under `patterns/`, the IPtF map schema maturity enum must use the v2 values only: `research | concept | testnet | production`. The legacy v1 values `PoC | pilot | prod` are invalid after the v2 schema migration (PR `#152`). Therefore, when reviewing `patterns/**/*.md`, do not flag `testnet` or `production` as invalid maturity values; instead, flag any remaining usage of the old v1 enum values (`PoC`, `pilot`, `prod`) as incorrect.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:50:06.756Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-compliance-monitoring.md:4-4
Timestamp: 2026-05-04T14:50:06.756Z
Learning: In ethereum/iptf-map, for v2 pattern cards under the `patterns/` directory, validate the `maturity` field against the v2 enum only: `research | concept | testnet | production`. Do not treat `testnet` or `production` as invalid maturity values for v2 pattern cards (the v1 enum `PoC | pilot | prod` is obsolete for content migrated to v2).

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:50:06.734Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-private-contract-dsl.md:4-4
Timestamp: 2026-05-04T14:50:06.734Z
Learning: For ethereum/iptf-map v2 pattern cards in the `patterns/` directory, validate the `maturity` field against the v2 enum defined in `scripts/schemas/pattern.json`: `research`, `concept`, `testnet`, `production`. Do NOT flag `maturity: production` as non-standard in v2 pattern files. Conversely, do not accept the v1 enum values (`PoC`, `pilot`, `prod`) for v2 pattern cards.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T19:17:00.734Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 155
File: patterns/pattern-private-stablecoin-shielded-payments.md:38-43
Timestamp: 2026-05-04T19:17:00.734Z
Learning: In this repo’s IPtF map pattern Markdown files, the v2 frontmatter key `visibility:` is part of the approved schema (defined by `patterns/_template.md`). It encodes the four-slot visibility matrix (counterparty, chain, regulator, public) for transaction-level pattern cards. Do not flag `visibility` as an unknown/ad-hoc/non-schema frontmatter key in `patterns/**/*.md`; only treat it as an issue if it violates the expected schema/format.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-03-19T10:42:48.438Z
Learnt from: rymnc
Repo: ethereum/iptf-map PR: 120
File: patterns/pattern-private-set-intersection-circuit.md:5-7
Timestamp: 2026-03-19T10:42:48.438Z
Learning: In ethereum/iptf-map, when reviewing documentation files in the `patterns/` directory (e.g., `patterns/*.md`), do not flag frontmatter fields `layer`, `privacy_goal`, or `assumptions` as invalid/non-schema fields. These fields are explicitly defined as valid properties in `scripts/schemas/pattern.json` with the expected types/constraints: `layer` (enum: L1, L2, offchain, hybrid), `privacy_goal` (string, maxLength 200), and `assumptions` (string or array of strings).

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:49:53.905Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-co-snark.md:4-4
Timestamp: 2026-05-04T14:49:53.905Z
Learning: In ethereum/iptf-map, for pattern markdown files under `patterns/` that use the v2 schema (introduced in PR `#152`), the `maturity` field must be one of: `research | concept | testnet | production`. Do not flag `testnet` or `production` as invalid in these v2-migrated pattern cards, and treat the old v1 values (`PoC | pilot | prod`) as not valid for v2 patterns.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:49:53.905Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-co-snark.md:4-4
Timestamp: 2026-05-04T14:49:53.905Z
Learning: When reviewing `patterns/*.md` in the `ethereum/iptf-map` repository that have been migrated to schema v2, interpret and validate the `maturity` field using the v2 enum values: `research | concept | testnet | production` (and do not accept legacy values `PoC | pilot | prod`). Also verify that `maturity` describes the repository’s Ethereum integration readiness (e.g., readiness of the native Ethereum execution-client integration represented in the repo), not the general real-world production readiness of the underlying technology.

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
📚 Learning: 2026-05-04T14:50:02.790Z
Learnt from: Meyanis95
Repo: ethereum/iptf-map PR: 154
File: patterns/pattern-icma-bdt-data-model.md:4-4
Timestamp: 2026-05-04T14:50:02.790Z
Learning: When reviewing `maturity` fields in v2 pattern-card files under `patterns/` (v2 schema introduced in PR `#152` for `ethereum/iptf-map`), use the v2 enum values only: `research | concept | testnet | production`. Do not flag `production` as non-conformant in v2 pattern files, and do not recommend replacing `production` with the v1 value `prod` (v1 enum `PoC | pilot | prod` is obsolete for v2).

Applied to files:

  • patterns/pattern-threshold-encrypted-mempool.md
  • patterns/pattern-social-recovery.md
  • patterns/pattern-zk-wrappers.md
🪛 GitHub Actions: CI Quality Gates / 2_Validate Documentation Patterns.txt
patterns/pattern-social-recovery.md

[error] 1-1: Pattern validation failed: context is 'both' but context_differentiation is missing. Add both i2i and i2u strings.

patterns/pattern-zk-wrappers.md

[error] 1-1: Pattern validation failed: context is 'both' but context_differentiation is missing. Add both i2i and i2u strings.

🪛 GitHub Actions: CI Quality Gates / Validate Documentation Patterns
patterns/pattern-social-recovery.md

[error] 1-1: Pattern validation failed: context is 'both' but context_differentiation is missing. Add both i2i and i2u strings.

patterns/pattern-zk-wrappers.md

[error] 1-1: Pattern validation failed: context is 'both' but context_differentiation is missing. Add both i2i and i2u strings.

🔇 Additional comments (4)
patterns/pattern-threshold-encrypted-mempool.md (1)

59-59: LGTM on the cryptographic-sub-pattern framing.

The added paragraph cleanly disambiguates this card from the trust-based private-relay variant, and the cross-reference via related_patterns.requires keeps the v2 frontmatter as the single source of truth instead of duplicating an inline link.

scripts/schemas/pattern.json (1)

1-215: Schema tightening looks consistent with the strict-v2 intent.

additionalProperties: false at the top level plus the nested crops_profile, crops_context, related_patterns, open_source_implementations, sub_patterns, visibility, post_quantum, and context_differentiation objects gives the validator a clean rejection surface for v1 aliases. The crops_profile oneOf ("n/a" | strict object with cr/o/p/s) is the right shape for the meta-pattern exception.

scripts/validate-patterns.js (2)

287-337: Strict-v2 routing through fileErrors looks correct.

Threading fileErrors into validateV2Fields (line 445) and pushing all four checks — context: both shape, type: metasub_patterns consistency, missing related_patterns slugs, missing sub_patterns slugs — into the error collector matches the changelog promise. Two pattern files in this PR are already failing CI on the context: both branch, which confirms the wiring works end-to-end.


426-431: Maturity strict-v2 check looks right.

The dedicated V2_MATURITY_VALUES check correctly rejects the v1 enum (PoC/pilot/prod/experimental) as errors, independent of the AJV enum branch. Matches the changelog claim on line 7 of CHANGELOG.md.

Comment thread CHANGELOG.md Outdated
Comment thread patterns/pattern-social-recovery.md
Comment thread patterns/pattern-zk-wrappers.md
Comment thread scripts/validate-patterns.js
…ROPS aliases)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Meyanis95
Copy link
Copy Markdown
Collaborator Author

@CodeRabbit approve

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

✅ Actions performed

Comments resolved and changes approved.

@Meyanis95 Meyanis95 merged commit c8addba into master May 7, 2026
7 checks passed
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