Skip to content

fix(#320): SchedulePanel kind-match filter + taskStore type alignment#383

Merged
zts212653 merged 5 commits intomainfrom
fix/320-schedule-panel-kind-match
Apr 10, 2026
Merged

fix(#320): SchedulePanel kind-match filter + taskStore type alignment#383
zts212653 merged 5 commits intomainfrom
fix/320-schedule-panel-kind-match

Conversation

@mindfn
Copy link
Copy Markdown
Collaborator

@mindfn mindfn commented Apr 7, 2026

What

  • packages/api/src/routes/schedule.ts: Remove !s.lastRun gate on kind-match filter path
  • packages/api/test/schedule-route.test.js: Fix test asserting buggy behavior + add negative test
  • packages/web/src/stores/taskStore.ts: Import TaskItem from @cat-cafe/shared (type alignment)

Why

PR #323 added a kind-match filter in the SchedulePanel's thread-scoped view, but gated it with !s.lastRun. Builtin scheduler tasks (cicd-check, conflict-check, review-feedback) have prior runs for other PRs, so s.lastRun is always truthy — newly registered PR tracking tasks never appeared in the SchedulePanel.

Original Requirements

  • Discussion: thread_mnnebghhey6tj7cp
  • Original report:

    thread_mnnebghhey6tj7cp 这个thread我注册了pr的tracking,但是我在workspace的调度这里看不到这个任务

  • CVO core pain: PR tracking registered but invisible in workspace scheduler
  • Please verify: does this fix make PR tracking tasks visible in SchedulePanel?

Plan / ADR

Tradeoff

Removed !s.lastRun on kind-match path. Tasks included via kind-match may show lastRun from a different PR — acknowledged as P2 follow-up (run state scrubbing for thread scope).

Test Evidence

Schedule route tests: 26 passed, 0 failed
Build: success
Biome check: 0 errors on changed files

Open Questions

None — scoped to SchedulePanel fix only.


Local Review: [x] gpt52 reviewed and approved (on original PR #379)
Cloud Review: [ ] Triggering in comment below

@mindfn mindfn requested a review from zts212653 as a code owner April 7, 2026 18:56
@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 7, 2026

@codex review

Please review latest commit 28f21da for P1/P2 only.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28f21da122

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 7, 2026

@codex review

Please review latest commit 7a2457e for P1/P2 only.

P1 fix applied: kind-match path now scrubs lastRun/subjectPreview to prevent cross-thread metadata leak. Test updated with scrub assertions.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn mindfn force-pushed the fix/320-schedule-panel-kind-match branch from 7a2457e to 6f9ad98 Compare April 9, 2026 02:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f9ad9825a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn mindfn force-pushed the fix/320-schedule-panel-kind-match branch from 876140b to 8d97b09 Compare April 9, 2026 02:17
@mindfn
Copy link
Copy Markdown
Collaborator Author

mindfn commented Apr 9, 2026

@codex review

Please review latest commit 8d97b09 for P1/P2 only.

规则:任何 P1/P2 必须给"可执行复现":

  • 优先:新增/更新一个 failing test(最小复现)
  • 否则:给确定性复现步骤(命令 + 输入 + 预期/实际)
    没有证据的一律降级为 P3 建议,不算缺陷。

审查标准(详见 AGENTS.md "Review guidelines" section):

  • P0 数据丢失/安全漏洞 | P1 逻辑错误/测试缺失/架构违规
  • P2 性能/重复/命名 | P3 风格偏好
  • 禁止 any、文件 200 行警告/350 硬上限、新功能必须有测试

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mindfn mindfn force-pushed the fix/320-schedule-panel-kind-match branch from 8d97b09 to 2ed7243 Compare April 9, 2026 13:22
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

mindfn and others added 3 commits April 10, 2026 15:17
The zero-run path in schedule.ts only showed PR scheduler tasks
(cicd-check, conflict-check, review-feedback) when the task had NEVER
run. Since builtin tasks have prior runs for other PRs, newly registered
PR tracking never appeared in the SchedulePanel.

Fix: drop the !s.lastRun condition so threads with active pr_tracking
tasks see PR-related scheduler tasks via subjectKind match.

Also: taskStore.ts imports TaskItem from @cat-cafe/shared instead of
maintaining a stale local copy (missing kind/subjectKey/automationState).

Split from PR #379 per upstream review — TaskPanel changes dropped to
align with cat-cafe #958 direction (filter pr_tracking out of TaskPanel).

[宪宪/Opus-46🐾]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a task is included via subjectKind match (not actual run match),
its lastRun and subjectPreview belong to a different thread/PR.
Returning them leaks cross-thread metadata.

Fix: kind-match path returns a scrubbed copy with lastRun and
subjectPreview set to null. Quick/slow paths (actual matches) are
unchanged.

[宪宪/Opus-46🐾]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Kind-match path already zeroed lastRun/subjectPreview but left
runStats from unrelated subjects intact, leaking cross-thread
activity totals (e.g. nonzero delivered count for a brand-new
PR tracking thread). Now resets runStats to all zeros.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mindfn mindfn force-pushed the fix/320-schedule-panel-kind-match branch from 85d9dde to 2f7c4dc Compare April 10, 2026 07:18
Copy link
Copy Markdown
Owner

@zts212653 zts212653 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean scope, good scrubbing approach.

Reviewed by both Ragdoll (opus) and Maine Coon (gpt52). No P1/P2 findings.

Key validations:

  • kind-match fix correctly removes !s.lastRun gate
  • flatMap + destructure scrub prevents cross-thread metadata leak
  • Test coverage solid: inclusion + scrub assertions + negative case
  • taskStore type alignment with shared is cleaner than local definition

Will proceed with merge + intake to cat-cafe.

— Ragdoll-opus

@zts212653 zts212653 merged commit 07483d5 into main Apr 10, 2026
5 checks passed
@zts212653 zts212653 deleted the fix/320-schedule-panel-kind-match branch April 10, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants