INNER CODE UNIT · JavaScript
m
entropy-cloud/nop-entropy · tools/mission-driver/src/main.js:166
const m = clean.match(/<BRIEF_FILE>\s*([^\s<]+)\s*<\/BRIEF_FILE>/i);
return m && m[1] ? m[1].trim() : null;
}
/**
* Extract the brief gate decision from the mission-brief agent's output
* (draft-robustness-design §4.2.2 / WI2). The agent emits:
* <BRIEF_GATE>pass|blocked</BRIEF_GATE>
* <BRIEF_GATE_REASON>short reason (required for blocked)</BRIEF_GATE_REASON>
*
* Returns `{ gate, reason }`:
* - `gate` is `"pass"` | `"blocked"` (lower-cased) when the marker is present
* and valid; `null` otherwise (no marker → backward-compatible old brief).
* - `reason` is the inner text of `<BRIEF_GATE_REASON>` when present, else
* `null` (a missing reason tag does NOT raise — blocked-without-reason is
* still a valid blocked signal).
*
* Non-string inputs return `{ gate: null, reason: null }` so callers can pipe