Repository navigation
Conversation
A daemon response naming a non-script artifact with a NUL byte in its fileName (or localPath) crashed the client in the download's first fs call. The client now drops that artifact before any filesystem work, records a typed droppedArtifacts entry (reason artifact_name_invalid) and a warning, and keeps the rest of the response, including the action's own outcome. Fixes callstack#4661
e99e7fe to
16c7e5e
Compare
|
At 16c7e5e, the change still has two delivery defects and needs live verification. The destination check rejects NUL but accepts a peer-selected fallback name longer than the filesystem component limit. Opening it fails with ENAMETOOLONG and loses the answered action. Please apply a host-kit name admission rule to every peer-selected entry before filesystem work, disclose invalid names, and cover overlong names and the platform cases in its table. The dropped reason exists only on an untyped remote response; screenshot normalization discards it. Node and default screenshot JSON consumers cannot reliably identify the dropped artifact by its typed reason, and the daemon path can still appear as successful output. Please own the disclosure in the shared response contract and carry it through client normalizers and machine output, preserving the warning and identifying unavailable paths. The remote capture delivery change has no live verification at this head. Please run a remote device capture through the daemon client and a public output surface, including a malformed artifact response, and show successful action data, the typed dropped reason and warning, and no dropped file. Not blocking: the regression could use a remote request with a malformed response through the daemon client and a public surface, asserting the kept action, typed disclosure and no artifact write; you can take or leave this suggestion. Could a single host-kit peer-entry admission rule and shared typed delivery disclosure be used at materialization? The host-kit owner would first need to agree on the name policy and platform case table, since issue #4669 defers the broader write policy. Coverage failed; please check its log for the failing assertion or threshold and compare it with main. The PR body describes validation at e99e7fe, not at this head. No conflicts are known. Before merge, please repair name admission and disclosure, provide live evidence at this head, and diagnose Coverage. |
Summary
A remote daemon response that names a non-script artifact with a NUL byte in its destination crashed the client:
resolveMaterializedArtifactPathbuilt a path fromartifact.fileNameand the download's first fs call threw.The client now checks the chosen destination before any filesystem work. A destination containing a NUL byte (from
fileNameor an echoedlocalPath), or afileNamethat is not a string, drops that artifact. The response gains a typeddroppedArtifacts: [{ field, reason: 'artifact_name_invalid' }]entry and a pairedwarningsline, mirroringscriptDeliveryFailure.droppedArtifactsis a client-owned field, so a daemon artifact cannot target it. The rest of the response, including the action's outcome, is kept. Script artifacts do not take this path, so they are unaffected.Empty,
.and..names keep their existing fallback name. Wider peer-named-entry validation is left to #4669.Files: 2 (
packages/remote/src/daemon-artifacts.ts, one test).Fixes #4661
Validation
Tested SHA:
e99e7fecc7626a01d2a16ae5785dfe6f11d87f7e(base6e18ea3).pnpm exec vitest run --project unit-core packages/remote/src/__tests__/: the new test passes at head and fails at base (the NUL name crashes the client). This VM also shows 13 failures in the script-ancestry, script-download and script-hostile-daemon suites. They happen at base as well, so they come from the environment (tmp-directory ancestry) and not from this change.tscoverpackages/remote/src(root tsconfig, noEmit): clean.oxfmt --checkon the changed files: clean.oxlintandcheck:affectedcould not run here: oxlint crashes in its allocator on this small VM. CI is the authority for lint and the full gate.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.