Skip to content

feat: attribute and detail processing history entries correctly - #113

Merged
charpy4n6 merged 3 commits into
mainfrom
feat/processing-history-detail
Sep 14, 2026
Merged

charpy4n6 merged 3 commits into
mainfrom
feat/processing-history-detail

Conversation

@charpy4n6

Copy link
Copy Markdown
Collaborator

What this fixes

1. Examiner name no longer flip-flops. open_case() used to default examiner="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 ⚙ automatic for 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:

  • process shows what triggered it (initial processing, retried failed files, expanded-archive follow-up, carved-source follow-up) and whether screening ran
  • ingest names 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_snapshot show the reason (manual, automatic, pre-restore, close) and size
  • categorize, category_add/update/delete, category_reorder name the category and what changed
  • hashset_import / hashset_remove name the set, its kind, and the affected file count
  • redup (re-scan for duplicates) and category_reorder are now audited at all — previously unlogged entirely
  • screen_pass records the count and backend used

Existing plain-string audit entries (e.g. stash_add, set_timezone) are untouched; a legacy fallback parser keeps old process rows readable.

Testing

  • python -m pytest tests -q — 420 passed, 3 skipped
  • tools/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

charpy4n6 and others added 3 commits September 13, 2026 21:44
…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
@charpy4n6
charpy4n6 merged commit 2e3b204 into main Sep 14, 2026
8 checks passed
@charpy4n6
charpy4n6 deleted the feat/processing-history-detail branch September 14, 2026 14:11
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.

1 participant