Skip to content

Bug: reject duplicate JSON keys before catalog and Pocket Board validation #24

Closed

Description

@drevendev

Verified on master

Baseline c2cbcf07ae67263ec7dbeb7cfb5822ea65b49c38, reviewed 2026-10-19 on Python 3.13.5.

Two public examples decode JSON with plain json.loads() before validating the resulting object:

  • tools/catalog.py, blob db02dd26: an otherwise valid resource containing "evidence":"not-reviewed","evidence":"source-reviewed" passes the CLI with exit 0. The first value is silently discarded.
  • examples/application-starter/app.py, blob e42afcac: a task containing "status":"open","status":"done" is accepted as done, and /health reports 200 OK.

This is not an upstream Python bug: accepting the last repeated value is documented behavior. The problem is that these strict teaching validators discard evidence of an ambiguous input before checking it.

Priority / existing implementation

P1 data-integrity follow-up. Existing branches beautifulrepo/catalog-duplicate-keys-20261018 (currently 9412ba80) and beautifulrepo/workshop-hardening-20261018 (currently 6d215bc8) contain candidate work. Inspect and integrate useful work rather than implementing duplicate branches. Neither candidate is part of the reviewed master.

Acceptance

  • Detect repeated object keys during decoding, including nested objects and equivalent Unicode-escaped keys.
  • Permit the same field name in separate objects; reject duplicates only within the same object.
  • Catalog fails with a controlled error and preserves output; Pocket Board rejects the fixture and reports unavailable readiness.
  • Add regressions for duplicate root/record keys, escaped equivalents and ordinary valid input.
  • Run actual full repository tests, catalog regeneration/check and link checks after integration.

Reference: https://docs.python.org/3/library/json.html#repeated-names-within-an-object .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions