Skip to content

test: cover state and audit contracts#23

Merged
jamiesun merged 1 commit into
mainfrom
codex/state-audit-contract-tests
Jun 20, 2026
Merged

test: cover state and audit contracts#23
jamiesun merged 1 commit into
mainfrom
codex/state-audit-contract-tests

Conversation

@jamiesun

Copy link
Copy Markdown
Contributor

Fixes #13.

Summary

  • assert the settings directory is created with private 0700 permissions
  • cover atomic settings-write cleanup when replacing settings.json fails
  • add audit recorder field-contract coverage for host resolution, redaction, sudo, timeout, known_hosts and execution flags
  • add table-driven audit effect coverage across ssh, password, host, and sftp modes

Why this closes #13

Together with #21 and #22, the listed security-sensitive focus areas now have targeted coverage: JSON contracts, timeout and exit-code behavior, command blocking, sudo stdin rewrite, settings atomic write/permissions, host-key behavior, and audit event contracts.

Coverage

  • internal/app: 47.2% -> 48.6%

Verification

  • go test ./internal/app -run 'TestSaveAndLoadSettings|TestSaveSettings_RenameFailureCleansTempFile|TestAuditRecorderRefreshRecordsExecutionContract|TestAuditEffectFlagsByModeAndAction'
  • go test ./...
  • go test -cover ./...
  • git diff --check
  • make check

@jamiesun jamiesun force-pushed the codex/state-audit-contract-tests branch from c01226b to 81bd271 Compare June 20, 2026 16:17
@jamiesun jamiesun merged commit be59911 into main Jun 20, 2026
6 checks passed
@jamiesun jamiesun deleted the codex/state-audit-contract-tests branch June 20, 2026 16:19
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.

[tests] Harden coverage for security-sensitive execution paths

1 participant