Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions evidence/511-named-gate-diagnostics/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Issue #511: a named gate that fails before its command now says why

Every transcript here is captured output, redirected to the file by the command
it records. Each begins with the literal invocation and ends with its exit
status. The checkout is Linux x64; the reported incident was macOS arm64 and is
not reproduced by any of these runs.

Common preamble for every run: `RELAYFLOWD_BIN` is passed explicitly because
`npm run test:prep` exports it inside a subshell that never reaches vitest. The
literal value is
`/home/daytona/.relayflows-toolchain/target/2962130851/debug/relayflowd` —
the kernel target lives outside the tree because `ops/cargo.sh` redirects
`CARGO_TARGET_DIR`. Revisions: head `f308f95`, parent `e21caad`.

- `head-focused.txt` — the two new files at head: 22 passed, exit 0.
- `mutation-reverted.txt` — mutation verification, red half.
`git checkout e21caad -- src/named-gate-lowering.ts` reverts the only
production file; blob hashes before and after the revert are recorded against
`git rev-parse` of both revisions. Rebuilt, re-run: 13 failed, 9 passed.
The 9 are stream-capture cases that already passed before the change.
- `mutation-restored.txt` — green half. `git checkout HEAD --` restores;
`git hash-object` equals `git rev-parse HEAD:…`
(`8a4ac50391d95c95693eb20cdbc69869a5d02060`) and
`git status --porcelain` is empty, so the restore is byte-for-byte. Rebuilt,
re-run: 22 passed, exit 0.
- `head-package-test.txt` — the required package command, `npm test` from
`packages/sdk`: kernel build, typecheck, build, test typecheck, then vitest.
Complete output including every failure. `Test Files 3 failed | 155 passed |
1 skipped (159)`, `Tests 30 failed | 2393 passed | 17 skipped (2440)`,
exit 1. The package is not green in this sandbox.
- `head-isolated-three-files.txt` — the three failing files alone at head:
30 failed, 23 passed, 14 skipped.
- `baseline-in-place-e21caad.txt` — the same three files in the same working
directory with `packages/sdk` reverted to `e21caad`
(`git diff --stat e21caad -- packages/sdk` empty, the two added test files
removed). Identical result: 30 failed, 23 passed, 14 skipped, same cases,
same line numbers. This is the baseline behind the claim that those failures
are pre-existing; the revision is the only variable between it and
`head-isolated-three-files.txt`.
- `restore-identity.txt` — restoring the tree after that baseline.
`git status --porcelain -- packages/sdk` empty and all four changed blobs
hash-identical to `HEAD`.
- `unrelated-failure-cause.txt` — why 22 of those failures happen here: node
resolves `@relayflows/surface` to two different installs, one inside the
checkout and one in an ancestor directory of it
(`/home/daytona/.relayflow-v2-supervisor/durable/node_modules`), so the
handle the workflow creates is absent from the `WeakMap` the test's copy of
`getFlowDefinition` consults (`packages/surface/src/flow.ts:137-143`). A
sandbox layout defect, not a code one.
- `baseline-e21caad.txt` — the same three files at `e21caad` in a separate
`git worktree` under `/tmp` with `node_modules` symlinked. Reported for
completeness and **not** used as the baseline: only 1 failed there, because
`/tmp` has no ancestor `@relayflows` install, which changes the resolution
above. The worktree has since been removed. `baseline-in-place-e21caad.txt`
is the comparison that holds the environment fixed.

Not run: the Rust suite (no kernel code changed) and any Cloud runner-log
publication, whose producer does not exist in this repository. Nothing here
demonstrates the `flows logs <run-id>` acceptance item; `summary.md` records it
as unmet.
107 changes: 107 additions & 0 deletions evidence/511-named-gate-diagnostics/baseline-e21caad.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Baseline run at the parent revision e21caad, in a detached git worktree.
$ git -C /tmp/flows-baseline-e21caad rev-parse HEAD
e21caad1e4020d9e2675d2840301cb7eeb6f1aac
$ git -C /tmp/flows-baseline-e21caad status --porcelain
?? packages/sdk/node_modules
# node_modules is a symlink to the main checkout (npm install is not rerun):
$ ls -l /tmp/flows-baseline-e21caad/packages/sdk/node_modules
lrwxrwxrwx 1 daytona daytona 83 Sep 20 17:41 /tmp/flows-baseline-e21caad/packages/sdk/node_modules -> /home/daytona/.relayflow-v2-supervisor/durable/repository/packages/sdk/node_modules

$ RELAYFLOWD_BIN=/home/daytona/.relayflows-toolchain/target/2962130851/debug/relayflowd npm run build && npx vitest run tests/live-kernel.test.ts tests/stuck-run-triage.test.ts tests/authored-node-runtime.test.ts

> @relayflows/sdk@2.0.22 build
> tsc && node scripts/make-cli-executable.mjs


RUN v2.1.9 /tmp/flows-baseline-e21caad/packages/sdk

❯ tests/authored-node-runtime.test.ts (14 tests | 14 skipped) 19ms
stdout | tests/live-kernel.test.ts
LIVE_KERNEL relayflowd=/home/daytona/.relayflows-toolchain/target/2962130851/debug/relayflowd
LIVE_KERNEL flows=/tmp/flows-baseline-e21caad/packages/sdk/dist/cli.js

✓ tests/stuck-run-triage.test.ts (22 tests) 3143ms
✓ stuck-run-triage shell text > collects tails with no GNU timeout on PATH, as on a stock macOS 3084ms
stdout | tests/live-kernel.test.ts > built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI
LIVE_ANALYZER ready: claude -p --model claude-haiku-4-5-20251001 round-trip OK

stdout | tests/live-kernel.test.ts > surface resume after a real daemon kill > resumes a three-step run with each successful completion exactly once
LIVE_KERNEL kill -9 pid=80459 run=01M2ZYKSAN5HW6C58HHTTVPSA8 while step=two state=Running

❯ tests/live-kernel.test.ts (31 tests | 1 failed) 56356ms
✓ built flows CLI against live relayflowd > twenty-six-step reuses 25 durable completions after editing the failed final step 1953ms
✓ built flows CLI against live relayflowd > runs rung (a), parks rung (b), and keeps JSON report-shaped 2298ms
✓ built flows CLI against live relayflowd > allows a deterministic run to exceed the bounded request timeout 32442ms
✓ built flows CLI against live relayflowd > follows a live worker dispatch through flows run 567ms
✓ built flows CLI against live relayflowd > runs an agent CLI end to end through the SDK worker 472ms
✓ built flows CLI against live relayflowd > f.agent lowers to a real agent step and dispatches through a live worker 576ms
✓ built flows CLI against live relayflowd > can always get a parked run to a late-attaching worker 5577ms
✓ built flows CLI against live relayflowd > reports a real manual-recovery NeedsHuman state as parked 413ms
✓ built flows CLI against live relayflowd > runs hn-monitor analyze-story end-to-end via a stub agent CLI (gate 2 clause 2 demo) 418ms
✓ built flows CLI against live relayflowd > hn-monitor analyze-story FAILS verification when the CLI omits required schema fields 440ms
✓ built flows CLI against live relayflowd > agent step preserves the CliResult wrapper as output when the CLI emits non-JSON text 460ms
✓ built flows CLI against live relayflowd > AgentWorker exposes wake_context to the CLI via RELAYFLOW_WAKE_CONTEXT env var (real analyzer prerequisite) 527ms
✓ built flows CLI against live relayflowd > AgentWorker leaves RELAYFLOW_WAKE_CONTEXT UNSET when the run has no wake_context (undefined-vs-null pin) 534ms
✓ built flows CLI against live relayflowd > AgentWorker passes a declared model to an identified wrapper as RELAYFLOW_MODEL 634ms
✓ built flows CLI against live relayflowd > AgentWorker refuses a nonconforming journal-submitted wrapper before exposing RELAYFLOW_MODEL 470ms
✓ built flows CLI against live relayflowd > AgentWorker executes the raw claude adapter with its real model flag 432ms
✓ built flows CLI against live relayflowd > AgentWorker executes the raw codex adapter with its real model flag 479ms
✓ built flows CLI against live relayflowd > AgentWorker leaves RELAYFLOW_MODEL UNSET when the step declares no model 541ms
× built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI 3805ms
→ expected { …(3) } to match object { Object (gate, verdict) }
(1 matching property omitted from actual)
✓ built flows CLI against live relayflowd > preflights before journaling and names an unreachable socket 720ms
✓ built flows CLI against live relayflowd > starts exactly one daemon when two runs race for one empty data dir 431ms
✓ surface resume after a real daemon kill > resumes a three-step run with each successful completion exactly once 807ms
✓ a relayflow can be scheduled: tick source against live relayflowd > a tick spawns a real run whose step reports the SCHEDULED instant 627ms

⎯⎯⎯⎯⎯⎯ Failed Suites 1 ⎯⎯⎯⎯⎯⎯⎯

FAIL tests/authored-node-runtime.test.ts [ tests/authored-node-runtime.test.ts ]
AssertionError: expected '1.3.6' to be '1.4.0' // Object.is equality

Expected: "1.4.0"
Received: "1.3.6"

❯ tests/authored-node-runtime.test.ts:18:77
16|
17| beforeAll(() => {
18| expect(spawnSync(bun, ['--version'], { encoding: 'utf8' }).stdout.tr…
| ^
19| expect(existsSync(daemon), 'build the current kernel or set RELAYFLO…
20| stage = mkdtempSync(join(tmpdir(), 'authored-standalone-build-'));

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

FAIL tests/live-kernel.test.ts > built flows CLI against live relayflowd > hn-monitor analyze-story reaches done through the real Claude analyzer CLI
AssertionError: expected { …(3) } to match object { Object (gate, verdict) }
(1 matching property omitted from actual)

- Expected
+ Received

Object {
- "gate": "json_schema",
- "verdict": "pass",
+ "gate": "execution",
+ "verdict": "fail",
}

❯ tests/live-kernel.test.ts:1317:49
1315| // the promoted output, not the test re-deriving it: the spec is
1316| // the unmodified canonical one, so this record is the gate.
1317| expect(stepCompleted!.payload.verification).toMatchObject({
| ^
1318| gate: 'json_schema',
1319| verdict: 'pass',

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯

Test Files 2 failed | 1 passed (3)
Tests 1 failed | 52 passed | 14 skipped (67)
Start at 17:41:55
Duration 57.63s (transform 1.01s, setup 0ms, collect 2.40s, tests 59.52s, environment 0ms, prepare 114ms)

EXIT=1
Loading
Loading