8000 fix(parser): reject a fact with more than four elements, PRS-108 (#649) [v2.x backport] by adityamukho · Pull Request #656 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(parser): reject a fact with more than four elements, PRS-108 (#649) [v2.x backport] - #656

Merged
adityamukho merged 1 commit into
mainfrom
fix/649-fact-arity-v2
Oct 20, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/649-fact-arity-v2

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Backport of #654 (v3) to main for a v2.0.x patch. Part of #649 (data-integrity; stays open until the patch is released).

Problem

parse_transact never checked a fact's upper arity. (transact [[:alice :person/age 1 {} 99 :junk]]) succeeded and stored only [:alice :person/age 1]. Present since v0.4.0.

Change

  • A fact of more than four elements fails with the new PRS-108, numbered as in v3.0.0 (same precedent as STG-045 in v2.0.5); the transaction writes nothing. A 5+-element fact whose 4th is not a map now gets PRS-108 instead of PRS-047.
  • Registered in src/error.rs, documented in docs/ERROR_REFERENCE.md.
  • Tests (tests/error_codes_prs_test.rs, +2): 5- and 6-element facts fail with PRS-108; a transaction holding one stores nothing.
  • Docs: CHANGELOG [Unreleased] → Fixed, TEST_COVERAGE, CLAUDE.md and README test counts (1313 total, 1304 passing).
  • No grammar verifier on main, so no KNOWN_DRIFT change here.

Verification

  • cargo test: 1304 passed, 0 failed, 9 ignored.
  • cargo clippy -- -D warnings, cargo fmt --check clean (pre-push hook).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

Backport of #654 from v3. parse_transact read a fact's 4th element as its
optional valid-time map and ignored everything after it, so
[[:alice :person/age 1 {} 99 :junk]] stored [:alice :person/age 1] and
dropped the rest without an error. A fact of more than four elements now
fails with the new PRS-108 (numbered as in v3.0.0) and the transaction
writes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@codecov
codecov Bot commented Oct 20, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

0