fix(audit): skip change-history entry for description checkbox toggles (PMS-349) #256

Merged
longjacksonle merged 1 commit from fix/PMS-349-skip-audit-for-checkbox-toggles into main 2026-06-16 02:04:28 +02:00

Implements PMS-349 (follow-up to PMS-348).

Problem

Toggling a rendered Markdown task-list checkbox rewrites the description with a flipped marker and PUTs it, so the server logged an "Updated Description" change-history entry for every check/uncheck - flooding the ticket/project history with noise.

Fix

A checklist toggle is a state change, not a content edit. New audit::is_task_marker_only_change(old, new), built on the existing field_changes (so HISTORY_NOISE_FIELDS still applies), is true only when the sole meaningful change is a description whose old/new differ purely by GFM task-list marker flips ([ ] <-> [x]). The ticket and project update services skip audit_write when it holds. Any other field change, a non-marker text edit, or adding/clearing the description is audited as before.

Verification

just check (cargo check + clippy + fmt + migration prefixes) passes; 5 new unit tests cover marker-only, text-edit, other-field, add/clear, and no-op cases.

🤖 Generated with Claude Code

Implements PMS-349 (follow-up to PMS-348). ## Problem Toggling a rendered Markdown task-list checkbox rewrites the description with a flipped marker and PUTs it, so the server logged an "Updated Description" change-history entry for every check/uncheck - flooding the ticket/project history with noise. ## Fix A checklist toggle is a state change, not a content edit. New `audit::is_task_marker_only_change(old, new)`, built on the existing `field_changes` (so `HISTORY_NOISE_FIELDS` still applies), is true only when the sole meaningful change is a `description` whose old/new differ purely by GFM task-list marker flips (`[ ]` <-> `[x]`). The ticket and project update services skip `audit_write` when it holds. Any other field change, a non-marker text edit, or adding/clearing the description is audited as before. ## Verification `just check` (cargo check + clippy + fmt + migration prefixes) passes; 5 new unit tests cover marker-only, text-edit, other-field, add/clear, and no-op cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(audit): don't record a change-history entry for description checkbox toggles (PMS-349)
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
E2E / Playwright against staging (pull_request) Successful in 43s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 1m13s
Integration / integration tests (pull_request) Successful in 4m46s
d793cba57e
Follow-up to PMS-348 (clickable Markdown task-list checkboxes). Toggling a rendered checkbox rewrites the description with a flipped marker and PUTs it, so the server logged an "Updated Description" audit entry for every check/uncheck, flooding the ticket/project change history.

A checklist toggle is a state change, not a content edit. Add audit::is_task_marker_only_change(old, new) (built on the existing field_changes, so the HISTORY_NOISE_FIELDS exclusion still applies): it is true only when the sole meaningful change is a description whose old/new differ purely by GFM task-list marker flips ([ ] <-> [x]). The ticket and project update services skip audit_write when it holds. Any other field change, a non-marker text edit, or adding/clearing the description is audited as before. Unit-tested for marker-only, text-edit, other-field, add/clear, and no-op cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch fix/PMS-349-skip-audit-for-checkbox-toggles 2026-06-16 02:04:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!256
No description provided.