Repository navigation
Conversation
[Low impact] The PR appears safe to merge; no blocking issues remain. SummaryChanges
Reviews (3) · Last reviewed commit: "test(cli): assert retained entropy Evide..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
inspect-byte-entropy passed a hard-coded "rea-byte-entropy" to the shared command finalizer, so a failed descriptor close named a provider that differs from the Evidence provider ("byte-entropy"). Use BYTE_ENTROPY_PROVIDER.id so both come from one owner.
Fixes #7279
…stic Check the partial observation returned with the close-failure diagnostic: provider id, file digest and byte count.
d5aa7ec to
2f43ac3
Compare
|
TL;DR: I ran the new test file on head 2f43ac3, and both tests pass on Node 22, 24 and 26. With
All rows ran
Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/process-global/byteEntropyCleanupCli.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
…ation Since #8444 the completed observation is projected once at the composed error's details.partial_observation rather than inside primary_error, so restore #7319's retained-Evidence assertion there. Refs #7279 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ation Since #8444 the completed observation is projected once at the composed error's details.partial_observation rather than inside primary_error, so restore #7319's retained-Evidence assertion there. Refs #7279 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks! This landed on main in #10490 as its own commit, cherry-picked with your authorship kept (rebase merge). Closing in favor of that merge. |
Summary
When
rea inspect-byte-entropyfinishes reading a file but the descriptor close fails, the cleanup diagnostic names providerrea-byte-entropy, while the retained Evidence namesbyte-entropy. This makes the cleanup diagnostic use the Evidence provider's identity.Fixes #7279
Written with AI assistance.
Problem and expected behavior
src/cli/binaryDiagnosticsCommands.tspassed the literal"rea-byte-entropy"tofinishAnalysisCommand, while the provider identity isBYTE_ENTROPY_PROVIDER.id("byte-entropy"). It is the only command in that file whose literal differs from its provider constant. With a persistent descriptor-close failure,details.diagnostics.cleanup_error.details.provider_idwasrea-byte-entropy. The failure status, resource list and completed Evidence were already correct.Change and scope
Use
BYTE_ENTROPY_PROVIDER.idat the call site, so the cleanup provider id and the Evidence provider id come from one owner. Nothing else changes.Not included: the other
"rea-…"literals in the same file match their provider constants today. Replacing them with the constants would be a separate cleanup, so I left them alone.Contribution scope: ordinary fix within existing boundaries; no maintainer scope decision is needed.
Contract and boundary impact
BYTE_ENTROPY_PROVIDER(src/domain/investigationProviders.ts); the CLI command registration passed a duplicated string. No superseded path was removed.provider_idvalue changes (rea-byte-entropy→byte-entropy) on the descriptor-close failure path.Expected effects:
Evidence and regression coverage
tests/process-global/byteEntropyCleanupCli.test.ts. It runs the real registeredinspect-byte-entropyCLI on a 512-byte file with a persistentEIOinjected on the file handle'sclose()(module mock ofnode:fs/promises). It assertscleanup_incomplete, the retainedcleanup: incompletedetails, that the nestedcleanup_error.details.provider_idequalsBYTE_ENTROPY_PROVIDER.id, and that the retained partial observation (diagnostics.primary_error.details.partial_observation) still carries the Evidence provider id, the file's SHA-256 and its byte count. A normal-close control asserts successful Evidence with the same provider id.provider_id: "rea-byte-entropy"where"byte-entropy"was expected; the control passed. With the fix both pass (vitest run --project process-global).provider_idvalue above changes.Boundary/lifecycle regressions covered: public CLI delivery with a cleanup failure after a completed observation ("Cleanup fails after success"). Not covered: primary-failure-plus-cleanup-failure for this command, cancellation during final close, and a naturally occurring OS close failure (the failure is injected).
Validation performed
Windows 11, Node 24.22.1:
npx vitest run --project process-global tests/process-global/byteEntropyCleanupCli.test.ts— fails on base with the provider-id mismatch; 2/2 pass with the fix. The neighboringbinaryDiagnosticsCliCleanup.test.tsalso passes (4/4).npm run test:local -- src/application/binaryDiagnostics/ByteEntropyService.test.ts— 20 passed, 2 skipped, 1 failed ("reports a changed artifact when its parent directory moves during streaming", a WindowsENOENTon rename). The same failure occurs without this change.npm run check:fast(typecheck and lint) — passed.oxfmt --checkon the two changed files — clean.npm run verify:test-discovery— all 2591 test files discovered exactly once.Not run:
npm run test:focusedand the acceptance suite (e.g.tests/acceptance/localPathAdmissionCli.test.ts): they need the compiled runtime, and the build needs Windows native artifacts that this host lacks. Run directly, that acceptance test fails because nodist/exists; that failure is environmental.npm run check,npm run docs:check, and the real-provider suites.Compatibility, safety, and release
provider_idstring.Author readiness
Human owner: @x-labb
Before merge
type(scope): outcome.