Repository navigation
fix: resolve 7 bugs (4 CRITICAL, 3 MAJOR) - #2
Merged
Merged
Conversation
CRITICAL: - main.py: replace bare list[str] current_app with threading.Lock-protected accessors to eliminate race condition between asyncio loop and pynput thread - aggregator/api.py: add add_done_callback error handler on fire-and-forget observation dispatch tasks so unhandled exceptions are logged - validator/api.py: enforce OBSERVED→VALIDATED state machine — approve endpoint (REST + FlowFabric webhook) now returns 409 if observation is not OBSERVED - drift_detector.py: return drift_score=0.0 when traces list is empty; no observed baseline means drift cannot be measured (was incorrectly 1.0) MAJOR: - models.py: ProcessStep.related_event_types changed from list[str] to list[EventType] for compile-time type safety; Pydantic v2 coerces strings - capture_clipboard.py: paste payload from_app now "" instead of None when no prior copy was detected, preventing None in serialized payloads - flowfabric.py: validated_by defaults to "" in payload instead of None tests: update test_empty_traces to reflect corrected zero-drift semantics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs fixed
CRITICAL
agent/main.pycurrent_app— asyncio loop writes, pynput thread reads without synchronisationthreading.Lock-protected_get/_set_current_app()helpersaggregator/api.pycreate_taskhad no error handler — exceptions silently droppedadd_done_callbacklogs warning if task raisesvalidator/api.pyOBSERVEDobservations can be approved (REST + FlowFabric webhook)drift_detector.pydrift_score=1.0— impossible to have 100% drift with no datadrift_score=0.0whentraces=[]; no baseline = unmeasurableMAJOR
models.pyProcessStep.related_event_types: list[str]— no validation of valueslist[EventType]; Pydantic v2 coerces and validatescapture_clipboard.pyfrom_app: Nonewhen no prior copy detectedNone→""flowfabric.pyvalidated_by: Noneserialised into webhook payloadNone→""Tests
test_empty_tracesupdated to assertdrift_score=0.0(was testing old wrong behavior)