Files
Agent-System-Backend/internal/projectcontext/workflow_step.go
T
weichen 7a00b20cd4 Bind workflow judge inputs to trusted step attempts
Why: Compiled workflow critics could resend a prior prompt output after document duty or publication changed across separate model guards.

Evidence: RED cross-guard revocation and retry tests; go test ./... -count=1 and targeted go test -race passed locally before commit.

Impact: Bind materialized prompt bytes to the engine step attempt and responded model receipt; recheck current project sources and epochs before judging, failing closed for unproven or ambiguous output.

Refs: RDM two-trees stage5 W6; stage6 X1 public extension request; W6 independent review P1.
2026-10-14 04:55:14 +00:00

17 lines
524 B
Go

package projectcontext
import "context"
type workflowStepAttemptKey struct{}
// WithWorkflowStepAttempt is used by the trusted squad executor adapter. The
// value comes from the engine's persisted step attempt, never from model text.
func WithWorkflowStepAttempt(ctx context.Context, attemptID string) context.Context {
return context.WithValue(ctx, workflowStepAttemptKey{}, attemptID)
}
func WorkflowStepAttempt(ctx context.Context) string {
value, _ := ctx.Value(workflowStepAttemptKey{}).(string)
return value
}