Skip to content

feat(habit): expose durable recurring-habit HTTP API - #43

Merged
seonghobae merged 16 commits into
mainfrom
feat/habit-http-api
Aug 3, 2026
Merged

feat(habit): expose durable recurring-habit HTTP API#43
seonghobae merged 16 commits into
mainfrom
feat/habit-http-api

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

Implements #41 as the next reviewable habit.recurring-core slice after #40.

  • adds bounded PostgreSQL pool configuration and an exactly-once NestJS shutdown lifecycle
  • wires the production Habit service to PostgresHabitRepository without an in-memory fallback
  • exposes versioned tenant-scoped routes for habit creation/listing, occurrence generation, idempotent completion commands, and immutable completion history
  • derives ownership exclusively from x-workspace-id and validates workspace/habit identifiers before persistence
  • parses untrusted recurrence and completion bodies without accepting tenant ownership from JSON
  • maps validation, missing records, idempotency conflicts, persistence failures, and unknown failures to bounded credential-free problem details
  • adds runtime tests plus habit-service.integration.test.ts over the production NestJS module and disposable PostgreSQL
  • proves tenant isolation, recurrence correctness, exact completion replay, conflicting replay rejection, process-restart durability, invalid ownership handling, and credential-free database failures
  • documents runtime settings, routes, migration privileges, shutdown behavior, and deferred workflows

Deferred

Authenticated workspace derivation at an API gateway, pause/archive, streak projections, reminders, calendar integration, controlled erasure, and end-user workflow design remain separate reviewable slices.

Validation gate

Merge only when CI, AppGuardrail, Semgrep, Security Scan, Commercial Readiness, CodeRabbit, and all human/security review requirements pass on the exact head with no unresolved actionable findings.

Closes #41

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 702853ad-515b-42b4-94f1-994c370cac5d

📥 Commits

Reviewing files that changed from the base of the PR and between cab995e and 2f083cb.

📒 Files selected for processing (10)
  • apps/habit-service/migrations/README.md
  • apps/habit-service/package.json
  • apps/habit-service/src/habit-runtime.test.ts
  • apps/habit-service/src/habit-runtime.ts
  • apps/habit-service/src/habit-service.integration.test.ts
  • apps/habit-service/src/http-boundary.test.ts
  • apps/habit-service/src/http-boundary.ts
  • apps/habit-service/src/main.ts
  • docs/superpowers/plans/2026-08-04-habit-http-api-slice.md
  • package.json

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

@seonghobae
seonghobae merged commit 2ea8510 into main Aug 3, 2026
32 checks passed

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

Expose durable recurring habits through a versioned HTTP API

1 participant