Work in progress. We welcome questions and suggestions — give us feedback.

Creating your enterprise code inventory

Overview

Section 7.2 and 7.3 of the Source Code Policy require agencies to provide an inventory of their 'custom-developed code' to support government-wide reuse and make Federal open source code easier to find.

Using these inventories, Code.gov will provide a platform to search federally funded open source software and software available for government-wide reuse.

Publishing Your Agency's Inventory

Agencies are required to publish their inventories using a standard metadata schema - a JSON file that they'll make available on their agency websites. Agencies are strongly encouraged to use version 2.0.0 of the schema, which is described below. This version includes revisions that make your inventory much more useful and intuitive.

Agencies should make the code.json available in the root folder of their website (e.g., https://www.agency.gov/code.json). Code.gov will then retrieve these JSON files daily and compile them.

Metadata Schema version 2.0.0

The schema fields and definitions are listed below. Here is version 2.0.0 of the metadata schema file in JSON format with parent/child relationships.

Agency code.json file location and contents:

  • code.json must live in the root directory of your agency’s website.
  • code.json must include a single object represented as JSON, with key-value pairs according to the list below.

Source Code Considerations for AI R&D Models

Consistent with the Executive Order on Maintaining American Leadership in Artificial Intelligence (EO 13859), agencies are directed to improve source code inventory documentation (i.e., agency code.json) to enable discovery and usability of source code AI models.

Field Name Tags
Data Type Array
Definition An array of keywords that will be helpful in discovering and searching for the release.
Required Always
AI R&D Guidance Agencies shall include the keyword of usg-artificial-intelligence for all source code determined to support AI R&D. Other keywords can be developed and used as appropriate and coordinated with standard data tagging available on resources.data.gov.
Field Name Contact
Data Type Object
Definition Point of contact information for the release.
Required Always
AI R&D Guidance Be sure to identify and include domain experts and their contact information who can discuss the model with interested AI researchers. If not the same as the domain expert, Agencies shall also identify an expert and their contact information who can discuss restrictions or controls on the model.
Field Name exemptionText
Data Type String or Null
Definition If an exemption is listed in the usageType field, this field should include a one or two sentence justification for the exemption used.
Required No
AI R&D Guidance Agencies shall describe how researchers may be able to access governmentWideReuse or exempt data.
Field Name relatedCode
Data Type Array
Definition An array of affiliated government repositories that may be a part of the same project. For example, relatedCode for code-gov-front-end would include code-gov-api and code-gov-client.
Required No
AI R&D Guidance Agencies shall describe related models and code.

Example code.json file

Here are some good metadata examples for reference when creating your agency code.json file.

You can find previous schema revisions in our changelog