Skip to content

fix: guard work import state transitions - #50

Merged
solomonneas merged 1 commit into
mainfrom
feat/work-import-state-guards
May 27, 2026
Merged

fix: guard work import state transitions#50
solomonneas merged 1 commit into
mainfrom
feat/work-import-state-guards

Conversation

@solomonneas

Copy link
Copy Markdown
Collaborator

Summary

  • prevent single-id work import promote from promoting dismissed or already promoted imports
  • prevent single-id work import dismiss from dismissing promoted or dismissed imports
  • add regression coverage for both non-pending state transitions

Review Finding

The review checkpoint found that batch promotion filtered pending imports, but single-id promote/dismiss accepted any matching import id. That let stale scanner queue items mutate after review. The commands now return exit code 2 for non-pending imports.

Validation

  • .venv/bin/python -m pytest tests/test_work_cmd.py -q
  • .venv/bin/python -m pytest -q
  • PYTHONPATH=$HOME/repos/content-guard/src python3 -m content_guard scan . --policy $HOME/repos/content-guard/policies/public-repo.json
  • git diff --check
  • live CLI smoke for dismiss-then-promote rejection

@solomonneas
solomonneas merged commit d1047cd into main May 27, 2026
11 checks passed
@solomonneas
solomonneas deleted the feat/work-import-state-guards branch May 27, 2026 14:04
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