Feedback on MarkdownParser (src/main/scala/05-MarkdownParser.scala) from dogfooding reqT-lang to author the requirements (PRD) of the genscalator project (https://codeberg.org/bjornregnell/genscalator). The language is a pleasure to write requirements in — thanks. Three improvement candidates, in priority order. All are non-breaking / opt-in; happy to prototype and open a verified PR once the reqT release constraints are checked.
1. Optional strict / lint mode for unknown concepts (highest value)
Unknown capitalized-colon terms fall through to a Text attribute (case _ => appendUntilEnd(Text), ~line 188). This graceful degradation is great for forgiving authoring, but it means a typo (Feautre: x has) or an un-mapped term silently becomes Text — data loss with no signal. For agent + human authoring at scale that is a real hazard.
Proposal: an opt-in strict/lint mode — e.g. parseModel(input, strict = true), or a parseWithWarnings(input): (Model, List[Warning]) — that emits a warning when a Capitalized:-prefixed token is not a known EntType/RelType/AttrType, e.g.:
line 42: unknown concept Feautre — did you mean Feature? (kept as Text)
Default stays lenient (no behavior change). This surfaces typos and makes divergences visible when feeding an external document through the parser as a baseline/ground-truth fixture.
2. Source positions on Elems
Elems carry no line/column, so lint or editor diagnostics cannot point at a location. Threading a line index through parseLines onto each Elem (or a parallel position map keyed by identity) would enable precise diagnostics and editor tooling, and pairs naturally with (1).
3. Id-handling edge cases
The id construction (~lines 124–150) allows spaces in ids (id = s"$idStart ... $idExtra") and has empty-id / id-is-a-concept-name branches that are intricate. Worth: a few property tests around these cases, and a documented decision on whether multi-word ids are intended vs single-token camelCase (a trailing-space id around line 148 looks possibly unintended).
Context: genscalator is a research project on typed, safe-by-design tools for AI coding agents; it now expresses its own PRD in reqT-lang and plans a small in-sourced parser (a tt reqt tool) that reuses this grammar. We will keep filing issues here for feedback and later propose verified PRs. Filed via the genscalator agent workflow.
Feedback on
MarkdownParser(src/main/scala/05-MarkdownParser.scala) from dogfooding reqT-lang to author the requirements (PRD) of the genscalator project (https://codeberg.org/bjornregnell/genscalator). The language is a pleasure to write requirements in — thanks. Three improvement candidates, in priority order. All are non-breaking / opt-in; happy to prototype and open a verified PR once the reqT release constraints are checked.1. Optional strict / lint mode for unknown concepts (highest value)
Unknown capitalized-colon terms fall through to a
Textattribute (case _ => appendUntilEnd(Text), ~line 188). This graceful degradation is great for forgiving authoring, but it means a typo (Feautre: x has) or an un-mapped term silently becomesText— data loss with no signal. For agent + human authoring at scale that is a real hazard.Proposal: an opt-in strict/lint mode — e.g.
parseModel(input, strict = true), or aparseWithWarnings(input): (Model, List[Warning])— that emits a warning when aCapitalized:-prefixed token is not a knownEntType/RelType/AttrType, e.g.:Default stays lenient (no behavior change). This surfaces typos and makes divergences visible when feeding an external document through the parser as a baseline/ground-truth fixture.
2. Source positions on
ElemsElems carry no line/column, so lint or editor diagnostics cannot point at a location. Threading a line index throughparseLinesonto eachElem(or a parallel position map keyed by identity) would enable precise diagnostics and editor tooling, and pairs naturally with (1).3. Id-handling edge cases
The id construction (~lines 124–150) allows spaces in ids (
id = s"$idStart ... $idExtra") and has empty-id / id-is-a-concept-name branches that are intricate. Worth: a few property tests around these cases, and a documented decision on whether multi-word ids are intended vs single-token camelCase (a trailing-space id around line 148 looks possibly unintended).Context: genscalator is a research project on typed, safe-by-design tools for AI coding agents; it now expresses its own PRD in reqT-lang and plans a small in-sourced parser (a
tt reqttool) that reuses this grammar. We will keep filing issues here for feedback and later propose verified PRs. Filed via the genscalator agent workflow.