Skip to content

fix(nunchi): stop charging the constraint block against the assemble fact budget (#2500) - #2501

Merged
jinon86 merged 1 commit into
mainfrom
fix/2500-assemble-fact-budget
Oct 24, 2026
Merged

jinon86 merged 1 commit into
mainfrom
fix/2500-assemble-fact-budget

Conversation

@jinon86

@jinon86 jinon86 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Closes #2500

문제

nunchi.py assemble이 제약 블록 바이트(#2216 이후 자체 예산 12000B)를 사실 예산(CCC_NUNCHI_ASSEMBLE_BUDGET=3000)에서도 차감하고 있었습니다. 실측한 모든 노드에서 budget - used < 0이었습니다. 그 결과 SessionStart 사실 블록이 1줄로 줄었고, auto-distill 몫은 0B였습니다. 공급을 켠 7개 노드에서 2026-10-09부터 10-24까지 주입된 세션 1,531개 중 ·auto 줄이 실린 세션은 0개였습니다(#2186 판정).

변경

  • claude/hooks/nunchi/nunchi.py assemble(): 사실 예산에서는 헤더 바이트만 차감합니다. 제약 블록은 지금처럼 자체 예산으로 묶입니다. auto-distill 33% 몫은 사실 블록 안에서 계산합니다.
  • scripts/ccc_doctor.py + docs/doctor.md: nunchi 항상-켜짐 상한 추정을 max(assemble, constraint)에서 assemble + constraint(기본 15000B)로 바꿨습니다.
  • 테스트
    • auto-distill-feed.test.sh에 운영 영역 회귀 3건을 추가했습니다(제약 블록 > 3000B일 때 사실 > 5줄, CONV 유지, ·auto 0 < x ≤ 990B). main 코드에서 2건 FAIL, 이 브랜치에서 42/42 PASS를 확인했습니다.
    • ccc_doctor_always_on_test.py는 새 상한에 맞춰 기대값만 고쳤습니다(12,000→15,000 / 2,500→3,500 / cut 3,000→6,000).
  • 로컬 결과: assemble-fixtures 60/60, nunchi 215/215, sessionstart 18/18, doctor always-on 27/27.

리스크: 항상-켜짐 상한 초과 (오너 판단 필요)

2026-10-24 06:12 KST 기준(현 main doctor, 읽기 전용 스윕), 11개 노드 중 8개가 이미 상한 24,000자를 넘고 있습니다. 육손 123%, 공융 113%, 진군 110%, 대교·방통 107%, 서서 104%, 소교 103%, 노숙 101%입니다. 상한에 못 미치는 노드는 순욱 99%, 등애 95%, 공명 50%, 곽가 85%입니다.

롤백

이 커밋을 revert합니다. 노드 반영은 self-update로 됩니다.

🤖 Generated with Claude Code

…fact budget (#2500)

Since #2216 the constraint block has its own byte budget (12000 by default),
but assemble() still subtracted those bytes from --budget (3000) before
filling facts. On every live node budget - used went negative: the fact
block collapsed to the one guaranteed line and the auto-distill share was
0 bytes (#2186 stage-4 measurement: 0 of 1,531 sessions carried a ·auto line).

- assemble: charge the fact budget for the header only
- doctor: nunchi always-on ceiling is assemble + constraint, not max()
- tests: live-regime regression (constraint block > fact budget) — fails on
  main, passes here; doctor expectations updated for the new ceiling

Closes #2500

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jinon86
jinon86 requested a review from seoseo-ai as a code owner October 23, 2026 21:12

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after exact-head validation and fresh operator authorization using the relay-held seoseo-ai credential.

@jinon86
jinon86 added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit ce00aa9 Oct 24, 2026
14 checks passed
@jinon86
jinon86 deleted the fix/2500-assemble-fact-budget branch October 24, 2026 00:05
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.

nunchi assemble: 제약 블록 바이트가 사실 예산을 다 써서 SessionStart 사실 1줄·auto-distill 0줄 (#2186 4단계 측정 무효)

2 participants