Repository navigation
Conversation
properties and additionalProperties:false sit on the `related` ARRAY node as
siblings of items, while items is bare {"type": "object"}. Both keywords
apply to object instances, so against an array they match nothing and are
silently skipped. The only rule in force is "each item is an object":
dest-uuid need not be a string or even present, and any key is accepted.
committed schema -> ACCEPTS {"dest-uuid": 12345, "totally-bogus-key": "x"}
fixed schema -> REJECTS: 12345 is not of type 'string'
Enumerating every key across all 64,683 related entries: dest-uuid 64683,
type 64683, tags 19421 -- plus refs 2, synonyms 1, payment-method 1,
price 1, which are value-level metadata written one level too deep.
Move properties/additionalProperties inside items, require dest-uuid and
type (present on all 64,683 entries), and add a UUID pattern for dest-uuid.
Migrate the four stray keys to the value's meta rather than dropping them
(android/RedAlert2, ransomware/Booyah, surveillance-vendor/RedLattice), and
remove the two related entries on microsoft-activity-group/NOBELIUM with an
empty dest-uuid. Version bumped on all four clusters.
Verified: 64,681 related entries validate with 0 failures; full-schema
validation passes on the touched and largest clusters; check_schema passes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HZGwPoa8MMfkhCw47rDLA4
Only the android cluster version conflicted: main is at 27 after its new entries, so it is now 28. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
BLUF —
schema_clusters.jsonmisplaces itsrelatedkeywords, so any related entry validates todayschema_clusters.jsonthepropertiesandadditionalProperties: falsekeywords onrelatedsit on the array node besideitemsrather than inside it, so JSON Schema skips them and the only rule enforced is "each item is an object" —dest-uuidmay be a non-string or absent, and any key at all is accepted.itemsand addrequired: [dest-uuid, type], then correct the four entries inandroid.json,microsoft-activity-group.json,ransomware.jsonandsurveillance-vendor.jsonwhere value-level metadata (refs,synonyms,payment-method,price) was written one level too deep.relatedentries instead of waving them through.Problem
schema_clusters.jsonlooks like it constrainsrelatedentries, but it does not.propertiesandadditionalProperties: falsesit on the array node, as siblings ofitems, whileitemsis left bare:In JSON Schema,
propertiesandadditionalPropertiesapply to an object instance. The instance here is an array, so both keywords match nothing and are silently skipped. The one rule in force is "each item is an object" —dest-uuidneed not be a string, or present at all, and any key whatsoever is accepted.Demonstrated against both schemas with
{"dest-uuid": 12345, "totally-bogus-key": "x"}:Three records have already drifted through the gap. I enumerated every key used across all 64,683
relatedentries in the repo:dest-uuid,typeandtagsare the intended vocabulary. The other four are value-level metadata that was written one level too deep.Fix
Schema — move
propertiesandadditionalProperties: falseinsideitemswhere they take effect, addrequired: ["dest-uuid", "type"](both are present on all 64,683 entries, so this codifies existing practice), and constraindest-uuidwith a UUIDpattern.Data — the stray keys are migrated to the value's
meta, where they belong, rather than deleted:android.jsonrelated.synonyms→meta.synonymsransomware.jsonrelated.refs,related.payment-method,related.price→meta.*surveillance-vendor.jsonrelated.refs→meta.refsmicrosoft-activity-group.jsonhad tworelatedentries on NOBELIUM with"dest-uuid": ""— they point at nothing and would fail the new pattern, so they are removed.All four touched clusters get a
versionbump so instances pick the corrections up.Verification
(64,681 rather than 64,683 — the two empty-
dest-uuidNOBELIUM entries are gone.)Note
This makes the schema structurally enforce
related. It does not check that adest-uuidresolves to a cluster that exists — 2,214 edges currently point at unknown uuids. That is a referential-integrity check for CI, submitted separately.🤖 Generated with Claude Code