Files
weichenandCursor f8b21ecd7c feat(app): add UnitOfWork and owner-bound repositories
Give each document command one postgres transaction and only let table owners unwrap the scope, so cross-owner writes can roll back together.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 13:54:27 +00:00

19 lines
403 B
Go

package taskrun
import (
"context"
"fmt"
"chat-agent-system/internal/app/uow"
)
// Repository is a M3 stub. M1 must not write task_runs through this port.
type Repository struct{}
func (Repository) ForbiddenInM1(ctx context.Context, scope uow.TxScope) error {
if _, err := uow.AsPG(scope); err != nil {
return err
}
return fmt.Errorf("taskrun: repository writes are not enabled until M3")
}