Skip to content

docs(tasks): a wrong entry hides its mapping's type mismatch from check - #5

Merged
adammharris merged 1 commit into
masterfrom
agent/backlog-file-a-wrong-entry-hides-its-mappings-mismatch
Nov 9, 2026
Merged

adammharris merged 1 commit into
masterfrom
agent/backlog-file-a-wrong-entry-hides-its-mappings-mismatch

Conversation

@adammharris

Copy link
Copy Markdown
Member

What

Files a task, docs/tasks/a-wrong-entry-hides-its-mappings-mismatch.md, and lists it in docs/tasks/tasks.md. No code changes.

Why

Schema::check stops reporting a mapping's own type mismatch as soon as any node under it mismatches too. With meta.** typed str:

  • meta: {author: Ann} → meta: expected str, found map
  • meta: {author: 3} → only meta.author: expected str, found int. The mapping's error is gone, although explain still says meta … not str: expected str, found map.

The cause is item_already_said in judge (src/check.rs). It counts a mismatch on any descendant, and its reasoning ("a list that does not fit is one with an item that does not") is only true of a sequence. The task gives the repro, the cause, and when it counts as done. The fix is left for an agent/backlog-a-wrong-entry-hides-its-mappings-mismatch branch.

Verified

  • Reproduced with the fig-schema binary built from 006b101 (master). The task's console output is copied from that run.
  • On that commit, the repo's CI jobs (fmt, clippy -D warnings, test, doc), plus test and clippy with --no-default-features, are all green, so nothing else catches this.
  • fig-schema is not a prov workspace (prov check finds no root), so the task file was written by hand following docs/tasks/tasks.md.

Schema::check drops a container's type mismatch whenever any descendant
already reported one. That is right for a list, which admits its items,
but a mapping under a scalar type is wrong for its own reason, so
`meta: {author: 3}` under `meta.**: str` reports only meta.author while
`explain` says meta is not str either.
@adammharris
adammharris merged commit e851338 into master Nov 9, 2026
6 checks passed
@adammharris
adammharris deleted the agent/backlog-file-a-wrong-entry-hides-its-mappings-mismatch branch November 9, 2026 20:06
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