[PR #1227] [MERGED] refactor(schemas): share portable identifier and base64 patterns #2738

Closed
opened 2026-10-17 21:09:40 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1227
Author: @morluto
Created: 10/9/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @morluto

Base: main ← Head: codex/cleanup-schema-patterns


📝 Commits (2)

  • 74e6dcc refactor(schemas): share identifier and canonical base64 patterns
  • d25f5bf test: hold the offset datetime schema to the validator it replaces

📊 Changes

14 files changed (+224 additions, -29 deletions)

View changed files

📝 src/browser/CdpSafeMetadata.ts (+9 -9)
📝 src/domain/browserScenarioValues.ts (+3 -3)
📝 src/domain/completionLedgerGeneration.ts (+3 -1)
📝 src/domain/conformancePackage.ts (+3 -1)
📝 src/domain/evidenceCompletionLedger.ts (+3 -1)
📝 src/domain/native/binaryLayout.ts (+3 -5)
📝 src/domain/native/recordedCrash.ts (+3 -5)
➕ src/domain/offsetDateTime.test.ts (+101 -0)
📝 src/domain/process/processTraceSpecification.ts (+3 -1)
📝 src/domain/reconstructionObligationLedgerSchemas.ts (+3 -1)
📝 src/domain/reconstructionReadinessSchemas.ts (+3 -1)
📝 src/domain/reconstructionVerificationSchemas.ts (+3 -1)
➕ src/domain/stringPatterns.test.ts (+75 -0)
➕ src/domain/stringPatterns.ts (+9 -0)

📄 Description

Summary

Identifier and canonical base64 patterns were duplicated across ten schema modules, requiring repeated edits for the same compatibility fix. They now share three domain-owned patterns. This follows #1220 and also carries felipeatp's datetime parity test, which was pushed to their branch after that PR merged.

Problem and expected behavior

Equivalent identifier and base64 validators should have one owner while preserving their accepted values and validation behavior. The remaining internal CDP metadata regexes should use the same portable escapes as the advertised patterns.

Change and scope

Add shared identifier, stable identifier, and canonical base64 patterns; reuse them in existing schemas. Complete the CDP metadata character-class escapes. Keep distinct length-bounded identifier grammars intact. Include differential grammar tests and the author's datetime validator parity regression, retaining their commit attribution.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain string patterns and browser metadata parsing.
  • CLI and MCP/tool-catalog contract: existing inputs, output shapes, accepted values, and advertised patterns remain unchanged.
  • Provider, bridge, target-format, or platform compatibility: internal regexes also compile under Unicode-set mode; no provider protocol changes.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata, package, or installation impact: ignored catalogs regenerated and validated; no generated files committed.

Evidence and regression coverage

  • Tests added: identifier/base64 parity under u and v, including canonical pad-bit validation; datetime calendar, clock, offset, and emitted-pattern parity against the replaced Zod validator.
  • Executed evidence: all 14 CDP metadata regex literals compiled under u and v and preserved verdicts across 459,004 comparisons. Existing CDP metadata and schema-consumer suites pass.
  • User-visible CLI/MCP output: unchanged; the actual SDK advertised-schema regression passes.
  • Remaining proof gaps: no real provider verification is required for these pattern-only changes.

Validation performed

  • npm run test:local -- src/domain/stringPatterns.test.ts src/domain/offsetDateTime.test.ts src/browser/CdpSafeMetadata.test.ts src/domain/native/binaryLayout.test.ts src/domain/native/recordedCrash.test.ts src/domain/process/processTraceSpecification.test.ts src/domain/evidenceCompletionLedger.test.ts src/domain/completionLedgerGeneration.test.ts src/domain/reconstructionReadiness.test.ts src/domain/reconstructionObligationLedgerSchemas.test.ts src/domain/reconstructionVerification.test.ts src/domain/browserScenario.test.ts — 170 tests passed.
  • npm run test:focused -- tests/boundary/mcp/advertisedPatternsVMode.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts — 8 tests passed.
  • npm run check:fast — passed.
  • npm run docs:check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not performed; this changes shared regex ownership and equivalent escapes only.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no authority or data-handling changes.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output (unchanged).
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1227 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/cleanup-schema-patterns` --- ### 📝 Commits (2) - [`74e6dcc`](https://github.com/morluto/rea/commit/74e6dccd0a3e36d5599160dfbc7c605a23691c8a) refactor(schemas): share identifier and canonical base64 patterns - [`d25f5bf`](https://github.com/morluto/rea/commit/d25f5bfc5eee73ff0bbdd77825a3ed047deac39f) test: hold the offset datetime schema to the validator it replaces ### 📊 Changes **14 files changed** (+224 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `src/browser/CdpSafeMetadata.ts` (+9 -9) 📝 `src/domain/browserScenarioValues.ts` (+3 -3) 📝 `src/domain/completionLedgerGeneration.ts` (+3 -1) 📝 `src/domain/conformancePackage.ts` (+3 -1) 📝 `src/domain/evidenceCompletionLedger.ts` (+3 -1) 📝 `src/domain/native/binaryLayout.ts` (+3 -5) 📝 `src/domain/native/recordedCrash.ts` (+3 -5) ➕ `src/domain/offsetDateTime.test.ts` (+101 -0) 📝 `src/domain/process/processTraceSpecification.ts` (+3 -1) 📝 `src/domain/reconstructionObligationLedgerSchemas.ts` (+3 -1) 📝 `src/domain/reconstructionReadinessSchemas.ts` (+3 -1) 📝 `src/domain/reconstructionVerificationSchemas.ts` (+3 -1) ➕ `src/domain/stringPatterns.test.ts` (+75 -0) ➕ `src/domain/stringPatterns.ts` (+9 -0) </details> ### 📄 Description ## Summary Identifier and canonical base64 patterns were duplicated across ten schema modules, requiring repeated edits for the same compatibility fix. They now share three domain-owned patterns. This follows #1220 and also carries felipeatp's datetime parity test, which was pushed to their branch after that PR merged. ## Problem and expected behavior Equivalent identifier and base64 validators should have one owner while preserving their accepted values and validation behavior. The remaining internal CDP metadata regexes should use the same portable escapes as the advertised patterns. ## Change and scope Add shared identifier, stable identifier, and canonical base64 patterns; reuse them in existing schemas. Complete the CDP metadata character-class escapes. Keep distinct length-bounded identifier grammars intact. Include differential grammar tests and the author's datetime validator parity regression, retaining their commit attribution. ## Contract and boundary impact - Semantic owner and earliest changed stage: domain string patterns and browser metadata parsing. - CLI and MCP/tool-catalog contract: existing inputs, output shapes, accepted values, and advertised patterns remain unchanged. - Provider, bridge, target-format, or platform compatibility: internal regexes also compile under Unicode-set mode; no provider protocol changes. - Evidence, artifact, provenance, or reconstruction contract: none. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata, package, or installation impact: ignored catalogs regenerated and validated; no generated files committed. ## Evidence and regression coverage - Tests added: identifier/base64 parity under `u` and `v`, including canonical pad-bit validation; datetime calendar, clock, offset, and emitted-pattern parity against the replaced Zod validator. - Executed evidence: all 14 CDP metadata regex literals compiled under `u` and `v` and preserved verdicts across 459,004 comparisons. Existing CDP metadata and schema-consumer suites pass. - User-visible CLI/MCP output: unchanged; the actual SDK advertised-schema regression passes. - Remaining proof gaps: no real provider verification is required for these pattern-only changes. ## Validation performed - `npm run test:local -- src/domain/stringPatterns.test.ts src/domain/offsetDateTime.test.ts src/browser/CdpSafeMetadata.test.ts src/domain/native/binaryLayout.test.ts src/domain/native/recordedCrash.test.ts src/domain/process/processTraceSpecification.test.ts src/domain/evidenceCompletionLedger.test.ts src/domain/completionLedgerGeneration.test.ts src/domain/reconstructionReadiness.test.ts src/domain/reconstructionObligationLedgerSchemas.test.ts src/domain/reconstructionVerification.test.ts src/domain/browserScenario.test.ts` — 170 tests passed. - `npm run test:focused -- tests/boundary/mcp/advertisedPatternsVMode.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts` — 8 tests passed. - `npm run check:fast` — passed. - `npm run docs:check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not performed; this changes shared regex ownership and equivalent escapes only. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no authority or data-handling changes. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output (unchanged). - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:09:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2738
No description provided.