Skip to content

fix: stop logging env var values and throw ProcessException on failure - #33

Merged
DecSmith42 merged 2 commits into
mainfrom
claude/project-thread-vhd3ok
Oct 14, 2026
Merged

DecSmith42 merged 2 commits into
mainfrom
claude/project-thread-vhd3ok

Conversation

@DecSmith42

Copy link
Copy Markdown
Contributor

Requested by Dec · project thread

Before: the invocation log line printed every environment variable as NAME=value at Information level, so secrets passed that way (API keys, tokens) ended up in build logs. A non-zero exit threw a plain System.Exception, so callers couldn't catch it specifically or read the exit code.

After: the log line lists variable names only (with env CI, NUGET_API_KEY). A non-zero exit throws the new ProcessException, which carries the ProcessRunResult (exit code, output, options) and an ExitCode shortcut. It derives from Exception, so existing catch (Exception) blocks still work, and the message text is unchanged.

How:

  • ProcessRunner builds the env part of the log from names only. Arguments are still logged in full, and the docs now explain how to keep secrets out of them: pass them as environment variables, or lower InvocationLogLevel.
  • New ProcessException type. RCS1194 is suppressed with a justification, because the standard constructors would make Result nullable.
  • New tests for both changes. The public API snapshot diff only adds ProcessException.
  • Updated README, docs, api/index.md and AGENTS.md.

Local check: the build passes with no warnings. The net10.0 tests pass, except the two cancellation tests that also fail locally on unmodified main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jy23TCq1bZkdPV2GRWfspU


Generated by Claude Code

…n failure

- The invocation log line now lists only the names of configured environment
  variables, never their values, so secrets passed via EnvironmentVariables no
  longer reach the log. Arguments are still logged in full (lower
  InvocationLogLevel to hide them); this is documented on the option and in
  docs/logging.md.
- A non-zero exit now throws the new public ProcessException (derives from
  Exception, so existing catch blocks still work) exposing ExitCode and the
  full ProcessRunResult. The message text is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jy23TCq1bZkdPV2GRWfspU
Copilot AI balanced review requested due to automatic review settings October 14, 2026 03:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The architecture guidance incorrectly includes an internal type in the public surface while omitting a public type.

1 open finding
What changed in this PR

Prevents environment-value leakage in invocation logs and adds typed process-failure handling.

Changes:

  • Logs environment variable names without values.
  • Introduces ProcessException with exit code and result details.
  • Adds synchronous/asynchronous tests and updates documentation.
File Description
src/​Invex.Process/​ProcessRunner.cs Redacts environment values and throws ProcessException.
src/​Invex.Process/​ProcessException.cs Defines the new typed exception.
src/​Invex.Process/​ProcessRunOptions.cs Documents logging and failure behavior.
tests/​Invex.Process.Tests/​ProcessRunnerTests.cs Tests both new behaviors.
tests/​Invex.Process.Tests/​PublicApiTests.VerifyPublicApiSurface.verified.txt Records the new public type.
README.md Updates failure-handling features.
docs/​handling-failures.md Documents typed exceptions.
docs/​logging.md Documents environment-name-only logging.
docs/​transforming-output.md Clarifies invocation logging.
docs/​testing.md Updates failure-faking example.
docs/​introduction.md Names the failure exception.
api/​index.md Adds the exception to the API map.
AGENTS.md Updates architecture and behavioral contracts.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md Resolved
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jy23TCq1bZkdPV2GRWfspU
Copilot AI balanced review requested due to automatic review settings October 14, 2026 03:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The synchronous and asynchronous implementations, tests, public API snapshot, and documentation consistently implement the stated behavior.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@DecSmith42
DecSmith42 merged commit 91062c7 into main Oct 14, 2026
8 checks passed
@DecSmith42
DecSmith42 deleted the claude/project-thread-vhd3ok branch October 14, 2026 03:49
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