Skip to content

chore: strengthen spec-review with liveness and promise ownership checks#175

Merged
coji merged 1 commit into
mainfrom
chore/strengthen-spec-review-liveness
Mar 29, 2026
Merged

chore: strengthen spec-review with liveness and promise ownership checks#175
coji merged 1 commit into
mainfrom
chore/strengthen-spec-review-liveness

Conversation

@coji
Copy link
Copy Markdown
Owner

@coji coji commented Mar 28, 2026

Summary

Expand spec-review instruction with structured checklist covering gaps found in #173:

  • Input validation: numeric options used as counts/concurrency/loop bounds must define exact valid domain (safe integer), not just "number"
  • Concurrency safety + liveness: completion criteria must cover both "no overlap" AND "idle slots keep polling, freed slots are reused"
  • Promise ownership: detached/tracked promises must define rejection handling; stop()/shutdown must use allSettled pattern
  • Behavioral regression: scheduler changes need explicit regression criteria

Also synced matching items to spec-draft quality checklist.

Context

Post-mortem from #173: CodeRabbit caught 3 issues (idle slot loss, unhandled rejection, unsafe integer) that spec-review should have caught. Codex (gpt-5.4) confirmed these were preventable at spec stage with the right checklist items.

Test plan

  • No code changes, only takt workflow configuration
  • Next takt task validates the improvements

🤖 Generated with Claude Code

Summary by CodeRabbit

  • ドキュメント
    • 品質チェックリストと仕様レビュー要件を拡張。入力値検証、並行処理・スケジューリング、非同期処理の所有権に関する要件を明確化し、より厳密なテスト基準を定義。

…afe integer checks

Add structured checklist to spec-review covering:
- Input validation: exact valid domain for numeric options (safe integer)
- Concurrency safety AND liveness (idle slots keep polling, freed slots reused)
- Detached promise rejection ownership (no unhandled rejections)
- stop()/shutdown must use allSettled pattern
- Behavioral regression criteria

Sync matching items to spec-draft quality checklist.

Learned from #173 CodeRabbit review: idle slot loss, unhandled rejection,
and unsafe integer validation were missed at spec stage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
durably-demo Ignored Ignored Mar 28, 2026 4:25pm
durably-demo-vercel-turso Ignored Ignored Mar 28, 2026 4:25pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 28, 2026

📝 Walkthrough

ウォークスルー

品質チェックリストが更新され、新しいパブリックAPI数値オプションの汎用入力テスト要件が、count/concurrency/loop-boundパラメータの明示的なドメイン定義要件に置き換わりました。並行実行/スケジューリング変更に対する安全保証と活動保証が追加され、detached対trackedプロミスの拒否所有権が明示的に定義される要件が含まれました。

変更内容

Cohort / File(s) Summary
仕様チェックリスト更新
.takt/facets/instructions/spec-draft.md, .takt/facets/instructions/spec-review.md
入力検証(0、負の値、NaN、Infinity、小数、MAX_SAFE_INTEGER超過値のテスト)、並行実行/スケジューリング要件(安全保証と活動保証、状態遷移基準)、プロミス/非同期所有権要件(拒否所有権の定義、Promise.allSettledの使用)が追加されました。

推定コードレビュー工数

🎯 2 (Simple) | ⏱️ ~10分

関連する可能性のあるPR

📋 ウサギがチェックリストを整え
ドメインと安全保証の確認を重ねて
プロミスの所有権もクリアにして
堅牢な仕様へと育ちゆく
品質のために、小さな変更が大きく光る ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: strengthening spec-review checklists with liveness guarantees and promise ownership requirements, which aligns with the core content modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/strengthen-spec-review-liveness

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.takt/facets/instructions/spec-review.md (1)

29-31: 並行性と活性の要件が詳細で実用的です

「Concurrency and scheduling」セクションは、安全性(重複なし、二重実行なし)と活性(アイドルリソースの継続的なポーリング、解放されたスロットの再利用、制限された遅延内での新しい作業のピックアップ)の両方をカバーしており、状態遷移ごとの明示的な基準(作業発見、部分的アイドル、完全アイドル、エラー/拒否、停止)を要求しています。これにより、issue #173で特定されたアイドルスロット喪失の問題を防ぐことができます

ただし、31行目の「keeps polling」という表現は、静的解析ツールによりよりフォーマルな表現が推奨されています。必要に応じて「continues to poll」への変更を検討してください。

♻️ スタイル改善の提案
-   - Require explicit criteria for each state transition: work found → immediate action, partially idle → keeps polling, fully idle → maintenance + delayed poll, error/reject → no orphaned state, stop → predictable drain.
+   - Require explicit criteria for each state transition: work found → immediate action, partially idle → continues to poll, fully idle → maintenance + delayed poll, error/reject → no orphaned state, stop → predictable drain.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.takt/facets/instructions/spec-review.md around lines 29 - 31, Update the
wording in the "Concurrency and scheduling" section: replace the informal phrase
"keeps polling" with the more formal "continues to poll" (referencing the phrase
inside the second bullet under **Concurrency and scheduling**) so the spec reads
with a formal, static-analysis-friendly term; no behavior change needed, only
the textual edit in that bullet.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.takt/facets/instructions/spec-review.md:
- Around line 29-31: Update the wording in the "Concurrency and scheduling"
section: replace the informal phrase "keeps polling" with the more formal
"continues to poll" (referencing the phrase inside the second bullet under
**Concurrency and scheduling**) so the spec reads with a formal,
static-analysis-friendly term; no behavior change needed, only the textual edit
in that bullet.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d46b2cda-3c42-40ff-97a7-bca3fab21d81

📥 Commits

Reviewing files that changed from the base of the PR and between a9c1645 and 25173f1.

📒 Files selected for processing (2)
  • .takt/facets/instructions/spec-draft.md
  • .takt/facets/instructions/spec-review.md

@coji coji merged commit cde70f7 into main Mar 29, 2026
5 checks passed
@coji coji deleted the chore/strengthen-spec-review-liveness branch March 29, 2026 01:59
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.

1 participant