Skip to content

fix(stack_verify_all): 증인 계층을 조용히 건너뛰고 ALL OK 를 냈다 - #36

Merged
bhyi4 merged 1 commit into
mainfrom
fix/silent-witness-skip
Aug 18, 2026
Merged

fix(stack_verify_all): 증인 계층을 조용히 건너뛰고 ALL OK 를 냈다#36
bhyi4 merged 1 commit into
mainfrom
fix/silent-witness-skip

Conversation

@bhyi4

@bhyi4 bhyi4 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

if am_ledger and am_peer_name:else 가 없었다. 증인 원장을 넘겨도 am_peer_name 이 없으면 L2 교차증인이 아예 안 돌고, 그런데도 판정은 ALL OK 였다.

r = stack_verify_all(mm_ledger=LED, am_ledger=AM)   # peer 이름 없이
# before → verdict: "ALL OK"
# after  → verdict: "ALL OK (partial: 1 requested layer(s) did not run)"

am 체인이 초록불 뒤에서 영영 안 측정될 수 있었다. 이건 검증기가 절대 하면 안 되는 한 가지다.

★ partial 의 정의 — "요청했는데 안 돈 것"만

anchor_dir 를 안 준 건 그게 아니다. L3 를 요청하지 않은 것이라 scope.layers_not_requested 로 적고 판정은 깨끗이 둔다.

호출 verdict
(mm_ledger) — L1만 요청 ALL OK · layers_not_requested: ["L3 anchor"]
(mm_ledger, am_ledger) — 증인 요청했는데 안 돎 ALL OK (partial: 1 requested layer(s) did not run)
(mm_ledger, am_ledger, am_peer_name, anchor_dir) ALL OK · layers_run: [L1, L2, L3] · 6/6

이 구분을 안 하면 L1만 부르는 정상 호출까지 partial 이 된다(첫 구현이 그랬고, 기존 시험이 그걸 잡았다).

같이 고친 둘

  • docstring 이 "Verify the whole stack in one call" 이라 약속했다. 전체를 잰 적이 없다 — 인자로 받은 원장만 재고 stack.json 을 안 읽는다. 그래서 caller 가 안 넘긴 원장에 대해선 아무 말도 못 한다. 그대로 적었고, 디렉토리 전체 커버리지는 verify_all.py 오케스트레이터로 가라고 가리켰다.
  • seals valid 가 잰 개수를 같이 낸다. 그 문장은 빈 원장에서도 참이다.

시험

51 통과. 남은 실패 1건(test_prereg_lint_clean_seal_has_no_warn_or_fail)은 이 변경 전 origin/main 에서도 재현된다(git stash 로 확인) — 이 PR 과 무관하고, 로컬 형제 체크아웃(../measure_mirror_poc)을 타고 들어가는 mm.py:463 TypeError 다. CI 가 판단할 몫으로 둔다.

맥락

이건 수리 둘 중 둘째다. 첫째는 measure-mirror 쪽 verify_all.py 의 범위 문제(선언 4개 / 원장 82개)이고, 그건 별건 PR 이다 — MCP 경로는 stack.json 을 아예 안 읽어서 거기를 고쳐도 이쪽엔 아무 일도 안 일어난다.

`if am_ledger and am_peer_name:` 에 else 가 없었다. 증인 원장을 넘겨도
`am_peer_name` 이 없으면 **L2 교차증인이 아예 안 돌고**, 그런데도 판정은 `ALL OK` 였다.
⇒ am 체인이 **초록불 뒤에서 영영 안 측정될 수 있었다.**

    stack_verify_all(mm_ledger=…, am_ledger=…)   # peer 이름 없이
    → (before) verdict: "ALL OK"
    → (after)  verdict: "ALL OK (partial: 1 requested layer(s) did not run)"
               scope.layers_skipped[0].why = "am_ledger given but am_peer_name
                 missing — the witness layer did not run; this verdict says
                 nothing about the am chain"

★ **요청했는데 안 돈 것**만 partial 로 친다. `anchor_dir` 를 안 준 건 그게 아니다 —
L3 를 **요청하지 않은** 것이라 `scope.layers_not_requested` 로 적고 판정은 깨끗이 둔다.
(이 구분을 안 하면 L1만 부르는 정상 호출까지 partial 이 된다.)

같이 고친 둘:
· **docstring 이 "the whole stack" 이라 약속했다.** 전체를 잰 적이 없다 — 인자로 받은
  원장만 재고 `stack.json` 을 **안 읽는다**. 그대로 적고, 디렉토리 전체 커버리지는
  `verify_all.py` 오케스트레이터로 가라고 가리켰다.
· `seals valid` 가 **잰 개수**를 같이 낸다. 그 문장은 빈 원장에서도 참이다.

시험 51 통과. 남은 실패 1건(`test_prereg_lint_clean_seal_has_no_warn_or_fail`)은
**이 변경 전 origin/main 에서도 재현된다** — 이 커밋과 무관하다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bhyi4

bhyi4 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

대장님 승인 머지 — B(중대 변경·mcp 공급망 최고민감). stack_verify_all 공개툴이 am_ledger만 주고 am_peer_name 없으면 L2 조용히 skip+ALL OK 반환하던 것 수리(layers_skipped 노출·partial 표시)·seals valid 분모 표기·docstring '전체 스택' 과대주장 정정. 버전 0.2.10→0.2.11·CI 4/4·이상 0.

@bhyi4
bhyi4 merged commit 7b394bf into main Aug 18, 2026
4 checks passed
@bhyi4
bhyi4 deleted the fix/silent-witness-skip branch August 18, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant