Repository navigation
feat(pages)!: refuse an empty pages mapping when the file is parsed - #548
Merged
Merged
Conversation
The update endpoint rejects an empty body, so pages: {} configured nothing; the planner noted it and the run went on. The shape now refuses it naming the three intents it could have meant, the published schema mirrors the refusal with minProperties, and the plan-time branch goes. The upgrade guide records it under the Pages refusal section.
There was a problem hiding this comment.
🟡 Changes recommended
The empty-map check still admits mappings containing only undefined fields, allowing an empty API payload.
1 open finding
What changed in this PR
Moves empty Pages mapping rejection from planning to validation and the published schema.
Changes:
- Rejects
pages: {}during parsing and schema validation. - Removes the obsolete planner note.
- Updates tests and migration documentation.
| File | Description |
|---|---|
src/sections/pages/schema.ts |
Adds empty-mapping validation. |
src/sections/pages/index.ts |
Removes plan-time handling. |
test/sections/pages/schema.test.ts |
Tests parse rejection. |
test/sections/pages/pages.test.ts |
Removes obsolete planner test. |
test/published-schema.test.ts |
Tests runtime/schema agreement. |
docs/sections/pages.docs.yml |
Documents the refusal. |
docs/reference/coverage.md |
Updates generated coverage documentation. |
docs/upgrading/v2-to-v3.md |
Adds the breaking change summary. |
docs/upgrading/v2-to-v3/refusals-repository.md |
Documents migration guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.

Before
After
How
minProperties: 1, so an editor flags the line as it is written.pages: {}. The fold merges keywise and validates each layer, so an empty placeholder never contributed a field.Proof
pages: {}and on a one-field mapping, and the pages suites; 428 across the touched suites.bun run build:checkmatches every generated file; typecheck, biome, and knip green.Technical details
pages: {}ran with a note before and fails validation now; the v2-to-v3 guide records it under section 38 beside the other Pages refusals, and the summary table row names it.BEGIN_COMMIT_OVERRIDE
feat(pages)!: refuse an empty pages mapping when the file is parsed
BREAKING CHANGE:
pages: {}fails validation instead of running with a note; declare at least one field, declarepages: nullto disable the site, or remove the section.END_COMMIT_OVERRIDE