Feature/sma 107 audit log operator docs readme final cleanup#212
Open
mrnkslv wants to merge 41 commits into
Open
Conversation
…types-config-serde
…-101-audit-log-trait-noop-factory-composition-root-wiring
…-102 Integrate SMA-101 wiring (enabled flag, audit in ElectionRunner) with JsonlAuditLog implementation: factory returns NoopAuditLog when disabled and starts JsonlAuditLog when enabled. Co-authored-by: Cursor <[email protected]>
Take sma-99 audit writer/log hardening (oneshot shutdown, rotated paths, shutdown timeout, flush/recovery). Adapt to SMA-103 event format: AuditFileHeader, system_audit_events_dropped constructor, payload.source() in record diagnostics, header-aware writer tests. Co-authored-by: Cursor <[email protected]>
… events to CLI - Merge feature/sma-104-audit-log-rest-producers-auditactorbuilder into current branch - Resolve conflicts: AppState gains both audit_ring (SMA-105) and actor_builder (SMA-104) - Fix RestApiAuthLoginSuccess → RestApiAuthLoginSucceeded in event.rs and auth_tests.rs - Add recent elections audit events to GET /v1/elections response (recent_events field, newest-first, from ring buffer) - Add elections events table to `nodectl api elections` CLI output Co-authored-by: Cursor <[email protected]>
…cture' into feature/sma-104-audit-log-rest-producers-auditactorbuilder
- Add `use serde::{Deserialize, Serialize}` to enums.rs (bare derives on
StakeSkipReason/ConfigFieldChange/AuditOutcome broke after SMA-103 merge)
- Add ElectionsTickFailed arm to severity() and source() match blocks
- Restore REST event constructors to event.rs (rest_api_auth_login_success,
rest_api_auth_login_rejected, rest_api_token_rejected, rest_api_config_updated)
removed by SMA-103 merge; required by rest_audit.rs (SMA-104)
- Fix RestApiAuthLoginSuccess -> RestApiAuthLoginSucceeded in auth_tests.rs
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
…roducers-auditactorbuilder' into feature/sma-105-audit-log-in-memory-ring-buffer-for-read-path
- Rename ElectionsStakeSubmittedParams.stake_nanotons → stake and elections_stake_recovered param amount_nanotons → amount to match the enum field names introduced by sma-104 (which dropped _nanotons suffixes from all payload fields). - Remove dead duplicate function adaptive_split50_defer_reason that was synthesised by the ort merge strategy from both SMA-103 and SMA-104 versions of adaptive_strategy.rs; the identical logic with node_id is already in adaptive_split50_status. - Update runner.rs and event.rs test fixtures to use the renamed fields. All 310 lib tests pass. Co-authored-by: Cursor <[email protected]>
Remove the intermediate AdaptiveStakeZero enum and move its variants (Defer, NoTopUpNeeded, InsufficientFree) directly into AdaptiveStakeResult. Update all call-sites in runner.rs accordingly, renaming adaptive_zero_to_skip → adaptive_result_to_skip. Co-authored-by: Cursor <[email protected]>
…a-105 Pull SMA-104 review fixes merged into sma-99 (test_support refactor, middleware without headers clone, AppError::internal in config handlers, rest_audit noop-update comment) while keeping sma-105 audit ring buffer. Co-authored-by: Cursor <[email protected]>
Apply sma-105 conflict resolutions (test_support builders, jsonl_writer cleanup) while keeping sma-106 projection test helpers for custom ring. Co-authored-by: Cursor <[email protected]>
…tion - Atomic dedup: replace two-step contains+push with push_unless_dedup_duplicate that holds a single write lock, eliminating the TOCTOU race on concurrent record() calls for the same elections.stake_skipped key. - Zero-copy dedup: replace dedup_key() -> Option<String> with dedup_identity() -> Option<AuditDedupIdentity<'_>>, removing per-event String allocations on the hot path. - Contract fix in collect_recent_election_ids: early-return when max == 0 and after inserting current_election_id when ids.len() >= max. Co-authored-by: Cursor <[email protected]>
Resolve conflicts preferring sma-99 for audit core (dedup, ring buffer, jsonl) while keeping sma-106 projection into elections response. Co-authored-by: Cursor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add docs/audit-log.md — a new operator-facing reference for the nodectl
audit log subsystem. Covers:
(enabled, path, max_size_bytes, max_files, batch_interval_ms,
batch_max_events, queue_capacity, queue_full_timeout_ms, fsync_on_batch,
include_payload, record_client_ip, ip_anonymize, ring_buffer_capacity)
Update README.md:
Closes SMA-107.