Repository navigation
feat(WO16): ISC-WF-1 workflow extension in interscript-py - #833
Merged
Merged
Conversation
Implement the ISC-WF-1 workflow extension in the Python runtime per maps docs/isc-wf-1.md (normative draft 1.0): - new src/interscript/isc.py: recursive-descent .isc parser (port of interscript-ts src/isc/parser.ts). W1 named rulesets and W2 use-with-override resolve at parse time: macro splice of expanded ruleset items at the use position, recursive with cycle detection (parse error), child-wins row overrides on exact from-equality (kept-in-order then overrides; unmatched overrides appended), with cross-map `use alias.<ident>` via a dependency resolver callback. - W3 language conditioning is runtime: the IR gains only optional `languages` on the document and optional `when` arrays on sub rules; the executor filters per the caller-selected language (guards inert without a declared selection; a guard-applicable rule beats an unguarded same-from rule, at the literal level in tree mode and at compiled-pattern level in megaregexp mode). The public API gains an optional language parameter. - parse fidelity: parse+convert output is structurally identical to the TypeScript-built compiled artifact for all 404 corpus maps, and all 408 corpus .isc sources (maps + libs) parse. Tests: 74 new (parser constructs, expansion/cycles, override merge, guard precedence/inertness, additive IR decode, synthetic fixtures through the full parse-execute path). Additivity gate: all 11,048 golden rows byte-identical before/after; the existing suite is unchanged.
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, W1 named rulesets, W2 use-with-override, W3 language conditioning) in interscript-py:
src/interscript/isc.py: recursive-descent.iscparser (port of interscript-tssrc/isc/parser.ts). W1/W2 resolve at parse time — macro splice of expanded ruleset items at theuseposition, recursive with cycle detection; child-wins row overrides on exact from-equality; cross-mapuse alias.<ident>via a dependency resolver callback.languages(document) and optionalwhenarrays (sub rules); the executor filters per the caller-selected language — guards inert without a selection, guard-applicable beats unguarded same-from, at literal level in tree mode and compiled-pattern level in megaregexp mode. Public API gains an optionallanguageparameter (transliterate(..., language=)).Verification
tests/test_isc_wf1.py,tests/test_isc_parser.py) — parser constructs, expansion/cycles, override merge, guard precedence/inertness, additive IR decode, synthetic fixtures through the full parse-execute path.parse_isc+ convert output is structurally identical to the TypeScript-built compiled artifact for all 404 corpus maps; all 408 corpus.iscsources (maps + libs) parse.interscript-rs tests/golden/isc-wf0.jsonl, 11,048 rows, fresh IR artifact built from current corpus) — 11,043/11,048 byte-identical; the 5 deltas are the known pre-existing alalc-ell-Grek-Latn-2010 executor constraint issue (tracked separately, pre-dates this change and is unrelated to ISC-WF-1).