[CLAUDE] Docs: adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block, S81)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m0s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m0s
8/8 floor via engine section-G + budget.json (harness_floor/token_governor/value_protect) + session-start 2.1.5 + rules 6.6 + gate-script value-protect FLAG (runtime-fired test-specialist). Review wf_b7f3c8ac-b53 PASS/PASS/HONEST -> 2 CONCERN fixed (anchoring + tool-attribution) + refresh stale measured S71->S81. adap-report + email ai_infra body-hash bb8fb6e803ae. 0 production code, A7 217/217, detector 26-flag baseline. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -50,6 +50,15 @@ $lowMark = [int]([math]::Floor($cap * [double]$gate.low_watermark_ratio)) #
|
||||
$keepFloor = [int]$gate.keep_floor_entries # A5: never auto-drain below N newest
|
||||
$strikeNeed = [int]$gate.strike_threshold # A6: consecutive over-cap runs before proposing
|
||||
|
||||
# value-protect patterns (Harness-15 B(b), S81): HIGH-VALUE markers (recurring-bug /
|
||||
# anti-pattern / gotcha / root-cause). If a planned MOVE would archive one OUT of
|
||||
# L1-hot regardless of age, FLAG it (keep-by-VALUE, not FIFO-by-date). ADVISORY FLAG
|
||||
# ONLY - em-main decides (no auto-exclude); keep_floor stays the recency axis.
|
||||
$valPatterns = @()
|
||||
if ($gate.value_protect -and $gate.value_protect.patterns) {
|
||||
foreach ($vp in $gate.value_protect.patterns) { if ($vp) { $valPatterns += [string]$vp } }
|
||||
}
|
||||
|
||||
# ---- strike-counter state (A6) -------------------------------------------
|
||||
# Stateless script => persist a tiny counter file (additive, NOT a memory file).
|
||||
# Only mutated under -Apply so DRY-RUN is side-effect-free.
|
||||
@ -155,6 +164,17 @@ foreach ($d in $subDirs) {
|
||||
if ($afterEst -ge $cap -and $moveCount -eq ($entryCount - $keepFloor)) { $warnFloor = $true }
|
||||
}
|
||||
|
||||
# --- H15 B(b) value-protect: scan the MOVED prefix for high-value markers ---
|
||||
$valHits = @()
|
||||
if ($moveCount -gt 0 -and $valPatterns.Count -gt 0) {
|
||||
$cutLine = $markers[$moveCount] # first KEPT line; moved region = lines [0..cutLine-1]
|
||||
for ($vli = 0; $vli -lt $cutLine; $vli++) {
|
||||
foreach ($vp in $valPatterns) {
|
||||
if ($lines[$vli] -like "*$vp*") { $valHits += $vp; break }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# --- A6 gate the resolution wording on the strike count ---
|
||||
if ($warnFloor) {
|
||||
$resolve = "WARN keep-floor hit ($keepFloor); cannot auto-drain - SPLIT/condense entries by hand"
|
||||
@ -165,6 +185,10 @@ foreach ($d in $subDirs) {
|
||||
}
|
||||
|
||||
Write-Output ("{0,-24} {1,9} {2,5} {3,10} {4,7} {5,12} {6}" -f $sub, $bytes, 'YES', $entryCount, $cur, "~$afterEst", $resolve)
|
||||
if ($valHits.Count -gt 0) {
|
||||
$uniqHits = ($valHits | Select-Object -Unique) -join ', '
|
||||
Write-Output (" [H15 B(b) VALUE-PROTECT] move-set has high-value marker(s): $uniqHits -> KEEP in L1 regardless of age (do NOT age-archive); em-main decides")
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $anyOver) {
|
||||
|
||||
Reference in New Issue
Block a user