feat: embed frontmatter skills in lock file gh-aw-metadata payload (schema v5)#42638
feat: embed frontmatter skills in lock file gh-aw-metadata payload (schema v5)#42638Copilot wants to merge 5 commits into
Conversation
…hema v5) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #42638 does not have the 'implementation' label and has only 69 new lines of code in business logic directories (threshold is 100). |
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Test Quality Sentinel completed test quality analysis. |
|
|
There was a problem hiding this comment.
Pull request overview
This PR upgrades the workflow lock-file metadata schema to v5 and embeds frontmatter-declared skills into the # gh-aw-metadata: JSON header, so downstream tooling can discover skill dependencies directly from compiled lock files.
Changes:
- Introduces
LockSchemaV5and extendsLockMetadatawithSkills []string(omitted when empty). - Populates
metadata.Skillsduring YAML compilation before emitting the# gh-aw-metadata:header. - Updates and adds tests to assert v5 behavior, supported-version handling, skills serialization/omission, and extraction.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/lock_schema.go | Adds v5 schema + skills field to lock metadata and marks v5 as supported/current. |
| pkg/workflow/compiler_yaml.go | Copies WorkflowData.Skills into lock metadata before JSON emission. |
| pkg/workflow/lock_schema_test.go | Updates schema assertions and adds coverage for skills JSON serialization, omission, and extraction. |
| pkg/workflow/stale_check_test.go | Updates expected “current schema” to v5 for stale-check/body-hash metadata assertions. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Low
🧪 Test Quality Sentinel Report✅ Test Quality Score: 90/100 — Excellent
📊 Metrics (3 new tests + 10 modified/maintained assertions)
Changed test files:
Verdict
The 3 new test functions cover the full behavioral contract of the new References: §28493996148 Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Review Summary 🧠Applied 📋 Details[/tdd] [/codebase-design] Everything else looks solid: the @copilot please address the review comments above.
|
There was a problem hiding this comment.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 60.6 AIC · ⌖ 8.07 AIC · ⊞ 6.6K
Comment /matt to run again
| metadata.CompilerVersion = c.GetVersion() | ||
| } | ||
| if len(data.Skills) > 0 { | ||
| metadata.Skills = data.Skills |
There was a problem hiding this comment.
[/tdd] The new compiler path that sets metadata.Skills has no test exercising the actual generateWorkflowHeader output — so nothing verifies the # gh-aw-meta(redacted) JSON contains "skills":[...]whenWorkflowData.Skills` is populated.
💡 Suggested test case for TestGenerateWorkflowHeader
Add a case to compiler_yaml_helpers_test.go's TestGenerateWorkflowHeader:
{
name: "header with skills embeds skills in gh-aw-metadata",
data: &WorkflowData{
Skills: []string{
"githubnext/skills@1f181b37d3fe5862ab590648f25a292e345b5de6",
},
},
expectInStr: []string{
`"skills":["githubnext/skills@1f181b37d3fe5862ab590648f25a292e345b5de6"]`,
},
},The three new tests in lock_schema_test.go are great for the struct layer, but they don't exercise the generateWorkflowHeader → metadata.Skills = data.Skills path. This gap means a regression on that 3-line block could go undetected.
@copilot please address this.
| DetectionAgentModel string `json:"detection_agent_model,omitempty"` | ||
| EngineVersions map[string]string `json:"engine_versions,omitempty"` | ||
| AgentImageRunner string `json:"agent_image_runner,omitempty"` | ||
| Skills []string `json:"skills,omitempty"` |
There was a problem hiding this comment.
[/codebase-design] Skills is set by the caller after GenerateLockMetadata returns, creating a split-initialisation pattern. Any future call site of GenerateLockMetadata must separately remember to wire up the skills field.
💡 Options to consolidate
Option A — expand AgentMetadataInfo (already aggregates agent-specific metadata):
type AgentMetadataInfo struct {
// existing fields...
Skills []string
}Then inside GenerateLockMetadata:
metadata := &LockMetadata{
// existing fields...
Skills: agentInfo.Skills,
}Option B — pass skills via LockHashInfo if skills influence the hash.
Either way, keeping all LockMetadata initialisation inside the function eliminates the risk of a future call site silently omitting the field.
@copilot please address this.
|
@copilot run pr-finisher skill |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Here's the summary:
Actions taken: Recompiled all 257 Hand-off: CI must be re-triggered by a maintainer (close/reopen PR, |
|
@copilot resolve the merge conflicts on this branch. |
|
@copilot skills should be in gh-aw-manifest, not gh-aw-metadata. Recompile |
…-lock-file # Conflicts: # .github/workflows/daily-geo-optimizer.lock.yml # .github/workflows/pr-sous-chef.lock.yml # .github/workflows/test-quality-sentinel.lock.yml # .github/workflows/uk-ai-operational-resilience.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Resolved. The 4 conflicting |
| @@ -1,4 +1,4 @@ | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"26e8a754482b7347113adc6d77b27f62e3dee49e84d972a2e35662fd319720b5","body_hash":"62ce0bd5c9851424f73f018934c48ae0ca6493b0bc7415fdc5564e808707829a","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.65"}} | |||
| # gh-aw-metadata: {"schema_version":"v5","frontmatter_hash":"26e8a754482b7347113adc6d77b27f62e3dee49e84d972a2e35662fd319720b5","body_hash":"62ce0bd5c9851424f73f018934c48ae0ca6493b0bc7415fdc5564e808707829a","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.65"},"skills":["mattpocock/skills/diagnosing-bugs@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/tdd@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/improve-codebase-architecture@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/grill-with-docs@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/to-prd@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/codebase-design@801dca688564c529fa84f247f64472520d9ebe28","mattpocock/skills/domain-modeling@801dca688564c529fa84f247f64472520d9ebe28"]} | |||
There was a problem hiding this comment.
@copilot add skills field to gh-aw-manifest in the next line
…chema to v4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Skills are now in |
Skills declared in workflow frontmatter were absent from the compiled lock file's
gh-aw-metadataJSON comment, making skill dependencies invisible to tooling that reads lock metadata.Changes
lock_schema.go— addsSkills []string(omitempty) toLockMetadata; introducesLockSchemaV5as the current schema version; adds v5 toSupportedSchemaVersionscompiler_yaml.go— setsmetadata.Skills = data.Skillsbefore emitting the# gh-aw-metadata:header lineExample output
Lock files compiled from a workflow with skills in frontmatter now include:
# gh-aw-metadata: {"schema_version":"v5","frontmatter_hash":"...","skills":["githubnext/skills@<sha>","githubnext/skills/review/security@<sha>"]}Workflows without
skillsin frontmatter are unaffected — the field is omitted viaomitempty. Lock files at v1–v4 remain fully readable.