mattrguerra/meridian-skillsmainPrivate on GitHub, published here in full

label_variants.md

Language Markdown4.9 KB95 lines

skills/production-speed-csv/references/label_variants.md

  1. # Label Variants: Turnaround Options
  2. The Meridian Display Co. product page template does not use a consistent vocabulary for turnaround labels. The same backend field ("Turnaround Option" / "Turnaround Options") displays with different labels on different product pages, sometimes within the same category.
  3. The script's `TIER_PATTERNS` list in `scripts/build_speed_csv.py` matches by case-insensitive keyword. As long as the option text contains "standard", "express", or "super express" (with optional whitespace), it gets classified correctly.
  4. The labels are read from the `data-option-label` attribute of each radio option inside the `md-option-group` div whose heading says "Turnaround Option(s)". Every variant below has a matching case in the test fixture (`scripts/fixtures/`), so a change to the parser can be checked offline against `scripts/fixtures/expected.csv`.
  5. ## Observed variants
  6. All variants below were observed on meridiandisplay.example during initial skill construction. The script handles all of them.
  7. ### Standard tier
  8. | Label text | Notes |
  9. |---|---|
  10. | `Standard Turnaround` | Most common. Modular booth kits, SEG frame pages, lightbox pages. |
  11. | `Standard turnaround` | Lowercase t. Backlit fabric display page. |
  12. | `Standard turnaround:` | Trailing colon. Backlit fabric display variant. |
  13. | `Standard Order` | Used on "request-a-quote" style product pages: Booth Concept A, Booth Concept B and Monitor Stand Bridge in the 10x10 booth category. |
  14. ### Express tier
  15. | Label text | Notes |
  16. |---|---|
  17. | `Express Turnaround` | Most common. |
  18. | `Express turnaround` | Lowercase. |
  19. | `Express turnaround:` | With colon. |
  20. | `Express order` | Lowercase "order", same context as "Standard Order". |
  21. ### Super Express tier
  22. | Label text | Notes |
  23. |---|---|
  24. | `Super Express Turnaround` | Lightweight SEG Frame Display. |
  25. | `Super Express turnaround` | Backlit fabric display, and it often runs into the next word with no space: "Super Express turnaround1 business day". |
  26. ## Day-count formatting variants
  27. The day count itself also varies in formatting. The `DAYS_RE` regex (`(\d+)\s*business\s*day`) handles all observed cases:
  28. | Source string | Days extracted |
  29. |---|---|
  30. | `12 business days + transit` | 12 |
  31. | `8 business days + transit` | 8 |
  32. | `1 business day + transit` (singular) | 1 |
  33. | `Turnaround10 business days` (missing space) | 10 |
  34. | `business days ` (extra spaces, trailing) | extracted normally |
  35. ## Caveats
  36. A few products attach a constraint to a specific tier. The `CAVEAT_RE` regex captures parenthetical text that mentions "only," "available," "except," "excludes," or "sizes."
  37. Observed caveats:
  38. | Product | Tier | Caveat |
  39. |---|---|---|
  40. | 10ft Backlit Fabric Display | Super Express | `only available for 8ft & 10ft widths` |
  41. The script captures caveats but writes only the numeric day count to the cell. Caveats are printed to stderr at the end of the run so they're surfaced but kept out of the machine-readable column.
  42. If Matt asks for caveats in the cell, change the `format_days_cell` callsite in `run()` to append the caveat. The data is in `tiers["super_express"]["caveat"]`.
  43. ## Adding a new variant
  44. If a future product page introduces a new variant the script doesn't recognize, the script will:
  45. 1. Log the option to stderr with `couldn't be matched to a tier (add to TIER_PATTERNS)` and print the raw `data-option-label` string.
  46. 2. Skip that option in the CSV output (so the row may show fewer tiers than expected).
  47. The fixture's Monitor Stand Bridge page carries an "Economy Turnaround" option on purpose, so you can see what this log line looks like.
  48. To add it:
  49. 1. Open `scripts/build_speed_csv.py`.
  50. 2. Find the `TIER_PATTERNS` list.
  51. 3. Add the new keyword to the matching tier's regex. For example, if Meridian introduces a new "Priority" label that should map to Express, and a "Basic" label that should map to Standard:
  52. ```python
  53. TIER_PATTERNS = [
  54. ("super_express", re.compile(r"\bsuper\s*express\b", re.I)),
  55. ("express", re.compile(r"\b(express|priority)\b", re.I)),
  56. ("standard", re.compile(r"\b(standard|basic)\b", re.I)),
  57. ]
  58. ```
  59. 4. Re-run the script on the failing category and verify the variant now classifies correctly. If you add a fixture page for it, update `scripts/fixtures/expected.csv` too.
  60. **Don't** loosen the regex so much that it false-positives. The "super_express" pattern is checked first specifically so "Super Express Turnaround" doesn't get caught by the "Express" or "Turnaround" patterns. Keep that ordering.
  61. ## Anti-patterns to avoid
  62. - **Don't pattern-match on "Turnaround" alone.** Every tier's label contains "Turnaround." Match on the qualifier word.
  63. - **Don't trust whitespace.** Several option labels have inconsistent or missing whitespace. The regex uses `\s*` not literal spaces.
  64. - **Don't ignore the "Order" variants.** Three products in the 10x10 booth category use "Standard Order" / "Express order" instead of "Turnaround." There may be more in other categories.