fix(cli): restore Authority (A) and canonical segment widths in ChittyID patterns - #25
Draft
chitcommit wants to merge 1 commit into
Draft
fix(cli): restore Authority (A) and canonical segment widths in ChittyID patterns#25chitcommit wants to merge 1 commit into
chitcommit wants to merge 1 commit into
Conversation
…yID patterns
chitty-cli's `structured` pattern used [PLTE], silently dropping A
(Authority) — a direct violation of chittycanon://gov/governance#core-types
in the service that owns the format. It also allowed \d{2,4} for YYMM and
required digits in the final segment.
`extended` required a 1-char segment 8, so it matched no real ID, and left
its type segment fully open — because isChittyId() ORs the patterns, that
let a non-canonical entity type pass the whole check. Compatibility relaxes
segment shape, not the entity-type set.
Widths now follow VV-G-LLL-SSSS-T-YYMM-C-XX per this repo's own
CHARTER/README/CLAUDE. LLL is alphanumeric to cover both live 'USA' and the
documented '001'.
Not touched: src/hybrid/{master-entity-schema,id-translation-worker}.js
describe a different legacy "legal ID" whose example contradicts its own
pattern, and neither is reachable from worker.js. Changing that layer's
semantics needs its own decision.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHwB8WGY7wkS3kQMGC8pTL
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittyid | af9e426 | Jul 31 2026, 02:39 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The service that owns the ChittyID format shipped CLI validators that violate it.
chitty-cli.tsCHITTYID_PATTERNS.structuredused[PLTE]— silently dropping A (Authority), one of the five core types (chittycanon://gov/governance#core-types). Every Authority-type ChittyID failed validation in the format's own repo.extendedrequired a 1-char segment 8, so it matched no real ID at all. Worse: it left the type segment fully open, and becauseisChittyId()ORs the patterns, that let a non-canonical entity type pass the entire check.Evidence
Tested against live-minted IDs from
registry.chitty.cc/api/v1/tools:structuredA-type IDs;\d{2,4}YYMM; digit-only seg8P/L/T/E/A,YYMM, alphanumeric seg 7–8extendedX[PLTEA]This repo's own
CHARTER.md:81,README.md:26, andCLAUDE.md:22all specifyVV-G-LLL-SSSS-T-YYMM-C-XX— the docs were already right; only the code disagreed.LLLis alphanumeric to cover both liveUSAand the documented001(CP-A-001-1234-P-2509-I-82).Not in scope
src/hybrid/master-entity-schema.jsandsrc/hybrid/id-translation-worker.jsdescribe a different legacy "legal ID" whose own example (01-N-USA-1234-P-25-3-X) contradicts its own pattern. Neither is reachable fromworker.js(id-translation-worker.jsis referenced by nothing). Changing that layer's semantics needs its own decision rather than a drive-by edit.Validation
Patterns parsed out of the edited file and run against 5 real/documented IDs and 5 malformed inputs: all real accepted, all malformed rejected.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DHwB8WGY7wkS3kQMGC8pTL