pi-mega-compact 0.20.31 → 0.20.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,7 +51,7 @@ export const SETTINGS = [
51
51
  boolFlag("MEGACOMPACT_HYDE", "HyDE", "Generate hypothetical answer via LLM, embed it, RRF-fuse", true, true),
52
52
  boolFlag("MEGACOMPACT_NEW_UI", "New Dashboard UI", "Tailwind + shadcn visual design (sidebar, glass panels)", true),
53
53
  boolDirect("MEGACOMPACT_MESSAGE_SEPARATION", "Message Separation (P2)", "PLAN_V2: split conversation thread from tool results to grow stable cache prefix", true),
54
- boolDirect("MEGACOMPACT_CACHE_STRIPING", "Cache Striping (P3)", "PLAN_V2: order stable context by stability score so durable chunks lead the prompt", false),
54
+ boolDirect("MEGACOMPACT_CACHE_STRIPING", "Cache Striping (P3)", "PLAN_V2: order stable context by stability score so durable chunks lead the prompt", true),
55
55
  ],
56
56
  },
57
57
  {
@@ -170,7 +170,8 @@ export function loadConfig() {
170
170
  // PC-A: positive sprint flag, default ON. =0 byte-identical to the
171
171
  // pre-change OFF state (single gate lives at the call site in tailResult.ts).
172
172
  messageSeparation: envBool("MEGACOMPACT_MESSAGE_SEPARATION", true),
173
- cacheStriping: envBool("MEGACOMPACT_CACHE_STRIPING", false),
173
+ // positive sprint flag: default ON, =0 byte-identical to OFF
174
+ cacheStriping: envBool("MEGACOMPACT_CACHE_STRIPING", true),
174
175
  tuiWidget: envBool("MEGACOMPACT_TUI_WIDGET", true),
175
176
  ragQueryReformulation: envBool("MEGACOMPACT_QUERY_REFORMULATION", false),
176
177
  ragTieredRouter: envBool("MEGACOMPACT_TIERED_ROUTER", false),
@@ -169,18 +169,12 @@ export function refreshStripeAssignments(stateDir, epochId, limit = DEFAULT_STRI
169
169
  * Build a cache-optimized prompt with 5 layers:
170
170
  * 0 (system) -> 1 (summary) -> 2 (cache stripes) -> 3 (thread) -> 4 (tool)
171
171
  *
172
- * Feature gate: MEGACOMPACT_CACHE_STRIPING (default OFF). When OFF, delegates
173
- * to buildSeparatedPrompt (byte-identical to Phase 2 behavior).
174
- *
175
- * When ON but MEGACOMPACT_MESSAGE_SEPARATION is OFF, also delegates to
176
- * buildSeparatedPrompt (which returns messages unchanged).
172
+ * Positive sprint flag driven by config.cacheStriping at the call site
173
+ * (tailResult.ts); this function is pure and never reads process.env.
174
+ * With flag ON but no stripe rows for the epoch, it returns the base
175
+ * separated prompt unchanged (byte-identical to buildSeparatedPrompt).
177
176
  */
178
177
  export function buildCacheOptimizedPrompt(messages, opts) {
179
- const flag = process.env.MEGACOMPACT_CACHE_STRIPING;
180
- if (flag === "0" || flag === "false" || flag === undefined || flag === "") {
181
- // Flag OFF: delegate to buildSeparatedPrompt (byte-identical).
182
- return buildSeparatedPrompt(messages, opts);
183
- }
184
178
  // Build the base 4-layer structure first.
185
179
  const base = buildSeparatedPrompt(messages, opts);
186
180
  // If base equals messages, separation is OFF — return unchanged.
@@ -132,7 +132,7 @@ export const SETTINGS: ReadonlyArray<SettingGroup> = [
132
132
  "MEGACOMPACT_CACHE_STRIPING",
133
133
  "Cache Striping (P3)",
134
134
  "PLAN_V2: order stable context by stability score so durable chunks lead the prompt",
135
- false,
135
+ true,
136
136
  ),
137
137
  ],
138
138
  },
@@ -206,7 +206,8 @@ export function loadConfig(): MegaConfig {
206
206
  // PC-A: positive sprint flag, default ON. =0 byte-identical to the
207
207
  // pre-change OFF state (single gate lives at the call site in tailResult.ts).
208
208
  messageSeparation: envBool("MEGACOMPACT_MESSAGE_SEPARATION", true),
209
- cacheStriping: envBool("MEGACOMPACT_CACHE_STRIPING", false),
209
+ // positive sprint flag: default ON, =0 byte-identical to OFF
210
+ cacheStriping: envBool("MEGACOMPACT_CACHE_STRIPING", true),
210
211
  tuiWidget: envBool("MEGACOMPACT_TUI_WIDGET", true),
211
212
  ragQueryReformulation: envBool("MEGACOMPACT_QUERY_REFORMULATION", false),
212
213
  ragTieredRouter: envBool("MEGACOMPACT_TIERED_ROUTER", false),
@@ -236,22 +236,15 @@ export function refreshStripeAssignments(
236
236
  * Build a cache-optimized prompt with 5 layers:
237
237
  * 0 (system) -> 1 (summary) -> 2 (cache stripes) -> 3 (thread) -> 4 (tool)
238
238
  *
239
- * Feature gate: MEGACOMPACT_CACHE_STRIPING (default OFF). When OFF, delegates
240
- * to buildSeparatedPrompt (byte-identical to Phase 2 behavior).
241
- *
242
- * When ON but MEGACOMPACT_MESSAGE_SEPARATION is OFF, also delegates to
243
- * buildSeparatedPrompt (which returns messages unchanged).
239
+ * Positive sprint flag driven by config.cacheStriping at the call site
240
+ * (tailResult.ts); this function is pure and never reads process.env.
241
+ * With flag ON but no stripe rows for the epoch, it returns the base
242
+ * separated prompt unchanged (byte-identical to buildSeparatedPrompt).
244
243
  */
245
244
  export function buildCacheOptimizedPrompt(
246
245
  messages: AgentMessage[],
247
246
  opts?: SeparatedPromptOptions,
248
247
  ): AgentMessage[] {
249
- const flag = process.env.MEGACOMPACT_CACHE_STRIPING;
250
- if (flag === "0" || flag === "false" || flag === undefined || flag === "") {
251
- // Flag OFF: delegate to buildSeparatedPrompt (byte-identical).
252
- return buildSeparatedPrompt(messages, opts);
253
- }
254
-
255
248
  // Build the base 4-layer structure first.
256
249
  const base = buildSeparatedPrompt(messages, opts);
257
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-mega-compact",
3
- "version": "0.20.31",
3
+ "version": "0.20.32",
4
4
  "description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
5
5
  "type": "module",
6
6
  "license": "BSD-3-Clause",