Skip to content

feat(schedule): expose audited terminal reason writes - #597

Draft
seonghobae wants to merge 22 commits into
feat/schedule-reason-project-version-287from
feat/schedule-reason-api-route-287
Draft

feat(schedule): expose audited terminal reason writes#597
seonghobae wants to merge 22 commits into
feat/schedule-reason-project-version-287from
feat/schedule-reason-api-route-287

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Buyer outcome

Refs #287. This stacked Draft exposes the existing schedule reason-event domain and same-connection project-version persistence stack through the project schedule write API for explicit skipped and not_performed outcomes. Cancellation remains outside this bounded slice.

Exact current stack

Implemented route and collaboration contract

POST /api/projects/:id/schedule/reasons reuses the established session boundary, derives project context server-side, enforces project membership and write role, bounds the request body, requires the current project version, verifies one exact work-item identity in the project snapshot, permits only skipped and not_performed, persists the reason record and project-version transition on the same SQLite connection, and returns the committed reason identity without rewriting task JSON.

A successful reason write also publishes the ordinary project.update SSE/webhook signal after commit so connected collaborators do not retain stale concurrency state. The committed project version now receives a project_revisions snapshot inside the same reason-event SQLite savepoint. The snapshot retains the unchanged project plan, while project version, revision history identity, normalized reason event, and immutable audit evidence commit or roll back together.

Current TDD repair evidence

Two current-head review findings were verified against live behavior and repaired test-first rather than treated as informational blockers:

  • Collaboration notification: RED 77cc6269d4b8fdc81c13482c3d6c42c4d73740c9 proved that a committed reason version was not broadcast. The repair exports and invokes publishProjectUpdate only after the reason transaction commits; predecessor GREEN Server Tests 33031946425 proved SSE and project.update webhook delivery.
  • Revision continuity: RED 7d2c3ed7ffe8e3a236e9cd7e119a6bace1aae148 added a real API regression requiring committed reason version 3 to remain fetchable through /api/projects/:id/revisions/3. Server Tests 33034442401, unit/API job 98393973898, failed exactly with 404 !== 200. GREEN ae670764a54d451103e72c2453c74ff3f95c198f inserts the unchanged snapshot only after the authoritative transition succeeds and inside the existing savepoint.

For current head ae670764a54d451103e72c2453c74ff3f95c198f:

  • Server Tests 33034622472: terminal success; unit/API job 98394537504 includes schedule reason collaboration notification regression passed, and cloud-e2e is success;
  • Dependency Review 33034622517: success;
  • OSV Scanner 33034622845: success.

The current hosted PR Server Tests checkout is synthetic merge revision 41141601b87b6799cca991080b06eaf4ae847406 (ae670764... merged into parent 22883d166...), not the immutable contributor head. It is strong product/regression evidence but is not treated as exact-contributor-head merge authorization. ScopeWeave #523 owns the repository-native exact-head checkout/coverage control repair; ContextualWisdomLab/.github#1222 owns the organization-reusable SAST/Security exact-head control path.

Scope fence / merge gate

Keep this PR Draft until the prerequisite stack reaches protected develop. Then reconcile only this bounded semantic delta onto the fresh integrated base and regenerate every applicable exact-head CI, browser E2E, owned statement/branch/function/line coverage, docstring, CodeQL/SAST/security, dependency/supply-chain, package/provenance, recovery, review, and thread-resolution gate. Valid unresolved findings must remain zero and a qualifying independent current-head approval must exist before merge or auto-merge. Synthetic, predecessor, stale, author-only, model-only, pending, skipped-required, cancelled, absent, neutral-required, failed, or status-only evidence is non-authorizing.

Refs #287

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae
seonghobae marked this pull request as ready for review August 26, 2026 23:00

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread server/app.mjs
Comment thread server/app.mjs
@seonghobae
seonghobae marked this pull request as draft August 27, 2026 01:50
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