[CLAUDE] Scripts: S167 governance — split _INDEX auto-rotate + 3 script _INDEX*-glob + tran _mind 48KB + ratified-stamps
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 6m24s

Slot(57) anh "auto": cicd-monitor _INDEX 21.468->8.756B (42,7% cap) + _INDEX-2026-H1.md tang-lanh;
3 script cung-class nhan _INDEX*.md (gate chong-haystack-duong-gia + doc MOI index-file; measure truc
l2_index; shard-probe loai-tru); fault-inject 2-chieu PASS + A7 427/427 lan dau sach (va needle-quote
test-specialist + mega-line + 29-entry lac-section). Slot(58) anh "nang tran": mind_ctx_kb 32->48
(live-verified 62,2%). G-1 RATIFIED stamps KhkkWorkflowPanel x2 app (SHA-pair giu) + STATUS 622/counter-41.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-08-01 13:06:39 +07:00
parent aaed699228
commit 628132cf10
6 changed files with 17 additions and 12 deletions

View File

@ -37,7 +37,7 @@ if (Test-Path $memRoot) {
if (Test-Path $arc) {
Get-ChildItem -Path $arc -Filter '*.md' -File -ErrorAction SilentlyContinue | ForEach-Object {
$n = $_.Name
if ($n -eq '_INDEX.md') { return } # muc-luc, KHONG phai shard
if ($n -like '_INDEX*.md') { return } # muc-luc (ke ca ban rotate _INDEX-<period>.md @S167), KHONG phai shard
if ($n -like '*.gist.md') { return } # ban nen, KHONG phai shard
$gist = Join-Path $arc ($n -replace '\.md$', '.gist.md')
if (-not (Test-Path $gist)) { $pending += $_.FullName }

View File

@ -17,7 +17,7 @@ Get-ChildItem -Path $Root -Directory | Sort-Object Name | ForEach-Object {
$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 }
if ($_.Name -like '_INDEX*.md') { $index += $_.Length } # S167 split: rotated _INDEX-<period>.md stays in the l2_index axis (not verbatim)
elseif ($_.Name -like '*.gist.md') { $gist += $_.Length }
else { $verbatim += $_.Length }
}

View File

@ -248,8 +248,10 @@ foreach ($d in $subDirs) {
if (-not (Test-Path $indexPath)) { continue } # only subs with a built index
$anyArchive = $true
# all archive content files (exclude the index itself)
$contentFiles = Get-ChildItem -Path $archDir -Filter *.md | Where-Object { $_.Name -ne '_INDEX.md' }
# all archive content files (exclude EVERY index file: _INDEX.md + rotated _INDEX-<period>.md.
# S167 split: a rotated index must NOT become a haystack - its own "substring:" lines would
# self-resolve any needle and turn a lost archive record into a silent PASS)
$contentFiles = Get-ChildItem -Path $archDir -Filter *.md | Where-Object { $_.Name -notlike '_INDEX*.md' }
Write-Output " [$sub] _INDEX.md + $($contentFiles.Count) archive file(s)"
@ -272,7 +274,10 @@ foreach ($d in $subDirs) {
# (i) pointer-resolve: extract every substring token (substring:QUOTE...QUOTE) and
# locate it literally (String.Contains = SimpleMatch) in ANY archive file.
$indexText = [System.IO.File]::ReadAllText($indexPath, $utf8)
# S167 split: read EVERY _INDEX*.md (main + rotated) so pointers that moved to a
# rotated index file KEEP being verified - rotation must not silently shrink the net.
$indexFiles = Get-ChildItem -Path $archDir -Filter '_INDEX*.md'
$indexText = ($indexFiles | ForEach-Object { [System.IO.File]::ReadAllText($_.FullName, $utf8) }) -join "`n"
$indexLines = $indexText -split "`r?`n"
$subPtrCount = 0; $subOk = 0; $subFail = 0
foreach ($line in $indexLines) {