Skip to content

fix(parsers): reject unknown directive attributes and unparsed remainder (THQ-357) - #535

Merged
transitrix merged 2 commits into
mainfrom
methodology/357-directive-attributes
Aug 27, 2026
Merged

fix(parsers): reject unknown directive attributes and unparsed remainder (THQ-357)#535
transitrix merged 2 commits into
mainfrom
methodology/357-directive-attributes

Conversation

@transitrix

@transitrix transitrix commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes task THQ-357 — both document parsers now reject unknown directive attributes and unparsed text.

Matches DIRECTIVE_LANGUAGE §7: unknown or malformed syntax is TTRS-002 (or message in view-engine), distinct from recognised-but-unimplemented (TTRS-004).

Changes to both packages (document-renderer and document-view-engine):

  • view and figure directives allowlist their known attributes
  • Unknown attributes (e.g., bogus = x) are errors
  • Unparsed remainder after attribute pairs (e.g., leftover text) are errors
  • Known attributes still parse: fit, as for view; caption, as for figure

Test plan

  • view with unknown attribute fails parser
  • figure with unknown attribute fails parser
  • Unparsed remainder after attributes is flagged
  • Known attributes continue to work
  • All existing tests in both packages pass

transitrix and others added 2 commits August 27, 2026 12:06
…t views

- Normalize line endings in --check comparison so CRLF checkouts report clean
- Plugin description now mentions the three document views (MRD, SRS, SDD)
  that onboard offers alongside diagram and report views
- Fix overbroad README claim: "this package" has zero dependencies, not
  "every package in this repository" (document-view-engine and
  plugin-examples have dependencies)
- Regenerate portable transitrix/plugin.json to match updated source

Closes transitrix-hq#358

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: transitrix <automation@transitrix.com>
Both document-renderer and document-view-engine now reject unknown
\`view\` and \`figure\` directive attributes, matching DIRECTIVE_LANGUAGE
§7 which specifies unknown syntax is an error (TTRS-002 / error message).

Changes:
- parseAttrs() returns both parsed attributes and unparsed remainder
- parseView/parseFigure allowlist known attributes (fit, as, caption)
- Unknown attributes or leftover text after valid pairs are errors
- Tests cover: unknown attributes, unparsed remainder, existing attributes

Matches spec: unparsed remainder and unknown keys are failures, distinct
from recognised-but-unimplemented constructs (TTRS-004).

Closes transitrix-hq#357

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Signed-off-by: transitrix <automation@transitrix.com>
@transitrix
transitrix merged commit 2d48557 into main Aug 27, 2026
12 checks passed
@transitrix
transitrix deleted the methodology/357-directive-attributes branch August 27, 2026 09:57
@vkgeorgia vkgeorgia changed the title fix(parsers): reject unknown directive attributes and unparsed remainder (transitrix-hq#357) fix(parsers): reject unknown directive attributes and unparsed remainder (THQ-357) Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant