formats: JSON Schema format assertion for idn-hostname and the file unknown (step 4b-2 of #80) #831
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#831
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 4b-2 of the epic #80 (formats: JSON Schema). Step 4b-1 (#829, landed in PR #830) asserts
email,idn-email,hostnameandduration;formatFailureinstd/json-schema/src/formats.trbstill letsidn-hostnamepass. This step adds it, and with it the last file of the suite'soptional/format/directory (unknown), so the directory is complete afterwards. Theformat-assertionvocabulary (the suite fileoptional/format-assertion) is its own step 4b-3 and thecontent*keywords become 4b-4, both filed when they start; this issue is one PR.Goal
validate(..., assertFormat: true)refuses a string that is not anidn-hostname, with the keywordformatand the message the other formats give, and the suite filesoptional/format/idn-hostnameandoptional/format/unknownrun.Requirements
idn-hostname: an internationalized host name as RFC 5890 reads it: dot-separated labels that are U-labels or A-labels, each valid under IDNA 2008, 63 bytes at most as an A-label, 253 bytes at most as a whole, no trailing dot. Decided by the loop: read withDomainName.tryFromofstd/dns(it owns UTS #46 processing and the A-label check; no second grammar here), after the checkstryFromleaves out on purpose and that need no table: a label that starts or ends with a hyphen, a hyphen in the third and fourth position of a U-label (RFC 5891 section 4.2.3.1; DNS.md section 3 runs withCheckHyphens=false), and a trailing dot (also U+3002, U+FF0E, U+FF61, asidn-emaildoes in 4b-1). Plain ASCII host names are valididn-hostnamevalues too.DomainName.tryFromdoes not yet implement the rest of UTS #46 and RFC 5892/5893 (open: #365: CONTEXTJ, CONTEXTO, the Bidi rule, the combining-mark rule, the disallowed code points of the mapping table). Decided by the loop: do not wait for #365 and do not copy its rules into this package; assertidn-hostnameonDomainNameas it is. Each suite case ofoptional/format/idn-hostnamethat the result decides the other way goes intodifferences()ofsuite.test.trbwith a reason that names the missing rule and #365 (as the twodate-time/timecases do), so the entry fails the test once #365 lands and is then deleted; no case is skipped. The implementer measures which cases these are (expected: the CONTEXTJ/CONTEXTO groups, the three "Begins with a ... Mark" cases, the Bidi cases and the disallowed-exception cases); a difference whose verdict can be closed with a check that needs no table is closed informats.trbinstead.formatFailureanswers a failure foridn-hostname; the list in the doc comment offormats.trband the "Format" section ofdocs/standard-library/json-schema.md(table, and the sentence that saysidn-hostname"passes until step 4b-2") are updated, with a short list of what is not decided like the suite yet and why; regenerateskills/if the docs check asks.optional/format/idn-hostnameandoptional/format/unknownare added tosuite-cases.trb(regenerated from release 23.1.0 as for the other format files; the header comment andsuitePartsfollow, the doc comments no longer sayidn-hostnamewaits) and run withassertFormat: true.unknownneeds no code: a format the package does not know passes, the file proves it.Acceptance criteria
assertFormat: true, a valid and an invalid string foridn-hostname(a Hangul name, thexn--form of the same, a name with a leading hyphen, a trailing dot, a label of 64 bytes) give valid and aformatfailure; with the default option it still only annotates (unit tests injson-schema.test.trb).optional/format/idn-hostnameandoptional/format/unknownpass insuite.test.trb; every case decided the other way is indifferences()with a reason that names the missing rule and #365.formatFailurestill passes unknown formats; the docs page saysidn-hostnameis asserted, on which rules, and which cases wait for #365.sh tools/gates.sh agreen in forge CI;torb format --checkclean on touched files.Governing record
ROADMAP.md, format versions and the epic #80 (
formatis an annotation by default and an assertion by option); DNS.md section 3 for whatDomainNamedoes and does not cover; RFC 5890, RFC 5891 section 4.2.3.1, RFC 5892 and RFC 5893 for the rules named above.Seed impact
None. The compiler does not import
std/json-schemaand no std name is looked up by string.Size
One PR, two Conventional Commits:
feat(std/json-schema): assert the idn-hostname format(code, unit tests, docs) andtest(std/json-schema): run the idn-hostname and unknown suite files(generated cases, differences). Smaller than #829: one format on an existing parser, 51 and 13 generated cases.Dependencies
Step 4b-2 of #80. Needs #829 (landed) and
std/dnsDomainName(built). Not blocked by #365: its rules shrink the named differences when they land.[loop:torbscript] claim implement by session:loop-torbscript-831-impl until 2026-11-16T15:50:00Z
Reason: #831 is the focus, ready, no PR yet, a worker slot is free.
[loop:torbscript] release by session:loop-torbscript-831-impl
implement: PR #834 open (commits
7826e55,153f271), merge gate review requested from Argus; forge CI is pending (runner queue), no job red.next: waiting (CI running, then the merge gate; a red job gets a fix worker on branch loop/831-idn-hostname-format)
[status] PR #834 merged (
f8bfefa5ee), task closed by it. Open next step: the merged code is in no release yet. Release state: main still carries version 0.1.0 (project.trb, compiler/project.trb, editors/vscode/package.json, compiler/src/package/version.trb), the only tag of the minor is v0.1.0-rc.1 (2026-11-15), and no stable v0.1.0 exists although docs/contributing/releasing.md schedules it for 2026-10-06. Choosing between a stable v0.1.0 tag on main (publishes stores, packages, images) and a new candidate needs the release line settled first: the calendar lists v0.3.0-rc.1 for 2026-11-24 while main says 0.1.0. Not cut in this run. Next step: align the version on main with the intended release, then tag per docs/contributing/releasing.md.