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>
19 lines
403 B
Go
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")
|
|
}
|