From e1478b3863a343a5f5041aff2dd3550fa3b2c64c Mon Sep 17 00:00:00 2001 From: Piotr Duda Date: Tue, 17 Mar 2026 12:11:31 +0100 Subject: [PATCH 1/4] Update github workflows to devel --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/compat.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c04b141..eef4186 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main, develop ] + branches: [ main, devel ] pull_request: - branches: [ main, develop ] + branches: [ main, devel ] jobs: test: @@ -62,10 +62,10 @@ jobs: uv run coverage xml -o coverage.xml uv run coverage json -o coverage.json - name: Build PR coverage comment - if: github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'develop') + if: github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'devel') run: python scripts/build_coverage_comment.py - name: Post sticky PR coverage comment - if: github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'develop') + if: github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'devel') uses: marocchino/sticky-pull-request-comment@v2 with: header: coverage-report diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index 695a700..30cb542 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -2,9 +2,9 @@ name: Compatibility on: push: - branches: [ main, develop ] + branches: [ main, devel ] pull_request: - branches: [ main, develop ] + branches: [ main, devel ] types: [opened, synchronize, reopened, labeled] schedule: - cron: "0 3 * * *" From f823b46cc8fcc07e6165ef9528c4be802268417e Mon Sep 17 00:00:00 2001 From: Piotr Duda Date: Tue, 17 Mar 2026 12:11:49 +0100 Subject: [PATCH 2/4] Hint on semver post beta --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 150baec..77d4fdb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ On-device ML inference monitoring for Python. Tracks latency, errors, and model metadata without any code modifications. -> **Pre-release:** The API is unstable and may change between versions. +> **Pre-release:** The API is unstable and may change between versions. Semantic versioning will apply from the first stable release. ## Install From 8070de229e3f8a02ba46cbff32adc11f51ed44ca Mon Sep 17 00:00:00 2001 From: Piotr Duda Date: Tue, 17 Mar 2026 12:12:12 +0100 Subject: [PATCH 3/4] Resolve queue ordering bug (windows affected) --- tests/test_queue.py | 24 ++++++++++++++++++++++++ wildedge/queue.py | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/test_queue.py b/tests/test_queue.py index 9970e41..7961fe8 100644 --- a/tests/test_queue.py +++ b/tests/test_queue.py @@ -126,6 +126,30 @@ def test_persistent_queue_rehydrates_from_disk(self, tmp_path): assert q2.length() == 2 assert q2.peek() == make_event(1) + def test_persistent_queue_rehydrates_order_when_timestamps_collide( + self, tmp_path, monkeypatch + ): + fixed_ns = 1_000_000_000_000_000_000 + monkeypatch.setattr("wildedge.queue.time.time_ns", lambda: fixed_ns) + + q1 = EventQueue( + max_size=10, + policy=QueuePolicy.OPPORTUNISTIC, + persist_to_disk=True, + disk_dir=str(tmp_path), + ) + for i in range(5): + q1.add(make_event(i)) + + q2 = EventQueue( + max_size=10, + policy=QueuePolicy.OPPORTUNISTIC, + persist_to_disk=True, + disk_dir=str(tmp_path), + ) + assert q2.length() == 5 + assert [e["event_id"] for e in q2.peek_many(5)] == ["0", "1", "2", "3", "4"] + def test_persistent_queue_remove_deletes_files(self, tmp_path): q = EventQueue( max_size=10, diff --git a/wildedge/queue.py b/wildedge/queue.py index 74c27f9..44c6c50 100644 --- a/wildedge/queue.py +++ b/wildedge/queue.py @@ -35,6 +35,7 @@ def __init__( self.disk_dir = Path(disk_dir).expanduser() if disk_dir else None self._event_paths: deque[Path] = deque() self.lock = threading.Lock() + self._persist_seq = 0 if self.persist_to_disk: if self.disk_dir is None: raise ValueError("disk_dir is required when persist_to_disk=True") @@ -63,7 +64,8 @@ def persist_event(self, event: dict) -> None: if not self.persist_to_disk: return assert self.disk_dir is not None - filename = f"{time.time_ns()}-{uuid.uuid4()}.json" + filename = f"{time.time_ns():020d}-{self._persist_seq:010d}-{uuid.uuid4()}.json" + self._persist_seq += 1 path = self.disk_dir / filename path.write_text(json.dumps(event, separators=(",", ":"), ensure_ascii=True)) self._event_paths.append(path) From 656f8a69049b10ba41a74c8496647fe2d0fe548f Mon Sep 17 00:00:00 2001 From: Piotr Duda Date: Tue, 17 Mar 2026 12:14:31 +0100 Subject: [PATCH 4/4] Fix CPU max assertion to accommodate for boost/turbo modes (cur>max) --- tests/test_platform_linux.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_platform_linux.py b/tests/test_platform_linux.py index 973f7d6..5c7d431 100644 --- a/tests/test_platform_linux.py +++ b/tests/test_platform_linux.py @@ -192,8 +192,6 @@ def test_real_cpu_freq(): assert 0 < cur <= 10_000 if max_f is not None: assert 0 < max_f <= 10_000 - if cur is not None and max_f is not None: - assert cur <= max_f @pytest.mark.requires_linux