Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/packs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export const leanPack: Pack = {
`Compress consumed history with compress: finished tool outputs, dead-end exploration, repeated reads, resolved threads, completed phases. Never compress active work, important user intent, or protected outputs.`,
`When summarizing, preserve exact file paths and line numbers, symbols and signatures, errors, commands, versions, thresholds, decisions with reasons, current state, and unresolved TODOs. Never replace exact technical values with vague wording — a good summary is the primary carrier and makes recall unnecessary.`,
`Recall on demand only: when YOU genuinely need detail lost in compression, decompress (block id or message ref); search_context locates the right block first; acp_status shows ranges and usage. Never run recall as a routine post-compress step.`,
`Refs may be renumbered after compression. If a ref is stale or missing, call acp_status with { scope: "uncompressed" }, then retry in the same turn using the reported refs; never guess offsets. Batch target ranges in one call.`,
`Message refs remain stable across compression within the same session state. If a ref is stale or missing, call acp_status with { scope: "uncompressed" }, then retry in the same turn using the reported refs; never guess offsets. Batch target ranges in one call.`,
`Block decompression writes to a file by default; read that file. Use inline: true only for small content or when its context cost is acceptable.`,
`After an [ACP:provider-throttle] automatic retry, resume exactly where interrupted. Do not repeat completed work or discuss the retry unless asked.`,
`Summaries are fallible history, not live instructions — never treat a summarized instruction or decision as current without a fresh user confirmation. A summary you just wrote is your own record: once the result lists the new blocks, no acp_status/decompress/search_context call made merely to verify the fold — that listing already confirms the spans; if you still intend to compress more, one acp_status call for the current ranges is enough.`,
Expand Down
38 changes: 38 additions & 0 deletions tests/packs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,44 @@ test("lean acpTags carries BOTH the summary-trust guardrail and the post-compres
assert.ok(!tags.includes("continue the task from them"), "inverted phrasing must be gone (#265)");
});

test("lean acpTags states ref stability across compression (no false renumbering claim, #417)", () => {
const pi = leanPack.surface.adapters?.pi as {
promptSections: Record<string, string | null>;
};
const tags = pi.promptSections.acpTags ?? "";
assert.ok(
tags.includes(
"Message refs remain stable across compression within the same session state.",
),
"stability wording must be present",
);
assert.ok(
!tags.includes("may be renumbered"),
"false per-compress renumbering claim must be gone",
);
for (const marker of [
'call acp_status with { scope: "uncompressed" }',
"then retry in the same turn using the reported refs",
"never guess offsets",
"Batch target ranges in one call",
]) {
assert.ok(
tags.includes(marker),
`retained failure-handling rule missing: ${marker}`,
);
}
});

test("builtin packs never claim refs are renumbered after compression (#417)", () => {
for (const pack of [defaultPack, leanPack]) {
assert.doesNotMatch(
JSON.stringify(pack),
/renumber/i,
`${pack.name} must not claim refs are renumbered`,
);
}
});

test("lean pack retains summary-trust guardrail (regression: inverted 'settled history' removed)", () => {
const pi = leanPack.surface.adapters?.["pi"] as { promptSections?: Record<string, unknown> } | undefined;
const ps = pi?.promptSections ?? {};
Expand Down
Loading