Skip to content

[dev] [Marfuen] mariano/fix-primitive-create-no-auto-link#2686

Merged
Marfuen merged 2 commits intomainfrom
mariano/fix-primitive-create-no-auto-link
Apr 28, 2026
Merged

[dev] [Marfuen] mariano/fix-primitive-create-no-auto-link#2686
Marfuen merged 2 commits intomainfrom
mariano/fix-primitive-create-no-auto-link

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 28, 2026

This is an automated pull request to merge mariano/fix-primitive-create-no-auto-link into dev.
It was created by the [Auto Pull Request] action.


Summary by cubic

Stop auto-linking new task and policy templates to every control in a framework. New templates are created unlinked; linking happens later via the dedicated endpoints.

  • Bug Fixes
    • Removed frameworkId from task/policy create controllers and services; deleted control lookup/connect logic.
    • Updated UI (CreatePolicyDialog, useTaskChangeTracking) to stop appending ?frameworkId=... on POST.
    • Added regression tests to ensure no control queries/links occur even if a stray frameworkId is provided.
    • Ensured sensible defaults: tasks default to frequency: monthly and department: none; policies persist an empty content object.

Written for commit bb03f8e. Summary will update on new commits. Review in cubic

…ll framework controls

When CX created a new task or policy template from a framework's editor
view, the create endpoint queried every control template attached to
that framework and connected the new primitive to all of them. CX
rarely wants the new template on every control — it forced manual
cleanup after every create.

Make all primitives consistent: a fresh create produces an unlinked row
regardless of which framework page the user happened to be on. Linking
to specific controls happens explicitly via the dedicated link
endpoints (POST /:id/control-templates/:ctId), which already existed.

  - task-template.service.ts: drop frameworkId param + the findMany
    + connect logic
  - policy-template.service.ts: same
  - task-template.controller.ts, policy-template.controller.ts: drop
    the @query('frameworkId') from the POST handler
  - frontend (useTaskChangeTracking, CreatePolicyDialog): stop appending
    ?frameworkId=... to the POST URL

Control template and requirement creates were already correct (no
auto-linking) — this brings task and policy templates in line.

New regression tests on TaskTemplateService and PolicyTemplateService
mirror the existing CS-271 guard on ControlTemplateService: even if a
stray frameworkId is passed, the service must not query for or attach
controls. Verified red without the fix, green with it.

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

vercel Bot commented Apr 28, 2026

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

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment Apr 28, 2026 6:36pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Apr 28, 2026 6:36pm
portal Skipped Skipped Apr 28, 2026 6:36pm

Request Review

@vercel vercel Bot temporarily deployed to Preview – app April 28, 2026 18:34 Inactive
@vercel vercel Bot temporarily deployed to Preview – portal April 28, 2026 18:34 Inactive
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 9 files

Requires human review: Modifies API signatures and core business logic regarding entity relationships during creation, which may impact downstream workflows and requires human verification.

@Marfuen Marfuen merged commit b58c4d3 into main Apr 28, 2026
11 checks passed
@Marfuen Marfuen deleted the mariano/fix-primitive-create-no-auto-link branch April 28, 2026 18:36
claudfuen pushed a commit that referenced this pull request Apr 28, 2026
## [3.34.1](v3.34.0...v3.34.1) (2026-04-28)

### Bug Fixes

* fix-sync-requirement-map-drift ([a10ecc3](a10ecc3))
* **framework-editor:** don't auto-link new task/policy templates to all framework controls ([#2686](#2686)) ([b58c4d3](b58c4d3))
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.34.1 🎉

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants