Skip to content

feat(domination): read and write IATA SSIM dates (AV-97, #405) - #498

Merged
craig-o-curtis merged 4 commits into
mainfrom
feature/405-av-97-ssim-dates
Nov 11, 2026
Merged

craig-o-curtis merged 4 commits into
mainfrom
feature/405-av-97-ssim-dates

Conversation

@baldurpan

Copy link
Copy Markdown
Contributor

Closes #405 (AV-97).

Summary

This adds an aviation namespace that reads, writes and checks the date in IATA SSIM airline schedule files. An SSIM date is DDMMMYY, such as 01JAN26. It is not ISO 8601, and no Temporal.*.from reads it. Two mistakes are common with it. Code that reads the month through the platform's language breaks on a machine that is not set to English. Code that picks the century itself is wrong for either an archive or a forward schedule. Here the month letters are a fixed code, and the caller states the century. The Dox site gains the SSIM Date Reader and an aviation guide.

What Changed

1. Library: @northguild/gmt/aviation

  • parseSsimDate(value, options) reads an SSIM date and returns an ISO date.
  • formatSsimDate(value, options) writes an ISO date as an SSIM date. It returns "" for a year outside the window, because written as two digits that year would read back as another century. It takes only an ISO calendar date.
  • isValidSsimDate(value, options) calls the parser, so the two cannot disagree.
  • The month is a fixed English code. The letters JAN to DEC are a constant table, never read through Intl and never case-folded. 01jan26, 01ENE26 and 01JANV26 are refused, and the answer is the same under every locale in the matrix.
  • The century is the caller's. options.yearWindow is required, with no default (INT-15's TwoDigitYearOptions). Without it the parser and formatter return "" and the validator returns false.
  • A day that does not exist is refused by Temporal with overflow: "reject". Examples are 29FEB25 and 31APR26.
  • Subpaths /parse, /format and /validate. Sentinels are "" and false. Nothing throws.
  • The grammar is one regex in internal/ssimDate.ts, and context/coding-standards.md gains a scoped exception for it. Nothing is added to regex/: a value is a date only once its century is known, so no pattern can say whether it is valid.

2. Dox

  • The SSIM Date Reader at /tools/ssim-date-reader/, with the chat tool showSsimDateReader, a starter and the permalink ssim. It reads a date with the window you state, beside parseDateWithPattern under a locale you pick, so the reader sees why a locale parser gets the month wrong. It also writes an ISO date back. It opens on a French-locale preset so the difference shows straight away.
  • The guide Aviation: Message Times, /mistakes/aviation/, and the scenario An SSIM Month Read in the Wrong Language.
  • The Aviation industry: hub text, a control tower glyph and an example area.
  • The gate scripts (contrast, grow, HTML diff, readout-still, visual snapshot) list the new tool page.

3. Agent skill

  • A gmt-aviation TanStack Intent skill. It is in skill_tree.yaml and domain_map.yaml, in the skills install command, and in the worker vocabulary.

4. Merge with main

  • main gained HLTH-93 (feat(domination): read and write HL7 v2 timestamps (HLTH-93, #401) #494) while this branch was open. Both industries, namespaces, skills and chat tools are kept, with main's first: showHl7TimestampReader is DOX_TOOL_DOCS[45] and showSsimDateReader is DOX_TOOL_DOCS[46].
  • On the merged tree, the gmt build and pnpm dox:generate were run again, and the corpus holds both stories' functions. Stats and both READMEs were regenerated with pnpm stats:sync, and stats check and api-surface check pass. The root bundle is 579,106 bytes, under its 584,000 budget.

Why

  • Airlines exchange schedules in SSIM files. Their dates are a code, not a sentence in a language, and their two-digit years say nothing about the century.
  • Both mistakes are silent: nothing fails, and the date comes out wrong.

Sources

  • IATA does not publish SSIM openly, and the Chapter 7 text was not reached. The JSDoc says so in one line.
  • EUROCONTROL's CSST Users Guide (§3.2, Figure 1) shows the seven-character form. ACL (UK) shows the day and the month letters, and Avinor shows the two-digit year. The owner accepted these sources as meeting the story's bar. The full table is in context/domination/issues/AV-97.md.

Validation

All on the tree after the merge with main:

  • pnpm validate ran all 23 checks. 21 passed before it stopped at test:dox, which failed one test: head-tags.test.ts found no dateModified on the HL7 guide healthcare-clinical-timestamps. That date comes from git log, and the merge was not yet committed, so no commit that HEAD could reach had the HL7 guide.
  • After the merge commit, node scripts/affected.mjs run --only dox-pages,build:dox,test:dox,test:gmt rebuilt the site and ran both suites. All 4 checks passed: test:dox 19,053 of 19,053 tests and test:gmt 73,261 of 73,261.
  • node scripts/stats.mjs check and node scripts/api-surface.mjs check pass on the merged tree.

Risk / Impact

Low. The namespace is new, and nothing existing changes behaviour. The Dox changes add one tool, one guide and one industry.

Release

.changeset/aviation-ssim-dates.md: @northguild/gmt minor, for the new namespace. Merging publishes nothing.

Airline schedule files in IATA SSIM formats write a date as DDMMMYY,
such as 01JAN26. It is not ISO 8601, so no Temporal.*.from reads it.
A parser that reads the month through the platform's language breaks
on a machine whose locale is not English, and a parser that picks the
century itself is wrong for either the archive or the forward
schedule.

Library: a new aviation namespace, @northguild/gmt/aviation, with the
subpaths parse, format and validate.

- parseSsimDate(value, options) reads an SSIM date into an ISO date.
- formatSsimDate(value, options) writes an ISO date as an SSIM date.
  It refuses a year outside the window.
- isValidSsimDate(value, options) is true exactly when the parser
  reads the value.
- The month letters are a fixed English, upper-case code, never read
  through Intl and never case-folded. The century is the caller's:
  yearWindow is required, as in INT-15. Days that do not exist are
  refused by Temporal with overflow reject.
- The grammar is one regex in internal/ssimDate.ts. A scoped exception
  in context/coding-standards.md covers it.

Dox: the SSIM Date Reader tool with a chat tool, the guide Aviation:
message times, /mistakes/aviation/, a scenario, and the Aviation
industry (hub text, control tower glyph, overview). The gate scripts
list the new tool page.

Agent skill: a gmt-aviation TanStack Intent skill, in skill_tree.yaml
and domain_map.yaml, and in the worker vocabulary.

Sources: EUROCONTROL's CSST Users Guide shows the seven-character
form, and ACL (UK) and Avinor corroborate the parts. IATA's Chapter 7
text was not reached, and the JSDoc says so.
…m-dates

# Conflicts:
#	README.md
#	apps/dox/src/content/docs/guides/index.mdx
#	apps/dox/src/content/docs/guides/industries/index.mdx
#	apps/dox/src/content/docs/guides/integration/skills.mdx
#	apps/dox/src/data/gmt-stats.json
#	apps/dox/src/data/industries.json
#	apps/dox/src/lib/chat-constants.ts
#	apps/dox/src/lib/dox-tools.ts
#	apps/dox/src/lib/industry-overview.ts
#	apps/dox/src/lib/industry-tags.ts
#	apps/dox/src/lib/namespace-summary.ts
#	context/dox/built.md
#	packages/gmt/README.md
#	packages/gmt/skills/_artifacts/domain_map.yaml
#	packages/gmt/skills/_artifacts/skill_spec.md
@baldurpan baldurpan added this to the Domination milestone Nov 10, 2026
@baldurpan baldurpan added documentation Improvements or additions to documentation enhancement New feature or request gmt skills labels Nov 10, 2026

@craig-o-curtis craig-o-curtis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for two items. The library code itself has no defect; the rest is minor.

Fix before merge

  1. packages/gmt/skills/gmt-aviation/SKILL.md:66 says isValidSsimDate "narrows unknown to string". The real signature is isValidSsimDate(value: string, options): boolean, with no type guard. Code that follows the skill fails tsc --strict (TS2345, TS2322), and the skill ships in the npm package. Either add the three overloads isValidFixUtcTimestamp uses, with typeof value === "string" && in the body, or delete the clause.

  2. apps/dox/src/lib/ssim-date-reader.ts, readSsim (about lines 395-410): a refusal that is neither "no window" nor "lower case" falls through to the shape message. The reader then says "Not two digits, three upper-case English month letters and two digits." for well-formed 31APR26 and 30FEB26, and for a first year the library rejects (10000, -1). That statement is false for all of them. Either re-read the same text with day 01 to tell the cases apart and probe the window separately, or reword the message so it is true for every fall-through. Add tests for 31APR26 and an out-of-range first year; none exists.

Smaller items

  1. parseSsimDate.ts:22, formatSsimDate.ts:23 and the header of internal/ssimDate.ts rest on AECFA's guide, which is offline. ACL's An Introductory Guide to SSIM is reachable and shows upper-case DDMMM; add it to the Sources line.
  2. SKILL.md:25 says the date appears in "a validity period or a creation date". No cited source gives the creation-date format. Drop it or cite one.
  3. formatSsimDate.ts:15 says value is a date "as Temporal.PlainDate.from and isValidDate accept it". PlainDate.from also accepts 2026-10-25T10:00, which the formatter rejects. Say "as isValidDate accepts it".
  4. parseSsimDate.ts calls readYearWindowStart before it checks the shape, so with "rolling" every input reads the clock, including garbage. Swap the two steps, as internal/patternToken.ts does. Output does not change.
  5. parseSsimDate.test.ts:20 and :27, and formatSsimDate.test.ts:45, use the array form of it.each; the checklist asks for the template form.
  6. context/coding-standards.md:318 still says "later maritime/, aviation/", and the directory list at context/code-review-checklist.md:18 lacks aviation/ and healthcare/.
  7. guides/industries/aviation-message-times.mdx, "What comes next": the line promising METAR and NOTAM pages is a roadmap for functions that have not shipped. Cut it.
  8. apps/dox/src/lib/dox-tools.ts, showSsimDateReaderInput: locale has no length cap, while value and date do. Add one.
  9. ssim-date-reader.module.css declares .strip twice; merge the two blocks.

Checked and fine

  • Month codes are a fixed English table; no Intl, no case folding. The 17-locale matrix passes.
  • The regex is ASCII-only, anchored, and runs in linear time.
  • The caller states the century. The rolling window follows the UTC year, and window edges are exact.
  • Days that do not exist are refused, with correct leap-year handling.
  • formatSsimDate refuses years outside the window, with exact edges.
  • The validator calls the parser, so they cannot disagree. Nothing throws (the no-throw harness passes).
  • Exports, changeset, README sync and tracker are correct.
  • Chat tool, starter, permalink and worker registration are in place. DOX_TOOL_DOCS indices are consistent (HL7 45, SSIM 46).
  • Time in Dox comes from gmt calls only. No left-border accents or rounded corners.
  • 302 aviation tests, the Dox unit tests, tsc, oxlint, oxfmt, stylelint, stats check and api-surface check pass.

Not verified

  • EUROCONTROL's CSST Users Guide §3.2 (the site returns 403), so 05APR10 and 16DEC09 are unchecked by me.
  • The Playwright gates in three browsers and both themes, the visual and HTML diff baselines, a hand keyboard and contrast pass, and live chat checks.

Answers the review of #498.

The SSIM Date Reader in Dox said the text had the wrong shape for
every refusal it could not name. That was false for a day that does
not exist (31APR26) and for a first year the library refuses (10000).
It now asks the library: it reads 01JAN00 to test the window, the
text in upper case to test the case, and the text with day 01 to
test the day. Each probe call is shown in the calls panel. The shape
message is now true for every case that is left.

The aviation skill no longer says isValidSsimDate narrows unknown to
string, since it takes a string and returns a boolean, as the other
two-argument validators do. It no longer says the date appears in a
creation date, which no source shows.

The parser checks the shape before it reads the window, so a rolling
window reads the clock only for text that could be a date. Output is
unchanged. The Sources lines cite ACL's Introductory Guide to SSIM,
which is online, next to AECFA's guide, which is not. The formatter's
JSDoc says value is a date as isValidDate accepts it, since
Temporal.PlainDate.from also accepts a date-time.

The shared SSIM test rows are named objects, so every it.each title
reads its fields by name, and the formatter's own table is a template.
The coding standard and the review checklist list aviation, healthcare
and recurrence. The aviation guide drops its METAR and NOTAM promise.
The chat tool caps the locale at 35 characters, and the reader's two
.strip blocks are one.
@baldurpan

Copy link
Copy Markdown
Contributor Author

Thanks, @craig-o-curtis. All eleven items are fixed in 432d4c7.

Fix before merge

  1. The skill's narrowing claim. I deleted the clause rather than adding overloads. The other two-argument validators (isValidEdifactDate, isValidX12Date, isValidHL7) take a string and return a plain boolean, so this keeps the four alike and leaves the public types as they are. If you would rather have the type guard, the three overloads are a small follow-up.

  2. The reader's false shape message. The reader now asks the library instead of guessing. After a refusal it makes up to three more calls in the same window:

    • 01JAN00. If that is refused, the window is the reason: The library refuses this window: a first year is a whole number from 0 to 9900.
    • The typed text in upper case. If that reads, case is the reason.
    • The typed text with day 01. If that reads, the day is the reason: That month has no such day in the windowed year.

    The shape message is left for text where none of the three names a reason, so it is now true. Day 01 exists in every month of every year, so text with day 01, the right shape and a valid window always reads. Every probe shows in the calls panel, and a probe whose text is the typed text is skipped. Tests: a 19-row table (31APR26, 30FEB26, 29FEB25, 29FEB00 in a 1900 window, 00JAN26, 32JAN26, first years 10000, 9901 and -1, lower case, and four shape cases), an exact-calls test for 31APR26, and two mount tests that paste 31APR26 and 10000. The leap-1900 preset's special flag is gone.

Smaller items

  1. Sources. The Sources lines in parseSsimDate.ts and formatSsimDate.ts, and the header of internal/ssimDate.ts, now cite ACL's An Introductory Guide to SSIM (April 2021). The header gives its URL. AECFA's guide stays, marked as no longer online. The guide page already cited ACL.
  2. Creation date. Dropped from SKILL.md.
  3. formatSsimDate JSDoc. It now says as isValidDate accepts it.
  4. Step order. parseSsimDate checks the shape before it reads the window, as patternToken.ts does. Output is unchanged, and the 254 aviation tests pass.
  5. it.each form. The formatter's own table is a template now. The parse rows are shared with isValidSsimDate.test.ts, which sweeps each one through both functions to check they agree, and a template literal cannot be exported and swept. So test/ssimDateRows.ts now exports named object rows ({ value, yearWindow, expected } and { value, yearWindow, reason }), and the titles read $value, $yearWindow and $expected. This is the form hl7ParseRows.ts and parseHL7.test.ts use for shared rows. If you want the parse test to keep its own template copy instead, say so.
  6. Context files. coding-standards.md lists aviation/ and healthcare/ as industry layers, with maritime/ still to come. The checklist's directory list adds aviation/, healthcare/ and recurrence/, which was also missing.
  7. What comes next. Cut. It was the only line in that section, so the heading went with it.
  8. Locale cap. showSsimDateReaderInput takes a locale of 2 to 35 characters, the same as the Duration Parser Bench. A schema test covers en, 35 characters, 36 characters and e.
  9. .strip. The two blocks are merged into one.

Checks run

  • The 254 aviation tests, the 94 SSIM Date Reader tests and the 49 worker tool tests pass. tsc is clean.
  • pnpm validate: all 23 checks pass, including the full gmt suite (73,261 tests) and the Dox suite (19,076 tests).
  • stats check and api-surface check pass.
  • I did not run the Playwright gates.

@craig-o-curtis
craig-o-curtis enabled auto-merge (squash) November 11, 2026 08:09

@craig-o-curtis craig-o-curtis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All eleven items are addressed in 432d4c7.

  • The skill no longer claims isValidSsimDate narrows unknown, and the creation-date wording is gone.
  • The reader names the reason by asking the library again (window, then case, then day), so 31APR26 and a bad first year no longer get the shape message. New tests cover both.
  • The ACL guide is cited in the JSDoc and the internal header, and the formatSsimDate wording is fixed.
  • The parser reads the clock only after the shape check.
  • The it.each calls use the template form.
  • The context lists name aviation/ and healthcare/.
  • The "What comes next" section is cut, locale is capped, and .strip is merged.

I re-ran the aviation and SSIM tests (302) and the reader, mount and worker tests (143) at the new head: all pass. CI is green apart from Tests (Node 24), which was still running when I checked.

@craig-o-curtis
craig-o-curtis merged commit f6a00ee into main Nov 11, 2026
81 of 82 checks passed
@craig-o-curtis
craig-o-curtis deleted the feature/405-av-97-ssim-dates branch November 11, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request gmt skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AV-97: SSIM dates

2 participants