fix(core,engine): OFFSET 순회 중 필터 컬럼 변경으로 인한 처리 누락 수정

Laravel chunk/each 는 OFFSET 기반이라, 콜백이 행의 필터 소속을 바꾸면
(필터 컬럼을 채우거나 매칭 행을 삭제하면) 다음 조회가 그만큼 앞으로 밀려
미처리 행을 조용히 건너뛴다. 250건/청크 100 이면 정확히 100건이 남는다.
코어·번들 확장 전수 조사로 확정한 6곳을 chunkById(키셋 순회)로 통일했다.

브라우저 검수(28축)에서 계획에 없던 결함 12건이 드러나 같은 사슬에서
수정했다. 이 중 layout_strategy=keep 무효화와 수정 감지 실패 시 "수정 없음"
오보는 사용자 작업 소실에 직결된다.

재발 방지로 audit 룰을 추가했고, 수정 6곳을 원복해 red 6건 / 복원 후 green
0건으로 판별력을 검증했다.
This commit is contained in:
HeuJung committed 2026-07-31 21:50:45 +09:00
1 parent 1866f0d566
commit 1eedbbdda1
55 files changed
+2764 -198

No files matched your search

+26 -2
View File
@@ -24,6 +24,13 @@ class ExpressionEvaluator
*/
private array $seoOverrides = [];
/**
* 번역 면제 바인딩 접두사 (`{{raw:expr}}`)
*
* 프론트엔드 `rawMarkers.ts` 의 RAW_PREFIX 와 동일해야 합니다.
*/
private const RAW_PREFIX = 'raw:';
public function __construct()
{
$this->pipeRegistry = new PipeRegistry;
@@ -87,6 +94,11 @@ class ExpressionEvaluator
if ($this->isSingleBinding($trimmed)) {
$expr = trim(substr($trimmed, 2, -2));
// raw: 접두사 제거 — 남겨 두면 콜론이 식의 일부로 파싱돼 평가가 실패한다.
if (str_starts_with($expr, self::RAW_PREFIX)) {
$expr = trim(substr($expr, strlen(self::RAW_PREFIX)));
}
// 파이프 표현식: 원본 값을 파이프로 변환 후 반환
if (PipeRegistry::hasPipes($expr)) {
[$baseExpr, $pipes] = PipeRegistry::splitPipes($expr);
@@ -281,10 +293,21 @@ class ExpressionEvaluator
return $this->resolveTranslation($expression, $context);
}
// raw: 접두사(번역 면제 바인딩)를 벗기고 후처리 대상에서 제외한다.
// React 는 `{{raw:expr}}` 의 접두사를 떼고 평가한 뒤 결과의 `$t:` 토큰을
// 번역하지 않는다(rawMarkers). 여기서 접두사를 그대로 두면 콜론이 식의
// 일부로 파싱되어 평가가 실패하고, 봇 화면에서만 값이 사라진다.
$rawExempt = false;
// {{binding | pipe}} 패턴 치환 (파이프 표현식 지원)
$result = (string) preg_replace_callback('/\{\{(.+?)\}\}/', function ($matches) use ($context) {
$result = (string) preg_replace_callback('/\{\{(.+?)\}\}/', function ($matches) use ($context, &$rawExempt) {
$expr = trim($matches[1]);
if (str_starts_with($expr, self::RAW_PREFIX)) {
$rawExempt = true;
$expr = trim(substr($expr, strlen(self::RAW_PREFIX)));
}
// 파이프 분리: expr | pipe1 | pipe2(arg)
if (PipeRegistry::hasPipes($expr)) {
[$baseExpr, $pipes] = PipeRegistry::splitPipes($expr);
@@ -304,7 +327,8 @@ class ExpressionEvaluator
}, $expression);
// 인라인 $t:key 토큰 해석 ({{}} 외부 텍스트 내 $t:key|param=value 패턴)
if (str_contains($result, '$t:')) {
// raw: 바인딩 결과는 번역 면제 — React 와 동일하게 토큰을 그대로 둔다.
if (! $rawExempt && str_contains($result, '$t:')) {
$result = preg_replace_callback('/\$t:(?:defer:)?([\w.\-]+(?:\|[\w.\-]+=[\w.\-{}]+)*)/', function ($matches) use ($context) {
return $this->resolveTranslation('$t:'.$matches[1], $context);
}, $result);