Skip to content

runtime: keep audit entry fields on one snapshot - #3453

Closed
adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/audit-entry-snapshot
Closed

adilalperenciftci wants to merge 1 commit into
aether-lang-dev:mainfrom
adilalperenciftci:fix/audit-entry-snapshot

Conversation

@adilalperenciftci

Copy link
Copy Markdown
Contributor

Summary

I reproduced the audit ring advancing between the three field accessor calls used by std.audit.entry(). Once the ring wrapped, a concurrent append could overwrite the category pointer and shift logical index zero before resource and verdict were read.

  • Copy the selected audit entry while holding the ring lock.
  • Keep category, resource, and verdict on one per-thread snapshot for the documented accessor order.
  • Preserve independent allowed reads used by audit.denied_count().
  • Add a synchronized overwrite regression test.

Verification

  • BEFORE: FAIL mixed audit entry: category=cat-new resource=res-001 allowed=1
  • AFTER: PASS: audit entry fields come from one snapshot
  • sandbox_in_spec_block passed.
  • make check-changelog
  • make check-tests
  • make test: 634 passed, 0 failed

Signed-off-by: Adil Alperen Çiftci adilalperenciftci@users.noreply.github.com

I reproduced the wrapped audit ring advancing between the category, resource, and verdict accessors, which combined fields from different entries. Copy the selected entry under the ring lock and keep the accessor sequence in thread-local storage.

Add a synchronized overwrite regression test for the std.audit read order.

Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@paul-hammant

Copy link
Copy Markdown
Collaborator

Thanks @adilalperenciftci! This landed in #3474, which batched nine of your PRs and merged on 2026-10-30 (ca1dae7d). Your commit went in unchanged with your authorship, so this PR is superseded, and I'm closing it.

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.

4 participants