Skip to content

mods: the declarations carry process.run's truncation flags and list entries' mtimeMs; the test fakes answer them - #97293

Open
poteat wants to merge 1 commit into
mainfrom
mods-run-flags-and-list-mtime
Open

poteat wants to merge 1 commit into
mainfrom
mods-run-flags-and-list-mtime

Conversation

@poteat

@poteat poteat commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Arm when the released npm CLI carries both fields (isStdoutTruncated / isStderrTruncated on a $.process.run result, mtimeMs on a $.fs.list entry): until then these declarations would promise what the installed CLI does not answer yet.

The engine's $.process.run result now says, per stream, whether its output was cut at the limit (isStdoutTruncated, isStderrTruncated), and its declaration states that limit as a number: 4194304 bytes each. A $.fs.list entry now carries mtimeMs: a regular file's own, as $.fs.stat spells it, and 0 for a directory, a link or any other kind, as size is.

The declarations in mods/types follow (the ProcessRunResult and FsEntry types, and the run and list docs), and every test fake that builds one of those values answers the new fields: the scripted git results and gitIn in mods/diff/tests, the telemetry probe and listing fixtures, the README's example test, and the recording backend host, whose runner hands on the mod's own narrower run result and so fills the two flags in. No mod reads the new fields yet; the diff mod's own output-cap arithmetic can move to isStdoutTruncated in a later change.

Checked:

  • tsc -p mods/tsconfig.json passes at this branch's head. It checks against the declarations in this folder, so the change is consistent on its own; without the fixture edits it fails once in each of the ten fixture files.
  • The added fields are inert under a CLI that does not know them, so claude plugin test mods/diff and claude plugin test mods/telemetry are unchanged by them.

…entries' mtimeMs; the test fakes answer them

@bhosmer-ant bhosmer-ant 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.

Declarations and fixtures match what the CLI generates, line for line. Nothing reads the new fields yet.

@konsta95

konsta95 commented Oct 2, 2026 •

Copy link
Copy Markdown

Rebased onto main, this needs three more additions, or tsc -p mods/tsconfig.json reports 3 errors, at git-in.ts:38, old-files.ts:15 and register.test.ts:16. Main rewrote the first two and added the third since this was opened. With the patch the typecheck is clean and the diff and telemetry suites pass on 2.1.287.

Patch against main 52c7644 and what I measured: https://gist.github.com/konsta95/f0acc40a7acdccd0394e67c326c16159

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.

3 participants