Repository navigation
fix(workflow): a step that concludes blocked: fails the run - #118
Conversation
An agent step that exited 0 with a `blocked:` conclusion (for example factory-mission --plan refusing on the dependency gate) completed, so the next gate paused with nothing to approve and an approval started execute on a refused mission (adlc-workspace#167, run fa82c68a). The engine now fails such a step with the conclusion as the error, before any question payload is read. The run ends failed without fast_failure, so `workflow run` exits 10 and the lane does not retry. Other conclusions keep today's behaviour. Refs adlc-workspace#167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct blocked errors Security review of the blocked-conclusion change: a blocked step keeps its merged agent output, so an agent-written "aborted" string would have turned the failure into an abort (exit 1, retried). The engine now compares `aborted === true`, which only the gate sets. The blocked error is passed through redactSecrets with the agent's env and kept on one line. Refs adlc-workspace#167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed
Full suite: 1107 of 1111 pass, with the same 4 target-branch failures as on |
itaior
left a comment
There was a problem hiding this comment.
factory-review verdict: NOT merge-ready (1 Important open)
Reviewed revision: head 7835b7b / base ac4810c / merge-base ac4810c, detached checkout, all REVIEW.md passes (bugs, security, spec-compliance, quality) via adversarial trio (Auditor / Adversary / Pragmatist) + cross-examination. CI on this head: all green (9 jobs pass). No prior verdict exists on this PR.
Checked: blocked-regex true/false cases · output merged on failure path · blocked-before-question ordering · .aborted reader sweep (both engine sites strict; only writer is gate.mjs:323) · stdout never parsed · redactSecrets pattern/env coverage · no .github/ changes · no existing test touched.
Not checked: the "4 target-branch failures are pre-existing on main" claim (trust-based; falsifiable — run those 4 tests on clean main).
🔴 Important (blocks merge)
F2 — a valid blocked: refusal is silently discarded when any sibling output field is invalid → the exact #167 failure recurs. src/workflow/steps/agent.mjs:205 merges readStepOutput(...) all-or-nothing (:422-430: one non-string value, >16 fields, or a >2048-char value rejects the whole object to {}), and the blocked check at :212 reads the post-validation object. Reproduced live on this head: {"conclusion": "blocked: dependency-gate on #164 (open)", "elapsed": 12} (plausible agent sloppiness) → step COMPLETES, run PAUSES at gate-spec with nothing to approve — the bug this PR fixes. Same for a conclusion longer than 2048 chars. Required correction: make the refusal fail-closed (e.g. sniff blocked: from the raw file before validation, or per-field filtering that preserves a valid conclusion), plus a B1-adjacent test with a poisoned sibling field. Note this also narrows B5's meaning: a boolean aborted: true can never arrive via the file today (string-only validation drops it first), which is why B5 uses "aborted": "true".
💬 Advisory (non-blocking)
- N1: Leading U+200B (zero-width space) evades
/^\s*blocked:/i(agent.mjs:212) — a visual refusal that doesn't fail. No privilege gained; cooperating agents won't do this. Consider stripping format chars before testing. - N2 (test gap for F2): no B-series test covers
blocked:+ poisoned sibling; add one with the fix. - N3:
tests/workflow-blocked-conclusion.test.mjs:201—assert.notEqual(failed.status, "aborted")passes vacuously ifstatusis ever omitted; preferassert.equal(failed.status, "failed"). The real weight is on:197(r.status === 10). - N4: The error is redacted but the raw
conclusionpersists unredacted instate.jsonstep results (B-series pinsplan.output.conclusion == BLOCKEDat:150). Pushed refs are scrubbed (refs.mjs:133); localstate.jsonis trusted-local — document that or scrub too. - N5: Newline-split credentials evade pattern + exact-match redaction (pre-existing redactor property, not a regression); the control-collapse runs after redaction and doesn't re-join.
- N6 (latent):
profile.envVarsis in the agent's env (run.mjs:47-56) but not in the redact call's env (agent.mjs:217). Sole in-tree entry is non-secret (GOOSE_MODE), so zero impact today. - N7: C1 controls U+0080–U+009F survive the collapse, unlike the repo's own
gate-payload.mjs:26/ui/ansi.mjssanitizers. ESC (0x1b) is covered, so ANSI injection is neutralized; consistency fix only. - N8: Bidi/zero-width chars survive — visual log spoofing possible, but one-lining + JSON escaping already prevent framing forgery. Social-engineering only.
- N9: README (
:285-293) says "fails the step with that text as the error" but after7835b7bit is redacted + one-lined, and omits the documented leading-whitespace/case tolerance. One clause fixes the drift. - N10: The pre-existing question-budget error (
agent.mjs:230) starts with literalblocked:— now a second human-visibleblocked:string with a different meaning. No behavior interaction (nothing matches on error text), but consider rewording to avoid future confusion.
Label set to validation: the PR stays in the lifecycle stage until F2 is resolved. Re-review required on any new head before merge-readiness can be declared.
…il closed) factory-review F2 on #118: step output merges all-or-nothing, so a `blocked:` conclusion next to one invalid sibling field (a number, a reserved key, >16 fields, a >2048-char value) or in a file that does not parse was dropped, the step completed, and the run paused at the spec gate with nothing to approve, the #167 failure again. The refusal is now read from the raw file before validation. Also: invisible format characters (U+200B, U+FEFF) before the prefix no longer hide it; C1 controls are collapsed in the error; the CLI test asserts run_failed status "failed"; the README says what the error holds. Refs adlc-workspace#167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Response to the factory-review verdict on 🔴 F2: fixedThe refusal is now read from the raw
The step's merged output still follows the old rules. Only the fail/complete decision comes from the raw file, so it now fails closed. The new B7 tests reproduced F2 before the fix and pass now. Each one runs a blocked conclusion with a non-string sibling ( 💬 Advisory
On "Not checked": I ran those 4 target-branch tests on a clean Full |
Security review of 6b38ebf: - the conclusion is redacted in full, then collapsed and capped, so a secret across the 2048-character cut is never half-kept; - in a file that does not parse, every "conclusion" string is decoded (valid escapes one by one) before the prefix check and redaction, so glpat-... is redacted as glpat-..., and a blocked conclusion after another one still counts. An unreadable or oversized file keeps today's outcome unless a readable, bounded part of it says blocked:, so a run that never refused is unchanged. Refs adlc-workspace#167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed
|
itaior
left a comment
There was a problem hiding this comment.
factory-review verdict: MERGE-READY (0 Important open)
Reviewed revision: head a93d2c9 / base ac4810c / merge-base ac4810c, detached checkout at exact head, all REVIEW.md passes (bugs, security, spec-compliance, test-integrity, ci-integrity, quality) via adversarial trio (Auditor / Adversary / Pragmatist) + cross-examination. This re-review was required: the iter-0 verdict on 7835b7b named a superseded head (pushes 6b38ebf, a93d2c9 followed). F2 from iter-0 is fixed and verified below.
Prior verdict delta: F2 (valid blocked: discarded on poisoned sibling) is resolved — refusal is now read from the raw file via readBlockedConclusion before validation (fail closed), with B7 tests reproducing each poisoned case. Redact-then-cap order fixed (B9), fallback decodes escapes and checks every match (B9), Cf-tolerant prefix (B8). All 23 B-tests pass locally; CI on this head is 11/11 green.
Checked: blocked-prefix true/false cases incl. Cf chars · fail-closed on all 5 B7 poison shapes · blocked-before-question ordering (code + B4) · output merged on failure path · fast_failure never set on blocked path · exit-10 mapping · redact-whole-then-cap order · tolerant decode edge cases (trailing backslash, partial \u, double-escape) · .aborted reader sweep (both engine sites strict === true, sole writer gate.mjs:323 boolean) · stdout never parsed · no .github/ changes in PR diff · no existing test touched (tests diff is one new file, +285/−0).
Not checked: full-suite "1115 of 1119" claim (trust-based; CI green corroborates) · author's clean-main reproduction of the 4 target-branch failures (claim is falsifiable as stated: ac4810c worktree, 115 run / 111 pass, same 4 fail).
💬 Advisory (non-blocking)
- N1 (tag=disputed): valid-JSON wrong-shape file misses a refusal.
src/workflow/steps/agent.mjs:289-294—[{"conclusion":"blocked: x"}],{"data":{"conclusion":"blocked: x"}}, or{"conclusion":["blocked: x"]}parse successfully, push no candidate, and the raw scan only runs in thecatchbranch, so the step COMPLETES. Adjudicated Nit (Auditor challenge upheld): no documented contract shape is an array/nesting, and an agent trying to evade would simply write a non-blocked:conclusion — but the README's "counts even when the rest of the file breaks the rules" promise reads broader than the implementation. Suggestion: also run theCONCLUSION_IN_RAWscan when parsing yields no candidate (union, then prefix-match). Trivial, zero-risk hardening. - N2 (tag=disputed): refusal past the 64 KiB head slice is missed.
agent.mjs:288— only the first 64 KiB is scanned; ~64 KiB of prefix junk pushes a refusal out of the window whilereadStepOutputrejects the same file as too large. Adjudicated Nit: requires a pathological file no honest agent writes. Suggestion: scan a tail window too, or document the bound as fail-open-by-design. - N3 (tag=solo):
profile.envVarssecrets never reach any redactor.agent.mjs:221redacts with{...process.env, ...runEnv}, but the agent child env isprocess.env + profile.envVars + runEnv(run.mjs:47-56) —runContextEnvcarries no profile vars, so the exact-value leg misses profile-only secrets echoed in a conclusion. Same gap inredactRunDir/redactDeepdefaults. Latent today (sole in-tree entry is non-secretGOOSE_MODE; pattern/userinfo redaction still applies), same class as iter-0 N6 which the author deferred. Suggestion: follow-up issue threading the agent's full env into the redact calls, incl.shell.mjs:127-128which drops even the step's ownenv:secrets. - N4 (tag=disputed): shell step merges
conclusionbut ignoresblocked:.shell.mjs:119-123— same file lifecycle, same merged key, opposite outcome vs agent steps. Adjudicated Nit (Auditor challenge upheld): the #167 contract and every commit message scope this to agent (command/prompt) steps, and shell has no refusal convention — but the merged-but-inert key will mislead future readers. Suggestion: one README clause statingblocked:is agent-only, or share the helper (it already imports fromagent.mjs). - N5 (tag=solo): inner/trailing Cf/bidi controls survive in the error.
agent.mjs:221,300— only leading[\s\p{Cf}]is stripped; U+202E, U+2066–U+2069, U+200B etc. persist intostate.error→ log →run_failed→ notifier rendering (ESC/ANSI is dead — 0x1B is stripped — so this is bidi-spoofing/social-engineering only, same class as iter-0 N8). Suggestion: strip\p{Cf}everywhere in the error, not just leading. - N6 (tag=solo): question-budget error squats the
blocked:namespace.agent.mjs:234— operator-owned guard error shares the now agent-controlled prefix. No consumer matches on error text today (verified by grep), so no behavior impact; triage-confusion only. Same as iter-0 N10, kept for consistency. - N7 (tag=solo):
CONCLUSION_IN_RAWcomment omits truncation-tolerance.agent.mjs:265-267— the missing closing-quote anchor is load-bearing (matches secrets split by the 64 KiB cut, per B9); one word would save the next reader a re-derivation. Optional.
No finding above blocks merge-readiness per REVIEW.md severity weights. Prior iter-0 advisories N1–N10: N1, N2, N3, N7, N9 fixed at 6b38ebf; N4–N6, N8, N10 intentionally left as-is by the author (documented in thread) and carried above where still applicable (N3, N5, N6).
Label stays validation: automated validation passed; a human code-owner's explicit approval is still required — this verdict never approves and never merges.
#118 (a step that concludes blocked: ends the run; adlc-workspace#167) is on main, so the v2.15.1 tag ships it; list it in the 2.15.1 section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs https://gitlab.tikalk.dev/tikalk/engineering/agentic-sdlc/adlc-workspace/-/issues/167
Why
On 2026-11-22, a #151 re-send ran as run
fa82c68a(adlc-cli 2.15.0):plan(factory-mission --plan) hit the dependency hard gate because #164 was still open. It posted its refusal, set the issue back tospec-gated, wrote{"conclusion":"blocked: dependency-gate on #164 (open)"}, and exited 0.gate-specpaused with "(no agent payload)" and nothing to approve.executeon a mission that had already been refused, and the run had to be terminated by hand.factory-missionusesblocked:only for final refusals: the dependency gate, a run with no issue, a refused pause publish, a run that ends without an MR, and the record-capture halt. Nothing in a skill can choose the agent's exit code, so the engine has to treat this conclusion as the end of the run.What changes
In
src/workflow/steps/agent.mjs, after an agent step exits 0 and its output is merged:conclusionstarts withblocked:(any case, after leading spaces), the step fails with that conclusion as the error. The output is still merged, so the error and the conclusion show up in the run.fast_failure. The run endsfailed,workflow runexits 10, and the Argo lane'sretryStrategydoes not retry 10. The result is one pod, no gate post and noexecute.blocked:later on, behaves as before.The README gains a short note in the step-output section.
Tests
tests/workflow-blocked-conclusion.test.mjswith 10 tests, all in the lane's shapeplan→gate-spec→execute:executenever runs and the gate never pauses. Case and leading-space variants count too.fast_failure,classifyWorkflowStatusgives 10, andadlc-cli workflow runexits 10 withrun_failedthat is notaborted.blocked:later, no conclusion, or no output file all still pause at the gate.fa82c68aexactly:plancompleted, thengate-specpaused, exit 3.npm test: 1105 of 1109 pass. The 4 failures are the target-branch testsTB1×2,TB3, and "no target branch on a single-branch clone", and they fail the same way on a cleanmaincheckout here.Rollout
This needs a release (2.16.0). Then the agentic-container
ADLC_CLI_SPECpin, then the runner image, then the tikal-infrastructure overlay. After that comes a drill: an issue with an open dependency should give one pod, no gate post and onedependency-gatenote.🤖 Generated with Claude Code