MCPcopy Create free account
hub / github.com/compozy/agh / ListTaskBlocks

Method ListTaskBlocks

internal/task/block_service.go:429–449  ·  view source on GitHub ↗

ListTaskBlocks returns task block rows after enforcing read authority and task existence.

(
	ctx context.Context,
	taskID string,
	includeCleared bool,
	actor ActorContext,
)

Source from the content-addressed store, hash-verified

427
428// ListTaskBlocks returns task block rows after enforcing read authority and task existence.
429func (m *Service) ListTaskBlocks(
430 ctx context.Context,
431 taskID string,
432 includeCleared bool,
433 actor ActorContext,
434) ([]TaskBlock, error) {
435 if err := requireReadAuthority(actor); err != nil {
436 return nil, err
437 }
438 normalizedTaskID := strings.TrimSpace(taskID)
439 if normalizedTaskID == "" {
440 return nil, fmt.Errorf("%w: task_block.task_id is required", ErrValidation)
441 }
442 if err := m.requireAgentSessionTaskLease(ctx, normalizedTaskID, actor); err != nil {
443 return nil, err
444 }
445 if _, err := m.store.GetTask(ctx, normalizedTaskID); err != nil {
446 return nil, err
447 }
448 return m.store.ListTaskBlocks(ctx, normalizedTaskID, includeCleared)
449}
450
451func (m *Service) taskBlockFromRequest(req BlockRequest, actor ActorContext) (TaskBlock, string, string, error) {
452 now := m.now().UTC()

Callers

nothing calls this directly

Calls 4

requireReadAuthorityFunction · 0.85
GetTaskMethod · 0.65
ListTaskBlocksMethod · 0.65

Tested by

no test coverage detected