[Schema Consistency] Schema consistency report - 2026-05-18 #32969
Closed
Replies: 1 comment
|
This discussion has been marked as outdated by Schema Consistency Checker. A newer discussion is available at Discussion #33233. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
This run explored fresh detection angles instead of replaying proven ones. Two of the three new strategies surfaced real, fixable issues in the schema itself, and a third surfaced a latent serialization bug in the compiler.
Critical Issues
1.
$refsiblings silently ignored under JSON Schema draft-07 (schema bug, user-visible)The main schema declares
"$schema": "(jsonschema.org/redacted) Under draft-07, when a property has$ref, **all sibling keywords are ignored** by spec-compliant validators (incl.santhosh-tekuri/jsonschema/v6`, which this repo depends on).Two top-level properties violate this:
properties.engine(pkg/parser/schemas/main_workflow_schema.json) declares$ref: "#/$defs/engine_config"alongsidedefault: "copilot",description, andexamples. Thedefault,description, andexamplesare dropped at validation time.properties.github-appdeclares$ref: "#/$defs/github_app"alongsidedescription. Thedescriptionis dropped.Detection one-liner:
jq -r '.properties | to_entries[] | select(.value | has("$ref") and ((. | keys | length) > 1)) | "\(.key): keys=\(.value | keys)"' pkg/parser/schemas/main_workflow_schema.jsonImpact: IDE tooltips, documentation generators, and any validator-driven default-injection will not see
enginedefaulting to"copilot"or read the property descriptions forengine/github-app. The user-facing behavior in this repo's hand-written compiler happens to be correct because the default lives inpkg/constants/constants.go(DefaultEngine), not because the schema enforces it.Suggested fix:
Or migrate
$schematodraft-2019-09/draft/2020-12, which both allow$refsiblings.2. Latent YAML-tag mismatch: plural where the rest of the codebase is singular
pkg/workflow/compiler_types.go:639:Everywhere else the canonical key is singular:
safe-outputs.properties.create-code-scanning-alert(singular)pkg/workflow/safe_outputs_config.go➜parseCodeScanningAlertsConfig(outputMap)looks upoutputMap["create-code-scanning-alert"]security_reports_test.go,safe_outputs_cross_repo_config_test.go,safe_outputs_permissions_test.goall use"create-code-scanning-alert"safe_output_handlers.go:208➜Key: "create-code-scanning-alert"The tag is dormant today because
SafeOutputsConfigis populated by hand-parsingoutputMap, not byyaml.Unmarshal. But it lights up the moment anythingyaml.Marshals the struct (config-dump tooling, debug helpers, future test harness) — the emitted YAML would use the plural form, which then fails to round-trip through the parser.Suggested fix (one-line):
Schema Improvements Needed
3. Orphan
$deftemplatable_integer(defined but never referenced)pkg/parser/schemas/main_workflow_schema.json:10099defines:No
$refin the schema points at it. Meanwhile, three top-level properties duplicate substantially the same shape inline:max-runs(integer-or-string-or-${{expr}}, default 500)max-effective-tokens(integer-or-string-or-${{expr}}, default 25000000)timeout-minutes(integer-or-string-or-${{expr}})Each inlines its own
oneOfwith the^\$\{\{.*\}\}$pattern.Suggested fix: Either delete the orphan
$def, or — preferable — migrate the three properties toallOf: [{ $ref: "#/$defs/templatable_integer" }]plus per-field constraints (minimum,default,description). Removes ~30 lines of duplication and makes the schema self-consistent.Detection one-liner:
Documentation Gaps
4.
field_gaps.in_used_not_schemais dominated by sub-agent-block content, not real frontmatter (confirmed false-positive)The pre-computed diff lists 34 keys (
model,title,repo,serena-find_symbol, etc.) as "used in workflows but absent from schema." Spot-checks ofpr-sous-chef.md,daily-subagent-optimizer.md, andspec-enforcer.mdconfirm these keys never appear in the top-level frontmatter (between the first---pair) — they all sit inside inline sub-agent blocks embedded in the markdown body. Restricting the schema-diff generator to the leading YAML frontmatter would eliminate the noise.This matches strategy
used-not-schema-false-positive-detectionfrom the cache; recording it as a continuing observation, not a new bug.View detailed diff data
templatable_integeris the lone orphanadditionalProperties: falseat root +required: ["on"]✅additionalProperties: false(76 unrestricted, but most are intentionaladditionalProperties: <schema>maps such asmodels,mcp-servers)on.workflow_call.inputs,on.workflow_call.secrets,safe-outputs.dispatch_repository.inputs). Likely intentional but worth noting.Recommendations
$refinproperties.engineandproperties.github-appwithallOfso the siblingdefault/description/examplessurvive draft-07 validation. Or bump$schemato a version that permits siblings.integer|string|${{expr}}shapes (max-runs,max-effective-tokens,timeout-minutes) onto the existingtemplatable_integer$def. Removes duplication and makes the orphan productive.yaml:"create-code-scanning-alerts"➜yaml:"create-code-scanning-alert"tag inpkg/workflow/compiler_types.go:639so the struct round-trips throughyaml.Marshal./tmp/gh-aw/agent/schema-diff.json, limit the frontmatter parser to the leading---block so sub-agent content stops pollutingin_used_not_schema.Strategy Performance
schema-defs-completeness,ref-with-siblings-draft07,yaml-tag-vs-parser-keyschema-defs-completenessandref-with-siblings-draft07into the proven pool (success_count: 1, ready to be picked on a 0–6 day)Next Steps
$refsiblings withallOf(or bump$schemaversion)max-runs,max-effective-tokens,timeout-minutestotemplatable_integer$defpkg/workflow/compiler_types.go:639to singular---blockReferences:
All reactions