[CLAUDE] Docs: thi hanh tron plan adap dot-2 (P2/P3/P5/P7i + W4 + khoan 5/6)
Chu du an chot 6 cau @S181; so quyet-dinh o runs/2026-08-07-S180-adap-upgrade-pack-phased/owner-decisions-07-08-2026-dot-2.md - P2=PB-2 sua luat da ratify du 2 SITE (tiep.md §3-bis canonical + pause.md b6 chi TRO). Cau cam san-3 GIU NGUYEN, chi them ranh REQUEST ⟂ TASK. - W4: docs/governance/so-yeu-cau-chu-du-an.md 3 khoi, ma YC/ST/PN vinh vien. Config: tiep_reload.sources 8->9 + owner_request_verbatim_char_cap. nhip-no-probe ve-5 "so-yc treo/nhac2+", fault-inject 5/5, phan biet chua-co-du-lieu ⟂ treo 0. Ky luat ghi-NGAY + A5 cam CLAUDE.md + rules.md §6.0. - P5: ACTIVE-MARKS §LT3 luat tu-tri 3 bac + mark RC-...-07-08-2026-20-57-48. - P7(i): docs/governance/expensive-runs-view.md derive-view 5 cot. - P3=B: niem phong _sealed_P3B_S181 (forward-only). Phep thu A10 da co rang (fault-inject: class tu che => exit 2; class hop le => exit 0). - Khoan 6: scripts/naming-baseline.json = NGUON, script chi doc. Fault-inject 6/6 hai chieu. 7/7 baseline xanh. 0 byte non-ASCII. - Khoan 5: broadcasts/_index.md +cot "ap" cuoi hang, backfill 42/4/23 = 69. - W3 acceptance 6/6 dong + va defect con-tro bang-19-cua (view-stale-status). Con treo: P8/W4b, W5, P7 ve (ii), VK-5, P3 hoi-to hay forward-only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@ -59,6 +59,40 @@ $script:Pep8 = 0
|
||||
$script:MissingSets = 0
|
||||
$script:LechList = @()
|
||||
|
||||
# ---------- baseline ky-vong ----------
|
||||
# NGUON DUY-NHAT = scripts/naming-baseline.json (chu du an chot phuong an (b) @S181, cau 6).
|
||||
# (a) Script nay chi DOC. CAM chep so nguoc vao day -- chep nguoc = de nguon-doi,
|
||||
# dung thu ma phuong an (b) sinh ra de chan.
|
||||
# (b) Nap tu $PSScriptRoot, KHONG phai $RepoRoot: fault-inject chay -RepoRoot <cay-tam>
|
||||
# nhung baseline la thuoc tinh cua CHUAN, khong phai cua cay dang quet.
|
||||
# (c) Thieu khoa / hong tep => IN LOUD roi tra $null. CAM tra 0: so 0 se lam mau so
|
||||
# cua guard A2 (:99) thanh "0/0", va "0/0" doc thanh SACH. Do dung la bay
|
||||
# "vang mat trong giong on" ma guard A2 duoc dung len de chan.
|
||||
$script:BaselinePath = Join-Path $PSScriptRoot 'naming-baseline.json'
|
||||
$script:Baseline = $null
|
||||
$script:BaselineUpdated = '(khong ro)'
|
||||
if (Test-Path -LiteralPath $script:BaselinePath) {
|
||||
try {
|
||||
$bj = Get-Content -LiteralPath $script:BaselinePath -Raw | ConvertFrom-Json
|
||||
$script:Baseline = $bj.sets
|
||||
if ($bj._updated) { $script:BaselineUpdated = [string]$bj._updated }
|
||||
} catch {
|
||||
Write-Host ("FLAG BASELINE-HONG: doc duoc '{0}' nhung khong parse duoc JSON: {1}" -f $script:BaselinePath, $_.Exception.Message) -ForegroundColor Red
|
||||
}
|
||||
} else {
|
||||
Write-Host ("FLAG BASELINE-VANG: khong thay '{0}'. Moi nhom se chay KHONG co ky-vong." -f $script:BaselinePath) -ForegroundColor Red
|
||||
}
|
||||
|
||||
function Get-Baseline([string]$Label) {
|
||||
if ($null -eq $script:Baseline) { return $null }
|
||||
$p = $script:Baseline.PSObject.Properties[$Label]
|
||||
if ($null -eq $p) {
|
||||
Write-Host (" FLAG BASELINE-THIEU-KHOA: '{0}' khong co trong naming-baseline.json" -f $Label) -ForegroundColor Red
|
||||
return $null
|
||||
}
|
||||
return [int]$p.Value
|
||||
}
|
||||
|
||||
function Write-Head([string]$t) { Write-Host ''; Write-Host $t -ForegroundColor Cyan }
|
||||
|
||||
function Add-Verdict {
|
||||
@ -84,19 +118,31 @@ function Scan-Set {
|
||||
# 'Item' = ca tep LAN thu muc. Bat buoc cho scripts/ va docs/governance/ vi
|
||||
# tap 231 dem theo don vi "muc" o hai nhom do (bay don-vi: tep != muc).
|
||||
[ValidateSet('File', 'Dir', 'Item')][string]$Kind,
|
||||
[int]$Expect,
|
||||
# -1 = khong truyen tay => tra cuu tu naming-baseline.json theo $Label.
|
||||
# KHONG dat mac dinh 0: xem ghi chu (c) o khoi nap baseline.
|
||||
[int]$Expect = -1,
|
||||
[scriptblock]$Rule,
|
||||
[string]$Filter = '*',
|
||||
[switch]$Recurse
|
||||
)
|
||||
|
||||
if ($Expect -lt 0) {
|
||||
$b = Get-Baseline $Label
|
||||
if ($null -ne $b) { $Expect = $b }
|
||||
}
|
||||
$hasExpect = ($Expect -ge 0)
|
||||
|
||||
$full = Join-Path $RepoRoot $RelPath
|
||||
Write-Head ("--- NHOM: {0} [{1}]" -f $Label, $RelPath)
|
||||
|
||||
if (-not (Test-Path -LiteralPath $full)) {
|
||||
$script:MissingSets++
|
||||
Write-Host (" FLAG THIEU-TAP: khong tim thay '{0}'." -f $RelPath) -ForegroundColor Red
|
||||
Write-Host (" Day KHONG phai [skip]. Tap vang mat => phep do khong ton tai, mau so = 0/{0} ky vong." -f $Expect) -ForegroundColor Red
|
||||
if ($hasExpect) {
|
||||
Write-Host (" Day KHONG phai [skip]. Tap vang mat => phep do khong ton tai, mau so = 0/{0} ky vong." -f $Expect) -ForegroundColor Red
|
||||
} else {
|
||||
Write-Host " Day KHONG phai [skip]. Tap vang mat => phep do khong ton tai, va KHONG CO ky-vong lam mau so (baseline thieu) => CAM doc thanh sach." -ForegroundColor Red
|
||||
}
|
||||
Write-Host " Nguyen nhan thuong gap: thu muc vua bi doi ten => moi may neo vao no cung mu theo."
|
||||
return
|
||||
}
|
||||
@ -127,8 +173,10 @@ function Scan-Set {
|
||||
}
|
||||
|
||||
Write-Host (" mau so: {0} {1}" -f $n, $unit) -NoNewline
|
||||
if ($n -ne $Expect) {
|
||||
Write-Host (" [!] lech ky vong {0} - chuan hoac kho da doi, doc lai naming-standard.md" -f $Expect) -ForegroundColor Yellow
|
||||
if (-not $hasExpect) {
|
||||
Write-Host " [!] KHONG CO ky-vong cho nhom nay trong naming-baseline.json" -ForegroundColor Red
|
||||
} elseif ($n -ne $Expect) {
|
||||
Write-Host (" [!] lech ky vong {0} (do ngay {1}) - chuan hoac kho da doi, doc lai naming-standard.md" -f $Expect, $script:BaselineUpdated) -ForegroundColor Yellow
|
||||
} else { Write-Host '' }
|
||||
|
||||
Write-Host (" OK {0}/{1} | LECH {2}/{1} | MIEN-theo-luat {3}/{1}" -f $lo, $n, $lk, $lm)
|
||||
@ -148,7 +196,7 @@ Write-Host "Chuan : docs/governance/naming-standard.md"
|
||||
Write-Host "Tap do : 231 ten vat-bo-may, 0 mien tru VUNG (khong quet 1.545 tep .md - bay-4)."
|
||||
|
||||
# 1/7 - vai
|
||||
Scan-Set -Label 'vai' -RelPath '.claude/agents' -Kind File -Expect 27 -Filter '*.md' -Rule {
|
||||
Scan-Set -Label 'vai' -RelPath '.claude/agents' -Kind File -Filter '*.md' -Rule {
|
||||
param($f)
|
||||
if ($f.Name -eq 'README.md') { return @('MIEN', 'quy uoc pho quat (luat L4)') }
|
||||
if ($f.BaseName -cmatch $RX_KEBAB) { return @('OK', '') }
|
||||
@ -156,14 +204,14 @@ Scan-Set -Label 'vai' -RelPath '.claude/agents' -Kind File -Expect 27 -Filter '*
|
||||
}
|
||||
|
||||
# 2/7 - thu muc nhat ky vai
|
||||
Scan-Set -Label 'nhat-ky-vai' -RelPath '.claude/agent-memory' -Kind Dir -Expect 26 -Rule {
|
||||
Scan-Set -Label 'nhat-ky-vai' -RelPath '.claude/agent-memory' -Kind Dir -Rule {
|
||||
param($d)
|
||||
if ($d.Name -cmatch $RX_KEBAB) { return @('OK', '') }
|
||||
return @('LECH', 'thu muc nhat ky phai trung ten vai (kebab thuan)')
|
||||
}
|
||||
|
||||
# 3/7 - lenh
|
||||
Scan-Set -Label 'lenh' -RelPath '.claude/commands' -Kind File -Expect 19 -Rule {
|
||||
Scan-Set -Label 'lenh' -RelPath '.claude/commands' -Kind File -Rule {
|
||||
param($f)
|
||||
if ($f.Name -eq 'README.md') { return @('MIEN', 'quy uoc pho quat (luat L4)') }
|
||||
if ($f.BaseName -cmatch $RX_KEBAB) { return @('OK', '') }
|
||||
@ -171,7 +219,7 @@ Scan-Set -Label 'lenh' -RelPath '.claude/commands' -Kind File -Expect 19 -Rule {
|
||||
}
|
||||
|
||||
# 4/7 - kich ban (2 quy uoc ngon ngu, luat L4). Don vi = MUC (co ca thu muc con).
|
||||
Scan-Set -Label 'kich-ban' -RelPath 'scripts' -Kind Item -Expect 55 -Rule {
|
||||
Scan-Set -Label 'kich-ban' -RelPath 'scripts' -Kind Item -Rule {
|
||||
param($f)
|
||||
if ($f.Name -eq 'README.md') { return @('MIEN', 'quy uoc pho quat (luat L4)') }
|
||||
if ($f.Name -eq '__pycache__') { return @('MIEN', 'vat sinh tu dong (luat L4)') }
|
||||
@ -189,7 +237,7 @@ Scan-Set -Label 'kich-ban' -RelPath 'scripts' -Kind Item -Expect 55 -Rule {
|
||||
}
|
||||
|
||||
# 5/7 - tep moc phien. BUOC -Recurse: tep nam trong session-<N>/, khong nam o goc.
|
||||
Scan-Set -Label 'moc-phien' -RelPath '.claude/sessions' -Kind File -Expect 90 -Recurse -Rule {
|
||||
Scan-Set -Label 'moc-phien' -RelPath '.claude/sessions' -Kind File -Recurse -Rule {
|
||||
param($f)
|
||||
if ($f.Name -cmatch $RX_SESSFAM) { return @('OK', '') }
|
||||
if ($f.Name -cmatch '^pause-') {
|
||||
@ -202,7 +250,7 @@ Scan-Set -Label 'moc-phien' -RelPath '.claude/sessions' -Kind File -Expect 90 -R
|
||||
}
|
||||
|
||||
# 6/7 - so. Don vi = MUC (co ca thu muc con adap-reports/ adap-requests/).
|
||||
Scan-Set -Label 'so-governance' -RelPath 'docs/governance' -Kind Item -Expect 16 -Rule {
|
||||
Scan-Set -Label 'so-governance' -RelPath 'docs/governance' -Kind Item -Rule {
|
||||
param($f)
|
||||
if ($f.Name -eq 'README.md') { return @('MIEN', 'quy uoc pho quat (luat L4)') }
|
||||
if ($f.BaseName -cmatch $RX_KEBAB) { return @('OK', '') }
|
||||
@ -210,7 +258,7 @@ Scan-Set -Label 'so-governance' -RelPath 'docs/governance' -Kind Item -Expect 16
|
||||
}
|
||||
|
||||
# 7/7 - hook
|
||||
Scan-Set -Label 'hook' -RelPath '.claude/hooks' -Kind File -Expect 1 -Rule {
|
||||
Scan-Set -Label 'hook' -RelPath '.claude/hooks' -Kind File -Rule {
|
||||
param($f)
|
||||
if ($f.BaseName -cmatch $RX_KEBAB) { return @('OK', '') }
|
||||
return @('LECH', 'hook phai kebab')
|
||||
|
||||
Reference in New Issue
Block a user