Skip to main content

What a Customer Preferred Code Guide contains

The written spec the hand-read fixtures were built against: what a guide prints, what is extracted from it, and the traps that have already caught a parser. Every reading rule here is still true of the documents.

ai_dealer_connect.code_guides.parser implements it; the records it feeds are defined in ai_stellantis.code_guides.extract.

What is extracted

Two pydantic records form the output contract.

  • CodeGuideModelRecord — one per trim variant of a model code. fwp and msrp are the trim's base prices; destination_charge is the standard charge (the separately labeled Hawaii amount is not substituted).
  • CodeGuideFeatureRecord — one per (option, model code, trim, parent package). Its fwp and msrp are the applicable option-price variant when one is printed.

Between the two sits CodeGuideDocument, the envelope: everything the guide says, with no derived record on it. The parser produces the envelope; the derivation reads it.

Document structure

Every guide is a cover page, then one repeating block of sections per model code, then shared back matter.

Cover (page 1) — a MODEL / CODE / PAGES index listing each model code, its vehicle name and the page its section starts on. Unruled: read it outwards from the bold six-character model codes.

Running header on every page — RAM United States (brand) top-left, and 2027 2500 HEAVY DUTY CREW CAB (model year + model name) top-right, both bold.

STEP #1 — SELECT - MODEL CODE. One row: vehicle name, $FWP, $MSRP, and the bold six-character model code.

STEP #2 — SELECT - QUICK ORDER PACKAGE CODE. Two sub-tables:

  • POWERTRAIN AVAILABILITY — a matrix. Left columns are the scaffolding (ENGINE, $FWP, $MSRP, TRANSMISSION, $FWP, $MSRP); everything to the right of the last of those is a trim column. Cells hold 3-character Customer Preferred Package (CPP) codes such as 24A. A trim column may be headed with a trim name, an LLP designator, both, or nothing at all.
  • PACKAGE CONTENT — items bundled into each CPP, marked X under the trim column.

Then FACTORY WHOLESALE PRICE $ and MANUFACTURER SUGGESTED RETAIL PRICE $ — rows labeled with a CPP prefix (24-, 2U-, 29-, 2B-…), one value column per trim. Cells are often blank; match values to columns by where they are printed, never by packing left to right.

STEP #3 — options. One or more tables: a description column, $FWP/$MSRP, then one column per equipment-group tier or per trim. Cell contents: the option's own code = orderable, P = packaged into that column, blank = not available. A row may have several price sub-rows (variants), each with a flush-right qualifier such as W/XBC, FLEET ONLY or W/2_A. Sub-tables are labeled by an unruled banner above them (MOPAR OPTIONS, FLEET ONLY).

The RAM guides also print STEP #3.1#3.4, splitting the step into equipment groups, appearance packages, functional packages and other options. The sub-number is carried as sub_step, and it is what says the columns are equipment groups rather than trims.

STEP #4 — SELECT - COLOR & TRIM CODES. Same structure; columns are interior colors and the option code is in the cell. Paint and trim are always a buyer choice.

GROUP DETAIL — group header rows (code + name + E marks per model code) followed by item rows. (*) Package X includes package Y content folds Y's items into X. Bullets come at two indent levels, separated by x-position and face; the deeper level is a sub-item of the bullet above it, not a second item of the group.

STANDARD EQUIPMENT — one row per item, X under each model code that has it.

Both back-matter tables put the model codes across the top as vertical, one-character- per-line headers.

Key terms

termmeaning
CPPCustomer Preferred Package, e.g. 24A. Its last character is the trim identifier.
LLPLower Level Package: CPP[0] + "_" + CPP[-1], e.g. 24A2_A.
trim_identifierthe single last character of the CPP / LLP.

The rules

  • rule-grammar.md — how the italic/bold compatibility annotations under an option (M/H …, N/A W/…, ONLY 1: …) become OptionRules. Authoritative.
  • features-ground-truth.md — the is_configurable rubric, the merge order and the judgment calls. Authoritative.
  • packages/ai_dealer_connect/tests/data/code_guides/parser/fixtures/*/GROUND_TRUTH.md — per-guide notes on what that guide does differently. They are where the traps are written down.

How the guides differ

Nearly every structural assumption one guide supports, another breaks. The four the spec was first written against:

RAM 2500Grand WagoneerGrand CherokeePacifica
STEP #3 columnsequipment tiers (BASE, A7B)LLP (2_E)trim name over LLPLLP, one column
option codein the description … (DSA)in the cellin the cellin the cell
annotation facebold obliquebold uprightbold uprightbold upright
FLEET ONLYper price sub-rowbannerbannerbanner
CPPs per trimtwooneoneone
trim column headingtrim nametrim namename + LLPnone at all
STEP #3 / #4 pagesseparateseparatesame pagesame page
pricesall printedone section prints noneall printedall printed

Traps that have already caught a parser

  1. A sales code is the last parenthesis of a name, not the first. UCONNECT 5 NAV W 12.0" DISPLAY (USA) (UBQ)UBQ; 8-SPD AUTO 880RE TRANS (MAKE) (DC1)DC1. Both wrong answers are valid-looking option codes, so nothing downstream complains.
  2. Decide "is this a color table?" per table, not per page. Two guides print STEP #3 and STEP #4 on one page.
  3. A P under a trim column is not a parent package — the column is the trim. Under an equipment-group tier it is the package.
  4. A cell spanning several price sub-rows repeats its text once per row — a packaged cell can read "P P".
  5. Blank price cells shift everything if you pack values left to right. DJ7X91 in the RAM guide has three trim columns where each price row leaves a different one blank.
  6. Row boundaries are not table row boundaries. One option can span several ruled bands — its price variants, a code per trim column, or the same cell repeated once per band. Group them by the rules that cross the description column; a rule that starts at the price columns divides a row.
  7. A page's tables are separate tables. Stacked tables share a page; treat a contiguous run of the border as one table, or a page's tables merge into nonsense.
  8. A table that runs onto the next page draws no bottom border, so its last horizontal rule is an interior one. Take the extent from the spine, not from the rules inside it: reading it the other way once left 1,624 GROUP DETAIL lines invisible.
  9. An all-digit token in a code cell is a figure, not a code. The 2026 Grand Wagoneer prints 754 where a sales code goes; it is a fee, and the row yields no record.