Repository navigation
fix(brain): scope planner examples by distro - #656
vladimirrott merged 3 commits into
Conversation
vladimirrott
left a comment
There was a problem hiding this comment.
Thank you for taking #648 the morning it came free, @dannyward630. Filtering the examples through the same available_on check as the action_name enum is the right fix. Your test that compares each query tool's filter key with the action query_tool_to_action dispatches pins the drift I was worried about.
I reviewed 1285503b.
One change before this leaves draft. The query-tool filtering opens a gap in the prompt. On Ubuntu, query_tools_for_distro now drops query_packages, query_deployments, query_toolboxes, query_kernel_args, query_package_repos, query_deployment_history and the two Flatpak queries. The shared PREAMBLE still lists all of them under "Available query_* tools" (crates/sysknife-brain/src/prompt.rs:115-124), and Example B (prompt.rs:230) tells the model to call query_packages before an install. On an Ubuntu host the model would read about a tool, call it, and get "unknown tool" back. CLAUDE.md names that path, a query error followed by an unrelated plan, as one of the two failures the examples exist to prevent, and any change to what the prompt promises needs the E2E story suite.
You said on #648 you'd leave the query-tool part out if it needed its own decision, and it does. Please drop the query_tools.rs and planner.rs changes from this PR and keep it to the propose_plan examples. I'll file the query-tool list and the prompt text that names it as a separate issue, because the two have to move together.
Optional. The example table can be smaller. ParameterSection, ParameterLine and ParameterExample carry an action_separator, a template and a prefix_without_toolboxes, and most entries repeat the action name twice (("InstallFlatpak", "InstallFlatpak")). A list of (action, line) pairs per section, filtered by available_on, would render the same text from about a third of the code, and you could check it against the old string by eye. Your call.
Leave tests/evidence/workspace-tests.json and the three prose counts to me. I'll set them from the Linux run when this merges.
Thank you for this, and for being upfront about the macOS limit. It told me which runs to do on my side.
|
The query-tool and prompt follow-up is #657, so nothing from that part gets lost when you drop it here. |
1285503 to
85d2191
Compare
The table-driven params description put all four Identity examples on one line, so a host that offers every action no longer got the text it had before. Split the section back into its two original lines; with every example offered the description is now byte-identical to the old literal. Pin that layout in the Fedora test, and assert on Ubuntu that a section whose actions are all withheld leaves no bare parameter line behind (deleting either empty-check in parameter_description failed nothing before). `available_on` goes back to private, since nothing outside the module calls it now. Test count moves to 1,998. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UpyrhbDTW1gBwzGAC44GYU
vladimirrott
left a comment
There was a problem hiding this comment.
@dannyward630 thanks for turning this around so fast. Dropping the planner.rs and query_tools.rs half was the right call, and the Ubuntu description reads well: no Toolbox, no Layering, no Repos, and the Containers heading loses its "/Toolbox" suffix with the rest.
I pushed one commit on top (f5425058), since you allow maintainer edits:
- Identity layout. The table put all four Identity examples on one line. I fed
parameter_descriptionevery action the table names and diffed it against the old literal: that one line break was the only difference. I split the section back into its two lines, so a host that offers everything now gets the old text byte for byte, and the Fedora test pins it. - One more assertion on Ubuntu. I changed
if actions.is_empty()toif false, and both tests stayed green. The mutant printed• Layering: : {"package":"vim"}and a baretarget_refline on Ubuntu. The Debian test now checks that• Layering,• Repos,target_refandrepo_urlare absent, and that mutant fails along with the other three I tried (filter always true, prefix always the Toolbox one, empty-line check removed). available_onwent back to private. Nothing outside the module calls it once the query-tool change left.- Test count is 1,998, measured on Linux: 1,998 passed, 6 skipped.
Locally clippy is clean and the pre-commit and pre-push boards passed. I'll merge once CI agrees. Thanks as well for picking up #657.
|
Merged as |
Minor release. #627 keys request_hash with an HMAC under the audit key (chain_version 4; previews stored by an older release fail closed after upgrading) and #639 changes the history request a newer CLI sends, so a caller relying on the old behaviour notices: the middle digit moves. Also: the planner sees only its host's distribution (#626, #656, #658, #684), checkpoint and the MCP audit tools share the audit-store resolver (#636), every workflow job has a time limit (#662), a weekly cargo audit (#640), release hardening (#635, #637, #660), and every published figure is rendered from its source (#685). Claude-Session: https://claude.ai/code/session_01UpyrhbDTW1gBwzGAC44GYU Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Build
propose_planparameter examples from the same distro-filtered action list as its enum and catalogue. Ubuntu no longer sees Fedora-only or Toolbox examples; retained Fedora examples keep their existing wording. This PR covers onlypropose_plan; query-tool filtering and matching prompt text are tracked in #657.Related Issue
Closes #648
Validation
Notes for Reviewers
planner.rsandquery_tools.rs; the coordinated query-tool and prompt change is tracked in The planner offers Fedora-only query tools on Ubuntu, and Example B tells it to call one #657.rustjob fails afterward because the checked-in baseline says 1,996. Per the review request, the baseline artifact and three prose counts remain unchanged for the maintainer's Linux measurement. The container image and Rust analysis checks are still pending.