Skip to content

fix(isms): production-deploy review follow-ups (CS-701)#3365

Merged
tofikwest merged 1 commit into
mainfrom
tofik/isms-versioning-review-fixes
Jul 7, 2026
Merged

fix(isms): production-deploy review follow-ups (CS-701)#3365
tofikwest merged 1 commit into
mainfrom
tofik/isms-versioning-review-fixes

Conversation

@tofikwest

@tofikwest tofikwest commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why

The main→release production-deploy PR (#3364) got an automated review that flagged 4 ISMS issues in the CS-701 versioning work (already merged to main). This PR fixes the real ones. Base is main (stage); it flows to release (production) on the next deploy.

What (each maps to a flagged issue)

  • P2 — hasApprovedVersion could report false for an approved doc. The migration intentionally drops legacy (pre-CS-701, snapshot-less) version rows but preserves the approved status, leaving currentVersionId null. hasApprovedVersion now checks currentVersionId != null || status === 'approved', so those docs stay consistent (they capture a real versioned artifact on their next approval). Locked with a unit test.
  • P3 — Scope form showed stale text after "Generate from platform data" / reload. ScopeForm reads its defaults at mount; its remount key tracked the published currentVersionId, which doesn't change when the draft does. The key now reflects draftNarrative, so the form re-seeds on draft changes. (LeadershipForm already handled this via a reset effect; ScopeForm's narrative is a fresh object each render, so keying is the clean equivalent.)
  • P3 — export DTO description was misleading. It said omitting versionId exports the working draft, but runtime serves the current published version when one exists. Description updated to match.
  • P3 — approval banner rendered v 2 instead of v2 (JSX split the v and the number). Now a single expression.

Not changed (by design)

The migration stays non-destructive (approvals preserved rather than reset to draft). The hasApprovedVersion fix makes that state self-consistent, so no destructive reset or heavy backfill is needed for pre-GA (flag-gated) data.

Testing

  • 319 API + 123 app ISMS tests passing, typecheck clean on both.

Follows up on #3361 (CS-701). Flagged in #3364.

🤖 Generated with Claude Code

https://claude.ai/code/session_012CweXoSSEP89mX93u3Bdcp


Summary by cubic

Fixes ISMS follow-ups from CS-701 versioning to keep approval state accurate and refresh scope text, plus minor UI/DTO copy corrections for a cleaner publish/export experience.

  • Bug Fixes
    • hasApprovedVersion now true when currentVersionId exists or status === 'approved' (covers pre-versioning approvals); adds unit test.
    • Scope form remounts when draftNarrative changes so generated/reloaded text appears immediately.
    • Export DTO description corrected: omitting versionId exports the current published version, or the draft if never published.
    • Approval banner now renders (v2) instead of v 2.

Written for commit c815b48. Summary will update on new commits.

Review in cubic

Addresses the ISMS issues cubic flagged on the main->release deploy PR (#3364):

- hasApprovedVersion is now status-aware (currentVersionId != null OR
  status === 'approved'), so a document approved before versioning existed — whose
  legacy version row the migration drops — still reports an approved version
  instead of flipping to false. (P2)
- ScopeForm re-seeds when the persisted draft content changes: its remount key now
  reflects draftNarrative, not just the published currentVersionId, so scope text
  refreshes after "Generate from platform data" / reload. (P3)
- export DTO description now matches runtime: omitting versionId exports the current
  published version (or the draft if never published), not always the draft. (P3)
- Approval banner renders "(v2)" instead of "v 2" (single JSX expression). (P3)

Migration is intentionally left non-destructive (approvals preserved); the
hasApprovedVersion fix makes that state self-consistent without a heavy backfill
for pre-GA data.

Tests: 319 api + 123 app ISMS tests passing; typecheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CweXoSSEP89mX93u3Bdcp
@linear

linear Bot commented Jul 7, 2026

Copy link
Copy Markdown

CS-701

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 7, 2026 7:44pm
comp-framework-editor Ready Ready Preview, Comment Jul 7, 2026 7:44pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped Jul 7, 2026 7:44pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest tofikwest merged commit d756d4a into main Jul 7, 2026
11 checks passed
@tofikwest tofikwest deleted the tofik/isms-versioning-review-fixes branch July 7, 2026 19:55
claudfuen pushed a commit that referenced this pull request Jul 7, 2026
# [3.99.0](v3.98.1...v3.99.0) (2026-07-07)

### Bug Fixes

* **integrations:** don't persist unverified GitHub installation_id ([#3370](#3370)) ([9c6f6fa](9c6f6fa))
* **isms:** lock before writing control links so edits serialize with approve ([#3369](#3369)) ([a21f866](a21f866))
* **isms:** production-deploy review follow-ups (CS-701) ([#3365](#3365)) ([d756d4a](d756d4a)), closes [#3364](#3364)
* **isms:** serialize approve against ALL register/content edits (central lock) ([#3367](#3367)) ([5c88a3d](5c88a3d))
* **isms:** serialize approve/decline to prevent concurrent double-publish (CS-701) ([#3366](#3366)) ([b158bc9](b158bc9)), closes [#3364](#3364)

### Features

* **integrations:** add read-only GitHub App integration (CS-710) ([#3363](#3363)) ([a5a9243](a5a9243))
* **isms:** document versioning and history (CS-701) ([#3361](#3361)) ([d95dc2e](d95dc2e))
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.99.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants