Test Rule and rule previews disagree with the detector for no-devcontainer because request rows lack sessionId

未关闭
#342 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start with devcontainerStats in src/core/dsl/interpreter.ts (around lines 588-590), which joins requests to sessions by sessionId, then compare the three row sources in src/webview/panel-rpc.ts (testRuleLive, getRuleEditor, getRulePreview) against the enrichment in src/core/analyzer-patterns.ts (lines 232-246). Done means those paths attach sessionId without mutating shared request objects, so Test Rule and previews match the detector regardless of call order.

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

描述

bug
Description

devcontainerStats matches requests to sessions by sessionId (src/core/dsl/interpreter.ts:588-590). But three paths evaluate rows from a.filterRequests(), which carry no sessionId:

  • Test Rule (testRuleLive, src/webview/panel-rpc.ts:961);
  • the Rule Editor list (getRuleEditor, :811);
  • the rule preview (getRulePreview, :884).

Only getAntiPatterns adds sessionId and workspaceName, and it does so by writing them into the shared request objects (src/core/analyzer-patterns.ts:232-246). References are to main e6cedb7.

As a result, for a rule that joins requests to sessions:

  • before that enrichment has run on the extension host, Test Rule and the previews evaluate requests with no session ids;
  • afterward, the same request objects carry ids, and the results change. So the result depends on call order.

Evidence (dashboard canvas host, real data, rule no-devcontainer):

  • Test Rule and the editor preview: CLEAN 0/0.
  • The detector (getAntiPatterns, with or without a date filter): TRIGGERED, 82 occurrences.
  • After one date-filtered getAntiPatterns call, Test Rule and the preview: TRIGGERED 82/112.
Steps to Reproduce
  1. Reload the dashboard.
  2. Open Anti-Patterns > Rules > No Devcontainer > Edit Source > Test Rule. It shows CLEAN 0/0.
  3. Compare with the detector's result for the same data: no-devcontainer is triggered with 82 occurrences.
  4. Load Anti-Patterns with a date filter, then Test Rule again: TRIGGERED 82/112.
Expected Behavior
  • Test Rule, the rule previews and the detector give the same result for the same data and filter, regardless of call order.
  • Analyzers don't mutate shared request objects.
Extension Version

0.1.0 (main e6cedb7)

VS Code Version

N/A: reproduced in the dashboard's canvas host, which shares the webview code with VS Code.

Operating System

Any

Related:

  • Found while testing #339.
  • On #322's branch, rule request rows are built by toRuleRequestRows (src/core/rule-rows.ts). It already resolves each request's session to attach harness, so it could attach sessionId the same way and replace the enrichment in analyzer-patterns.ts, which #322 leaves unchanged.
主要语言
TypeScript
星标
4.4k
派生
604
平均合并
5 天 13 小时
30 天内合并 PR
19

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

microsoft/AI-Engineering-Coach 的其他 Issue

查看 microsoft/AI-Engineering-Coach 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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