Skip to content

fix(verify): write .verify.out owner-only - #165

Merged
SutuSebastian merged 2 commits into
mainfrom
agent/sta-432-verify-out
Nov 16, 2026
Merged

SutuSebastian merged 2 commits into
mainfrom
agent/sta-432-verify-out

Conversation

@SutuSebastian

@SutuSebastian SutuSebastian commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes STA-432. Part of STA-436 (release 0.7.0).

What

verify wrote .verify.out, the raw combined stdout and stderr of the verify command, at the store's 0644 mode. Any credential the command printed was readable by other local users. The file is now written owner-only (0600), the same as run's .run.out.

The raw content is intentional, for operator debugging, and existing tests pin it (TestVerifyRedaction, TestVerifyContractRedaction). The published receipts (patch.json and verification-<group>.json) were already redacted and are unchanged. Nothing outside internal/core/verify writes the file or sweeps it into a posted artifact.

Evidence

  • TestVerifyOutputOwnerOnly failed on main with .verify.out mode = 0644, want 0o600, and reverting the fix brings that failure back. The mode check is skipped on Windows, where permission bits aren't real.
  • make evals 135/135, whole-repo go test, golangci-lint (native and GOOS=windows), make cross and make size pass.

Summary by CodeRabbit

  • Security
    • Verification output files now use owner-only permissions on Unix systems, reducing access to raw command output that may contain credentials.
    • Run output files are documented as using the same permissions. On Windows, inherited directory permissions remain in effect.

`.verify.out` holds the command's raw combined output, so a command that
prints a credential leaves the value in it, and the store writer's 0644
left that readable by every local user. Write it at 0600, the permission
`run` already gives `.run.out`; the recorded tail in `patch.json` and the
deep-validation receipts stay redacted and 0644 as before.

Add `.WriteFileMode(` to wrapcheck's ignore-sigs beside `.WriteFile(`:
both seal their errors at the store boundary (GO-ERRORS-03).
@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9678329

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stainless-code/verdict Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The verify service now writes .verify.out with Unix mode 0600. A test checks this mode outside Windows. The changes also update documentation, a changeset, and the linter configuration.

Changes: Verify output permissions

Layer / File(s) Summary
Set and verify output permissions
internal/core/verify/service.go, internal/core/verify/service_test.go, docs/manual.md, .changeset/verify-out-owner-only.md, .golangci.yml
writeOutputs writes .verify.out with mode 0600. The test checks the permission bits outside Windows. Documentation describes Unix mode 0600 for .run.out and .verify.out, while the changeset notes the inherited Windows ACL and redaction of recorded output. The linter configuration adds .WriteFileMode( to wrapcheck’s ignored signatures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: docs

Merge Risk: Minimal · up to 96783

The change makes the raw verify output file owner-only on Unix, which tightens access without altering the redacted receipts. It is a small, tested change and is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(verify): write .verify.out owner-only" names the main change: the verify command now writes .verify.out with owner-only mode 0600 instead of 0644. The raw summary confirms this change i…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(verify): write .verify.out owner-only" names the main change: the verify command now writes .verify.out with owner-only mode 0600 instead of 0644. The raw summary confirms this change in internal/core/verify/service.go, the new test, the changeset, and the docs. The title is specific and concise, and it follows a conventional-commit style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4fd4a11-3d66-4b2a-81b4-626a91e6721a
Commits

Reviewing files that changed from the base of the PR and between e4fc711 and 9678329.

Files selected for processing: 5

  • .changeset/verify-out-owner-only.md
  • .golangci.yml
  • docs/manual.md
  • internal/core/verify/service.go
  • internal/core/verify/service_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@SutuSebastian
SutuSebastian merged commit 14aca16 into main Nov 16, 2026
21 checks passed
@SutuSebastian
SutuSebastian deleted the agent/sta-432-verify-out branch November 16, 2026 10:31
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.

1 participant