public/Show-OctaHistory.ps1

function Show-OctaHistory {
    <#
        .SYNOPSIS
        Read-only view over the existing Run Record folders already used by Undo-OctaRun - no
        new storage, just a projection of data that already exists (research.md).
    #>

    [CmdletBinding()]
    param()

    $runsRoot = Get-OctaRunsRoot
    $runFolders = Get-ChildItem -Path $runsRoot -Directory -ErrorAction SilentlyContinue |
        Sort-Object Name -Descending

    $history = @(
        foreach ($runFolder in $runFolders) {
            $runFile = Join-Path $runFolder.FullName 'run.json'
            if (-not (Test-Path $runFile)) { continue }
            $record = Get-Content -Path $runFile -Raw | ConvertFrom-Json
            [pscustomobject]@{
                RunId             = $record.RunId
                Timestamp         = $record.Timestamp
                CategoriesApplied = ($record.CategoriesApplied -join ', ')
                ActionCount       = @($record.ActionSnapshots).Count
                Status            = $record.Status
            }
        }
    )

    foreach ($h in $history) {
        Write-Host ("{0,-16} {1,-24} {2,-40} {3,-6} {4}" -f $h.RunId, $h.Timestamp, $h.CategoriesApplied, $h.ActionCount, $h.Status)
    }

    return $history
}