Repository navigation
feat: attribute and detail processing history entries correctly - #113
Merged
Merged
Conversation
…buted Three problems with the case's processing-history (audit) log, worked together since they all stem from the same log: 1. Audit entries alternated between the examiner's real name and the literal placeholder word "examiner". open_case() always overwrote the stored examiner name with its own default unless the caller supplied one explicitly - and almost every re-open path (the launcher, recent cases, restoring a snapshot, most CLI commands) doesn't. Now a name is only ever written when the caller genuinely supplies one (case creation, or an explicit --examiner); every other open reads back whatever is already stored instead of clobbering it. Same fix applied to the CLI's --examiner default. 2. Tool-triggered actions were indistinguishable from - or in the case of auto-snapshots, entirely absent from - an examiner's own actions. gleapp.db.TOOL_ACTOR is a shared actor string for anything GLEAPP does on its own (a timed auto-snapshot, a close-time save, the safety copy before a restore); the periodic and close-time auto-snapshots are now actually logged (they weren't before), and the history panel renders that actor as a distinct "⚙ automatic" tag instead of a name. A related mislabel found in passing: hash-set imports were always logged as actor "system" even though only an examiner ever triggers one. 3. Detail text was either a bare internal code (categorize logged "cat=2 ids=[104,105]") or, for "process", a fragile Python dict-repr string. The actions examiners actually look at are now logged as JSON and rendered as plain sentences: categorize, category add/update/ delete/reorder, snapshot/restore, ingest (naming each source and kind, never the evidence folder's real name - that also flows into the LAVA export), process (now says whether it was the ingest-time run or a scoped rerun like "Retried failed files", and whether screening ran), hash-set import/remove, screen_pass, and a new "Re-scan for duplicates" entry that plugs a gap where that action left no trace at all, alongside category reorder (same gap). Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ry-detail # Conflicts: # gleapp/web/templates/index.html
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.
What this fixes
1. Examiner name no longer flip-flops.
open_case()used to defaultexaminer="examiner"and unconditionally write it back on every open, so any code path that re-opened a case without passing--examiner/an examiner (launcher,/api/case/open, snapshot restore, several CLI commands) silently overwrote the name that was actually entered at ingest. Now the examiner name is only ever written when a caller explicitly supplies one; every other open reads back whatever is already stored.2. Tool actions are now distinguished from examiner actions. A new
TOOL_ACTOR = "GLEAPP (automatic)"constant marks anything GLEAPP itself triggers — periodic auto-snapshots, the safety snapshot taken before a restore, case-close snapshots — as opposed to something the examiner did (manual snapshot, categorization, hash-set import, etc.). The processing history list now renders⚙ automaticfor tool-attributed rows instead of the examiner's name.3. Processing history entries are structured and human-readable. Audit details are now JSON instead of ad-hoc strings, with per-action renderers in the UI:
processshows what triggered it (initial processing, retried failed files, expanded-archive follow-up, carved-source follow-up) and whether screening raningestnames each source and its kind, without ever including a local file path (the source's own declared label only — verified by a new test)snapshot/restore_snapshotshow the reason (manual, automatic, pre-restore, close) and sizecategorize,category_add/update/delete,category_reordername the category and what changedhashset_import/hashset_removename the set, its kind, and the affected file countredup(re-scan for duplicates) andcategory_reorderare now audited at all — previously unlogged entirelyscreen_passrecords the count and backend usedExisting plain-string audit entries (e.g.
stash_add,set_timezone) are untouched; a legacy fallback parser keeps oldprocessrows readable.Testing
python -m pytest tests -q— 420 passed, 3 skippedtools/lint_changed.py --base-ref origin/main— no new pylint warnings (94 pre-existing, 94 after)tools/check_line_endings.sh— all tracked text files LF🤖 Generated with Claude Code