Files
reverse-skill/skills/scripts/lib/RouteScope.ps1
Harry 0a4019d56f fix(router): clamp hot path to routing.json and real auth gate
Keep reverse-skill a skill router, not a platform. RULES hot path is master-route then case-init then PRIMARY. MASTER-ROUTING priority is verified against routing.json. precedent-auth no longer grants. CTF is one R41 pointer, not 40 competition routes. open.ps1 never deletes .i64/.idb. Route-scope parse is line-anchored and last-match. Tests: 168 routing cases, parse-contracts, title-safety in CI.
2026-08-18 14:58:22 +01:00

20 lines
718 B
PowerShell

# Shared parsers for master-route route-scope.md.
# Line-anchored so a hint containing "primary: R11" cannot steal the real PRIMARY.
function Get-ReverseRouteScopeFields {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Text
)
$id = $null
$skill = $null
$idHits = [regex]::Matches($Text, '(?m)^- primary:\s*(\S+)\s*$')
if ($idHits.Count -gt 0) { $id = $idHits[$idHits.Count - 1].Groups[1].Value }
$skillHits = [regex]::Matches($Text, '(?m)^- primary_skill:\s*skills/(\S+)\s*$')
if ($skillHits.Count -gt 0) { $skill = $skillHits[$skillHits.Count - 1].Groups[1].Value }
return [pscustomobject]@{
Id = $id
Skill = $skill
}
}