Repository navigation
feat(domination): read and write IATA SSIM dates (AV-97, #405) - #498
Conversation
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
craig-o-curtis
left a comment
There was a problem hiding this comment.
Requesting changes for two items. The library code itself has no defect; the rest is minor.
Fix before merge
-
packages/gmt/skills/gmt-aviation/SKILL.md:66saysisValidSsimDate"narrowsunknowntostring". The real signature isisValidSsimDate(value: string, options): boolean, with no type guard. Code that follows the skill failstsc --strict(TS2345, TS2322), and the skill ships in the npm package. Either add the three overloadsisValidFixUtcTimestampuses, withtypeof value === "string" &&in the body, or delete the clause. -
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-formed31APR26and30FEB26, 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 day01to tell the cases apart and probe the window separately, or reword the message so it is true for every fall-through. Add tests for31APR26and an out-of-range first year; none exists.
Smaller items
parseSsimDate.ts:22,formatSsimDate.ts:23and the header ofinternal/ssimDate.tsrest on AECFA's guide, which is offline. ACL's An Introductory Guide to SSIM is reachable and shows upper-caseDDMMM; add it to the Sources line.SKILL.md:25says the date appears in "a validity period or a creation date". No cited source gives the creation-date format. Drop it or cite one.formatSsimDate.ts:15saysvalueis a date "asTemporal.PlainDate.fromandisValidDateaccept it".PlainDate.fromalso accepts2026-10-25T10:00, which the formatter rejects. Say "asisValidDateaccepts it".parseSsimDate.tscallsreadYearWindowStartbefore it checks the shape, so with"rolling"every input reads the clock, including garbage. Swap the two steps, asinternal/patternToken.tsdoes. Output does not change.parseSsimDate.test.ts:20and:27, andformatSsimDate.test.ts:45, use the array form ofit.each; the checklist asks for the template form.context/coding-standards.md:318still says "latermaritime/,aviation/", and the directory list atcontext/code-review-checklist.md:18lacksaviation/andhealthcare/.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.apps/dox/src/lib/dox-tools.ts,showSsimDateReaderInput:localehas no length cap, whilevalueanddatedo. Add one.ssim-date-reader.module.cssdeclares.striptwice; 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.
formatSsimDaterefuses 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_DOCSindices 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 checkandapi-surface checkpass.
Not verified
- EUROCONTROL's CSST Users Guide §3.2 (the site returns 403), so
05APR10and16DEC09are 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.
|
Thanks, @craig-o-curtis. All eleven items are fixed in 432d4c7. Fix before merge
Smaller items
Checks run
|
craig-o-curtis
left a comment
There was a problem hiding this comment.
All eleven items are addressed in 432d4c7.
- The skill no longer claims
isValidSsimDatenarrowsunknown, and the creation-date wording is gone. - The reader names the reason by asking the library again (window, then case, then day), so
31APR26and 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
formatSsimDatewording is fixed. - The parser reads the clock only after the shape check.
- The
it.eachcalls use the template form. - The context lists name
aviation/andhealthcare/. - The "What comes next" section is cut,
localeis capped, and.stripis 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.
Closes #405 (AV-97).
Summary
This adds an
aviationnamespace that reads, writes and checks the date in IATA SSIM airline schedule files. An SSIM date isDDMMMYY, such as01JAN26. It is not ISO 8601, and noTemporal.*.fromreads 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/aviationparseSsimDate(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.JANtoDECare a constant table, never read throughIntland never case-folded.01jan26,01ENE26and01JANV26are refused, and the answer is the same under every locale in the matrix.options.yearWindowis required, with no default (INT-15'sTwoDigitYearOptions). Without it the parser and formatter return""and the validator returnsfalse.overflow: "reject". Examples are29FEB25and31APR26./parse,/formatand/validate. Sentinels are""andfalse. Nothing throws.internal/ssimDate.ts, andcontext/coding-standards.mdgains a scoped exception for it. Nothing is added toregex/: a value is a date only once its century is known, so no pattern can say whether it is valid.2. Dox
/tools/ssim-date-reader/, with the chat toolshowSsimDateReader, a starter and the permalinkssim. It reads a date with the window you state, besideparseDateWithPatternunder 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./mistakes/aviation/, and the scenario An SSIM Month Read in the Wrong Language.3. Agent skill
gmt-aviationTanStack Intent skill. It is inskill_tree.yamlanddomain_map.yaml, in the skills install command, and in the worker vocabulary.4. Merge with main
showHl7TimestampReaderisDOX_TOOL_DOCS[45]andshowSsimDateReaderisDOX_TOOL_DOCS[46].pnpm dox:generatewere run again, and the corpus holds both stories' functions. Stats and both READMEs were regenerated withpnpm stats:sync, andstats checkandapi-surface checkpass. The root bundle is 579,106 bytes, under its 584,000 budget.Why
Sources
context/domination/issues/AV-97.md.Validation
All on the tree after the merge with main:
pnpm validateran all 23 checks. 21 passed before it stopped attest:dox, which failed one test:head-tags.test.tsfound nodateModifiedon the HL7 guidehealthcare-clinical-timestamps. That date comes fromgit log, and the merge was not yet committed, so no commit that HEAD could reach had the HL7 guide.node scripts/affected.mjs run --only dox-pages,build:dox,test:dox,test:gmtrebuilt the site and ran both suites. All 4 checks passed:test:dox19,053 of 19,053 tests andtest:gmt73,261 of 73,261.node scripts/stats.mjs checkandnode scripts/api-surface.mjs checkpass 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/gmtminor, for the new namespace. Merging publishes nothing.