文件最后提交记录最后更新时间
fix(context): preserve memory constraints across context folds (#1515) Two fixes around context-fold memory preservation, plus a behavior-stability harness to regression-test them. **context-manager.ts** — fold now reinforces pinned constraints after the summary: - New extractPinnedConstraints() pulls the # HIGH PRIORITY constraints, # User memory, and # Project memory blocks out of the live system prompt and appends them verbatim under a [PINNED CONSTRAINTS — preserved verbatim] tail on the synthetic fold summary message. The system prompt always survives the fold (only history is compressed), but in long sessions the model's attention drifts away from instructions at the top; restating them near the current context window mitigates the "lost in the middle" effect. - Summarizer system prompt now explicitly tells the model to preserve "do not" / "never" / "avoid" instructions when compressing — independent improvement, useful regardless of whether the new constraint tail fires. **loop.ts** — wires getSystemPrompt: () => this.prefix.system into ContextManagerDeps so the fold can read the current system prompt. **benchmarks/behavior-stability/** — small evals scaffold (harness / runner / report / types + one scenario). The constraint-persistence scenario stuffs the log with 40 synthetic turns, triggers a fold with a tiny keepRecentTokens budget, and asserts all four pinned constraints (2× HIGH PRIORITY, 1× User memory, 1× Project memory) survive in the folded summary. Local: npx tsx benchmarks/behavior-stability/runner.ts --local — 1/1 passing. Refs #1462.7 天前
fix(context): preserve memory constraints across context folds (#1515) Two fixes around context-fold memory preservation, plus a behavior-stability harness to regression-test them. **context-manager.ts** — fold now reinforces pinned constraints after the summary: - New extractPinnedConstraints() pulls the # HIGH PRIORITY constraints, # User memory, and # Project memory blocks out of the live system prompt and appends them verbatim under a [PINNED CONSTRAINTS — preserved verbatim] tail on the synthetic fold summary message. The system prompt always survives the fold (only history is compressed), but in long sessions the model's attention drifts away from instructions at the top; restating them near the current context window mitigates the "lost in the middle" effect. - Summarizer system prompt now explicitly tells the model to preserve "do not" / "never" / "avoid" instructions when compressing — independent improvement, useful regardless of whether the new constraint tail fires. **loop.ts** — wires getSystemPrompt: () => this.prefix.system into ContextManagerDeps so the fold can read the current system prompt. **benchmarks/behavior-stability/** — small evals scaffold (harness / runner / report / types + one scenario). The constraint-persistence scenario stuffs the log with 40 synthetic turns, triggers a fold with a tiny keepRecentTokens budget, and asserts all four pinned constraints (2× HIGH PRIORITY, 1× User memory, 1× Project memory) survive in the folded summary. Local: npx tsx benchmarks/behavior-stability/runner.ts --local — 1/1 passing. Refs #1462.7 天前
fix(context): preserve memory constraints across context folds (#1515) Two fixes around context-fold memory preservation, plus a behavior-stability harness to regression-test them. **context-manager.ts** — fold now reinforces pinned constraints after the summary: - New extractPinnedConstraints() pulls the # HIGH PRIORITY constraints, # User memory, and # Project memory blocks out of the live system prompt and appends them verbatim under a [PINNED CONSTRAINTS — preserved verbatim] tail on the synthetic fold summary message. The system prompt always survives the fold (only history is compressed), but in long sessions the model's attention drifts away from instructions at the top; restating them near the current context window mitigates the "lost in the middle" effect. - Summarizer system prompt now explicitly tells the model to preserve "do not" / "never" / "avoid" instructions when compressing — independent improvement, useful regardless of whether the new constraint tail fires. **loop.ts** — wires getSystemPrompt: () => this.prefix.system into ContextManagerDeps so the fold can read the current system prompt. **benchmarks/behavior-stability/** — small evals scaffold (harness / runner / report / types + one scenario). The constraint-persistence scenario stuffs the log with 40 synthetic turns, triggers a fold with a tiny keepRecentTokens budget, and asserts all four pinned constraints (2× HIGH PRIORITY, 1× User memory, 1× Project memory) survive in the folded summary. Local: npx tsx benchmarks/behavior-stability/runner.ts --local — 1/1 passing. Refs #1462.7 天前
fix(context): preserve memory constraints across context folds (#1515) Two fixes around context-fold memory preservation, plus a behavior-stability harness to regression-test them. **context-manager.ts** — fold now reinforces pinned constraints after the summary: - New extractPinnedConstraints() pulls the # HIGH PRIORITY constraints, # User memory, and # Project memory blocks out of the live system prompt and appends them verbatim under a [PINNED CONSTRAINTS — preserved verbatim] tail on the synthetic fold summary message. The system prompt always survives the fold (only history is compressed), but in long sessions the model's attention drifts away from instructions at the top; restating them near the current context window mitigates the "lost in the middle" effect. - Summarizer system prompt now explicitly tells the model to preserve "do not" / "never" / "avoid" instructions when compressing — independent improvement, useful regardless of whether the new constraint tail fires. **loop.ts** — wires getSystemPrompt: () => this.prefix.system into ContextManagerDeps so the fold can read the current system prompt. **benchmarks/behavior-stability/** — small evals scaffold (harness / runner / report / types + one scenario). The constraint-persistence scenario stuffs the log with 40 synthetic turns, triggers a fold with a tiny keepRecentTokens budget, and asserts all four pinned constraints (2× HIGH PRIORITY, 1× User memory, 1× Project memory) survive in the folded summary. Local: npx tsx benchmarks/behavior-stability/runner.ts --local — 1/1 passing. Refs #1462.7 天前
fix(context): preserve memory constraints across context folds (#1515) Two fixes around context-fold memory preservation, plus a behavior-stability harness to regression-test them. **context-manager.ts** — fold now reinforces pinned constraints after the summary: - New extractPinnedConstraints() pulls the # HIGH PRIORITY constraints, # User memory, and # Project memory blocks out of the live system prompt and appends them verbatim under a [PINNED CONSTRAINTS — preserved verbatim] tail on the synthetic fold summary message. The system prompt always survives the fold (only history is compressed), but in long sessions the model's attention drifts away from instructions at the top; restating them near the current context window mitigates the "lost in the middle" effect. - Summarizer system prompt now explicitly tells the model to preserve "do not" / "never" / "avoid" instructions when compressing — independent improvement, useful regardless of whether the new constraint tail fires. **loop.ts** — wires getSystemPrompt: () => this.prefix.system into ContextManagerDeps so the fold can read the current system prompt. **benchmarks/behavior-stability/** — small evals scaffold (harness / runner / report / types + one scenario). The constraint-persistence scenario stuffs the log with 40 synthetic turns, triggers a fold with a tiny keepRecentTokens budget, and asserts all four pinned constraints (2× HIGH PRIORITY, 1× User memory, 1× Project memory) survive in the folded summary. Local: npx tsx benchmarks/behavior-stability/runner.ts --local — 1/1 passing. Refs #1462.7 天前