monad-developers / monad-developers/ultrafuzz

Modal retry classifier truncates exact collision diagnostics at 4 KiB

Open
#732 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

deferred-post-v0.1
Dominant language
TypeScript
Stars
85
Forks
18
Avg merge
11h 10m
Merged PRs (30d)
194

Description

Summary

In release/v0.1.0, the Modal node worker's exact exhausted-task retry uses the generic 4,096-character runChecked stdout/stderr capture. If harmless workflow diagnostics exceed that bound before an exact selected linked-worktree git read-tree --reset -u / index.lock collision, the full output satisfies the retry classifier but the retained output cannot. The worker reports a terminal pre-ownership failure instead of applying its already-bounded retry policy.

Generic reproduction

This uses only an in-memory stream and a temporary generic path:

import { Readable } from "node:stream";

const readBoundedText = async (stream, limit = 4096) =>
  new Promise((resolve) => {
    const chunks = [];
    let length = 0;
    stream.setEncoding("utf8");
    stream.on("data", (chunk) => {
      if (length >= limit) return;
      const remaining = limit - length;
      chunks.push(chunk.slice(0, remaining));
      length += Math.min(chunk.length, remaining);
    });
    stream.once("end", () => resolve(chunks.join("")));
  });

const lock = "/tmp/generic-linked-worktree/index.lock";
const output =
  "workflow diagnostic\n".repeat(300) +
  `Error: Command failed: git read-tree --reset -u ${"a".repeat(40)}\n` +
  `fatal: Unable to create '${lock}': File exists.\n`;
const retained = await readBoundedText(Readable.from([output]));
const matches = (text) =>
  /\bgit read-tree --reset -u [0-9a-f]{40}\b/.test(text) &&
  text.includes(`fatal: Unable to create '${lock}': File exists.`);

console.log({
  fullBytes: Buffer.byteLength(output),
  retainedBytes: Buffer.byteLength(retained),
  fullMatches: matches(output),
  retainedMatches: matches(retained)
});

Observed:

fullBytes: 6169
retainedBytes: 4096
fullMatches: true
retainedMatches: false

Expected behavior

The exact retry-task subprocess should retain a separately bounded diagnostic window large enough for its narrow selected-worktree collision predicate. Other Modal worker commands should retain the release's default bound. When the exact collision, unchanged event stream, and existing reset/start pre-ownership command shape all agree, the existing bounded command retry should be able to proceed.

Actual behavior

The collision suffix is discarded. The retry diagnostics report one byte-stable command attempt, zero read-tree matches, and zero lock-path matches even though the subprocess's full stderr contains both exact lines. The attempt terminates before task ownership or inference.

Version

  • Branch: release/v0.1.0
  • Commit: 9b0bc8cab2e681bbffeee385c1f80f85a47087d3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Modal node worker's runChecked capture and exact exhausted-task retry classifier on release/v0.1.0. Use the provided in-memory stream reproduction to trace the retained diagnostic window and existing retry checks. Done means the exact collision remains classifiable despite long diagnostics while other worker commands retain the default bound, with the unchanged event stream and pre-ownership retry behavior verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.