From 337365551c50b8074d070c0298d0bc913579e7ee Mon Sep 17 00:00:00 2001 From: Dayz Tech Co Date: Sun, 26 Jul 2026 10:56:05 +0100 Subject: [PATCH] fix: co-locate example/schema JSON files in docs/ alongside STORAGE_SCHEMA.md Moves project-metadata.example.json, project-metadata.schema.json, review-cid.example.json, and review-cid.schema.json from repo root into docs/ where STORAGE_SCHEMA.md lives. Updates all cross-references in README.md, dongle-smartcontract/README.md, and PRODUCTION_LAUNCH_CHECKLIST.md to point to the new paths. Closes #386 --- PRODUCTION_LAUNCH_CHECKLIST.md | 2 +- README.md | 8 ++++---- docs/STORAGE_SCHEMA.md | 11 +++++++++++ .../project-metadata.example.json | 0 .../project-metadata.schema.json | 0 .../review-cid.example.json | 0 review-cid.schema.json => docs/review-cid.schema.json | 0 dongle-smartcontract/README.md | 4 ++-- 8 files changed, 18 insertions(+), 7 deletions(-) rename project-metadata.example.json => docs/project-metadata.example.json (100%) rename project-metadata.schema.json => docs/project-metadata.schema.json (100%) rename review-cid.example.json => docs/review-cid.example.json (100%) rename review-cid.schema.json => docs/review-cid.schema.json (100%) diff --git a/PRODUCTION_LAUNCH_CHECKLIST.md b/PRODUCTION_LAUNCH_CHECKLIST.md index 139f6014..5f262ea0 100644 --- a/PRODUCTION_LAUNCH_CHECKLIST.md +++ b/PRODUCTION_LAUNCH_CHECKLIST.md @@ -75,7 +75,7 @@ This checklist must be completed before deploying the Dongle smart contract to S ## 6. Data Schema & Events - [ ] Event schema (`EVENTS_SCHEMA.md`) matches emitted events in production code -- [ ] Review CID schema (`review-cid.schema.json`) validated against example (`review-cid.example.json`) +- [ ] Review CID schema (`docs/review-cid.schema.json`) validated against example (`docs/review-cid.example.json`) - [ ] Data export guide (`DATA_EXPORT_GUIDE.md`) tested against Testnet data - [ ] Indexers confirmed to be handling all event types in `EVENTS_SCHEMA.md` diff --git a/README.md b/README.md index 04bc4e26..3b2c8429 100644 --- a/README.md +++ b/README.md @@ -105,10 +105,10 @@ Projects can attach extended metadata via IPFS CIDs. Follow the JSON schema: | Schema | Purpose | |--------|---------| -| [`project-metadata.schema.json`](./project-metadata.schema.json) | Project metadata structure | -| [`project-metadata.example.json`](./project-metadata.example.json) | Example valid document | -| [`review-cid.schema.json`](./review-cid.schema.json) | Review content structure | -| [`review-cid.example.json`](./review-cid.example.json) | Example review document | +| [`project-metadata.schema.json`](./docs/project-metadata.schema.json) | Project metadata structure | +| [`project-metadata.example.json`](./docs/project-metadata.example.json) | Example valid document | +| [`review-cid.schema.json`](./docs/review-cid.schema.json) | Review content structure | +| [`review-cid.example.json`](./docs/review-cid.example.json) | Example review document | **Key guidelines:** - Pin metadata on IPFS and verify the CID matches on-chain `metadata_cid` diff --git a/docs/STORAGE_SCHEMA.md b/docs/STORAGE_SCHEMA.md index f88b892a..4790de09 100644 --- a/docs/STORAGE_SCHEMA.md +++ b/docs/STORAGE_SCHEMA.md @@ -24,6 +24,17 @@ A project is stored under the key `Project(u64)` and contains the following fiel | `created_at` | `u64` | Timestamp of project creation | No | | `updated_at` | `u64` | Timestamp of last update | No | +## Off-Chain JSON Schemas + +The following JSON schema and example files are co-located here in `docs/`: + +| File | Purpose | +|------|---------| +| [`project-metadata.schema.json`](./project-metadata.schema.json) | Project metadata JSON schema | +| [`project-metadata.example.json`](./project-metadata.example.json) | Example valid project metadata document | +| [`review-cid.schema.json`](./review-cid.schema.json) | Review content JSON schema | +| [`review-cid.example.json`](./review-cid.example.json) | Example valid review document | + ## Validation Rules - `bounty_url`: If provided, must be a valid HTTP/HTTPS URL (starts with `http://` or `https://`). diff --git a/project-metadata.example.json b/docs/project-metadata.example.json similarity index 100% rename from project-metadata.example.json rename to docs/project-metadata.example.json diff --git a/project-metadata.schema.json b/docs/project-metadata.schema.json similarity index 100% rename from project-metadata.schema.json rename to docs/project-metadata.schema.json diff --git a/review-cid.example.json b/docs/review-cid.example.json similarity index 100% rename from review-cid.example.json rename to docs/review-cid.example.json diff --git a/review-cid.schema.json b/docs/review-cid.schema.json similarity index 100% rename from review-cid.schema.json rename to docs/review-cid.schema.json diff --git a/dongle-smartcontract/README.md b/dongle-smartcontract/README.md index 047efb89..4b0a7946 100644 --- a/dongle-smartcontract/README.md +++ b/dongle-smartcontract/README.md @@ -1734,8 +1734,8 @@ src/ - **Event Reference:** [EVENTS_SCHEMA.md](../EVENTS_SCHEMA.md) defines topics, payload structures, and compatibility patterns for all emitted contract events. - **Threat Model:** [THREAT_MODEL.md](../THREAT_MODEL.md) documents trust boundaries, admin capabilities, mitigation steps, and unresolved risks. -- **Review CID Schema:** [review-cid.schema.json](../review-cid.schema.json) defines the off-chain JSON schema expected for review content CIDs. -- **Review Example:** [review-cid.example.json](../review-cid.example.json) provides a valid off-chain review document matching the schema. +- **Review CID Schema:** [review-cid.schema.json](../docs/review-cid.schema.json) defines the off-chain JSON schema expected for review content CIDs. +- **Review Example:** [review-cid.example.json](../docs/review-cid.example.json) provides a valid off-chain review document matching the schema. ## Contributing