diff --git a/docs/features/integrations/claude-code.md b/docs/features/integrations/claude-code.md index 833beafc1b..9bfc4a18bc 100644 --- a/docs/features/integrations/claude-code.md +++ b/docs/features/integrations/claude-code.md @@ -644,7 +644,10 @@ chosen so, when it is a range of more than 200 lines, gives way to the first-ran definition the answer holds inside it, which is the part of it the search matched, so a long class the prompt names is sent as that method; with none inside it, it is sent as its first line, the definition's signature, with its length -(`path:643 Permutation (372 lines)`). The low-risk label says the index holds code about +(`path:643 Permutation (372 lines)`). The highest-ranked place in the file of the answer's +first result is listed first, also when that result is no place itself or is sent as a +definition ranked below another file's; the other places keep the index's order, as all +do when that file has no place. The low-risk label says the index holds code about the prompt, not that the pointers are where a fix is made, and no field of the answer tells the two apart. The place test reads a unit's path and kind and does not tell them apart either: an answer that holds only other places is sent. diff --git a/docs/guides/issue-code-pointers.md b/docs/guides/issue-code-pointers.md index 1eb38940fa..930350c17d 100644 --- a/docs/guides/issue-code-pointers.md +++ b/docs/guides/issue-code-pointers.md @@ -162,7 +162,10 @@ lists the answer's places to edit: class when the prompt names it, else the one the index ranked first. A range over 200 lines gives way to a definition the answer holds inside it, and is otherwise listed as its first line and its length. -- Entries keep the index's order, and a span is listed once. +- The highest-ranked place in the file of the answer's first result is listed first, + also when that result is no place itself or is sent as a definition ranked below + another file's. The other entries keep the index's order, as all do when that file has + no place. A span is listed once. - Paths are relative to the repository root, after the checkout prefix when one is given, and the lines are those of the indexed commit. diff --git a/integrations/claude-code-plugin/.claude-plugin/plugin.json b/integrations/claude-code-plugin/.claude-plugin/plugin.json index 5e2cf2fb0e..6746e2a9cd 100644 --- a/integrations/claude-code-plugin/.claude-plugin/plugin.json +++ b/integrations/claude-code-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "loom", "displayName": "ClickHouse Loom", - "version": "1.2.162", + "version": "1.2.165", "description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/claude-code-plugin/hooks/HOOKS.md b/integrations/claude-code-plugin/hooks/HOOKS.md index d19463ed49..d04644277a 100644 --- a/integrations/claude-code-plugin/hooks/HOOKS.md +++ b/integrations/claude-code-plugin/hooks/HOOKS.md @@ -872,7 +872,11 @@ in. part of it the search matched, so a long class the prompt names is sent as that method; with none inside it, it is sent as its first line, the definition's signature, with its length - (`path:643 Permutation (372 lines)`). For a + (`path:643 Permutation (372 lines)`). + **The first result's file leads.** The highest-ranked place in the file of + the answer's first result is listed first, also when that result is no place + itself or is sent as a definition ranked below another file's. The other + places keep the index's order, as all do when that file has no place. For a picked answer (`LOOM_PROMPT_PACK_PICK`) the model's confidence is in its first result, and the pick was measured on its first three: when the first is no place nothing is sent, and no result below the third is. The low-risk label says the index holds code about the prompt, not that the pointers are where diff --git a/integrations/claude-code-plugin/lib/prompt-pack.mjs b/integrations/claude-code-plugin/lib/prompt-pack.mjs index ab5eab82a8..1739e9844d 100644 --- a/integrations/claude-code-plugin/lib/prompt-pack.mjs +++ b/integrations/claude-code-plugin/lib/prompt-pack.mjs @@ -568,11 +568,16 @@ export const LONG_RANGE_LINES = 200; /** * The pointers a search answer sends: the units that pass the place test - * (`isPlace`), in rank order, at most `cap`, and no range inside another. The - * model re-reads the pointers on every later request, so a unit that fails - * the test is not carried by one that passes. The test reads a unit's path - * and kind: it does not say the fix is made there, and no rule here drops an - * answer that holds only other places. + * (`isPlace`), at most `cap`, and no range inside another. The model re-reads + * the pointers on every later request, so a unit that fails the test is not + * carried by one that passes. The test reads a unit's path and kind: it does + * not say the fix is made there, and no rule here drops an answer that holds + * only other places. + * + * The first-ranked result's file leads: the highest-ranked of the pointers + * in that file is listed first, also when the unit sent for it ranks below + * another file's (a class sent as a method, a first result that is no place). + * The others keep rank order, as all do when that file has no pointer. * * A range and the ranges inside it (a class and its own methods) send one * pointer, chosen in two steps: @@ -623,7 +628,9 @@ export function places(res, { query, text = query, cap = 3, picked = false } = { const sent = new Set(outermost.flatMap(byName).map(byLength)); // No range inside another: two ranges that overlap without one holding the other can each choose a unit inside both. const apart = (unit) => ![...sent].some((other) => other !== unit && within(unit, other)); - return ranked.filter((unit) => sent.has(unit) && apart(unit)).slice(0, cap); + const chosen = ranked.filter((unit) => sent.has(unit) && apart(unit)); + const lead = chosen.find((unit) => unit.path === results[0].path); + return (lead ? [lead, ...chosen.filter((unit) => unit !== lead)] : chosen).slice(0, cap); } export function pointerOf(unit) { diff --git a/integrations/claude-code-plugin/tests/fixtures/pointer-block.json b/integrations/claude-code-plugin/tests/fixtures/pointer-block.json index 4b6f39e10f..07b5849df7 100644 --- a/integrations/claude-code-plugin/tests/fixtures/pointer-block.json +++ b/integrations/claude-code-plugin/tests/fixtures/pointer-block.json @@ -1310,6 +1310,204 @@ }, "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/parser.c:10-60 parse_record\n- src/parser.c:40-90 parse_tail" }, + { + "name": "the first place is one of the first-ranked file, also when its class is sent as a method ranked below another file", + "prompt": "objects are written twice when memory runs low", + "query": "objects are written twice when memory runs low", + "reply": { + "abstain": false, + "retrieval_risk": "low", + "retrieval_confidence": 0.82, + "results": [ + { + "path": "src/store.py", + "start_line": 10, + "end_line": 300, + "kind": "class_skeleton", + "symbol": "store::Store" + }, + { + "path": "src/cache.py", + "start_line": 12, + "end_line": 20, + "kind": "function", + "symbol": "cache::Cache::evict" + }, + { + "path": "src/store.py", + "start_line": 50, + "end_line": 90, + "kind": "function", + "symbol": "store::Store::put_object" + } + ] + }, + "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/store.py:50-90 store::Store::put_object\n- src/cache.py:12-20 cache::Cache::evict" + }, + { + "name": "a first-ranked unit that is no place gives the first slot to a place of its file", + "prompt": "the transfer is never tried again after the bucket answers slowly once", + "query": "the transfer is never tried again after the bucket answers slowly once", + "reply": { + "abstain": false, + "retrieval_risk": "low", + "retrieval_confidence": 0.82, + "results": [ + { + "path": "src/uploads/retry.py", + "start_line": 1, + "end_line": 3, + "kind": "file_header", + "symbol": "" + }, + { + "path": "src/uploads/client.py", + "start_line": 20, + "end_line": 23, + "kind": "function", + "symbol": "uploads.client::Client::put" + }, + { + "path": "src/uploads/retry.py", + "start_line": 6, + "end_line": 15, + "kind": "function", + "symbol": "uploads.retry::retry_upload" + } + ] + }, + "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/uploads/retry.py:6-15 uploads.retry::retry_upload\n- src/uploads/client.py:20-23 uploads.client::Client::put" + }, + { + "name": "a first-ranked file with no place leaves the places in rank order", + "prompt": "objects are written twice when memory runs low", + "query": "objects are written twice when memory runs low", + "reply": { + "abstain": false, + "retrieval_risk": "low", + "retrieval_confidence": 0.82, + "results": [ + { + "path": "src/uploads/settings.py", + "start_line": 1, + "end_line": 2, + "kind": "file_header", + "symbol": "" + }, + { + "path": "src/store.py", + "start_line": 10, + "end_line": 300, + "kind": "class_skeleton", + "symbol": "store::Store" + }, + { + "path": "src/cache.py", + "start_line": 12, + "end_line": 20, + "kind": "function", + "symbol": "cache::Cache::evict" + }, + { + "path": "src/store.py", + "start_line": 50, + "end_line": 90, + "kind": "function", + "symbol": "store::Store::put_object" + } + ] + }, + "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/cache.py:12-20 cache::Cache::evict\n- src/store.py:50-90 store::Store::put_object" + }, + { + "name": "a place of the first-ranked file ranked below the count is listed first, and the last of the others is not listed", + "prompt": "objects are written twice when memory runs low", + "query": "objects are written twice when memory runs low", + "reply": { + "abstain": false, + "retrieval_risk": "low", + "retrieval_confidence": 0.82, + "results": [ + { + "path": "src/store.py", + "start_line": 10, + "end_line": 300, + "kind": "class_skeleton", + "symbol": "store::Store" + }, + { + "path": "src/cache.py", + "start_line": 12, + "end_line": 20, + "kind": "function", + "symbol": "cache::Cache::evict" + }, + { + "path": "src/uploads/client.py", + "start_line": 20, + "end_line": 23, + "kind": "function", + "symbol": "uploads.client::Client::put" + }, + { + "path": "src/uploads/retry.py", + "start_line": 6, + "end_line": 15, + "kind": "function", + "symbol": "uploads.retry::retry_upload" + }, + { + "path": "src/store.py", + "start_line": 50, + "end_line": 90, + "kind": "function", + "symbol": "store::Store::put_object" + } + ] + }, + "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/store.py:50-90 store::Store::put_object\n- src/cache.py:12-20 cache::Cache::evict\n- src/uploads/client.py:20-23 uploads.client::Client::put" + }, + { + "name": "of two places in the first-ranked file the higher-ranked is listed first, not the one on the earlier line", + "prompt": "the transfer is never tried again after the bucket answers slowly once", + "query": "the transfer is never tried again after the bucket answers slowly once", + "reply": { + "abstain": false, + "retrieval_risk": "low", + "retrieval_confidence": 0.82, + "results": [ + { + "path": "src/uploads/retry.py", + "start_line": 1, + "end_line": 3, + "kind": "file_header", + "symbol": "" + }, + { + "path": "src/uploads/client.py", + "start_line": 20, + "end_line": 23, + "kind": "function", + "symbol": "uploads.client::Client::put" + }, + { + "path": "src/uploads/retry.py", + "start_line": 40, + "end_line": 52, + "kind": "function", + "symbol": "uploads.retry::backoff_delay" + }, + { + "path": "src/uploads/retry.py", + "start_line": 6, + "end_line": 15, + "kind": "function", + "symbol": "uploads.retry::retry_upload" + } + ] + }, + "block": "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n- src/uploads/retry.py:40-52 uploads.retry::backoff_delay\n- src/uploads/client.py:20-23 uploads.client::Client::put\n- src/uploads/retry.py:6-15 uploads.retry::retry_upload" + }, { "name": "a line carries the name and the signature cut at 80 characters; a span is listed once", "prompt": "the handler ignores the strict flag for uploads", diff --git a/integrations/claude-code-plugin/tests/prompt-pack-hook.test.mjs b/integrations/claude-code-plugin/tests/prompt-pack-hook.test.mjs index 68fde5bfa3..45d21e5314 100644 --- a/integrations/claude-code-plugin/tests/prompt-pack-hook.test.mjs +++ b/integrations/claude-code-plugin/tests/prompt-pack-hook.test.mjs @@ -958,13 +958,14 @@ const context = (result) => (result.out ? JSON.parse(result.out).hookSpecificOut const POINTERS = "Loom index pointers for this prompt, candidates: Read a line range to check one, search if none fits:\n" + "- src/parser.py:10-14 Parser.parse_record — (value)"; -/** The test line for the fixture's file, behind the interpreter `parserCheckout` left in `dir`. */ -const testLine = (dir) => - `Loom test for src/parser.py: ${path +/** The test line for `src/.py`, by default the fixture's file, behind the interpreter + * `parserCheckout` left in `dir`. */ +const testLine = (dir, stem = "parser") => + `Loom test for src/${stem}.py: ${path .relative(dir, venvPython(path.join(dir, ".venv"))) .split(path.sep) .join("/")} ` + - "-m pytest -q -rf tests/test_parser.py\n" + + `-m pytest -q -rf tests/test_${stem}.py\n` + "It is the one test file named for that file. With -q -rf the last lines are one " + "`FAILED ::` line per failing test, then the totals."; // The fixture's pointer is Parser.parse_record in src/parser.py: this prompt names it. @@ -1061,6 +1062,27 @@ test("the test line runs pytest the way the checkout does: its options and its - ); }); +test("the test line is for the first listed pointer the prompt names: the first result's file", async (t) => { + const { ask, dir, replies } = await contractFixture(t, structuredClone(REPLIES)); + parserCheckout(dir, { + tests: ["tests/test_parser.py", "tests/test_records.py"], + files: { "pytest.ini": "", "src/records.py": "def merge_prefixes(parts):\n return parts\n" }, + }); + const [parser] = replies["code.search"].results; + const header = { path: "src/parser.py", start_line: 1, end_line: 3, kind: "file_header", symbol: "" }; + const records = { path: "src/records.py", start_line: 1, end_line: 2, kind: "function", symbol: "merge_prefixes" }; + const recordsLine = "- src/records.py:1-2 merge_prefixes"; + const [lead, parserLine] = POINTERS.split("\n"); + // The prompt names a definition of each file, and each file has one test named after it. + const both = "Why does parse_record drop the prefix that merge_prefixes built?"; + // The first result is no place: its file's function is listed first, and the line is for that file. + replies["code.search"].results = [header, records, parser]; + assert.equal(context(await ask(both, "one")), `${POINTERS}\n${recordsLine}\n${testLine(dir)}`); + // The other file's function ranked first is listed first, and the line is for its file. + replies["code.search"].results = [records, parser]; + assert.equal(context(await ask(both, "two")), `${lead}\n${recordsLine}\n${parserLine}\n${testLine(dir, "records")}`); +}); + test("a prompt carries no test line where the checkout shows no single test or no pytest", async (t) => { for (const [why, shape] of [ ["no pytest configuration", { files: { "setup.cfg": "[flake8]\nexclude = build\n" } }], diff --git a/integrations/claude-code-plugin/tests/prompt-pack.test.mjs b/integrations/claude-code-plugin/tests/prompt-pack.test.mjs index 4ccdaf57ad..d3ee929482 100644 --- a/integrations/claude-code-plugin/tests/prompt-pack.test.mjs +++ b/integrations/claude-code-plugin/tests/prompt-pack.test.mjs @@ -343,6 +343,15 @@ test("a picked answer is sent only when its first result is a place", () => { assert.deepEqual(places({ results: ranked }, { query, cap: 2 }), [second, third]); }); +test("a picked answer lists the first pick's file first", () => { + // A long first pick is sent as its method, ahead of another file's function ranked between them. + const long = { path: "pkg/store.py", start_line: 10, end_line: 300, symbol: "Store", kind: "class_skeleton" }; + const other = { path: "pkg/solvers/other.py", start_line: 1, end_line: 9, symbol: "later", kind: "function" }; + const method = { path: "pkg/store.py", start_line: 50, end_line: 90, symbol: "Store::put_object", kind: "function" }; + const query = "objects are written twice when memory runs low"; + assert.deepEqual(places({ results: [long, other, method] }, { query, picked: true }), [method, other]); +}); + test("a range over the stated length is pointed at by its first line and its length", () => { assert.equal(LONG_RANGE_LINES, 200); const line = (unit) => renderPack({ results: [unit] }).text.split("\n")[1]; diff --git a/integrations/codex-plugin/.codex-plugin/plugin.json b/integrations/codex-plugin/.codex-plugin/plugin.json index fe5001afb0..681af33330 100644 --- a/integrations/codex-plugin/.codex-plugin/plugin.json +++ b/integrations/codex-plugin/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "loom", - "version": "1.2.162", + "version": "1.2.165", "description": "Shared long-term memory and code intelligence for Codex, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/codex-plugin/lib/prompt-pack.mjs b/integrations/codex-plugin/lib/prompt-pack.mjs index ab5eab82a8..1739e9844d 100644 --- a/integrations/codex-plugin/lib/prompt-pack.mjs +++ b/integrations/codex-plugin/lib/prompt-pack.mjs @@ -568,11 +568,16 @@ export const LONG_RANGE_LINES = 200; /** * The pointers a search answer sends: the units that pass the place test - * (`isPlace`), in rank order, at most `cap`, and no range inside another. The - * model re-reads the pointers on every later request, so a unit that fails - * the test is not carried by one that passes. The test reads a unit's path - * and kind: it does not say the fix is made there, and no rule here drops an - * answer that holds only other places. + * (`isPlace`), at most `cap`, and no range inside another. The model re-reads + * the pointers on every later request, so a unit that fails the test is not + * carried by one that passes. The test reads a unit's path and kind: it does + * not say the fix is made there, and no rule here drops an answer that holds + * only other places. + * + * The first-ranked result's file leads: the highest-ranked of the pointers + * in that file is listed first, also when the unit sent for it ranks below + * another file's (a class sent as a method, a first result that is no place). + * The others keep rank order, as all do when that file has no pointer. * * A range and the ranges inside it (a class and its own methods) send one * pointer, chosen in two steps: @@ -623,7 +628,9 @@ export function places(res, { query, text = query, cap = 3, picked = false } = { const sent = new Set(outermost.flatMap(byName).map(byLength)); // No range inside another: two ranges that overlap without one holding the other can each choose a unit inside both. const apart = (unit) => ![...sent].some((other) => other !== unit && within(unit, other)); - return ranked.filter((unit) => sent.has(unit) && apart(unit)).slice(0, cap); + const chosen = ranked.filter((unit) => sent.has(unit) && apart(unit)); + const lead = chosen.find((unit) => unit.path === results[0].path); + return (lead ? [lead, ...chosen.filter((unit) => unit !== lead)] : chosen).slice(0, cap); } export function pointerOf(unit) { diff --git a/sdk/python/loom/pointers.py b/sdk/python/loom/pointers.py index a77cba4311..934c7f177d 100644 --- a/sdk/python/loom/pointers.py +++ b/sdk/python/loom/pointers.py @@ -589,10 +589,14 @@ def _pointer(unit: Mapping[str, Any]) -> str: def _places( results: list[Mapping[str, Any]], *, query: str, text: str, cap: int ) -> list[Mapping[str, Any]]: - """The pointers a search answer sends: the units that pass the place test, in rank - order, at most `cap`, and no range inside another. `query` is the text the search - was asked with (it says whether tests or documentation were asked for) and `text` - the whole prompt (it says what is named). + """The pointers a search answer sends: the units that pass the place test, at most + `cap`, and no range inside another. `query` is the text the search was asked with + (it says whether tests or documentation were asked for) and `text` the whole prompt + (it says what is named). + + The first-ranked result's file leads: the highest-ranked of the pointers in that file + is listed first, also when the unit sent for it ranks below another file's. The + others keep rank order, as all do when that file has no pointer. A range and the ranges inside it (a class and its own methods) send one pointer: each innermost definition inside the range that `text` names; else the range when @@ -640,12 +644,16 @@ def by_length(unit: Mapping[str, Any]) -> Mapping[str, Any]: sent = [by_length(chosen) for unit in outermost for chosen in by_name(unit)] # No range inside another: two ranges that overlap without one holding the other can # each choose a unit inside both. - return [ + listed = [ unit for unit in ranked if any(unit is one for one in sent) and not any(other is not unit and _within(unit, other) for other in sent) - ][:cap] + ] + lead = next((unit for unit in listed if unit.get("path") == results[0].get("path")), None) + if lead is not None: + listed = [lead, *(unit for unit in listed if unit is not lead)] + return listed[:cap] # ---------------------------------------------------------------- the block diff --git a/sdk/typescript/src/pointers.ts b/sdk/typescript/src/pointers.ts index 7c6c18344b..58f3607ca1 100644 --- a/sdk/typescript/src/pointers.ts +++ b/sdk/typescript/src/pointers.ts @@ -485,10 +485,14 @@ function pointerOf(unit: PointerUnit): string { } /** - * The pointers a search answer sends: the units that pass the place test, in rank order, - * at most `cap`, and no range inside another. `query` is the text the search was asked - * with (it says whether tests or documentation were asked for) and `text` the whole - * prompt (it says what is named). + * The pointers a search answer sends: the units that pass the place test, at most `cap`, + * and no range inside another. `query` is the text the search was asked with (it says + * whether tests or documentation were asked for) and `text` the whole prompt (it says + * what is named). + * + * The first-ranked result's file leads: the highest-ranked of the pointers in that file + * is listed first, also when the unit sent for it ranks below another file's. The others + * keep rank order, as all do when that file has no pointer. * * A range and the ranges inside it (a class and its own methods) send one pointer: each * innermost definition inside the range that `text` names; else the range when `text` @@ -528,7 +532,9 @@ function places(results: PointerUnit[], query: string, text: string, cap: number // No range inside another: two ranges that overlap without one holding the other can // each choose a unit inside both. const apart = (unit: PointerUnit) => ![...sent].some((other) => other !== unit && within(unit, other)); - return ranked.filter((unit) => sent.has(unit) && apart(unit)).slice(0, cap); + const chosen = ranked.filter((unit) => sent.has(unit) && apart(unit)); + const lead = chosen.find((unit) => unit.path === results[0].path); + return (lead ? [lead, ...chosen.filter((unit) => unit !== lead)] : chosen).slice(0, cap); } // ---- the block --------------------------------------------------------------- diff --git a/tests/unit/session_content_senders.json b/tests/unit/session_content_senders.json index 0f2ea90e65..2c7fff9692 100644 --- a/tests/unit/session_content_senders.json +++ b/tests/unit/session_content_senders.json @@ -393,7 +393,7 @@ "integrations/claude-code-plugin/lib/flush-job.mjs": "e6c4ae5e42a54cba0e171b727688be621a81245023bf85a8ac093d334bc9bfd5", "integrations/claude-code-plugin/lib/loom-client.mjs": "2dda1d7c9c04ec1d3f207e12cb1d1dc65571afa298bbbb8e4238115261784dd8", "integrations/claude-code-plugin/lib/namespace-health.mjs": "c8a9aab01f1e996c97643aee7b8f367bf6447f7a6c74dec01a70dc50a0caa182", - "integrations/claude-code-plugin/lib/prompt-pack.mjs": "efd318401aebf0a13fb51289b971ae4bab6138b4d175cc8150902f325a5d9101", + "integrations/claude-code-plugin/lib/prompt-pack.mjs": "2cdbcecb6d5b19c821d73f0e1597b17de79e6c40e56bb63052f87ca3d3589b59", "integrations/claude-code-plugin/lib/repo-scope.mjs": "961eafc828f667daf59e94407bf363c7243890e3f4d1d35c5b9d04e2db72eefe", "integrations/claude-code-plugin/lib/session-brief.mjs": "3aee492198a400ed0fa5fee733b4a4e04463efcc4d0b22ff760e1b765a76e28b", "integrations/claude-code-plugin/lib/session-start.mjs": "6b410afc84c63d539f539b9f6e9325a91ab6d8431637541c3b6c8a8e58079ca1", @@ -408,7 +408,7 @@ "integrations/codex-plugin/lib/flush-job.mjs": "e6c4ae5e42a54cba0e171b727688be621a81245023bf85a8ac093d334bc9bfd5", "integrations/codex-plugin/lib/loom-client.mjs": "2dda1d7c9c04ec1d3f207e12cb1d1dc65571afa298bbbb8e4238115261784dd8", "integrations/codex-plugin/lib/namespace-health.mjs": "c8a9aab01f1e996c97643aee7b8f367bf6447f7a6c74dec01a70dc50a0caa182", - "integrations/codex-plugin/lib/prompt-pack.mjs": "efd318401aebf0a13fb51289b971ae4bab6138b4d175cc8150902f325a5d9101", + "integrations/codex-plugin/lib/prompt-pack.mjs": "2cdbcecb6d5b19c821d73f0e1597b17de79e6c40e56bb63052f87ca3d3589b59", "integrations/codex-plugin/lib/repo-scope.mjs": "961eafc828f667daf59e94407bf363c7243890e3f4d1d35c5b9d04e2db72eefe", "integrations/codex-plugin/lib/session-brief.mjs": "3aee492198a400ed0fa5fee733b4a4e04463efcc4d0b22ff760e1b765a76e28b", "integrations/codex-plugin/lib/session-start.mjs": "6b410afc84c63d539f539b9f6e9325a91ab6d8431637541c3b6c8a8e58079ca1", diff --git a/tests/unit/test_sdk_pointer_block.py b/tests/unit/test_sdk_pointer_block.py index 3e4b52b63c..5fe9ef4e84 100644 --- a/tests/unit/test_sdk_pointer_block.py +++ b/tests/unit/test_sdk_pointer_block.py @@ -564,8 +564,7 @@ async def test_an_issue_gets_the_places_it_is_about(deployment: Deployment) -> N first = await bot.code.pointer_block(ISSUE, namespace="code-uploads") lead, *entries = block.split("\n") assert lead == pointers.LEAD - # Places to edit, in the index's order: the test and the document the answer - # holds are left out. + # Places to edit: the test and the document the answer holds are left out. served = deployment.answers[0]["results"] assert len(served) == 5 assert any(u["path"].startswith("tests/") for u in served) @@ -577,6 +576,7 @@ async def test_an_issue_gets_the_places_it_is_about(deployment: Deployment) -> N ] listed = [entry.split(" ")[1] for entry in entries] ranked = [f"{u['path']}:{u['start_line']}-{u['end_line']}" for u in served] + # The lead rule moves nothing in this answer: the block is in the index's order. assert listed == [pointer for pointer in ranked if pointer in listed] # Unasked, the answer is three results, and the block lists the places among them. assert len(deployment.answers[1]["results"]) == 3