Skip to content

chore: consolidate specs into OpenSpec#23

Closed
coji wants to merge 1 commit into
mainfrom
feature/spec-consolidation
Closed

chore: consolidate specs into OpenSpec#23
coji wants to merge 1 commit into
mainfrom
feature/spec-consolidation

Conversation

@coji
Copy link
Copy Markdown
Owner

@coji coji commented Jan 18, 2026

Summary\n\n- Remove duplicated docs/spec-*.md files and keep OpenSpec as the single source of truth\n- Add for existing @coji/durably-react behavior\n- Update HITL change set with React spec deltas and job filter notes\n\n## Test plan\n\n- [x] Specification 'react' is valid\n- [x] Change 'add-human-in-the-loop' is valid\n

Summary by CodeRabbit

  • New Features

    • Added Human-in-the-Loop React integration with useHumanWaits hook for browser and server modes
    • Support for filtering waiting runs by job name via the API
  • Documentation

    • Reorganized and updated specification structure for core and React features
    • Introduced comprehensive OpenSpec documentation for Human-in-the-Loop and React bindings

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 18, 2026

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

Project Deployment Review Updated (UTC)
durably-demo Ready Ready Preview Jan 18, 2026 5:25am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

This PR migrates documentation specifications from the docs/ directory to an OpenSpec-based structure, removing legacy specification files while introducing new specifications for core, React, and HITL features organized under openspec/.

Changes

Cohort / File(s) Summary
Documentation Deletion
docs/spec*.md (spec.md, spec-human-in-the-loop.md, spec-job-versioning.md, spec-postgres.md, spec-react.md, spec-streaming.md)
Removed 3,389 lines of legacy specification documentation covering system architecture, HITL, job versioning, PostgreSQL support, React integration, and streaming workflows.
OpenSpec Proposal Updates
openspec/changes/add-human-in-the-loop/proposal.md
Updated impact section to reference new OpenSpec specs locations instead of legacy docs/ paths.
OpenSpec Core Specification
openspec/changes/add-human-in-the-loop/specs/core/spec.md
Added GET /runs?status=waiting_human&jobName=... query filter scenario for listing human-waiting runs by job name.
OpenSpec React HITL Specification
openspec/changes/add-human-in-the-loop/specs/react/spec.md
Introduced new React hook specifications (useHumanWaits) for HITL in both browser and server/client modes, including typed variants, factory patterns, and WaitingRun shape requirements.
OpenSpec Task Reorganization
openspec/changes/add-human-in-the-loop/tasks.md
Restructured sections 7–9: shifted from documentation-oriented tasks to HITL testing-focused items, reorganized under new section headers (7. React, 8. テスト, 9. ドキュメント).
OpenSpec React Bindings Specification
openspec/specs/react/spec.md
Created comprehensive React integration specification covering DurablyProvider, browser-mode hooks (useJob, useJobRun, useJobLogs, useRuns), server-connected mode hooks, and typed client factories.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 The specs hop into OpenSpec's warren so bright,
No more scattered in docs—now organized right!
React hooks and HITL dance in structured delight,
While old scrolls retire to memory's night.
📚✨

🚥 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 'chore: consolidate specs into OpenSpec' directly and clearly describes the main change: consolidating specification files into OpenSpec as the single source of truth by removing duplicated docs/spec-*.md files.
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.


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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
openspec/changes/add-human-in-the-loop/specs/core/spec.md (2)

35-38: Avoid SHOULD for normative requirement wording.

Spec guidance here prefers SHALL/MUST unless intentionally non‑normative. Consider promoting to MUST or explicitly marking it non‑normative. As per coding guidelines, avoid should/may in spec requirements.


38-41: Fix list indentation to keep bullets consistent.

The extra leading space before the bullets can break list rendering.

🔧 Suggested fix
- - The system MUST return `404` when `runId` does not exist
- - The system MUST return `410` when `wait_deadline_at` has expired
+- The system MUST return `404` when `runId` does not exist
+- The system MUST return `410` when `wait_deadline_at` has expired
🤖 Fix all issues with AI agents
In `@openspec/changes/add-human-in-the-loop/specs/react/spec.md`:
- Around line 11-14: The spec uses non-normative modal verbs (SHOULD) for what
are clearly required behaviors: update the lines referencing the hook parameters
and return values—specifically the `jobName` parameter, the `payloadSchema`
parameter, the returned object `{ waits, isLoading, reload, respond }`, and the
`respond(runId, payload)` behavior—to use normative language (replace SHOULD
with MUST) or explicitly mark them as non‑normative; ensure `respond(runId,
payload)` remains a MUST for resuming a Run and that the return contract `{
waits, isLoading, reload, respond }` is stated as mandatory.

Comment on lines +11 to +14
- The hook SHOULD accept `jobName` to filter waits by job
- The hook SHOULD accept `payloadSchema` to enable type inference and client-side validation
- The hook MUST return `{ waits, isLoading, reload, respond }`
- `respond(runId, payload)` MUST resume the Run with the given payload
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use SHALL/MUST for normative requirements.

The SHOULDs read like normative requirements. Consider upgrading to MUST or explicitly noting non‑normative intent. As per coding guidelines, avoid should/may in spec requirements.

✏️ Possible wording update
-- The hook SHOULD accept `jobName` to filter waits by job
-- The hook SHOULD accept `payloadSchema` to enable type inference and client-side validation
+- The hook MUST accept `jobName` to filter waits by job
+- The hook MUST accept `payloadSchema` to enable type inference and client-side validation
...
-- A WaitingRun SHOULD include `wait_schema` when available
+- A WaitingRun MUST include `wait_schema` when available

Also applies to: 73-75

🤖 Prompt for AI Agents
In `@openspec/changes/add-human-in-the-loop/specs/react/spec.md` around lines 11 -
14, The spec uses non-normative modal verbs (SHOULD) for what are clearly
required behaviors: update the lines referencing the hook parameters and return
values—specifically the `jobName` parameter, the `payloadSchema` parameter, the
returned object `{ waits, isLoading, reload, respond }`, and the `respond(runId,
payload)` behavior—to use normative language (replace SHOULD with MUST) or
explicitly mark them as non‑normative; ensure `respond(runId, payload)` remains
a MUST for resuming a Run and that the return contract `{ waits, isLoading,
reload, respond }` is stated as mandatory.

@coji coji closed this Mar 4, 2026
@coji coji deleted the feature/spec-consolidation branch March 5, 2026 12:14
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