Repository navigation
feat(WO16): ISC-WF-1 workflow extension (TypeScript runtime) - #125
Merged
Merged
Conversation
…ditioning Implements ISC-WF-1 (maps docs/isc-wf-1.md, PR #259) for the TypeScript runtime, per the decided design split: - W1/W2 resolve at parse/compile time: the parser accepts ruleset/use/ override, expandDocument() expands uses recursively in place (cycles are IscLoadError) and applies per-site overrides (child-wins on exact from-equality; kept-in-order then overrides). The IR stays flat. - W3 is runtime: maps carry languages on the document and when arrays on rules; the executor filters per the selected language (guard-applicable wins over unguarded same-from; inert otherwise). transliterate and the CLI gain an optional language parameter. IR (interscript.maps.ir.v1) gains only optional document-level languages and optional rule-level when — additive, legacy maps serialize byte-identically. Additivity gate (scripts/wf1-gate.mjs): 408/408 corpus files parse and all 11,048 golden rows are byte-identical before/after (digest 77bb59bf...); 11,043/11,048 match the rs golden (5 pre-existing alalc-ell-Grek-Latn-2010 deltas present on main).
§4.2.5 requires the whole expansion (kept + override rows) to share the enclosing single longest-match pass; appending override rows as bare stage rules gave each its own pass, so a replacement could be preempted by the generic row it was meant to supersede. When the expansion ends with a parallel block, overrides now join that block (ruby-reference semantics); otherwise they append as bare rules (unchanged fallback).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the ISC-WF-1 workflow extension (maps docs/isc-wf-1.md) in the TypeScript runtime:
ruleset <ident> { ... }(W1),use <ident>/use <ident> override { rows }(W2),languagesdeclarations (W3),when tag, ...guard suffix on sub rules; keyword-table join with pass-through for maps using the words as identifiers.src/isc/expand.ts): macro splice at the use position, recursive with cycle rejection as load error; same-map and dependency-referenced rulesets (use alias.<ident>, declared dependencies only). W2 merge: child-wins replacement on byte-exact from-equality (all same-from duplicates replaced), effective expansion = kept rows in order then override rows.languageson the document,whenarrays on rules); executor filters per the caller-selected language (guards inert without a declared selection; guard-applicable beats unguarded same-from).scripts/wf1-gate.mjs+ WF1 fixture maps.Rebased onto main including the executor constraint fix (#124); includes the override-placement fix (§4.2.6) with failing-first tests.
Verification
test/isc/(parser, expansion semantics, e2e, constraints): 120 tests green locally, including the new trailing-parallel-join specs (watched failing before the fix).test/golden-isc-wf0.test.tsreplays all 11,048 golden-capture rows byte-identically against the current corpus (including the WF-1 pilot maps from maps PR #261 — a pure refactor, zero delta).