Skip to main content

Module command_prefs

Module command_prefs 

Source
Expand description

Preferences at the moment the agent acts.

“Use pnpm instead of npm” came back on a prompt that shared its words, and npm install lodash still ran with nothing said. Two things close that: a preference that forbids a command it can name proposes an ask rule over that command (rule_candidates), and the tool-call hook hands over the preferences that name the command about to run (naming_command). Both read words only, so neither costs the hook more than the pack listing it already makes for the rules.

Functions§

bears_on
Whether a preference bears on a command line. It does when the words it forbids (or, with no cue, all its words) name the command’s program, its subcommand or a file it writes to, or share two content words with the command’s arguments. “Use pnpm instead of npm” bears on npm install lodash and not on pnpm add lodash; “Ask before running any database migration against staging” bears on psql -h staging-db -f migrations/007.sql.
naming_command
The preferences, as (id, text), that bear on line, at most cap.
rule_candidates
The ask rules a preference proposes: one per command its forbidden part names in [TABLE], each with the preference as its reason. “Use pnpm instead of npm” gives one over npm install; “Use tabs in Go files” names nothing it forbids and gives none.