Repository navigation
fix(prompts): rule-slot sections accept string overrides (#423) - #425
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Extension ArtifactBranch: Option A — Install from npm PR tag (recommended)pi install npm:billion-context-pi@pr-425Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pi-pr425.tgz
pi install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 Review started. Initial finding: the branch carries two commits — the #423 rule-slot fix ( |
…e string-replacement contract (refs #423) sanitizePromptSections now stores replacement strings in the rule slots, but PiPromptSections still declared them null-only, hiding the new capability from typed consumers. Align the four rule-slot fields with the kernel tri-state contract (string | null).
bbfcc60 to
3bf4300
Compare
[bot] 🏷 Review complete — diff converged, one small fix added directly to the branch, ready to merge. Duplicate screeningNo duplicate of the #423 fix exists. But the branch carried a second, unrelated commit ( Verification of the fix itself
What I changed on the branch (committed directly, per review policy)
Branch state after convergence (force-pushed with Diff vs master is now exactly Minor observations (no action needed)
中文摘要:修复本身正确且已验证(kernel 的 |
Fixes #423
Problem
sanitizePromptSectionsacceptednullonly for the rule slots (philosophy / howToCompress / tier2 / tier3). Kernel master (post-#269, formalized by open PRs #263/#266) ships lean'showToCompressas a condensed string (~2.5K, restoring the summary style floor lost in the #263 hallucination incident). On the next kernel bump pi would have silently dropped lean's condensed rules (falling back to the 4.5K default — silent regression) and the #403 leanPack assertion would have gone red.Fix
string | nullin sanitize (string = replace slot body, null = remove) — the apply path (applySectionOverrides, kernel) already treats strings as replacement, so this is a one-line contract fixbuildAcpSystemPrompt; kernel-master-style condensed howToCompress flows throughpiAdapterSurface; junk test updated to the new contract (strings kept, non-strings still dropped)Verification
805 tests, 0 fail (3 pre-existing skips), typecheck clean, build green. Also validated against a local kernel-integration build (master + #271 + #273): the condensed string flows into the rendered prompt.