[CLAUDE] Docs: adopt Harness-9 — L2 archive dark-matter recovery (4 sub) + adap 2-workflow mandate (S70)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m52s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m52s
3-stage Workflow run-id evidence: investigate wf_be952f3c-97f / implement wf_a58e0d15-beb / audit wf_9520d8cd-4fe. PART 1 (L2 recovery): 4 over-cap sub (cicd-monitor/investigator-codebase/reviewer/implementer-backend) curated L1->L2 byte-exact + archive/_INDEX.md (substring sha-keyed pointers, no line-hints) + <period>.gist.md (4-field distill, distill-gen:1, verbatim frozen). All 4 MEMORY.md now < 25KB auto-inject cap (closes P1 curate-debt). ~240KB archive no longer RAG-dark. 0-byte-loss git+sha verified (Stage C audit + em-main self-gate on 2 reviewer StructuredOutput no-returns). Read-side gap fixed (MEMORY.md L5 header -> _INDEX). + memory-budget.json (seed-by-measure) + scripts/measure-agent-memory.ps1 + .ragignore guard. PART 2/3 (process mandate): every adap = 2 separate workflows (implement + review) + report with run-id; short-but-needs-confirm still requires review. Codified in .claude/commands/adap-apply.md + agents/README.md (Upgrade S70) + session-start.md (§2.1.2 budget-audit, pending-restart). adap-report + email-back to AI_INFRA (body-hash 7c07b716e775). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
41
scripts/measure-agent-memory.ps1
Normal file
41
scripts/measure-agent-memory.ps1
Normal file
@ -0,0 +1,41 @@
|
||||
# measure-agent-memory.ps1 - Harness-9 seed-by-measure (2026-06-17)
|
||||
# Measures REAL bytes of each agent-memory tier so memory-budget.json caps are
|
||||
# set from measurement, NOT an imagined "headroom" number (Harness-9 step a).
|
||||
# Output: JSON to stdout. ASCII-only (gotcha #30). PS 5.1 compatible.
|
||||
param([string]$Root = "$PSScriptRoot\..\.claude\agent-memory")
|
||||
|
||||
if (-not (Test-Path $Root)) { Write-Error "agent-memory root not found: $Root"; exit 1 }
|
||||
|
||||
$rows = @()
|
||||
Get-ChildItem -Path $Root -Directory | Sort-Object Name | ForEach-Object {
|
||||
$dir = $_.FullName
|
||||
$name = $_.Name
|
||||
$mem = Join-Path $dir 'MEMORY.md'
|
||||
$l1 = if (Test-Path $mem) { (Get-Item $mem).Length } else { 0 }
|
||||
|
||||
$archDir = Join-Path $dir 'archive'
|
||||
$verbatim = 0; $index = 0; $gist = 0
|
||||
if (Test-Path $archDir) {
|
||||
Get-ChildItem -Path $archDir -Filter *.md | ForEach-Object {
|
||||
if ($_.Name -eq '_INDEX.md') { $index += $_.Length }
|
||||
elseif ($_.Name -like '*.gist.md') { $gist += $_.Length }
|
||||
else { $verbatim += $_.Length }
|
||||
}
|
||||
}
|
||||
|
||||
$rows += [ordered]@{
|
||||
agent = $name
|
||||
l1_hot_bytes = $l1
|
||||
l2_verbatim_bytes = $verbatim
|
||||
l2_index_bytes = $index
|
||||
l2_gist_bytes = $gist
|
||||
l1_over_30kb = ($l1 -gt 30720)
|
||||
}
|
||||
}
|
||||
|
||||
[ordered]@{
|
||||
measured_at_note = "run date stamped by caller (Date.now unavailable in workflow scripts)"
|
||||
soft_cap_l1_bytes = 30720
|
||||
autoinject_cap_bytes = 25600
|
||||
agents = $rows
|
||||
} | ConvertTo-Json -Depth 5
|
||||
Reference in New Issue
Block a user