Skip to content

feat(findings): report stage separate from triage status - #308

Merged
BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:feat/finding-report-state
Nov 17, 2026
Merged

BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:feat/finding-report-state

Conversation

@Coff0xc

@Coff0xc Coff0xc commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Closes #297.

Triage already has a bulk status action. This is the other half: a report_state column (none / submitted / accepted / rejected / duplicate) so a finding can be confirmed and submitted at the same time.

It's a workflow stage, not a verdict. Lesson extraction still reads status. Status-change notifications do not fire when only the report stage changes.

The Findings toolbar can set it in bulk the same way as status (one transaction, per-id result, cap 500). List, filter, stats, detail, and export follow.

Verified: go build ./..., go vet ./server ./db ./report, handler validation and DTO tests. The PG tests skip locally and run in CI.

Copilot AI balanced review requested due to automatic review settings November 17, 2026 19:47

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. Try requesting a review at a lower effort level.

@BaaRai BaaRai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for taking the second half of #297, and for reusing the bulk helper from #298 instead of duplicating it. The shape is right: a workflow stage separate from the verdict, no notification event, and the filter, stats, export and UI are all wired.

One blocker before merge: restoring an archive created before this migration fails.

insertArchiveRows restores every table with INSERT INTO findings SELECT * FROM json_populate_recordset(NULL::findings, …) (db/task_archives_restore.go:364-399). As the comment right above it explains for the side-memory fields, json_populate_recordset inserts NULL for a column absent from the JSON, bypassing the SQL default. An archive written before this PR has no report_state key, and the column is NOT NULL DEFAULT 'none', so the restore hits a not-null violation and the whole restore is refused. The existing side-memory workaround is the pattern to apply here: set "none" when the row lacks report_state. Please add a test that restores a findings row serialized without the column; the round-trip test archives from the current schema, so it cannot catch this.

One coordination note: this uses migration 0006 and #300 also uses 0006. Whichever lands first keeps it; if this one lands first I'll ask #300 to renumber to 0007.

@BaaRai
BaaRai force-pushed the feat/finding-report-state branch from df0c14b to 6a0b79d Compare November 17, 2026 23:08
@BaaRai
BaaRai merged commit 9a2a9e6 into BaaRai:main Nov 17, 2026
5 checks passed
@BaaRai

BaaRai commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thanks. I pushed the review fixes to your branch before merging: rebased on current main, renamed the migration to 0007 (0006 is taken by the activity outbox), and added the archive-restore compatibility for report_state (fillArchiveDefaults restores "none" when an older archive has no such key) with a pure test. Merged as 9a2a9e6.

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.

Findings: bulk status update, and a report stage separate from the triage status

3 participants