microskills: bundle exec and pnpm exec are recorded as bundle run and pnpm run

未关闭 适合新手
#344 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Shizoqua 已经在做这个了。

开始于 2026年11月27日。

  • #346 来自 @Shizoqua —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
devtools

调研方向

从 tokeneconomizer/microskills/observe.py 开始,其中 classify_command 匹配 run 和 exec,通过 _TOOL_RUN_RE 实现,但将形式动词写成了 run。运行 issue 中的离线复现,查看 bundle exec rspec 和 pnpm exec jest 当前的形式。完成标准是这些命令在形式中保留 exec 动词,且 uv run pytest 保持不变。

由索引模型根据 Issue 内容生成。

描述

classify_command in tokeneconomizer/microskills/observe.py matches a launcher's run or exec (_TOOL_RUN_RE) but always writes the verb as run in the form. The form is what a learned fact tells the next session to type, so bundle exec rspec is taught as bundle run rspec, which Bundler has no command for, and pnpm exec jest as pnpm run jest, which runs a package.json script named jest rather than the binary (pnpm's docs for pnpm run: "Runs a script defined in the package's manifest file").

Reproduction (offline):

from tokeneconomizer.microskills.observe import GENERIC, classify_command

for cmd in ["bundle exec rspec", "pnpm exec jest", "uv run pytest"]:
    print(cmd, "->", [(o.intent, o.form) for o in classify_command(cmd, vocab=GENERIC)])

Expected: forms bundle exec rspec, pnpm exec jest, uv run pytest
Actual: bundle run rspec, pnpm run jest, uv run pytest

End to end, four sessions where rspec is not on PATH and bundle exec rspec passes inject "rspec … fails here with command not found; bundle run rspec … works."

Upstream main: 747b8016538c13da7ba9d455b89e5e6595bf5294
Python 3.13.18, Linux

主要语言
Python
星标
7.4k
派生
500
平均合并
1 天 19 小时
30 天内合并 PR
123

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/TokenEconomizer 的其他 Issue

查看 microsoft/TokenEconomizer 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。