Repository navigation
Conversation
Publishing a shared AI schedule silently makes its project-private agent, skill, SOP and their dependencies visible to all projects (Tencent#1215). Add a read-only dry-run endpoint GET /api/schedule-jobs/:id/publish-preview that reports which assets would be newly shared (including the rules/skills a newly shared agent carries) and which references cannot be shared. The preview reuses the publish path's reference resolution, sharing checks and agent cascade rules, so the two cannot drift. It never writes: a test asserts no asset becomes shared and no version is created after previewing. Publishing behavior itself is unchanged; the dialog is a follow-up slice. Part of Tencent#1215; does not close the issue.
Robert0622
approved these changes
Nov 26, 2026
Robert0622
left a comment
Collaborator
There was a problem hiding this comment.
Code Review & Deploy Test: PASS ✅
Reviewed changes: New read-only GET /api/schedule-jobs/:id/publish-preview returns willShare and blocked without writing. Authorization matches the publish endpoint. Test confirms no writes occur.
Deploy test: Schedule endpoint responds with 200.
Minor notes (non-blocking):
- P3: Duplicate entries possible in
willSharewhen agent carries a skill also listed directly. - P3:
WillShare/Blockedtaggedomitempty, so empty preview returns{}with both keys missing. - P3: If anything in
blocked, nothing inwillSharewill actually be shared — worth documenting in the response.
loopforge-pr-review:d47f8bdbc7390fc55ede4d37f0cf668aa437eb7d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(schedule): preview shared-schedule publish side effects
This is the backend slice of #1215: let a user see what publishing a shared AI schedule would make public, before committing to it.
Problem
PublishSharedScheduleautomatically makes a job's project-private agent, skill, SOP and their dependencies visible to all projects. The publish dialog never said which assets were affected, so users clicked "publish" without knowing the side effects (#1215).Change
GET /api/schedule-jobs/:id/publish-previewreturning{willShare: [...], blocked: [...]}— the assets that would be newly shared (including the rules/skills a newly shared agent carries) and references that cannot be shared.internal/repo/shared_schedule_assets.go—PreviewSharedSchedulePublishreuses the publish path'sdirectScheduleReferences/sharedScheduleReferenceresolution, mirrorsShareAgentAssetscascade rules, and simulatesShared=trueto runValidateWorkflowAgentScopes/ValidateWorkflowSharingfor SOPs — all without writing anything.internal/domain/shared_schedule.go— preview result types.internal/httpapi/shared_schedules.go/server.go— handler with the same authorization/admission as the publish endpoint, plus route.Publishing behavior itself is unchanged; the dialog that consumes this endpoint is a follow-up slice.
Verification (Linux/amd64, Docker
python:3.12)go veton domain/repo/httpapi: clean.-count=3.gofmtandcheck-public.pypass.Scope / notes
willSharestays complete. This is a future follow-up, not a current blocker.Related
Part of #1215; does not close the issue.