feat: publish versioned JSON Schema for AWF config file#2375
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds a generated, versioned JSON Schema for the AWF config file, along with tests and release automation to publish the schema as a release asset for IDE validation/autocomplete.
Changes:
- Introduces
scripts/generate-schema.mjsto generatedocs/awf-config.schema.json(optionally embedding a versioned$id). - Adds Jest tests (
src/schema.test.ts) to compile and validate the schema with Ajv 2020-12. - Updates docs and the release workflow to publish the versioned schema as a release asset.
Show a summary per file
| File | Description |
|---|---|
| src/schema.test.ts | New unit tests that compile and validate the JSON Schema with Ajv. |
| scripts/generate-schema.mjs | New generator script to produce the JSON Schema (supports --version and --print). |
| package.json | Adds an npm script to run the schema generator. |
| docs/awf-config.schema.json | Expands schema coverage and adds descriptions for IDE autocomplete. |
| docs/awf-config-spec.md | Documents live vs versioned schema locations. |
| README.md | Links to schema and notes the versioned release asset URL. |
| .github/workflows/release.yml | Generates a versioned schema during releases and uploads it as an asset. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 4
| * The schema mirrors the AwfFileConfig TypeScript interface in src/config-file.ts. | ||
| * When the interface changes, update this script to match. |
| enum: ['5m', '1h'], | ||
| description: | ||
| 'TTL for Anthropic cache tail optimization. ' + | ||
| 'Requires anthropicAutoCache to be enabled. Allowed values: "5m" or "1h".', |
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import Ajv2020 from 'ajv/dist/2020'; |
| const versionIdx = args.indexOf('--version'); | ||
| const version = versionIdx !== -1 ? args[versionIdx + 1] : null; | ||
| const printOnly = args.includes('--print'); | ||
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address the review feedback |
Addressed all four review items in c42ce40:
|
🔥 Smoke Test: Copilot BYOK — PASS
Running in BYOK offline mode ( Overall: PASS · PR by
|
|
Smoke Test Results ✅
Overall: PASS
|
🔬 Smoke Test Results
PR: feat: publish versioned JSON Schema for AWF config file — author Overall: PARTIAL — MCP works; connectivity/file tests skipped due to unresolved template variables in workflow step data.
|
|
PR titles: unavailable Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Chroot Smoke Test Results
Overall: FAILED — Python and Node.js versions differ between host and chroot environment.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results
Overall: FAIL — Service containers unreachable from this environment.
|
AwfFileConfighad no published JSON Schema, leaving consumers (IDE validators,gh-awcompiler) without a machine-readable contract and no way to reference a stable, versioned URL.Changes
scripts/generate-schema.mjs— generator script that builds the complete JSON Schema forAwfFileConfig--version v0.X.Yembeds a version-specific$idfor release assets--printwrites to stdout (used in release pipeline)docs/awf-config.schema.jsondocs/awf-config.schema.json— updated existing schema:apiProxy.anthropicAutoCache,apiProxy.anthropicCacheTailTtl,apiProxy.modelsdescriptionon every property for IDE autocompletecopilottarget correctly uses a host-only$defsref (nobasePath)src/schema.test.ts— 16 tests usingajv/dist/2020(already transitive) covering valid configs, enum constraints,additionalPropertiesrejection, and type mismatchespackage.json—generate:schemascript.github/workflows/release.yml— generates versioned schema and uploadsawf-config.schema.jsonas a release assetREADME.md/docs/awf-config-spec.md— documents the versioned release asset URLIDE integration
Users can reference the schema for autocomplete in
.awf.yml/.awf.json:The live schema at
docs/awf-config.schema.jsonis reachable viaraw.githubusercontent.com; each release additionally uploads a pinned copy so downstream tools can reference a specific AWF version.