sync SVN r18211

This commit is contained in:
2026-09-28 09:17:38 +03:00
parent 7c8da7bf66
commit 35dbaa4446
8 changed files with 316 additions and 19 deletions

View File

@@ -0,0 +1,3 @@
# Raport context + timp per nod pentru un run roa-fix (fara parametru = ultimul run)
param([string]$RunId = '')
& "C:\Program Files\Git\bin\bash.exe" -lc "cd /d/roa/roacont && perl .archon/scripts/raport_context.pl $RunId"

View File

@@ -0,0 +1,32 @@
# Ce face acum agentul Archon: ultima sesiune activa (Pi sau Claude), de cand tace, ultimii pasi.
# Folosire: urmareste.ps1 [-N 8] [-Watch] (-Watch = reimprospateaza la 15s, Ctrl+C iese)
param([int]$N = 8, [switch]$Watch)
$dirs = 'C:\Users\mmari\.pi\agent\sessions\--D--ROA-ROACONT--', 'C:\Users\mmari\.claude\projects\D--ROA-ROACONT'
function Scurt($s, $max = 160) { $s = ("$s" -replace '\s+', ' ').Trim(); if ($s.Length -gt $max) { $s.Substring(0, $max) + '...' } else { $s } }
function Arata {
$f = Get-ChildItem $dirs -Filter *.jsonl -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending |
Where-Object { $_.FullName -like '*\.pi\*' -or (Select-String -Path $_.FullName -Pattern '"entrypoint":"sdk-ts"' -SimpleMatch -Quiet) } | Select-Object -First 1 # doar sesiunile Archon (sdk), nu Claude Code interactiv
if (-not $f) { 'Nicio sesiune gasita.'; return }
$tace = [int]((Get-Date) - $f.LastWriteTime).TotalSeconds
$tip = if ($f.FullName -like '*\.pi\*') { 'Pi/DeepSeek' } else { 'Claude' }
"=== $tip $($f.Name)"
"=== ultima scriere: $($f.LastWriteTime.ToString('HH:mm:ss')) (tace de ${tace}s)" + $(if ($tace -gt 600) { ' <-- POSIBIL BLOCAT' } else { '' })
$pasi = foreach ($l in (Get-Content $f.FullName -Tail 200 -Encoding UTF8)) {
try { $e = $l | ConvertFrom-Json } catch { continue }
$m = $e.message; if (-not $m) { continue }
$ora = if ($e.timestamp) { ([datetime]$e.timestamp).ToLocalTime().ToString('HH:mm:ss') } else { '' }
foreach ($c in @($m.content)) {
switch ($c.type) {
'toolCall' { "$ora > $($c.name): $(Scurt ($c.arguments.command, $c.arguments.path, ($c.arguments | ConvertTo-Json -Compress) | Where-Object { $_ } | Select-Object -First 1))" }
'tool_use' { "$ora > $($c.name): $(Scurt ($c.input.command, $c.input.file_path, $c.input.pattern, ($c.input | ConvertTo-Json -Compress) | Where-Object { $_ } | Select-Object -First 1))" }
'text' { if ($m.role -eq 'assistant') { "$ora $(Scurt $c.text)" } elseif ($m.role -eq 'toolResult') { "$ora < $(if ($m.isError) { 'EROARE ' })$(Scurt $c.text 120)" } }
'tool_result' { $t = if ($c.content -is [string]) { $c.content } else { @($c.content)[0].text }; "$ora < $(if ($c.is_error) { 'EROARE ' })$(Scurt $t 120)" }
}
}
}
$pasi | Select-Object -Last $N
}
do { if ($Watch) { Clear-Host }; Arata; if ($Watch) { Start-Sleep 15 } } while ($Watch)

View File

@@ -15,6 +15,9 @@ param(
$ErrorActionPreference = "Stop"
Set-Location $ProjectRoot
# -Files explicit => comportamentul istoric (fara fisier de verificat, exit 0)
$explicitFiles = $PSBoundParameters.ContainsKey('Files')
if (-not $Files -or $Files.Count -eq 0) {
$tracked = git diff --name-only HEAD 2>$null
$untracked = git ls-files --others --exclude-standard 2>$null
@@ -24,8 +27,12 @@ if (-not $Files -or $Files.Count -eq 0) {
}
if (-not $Files -or $Files.Count -eq 0) {
Write-Output "Niciun fisier modificat - nimic de verificat."
exit 0
if ($explicitFiles) {
Write-Output "Niciun fisier modificat - nimic de verificat."
exit 0
}
Write-Output "Niciun fisier modificat - implementarea nu a produs diff."
exit 1
}
$failures = @()