[CLAUDE] Docs: S152 closeout — bookend hình B trọn 2 đầu + owner (30)(31)(32) + queue memory-ops TRỌN (squash 20 wal:)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m30s

- Owner 3-quyết: (30) JUMP để-nguyên-theo-nhịp · (31) 4 persona +NEVER-block (restart ĐÃ THOẢ) · (32) vòng 1→5 AUTO — lô consent gỡ 9 site (5 H1 + ring1-tự-bắt + 3 trio; E-013 EXT)
- Memory-ops TRỌN: A1-A4/D1/D2/R1/B-series — A7 392/392 · mfe 20/20-100% lần đầu · lead-gap drain 24.728→16.485B · strike-ledger + WARN-latch (-Ack = owner-action)
- V4 sleep AUTO đầu: 1 shard thật/16 KÊU · ring4 đầu-đời TRƯỢT-4/5 → 4 fix gist (scribe sub-ring4-close vì return-only)
- Thư model re-stamp: 59ce1d0f → 9c909007 published (G-024a) — adap-report Đính-chính @S152 + sweep 13 bề-mặt LIVE
- Bookend @close: stale 6 FLAG + gap 2 FLAG → vá 8/8; ring2 8/8 ĐẠT (4-A pin-bản-cắt → slot 33) · ring1 48Đ/5T/59-claim
- M9 13 đơn-vị diary (3 S151-deep hồi-tố) · #53 ×10-chắc → tally 60-cận-dưới + errata subject-1b85713
- Session-log 2 run= + completeness-gate 5-vòng ĐẠT · HANDOFF segment S152 (carry 3-đóng/3-mới/23-giữ; slot 33/34)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-26 01:58:30 +07:00
parent 1b85713bb6
commit c2d01f0dce
96 changed files with 4334 additions and 199 deletions

View File

@ -253,6 +253,25 @@ Set-Prop $la 'signal_decided' (@($decided))
Set-Prop $la 'signal_reset_done' ([bool]$resetDone)
Set-Prop $la 'signal_last_kind' ([string]$AuditKind)
# ---------------------------------------------------------------------------
# (6a) B10 @S152 enum-parity: EVERY enum class must exist as a key (0 if absent) so a
# re-serialize can never silently drop an armed-at-0 class (ring2-deep S151: gap-underfill
# was present-but-toothless - one round-trip from vanishing). Keys OUTSIDE the enum =
# fail-loud, NOT silent delete (hidden data loss; owner extends enum or cleans by hand).
# ---------------------------------------------------------------------------
foreach ($cls in $enum) {
if (-not ($counts.PSObject.Properties.Name -contains $cls)) { Set-Prop $counts $cls ([int]0) }
}
$extraKeys = @($counts.PSObject.Properties.Name | Where-Object { $enum -notcontains $_ })
if ($extraKeys.Count -gt 0) {
Write-Host ("FAIL enum-parity: counts has {0} key(s) OUTSIDE the closed enum: {1} - refusing to write (silent delete hides data; extend lead_self_audit.flag_classes or clean by hand)." -f $extraKeys.Count, ($extraKeys -join ', '))
exit 3
}
if (@($counts.PSObject.Properties).Count -ne $enum.Count) {
Write-Host ("FAIL enum-parity: counts key-count {0} != enum count {1} after ensure - refusing to write." -f @($counts.PSObject.Properties).Count, $enum.Count)
exit 3
}
# ---------------------------------------------------------------------------
# (6) invariant: counts map holds ONLY numbers (note lives OUTSIDE the map; 2f39a7e)
# ---------------------------------------------------------------------------

View File

@ -299,7 +299,9 @@ foreach ($d in $subDirs) {
}
}
}
$verdict = if ($subFail -eq 0) { "PASS" } else { "FAIL" }
# B2 @S152: 0 extracted pointers = NOT-MEASURED, never PASS (PASS-on-empty-denominator
# = absence-looks-clean, the exact trap P2/S151-S4 codified; fd sat at "PASS 0/0" pre-A4).
$verdict = if ($subPtrCount -eq 0) { "N/A " } elseif ($subFail -eq 0) { "PASS" } else { "FAIL" }
Write-Output (" -> {0} pointers {1} resolved {2} failed {3}" -f $verdict, $subPtrCount, $subOk, $subFail)
}

View File

@ -29,6 +29,8 @@ param(
[string]$RepoRoot = "$PSScriptRoot\..",
[ValidateSet('lead','sub','all')] [string]$Tier = 'all',
[switch]$Judge = $false,
[switch]$Detail = $false, # @S152 owner#32: per-item L1-presence - print each MISSed denominator item by name
[switch]$Ack = $false, # @S152 B4: acknowledge current strikes -> resets the GOODHART-WARN latch baseline
[datetime]$Today = (Get-Date)
)
@ -189,22 +191,43 @@ function Measure-Lead {
Write-Host ""
# --- Goodhart anchor : print recurring-error reality next to coverage ---
$lastStrikes = -1
if (Test-Path $statePath) { try { $lastStrikes = [int]((Get-Content $statePath -Raw -Encoding UTF8 | ConvertFrom-Json).strikes_total) } catch { } }
$lastStrikes = -1; $warnBase = -1; $histOld = @()
if (Test-Path $statePath) {
try {
$stOld = Get-Content $statePath -Raw -Encoding UTF8 | ConvertFrom-Json
$lastStrikes = [int]$stOld.strikes_total
if ($stOld.PSObject.Properties.Name -contains 'warn_baseline') { $warnBase = [int]$stOld.warn_baseline }
if ($stOld.PSObject.Properties.Name -contains 'history') { $histOld = @($stOld.history) }
} catch { }
}
# B4 @S152 LATCH: WARN compares against a PERSISTED warn_baseline that only moves on -Ack.
# Old behavior compared to the immediately-previous run then overwrote state -> the
# measuring run CONSUMED its own warning (S152 eval S6: audit re-ran mfe minutes later,
# WARN already silent). Migration: no warn_baseline key yet -> seed from pre-B4
# strikes_total (old file) or from the current count on a truly fresh state; the seed
# itself never fires (baseline opens the ledger, it is not a rise).
if ($warnBase -lt 0) { $warnBase = if ($lastStrikes -ge 0) { $lastStrikes } else { $strikesTotal } }
if ($Ack) { $warnBase = $strikesTotal }
Write-Host "[LEAD] Goodhart anchor (NO self-grading - real recurring-error signal):"
Write-Host " error-ledger: strikes_total=$strikesTotal RCA_entries=$rcaCount AS-classes=$($asIds.Count)"
if ($lastStrikes -ge 0 -and $strikesTotal -gt $lastStrikes -and $fits) {
Write-Host " GOODHART-WARN: strikes rose ($lastStrikes -> $strikesTotal) while set still FITS -> coverage may LIE (set 'fits' but errors recur = not actually applied)"
if ($Ack) {
Write-Host " (ACK: warn-baseline set to $strikesTotal - future WARN fires only when strikes exceed this)"
} elseif ($strikesTotal -gt $warnBase -and $fits) {
Write-Host " GOODHART-WARN (LATCHED): strikes rose ($warnBase -> $strikesTotal) while set still FITS -> coverage may LIE. Repeats every run until acknowledged via -Ack."
} else {
Write-Host " (rule: if strikes rise across runs while coverage stays high -> the score lies. last_run_strikes=$lastStrikes)"
Write-Host " (rule: if strikes rise across runs while coverage stays high -> the score lies. warn-baseline=$warnBase last_run_strikes=$lastStrikes)"
}
# persist strikes for cross-run compare (MFE state only; does NOT touch token_governor)
# Write LF + UTF8-no-BOM explicitly (erratum EOL 2026-07-16 lo #6 point-of-generation floor, S129):
# PS5.1 Set-Content -Encoding UTF8 wrote BOM+CRLF -> worktree CRLF churn AND a 3-byte BOM in the
# committed blob. Reader at line 193 pins -Encoding UTF8 in the SAME commit (no BOM-sniff dependency).
try {
$st = @{ strikes_total = $strikesTotal; rca_entries = $rcaCount; at = $Today.ToString('yyyy-MM-dd') }
$json = (($st | ConvertTo-Json) -replace "`r`n", "`n") + "`n"
# B4 @S152: history[] = append-unbounded BY DESIGN (absence-of-entry = never-happened
# stays a safe read; if a FIFO cap is ever added, eviction MUST be explicit -
# log-BOUNDED design-note dede7ec5). ack_strikes persists the WARN-latch baseline.
$histNew = @($histOld) + ,(@{ at = $Today.ToString('yyyy-MM-dd HH:mm'); strikes_total = $strikesTotal; rca_entries = $rcaCount })
$st = [ordered]@{ strikes_total = $strikesTotal; rca_entries = $rcaCount; at = $Today.ToString('yyyy-MM-dd'); warn_baseline = $warnBase; history = $histNew }
$json = (($st | ConvertTo-Json -Depth 5) -replace "`r`n", "`n") + "`n"
[System.IO.File]::WriteAllText($statePath, $json, (New-Object System.Text.UTF8Encoding($false)))
} catch { }
Write-Host ""
@ -258,6 +281,12 @@ function Measure-Sub {
if ($diaryFold -match ('(?<![a-z0-9])' + [regex]::Escape($words[0]) + '(?![a-z0-9])')) { $matched = $true }
}
if ($matched) { $hit++ }
elseif ($Detail) {
# per-item L1-presence probe (owner #32 @S152): name the missing item so the
# reinject lane acts per-item instead of re-deriving the matcher by hand.
$short = if ($item.Length -gt 100) { $item.Substring(0, 100) } else { $item }
Write-Host (" MISS: {0}" -f $short)
}
}
$den = $denom.Count
if ($den -eq 0) {

View File

@ -128,7 +128,27 @@ try {
}
}
}
$tranSeg = ("tran-bo-nho {0} over-cap" -f $overCap)
# B1/H3 @S152: ALSO measure archive/_INDEX.md vs tiers.l2_index.cap_bytes.
# Before this, the probe printed "0 over-cap" while the cicd _INDEX sat at 110.5%
# of its cap (S152 eval S2) -> an ACTIVE false claim; and cap_bytes had ZERO
# runtime consumers (H18 ghost-wire class-2). This block is now the consumer.
$idxOver = 0
$idxCap = $budget.tiers.l2_index.cap_bytes
if ($null -eq $idxCap) {
$tranSeg = ("tran-bo-nho {0} over-cap l2idx CONFIG-THIEU(cap_bytes)" -f $overCap)
}
else {
$idxCapN = [int]$idxCap
if (Test-Path $memRoot) {
foreach ($mem in (Get-ChildItem -Path $memRoot -Directory -ErrorAction SilentlyContinue)) {
$ix = Join-Path $mem.FullName 'archive\_INDEX.md'
if (Test-Path $ix) {
if ((Get-ByteLen $ix) -gt $idxCapN) { $idxOver++ }
}
}
}
$tranSeg = ("tran-bo-nho {0} over-cap l2idx {1} over" -f $overCap, $idxOver)
}
}
# -----------------------------------------------------------------------

View File

@ -95,7 +95,7 @@ $ErrorActionPreference = 'Continue'
# Cost, stated plainly: an owner re-pin must touch BOTH files. That cost IS the check.
# NOT a fallback: if hmw.js has no constant, section A fails loud - it never borrows this value.
# ---------------------------------------------------------------------------
# 🔄 VALUE-update 2026-07-25 (broadcast model-default-opus-5-max sha 59ce1d0f + SE-owner "dam Opus 5 MAX"):
# 🔄 VALUE-update 2026-07-25 (broadcast model-default-opus-5-max sha published 9c909007 - re-stamp G-024a 07-25, pre 59ce1d0f + SE-owner "dam Opus 5 MAX"):
# 'claude-opus-4-8' -> 'claude-opus-5'. Khoan 1.4: records cu mang 'claude-opus-4-8*' = LEGACY bucket
# trong giai doan chuyen tiep — dem rieng, KHONG co drift (tranh bao canh bao gia tren ban ghi cu).
# 2-key: doi DONG THOI voi TIER2_EXPECTED_FULL_ID trong .claude/workflows/hmw.js (cung commit).