[CLAUDE] Docs: S151 closeout — bootstrap + trio-AUTO đầu tiên + gói 3-máy vá sống + bookend DEEP trả nợ JUMP (tally #53=53, AS-17 promote)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m38s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-25 20:13:25 +07:00
parent 398d343403
commit 1b85713bb6
54 changed files with 2422 additions and 95 deletions

View File

@ -352,7 +352,15 @@ if ($null -eq $maxGotcha -or $gotchaAnchors.Count -eq 0) {
}
else {
# Match "gotcha #N", "gotcha N", and bare "#N" tokens.
$refRx = '(?:gotcha[s]?\s*#?(\d+))|(?<![A-Za-z0-9])#(\d+)'
# S151 fix (FP #111, H1 F-6 + ring1 confirm): the word-branch used to swallow
# "gotchas 111.616B" (a BYTE-SIZE, thousands-separator) and flag a phantom #111.
# Guard: the digits must NOT be followed by a decimal/thousands separator + digit
# (111.616 / 111,616) nor glued to a letter (111B) - real refs ("#57", "gotcha 81-EXT",
# "gotcha 57,") are unaffected. Word-boundary before 'gotcha' kills mid-word hits.
# (?!\d) pins the capture to the FULL digit-run first - without it the engine
# backtracks THROUGH the guard ("gotchas 111.616B" -> retries as "11" and matches
# a phantom #11; caught by fault-inject S151). Then the separator guard applies.
$refRx = '(?:\bgotcha[s]?\s*#?(\d+)(?!\d)(?![.,]\d|[A-Za-z]))|(?<![A-Za-z0-9])#(\d+)'
foreach ($f in $GovMd) {
$lines = Get-Content -Path $f.FullName -Encoding UTF8
for ($i = 0; $i -lt $lines.Count; $i++) {
@ -872,7 +880,16 @@ if (-not (Test-Path $handoffPath)) {
else {
$raw = Get-Content -Path $handoffPath -Raw -Encoding UTF8
# "NEXT anh" / "NEXT em" are pure ASCII (no diacritics) -> safe as a literal here.
$marks = [regex]::Matches($raw, 'NEXT\s+(?:anh|em)')
# S151 fix (lead-gap FLAG-1 HIGH, ring2 re-implemented + confirmed): the unanchored
# literal cut a segment at EVERY occurrence of the phrase - including MID-PROSE
# mentions (HANDOFF item (20) contains "NEXT anh #11" inside a sentence), which
# split the current segment so carryLines[0] shared nothing with carryLines[1] and
# every streak broke at 1 => the carry-age net went silent while printing [ok].
# Anchor to REAL segment headers only: line-start bold "**NEXT anh/em" with an
# optional emoji marker (e.g. the red dot). The marker is matched as "any run of
# non-ASCII chars" [^\x00-\x7F]+ so this .ps1 source stays pure-ASCII (gotcha #30)
# and survives a future marker-emoji change; \xNN is interpreted by .NET at match time.
$marks = [regex]::Matches($raw, '(?m)^\*\*(?:[^\x00-\x7F]+\s*)?NEXT\s+(?:anh|em)\b')
$segs = @()
for ($i = 0; $i -lt $marks.Count; $i++) {
$start = $marks[$i].Index