Skip to content

Refuse schema names whose derived id is a date (#3674) - #3678

Merged
malibio merged 2 commits into
mainfrom
issue-3674-schema-date-id
Oct 7, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-3674-schema-date-id

Conversation

@malibio

@malibio malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

create_schema now refuses a name whose derived id is a valid YYYY-MM-DD date (e.g. "2026-10-06", "2026_10_06", "2026 10 06"), reusing the date node's id predicate. The check runs beside the core-type check, before any write. Digit-bearing names ("Invoice 2026", "Q4-2026") remain accepted.

Closes #3674

🤖 Generated with Claude Code

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review Summary

Small, well-scoped change (3 files, +40/-1) that does exactly what #3674 asks. The check sits beside the core-type check in create_schema, reuses the existing is_date_node_id predicate (widened to pub(crate)) rather than a new regex, and runs before any write. Net positive; no blockers.

Acceptance criteria

  • Rejects date-shaped derived ids incl. "2026_10_06" / "2026 10 06" with an error saying the name cannot be a date: met (message is actionable, suggests "Log ").
  • Digit-bearing names ("Invoice 2026", "Q4-2026") still accepted: met, covered by test.
  • Runs before any node is written: met; placed right after normalize_schema_id/core-type check, before relationship validation and node creation. Test asserts no schema node exists afterward.
  • Refusal and acceptance tests; refusal test fails without the check: met. Without the check fields: [] creates the schema, so expect_err panics for each of the three names.
  • quality:fix: not verifiable here; confirm before merge.

Findings

Critical Issues

None.

Suggested Improvements

None blocking.

Nitpicks

  • Nit: packages/core/tests/it/kebab_schema_id_test.rs: the "nothing left behind" assertion only checks 2026-10-06; since all three names derive the same id, that is sufficient, but a short comment saying so would help.
  • Nit: the predicate also validates calendar semantics, so "2026-13-45" is accepted. That matches what a date node id is, so it is correct; no change needed.
  • CLAUDE.md compliance: no literal node_type comparison, no lifecycle reads, no compat code, no wire type or schema change, so the node-type sequence and node-types.md do not apply. No new docs required (issue says none expected).

Recommendation

APPROVE. Run /address-review next per project workflow (expected: nothing to address).

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval).

@malibio

malibio commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the one nit (comment in the test). Skipped none else; reviewer noted the calendar-validity behaviour of the predicate needs no change. Comment-only change, no re-review needed.

malibio and others added 2 commits October 7, 2026 10:40
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@malibio
malibio force-pushed the issue-3674-schema-date-id branch from 6eed7b8 to 06b6e5a Compare October 7, 2026 08:40
@malibio
malibio merged commit a77d697 into main Oct 7, 2026
@malibio
malibio deleted the issue-3674-schema-date-id branch October 7, 2026 08:40
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.

Refuse schema names whose derived id looks like a date

1 participant