// pm_access.go 定义编排器对 project (PM) 模块的窄读写接口。app 层用 project 的 // Repository / RequirementService 适配,避免在 orchestrator 内直接耦合 project 的 // Caller/Service 全貌。 package orchestrator import ( "context" "github.com/google/uuid" "github.com/yan1h/agent-coding-workflow/internal/project" ) // PMAccess 是编排器驱动阶段所需的 project 读写能力。 type PMAccess interface { // GetProjectByID / GetProjectBySlug 解析项目(slug 用于 ChangePhase / Create 入参)。 GetProjectByID(ctx context.Context, id uuid.UUID) (*project.Project, error) GetProjectBySlug(ctx context.Context, slug string) (*project.Project, error) // GetRequirementByID / GetRequirementByNumber 解析需求(号用于 ChangePhase / session 绑定)。 GetRequirementByID(ctx context.Context, id uuid.UUID) (*project.Requirement, error) GetRequirementByNumber(ctx context.Context, projectID uuid.UUID, number int) (*project.Requirement, error) // ListLatestArtifacts 返回某需求各阶段最新产物(供 BuildPrompt 注入上下文)。 ListLatestArtifacts(ctx context.Context, requirementID uuid.UUID) ([]*project.Artifact, error) // ChangeRequirementPhase 以 owner 身份推进需求阶段(编排器特权身份调用)。 ChangeRequirementPhase(ctx context.Context, ownerID uuid.UUID, isAdmin bool, projectSlug string, number int, to project.Phase) error }