Add SCM functional knowledge domain

Introduce nine source-backed rules with original AL sample pairs, bounded SCM review routing, and complete positive/clean evaluation coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Jesper Schulz-Wedde 2026-09-17 15:54:23 +02:00
parent b91443beec
commit 9ac62e3967
34 changed files with 1244 additions and 10 deletions

View file

@ -93,14 +93,15 @@ try {
'microsoft/skills/review/al-query-review.md',
'microsoft/skills/review/al-reporting-review.md',
'microsoft/skills/review/al-appsource-review.md',
'microsoft/skills/review/al-telemetry-review.md'
'microsoft/skills/review/al-telemetry-review.md',
'microsoft/skills/review/al-scm-review.md'
)
$review = @($skills | Where-Object id -eq 'al-code-review')
if ($review.Count -ne 1) {
throw "Expected exactly one al-code-review record, found $($review.Count)."
}
if ((@($review[0].subSkills) -join "`n") -cne ($expectedLeaves -join "`n")) {
throw 'al-code-review subSkills did not preserve the declared 17-leaf order.'
throw "al-code-review subSkills did not preserve the declared $($expectedLeaves.Count)-leaf order."
}
foreach ($leafPath in $expectedLeaves) {
$leaf = @($skills | Where-Object path -ceq $leafPath)
@ -109,6 +110,28 @@ try {
}
}
$scm = @($skills | Where-Object id -eq 'al-scm-review')
if ($scm.Count -ne 1 -or
(@($scm[0].inputs) -join ',') -cne 'pr-diff,file-path,folder-path' -or
(@($scm[0].filters.technologies) -join ',') -cne 'al') {
throw 'SCM must be discoverable as an AL leaf accepting diffs, files, and complete folders.'
}
$scmText = Get-Content -LiteralPath (Join-Path $Root $scm[0].path) -Raw
$scmExamples = [regex]::Matches($scmText, '(?s)```json\s*(\{.*?\})\s*```')
if ($scmExamples.Count -ne 2) {
throw "Expected two SCM findings-report examples, found $($scmExamples.Count)."
}
foreach ($example in $scmExamples) {
if (-not ($example.Groups[1].Value | Test-Json -SchemaFile $reportSchema -ErrorAction Stop)) {
throw 'An SCM output example does not satisfy schemas/findings-report.schema.json.'
}
$report = $example.Groups[1].Value | ConvertFrom-Json
if ($report.skill.id -cne 'al-scm-review' -or
@($report.findings | Where-Object domain -cne 'Supply Chain Management').Count) {
throw 'SCM output examples must retain the leaf id and complete display domain.'
}
}
$minimalReport = @{
skill = @{ id = 'al-style-review'; version = 1 }
outcome = 'completed'
@ -238,4 +261,4 @@ finally {
Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue
}
Write-Output 'Skill-index check PASSED: deterministic, schema-valid, and all 17 review leaves preserved in order.'
Write-Output "Skill-index check PASSED: deterministic, schema-valid, and all $($expectedLeaves.Count) review leaves preserved in order."