← Back to Pull requests

[18.0] Expose jobrunner metrics #1029

Open
yvaucher opened this pull request with 245 lines diff across 8 files
View on GitHub
yvaucher yvaucher commented on Nov 04, 2026 16:53 UTC
Author

This is based on #976

This turns out to be fairly simple. A few things worth noting:

> - The http server runs in the same thread and event loop as listen/notify job events, so there are no concurrency issues while accessing the channels stats

- I added the set of jobs waiting for dependencies on each channel for completeness and convenient access to that stat, similar to what is done for failed jobs.

- I used the prometheus-client external library. It's currently required even if the metrics server is not configured. This could be improved by mocking the lib and making it mandatory only for users enabling the metrics server. Or make it a required dependency (which is my preference, for simplicity).

- This still needs tests and docs.

> Test by setting ODOO_QUEUE_JOB_METRICS_PORT=8080 before running Odoo then watch curl -s http://localhost:8080.

Diff: 245 lines (+238 / -7) across 8 files Reviewer: sbidoul Review duration: 40491m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.46) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 245 lines diff across 8 files
0.46
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 5 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
91%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.329
Real PR Conversation Timeline
34 items
oca-cla-bot[bot] oca-cla-bot[bot] commented on Nov 04, 2026 16:53 UTC
Bot

All commit authors signed the Contributor License Agreement.

![CLA signed](https://clabot.odoo-community.org/)<!-- CLA BOT SIGNING COMMENT DO NOT EDIT -->

OCA-git-bot OCA-git-bot commented on Nov 04, 2026 16:53 UTC
Bot

Hi @guewen, @sbidoul,
some modules you are maintaining are being modified, check this out!

sbidoul sbidoul commented on code on Nov 04, 2026 17:13 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -15,6 +15,7 @@
 from . import metrics
 
 RELOAD_PAYLOAD = "reload"
+ROOT = "root"

this new constant seems unrelated to this PR

sbidoul sbidoul commented on code on Nov 04, 2026 17:17 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -686,6 +686,17 @@ def initialize_databases(self):
             else:
                 db.close()
 
+    def _jobs_to_do_gauge(self) -> float:
+        """Return the total number of jobs to do across all databases."""
+        total = 0
+        for channel_manager in self._channel_managers:
+            total += len(channel_manager._jobs_by_uuid)
+        return total

jobs_to_do can be a per ChannelManager gauge with a db label, so we have granular per db data and the sum can be obtained downstream with queries in the metrics database.

sbidoul sbidoul commented on code on Nov 04, 2026 17:19 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -455,15 +456,17 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
-        self._metrics_labels = None
-        self._register_channel_gauges()
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
 
     def __del__(self):
-        self._unregister_channel_gauges()
+        self._unregister_metrics()
 
-    def _register_channel_gauges(self) -> None:
-        self._unregister_channel_gauges()
+    def register_metrics(self) -> None:
+        """Register gauges for a specific database in this channel."""
+        self._unregister_metrics()
         self._metrics_labels = {
+            "db": self.db_name,

Note to self: I think self.db_name can be None if this is the global ChannelManager. Test that this works.

sbidoul sbidoul commented on code on Nov 04, 2026 17:27 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1019,7 +1027,7 @@ def parse_simple_config(cls, config_string):
                     config["capacity"] = int(config_items[0])
                     config_items.pop(0)
                 except Exception as ex:
-                    if name == "root":
+                    if name == ROOT:

unrelated change?

sbidoul sbidoul commented on code on Nov 04, 2026 17:30 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1205,3 +1292,12 @@ def get_wakeup_time(self):
     def running_count(self) -> int:
         """Number of jobs currently running"""
         return len(self._root_channel._running)
+
+    def _jobs_to_do_gauge(self) -> float:
+        return len(self._jobs_by_uuid)
+
+    def register_metrics(self):
+        for channel in self._channels_by_name.values():
+            channel.register_metrics()
+            if channel.parent:
+                channel.parent.register_metrics()

Is that part necessary since we iterate on all channels of the ChannelManager?

sbidoul sbidoul commented on code on Nov 04, 2026 17:33 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -455,15 +456,17 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
-        self._metrics_labels = None
-        self._register_channel_gauges()
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}

Any particular reason to use an empty dict rather than None?

sbidoul sbidoul commented on code on Nov 04, 2026 17:34 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -450,6 +456,63 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
+
+    def __del__(self):
+        self._unregister_metrics()
+
+    def register_metrics(self) -> None:
+        """Register gauges for a specific database in this channel."""
+        self._unregister_metrics()
+        self._metrics_labels = {
+            "db": self.db_name,
+            "channel": self.fullname,
+            "root": not bool(self.parent),
+            "leaf": not bool(self.children),
+        }
+        metrics.channel_capacity.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._capacity_gauge
+        )
+        metrics.channel_pending.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._pending_gauge
+        )
+        metrics.channel_running.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._running_gauge
+        )
+        metrics.channel_failed.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._failed_gauge
+        )
+        metrics.channel_waiting_dependencies.labels(
+            **self._metrics_labels
+        ).set_function(weakref.proxy(self)._waiting_dependencies_gauge)
+
+    def _unregister_metrics(self) -> None:
+        if not self._metrics_labels:
+            return
+        metrics.channel_capacity.remove_by_labels(self._metrics_labels)
+        metrics.channel_pending.remove_by_labels(self._metrics_labels)
+        metrics.channel_running.remove_by_labels(self._metrics_labels)
+        metrics.channel_failed.remove_by_labels(self._metrics_labels)
+        metrics.channel_waiting_dependencies.remove_by_labels(self._metrics_labels)
+        self._metrics_labels.clear()

        self._metrics_labels = None

sbidoul sbidoul commented on code on Nov 04, 2026 17:34 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -450,6 +456,63 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
+
+    def __del__(self):
+        self._unregister_metrics()
+
+    def register_metrics(self) -> None:
+        """Register gauges for a specific database in this channel."""
+        self._unregister_metrics()
+        self._metrics_labels = {
+            "db": self.db_name,
+            "channel": self.fullname,
+            "root": not bool(self.parent),
+            "leaf": not bool(self.children),
+        }
+        metrics.channel_capacity.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._capacity_gauge
+        )
+        metrics.channel_pending.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._pending_gauge
+        )
+        metrics.channel_running.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._running_gauge
+        )
+        metrics.channel_failed.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._failed_gauge
+        )
+        metrics.channel_waiting_dependencies.labels(
+            **self._metrics_labels
+        ).set_function(weakref.proxy(self)._waiting_dependencies_gauge)
+
+    def _unregister_metrics(self) -> None:
+        if not self._metrics_labels:
+            return
+        metrics.channel_capacity.remove_by_labels(self._metrics_labels)
+        metrics.channel_pending.remove_by_labels(self._metrics_labels)
+        metrics.channel_running.remove_by_labels(self._metrics_labels)
+        metrics.channel_failed.remove_by_labels(self._metrics_labels)
+        metrics.channel_waiting_dependencies.remove_by_labels(self._metrics_labels)
+        self._metrics_labels.clear()
+
+    def _capacity_gauge(self) -> float:
+        if self.capacity is None:
+            return math.inf

Note to self: test that prometheus client renders math.inf correctly

sbidoul sbidoul commented on code on Nov 04, 2026 17:39 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -827,6 +879,7 @@ def run(self):
                 #       on which queue_job is installed after server start?
                 self.initialize_databases()
                 _logger.info("database connections ready")
+                self.register_metrics()

Should we rather do this for each ChannelManager, in _configure_db, and when creating the server_wide_channel_manager?

sbidoul sbidoul commented on code on Nov 04, 2026 17:42 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -450,6 +456,63 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
+
+    def __del__(self):
+        self._unregister_metrics()

We can keep this, but it's probably safer to do it also at deterministic points, in _configure_db when a ChannelManager for a db is replaced.

sbidoul sbidoul commented on Nov 04, 2026 17:42 UTC
Reviewer

Thanks! A few thoughts after a first read.

yvaucher yvaucher commented on code on Nov 05, 2026 09:09 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1205,3 +1292,12 @@ def get_wakeup_time(self):
     def running_count(self) -> int:
         """Number of jobs currently running"""
         return len(self._root_channel._running)
+
+    def _jobs_to_do_gauge(self) -> float:
+        return len(self._jobs_by_uuid)
+
+    def register_metrics(self):
+        for channel in self._channels_by_name.values():
+            channel.register_metrics()
+            if channel.parent:
+                channel.parent.register_metrics()

Should indeed not be necessary, I'll test without it.

yvaucher yvaucher commented on code on Nov 05, 2026 09:12 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -827,6 +879,7 @@ def run(self):
                 #       on which queue_job is installed after server start?
                 self.initialize_databases()
                 _logger.info("database connections ready")
+                self.register_metrics()

I was hesitant to put it in initalize_database as for me we do this setup once the db are set and it is not in the scope of initializing the database. But if you find it more convenient I will move it to _configure_db and server_wide_channel_manager

yvaucher yvaucher commented on code on Nov 05, 2026 09:13 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -686,6 +686,17 @@ def initialize_databases(self):
             else:
                 db.close()
 
+    def _jobs_to_do_gauge(self) -> float:
+        """Return the total number of jobs to do across all databases."""
+        total = 0
+        for channel_manager in self._channel_managers:
+            total += len(channel_manager._jobs_by_uuid)
+        return total

Good idea the overall to do gauge is not very helpful.

sbidoul sbidoul commented on code on Nov 05, 2026 09:18 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -827,6 +879,7 @@ def run(self):
                 #       on which queue_job is installed after server start?
                 self.initialize_databases()
                 _logger.info("database connections ready")
+                self.register_metrics()

With the new per db config, the ChannelManager of a db is re-created when a channel config changes, so we need to reset the metrics at the point too. Look for RELOAD_PAYLOAD to see how it works. It ends up calling _configure_db when, say, the parent or capacity of a channel is changed in db.

yvaucher yvaucher commented on code on Nov 05, 2026 09:55 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -455,15 +456,17 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
-        self._metrics_labels = None
-        self._register_channel_gauges()
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}

Changed back to None, it was to be explicit on the type but a initialized dict is probably a bad idea.

sbidoul sbidoul commented on code on Nov 05, 2026 11:04 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1205,3 +1288,15 @@ def get_wakeup_time(self):
     def running_count(self) -> int:
         """Number of jobs currently running"""
         return len(self._root_channel._running)
+
+    def _jobs_to_do_gauge(self) -> float:
+        return len(self._jobs_by_uuid)
+
+    def register_metrics(self):
+        for channel in self._channels_by_name.values():
+            channel.register_metrics()
+
+        if self.db_name:
+            metrics.jobs_to_do.labels(db=self.db_name).set_function(
+                self._jobs_to_do_gauge
+            )

        metrics.jobs_to_do.labels(db=self.db_name).set_function(
            self._jobs_to_do_gauge
        )

This gauge must be present for the server wide ChannelManager too, like other channel metrics, and that one has no db. So that's relates to the other comment to test what happens when db_name is None.

sbidoul sbidoul commented on code on Nov 05, 2026 11:07 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -639,11 +666,12 @@ def _configure_db(self, db):
         self._channel_managers = list(self._channel_manager_by_db.values())
         self._notify_existing_jobs(db, channel_manager)
         _logger.info("channels configuration loaded for db %s", db_name)
+        self.register_metrics()

    def _configure_db(self, db):
        """Build the channel manager for a database and reload its jobs"""
        db_name = db.db_name
        channel_manager = self._build_channel_manager(db)
        if db_name in self._channel_manager_by_db:
             self._channel_manager_by_db[db_name].unregister_metrics()
        self._channel_manager_by_db[db_name] = channel_manager
        channel_manager.register_metrics()
        self._channel_managers = list(self._channel_manager_by_db.values())
        self._notify_existing_jobs(db, channel_manager)
        _logger.info("channels configuration loaded for db %s", db_name)

I was thinking of something like this. What do you think?

sbidoul sbidoul commented on code on Nov 05, 2026 11:22 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -630,6 +656,7 @@ def _register_db_server_wide(self, db):
         self._channel_manager_by_db[db_name] = channel_manager
         self._channel_managers = [self._server_wide_channel_manager]
         self._notify_existing_jobs(db, channel_manager)
+        self.register_metrics()

This one should not be here. Because the server wide channel manager is a singleton without db_name, we don't need to re-register metrics for each db. It should move somewhere near the creation of the server wide ChannelManager

sbidoul sbidoul commented on Nov 05, 2026 11:42 UTC
Contributor

Can you also add prometheus-client to the manifest external deps?

yvaucher yvaucher commented on code on Nov 05, 2026 11:54 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -639,11 +666,12 @@ def _configure_db(self, db):
         self._channel_managers = list(self._channel_manager_by_db.values())
         self._notify_existing_jobs(db, channel_manager)
         _logger.info("channels configuration loaded for db %s", db_name)
+        self.register_metrics()

Ok, I'll add an unregister on the channel manager.

However, it seems we need the register_metrics after _notify_existing_jobs to initialize correctly the metrics, as notify_existing_jobs initialize the jobs and thus fills in the categories based on state. The gauge would be only valid on first update otherwise.

sbidoul sbidoul commented on code on Nov 05, 2026 11:59 UTC
Code Review
queue_job/jobrunner/runner.py:1
@@ -639,11 +666,12 @@ def _configure_db(self, db):
         self._channel_managers = list(self._channel_manager_by_db.values())
         self._notify_existing_jobs(db, channel_manager)
         _logger.info("channels configuration loaded for db %s", db_name)
+        self.register_metrics()

It should not be a problem because the labels only depend on the channels config, and the values of the gauges can't be queried before _notify_existing_jobs because all this happens in the same thread.

amh-mw amh-mw commented on Nov 05, 2026 12:19 UTC
Contributor

Can you also add prometheus-client to the manifest external deps?

Late to the party here and not familiar with prometheus, but is it appropriate to hardcode a metrics collection agent and additional python dependencies into the main queue_job module? I'm running on AWS, won't use this, and would prefer not to install a python package that won't get used at best, and will steal CPU cycles at worst.

amh-mw amh-mw commented on Nov 05, 2026 12:23 UTC
Contributor

Late to the party here and not familiar with prometheus, but is it appropriate to hardcode a metrics collection agent and additional python dependencies into the main queue_job module? I'm running on AWS, won't use this, and would prefer not to install a python package that won't get used at best, and will steal CPU cycles at worst.

It looks like Prometheus metrics collected by the CloudWatch agent, so that removes some decent portion of my argument against.

sbidoul sbidoul commented on code on Nov 05, 2026 13:08 UTC
Code Review
queue_job/readme/CONFIGURE.md:1
@@ -82,6 +81,8 @@ The execution of channels by the job runner is defined by:
       or `localhost` if unset
     - `ODOO_QUEUE_JOB_HTTP_AUTH_USER=jobrunner`, default empty
     - `ODOO_QUEUE_JOB_HTTP_AUTH_PASSWORD=s3cr3t`, default empty
+    - `ODOO_QUEUE_JOB_METRICS_LISTEN_ADDRESS=127.0.0.1`, default empty

    - `ODOO_QUEUE_JOB_METRICS_LISTEN_ADDRESS=127.0.0.1`, default 127.0.0.1

sbidoul sbidoul commented on code on Nov 05, 2026 13:11 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -455,15 +456,17 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
-        self._metrics_labels = None
-        self._register_channel_gauges()
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
 
     def __del__(self):
-        self._unregister_channel_gauges()
+        self._unregister_metrics()
 
-    def _register_channel_gauges(self) -> None:
-        self._unregister_channel_gauges()
+    def register_metrics(self) -> None:
+        """Register gauges for a specific database in this channel."""
+        self._unregister_metrics()
         self._metrics_labels = {
+            "db": self.db_name,

It renders db="None". Not ideal. So maybe __all__?

sbidoul sbidoul commented on code on Nov 05, 2026 13:24 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1166,7 +1247,9 @@ def notify(
                 self.remove_job(uuid)
                 job = None
         if not job:
-            job = ChannelJob(db_name, channel, uuid, seq, date_created, priority, eta)
+            job = ChannelJob(
+                self.db_name, channel, uuid, seq, date_created, priority, eta
+            )

I'm afraid we can't use self.db_name here because the server wide ChannelManager does not have a db_name.

sbidoul sbidoul commented on code on Nov 05, 2026 13:44 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1166,7 +1247,9 @@ def notify(
                 self.remove_job(uuid)
                 job = None
         if not job:
-            job = ChannelJob(db_name, channel, uuid, seq, date_created, priority, eta)
+            job = ChannelJob(
+                self.db_name, channel, uuid, seq, date_created, priority, eta
+            )

So yeah, storing db_name on the ChannelManager is fine but we probably can't use it anywhere except as a metrics label.

yvaucher yvaucher commented on Nov 05, 2026 14:03 UTC
Author

@amh-mw on our wish list we have the extraction of the metrics in a separate module and the possibility to plug other observability tools such as opentelemetry.

The state of this PR is still in draft. Your input are welcome nevertheless, and I agree with you that we might not want to enforce the usage of Prometheus.

yvaucher yvaucher commented on code on Nov 05, 2026 16:50 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -1166,7 +1247,9 @@ def notify(
                 self.remove_job(uuid)
                 job = None
         if not job:
-            job = ChannelJob(db_name, channel, uuid, seq, date_created, priority, eta)
+            job = ChannelJob(
+                self.db_name, channel, uuid, seq, date_created, priority, eta
+            )

Reverted the store of db_name on ChannelManager it is only stored on Channel as the server_wide manager can be used for multiple database.

sbidoul sbidoul commented on code on Nov 05, 2026 17:47 UTC
Code Review
queue_job/jobrunner/channels.py:1
@@ -450,6 +456,63 @@ def __init__(
         self.sequential = sequential or (parent and parent.sequential_default)
         self.sequential_default = sequential_default
         self.paused = paused
+        self.db_name = db_name
+        self._metrics_labels = {}  # {"channel": ..., "db": ..., "root": ..., "leaf": ...}
+
+    def __del__(self):
+        self._unregister_metrics()
+
+    def register_metrics(self) -> None:
+        """Register gauges for a specific database in this channel."""
+        self._unregister_metrics()
+        self._metrics_labels = {
+            "db": self.db_name,
+            "channel": self.fullname,
+            "root": not bool(self.parent),
+            "leaf": not bool(self.children),
+        }
+        metrics.channel_capacity.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._capacity_gauge
+        )
+        metrics.channel_pending.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._pending_gauge
+        )
+        metrics.channel_running.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._running_gauge
+        )
+        metrics.channel_failed.labels(**self._metrics_labels).set_function(
+            weakref.proxy(self)._failed_gauge
+        )
+        metrics.channel_waiting_dependencies.labels(
+            **self._metrics_labels
+        ).set_function(weakref.proxy(self)._waiting_dependencies_gauge)
+
+    def _unregister_metrics(self) -> None:
+        if not self._metrics_labels:
+            return
+        metrics.channel_capacity.remove_by_labels(self._metrics_labels)
+        metrics.channel_pending.remove_by_labels(self._metrics_labels)
+        metrics.channel_running.remove_by_labels(self._metrics_labels)
+        metrics.channel_failed.remove_by_labels(self._metrics_labels)
+        metrics.channel_waiting_dependencies.remove_by_labels(self._metrics_labels)
+        self._metrics_labels.clear()
+
+    def _capacity_gauge(self) -> float:
+        if self.capacity is None:
+            return math.inf

It renders +Inf. Now need to see what prometheus and grafana do with that.

Reviewers
Assignees
yvaucher yvaucher
Labels
risk: low confidence: 91.2% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 46.2% (MEDIUM) · Higher = larger blast radius
46.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 91.2% · Lower = rushed or shallow review
91.2%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 4.1% · Safe to merge
4.1%
Repository