Public/Test-KadenRepo.ps1
|
function Test-KadenRepo { <# .SYNOPSIS Report child-repository health without modifying files. .DESCRIPTION Inspects transactional ignore entries (.kaden/ and .kaden.local.json), hook files (.cursor/hooks.json and .github/hooks/harness.json), doc scaffolds (docs/adr/README.md, docs/harness/README.md, docs/harness/features/README.md, and docs/wip/README.md), and AGENTS.md injection (<!-- KADEN:START --> before <!-- KADEN:END -->). The command does not modify repository files. Hook files and doc scaffolds pass when the file exists. The command does not parse hook JSON or require README text. Healthy is true only when every finding passed. Each finding has Area, Name, Passed, and Detail. Area is Ignore, Hooks, DocScaffold, or AgentsInjection. .PARAMETER Path Child repository root to inspect. Relative paths, including '.', use the current PowerShell location. .EXAMPLE Test-KadenRepo -Path . #> [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$Path ) $childRoot = Resolve-KadenChildRoot -Path $Path if (-not (Test-Path -LiteralPath $childRoot -PathType Container)) { throw "KDN-TXN-PREFLIGHT-FAILED: Child repository path does not exist: $childRoot" } $findings = @(Get-KadenRepoHealthFinding -ChildRoot $childRoot) $failed = @($findings | Where-Object { -not $_.Passed }) return [pscustomobject]@{ Path = $childRoot Healthy = ($failed.Count -eq 0) Findings = $findings } } |