diff --git a/.dev-loop/INGEST_REPORT.md b/.dev-loop/INGEST_REPORT.md index 2ff3871..1cbd85d 100644 --- a/.dev-loop/INGEST_REPORT.md +++ b/.dev-loop/INGEST_REPORT.md @@ -1,35 +1,185 @@ -# Knowledge flush — 1 insight +# Knowledge flush — 1 page from 2 insight(s), 1 candidate deduped -Source: RNR-3440 (사내 잠재매물 주간 추출 스크립트 메모리 피크 저감). Candidate: -"QueryPie 프록시 경유로 대용량 결과를 스트리밍할 때 server-side named cursor 대신 -일반 커서 + `fetchmany` + openpyxl `write_only`." +Cross-Check: 독립 claude CLI(headless, --permission-mode plan) 적대검증 1회 — `.strip("|")`가 마지막 셀의 escaped pipe를 먹는 실제 버그(GitHub `/markdown` API로 재현 확인), pitest·ESLint 인용 과대주장 2건을 지적받아 전부 수정 반영. 백슬래시 parity 반례 지적은 GitHub 실렌더로 기각됨. + +Queue drained: 3 pending rows. Two became one page (they share a trigger); one was +already flushed and is a duplicate re-emission — see "Existing-layer check". + +## Independent adversarial cross-check — 3 defects found and fixed + +An independent headless `claude` instance was asked to break this page's claims. It +found one real code defect and two overstated citations; all three are fixed in this +PR, and I re-verified each myself rather than taking the review's word. + +| Finding | Verification | Fix | +|---------|--------------|-----| +| **Code defect.** The snippet's `row.strip().strip("|")` strips a *run* of pipes, so a cell ending in an escaped pipe loses it and keeps a dangling backslash — every per-column comparison against that cell then compares the wrong string | Reproduced: `\|a\|b\\\|\|` gave `['a', 'b\\']`. Ground truth from GitHub's own renderer (`POST /markdown`, `mode: gfm`): the row is two cells, `a` and `b\|` | Delimiters now stripped with anchored patterns (`^\|`, `(? — the normative + split this rests on. `required`: "An object instance is valid against this keyword + if every item in the array is the name of a property in the instance." `enum`: "An + instance validates successfully against this keyword if its value is equal to one + of the elements in this keyword's array value." Presence and value are separate + keywords in the spec, which is exactly the coverage-vs-validity distinction. +- — the negative-control mechanic. "Faults (or mutations) are + automatically seeded into your code, then your tests are run. If your tests fail + then the mutation is killed, if your tests pass then the mutation lived." And on + why a green run over covered rows proves less than it appears to: line coverage + "measures only which code is executed by your tests. It does **not** check that + your tests are actually able to detect faults in the executed code." +- — `RuleTester#run()` takes + `valid` and `invalid` case arrays, and an invalid case must declare `errors`; the + must-pass/must-fail pairing is the established form for validating a checker. + +**How verified.** The two load-bearing quotes (JSON Schema, pitest) were read from +the primary sources, not from memory. The per-check-negative-control refinement — +one mutation per check, requiring the *owning* check to redden — is the session's +own field evidence (mutating `| EntityDecl | Entity |` to `Bogus` and repointing a +golden node id to `perf.nonexistent` both left the coverage checks PASS until +kind∈schema and id∈document checks were added). + +**Confidence: verified** for the coverage/validity split and the seeded-fault +mechanic (official docs). The "exactly one check reddens per mutation" discipline is +field evidence layered on those sources; it is stated as a directive, not attributed +to a source it does not come from. + +**Not cited.** The draft this flush inherited cited +`testing.googleblog.com/2021/04/mutation-testing.html`. That page's body could not be +retrieved (the fetch returned only title/comments/sidebar), so it was **removed** +rather than carried as an unread citation; `pitest.org` supplies the same mechanic in +text I could actually read. Two further draft citations (ploeh red-green checklist, +lostechies "red for the right reason") were dropped with the scope change below. + +### Insight B — Markdown table rows split on unescaped pipes only + +**Claim.** When validating or parsing Markdown table rows programmatically, split on +unescaped pipes — `re.split(r"(? (tables extension) — "Include a pipe in a cell's + content by escaping it, including inside other inline spans"; "The header row must + match the delimiter row in the number of cells. If not, a table will not be + recognized"; and for body rows, "If there are a number of cells fewer than the + number of cells in the header row, empty cells are inserted. If there are greater, + the excess is ignored". The last quote corrected an edge-case claim: a fixed + body-row cell count is a repo convention, not a GFM requirement, and the page now + says so. -**Claim 3 — openpyxl `write_only` gives near-constant memory (<10 MB); one save only; lxml is for serialization speed, not the memory saving.** -- Source: openpyxl Optimised Modes — `https://openpyxl.readthedocs.io/en/stable/optimized.html` (via WebSearch). "keeping memory usage under 10Mb"; "A write-only workbook can only be saved once"; "make sure you have lxml installed" for large dumps (speed). -- This **corrects** the raw candidate's "lxml unnecessary" → precise form: unnecessary *for the memory win*, recommended *for large-dump speed*. Confirmed by my server test (write-only worked with lxml absent). → **verified** +**How verified.** Reproduced locally (Python 3.9.6, macOS) on a 5-column row whose +third cell holds `create\|update\|delete`: `split("|")` → **7** cells, +`re.split(r"(? [추정] 표시 항목은 세션에 명시 근거가 없어 사후 재구성한 의도임 — 검증 필요 diff --git a/log.md b/log.md index 587a5dc..415a83d 100644 --- a/log.md +++ b/log.md @@ -34,3 +34,4 @@ Append-only. Format: `## [YYYY-MM-DD]