diff --git a/.github/workflows/json-validate.yml b/.github/workflows/json-schema-tests.yml similarity index 54% rename from .github/workflows/json-validate.yml rename to .github/workflows/json-schema-tests.yml index f8acd11..6d65910 100644 --- a/.github/workflows/json-validate.yml +++ b/.github/workflows/json-schema-tests.yml @@ -1,4 +1,4 @@ -name: json-validate +name: json-schema-tests on: pull_request: types: [opened, synchronize] @@ -11,7 +11,7 @@ permissions: pull-requests: write # enable write permissions for pull request comments jobs: - json-yaml-validate: + json-validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,3 +22,17 @@ jobs: with: comment: "true" json_schema_version: "draft-04" + + schema-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install the JSON Schema CLI + uses: sourcemeta/jsonschema@v11.1.1 + + - name: Run generic schema unit tests + run: jsonschema test tests/gov-schema.json --resolve schemas/schema-2.0.0.json + + - name: Run CMS schema unit tests + run: jsonschema test tests/cms-schema.json --resolve schemas/cms/schema-0.2.0.json \ No newline at end of file diff --git a/code.json b/code.json index 54fbaea..ebd855c 100644 --- a/code.json +++ b/code.json @@ -1,22 +1,29 @@ { "name": "gov-codejson", "description": "code.json: An agency-wide metadata standard for software projects", - "longDescription": "This repository contains documentation on code.json, a metadata standard used to collect information on the agency's software projects in compliance with M-16-21 and the SHARE IT Act.", + "longDescription": "This repository contains documentation on code.json, a metadata standard used to collect information on agency software projects in compliance with M-16-21 and the SHARE IT Act.", "status": "Production", "permissions": { - "license": [ + "licenses": [ { - "name": "CC0 1.0 Universal", + "name": "CC0-1.0", "URL": "https://github.com/DSACMS/gov-codejson/blob/main/LICENSE" } ], - "usageType": "openSource", + "usageType": [ + "openSource" + ], "exemptionText": "" }, "organization": "Centers for Medicare & Medicaid Services", "repositoryURL": "https://github.com/DSACMS/gov-codejson", + "repositoryHost": "github.com/DSACMS", + "repositoryVisibility": "public", "vcs": "git", "laborHours": 3479, + "reuseFrequency": { + "forks": 2 + }, "platforms": [ "web" ], @@ -26,15 +33,20 @@ ], "softwareType": "standalone/web", "languages": [ - "Markdown" + "javascript" ], - "maintenance": "internal", + "maintenance": "community", + "contractNumber": [], "date": { "created": "2025-02-04T21:59:53Z", - "lastModified": "2025-02-11T18:45:30Z", - "metaDataLastUpdated": "2025-02-11T18:47:02.924Z" + "lastModified": "2025-08-13T22:27:54Z", + "metaDataLastUpdated": "2025-08-15T16:41:02.063Z" }, "tags": [ + "dsacms-tier3", + "government", + "json", + "metadata-standard", "guide", "codejson", "OSPO", @@ -46,17 +58,23 @@ "email": "opensource@cms.hhs.gov", "name": "CMS Open Source Team" }, + "feedbackMechanism": "https://github.com/DSACMS/gov-codejson/issues", + "AIUseCaseID": "0", "localisation": false, "repositoryType": "standards", "userInput": false, - "fismaLevel": "Low", + "fismaLevel": "low", "group": "CMS/OA/DSAC", + "projects": [ + "SHARE IT Act" + ], + "systems": [], + "upstream": "https://github.com/DSACMS/gov-codejson/network/dependencies", "subsetInHealthcare": [ - "Operational" + "operational" ], "userType": [ - "Government" + "government" ], - "repositoryHost": "github.com/DSACMS", "maturityModelTier": 3 } \ No newline at end of file diff --git a/docs/examples.md b/docs/examples.md index 827f614..8e6f0e9 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -1,175 +1,25 @@ # Examples of code.json -Below are good examples of metadata in CMS code.json files. We hope it helps when creating your repository-level code.json file. +Below are examples of well-structured and comprehensive metadata in CMS code.json files. These examples demonstrate best practices for repository-level metadata documentation. + +For additional reference, the [tests directory](../schemas/tests) contain unit tests of code.json files from various DSACMS repositories. These tests help ensure consistency and compliance as we make future updates to the schemas. + +We encourage you to review these examples and tests when creating or updating your repository-level code.json file to maintain consistency with federal standards. ## Example 1: [DedupliFHIR](https://github.com/DSACMS/dedupliFHIR) DedupliFHIR is a desktop app tool that uses AI deduplication to identify duplicates in patient records. It is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project launched in production that receives user input. -``` -{ - "name": "dedupliFHIR", - "description": "Prototype for basic deduplication and aggregation of eCQM data", - "longDescription": "A CLI bundled with an electron front-end that provides data-linkage and AI deduplication for reported ACO data at scale.", - "status": "Production", - "permissions": { - "license": [ - { - "name": "CC0 1.0 Universal", - "URL": "https://github.com/DSACMS/dedupliFHIR/blob/main/LICENSE" - } - ], - "usageType": "openSource", - "exemptionText": "" - }, - "organization": "Centers for Medicare & Medicaid Services", - "repositoryURL": "https://github.com/DSACMS/dedupliFHIR", - "projectURL": "", - "repositoryHost": "github.com/DSACMS", - "repositoryVisibility": "public", - "vcs": "git", - "laborHours": 4271, - "reuseFrequency": { - "forks": 3, - "clones": 0 - }, - "platforms": [ - "windows", - "mac", - "linux" - ], - "categories": [ - "data-analytics", - "application-development", - "data-collection" - ], - "softwareType": "standalone/desktop", - "languages": [ - "Python", - "JavaScript", - "HTML", - "CSS", - "Shell", - "Makefile" - ], - "maintenance": "internal", - "contractNumber": [], - "date": { - "created": "2023-06-22T17:08:19Z", - "lastModified": "2025-02-13T18:44:26Z", - "metaDataLastUpdated": "2025-06-10T14:55:32.836Z" - }, - "tags": [ - "AI", - "deduplication", - "data", - "ACA", - "FHIR", - "featured" - ], - "contact": { - "email": "opensource@cms.hhs.gov", - "name": "CMS Open Source Team" - }, - "feedbackMechanisms": "https://github.com/DSACMS/dedupliFHIR/issues", - "AIUseCaseID": "0", - "localisation": false, - "repositoryType": "application", - "userInput": "true", - "fismaLevel": "Moderate", - "group": "CMS/OA/DSAC", - "projects": [], - "systems": [], - "upstream": "https://github.com/DSACMS/dedupliFHIR/network/dependencies", - "subsetInHealthcare": [ - "Operational" - ], - "userType": [ - "Providers" - ], - "maturityModelTier": "3" -} -``` +Link to code.json file: [codejson-example-dedupliFHIR.json](https://github.com/DSACMS/gov-codejson/blob/main/tests/examples/codejson-example-dedupliFHIR.json) ## Example 2: [CMS Metrics Website](https://github.com/DSACMS/metrics) The CMS Metrics Website is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project where government employees can view repository metrics on CMS open source projects, currently maintained by the CMS OSPO. -``` -{ - "name": "metrics", - "description": "CMS Open Source Repository Metrics Website", - "longDescription": "The CMS Repository Metrics Website shows an overview of software development activity across open source projects within a specified organization. It is designed for developers and program managers interested in monitoring health and activity of CMS open source repositories.", - "status": "Production", - "permissions": { - "license": [ - { - "name": "CC0 1.0 Universal", - "URL": "https://github.com/DSACMS/metrics/blob/main/LICENSE.md" - } - ], - "usageType": "openSource", - "exemptionText": "" - }, - "organization": "Centers for Medicare & Medicaid Services", - "repositoryURL": "https://github.com/DSACMS/metrics", - "projectURL": "https://dsacms.github.io/metrics/", - "repositoryHost": "github.com/DSACMS", - "repositoryVisibility": "public", - "vcs": "git", - "laborHours": 20722, - "reuseFrequency": { - "forks": 4, - "clones": 0 - }, - "platforms": [ - "web" - ], - "categories": [ - "data-visualization", - "data-analytics" - ], - "softwareType": "standalone/web", - "languages": [ - "Liquid", - "JavaScript", - "CSS", - "Python", - "Shell" - ], - "maintenance": "internal", - "contractNumber": [], - "date": { - "created": "2023-07-18T14:10:58Z", - "lastModified": "2025-06-01T11:36:12Z", - "metaDataLastUpdated": "2025-06-06T16:36:38.949Z" - }, - "tags": [ - "metrics", - "ospo", - "repository", - "featured" - ], - "contact": { - "email": "opensource@cms.hhs.gov", - "name": "CMS/OA/DSAC/OSPO" - }, - "feedbackMechanisms": "https://github.com/DSACMS/metrics/issues", - "AIUseCaseID": "0", - "localisation": false, - "repositoryType": "website", - "userInput": "No", - "fismaLevel": "Low", - "group": "CMS/OA/DSAC", - "projects": [], - "systems": [], - "upstream": "https://github.com/DSACMS/metrics/network/dependencies", - "subsetInHealthcare": [ - "Operational" - ], - "userType": [ - "Government" - ], - "maturityModelTier": 3 -} -``` +Link to code.json file: [codejson-example-metrics.json](https://github.com/DSACMS/gov-codejson/blob/main/tests/examples/codejson-example-metrics.json) + +## Example 3: [gov-codejson](https://github.com/DSACMS/gov-codejson) + +gov-codejson (this repository!) is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project containing documentation on the code.json metadata standard, currently maintained by the federal government community. + +Link to code.json file: [code.json](https://github.com/DSACMS/gov-codejson/blob/main/code.json) \ No newline at end of file diff --git a/schemas/cms/schema-0.2.0.json b/schemas/cms/schema-0.2.0.json index 7810eb4..9b9e036 100644 --- a/schemas/cms/schema-0.2.0.json +++ b/schemas/cms/schema-0.2.0.json @@ -317,9 +317,9 @@ "type": "string", "description": "Level of security categorization assigned to an information system under the Federal Information Security Modernization Act (FISMA): https://security.cms.gov/learn/federal-information-security-modernization-act-fisma", "enum": [ - "Low", - "Moderate", - "High" + "low", + "moderate", + "high" ] }, "group": { @@ -349,10 +349,10 @@ "items": { "type": "string", "enum": [ - "Policy", - "Operational", - "Medicare", - "Medicaid" + "policy", + "operational", + "medicare", + "medicaid" ] }, "description": "Healthcare-related subset" @@ -362,9 +362,9 @@ "items": { "type": "string", "enum": [ - "Providers", - "Patients", - "Government" + "providers", + "patients", + "government" ] }, "description": "Types of users who interact with the software" diff --git a/schemas/schema-2.0.0.json b/schemas/schema-2.0.0.json index 68d5574..a01e16b 100644 --- a/schemas/schema-2.0.0.json +++ b/schemas/schema-2.0.0.json @@ -151,6 +151,13 @@ }, "additionalProperties": true }, + "languages": { + "type": "array", + "description": "Programming languages that make up the codebase", + "items": { + "type": "string" + } + }, "maintenance": { "type": "string", "description": "The dedicated staff that keeps the software up-to-date, if any", @@ -241,5 +248,5 @@ "feedbackMechanism", "AIUseCaseID" ], - "additionalProperties": false + "additionalProperties": true } \ No newline at end of file diff --git a/tests/cms-schema.json b/tests/cms-schema.json new file mode 100644 index 0000000..25ae01e --- /dev/null +++ b/tests/cms-schema.json @@ -0,0 +1,21 @@ +{ + "target": "../schemas/cms/schema-0.2.0.json", + "$comment": "This test suite validates code.json files for compliance with the CMS schema requirements.", + "tests": [ + { + "description": "Example 1: DedupliFHIR", + "valid": true, + "dataPath": "./examples/codejson-example-dedupliFHIR.json" + }, + { + "description": "Example 2: metrics", + "valid": true, + "dataPath": "./examples/codejson-example-metrics.json" + }, + { + "description": "Example 3: gov-codejson", + "valid": true, + "dataPath": "../code.json" + } + ] +} \ No newline at end of file diff --git a/tests/examples/codejson-example-dedupliFHIR.json b/tests/examples/codejson-example-dedupliFHIR.json new file mode 100644 index 0000000..f7af54b --- /dev/null +++ b/tests/examples/codejson-example-dedupliFHIR.json @@ -0,0 +1,83 @@ +{ + "name": "dedupliFHIR", + "description": "Prototype for basic deduplication and aggregation of eCQM data", + "longDescription": "A CLI bundled with an Electron.js front-end that provides data-linkage and AI deduplication for reported Accountable Care Organization (ACO) data at scale.", + "status": "Production", + "permissions": { + "licenses": [ + { + "name": "CC0-1.0", + "URL": "https://github.com/DSACMS/dedupliFHIR/blob/main/LICENSE" + } + ], + "usageType": [ + "openSource" + ], + "exemptionText": "" + }, + "organization": "Centers for Medicare & Medicaid Services", + "repositoryURL": "https://github.com/DSACMS/dedupliFHIR", + "repositoryHost": "github.com/DSACMS", + "repositoryVisibility": "public", + "vcs": "git", + "laborHours": 4271, + "reuseFrequency": { + "forks": 3, + "clones": 0 + }, + "platforms": [ + "windows", + "mac", + "linux" + ], + "categories": [ + "data-analytics", + "application-development", + "data-collection" + ], + "softwareType": "standalone/desktop", + "languages": [ + "Python", + "JavaScript", + "HTML", + "CSS", + "Shell", + "Makefile" + ], + "maintenance": "internal", + "contractNumber": [], + "date": { + "created": "2023-06-22T17:08:19Z", + "lastModified": "2025-02-13T18:44:26Z", + "metaDataLastUpdated": "2025-06-10T14:55:32.836Z" + }, + "tags": [ + "AI", + "deduplication", + "data", + "ACA", + "FHIR", + "featured" + ], + "contact": { + "email": "opensource@cms.hhs.gov", + "name": "CMS Open Source Team" + }, + "feedbackMechanism": "https://github.com/DSACMS/dedupliFHIR/issues", + "AIUseCaseID": "0", + "localisation": false, + "repositoryType": "application", + "userInput": true, + "fismaLevel": "moderate", + "group": "CMS/OA/DSAC", + "projects": [], + "systems": [], + "upstream": "https://github.com/DSACMS/dedupliFHIR/network/dependencies", + "subsetInHealthcare": [ + "operational" + ], + "userType": [ + "providers" + ], + "maturityModelTier": 3 +} \ No newline at end of file diff --git a/tests/examples/codejson-example-metrics.json b/tests/examples/codejson-example-metrics.json new file mode 100644 index 0000000..5a448e7 --- /dev/null +++ b/tests/examples/codejson-example-metrics.json @@ -0,0 +1,78 @@ +{ + "name": "metrics", + "description": "CMS Open Source Repository Metrics Website", + "longDescription": "The CMS Repository Metrics Website shows an overview of software development activity across open source projects within a specified organization. It is designed for developers and program managers interested in monitoring health and activity of CMS open source repositories.", + "status": "Production", + "permissions": { + "licenses": [ + { + "name": "CC0-1.0", + "URL": "https://github.com/DSACMS/metrics/blob/main/LICENSE.md" + } + ], + "usageType": [ + "openSource" + ], + "exemptionText": "" + }, + "organization": "Centers for Medicare & Medicaid Services", + "repositoryURL": "https://github.com/DSACMS/metrics", + "projectURL": "https://dsacms.github.io/metrics/", + "repositoryHost": "github.com/DSACMS", + "repositoryVisibility": "public", + "vcs": "git", + "laborHours": 20722, + "reuseFrequency": { + "forks": 4, + "clones": 0 + }, + "platforms": [ + "web" + ], + "categories": [ + "data-visualization", + "data-analytics" + ], + "softwareType": "standalone/web", + "languages": [ + "Liquid", + "JavaScript", + "CSS", + "Python", + "Shell" + ], + "maintenance": "internal", + "contractNumber": [], + "date": { + "created": "2023-07-18T14:10:58Z", + "lastModified": "2025-06-01T11:36:12Z", + "metaDataLastUpdated": "2025-06-06T16:36:38.949Z" + }, + "tags": [ + "metrics", + "ospo", + "repository", + "featured" + ], + "contact": { + "email": "opensource@cms.hhs.gov", + "name": "CMS/OA/DSAC/OSPO" + }, + "feedbackMechanism": "https://github.com/DSACMS/metrics/issues", + "AIUseCaseID": "0", + "localisation": false, + "repositoryType": "website", + "userInput": false, + "fismaLevel": "low", + "group": "CMS/OA/DSAC", + "projects": [], + "systems": [], + "upstream": "https://github.com/DSACMS/metrics/network/dependencies", + "subsetInHealthcare": [ + "operational" + ], + "userType": [ + "government" + ], + "maturityModelTier": 3 +} \ No newline at end of file diff --git a/tests/gov-schema.json b/tests/gov-schema.json new file mode 100644 index 0000000..9fc981c --- /dev/null +++ b/tests/gov-schema.json @@ -0,0 +1,21 @@ +{ + "target": "../schemas/schema-2.0.0.json", + "$comment": "This test suite validates CMS code.json files for compliance with the generic schema, ensuring alignment with federal government metadata standards.", + "tests": [ + { + "description": "Example 1: DedupliFHIR", + "valid": true, + "dataPath": "./examples/codejson-example-dedupliFHIR.json" + }, + { + "description": "Example 2: metrics", + "valid": true, + "dataPath": "./examples/codejson-example-metrics.json" + }, + { + "description": "Example 3: gov-codejson", + "valid": true, + "dataPath": "../code.json" + } + ] +} \ No newline at end of file