Skip to content

feat(gateway): ComponentDescriptor v1 β€” C1 keystone adapter (zod, tolerant-reader, PHI-safe) - #55

Merged
supmo668 merged 3 commits into
mainfrom
mangyinm/component-descriptor-v1
Jul 9, 2026
Merged

supmo668 merged 3 commits into
mainfrom
mangyinm/component-descriptor-v1

Conversation

@supmo668

@supmo668 supmo668 commented Jul 9, 2026 •

Copy link
Copy Markdown

C1 keystone (B0 scaffold, A&D openclaw-syntropy-agentic-chat). Additive-only, INERT until B3 wires emission β€” safe to land anytime.

  • ComponentDescriptor v1 zod adapter + ChannelPayloadDescriptor alias, tolerant-reader, gateway-stamped pending_id/expires_at, prototype-pollution guard (stripUnsafeKeys preprocess).
  • 27 tests: shared pact-lite fixtures (manifest-pinned) + adapter behavior + SEC-1 regressions + coverage locks.
  • Monorepo contracts/component-descriptor/v1.schema.json + 10 fixtures land separately (seeds T3.1 registry; SJ Pydantic + mobile Dart adapters consume the same fixtures).

QG: 4 reviewers + scorer, 15 findings / 11β‰₯80 all fixed. SEC-1 HIGH (verified PoC prototype-pollution via proto surviving looseObject) fixed red-first + 3 regressions. tsgo 0 Β· vitest 27/27 Β· sealed 60/60. Receipt 75a5510 verified.

πŸ€– Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for validating and parsing a broader set of component descriptor shapes, including future/unknown fields and additional valid descriptor examples.
  • Bug Fixes

    • Improved handling of invalid descriptor data, including malformed keys, missing required summary content, and pending states without expiry.
    • Strengthened safety when reading descriptor data so unexpected fields are ignored more reliably.

supmo668 and others added 3 commits July 8, 2026 19:23
…+ pact-lite contract test (C1 keystone, B0) β€” tolerant-reader schema (looseObject), gateway-stamped pending_id/expires_at pair, vendored shared fixtures 10/10; canonical schema at monorepo contracts/component-descriptor/v1.schema.json

Generated-With: Claude Code
Co-Authored-By: openclaw <[email protected]>
Co-Authored-By: Claude <[email protected]>
…v1 β€” SEC-1 prototype-pollution guard (stripUnsafeKeys preprocess; red-first regression x3), TEST-1..7 coverage locks (props boundary, expires_at negatives, one-directional dependency, pattern/enum tables), CODE-1 fixtures re-vendored byte-identical + oxfmt ignore, TEST-8 fixture manifest backstop, DESIGN-1 ChannelPayloadDescriptor alias, SEC-2 pending_id provenance JSDoc; 27/27 green

QGR-Finding: SEC-1
Generated-With: Claude Code
Co-Authored-By: openclaw <[email protected]>
Co-Authored-By: Claude <[email protected]>
…scriptor v1 adapter

Generated-With: Claude Code
Co-Authored-By: openclaw <[email protected]>
Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ac1a34f3-98e5-478b-af25-cd697f6e90ae

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 5b9fc6d and 7446367.

πŸ“’ Files selected for processing (15)
  • .oxfmtrc.jsonc
  • src/gateway/__fixtures__/component-descriptor/README.md
  • src/gateway/__fixtures__/component-descriptor/invalid/bad_field_descriptor.json
  • src/gateway/__fixtures__/component-descriptor/invalid/bad_key_format.json
  • src/gateway/__fixtures__/component-descriptor/invalid/missing_summary.json
  • src/gateway/__fixtures__/component-descriptor/invalid/pending_without_expiry.json
  • src/gateway/__fixtures__/component-descriptor/invalid/weak_pending_id.json
  • src/gateway/__fixtures__/component-descriptor/invalid/wrong_type_discriminator.json
  • src/gateway/__fixtures__/component-descriptor/valid/food_log_card_preview.json
  • src/gateway/__fixtures__/component-descriptor/valid/goto_navigate.json
  • src/gateway/__fixtures__/component-descriptor/valid/paywall_card_minimal.json
  • src/gateway/__fixtures__/component-descriptor/valid/unknown_future_fields_tolerated.json
  • src/gateway/component-descriptor.schema.test.ts
  • src/gateway/component-descriptor.schema.ts
  • workstreams/openclaw/qgr/SyntropyHealth-Applications-mo-openclaw-openclaw-SyntropyHealth-Applications-qgr-pr-prep-20260708-1937-75a5510.md

πŸ“ Walkthrough

Walkthrough

Adds a Zod-based ComponentDescriptor schema module with prototype-pollution sanitization, pending_id/expires_at validation, and a parse helper. Includes vendored pact-lite fixture JSON files (valid/invalid) with a README, a comprehensive schema test suite, an oxfmt ignore update, and a QGR receipt document.

Changes

Component Descriptor Schema

Layer / File(s) Summary
Schema module
src/gateway/component-descriptor.schema.ts
Defines sanitization (stripUnsafeKeys), field/UI/descriptor Zod schemas, refinement enforcing expires_at with pending_id, exported types/aliases, and parseComponentDescriptor helper.
Vendored fixtures
src/gateway/__fixtures__/component-descriptor/{valid,invalid}/*, .../README.md
Adds valid and invalid component-descriptor JSON fixtures and README documenting vendoring/drift-gate requirements.
Schema test suite
src/gateway/component-descriptor.schema.test.ts
Loads fixtures, checks drift detection, validates contract parsing, adapter behavior (nulls, tolerance, pollution defenses, date formats), and coverage-lock cases.
Formatter config
.oxfmtrc.jsonc
Adds src/gateway/__fixtures__/ to ignorePatterns.
QGR receipt
workstreams/openclaw/qgr/*.md
Adds a pr-prep receipt document with hash anchors and verification summary.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant parseComponentDescriptor
  participant stripUnsafeKeys
  participant ComponentDescriptorSchema
  participant Fixture

  Test->>Fixture: load JSON fixture
  Test->>parseComponentDescriptor: parse(fixtureData)
  parseComponentDescriptor->>ComponentDescriptorSchema: safeParse(value)
  ComponentDescriptorSchema->>stripUnsafeKeys: preprocess(value)
  stripUnsafeKeys-->>ComponentDescriptorSchema: sanitized value
  ComponentDescriptorSchema-->>parseComponentDescriptor: success/failure
  parseComponentDescriptor-->>Test: descriptor or null
Loading

Poem

A rabbit hops through JSON fields so neat,
Stripping __proto__ before it can cheat,
Fixtures vendored, byte for byte,
Schemas guard the gateway tight,
Hop, parse, validate β€” descriptors complete! πŸ‡βœ¨

πŸš₯ Pre-merge checks | βœ… 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing most required template sections, including change type, scope, verification, security impact, and compatibility. Rewrite it using the template and add the missing sections: Summary, Change Type, Scope, Linked Issue/PR, Security Impact, Verification, Evidence, and Risks.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (3 passed)
Check name Status Explanation
Title check βœ… Passed The title is specific and accurately summarizes the main gateway ComponentDescriptor adapter change.
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.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mangyinm/component-descriptor-v1

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.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ Formal models conformance drift detected

The formal models extracted constants (generated/*) do not match this openclaw PR.

This check is informational (not blocking merges yet).
See the formal-models-conformance-drift artifact for the diff.

If this change is intentional, follow up by updating the formal models repo or regenerating the extracted artifacts there.

@supmo668
supmo668 merged commit d57ad93 into main Jul 9, 2026
7 of 13 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