모델용 proposal 스키마에서 상한을 빼고 system prompt가 compact 출력과 key 규칙을 말하도록 변경 - #60
Merged
Createyouracccount merged 1 commit intoSep 6, 2026
Conversation
Planner에 보내는 strict JSON Schema는 Core가 독립 검증하는 상한(maxLength 5000 등)을 그대로 담고 있었다. llama.cpp는 이 상한을 GBNF로 컴파일하지 못해 HTTP 200으로 제약 없는 출력을 반환했고, PR #56의 production 스키마 프로브가 이를 chat_completions_incompatible로 닫았다. Ollama는 상한 유무에 영향이 없다(8B 3회씩 A/B 동일). 스키마 pattern은 Ollama가 어떤 형태든 400으로 거부해 이식 가능하지 않으므로 넣지 않는다. ADR-0037에 따라 maxLength/maxItems를 제거해 스키마는 구조만 강제하고(revision v2), 두 system prompt 끝에 한 줄 minified JSON 문장과 Core step key 규칙 문장을 더한다(template v4-compact). 8B no-think model은 쓰기 카탈로그 prompt에서 1024 token 안에 100% 잘렸는데 compact 문장으로 100% 순응했고, key 문장은 출력을 767~854에서 577 token으로 줄이며 key를 유효하게 유지했다. 27B는 이미 compact라 변화가 없다. Request profile golden은 의도적으로 재채취했으며 진행 중이던 Run의 resume은 configuration_mismatch가 된다. 실측: brew llama.cpp 8B와 Ollama 번들 llama.cpp 27B 모두 model setup PASS(이전 incompatible), 27B 읽기 Run COMPLETED, Ollama 27B 쓰기 Run 162초로 회귀 없음, Ollama 8B 쓰기 Run 2/2 COMPLETED.
Createyouracccount
merged commit Sep 6, 2026
4d0cec9
into
feat/planner-prompt-prefix-order-20260905
6 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
PR #56 뒤 llama.cpp 계열 provider는
model setup에서chat_completions_incompatible로 정직하게실패했습니다. 원인은 planner 스키마의
maxLength: 5000(objective, summary)이 GBNF 문법 컴파일을깨뜨리고 서버가 HTTP 200으로 제약 없는 출력을 반환하는 것이었습니다. 이 상한은 Core가
MAX_ACCEPTED_OBJECTIVE_BYTES등으로 독립 검증하므로 스키마에서는 안내일 뿐 안전 장치가 아닙니다.같은 GGUF를 두 provider로 실행해 측정했습니다.
maxLength제거 또는 ≤2000pattern(4가지 형태)400 failed to parse grammar; llama.cpp는 anchored만 강제변경 사항 (ADR-0037)
maxLength/maxItems를 제거합니다. 구조(required,additionalProperties: false,enum,const)만 강제하고 Core 검증은 그대로입니다.PROPOSAL_SCHEMA_REVISION→xgeny.plan-proposal/v2.pattern은 넣지 않습니다(Ollama 사용자 전부를 setup에서 막습니다). Step key 형식은 Core가 검증합니다.SYSTEM_PROMPT·CONSTRAINED_SYSTEM_PROMPT끝에 두 문장을 더합니다: 한 줄 minified JSON, Core step key 규칙. Template revision →v4-compact/v4-compact-constrained.maxLength/maxItems/pattern이 없고additionalProperties·const는 유지, 두 prompt에 두 문장이 있음, revision 문자열. Request profile golden은 의도적으로 재채취했습니다.chat_completions_incompatible설명을 갱신했습니다.실제로 동작하게 된 것
llama.cpp 27B 쓰기 Run은 다섯 번째 호출에서 4096 token을 넘겨
model_rejected.provider_limit로닫혔습니다(reasoning 10,148자). 같은 model이 Ollama에서는 reasoning 244~671자로 끝나는 것과 달리
llama.cpp의
--jinja기본 thinking이 훨씬 길게 이어집니다. 이는 provider의 thinking 정책이며--max-output-tokens를 더 올리거나 서버의 reasoning budget으로 다룹니다. 8B의 Run 실패(
write_approval_required로 pause,invocation_invalid)는 model 품질이며 이제 class로 진단됩니다.데이터 경계
스키마 revision과 prompt template은
request_profile_digest입력이므로 이 PR 이전에 시작해 완료되지않은 Run은 resume 시
configuration_mismatch로 닫힙니다(ADR-0035 §4, ADR-0036 §2와 같은 결과).#58과 함께 머지해 resume 단절을 한 번으로 줄이는 것을 권합니다. Journal·Receipt·manifest schema는
바뀌지 않습니다. 이 브랜치는 #58 위에 쌓여 있습니다.
검증
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --locked --no-fail-fast(568 passed / 0 failed, 45 binaries)cargo build --workspace --release --lockedxgeny protocol checksh scripts/check-rc3-public-docs.sh,check-third-party-licenses.sh --check실패 테스트를 먼저 추가해 red를 확인한 뒤 구현했습니다.
범위 밖
outputSchema축소(prompt −29%, 품질 검증 필요),--allow-filescope 제약, planner 경로provider_limit의 잘림/429 분리는 별도입니다. 이 PR은 게시나 태그 생성을 수행하지 않습니다.