Repository navigation
Conversation
…e definitions sends its pointers The prompt hook's place test holds source in the languages the index chunks by definition to definitions, and a picked answer whose first result fails the test sends nothing. So an answer the pick model worded high or medium sends nothing when the model put module-level code or class-level source first. These tests state the rule for that first result and fail until the place test follows it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… when it is source outside the definitions In the languages the index chunks by definition the place test passes definitions only, and a picked answer whose first result fails the test sends nothing. That rule is for an answer no model has read. The pick model's candidates hold module-level code and the lines of a class outside its methods, and it reads the request against them before it puts one first; a fix can be made there, in a setting or a class attribute. So for the first result of an answer the model worded high or medium, kind other passes. The rules on the path, the rule on a file's preamble, the results below the first and an answer with no pick word are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… place test for a picked answer's first result Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… and a first pick alike The hook notes and the Claude Code page added the lines of a class outside its methods to the first-pick rule alone. The index chunks them as kind `other`, and one expression passes that kind for a request that asks for tests and for a picked answer's first result, so the text names them among the units both rules share. A first pick of kind `other` in a file the prompt names is sent: the test asserts it for a packaging script and a test file. `isPlace` has one caller, which passes `firstPick`, so the parameter has no default. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Main's gate change (`accept` admits a picked answer at any risk label, as its first pick alone) and this branch's place test both stand. The hook table rows of the plugin README and the Claude Code page carry both texts, the manifests keep 1.2.183, and the four pins are the merged files' digests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…k that is source outside the definitions Where the risk label holds a picked answer back, the hook sends its first result alone. That result passes the place test as a first pick when it is kind `other`, so the two rules together send one pointer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #2172
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
For a bug report whose pointers the server's pick model chose and worded
highormedium, the coding-agent plugins' prompt hook sends the pointers when the model's first pick is module-level code or the lines of a class outside its methods. Such an answer sent nothing before. Plugin 1.2.183.Why
In Python, C and C++, TypeScript and JavaScript, Go, Rust and Java source the hook's place test (
isPlaceinlib/prompt-pack.mjs) passes definitions only: kindfunction,class_skeletonorsymbol. The index chunks everything else in such a file that is not its preamble as kindother: module-level code, the lines of a class outside its methods, a window of a file it could not parse. The rule was written for answers ranked by the search alone.A picked answer adds a second rule: its first result decides, and when that result fails the place test nothing is sent, the definitions below it included. The pick model's instruction lists module-level code among its candidates, and the model reads the request against them before it puts one first. A fix can be made in such code: a setting assigned at module level, a class attribute. When the model picked that code first, the kind rule refused it and the first-result rule then dropped the whole answer, so the session got no pointer for a report the model had answered
highormedium.The fix: for the first result of an answer worded
highormedium, kindotherpasses the kind rule.isPlacetakes afirstPickargument andplacessets it forresults[0]of a picked answer.First result only, not every picked result. Two reasons, both from the code:
pick_confidenceon a page whose first unit is not the pick's first (server/code/app/search/window.py), and it marks no unit as a pick. Where the model picked fewer results than the page holds, the search's own ranking follows them, and the hook cannot tell the two apart.Applying it to every result would be one expression shorter (
pickedin place ofpicked && unit === results[0]) and is not taken for those reasons.Scope and risk
Touches
isPlaceandplacesinintegrations/claude-code-plugin/lib/prompt-pack.mjs, the header comment ofhooks/loom-prompt-pack.mjs, the generated Codex copies of both, their pins intests/unit/session_content_senders.json, both plugin manifests (1.2.183), and the text that states the place test:hooks/HOOKS.md, the plugin README's hook table,docs/features/integrations/claude-code.mdanddocs/guides/issue-code-pointers.md.docs/operations/code-index-operations.mddoes not state the place test and is unchanged.Left alone:
file_header), acomment_blockand a unit with no kind are no place as a first pick either.low:pickedis false there andfirstPickwith it.accept), the caps of three and of one, the cause sentence and the test line.rerank: "none", get no pick word and have no pick branch.integrations/claude-code-plugin/tests/fixtures/pointer-block.jsonholds no reply with a pick word and is unchanged, so the three renderers build the same blocks as before.What could go wrong: an answer that sent nothing sends up to three pointers (one where only the model's word admits it), and the first is a range with no name that can be long. When the model's first pick is wrong, the session reads a wrong pointer where it read none. The block's lead line still calls the pointers candidates. The existing range rules apply to that unit: a definition the answer holds inside it that the prompt names is sent in its place, and a range over 200 lines is listed by its first line and its length.
The hook sends no new request and no new field, and its timing and failure paths are unchanged.
The linked pull request is merged and is in this branch through a merge of
main:acceptadmits an answer wordedhighormediumat any risk label, and where only the word admits it the hook sends its first result alone. That first result can be such a unit, and the new test asserts that it is sent.Compatibility, rollout and rollback
Tests
node --test integrations/claude-code-plugin/tests/prompt-pack.test.mjs: 40 pass. The new test, "the first result of a picked answer is a place when it is source outside the definitions", is committed alone in the first commit, where it fails with[]for the two expected pointers. It covers each of the held languages' suffixes, the results below the first, an answer no model ordered, every kind and path rule that still drops a first pick, a first pick in a packaging script and in a test file the prompt names (sent;[]onmain), a class-level range with a named definition inside it, andpointerBlockforhigh,medium,lowand no word, at a low risk label and, forhighandmedium, at a medium one.node --test integrations/claude-code-plugin/tests/prompt-pack-hook.test.mjs: 92 pass. The hook, run as a process against a stub server, prints the module-level unit first forhighandmedium, and for a reply with no word the block without it.node --test --test-concurrency=2 integrations/claude-code-plugin/tests/*.test.mjs: 1251 of 1258 pass, 7 skipped, none failed. At the default concurrency on a loaded machine the tests that bound a hook process's time fail, a different set each run (infile-context-read.test.mjs,session-start.test.mjs,hook-contract.test.mjsandplugin-modes.test.mjsamong others); none is in a test file this change touches.node --test integrations/grep-shim/tests/*.test.mjs integrations/cline/tests/*.test.mjs: 46 pass, 1 skipped.make format,make lint,make typecheckwithLOOM_ENV_FILE=: clean;agent_plugin_sync --checkreports the Codex copies current.pytest tests/unit/test_session_content_senders.py tests/unit/test_codex_plugin.py tests/unit/test_agent_plugin.py tests/unit/test_plugin_code_query_contract.py tests/unit/test_sdk_pointer_block.py tests/unit/test_doc_links.py tests/unit/test_public_copy.py tests/unit/test_agent_instructions.py: 668 pass.node --checkover the plugins' hooks andlib/: clean.claude plugin validate integrations/claude-code-plugin --profile directory --strictfails here on one warning about thebin/folder, which this change does not touch.The full unit suite, the TypeScript SDK's tests and the integration suite are left to CI.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: the new test fails before the change and passes after it, the plugin test files above, and the diff of the generated Codex copies against the Claude Code plugin's files.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited. (No migration.)hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed. (Not changed.)docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code