Skip to main content
Loading navigation

Build an OCDS Contracting Release Package Auditor — implementation

Prompt source

implementation77 lines11 sectionsNo variables1 code block
## Build
Parse Open Contracting Data Standard (OCDS) release packages to validate package metadata and release array structure. Detect missing publisher URIs, schema versions, and invalid release compilation structures.

## User
Procurement Transparency Analyst

## Workflow
1. Ingest OCDS release package JSON files representing published procurement events.
2. Evaluate the root package metadata including URI, publisher details, and schema version.
3. Traverse the releases array to ensure each release contains the required structure and ID.
4. Compile an audit report flagging non-compliant or missing package metadata.

## Interface
Browser validation dashboard showing package metadata compliance status and release ID listings.

## Data
Generate synthetic OCDS release packages containing valid and invalid root metadata structures.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Open Contracting Data Standard](https://standard.open-contracting.org/latest/en/schema/reference/)
Implements the OCDS Release Package structure, enforcing required fields such as uri, version, publishedDate, releases, and publisher.

## Tools
langgraph, pandas, fastapi.
LangGraph manages stateful traversal and validation workflows across multi-stage schema auditing pipelines.
Hosted reasoning model capable of interpreting JSON schema structures and validating required metadata fields.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Validates presence of required package metadata fields (uri, publishedDate, publisher, version).
- Ensures releases array is present and contains at least one release object.
- Produces a structured JSON error report for missing metadata.

## Starter Examples
```json
[
  {
    "input": {
      "uri": "http://example.com/ocds/package-1",
      "version": "1.1",
      "publishedDate": "2023-10-01T12:00:00Z",
      "publisher": {
        "name": "City Procurement"
      },
      "releases": [
        {
          "id": "release-1",
          "ocid": "ocds-213-1"
        }
      ]
    },
    "expected_output": {
      "package_valid": true,
      "missing_fields": [],
      "release_count": 1,
      "status": "COMPLIANT",
      "note": "Simplified synthetic app records, not complete official schema files."
    }
  },
  {
    "input": {
      "version": "1.1",
      "publishedDate": "2023-10-01T12:00:00Z",
      "publisher": {
        "name": "City Procurement"
      },
      "releases": []
    },
    "expected_output": {
      "package_valid": false,
      "missing_fields": [
        "uri"
      ],
      "release_count": 0,
      "status": "NON_COMPLIANT_EMPTY_RELEASES",
      "note": "Simplified synthetic app records, not complete official schema files."
    }
  }
]
```

## Safety
Acts as an analytical project management tool without executing real-world contractual or site dispatch actions.
Use mock external writes. Require human review before any real deployment.