Repository navigation
Description
[Docs / DX] Clarify the expected type of acceptance.requiredEvidence
Description
The Workflow API rejects an agent() call when
acceptance.criteria[].requiredEvidence is passed as a string instead of an
array of strings.
The implementation appears to enforce the intended contract correctly, but the
public Workflow documentation only shows requiredEvidence? without explaining
its type or providing a complete example. Since description is a prose field,
it is easy to assume that requiredEvidence also accepts a prose explanation.
This issue proposes a documentation improvement and a focused regression test.
It does not propose changing the acceptance semantics.
Minimal reproduction
await agent("Review the requested change.", {
agent_type: "reviewer",
schema: {
type: "object",
properties: {
summary: { type: "string" },
},
required: ["summary"],
},
acceptance: {
criteria: [
{
id: "tests",
description: "The relevant tests pass.",
requiredEvidence: "test-command", // Invalid
},
],
},
});The call fails before the child agent starts with an error similar to:
acceptance criterion "tests" requiredEvidence must be an array of at most 16 labels
The valid form is an array of concise labels:
requiredEvidence: ["test-command"]The child should return the matching label in its acceptance ledger:
{
"acceptance": {
"criteria": [
{
"id": "tests",
"status": "accepted",
"evidence": ["test-command"]
}
]
}
}Expected behavior
The documentation should clearly state that:
descriptionis a human-readable requirement;requiredEvidenceis an optional array of concise string labels;- each label must be a non-empty string;
- the child must return matching labels in
acceptance.criteria[].evidence; - evidence labels are compared exactly.
For malformed input, the current rejection behavior is reasonable. A clearer
example in the error message would be a useful optional improvement, but is not
required to fix the underlying documentation gap.
Source investigation
Type contract
extensions/workflows/acceptance.ts defines the field as:
readonly requiredEvidence?: readonly string[];Runtime validation
parseAcceptanceContract() in extensions/workflows/acceptance.ts requires
requiredEvidence to be an array with no more than 16 entries and validates each
entry as a string label.
Validation timing
The Workflow implementation calls parseAcceptanceContract() in
extensions/workflows/index.ts before the child execution is scheduled. An
invalid contract therefore produces an invocation failure during admission; it
is not a failure from the child agent or from the repository being inspected.
Evidence matching
evaluateAcceptance() in extensions/workflows/acceptance.ts checks required
labels with exact membership matching against the returned evidence array.
Existing test coverage
The acceptance tests already cover valid evidence arrays and several ledger
outcomes in tests/extensions/workflows/acceptance.test.ts, but do not appear
to include a direct regression case for passing a scalar string as
requiredEvidence.
Root cause classification
Confirmed caller mistake
A scalar string is not a valid value for requiredEvidence:
requiredEvidence: "test-command"The caller should use:
requiredEvidence: ["test-command"]or move the prose into description.
Confirmed documentation / developer-experience gap
The public documentation should show the field's type and explain the
relationship between the contract's required labels and the result ledger's
evidence labels. The current short notation does not make this distinction
clear enough:
acceptance: { criteria: [{ id, description, requiredEvidence? }] }
Not confirmed as a runtime bug
The following behavior is consistent with the current source contract and is
not being reported as incorrect:
- rejecting malformed acceptance configuration;
- rejecting the invocation before child execution;
- requiring exact evidence labels;
- returning a failed result when acceptance requirements are not met.
Suggested changes
Documentation
Add a complete example to the Workflow reference and README:
acceptance: {
criteria: [
{
id: "tests",
description: "Focused tests pass.",
requiredEvidence: ["test-command"],
},
],
}Document the current limits enforced by the implementation:
- 1–32 acceptance criteria;
- at most 16 required evidence labels per criterion;
- at most 120 characters per label.
Also document that the child result must contain the exact required labels in
acceptance.criteria[].evidence.
Regression test
Add a focused test to tests/extensions/workflows/acceptance.test.ts:
assert.throws(
() =>
parseAcceptanceContract({
criteria: [
{
id: "tests",
description: "Focused tests pass.",
requiredEvidence: "test-command",
},
],
}),
/requiredEvidence must be an array/,
);Acceptance criteria
- Workflow documentation describes
requiredEvidenceas an array of
strings. - Documentation includes a valid
agent()acceptance example. - Documentation distinguishes
descriptionfrom evidence labels. - Documentation states that returned evidence labels are matched exactly.
- A regression test covers scalar-string input.
- Existing acceptance semantics remain unchanged.
Relevant source files
extensions/workflows/acceptance.tsextensions/workflows/index.tstests/extensions/workflows/acceptance.test.tsskills/workflows/REFERENCE.mdREADME.md
Activity
hasak21 commentedon Aug 28, 2026
Hi! I'd like to work on this issue. I plan to clarify the requiredEvidence array type and limits in the Workflow reference/README, and add regression test coverage for scalar strings in acceptance.test.ts.
docs(workflows): clarify acceptance requiredEvidence type, limits, an…
docs(workflows): clarify acceptance requiredEvidence type, limits, an…
docs(workflows): clarify acceptance requiredEvidence type, limits, an…