Repository navigation
docs(chit): CHIT_INTEGRATION contract for the PMOVES.AI Geometry Bus - #68
Conversation
…n, consumers for the PMOVES.AI Geometry Bus
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
|
|
||
| ## NATS Subjects | ||
|
|
||
| All subjects are published (not subscribed) by this repo and match the parent Geometry Bus subject catalog exactly: |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| | `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`. |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| "x": 0.0, | ||
| "y": 0.0, | ||
| "r": 0.3, | ||
| "constellations": ["..."] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| - 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>`. |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
…egrating repos/services
…, publisher modes, wiring status
8ab0e2f
into
PMOVES.AI-Edition-Hardened
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.mdpoints toPMOVES-ToKenism-Multi/docs/CHIT_INTEGRATION.md, which did not exist).Contents
tokenism.*subjects ourCHITNATSPublisheremits (verified to match the parent catalog exactly)contracts/schemas/tokenism/*.v1.schema.jsonchit.cgp.v0.2spec)NATS_URLresolution order)Everything in the doc is verified against actual code and schemas in this repo and the parent catalog — nothing aspirational.