Skip to content

docs(chit): CHIT_INTEGRATION contract for the PMOVES.AI Geometry Bus - #68

Merged
POWERFULMOVES merged 3 commits into
PMOVES.AI-Edition-Hardenedfrom
docs/chit-integration
Nov 8, 2026
Merged

POWERFULMOVES merged 3 commits into
PMOVES.AI-Edition-Hardenedfrom
docs/chit-integration

Conversation

@POWERFULMOVES

Copy link
Copy Markdown
Owner

Summary

Adds docs/CHIT_INTEGRATION.md — the contract document the parent PMOVES.AI repo references from its NATS subject catalog (pmoves/.claude/context/geometry-nats-subjects.md points to PMOVES-ToKenism-Multi/docs/CHIT_INTEGRATION.md, which did not exist).

Contents

  • The four tokenism.* subjects our CHITNATSPublisher emits (verified to match the parent catalog exactly)
  • Required/optional payload keys per event, straight from contracts/schemas/tokenism/*.v1.schema.json
  • Full JSON payload examples (chit.cgp.v0.2 spec)
  • AJV fail-closed validation guarantees and log-line grep targets
  • NATS connection config (NATS_URL resolution order)
  • Parent-side consumers table (publisher-discord, Hi-RAG v2, Shape Store, consciousness service) with enablement flags

Everything in the doc is verified against actual code and schemas in this repo and the parent catalog — nothing aspirational.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T20:07:00.365578Z b25ff87 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b25ff873ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/CHIT_INTEGRATION.md

## NATS Subjects

All subjects are published (not subscribed) by this repo and match the parent Geometry Bus subject catalog exactly:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe the publisher as unwired

A repo-wide search for all four publish methods finds no production call site: outside tests, CHITNATSPublisher is only re-exported from integrations/contracts/chit/index.ts. Consequently, running this repo's weekly simulation does not currently publish any of these subjects, so deployments relying on this statement will monitor events that never occur; describe this as an opt-in publisher API or identify and wire the actual simulation entry point.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in bf87094: Overview now carries a Wiring status paragraph stating plainly that CHITNATSPublisher has no production call site yet (tests/re-exports only) and that subjects are a forward contract until simulator wiring lands.

Comment thread docs/CHIT_INTEGRATION.md Outdated
| `tokenism.cgp.weekly.v1` | Weekly CGP export (end-of-week attribution summary) | `week, cgp, super_node_count, total_attributions, cgp_spec` | `gini, poverty_rate` |
| `tokenism.cgp.ready.v1` | CGP document ready for downstream consumption (also used by parent research services: DeepResearch / SupaSerch CGP publish) | `cgp, super_node_count, source, cgp_spec, timestamp` | `week` |

The CGP document embedded in `cgp` follows spec `chit.cgp.v0.2` (weekly export) / `chit.cgp.v0.1` (research-produced CGPs), and itself validates against `contracts/schemas/geometry/cgp.v1.schema.json`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge List only CGP versions accepted by the bus

A research producer following this contract and sending chit.cgp.v0.1 will be rejected before publication: both contracts/schemas/geometry/cgp.v1.schema.json and cgp.ready.v1.schema.json permit only chit.cgp.v0.2 and chit.cgp.v1.0. Conversely, CGPGenerator.generateWeeklyCGP() currently emits chit.cgp.v1.0, not the documented weekly v0.2; update the version mapping to reflect the actual accepted and generated formats.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in bf87094: the doc now cites the spec enum from geometry/cgp.v1.schema.json — only chit.cgp.v0.2 and chit.cgp.v1.0 are accepted by the bus; the incorrect v0.1 claim is removed.

Comment thread docs/CHIT_INTEGRATION.md Outdated
"x": 0.0,
"y": 0.0,
"r": 0.3,
"constellations": ["..."]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the contract payload examples schema-valid

Running the four JSON blocks through the publisher's AJV schemas rejects every example: this constellations entry must be an object, line 79 supplies null where merkle_root must be a string, line 91 uses running instead of the allowed active/draft/archived statuses, and line 107 uses a string where a super-node object is required. Copying any payload reference into an integration therefore produces no event; replace the placeholders with minimal valid objects and omit an absent optional Merkle root.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in bf87094: all four JSON examples were regenerated and AJV-validated against the repo's actual schemas (result: valid 4 / invalid 0) — constellations entries are objects with required points[] (each point has id), merkle_root matches ^0x[a-fA-F0-9]{64}$, swarm status uses the enum value active, and cgp.ready carries a proper super_node object. Every example now passes the same AJV compile the publisher runs.

Comment thread docs/CHIT_INTEGRATION.md Outdated
Comment on lines +118 to +121
- Every payload is **AJV-validated** against its JSON Schema **before** publish; an invalid payload raises and is **not** published (fail-closed).
- The geometry CGP schema is registered alongside the tokenism schemas so nested `cgp` objects validate against `contracts/schemas/geometry/cgp.v1.schema.json`.
- Publish failures are logged as `[CHIT] Failed to publish <subject>: <reason>` and return `false` to the caller.
- Successful publishes log `[CHIT] Published <subject>: <pack_id>`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document strict and default publishing behavior separately

These guarantees do not match either publisher mode. With the default strictPublish: false, schema errors are caught, logged, and returned as false rather than raised; with strictPublish: true, fail() throws before emitting the documented failure log. The success messages are also event-specific and do not contain <subject>: <pack_id>. Callers deciding between exception handling and boolean checks, and operators configuring log matching, need the two modes and actual message formats documented explicitly.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in bf87094: the Guarantees section now documents both modes separately — default strictPublish:false catches schema errors, logs [CHIT] Failed to publish : and returns false; strictPublish:true throws. In both modes an invalid payload is never published.

@POWERFULMOVES
POWERFULMOVES merged commit 8ab0e2f into PMOVES.AI-Edition-Hardened Nov 8, 2026
13 of 14 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