cadet-agent 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/harness/state.mjs +15 -0
package/package.json
CHANGED
package/src/harness/state.mjs
CHANGED
|
@@ -129,8 +129,23 @@ export function validateState(state, context = {}) {
|
|
|
129
129
|
const workItemId = activeWorkItem
|
|
130
130
|
? `${activeWorkItem.epicId || 'none'}::${activeWorkItem.storyId || 'none'}`
|
|
131
131
|
: null;
|
|
132
|
+
|
|
133
|
+
// Gate exceptions are honoured here for the same reasons `evaluateTransition`
|
|
134
|
+
// honours them. Before this, a scoped exception could make a transition legal
|
|
135
|
+
// while `state validate` still reported the identical document as invalid, so
|
|
136
|
+
// the two official commands contradicted each other and a reader could not tell
|
|
137
|
+
// "correctly excepted" from "evidence broken". Exceptions are keyed on the
|
|
138
|
+
// ACTIVE work item, so they cannot excuse a different story's gates.
|
|
139
|
+
const exceptions = activeExceptions(state, { workItemId: workItemId || undefined });
|
|
140
|
+
|
|
132
141
|
for (const gate of GATES) {
|
|
133
142
|
if (state.gates[gate] !== true) continue;
|
|
143
|
+
|
|
144
|
+
// An excepted gate is intentionally not held to freshness or work-item
|
|
145
|
+
// ownership: that is precisely what the exception is for. It still must have
|
|
146
|
+
// been claimed true, which the loop condition above already guarantees.
|
|
147
|
+
if (exceptions[gate]) continue;
|
|
148
|
+
|
|
134
149
|
const evidence = latestEvidenceForGate(state, gate);
|
|
135
150
|
if (!evidence || (evidence.status !== 'passed' && evidence.status !== 'manual-confirmation')) {
|
|
136
151
|
errors.push({
|