Skip to content

fix: harden PR 221-227 follow-up issues#231

Merged
inureyes merged 1 commit into
mainfrom
fix/pr-221-227-postmerge-hardening
May 24, 2026
Merged

fix: harden PR 221-227 follow-up issues#231
inureyes merged 1 commit into
mainfrom
fix/pr-221-227-postmerge-hardening

Conversation

@inureyes

@inureyes inureyes commented May 24, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up hardening for the already-merged PRs #221, #222, #224, #225, #226, and #227 after reading each PR body and the linked original issue bodies. This PR fixes the remaining gaps found during that review and was rebased after #230 so record-path documentation and tests now match the platform-aware cache-directory behavior from #229/#230.

Target PRs Reviewed

Linked Original Issues Reviewed

Review Findings

Fixes

  • Added paths::active_config_path() and reused it in top-level help plus all-smi config path text/JSON output so the displayed active path matches implicit loader semantics.
  • Added regression coverage that the help block contains the loader-active path.
  • Added RecorderOptions documentation and regression coverage proving the real CLI default, represented by compiled Settings::default().record, delegates to paths::cache_dir().join("records") and falls back to DEFAULT_BASENAME only when cache-dir discovery returns None.
  • Updated the swap-color regression test to derive crossterm’s current Color::Red SGR sequence rather than hard-coding specific terminal encodings.

Security Review

No authentication, authorization, SQL, shell execution, deserialization, SSRF, or network surface was changed by this follow-up. The config path change remains read-only and only calls bounded path discovery plus Path::exists(). The record-path change is documentation/test alignment around existing resolver behavior; it does not relax writer symlink refusal or file-mode hardening. No sensitive config values are printed or newly exposed.

Performance And Reliability Review

The new active-path helper performs the same bounded candidate path scan the config loader already performs and is only used in help/config-path discovery surfaces. There is no hot-path TUI, API, parser, or hardware reader overhead. The swap test update improves CI reliability across crossterm versions without changing rendering behavior.

Validation

  • rustup update stable to Rust 1.95.0 so local validation matches the post-update: bump dependencies to latest versions #228 dependency MSRV.
  • Local system lacked libdrm-dev; because sudo was unavailable, validation used target/local-lib symlinks to the installed runtime libdrm.so.2 and libdrm_amdgpu.so.1 via LIBRARY_PATH for linking only.
  • cargo fmt --check
  • git diff --check
  • LIBRARY_PATH=/home/inureyes/Development/backend.ai/all-smi/target/local-lib cargo test --bin all-smi record::tests::resolve_output
  • LIBRARY_PATH=/home/inureyes/Development/backend.ai/all-smi/target/local-lib cargo test --test config_path_help_test
  • LIBRARY_PATH=/home/inureyes/Development/backend.ai/all-smi/target/local-lib cargo test --lib ui::renderers::memory_renderer::tests::test_swap_row_active_uses_red_color
  • LIBRARY_PATH=/home/inureyes/Development/backend.ai/all-smi/target/local-lib cargo clippy -- -D warnings
  • LIBRARY_PATH=/home/inureyes/Development/backend.ai/all-smi/target/local-lib cargo test

Refs #221, #222, #224, #225, #226, #227, #211, #212, #213, #214, #220, #223.

@inureyes inureyes self-assigned this May 24, 2026
@inureyes inureyes added status:review Under review priority:medium Medium priority issue type:performance Performance improvements type:optimization Code optimization and efficiency improvements labels May 24, 2026
Refs #221, #222, #224, #225, #226, #227.

Align config path active discovery with the implicit loader's first-existing-candidate semantics, correct record output help and resolver docs against the binary default, and make the swap-color regression test derive crossterm's current Red SGR sequence instead of hard-coding older encodings.
@inureyes inureyes force-pushed the fix/pr-221-227-postmerge-hardening branch from 2c6630f to 51b8d26 Compare May 24, 2026 10:45
@inureyes inureyes merged commit bdf4d9d into main May 24, 2026
3 of 4 checks passed
@inureyes inureyes deleted the fix/pr-221-227-postmerge-hardening branch May 24, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority issue status:review Under review type:optimization Code optimization and efficiency improvements type:performance Performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant