gabriel / musehub public
feat patch security task/stream-security-phase4 #1 / 1
AI Agent gabriel · 130 days ago · May 11, 2026 · Diff

feat(security): content.scan job enqueue in stream path — Phase 4 of issue #51

Inside _flush_batch, after the bulk INSERT and upsert_refs, one MusehubBackgroundJob(job_type='content.scan', status='pending') is created per newly-stored object. Skipped (already-present) objects are excluded — no duplicate scan jobs. Mirrors the bundle.index path exactly.

4 TDD tests green (test_stream_security_phase4.py); 78 regression tests pass.

sha256:14738715ff714f7d90305fcc2ddcc07cfd067c8941b811f85ab206e6a486ce0c sha
+34 ~1 symbols
sha256:9e069da4c9a27762566d14423dfcd9e4e45569a70c0459a210b09483348af760 snapshot
+34
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 35 symbols
~ tests/test_stream_security_phase4.py .py 34 symbols added
+ _collect function async_function _collect L85–89
+ _commit_pack function function _commit_pack L63–66
+ _end function function _end L69–70
+ _fw variable variable _fw L35–35
+ _header function function _header L48–53
+ _make_commit function function _make_commit L73–82
+ _make_repo function async_function _make_repo L105–127
+ _obj function function _obj L56–60
+ _pack function function _pack L40–41
+ _scan_jobs function async_function _scan_jobs L92–100
+ _stub_backend function function _stub_backend L130–148
+ _wrap function function _wrap L44–45
+ AsyncMock import import AsyncMock L20–20
+ AsyncSession import import AsyncSession L19–19
+ MuseWireFrameWriter import import MuseWireFrameWriter L33–33
+ MusehubBranch import import MusehubBranch L24–24
+ MusehubRepo import import MusehubRepo L24–24
+ SFRAME_COMMIT_PACK import import SFRAME_COMMIT_PACK L25–25
+ SFRAME_END import import SFRAME_END L25–25
+ SFRAME_ERROR import import SFRAME_ERROR L25–25
+ SFRAME_HEADER import import SFRAME_HEADER L25–25
+ SFRAME_OBJECT import import SFRAME_OBJECT L25–25
+ SFRAME_RESULT import import SFRAME_RESULT L25–25
+ annotations import import annotations L14–14
+ blob_id import import blob_id L22–22
+ db import import db L23–23
+ msgpack import import msgpack L16–16
+ now_utc_iso import import now_utc_iso L22–22
+ pytest import import pytest L17–17
+ select import import select L18–18
+ test_all_skipped_yields_zero_scan_jobs function async_function test_all_skipped_yields_zero_scan_jobs L295–336
+ test_mixed_new_and_skipped_only_new_get_scan_jobs function async_function test_mixed_new_and_skipped_only_new_get_scan_jobs L242–291
+ test_new_objects_get_scan_jobs function async_function test_new_objects_get_scan_jobs L156–197
+ test_skipped_objects_get_no_scan_jobs function async_function test_skipped_objects_get_no_scan_jobs L201–238
← Older Oldest on task/stream-security-phase4
All commits
Newer → Latest on task/stream-security-phase4

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:14738715ff714f7d90305fcc2ddcc07cfd067c8941b811f85ab206e6a486ce0c --body "your comment"