Skip to content

feat: add defensible durability eval foundation - #566

Merged
khaliqgant merged 8 commits into
mainfrom
evals/defensible-metrics-foundation
Sep 24, 2026
Merged

khaliqgant merged 8 commits into
mainfrom
evals/defensible-metrics-foundation

Conversation

@kjgbot

@kjgbot kjgbot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Adds a fail-closed, reproducible evidence foundation for Relayflows durability claims:

  • seven durability cases repeated 30 times each;
  • one independent Node black-box case that uses public CLI receipts, kills the resumed daemon and in-flight child process, and verifies replacement of unfinished work without replaying completed work;
  • six real Rust crash/resume cases covering deterministic, llm, agent, channel, concurrency, and memory behavior;
  • pinned source, suite, runtime, host, argv, working directory, allowlisted environment, literal stdout/stderr, and success witnesses;
  • a vendor-neutral protocol naming the participants required for build-vs-buy and best-in-class claims.

This PR does not claim competitive superiority. Relayflows versus DIY requires both adapters under the shared protocol; best-in-class additionally requires Temporal and Inngest.

Independent review repairs

The first review correctly rejected the original head. The current head now:

  • requires explicit output witnesses, so Cargo zero-test exits are invalid;
  • uses ops/cargo.sh instead of ambient Cargo;
  • directly tests clean, dirty, and unavailable provenance paths;
  • confines case working directories to the recorded repository root;
  • distinguishes failed, timed-out, invalid, and inconclusive trials;
  • treats command timeouts as product failures and publication blockers;
  • exits nonzero for every nonpublishable report;
  • requires report output outside the source tree;
  • reports p95 only at 20 or more passing samples;
  • validates nonempty competitive success predicates;
  • records only an explicit non-secret environment allowlist plus case-owned values;
  • forces color-free Cargo output so literal witnesses are stable;
  • cleans up detached daemon and step processes on every failure path;
  • parses the last valid CLI receipt even if diagnostics precede it;
  • uses a fixed, named 16-assertion black-box witness;
  • obtains the run ID from the public CLI receipt rather than journal storage;
  • splits the runner into small CLI, suite, and provenance modules;
  • rejects empty implementation attribution and missing toolchain provenance;
  • classifies executable launch failures as environmental, never product failures;
  • canonicalizes suite and working directories so symlinks cannot escape the recorded root;
  • skips the symlink regression case only when the host denies symlink creation.

The remaining CI-wiring work is deliberately separate because AGENTS.md forbids changing a gate that judges the same work. It is tracked in #569.

Verification at exact head

Exact head: 3f50d89c39dfe67c196138feb401987d0e79cdcd

Command:

node --test scripts/run-evals.test.mjs scripts/benchmark-protocol.test.mjs

Captured output:

1..21
# tests 21
# suites 0
# pass 21
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 53.737875

Command:

set -e
for trial in {1..30}; do
  output=$(node benchmarks/durability/black-box-crash.mjs)
  [[ "$output" == *"BLACK_BOX_ASSERTIONS: 16/16"* ]]
  echo "trial $trial: 16/16"
done

Captured output:

trial 1: 16/16
trial 2: 16/16
trial 3: 16/16
trial 4: 16/16
trial 5: 16/16
trial 6: 16/16
trial 7: 16/16
trial 8: 16/16
trial 9: 16/16
trial 10: 16/16
trial 11: 16/16
trial 12: 16/16
trial 13: 16/16
trial 14: 16/16
trial 15: 16/16
trial 16: 16/16
trial 17: 16/16
trial 18: 16/16
trial 19: 16/16
trial 20: 16/16
trial 21: 16/16
trial 22: 16/16
trial 23: 16/16
trial 24: 16/16
trial 25: 16/16
trial 26: 16/16
trial 27: 16/16
trial 28: 16/16
trial 29: 16/16
trial 30: 16/16

Command:

node scripts/run-evals.mjs --suite benchmarks/durability/suite.json --output /tmp/relayflows-durability-3f50d89c.json

Captured output:

relayflows-durability-v1: 210/210 trials passed; publication eligible

Report summary:

{
  "commit": "3f50d89c39dfe67c196138feb401987d0e79cdcd",
  "dirty": false,
  "suiteSha256": "d2972d947660474fba65a1a3f8e6d743379eb37d4025ad3bdadb24d82829918c",
  "passedTrials": 210,
  "failedTrials": 0,
  "timedOutTrials": 0,
  "invalidTrials": 0,
  "inconclusiveTrials": 0,
  "publicationStatus": "eligible",
  "blockers": []
}

Per-case pass counts:

black-box-cli-sigkill-resume       30/30
deterministic-boundary-resume     30/30
llm-result-memoization             30/30
agent-effect-exactly-once          30/30
durable-channel-redelivery         30/30
concurrent-resume-single-lease     30/30
memory-budget-once                 30/30

Negative evidence retained

The allowlist change initially omitted the active Rust toolchain selectors. The clean run failed closed instead of publishing:

Command:

node scripts/run-evals.mjs --suite benchmarks/durability/suite.json --output /tmp/relayflows-durability-7304d1ce.json

Captured output:

relayflows-durability-v1: 0/210 trials passed; publication ineligible

That artifact records 180 failures and 30 inconclusive trials caused by missing Rust toolchain selection. The final head explicitly allows and records CARGO_HOME, CARGO_TARGET_DIR, RUSTUP_HOME, and RUSTUP_TOOLCHAIN, then passed at a new exact commit.

An earlier black-box workload also produced 207/210 and was correctly ineligible. It killed the daemon when a shell effect appeared without proving the step completion was durable, and on three trials observed the expected replay of uncommitted work. The corrected workload first obtains a CLI receipt after one durable completion, resumes, waits for the dependent step to be in flight, then kills the whole execution environment. The README records this boundary explicitly.


Note

Low Risk
Adds benchmark harnesses, Node scripts, and JSON fixtures only; no changes to relayflowd runtime or production gates.

Overview
Introduces a fail-closed durability evidence pipeline and separates product conformance from future competitive benchmarking.

Durability eval: scripts/run-evals.mjs drives benchmarks/durability/suite.json (30 repetitions × 7 cases). Reports pin git commit, suite hash, toolchain/host provenance, per-trial argv/cwd/allowlisted env, and full stdout/stderr. Publication is eligible only on a clean tree, sufficient repetitions, Rust/Cargo provenance, all trials passing with required success witnesses (so zero-test Cargo exits count as invalid), and no timeouts/failures/inconclusive environment outcomes. Output must live outside the repo; non-publishable runs exit nonzero.

Black-box case: benchmarks/durability/black-box-crash.mjs exercises public CLI run/resume receipts, SIGKILLs the resumed daemon and in-flight step child, then asserts 16 fixed outcomes (no journal inspection).

Competitive protocol: benchmarks/workflow-reliability/protocol.json defines vendor-neutral scenarios, metrics, and which participants are required for build-vs-buy vs best-in-class claims—without implementing adapters yet. scripts/benchmark-protocol.test.mjs guards protocol shape.

Tests: Extensive scripts/run-evals.test.mjs covers trial classification, symlink/cwd containment, env allowlisting, and black-box helpers.

Reviewed by Cursor Bugbot for commit 3f50d89. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0583a992-78b9-419d-82d7-ea92f96557ff


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread scripts/run-evals.mjs Outdated
const durationMs = Math.round((performance.now() - before) * 1000) / 1000;
trials.push({
repetition,
passed: result.status === 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty cargo runs count as passes

High Severity

A trial is marked passed solely when the child exits 0. cargo test still exits 0 when --exact matches no tests, so a renamed or missing case can produce a publication-eligible durability artifact without exercising the claim.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 35106b7. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread scripts/run-evals.mjs Outdated
Comment thread scripts/benchmark-protocol.test.mjs
Comment thread scripts/run-evals.mjs
Comment thread scripts/run-evals.mjs Outdated
@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

maintainability lens — FAIL

PR #566 — maintainability review

Blocker

collectProvenance is load-bearing for publication and completely untested

scripts/run-evals.mjs:153-176 collects git commit, dirty flag, rustc, and cargo — the exact fields that determine publicationStatus: 'eligible'. Every test in scripts/run-evals.test.mjs:34-108 passes an injected provenance object, so the real detection branches (gitCommit.ok, !gitStatus.ok || stdout.length > 0, commandText swallowing non-zero exits into '') are never exercised. Six months from now, a refactor that flips a boolean or reorders commandResult can silently mark a dirty tree clean, and every stubbed test still passes. That is exactly the "tests that would not fail if the behavior broke" pattern the lens brief flags, and it lives on the code path AGENTS.md §Evidence treats as a merge gate. Add tests that stub execute and drive collectProvenance directly through the ok / not-ok / dirty / non-git-tree matrix.

Concerns

  • Command cwd resolution is likewise untested. Every fixture injects a stub execute, so resolve(dirname(suitePath), testCase.command.cwd) at run-evals.mjs:100 never runs. Someone changing "relative to suite" to "relative to rootDir" won't be caught. The ../../kernel contract on every case in benchmarks/durability/suite.json:8-64 is a load-bearing implicit convention.
  • validateEvalSuite at run-evals.mjs:12-52 collapses ~20 field checks into two throws. The message says "invalid or duplicate case: " without naming the offending field. A future contributor with a typo in timeoutMs gets an error that hides which field failed. Break it into named guards, or at minimum interpolate the failing field.
  • env: { ...process.env, CARGO_TERM_COLOR: 'never' } at run-evals.mjs:105 hardcodes a cargo convention into a "generic" runner whose schema does not require Rust. The implicit "cases must be cargo" contract is invisible to a reader of suite.json. Move it into the case's command or drop it.
  • rootDir and per-case cwd diverge silently. Provenance (run-evals.mjs:88, using rootDir) and the tested code (dirname(suitePath)/testCase.command.cwd) can point at different repos when --root is used. The recorded commit is then wrong and nothing warns.
  • p95 over 5 samples is a stated metric that the code cannot compute. defaultRepetitions=5, minimumPublishableRepetitions=5, and the report emits durationMs.p95 at run-evals.mjs:122. p95 of five values is max. The field name asserts more than the math delivers; consider suppressing the percentile below a sample threshold.

Notes

  • Six near-identical cargo invocations in benchmarks/durability/suite.json will drift; consider a template with the test name as the sole variable.
  • benchmarks/README.md:47 promises environment failures are inconclusive, but run-evals.mjs:131-134 classifies any non-zero exit as trial_failures — the raw data survives, the taxonomy does not.
  • main() and parseArgs in run-evals.mjs:207-241 are entirely uncovered by tests.

REVIEW_FAILED

@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

history lens — FAIL

Blocker

  • benchmarks/durability/suite.json:11-65 invokes bare cargo for all six cases, and scripts/run-evals.mjs:77-83 executes that binary directly from the inherited environment. This repeats a mistake deliberately removed in ops/DRIVE-LOG.md:76-112: the repository introduced ops/cargo.sh and rewired kernel test gates through it after machine-global Cargo state—including a broken registry symlink—made execution non-hermetic. The wrapper now also handles missing cloud toolchains and keeps build output outside propagated worktrees. A supposedly publishable durability artifact can therefore fail merely because the host lacks usable global Cargo, recreating the exact environment dependency the historical fix eliminated. Point each case at ../ops/cargo.sh from its kernel working directory instead.

Concerns

  • None beyond that blocker under this lens. In particular, incomplete competitive adapters are explicitly deferred in benchmarks/README.md:45-48, so this remains acceptable scaffolding rather than an RFC-completeness failure.

Notes

  • No new contradiction with a settled RFC-0001 decision was found. The distinction between orchestration completion and evidence-layer quality in benchmarks/README.md:13-16 agrees with settled decision 11.
  • The commit message, feat: add defensible durability eval foundation, accurately describes the six newly added files and makes no false claim that the competitive benchmark has already been executed or that tests passed.
  • The claim limits in benchmarks/README.md:35-43 appropriately avoid treating the internal durability suite as general or comparative proof.

REVIEW_FAILED

@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

structure lens — MISSING

@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

🎯 review-swarm: FAILED (M:fail H:fail S:missing)

Lens transcripts posted as sibling comments above.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

"fs.writeFileSync(process.argv[4], String(process.pid))",
'const wait=new Int32Array(new SharedArrayBuffer(4))',
'while(!fs.existsSync(process.argv[2])) Atomics.wait(wait,0,0,20)',
"fs.appendFileSync(process.argv[1], 'second\\n')",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black-box eval uses wrong argv

High Severity

The -e scripts treat process.argv[1] as the first user argument, but Node puts [eval] there and starts user args at process.argv[2]. The fixture never writes effects.txt, attempts.txt, or step.pid, so every trial times out and a stray [eval] file is left in the suite working directory.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ec74641. Configure here.

Comment thread benchmarks/durability/black-box-crash.mjs
Comment thread scripts/run-evals.mjs Outdated
environmentFailurePatterns.some((pattern) => combined.includes(pattern))
) {
return 'inconclusive';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeouts marked as environment failures

Medium Severity

classifyTrial treats any result.error as inconclusive, and spawnSync sets that field on timeout. A hung crash/resume trial is therefore recorded as an environment failure instead of a product failure, so a real durability hang is labeled as infrastructure noise.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ec74641. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 6 files (changes from recent commits).

You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/run-evals.mjs">

<violation number="1" location="scripts/run-evals.mjs:107">
P2: This drops the previous `CARGO_TERM_COLOR=never` normalization; with `CARGO_TERM_COLOR=always`, Cargo can color test output and make successful trials fail the suite’s literal success-witness checks. Preserve the override in the child environment.</violation>

<violation number="2" location="scripts/run-evals.mjs:243">
P2: A `spawnSync` timeout sets `result.error.code` to `ETIMEDOUT`, so this classifies a hung durability test as an environment failure instead of a trial failure. Exclude timeout errors here so hangs are recorded as product failures.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread benchmarks/README.md Outdated
Comment thread scripts/run-evals.mjs Outdated
if (result.status === 0) return missingWitnesses.length === 0 ? 'passed' : 'invalid';
const combined = `${stdout}\n${stderr}\n${result.error?.message ?? ''}`;
if (
result.error ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A spawnSync timeout sets result.error.code to ETIMEDOUT, so this classifies a hung durability test as an environment failure instead of a trial failure. Exclude timeout errors here so hangs are recorded as product failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/run-evals.mjs, line 243:

<comment>A `spawnSync` timeout sets `result.error.code` to `ETIMEDOUT`, so this classifies a hung durability test as an environment failure instead of a trial failure. Exclude timeout errors here so hangs are recorded as product failures.</comment>

<file context>
@@ -171,6 +230,25 @@ export function collectProvenance(rootDir, execute = spawnSync) {
+  if (result.status === 0) return missingWitnesses.length === 0 ? 'passed' : 'invalid';
+  const combined = `${stdout}\n${stderr}\n${result.error?.message ?? ''}`;
+  if (
+    result.error ||
+    result.status === 127 ||
+    environmentFailurePatterns.some((pattern) => combined.includes(pattern))
</file context>
Suggested change
result.error ||
(result.error && result.error.code !== 'ETIMEDOUT') ||

Comment thread scripts/run-evals.mjs Outdated
encoding: 'utf8',
timeout: testCase.command.timeoutMs,
maxBuffer: 64 * 1024 * 1024,
env: process.env,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This drops the previous CARGO_TERM_COLOR=never normalization; with CARGO_TERM_COLOR=always, Cargo can color test output and make successful trials fail the suite’s literal success-witness checks. Preserve the override in the child environment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/run-evals.mjs, line 107:

<comment>This drops the previous `CARGO_TERM_COLOR=never` normalization; with `CARGO_TERM_COLOR=always`, Cargo can color test output and make successful trials fail the suite’s literal success-witness checks. Preserve the override in the child environment.</comment>

<file context>
@@ -65,26 +81,48 @@ export function runEvalSuite(options) {
         timeout: testCase.command.timeoutMs,
         maxBuffer: 64 * 1024 * 1024,
-        env: { ...process.env, CARGO_TERM_COLOR: 'never' },
+        env: process.env,
       });
       const durationMs = Math.round((performance.now() - before) * 1000) / 1000;
</file context>
Suggested change
env: process.env,
env: { ...process.env, CARGO_TERM_COLOR: 'never' },

Comment thread benchmarks/durability/black-box-crash.mjs Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c409218. Configure here.

Comment thread scripts/eval-suite.mjs

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 existing issue remains and 1 new issue found across 7 files (changes from recent commits).

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/eval-provenance.mjs">

<violation number="1" location="scripts/eval-provenance.mjs:21">
P2: This can record `rustc: null` for an eligible run: the ambient lookup happens before `ops/cargo.sh` can bootstrap its private toolchain, and missing runtime metadata does not block publication. Capture the compiler version from the wrapper-selected toolchain and reject publication when it is unavailable.</violation>
</file>

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread scripts/run-evals.mjs Outdated
Comment thread benchmarks/README.md Outdated
runtime: {
node: process.version,
nodePath: process.execPath,
rustc: commandText(execute, 'rustc', ['--version'], rootDir) || null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This can record rustc: null for an eligible run: the ambient lookup happens before ops/cargo.sh can bootstrap its private toolchain, and missing runtime metadata does not block publication. Capture the compiler version from the wrapper-selected toolchain and reject publication when it is unavailable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/eval-provenance.mjs, line 21:

<comment>This can record `rustc: null` for an eligible run: the ambient lookup happens before `ops/cargo.sh` can bootstrap its private toolchain, and missing runtime metadata does not block publication. Capture the compiler version from the wrapper-selected toolchain and reject publication when it is unavailable.</comment>

<file context>
@@ -0,0 +1,51 @@
+    runtime: {
+      node: process.version,
+      nodePath: process.execPath,
+      rustc: commandText(execute, 'rustc', ['--version'], rootDir) || null,
+      cargo: commandText(execute, resolve(rootDir, 'ops/cargo.sh'), ['--version'], rootDir) || null,
+    },
</file context>

Comment thread scripts/eval-suite.mjs
Comment thread scripts/eval-suite.mjs
@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Mutation verification: timeout classification

I reverted the exact timeout-classification branch from timed_out to inconclusive, ran the focused test, restored the line byte-for-byte, and reran it.

Mutated command:

node --test --test-name-pattern="timed-out command" scripts/run-evals.test.mjs

Captured mutated output:

TAP version 13
# Subtest: a timed-out command is a product failure blocker, not an environment failure
not ok 1 - a timed-out command is a product failure blocker, not an environment failure
  ---
  duration_ms: 2.996667
  type: 'test'
  location: '/Users/khaliqgant/Projects/AgentWorkforce/flows/scripts/run-evals.test.mjs:173:1'
  failureType: 'testCodeFailure'
  error: |-
    Expected values to be strictly equal:
    + actual - expected

    + 'inconclusive'
    - 'timed_out'

  code: 'ERR_ASSERTION'
  name: 'AssertionError'
  expected: 'timed_out'
  actual: 'inconclusive'
  operator: 'strictEqual'
1..1
# tests 1
# suites 0
# pass 0
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 39.761

Restored command:

node --test --test-name-pattern="timed-out command" scripts/run-evals.test.mjs && git diff --exit-code && git status --short

Captured restored output:

TAP version 13
# Subtest: a timed-out command is a product failure blocker, not an environment failure
ok 1 - a timed-out command is a product failure blocker, not an environment failure
  ---
  duration_ms: 3.115167
  type: 'test'
  ...
1..1
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 39.376042

git diff --exit-code and git status --short emitted no output, confirming the tested source was restored exactly and the worktree is clean at d40219310007a353963b1d763c8890d214ff7a52.

@kjgbot

kjgbot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Final-head mutation verification

At exact head 6c09afae52b8700af3c4308d886a346a8dc99fd3, I changed only the ETIMEDOUT outcome from timed_out back to inconclusive.

Command:

node --test --test-name-pattern="timed-out command" scripts/run-evals.test.mjs

Captured output with the mutation:

TAP version 13
# Subtest: a timed-out command is a product failure blocker, not an environment failure
not ok 1 - a timed-out command is a product failure blocker, not an environment failure
  ---
  duration_ms: 3.187125
  type: 'test'
  location: '/Users/khaliqgant/Projects/AgentWorkforce/flows/scripts/run-evals.test.mjs:181:1'
  failureType: 'testCodeFailure'
  error: |-
    Expected values to be strictly equal:
    + actual - expected

    + 'inconclusive'
    - 'timed_out'

  code: 'ERR_ASSERTION'
  name: 'AssertionError'
  expected: 'timed_out'
  actual: 'inconclusive'
  operator: 'strictEqual'
1..1
# tests 1
# suites 0
# pass 0
# fail 1
# cancelled 0
# skipped 0
# todo 0
# duration_ms 38.865917

I then restored that exact line byte-for-byte and ran:

node --test --test-name-pattern="timed-out command" scripts/run-evals.test.mjs && git diff --exit-code && git status --short && git rev-parse HEAD

Captured output after restoration:

TAP version 13
# Subtest: a timed-out command is a product failure blocker, not an environment failure
ok 1 - a timed-out command is a product failure blocker, not an environment failure
  ---
  duration_ms: 3.060833
  type: 'test'
  ...
1..1
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 37.021167
6c09afae52b8700af3c4308d886a346a8dc99fd3

The absent git diff / git status output proves the restoration was exact and the tree was clean.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread scripts/run-evals.test.mjs Outdated
@khaliqgant
khaliqgant merged commit e07a190 into main Sep 24, 2026
4 checks passed
khaliqgant added a commit that referenced this pull request Sep 24, 2026
…never outlives its lease (#561) (#576)

* test(sdk): reproduce repeated authored CLI probes and expired leases

* fix(sdk): reuse authored CLI probes for each run before worker admission

* docs: capture lease regression mutation and live repro evidence

* test(sdk): keep the artifact-gate cwd regression inside the run root

The regression added by #517 declares `cwd` on a spec it hands to
`preflight`, and used an `os.tmpdir()` directory — an absolute path.
#566 landed one commit earlier and made an absolute `cwd` a compile
refusal (`agent-cwd.ts`: a declared `cwd` is run-root-relative, the
same rule `relayflowd_core::spec::is_run_root_relative_path` applies
at the kernel boundary). Each PR was green alone; together they are
not, and `main` at e30226c fails this test with `invalid_spec` where
it expects `gate_path_unscanned`.

The fixture now makes its directory inside the run root and declares
the relative name. Nothing else moves: the warning, `ok`, the real
`AgentWorker` dispatch, the empty scan snapshot, the journaled JSON
output and the lowered gate command are asserted exactly as before.

Reverting this file to its e30226c bytes fails the case and restoring
it passes; both captures are in evidence/561/artifact-gates-{red,green}.txt.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: classify every check failure against main and re-capture #561 evidence

The repository check on this branch failed with 30 tests across five files.
None came from #561. Each is classified by reverting this branch's three
source files to origin/main (e30226c), re-running and restoring:

  * artifact-gates (1)     — main is red; #566 and #517 conflict semantically.
                             Fixed in the preceding commit.
  * live-kernel (7)        — this sandbox's HOME declares "type": "commonjs"
                             above the checkout, so testdata/preflight's
                             extensionless ESM fixture CLIs load as CommonJS
                             and emit nothing, silently. Local setup only.
  * authored-node-runtime  — Bun 1.3.6 where every workflow pins 1.4.0.
  * hosted-extension (22)  — unprivileged user namespaces denied to this
                             container; bwrap cannot run even once installed.

The mutation is re-run at this head. The mutated run reproduces the issue's
exact signature — lease_expired on a first attempt that never heartbeated,
retry, second attempt success — and the restore is byte-identical by SHA-256.

The live-Claude repro could not be re-run: this environment's claude is no
longer authenticated. The capture says so rather than the acceptance box
claiming a pass it cannot show.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs: re-run the #561 mutation at the branch head

The committed mutation transcripts were captured before the artifact-gate
fix (1ccaaed) landed. Re-run `evidence/561/mutation.patch` against the
current head so the transcript matches the bytes a reviewer checks out,
and record the restore with `git diff --exit-code` plus a sha256sum.

The failing capture carries the issue's exact journal shape at both
capacity 1 and the default: attempt 1 completes `lease_expired` with
`wallclock_ms: 30011`, a `retry_backoff` sleep follows, and attempt 2
succeeds. Restored, all five cases pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Keep relayflow working files out of the change

* fix(sdk): keep authored CLI probes from starving worker leases

Session-Id: 01a0d409-e854-7540-a76e-a2f9cd136946

* fix(sdk): preserve authored probe compatibility and stdin isolation

Session-Id: 01a0d409-e854-7540-a76e-a2f9cd136946

* fix(sdk): detect authored option bags without config key

Session-Id: 01a0d409-e854-7540-a76e-a2f9cd136946

* fix(sdk): keep authored option bags from becoming config

Session-Id: 01a0d409-e854-7540-a76e-a2f9cd136946

---------

Co-authored-by: Relayflow <noreply@agentrelay.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: khaliqgant <khaliqgant@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants