graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Validated error accumulation (DeepSWE returns-validated-error-accumulation, distilled)
validated.py must expose Valid, Invalid, Validated (alias of the
union behavior via classmethods on either).
Valid(x)andInvalid(errors)whereInvalidstores errors as an immutable tuple.Invalid.from_failure(err)wraps a single error in a 1-tuple.bind(fn)short-circuits:InvalidstaysInvalid(fn not called);Validcallsfnand returns its Validated.apply(other)is applicative. TwoInvalids concatenate self then other, left to right.Valid+Invalid→ thatInvalid.Valid(f).apply(Valid(x))→Valid(f(x)).swap():Valid(x)→Invalid((x,));Invalid(errs)→Valid(errs).from_validated(v)returns the same instance.alt(fn)onInvalidmapsfnover each error; onValidis identity.__match_args__is("value",)for Valid and("errors",)for Invalid.combine(a, b, fn)applicative-combines two containers withfn(a,b).combine_n(items, fn)appliesfnto N inner values, accumulating every error if any item is Invalid.