[GAP-068]: verify complete deployed Strategies source folder

This commit is contained in:
2026-10-26 09:03:16 -04:00
parent 5907e9cc54
commit 0bbc031c58
7 changed files with 197 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ function Get-ScriptDirectory {
$script:ScriptDir = Get-ScriptDirectory
$script:RepoRoot = [System.IO.Path]::GetFullPath((Join-Path $script:ScriptDir '..\..'))
. (Join-Path $script:ScriptDir 'strategy-source-verification.ps1')
if ([string]::IsNullOrEmpty($RepoStrategyBasePath)) {
$RepoStrategyBasePath = [System.IO.Path]::GetFullPath((Join-Path $script:RepoRoot 'src\NT8.Adapters\Strategies\NT8StrategyBase.cs'))
}
@@ -518,6 +519,10 @@ function Invoke-PreflightChecks {
}
Write-CheckResult -Number 5 -Passed $hashPassed -Title 'Deployed NT8StrategyBase.cs matches repo copy' -Detail $hashDetail -Remedy 'Redeploy NT8StrategyBase.cs from the repo to the NinjaTrader Strategies directory and confirm the deployed source exactly matches the repo copy before enabling.'
$sourceIssues = @(Compare-DeployedStrategySources -RepositoryRoot $script:RepoRoot -DeployedDirectory $NtStrategiesDirectory)
$sourceDetail = if ($sourceIssues.Count -eq 0) { 'all four deploy-managed source files match; no unexpected .cs files found' } else { Format-StrategySourceIssues -Issues $sourceIssues }
Write-CheckResult -Number 6 -Passed ($sourceIssues.Count -eq 0) -Title 'All deployed Strategies sources match the repository; no unexpected .cs files' -Detail $sourceDetail -Remedy 'For each discrepancy, compare repository/deployed timestamps and hashes. Restore or redeploy missing/mismatched managed files. Review unexpected files and remove or retain them deliberately; preflight never deletes deployed files.'
$spacePassed = $false
$spaceDetail = ''
if ($logDirExists) {
@@ -526,7 +531,7 @@ function Invoke-PreflightChecks {
$spaceDetail = ('free space={0} GB' -f [Math]::Round(($freeBytes / 1GB), 2))
}
else { $spaceDetail = 'log directory missing' }
Write-CheckResult -Number 6 -Passed $spacePassed -Title 'Disk space greater than 1 GB in log directory drive' -Detail $spaceDetail -Remedy 'Free disk space on the log drive or move the log directory to a drive with more than 1 GB available before enabling the strategy.'
Write-CheckResult -Number 7 -Passed $spacePassed -Title 'Disk space greater than 1 GB in log directory drive' -Detail $spaceDetail -Remedy 'Free disk space on the log drive or move the log directory to a drive with more than 1 GB available before enabling the strategy.'
}
catch {
$script:AllPassed = $false