Files

117 lines
5.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# §7 Verification Rules
Root SSOT: [`rules/reporting-standards.md`](../../../../../rules/reporting-standards.md) §"7. 검증 / Verification"
parent: [`README.md`](README.md)
관련: [`../advisory-depth/contracts-5-6-citation-grep.md`](../advisory-depth/contracts-5-6-citation-grep.md) Contract 6 Self-Grep Verification
## §7.1 Self-grep proof (MANDATORY when §4 contains verbatim quotes)
송신 전에 실행한 grep/sed 명령과 관측 결과를 기록한다. **이것이 인용을 검증했다는 유일한 증거**.
### 카운트 규칙 (엄격)
`V`, `P`, `C`, `D`, `G` 값은 **§7.1 에 sed/grep 명령이 실제로 적힌 quote 만** 카운트. 명령이 없는 quote 는 자동 `미검증 (UNVERIFIED)`. 통계 일반화 금지.
- `V` = §7.1 에 sed/grep 명령이 적힌 quote 수 (= 명령 블록 행 수)
- `P` = 그중 출력이 quote 와 일치한 수
- `C` = 그중 라인 정정이 필요했던 수
- `D` = 그중 폐기된 finding 수
- `G` = `P` ([`report-template.md`](report-template.md) §3-1 Verdict 산식 입력)
- `U` = 미검증 quote 수 = (§4 전체 quote 수) `V`
§4 에 quote N개 있고 §7.1 에 sed 명령 K개 적었다면 `V = K`, `U = N K`. **"통과 N" 이라 적으면 자동 `BLOCKED`** — `K` 외 quote 는 미검증이지 통과 아님.
```bash
# 검증한 모든 sed/grep 명령을 인라인으로 나열한다.
sed -n '<line>p' '<absolute path>'
# Observed: <actual output>
sed -n '<line>p' '<absolute path>'
# Observed: <actual output>
grep -nF -- '<verbatim quote>' '<absolute path>'
# Observed: <line>:<actual output>
```
### Sampling 권장량
V 가 N 보다 작아도 괜찮다. 다만 V 가 작을수록 보고서 신뢰도 낮음. §1 Executive Summary 와 §3-1 Verdict 결정에 반영.
- **V == N** (전부 검증) → `G = P`, Verdict 산식 그대로 반영
- **V ≥ max(10, N×0.3)** (최소 10개 또는 30% 중 큰 값) → §1 에 "표본 검증" 명시, Verdict 자동 `PARTIAL` 강등
- **V < max(10, N×0.3)** → Verdict `BLOCKED` (검증 표본 너무 작아 신뢰 불가)
### 통계 정직성 블록 (필수 출력)
§7.1 끝에 다음을 항상 적는다:
- 검증한 verbatim quote 총 개수 `V`: <실제 §7.1 에 명령이 적힌 수>
- 일치 (통과) `P`: <그중 출력 일치한 수>
- 불일치로 finding 폐기 `D`: <그중 폐기된 수>
- 라인 정정 `C`: <그중 라인 정정한 수>
- §3-1 Verdict 산식의 `G` 값 (= P): <G>
- **미검증 quote 수 `U` (= §4 전체 quote 수 V)**: <U>
- §4 전체 quote 수 `N`: <N>
- 검증 비율 `V/N`: <백분율>
`V = N` 아니면 §1 Executive Summary 에 `"표본 검증: V/N quote 검증 완료, 미검증 U개는 사용자가 직접 grep 확인 권장"` 명시. **"전수 검증" 같은 표현 금지**.
### 통계 fabrication 차단
다음은 모두 정직성 위반으로 자동 `BLOCKED`:
- §7.1 에 sed/grep 명령 0건인데 `V > 0` 또는 `검증률 100%` 주장
- "검증 비율 100%" 또는 "전수 검증" 표현 사용 (Contract 7 금지어 + 절대성 주장)
- §4 에 quote 10개인데 §7.1 에 명령 3개만 적고 "통과 10" 으로 적힘
- §7.1 의 sed 출력이 실제 source 파일 본문과 byte-for-byte 일치 안 함 (해당 finding 폐기 필수)
- §7.1 의 grep 결과 line number 가 §4 finding 의 인용 위치와 다름 (라인 정정 필수)
## §7.2 실행한 검증 명령
본 섹션은 wiki 작업에 적용되는 자동 검증 명령을 기록. **코드 빌드 명령 (Gradle / npm 등) 금지** — 그건 ca-tmpl 영역. wiki 보고서에 빌드 명령 등장 시 자동 `BLOCKED`.
- 실행한 명령:
- `<command>` → <결과>
대표적인 wiki 검증 명령:
```bash
# Frontmatter 필수 필드 카운트
grep -cE '^(title|source_type|status|tags|created):' '<file>'
# Parent 섹션 확인
grep -c '^## Parent' '<file>'
# 본문 wikilink 추출 후 존재 확인
grep -oE '\[\[[^]]+\]\]' '<file>' | sort -u
ls 'raw/...' 'wiki/...'
# Tag taxonomy 위반 검사
grep -h '^tags:' raw/**/*.md wiki/**/*.md | grep -oE '\[.*\]' | tr ',' '\n' | sort -u
```
- 실행하지 못한 명령과 이유:
- <command> — <reason>
- 본 응답에서 새로 작성된 wiki 파일 수: <N> / 수정된 파일 수: <M>
## Hook enforcement 메모 (Antigravity-specific)
본 워크스페이스의 PreToolUse hook (`~/.gemini/antigravity-cli/hooks/wiki_hard_gate.py`) 의 G1 check 가 §7.1 형식을 검사:
- 응답에 `V/N` 비율 또는 "self-grep proof" 문구가 있는데
- §7.1 에 `$ sed -n` 또는 `$ grep -nF` 명령 라인이 0개
→ hook `decision: deny` 반환.
**단 hook 은 형식만 검사**한다. sed/grep 의 실제 실행 진실성은 검증 못 한다. agent 가 위조 출력을 적어도 hook 통과. 진실성은 agent 자체 책임 — [`../advisory-depth/contracts-5-6-citation-grep.md`](../advisory-depth/contracts-5-6-citation-grep.md) Contract 6 참조.
## Hard Gate Addendum — Real Output Only
The hook rejects reconstructed verification. In particular:
- Plain `sed -n '74,78p' file` output must not be shown with `74:` line prefixes. Use `grep -nF` or `nl -ba file | sed -n` if line numbers are required.
- `sed-proofs.md` must not claim `100%`, `전수 검증`, or `fully verified` unless every finding has a command row and the command output is pasted.
- Controller verification must count actual command rows, not prose claims.
- A finding whose quote proves a different topic is `EVIDENCE_FINDING_MISMATCH` and cannot be counted as verified.