Process observability
Telemetry on the delivery process itself (review quality, gate health), and whether its scheduled jobs are still runningTeams instrument their product obsessively — funnels, error rates, latency — and their process not at all. Nobody can say what share of pull requests (PRs) actually get reviewed, whether a gate passes 100% of the time (theater) or fails constantly (noise), whether CI is quietly getting slower, or what the automated reviewer costs against what it catches. So decisions about the delivery process — promote this gate to blocking, keep paying for that reviewer, trust this number — run on vibes. Worse, teams that do provision instruments often leave them fail-open: a metric on the dashboard whose data source was never wired, a key never set, a TODO where a query should be. That is not a half-measure — it reads as a real measurement while it is silently dark, so the “measure” step looks done and the decision runs on a gauge that reads zero because nothing feeds it. This module instruments the delivery system itself, and makes “claimed but not wired” a mechanical failure.
The delivery process emits telemetry — review outcomes and their cost,
gate results and their duration, cycle times — as a closed set of typed
events. Every process metric declares a wired source: an instrument
that is provisioned but dark (fail-open, TODO, unset) is treated as worse
than absent and fails a gate. Dashboards make process drift visible, and
measurements drive promote/demote decisions for gates and review
lenses — a promotion must cite a recorded measurement
from a provably live instrument before autonomy increases.
Every scheduled job declares the cadence it is expected to produce a
result at. A job whose latest result is older than that cadence plus a
grace, or that has produced none, is stale (unless its failures in a
row already make it red, the more specific fact), and stale is never
green: a job is exactly one of green, degraded, red, stale or running.
The watcher reports to an external monitor on a success and on a
failure, so if the watcher itself stops, the missing report raises the
incident (a dead-man’s switch). How many failures in a row make a job
red is configured per job.
External-precondition failures reconcile one current issue per registry;
a complete healthy observation closes it automatically.
A scheduled check reports each distinct cause as one issue, identified by
a stable cause fingerprint. Recurrences update that issue;
confirmed recovery closes it. A flood breaker for each
cause announces when it suppresses repeated comments after N consecutive
failures, and re-arms only on genuine recovery. The test job produces
evidence only; a separate triage step classifies and reconciles issues.
Everything below applies these tool-independent statements; concrete per-backend wiring lives in mappings.md.
M11 Lite — minimum useful
the process events you care about are named and documented (TELEMETRY.md + event-schema.yaml), and at least one is actually emitted (start with gate results — you already run gates). Enforcement may be convention.
- The process events the team measures (review outcome + cost, gate pass/fail + duration, cycle times) are named and documented as a closed set, distinct from product analytics.
process-events-documentedWhat the audit looks for (2)- a telemetry doc / event-schema names the process event types and their required fields
- it is explicit that these measure the delivery process, not the product
- At least one process event is actually emitted by the machinery that runs the process (not merely described).
at-least-one-event-emittedWhat the audit looks for (1)- an emitter posts at least one event type (e.g. gate_result from the gate ladder)
M11 Standard — production teams
a metrics registry exists with wired sources and the no-dark-instruments check runs (mechanical); review outcomes and gate results are emitted as events validated by the event-schema lint; every scheduled job is in the cadence registry and a scheduled watcher classifies its runs, failing for a job that is stale or red (mechanical); each external-precondition registry reconciles one current issue that closes only after a complete healthy observation (mechanical); and scheduled failures have evidence-only test jobs and separate triage that maintains one issue per cause, with confirmed recovery and an announced per-cause flood breaker (mechanical).
- A metrics registry exists where every metric declares a wired source and an owner, and a check fails the build if any source is missing, empty, or a placeholder (a dark instrument).
metrics-registry-no-dark-instrumentsWhat the audit looks for (2)- a metrics-registry file lists metrics each with a source + owner
- a no-dark-instruments check runs and fails on a TODO/empty/unset source
- Review outcomes and gate results are emitted as typed events and validated against the declared event schema by a lint.
review-and-gate-events-validatedWhat the audit looks for (2)- review_completed and gate_result events are emitted with their required fields
- an event-schema lint validates a stream and fails on an unknown type or missing required field
- Every scheduled job is declared in a cadence registry with the interval it must produce a result at, a check fails a scheduled workflow missing from it, and a scheduled watcher classifies each job's run history and fails for a job that is stale (no result inside its cadence plus grace) or red, so a schedule that stopped running never reads as green (expected-absent for a repository with no scheduled job).
scheduled-jobs-staleness-watchedWhat the audit looks for (3)- a cadence registry lists each scheduled job with an expected cadence (and a grace and a red threshold, or the defaults)
- a check fails a scheduled workflow that the registry does not list
- a scheduled workflow classifies each job's runs against its cadence and exits non-zero for stale and for red
- Scheduled-check test jobs produce evidence without tracker or model calls; separate triage classifies findings as regression, intended change, flake or environment and maintains one issue per stable cause fingerprint, updating recurrences and closing only on confirmed recovery covering that cause (expected-absent with no scheduled check).
scheduled-failures-reconciled-per-causeWhat the audit looks for (4)- test job commands only collect evidence; tracker and optional model calls occur in separate triage
- triage records each classification, uses stable fingerprints excluding volatile run data, and updates or reopens the same issue
- closure requires complete evidence covering the cause; missing, skipped, cancelled, partial or blocked checks leave it open
- durable state and coordinated writes prevent replay or overlapping runs from duplicating issues or comments, and reject stale recovery
- Each scheduled-failure cause has a durable breaker that announces suppression after a declared positive N consecutive failures, bounds further recurrence comments while retaining evidence and an open issue, and re-arms on confirmed recovery; unknown evidence does not reset it and other causes report independently (expected-absent with no scheduled check).
scheduled-failure-flood-breakerWhat the audit looks for (4)- a reviewed threshold N governs each cause's failure streak and a durable per-cause breaker suppresses subsequent comments
- the Nth failure announces suppression, including at opening for N = 1; collection and failed verdicts continue
- confirmed recovery comments, closes and clears suppression; silence, restarts, unknown observations and manual closure do not re-arm it
- replayed observations do not advance streaks, and one cause's breaker does not suppress another
- Each external-precondition registry maintains exactly one current tracker issue while anything is unresolved, updates it after each observation, and closes it automatically only after a complete healthy observation.
external-preconditions-issue-reconciledWhat the audit looks for (4)- a stable registry marker identifies the issue, among only the issues the reconciling identity opened; every page of open issues is read and failed or malformed listings fail without writing
- runs that reconcile the same marker are serialized; duplicate open markers fail for manual reconciliation
- failed, unknown and pending entries keep the issue open with owners and recovery actions; a fully healthy report or valid visible waivers closes it
- invalid registries and unavailable reader credentials are red observations, never an empty green report; tracker failures fail the run
M11 Strict — regulated / compliance posture
both gates run in CI with their self-tests (mechanical); the watcher reports to an external monitor on success and on failure, so a watcher that stops is itself an incident; reviewer/lens promotion decisions cite recorded measurements (ties to M7 / M8); and dashboards for gate pass-rate, review-adoption, and cost exist and are reviewed on a cadence.
- The no-dark-instruments gate and the event-schema lint each ship a self-test that runs in CI, so a broken observability gate fails loudly.
observability-gates-self-testedWhat the audit looks for (2)- each gate has a paired self-test exercising a known pass and a known fail
- CI runs the self-tests
- Promoting a gate to blocking, or a reviewer/lens from comment-only to blocking, cites a recorded measurement from a provably live instrument (ties to M7's precision bar and M8's parity report).
promotion-cites-recorded-measurementWhat the audit looks for (2)- a promoted gate/reviewer/lens carries a recorded measurement clearing the bar
- the instrument behind it is wired (passes no-dark-instruments), not aspirational
- Dashboards for gate pass-rate, review-adoption, and reviewer cost exist, render from the registry, and are reviewed on a cadence.
process-dashboards-reviewedWhat the audit looks for (2)- dashboards for pass-rate + adoption + cost exist and trace to registry metrics
- a review cadence for them is stated (drift is looked at, not just recorded)
- The heartbeat watcher reports to a monitor outside the system it watches on both outcomes, a success when no job is red or stale and a failure otherwise, and the monitor raises an incident when a report does not arrive, so a watcher that itself stopped is an incident (expected-absent for a repository with no scheduled job).
heartbeat-reports-to-external-monitorWhat the audit looks for (2)- the watcher's workflow sends a report to an external monitor after the verdict, with a success form and a failure form
- the monitor's expected period matches the watcher's cadence and it alerts on a missing report
Adoption steps
- Copy
TELEMETRY.mdandevent-schema.yaml; prune the event set to what you emit, and wire one emitter for real —gate_resultis the cheapest start (the M1 gates already produce the pass/fail). - Start a
metrics-registry.yaml: register only metrics you will actually watch, each with a wired source and an owner. - Add the no-dark-instruments gate so a metric can never merge with an unwired source, and the event-schema lint so emitted events can’t drift from the schema.
- Build dashboards from the registry (recipes per backend in mappings.md); review them on a cadence.
- List every scheduled job in a
scheduled-jobs.yamlwith the cadence you expect, add the coverage check so a new schedule cannot arrive unlisted, and run the heartbeat classifier on a schedule of its own over the provider’s run history (collectors per provider). Make it fail on red and on stale. - Have the watcher report to an external monitor on both outcomes, and have the monitor page when a report is missing.
- Separate scheduled-check evidence collection from triage. Adopt the issue lifecycle above, choose N per cause policy, and verify recurrence, suppression, recovery, unknown evidence, concurrent runs and replay before enabling tracker writes.
- Gate every promote decision in M7 / M8 on a measurement from a live instrument — never a dark one.
One current issue for external preconditionsAn external precondition that fails every day needs one current issue, not one issue per run. A reconciler compares a complete observation with the tracker's current state: it opens the…Open
An external precondition that fails every day needs one current issue, not one issue per run. A reconciler compares a complete observation with the tracker’s current state: it opens the registry’s issue when anything fails, updates it with the current failing entries, and closes it automatically only after every entry passes or has a valid, visible waiver. Pending checks and failed reads keep it open. Each entry names its owner and recovery action; the report does not contain secret values.
Use a stable machine marker rather than a title search, read every page of open issues, and serialize observations that write the same marker. A marker anyone can type is an identifier, not ownership: consider only issues the reconciling identity opened. If a lookup fails or duplicate open issues carry the marker, fail without writing or closing anything. An invalid registry is an observation failure, never an empty green report. Tracker failures fail the run as well: checking without maintaining the issue leaves the operational work invisible.
The M10 reference provides the external-registry reconciler behind a tracker interface, with a GitHub Issues adapter. The checks remain read-only against the systems they inspect; tracker reconciliation is the explicit write boundary. The heartbeat still watches whether the scheduled observation ran.
Core piecesThe model as a copyable narrative is templates/TELEMETRY.md.Open
-
Typed process events — the process emits a closed set of event types (review outcome + cost, gate pass/fail + duration, cycle times, deploy results), declared once in
templates/event-schema.yamland validated by the event-schema lint so a typo’d type or a missing required field can’t quietly corrupt a metric. This measures the delivery process, not the product. -
A metric registry with no dark instruments — every process metric lives in
templates/metrics-registry.yamlwith a wiredsourceand an owner. The no-dark-instruments gate fails the build if any source is missing, empty, or a placeholder, because a silently-dark instrument makes the “measure” step aspirational. -
Parity measurement — reused from M8, not duplicated. What a reviewer’s recall/precision/
missed_blockersnumbers mean and how they gate promotion is M8’s parity report. M11 owns the other half: the telemetry emission those numbers are computed from, the registry they are declared in, and the no-dark-instruments discipline that keeps them honest. -
Dashboards that make drift visible — metrics roll up from the events into dashboards whose job is to surface an adoption rate sliding, a gate’s pass-rate collapsing, or cycle time creeping up, early enough to act. The registry is the single source of truth (SSoT) for what is measured; dashboards render from it.
-
Measurements drive promote/demote — a gate goes advisory→blocking, or a reviewer/lens comment-only→blocking, only on a recorded measurement that clears M7’s precision bar — and only if the instrument behind that measurement is provably live. Demotion (step back to advisory, fix the instrument) needs no such ceremony. Trust is one-directional: real measurement before more autonomy.
-
A heartbeat for scheduled automation — see the next section. A cadence registry names every scheduled job and how often it must produce a result; the heartbeat classifier puts each job in a class from its run history; an external monitor notices when the watcher itself goes quiet.
The model as a copyable narrative is templates/TELEMETRY.md.
Heartbeat: a stopped schedule is stale, never greenA disabled workflow keeps its last green run. So "how did it last finish?" is the wrong only question: the other is "when did it last finish?", asked of the clock.Open
A disabled workflow keeps its last green run. So “how did it last finish?” is the wrong only question: the other is “when did it last finish?”, asked of the clock.
The cadence registry. Every scheduled job is listed in one file with the interval it must produce a result at, a grace for the lateness a provider adds (it starts scheduled runs late under load and sometimes drops one), and the number of failures in a row that make it red. The job that runs the classifier is listed too, marked as the watcher, and left out of the classification: the external monitor is what watches it. One list is the single source of truth for what is watched. A check fails a scheduled workflow that is missing from it, so a new schedule cannot arrive unwatched: that is the dark instrument the registry’s own gate refuses, one level up.
The classes. From the registry, the job’s recent runs and the time now, the classifier puts each job in exactly one:
| Class | Means |
|---|---|
| green | the last result is a success, inside the cadence plus grace |
| degraded | recent failures, fewer in a row than the job’s red threshold |
| red | at least the job’s threshold of failures in a row |
| stale | no result inside the cadence plus grace, or never one |
| running | a run is in progress, and the job is otherwise green or degraded |
These rules keep the classes honest:
- Stale is a failure of the watcher’s verdict. A watcher exits non-zero for red and for stale alike. “It stopped” and “it failed” both need a person, and only one of them used to show.
- Only a success or a failure is a result. A cancelled or skipped run says nothing about whether the job works; it neither makes the job fresh nor ends a streak of failures. A job whose every run is cancelled is stale.
- A run in progress is bounded. It counts as running for a declared maximum; past it the run is hung and counts as no run. A job that has never produced a result is running only while its first run is younger than the cadence plus grace. It never excuses an overdue job and never hides a red one.
- Missing evidence reads as stale. A declared job with no run in the history is stale, and so is every job when the history is empty, because an empty history is what a collection that failed silently leaves behind. A history the classifier cannot trust (not valid, a time more than five minutes ahead of the watcher’s clock) is an error, never a pass.
The dead-man’s switch. The watcher is itself a scheduled job, and nothing inside the repository can notice that it has stopped. So it reports its verdict to a monitor outside the system it watches, on both outcomes: a success report when every job is green, degraded or running, a failure report when any is red or stale. The monitor expects a report every cadence and raises an incident when none arrives. Silence is then a signal in its own right: the watcher stopped, the schedule that runs it was disabled, the runner pool is down, or the provider is. Reporting only on failure would make a dead watcher indistinguishable from a healthy quiet one. The monitor products that do this, and the watcher workflow, are in mappings.md.
Thresholds per job. How many consecutive failures make a job red is the job’s own setting, because a flaky external check and a deploy verification should not page at the same count. The value is the repository’s; the rule is that a threshold can only be raised in the registry, in review, never in the watcher, so a job cannot be quietened by tuning the thing that watches it.
Tie-ins: M10’s verified-pointer watchdog is one scheduled job this registry should list, and the heartbeat is what notices if the watchdog itself stops; M13’s queue-stall check covers a run that never started, this covers a schedule that never fired.
Scheduled failures: one issue per causeA nightly failure can disappear in a log nobody reads. Filing a fresh issue for every run solves visibility by creating a second problem: one outage buries unrelated findings under…Open
A nightly failure can disappear in a log nobody reads. Filing a fresh issue for every run solves visibility by creating a second problem: one outage buries unrelated findings under repeated tickets. Keep one issue per cause, with bounded updates and an explicit recovery signal.
Separate evidence from triage. The test job writes results and the scope it actually checked; it never calls a tracker or a model. A separate triage step reads that evidence and classifies each finding before reporting it:
| Classification | Meaning | What the issue records |
|---|---|---|
| regression | behaviour previously supported now fails | the broken expectation and evidence of the change |
| intended change | the expectation no longer matches an approved behaviour change | the decision and the expectation to update |
| flake | equivalent executions disagree without an intended behaviour change | the inconsistent results and the reliability work owed |
| environment | an external dependency or execution environment prevented the check | the failed prerequisite and its owner |
A successful retry alone does not prove a flake, and missing evidence does not justify guessing a classification. Inconclusive triage fails visibly and leaves existing issues open until evidence supports a decision. All classes retain an owner and evidence; none turns the test job’s failure into a pass.
Stable identity. A cause fingerprint uses the repository, relevant check or shared prerequisite, affected scope (such as an environment), and a normalized failure signature. It excludes run identifiers, timestamps and transient log values that do not identify a distinct cause; a value naming an affected resource or endpoint stays in. Runs showing the same cause find the same issue; independent causes get separate issues. Several checks that establish the same failed prerequisite can share its cause, with their evidence attached. Keep the fingerprint on the issue and compare it exactly after searching; a similar title is not identity, and a fingerprint anyone can copy is not ownership: write only to an issue the triage identity created. A recurrence comments on the existing issue with its classification and evidence, rather than filing another. A cause that returns after recovery reopens that same issue.
Recovery requires a check. Close an issue automatically only when a later, complete result actually exercises its affected scope and confirms that the cause is absent. A skipped, cancelled, missing, partial or failed collection is unknown, not recovered. Nor does a green result from an unrelated check close it. Another cause blocking the affected check leaves the earlier cause unknown. Record the recovery evidence when closing. This complements the heartbeat: a schedule that stopped cannot close its own failure issues through silence.
Announced flood breaker. Choose and review a positive threshold N for consecutive failed observations of each cause. The first failure opens or reopens its issue; subsequent failures comment until the Nth failure, whose update announces that further recurrence comments are suppressed, why, and what recovery will re-arm reporting. For N = 1 the opening or reopening notice includes the announcement. While suppressed, keep collecting evidence and recording the cause’s latest observation and count in durable state; leave the issue open. Suppression changes notification volume, never the check’s verdict or whether other causes report. Unknown observations neither advance nor reset the streak. A confirmed recovery posts its evidence, closes the issue and clears the streak and suppression; the next failure reports again. Restarting the triage process, waiting a period, or a person closing an issue does not constitute recovery or reset the breaker.
Reporting must survive retries and overlapping runs: processing the same observation twice neither duplicates a comment nor advances the streak, and an old result cannot close an issue after a newer failure. Serialize changes for each cause and retain durable progress across restarts. A tracker error fails triage visibly; it never becomes an empty finding list or a recovery. The tracker mappings describe how a repository can implement this practice today. Jig’s reusable reconciler is future work.
In your toolsThe same rule, wired into a specific CI provider, hook manager or tracker. Shows only your stack.Open
The module invariant — the delivery process emits typed events,
every metric declares a wired source, dashboards surface drift, and measurements
drive promote/demote — is tool-independent. This file maps its mechanisms onto
concrete telemetry/analytics backends, event emitters, and dashboard homes. The
backends below are options, never requirements — pick one you already run.
Replace <placeholders> with your values. Install the pinned Bun runtime
before the commands below; the module gates and tests require Bun.
The two gates, per rung
| Gate | When it runs | Rung |
|---|---|---|
| no-dark-instruments | on any change to metrics-registry.yaml | CI (authority); cheap enough to pre-commit — a new metric cannot merge dark |
| event-schema lint | wherever an event stream is exported for aggregation (per-PR over a captured stream, or scheduled over a window) | CI; validates emitted events against event-schema.yaml |
The heartbeat is a third piece, and runs differently: a scheduled watcher, not a gate on a change, plus a coverage check on any change to the workflows or the cadence registry.
Both gates run on Bun (TypeScript) — any CI provider runs them. Point one
M11 variable at wherever you vendored the module and build paths from it.
Telemetry / analytics backends (the metric source)
Any of these can back a metric’s source:; the registry stays backend-neutral
(the source string just names which wired query/event feeds the number).
| Backend kind | Examples (options) | Fits |
|---|---|---|
| Product-analytics / event pipeline | PostHog, Amplitude, Snowplow | per-review events, adoption rate, cost-vs-catches; ad-hoc queries |
| Data warehouse | BigQuery, Snowflake, ClickHouse | joins over review + gate + tracker data; scheduled rollups feeding a parity snapshot |
| Metrics / time-series | Prometheus + Grafana, Datadog, OpenTelemetry collector | gate durations, CI-duration trend, pass-rate gauges, alerting |
| CI-native metrics | GitHub Actions job summaries / Insights, GitLab CI analytics | zero-extra-infra start: gate pass-rate and duration from the CI provider itself |
The no-dark-instruments gate does not care
which backend — only that the source is a real one, not a TODO.
Where events are emitted from
Process events (see event-schema.yaml) come out
of the machinery that already runs the process.
| Event | Emitted from |
|---|---|
gate_result | each M1 gate / CI step wraps its run and posts pass/fail + duration |
review_completed | the review harness (M7) emits outcome + cost per review; a merged-PR hook records whether any review happened (adoption) |
cycle_time | forge webhooks / a scheduled query over PR timestamps (opened, ready, merged, deployed) |
deploy_result | the deploy + promotion workflows (M10) emit environment + result + duration |
merge_conflict | resolve-conflicts appends one event per concluded conflicted path to git’s common-directory jig/conflict-events.jsonl; the repository’s emitter forwards it to its event pipeline |
heartbeat | a scheduled emitter proves a pipeline is still alive; its silence is itself the signal an instrument went dark. For the heartbeat watcher, the repository’s adapter emits one per watcher run from the classifier’s --json report (the counts of red and stale jobs); see Heartbeat monitoring |
GitHub Actions
# .github/workflows/process-telemetry.yml
on:
pull_request: { paths: ['metrics-registry.yaml', 'event-schema.yaml'] }
schedule:
- cron: '0 9 * * 1' # weekly window export
jobs:
registry:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
env: { M11: modules/M11-process-observability }
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- run: bun test "$M11"/reference/no-dark-instruments/check-metrics-wired.test.ts
- run: bun "$M11"/reference/no-dark-instruments/check-metrics-wired.ts metrics-registry.yaml
events:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
env: { M11: modules/M11-process-observability }
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- run: bun test "$M11"/reference/event-schema-lint/check-events.test.ts
# export the window's events into the logfmt line shape, then validate
- run: ./scripts/export-events > events.log # your backend query, see below
- run: SCHEMA=event-schema.yaml bun "$M11"/reference/event-schema-lint/check-events.ts events.logGitLab CI
process-telemetry:
variables: { M11: modules/M11-process-observability }
script:
- bun test "$M11"/reference/no-dark-instruments/check-metrics-wired.test.ts
- bun "$M11"/reference/no-dark-instruments/check-metrics-wired.ts metrics-registry.yaml
- bun test "$M11"/reference/event-schema-lint/check-events.test.ts
- ./scripts/export-events > events.log
- SCHEMA=event-schema.yaml bun "$M11"/reference/event-schema-lint/check-events.ts events.logExporting a backend’s events into the lint’s line format
The event-schema lint reads one event per line as
whitespace-separated key=value tokens. Flatten your backend’s records to that
with a one-liner — jq here is an export convenience, never inside the gate:
# from a JSON array of events (one object per event) to logfmt lines
jq -r '.[] | to_entries | map("\(.key)=\(.value)") | join(" ")' events.json > events.logA warehouse query can emit the same shape directly (select the columns you need,
concatenate as type=... key=...), so the lint runs on the query output.
Heartbeat monitoring
The heartbeat has three parts: an external monitor that pages when the watcher’s report goes missing, a collector that turns the provider’s run list into the classifier’s history, and the watcher workflow that runs both and reports. It runs in a workflow of its own, not in the telemetry workflow above: its pull-request trigger covers different files, and its scheduled job must not sit behind a pull-request condition.
Monitors (the dead-man’s switch)
Any monitor that expects a report on a period and raises an incident when one is missing will do. Most accept an explicit failure report too, so a red verdict pages at once instead of after the period runs out.
| Monitor (options) | Success report | Failure report | Raises an incident when |
|---|---|---|---|
| Healthchecks.io | GET <ping-url> | GET <ping-url>/fail | no ping inside period plus grace, or a failure ping |
| Better Stack heartbeats | GET <heartbeat-url> | GET <heartbeat-url>/fail | no request inside period plus grace, or a failure request |
| Cronitor | GET <telemetry-url>?state=complete | GET <telemetry-url>?state=fail | no event on the schedule, or a fail event |
| Sentry Crons | a check-in with status=ok | a check-in with status=error | a missed or failed check-in |
| Prometheus Pushgateway | push the verdict as a gauge | push the verdict as a gauge | an alert rule on time() - push_time_seconds beyond the period, or on the gauge |
The watchers below use the <url> and <url>/fail form; for another monitor,
change the one reporting line.
Collectors: the run history per provider
A collector writes the classifier’s history: a JSON array of
{"job", "id", "status", "startedAt", "finishedAt"} (the contract is in the
reference README). Collect
only runs the schedule started: a manual or push-triggered run of the same
workflow says nothing about whether the schedule still fires. For the same
reason, take each run’s status and times from the execution the schedule
started, never from a later retry of it: a provider that lets a person re-run
an old run rewrites that run’s result and finish time, so an old scheduled run
re-run by hand would make a stopped schedule fresh. Where the provider keeps
the first execution, report it; where it does not, report the run as
cancelled, which can never make a job fresh. Deciding that a run was never
retried takes a complete answer: a lookup that is cut off at a page, or that
fails, cannot show that no retry happened, so the collector fails instead of
reporting the run. Map every status
the provider has, and map one the table does not name to cancelled, so an
unknown status can never make a job fresh. Ask for enough runs per job to
reach back past red_after results, newest first: a collector that receives
the oldest runs instead can make a healthy job read stale or red.
| Provider | Runs of one job | job | id | status | startedAt / finishedAt |
|---|---|---|---|---|---|
| GitHub Actions | gh api "repos/{owner}/{repo}/actions/workflows/<file>/runs?event=schedule&per_page=<n>" | the workflow file name without its extension (what the coverage check uses) | id | status not completed → running; conclusion success → success; failure, timed_out, startup_failure → failure; cancelled → cancelled; skipped → skipped | run_started_at / updated_at of a completed run. A run whose run_attempt is above 1 was re-run by hand, and its own fields describe that latest attempt; take status and times from its first attempt (gh api "repos/{owner}/{repo}/actions/runs/<id>/attempts/1") |
| GitLab CI | GET /projects/:id/pipeline_schedules, then GET /projects/:id/pipeline_schedules/:schedule_id/pipelines?sort=desc&per_page=<n> (this endpoint sorts oldest first unless told otherwise; follow pages until <n> runs are in hand) | the schedule’s description, as the registry names it | the pipeline id | success → success; failed → failure; canceled → cancelled; skipped → skipped; created, waiting_for_resource, preparing, pending, running, scheduled → running | started_at / finished_at from GET /projects/:id/pipelines/:pipeline_id; a pipeline that never started (still queued, or cancelled in the queue) has no started_at, so use its created_at. A retry keeps the pipeline and overwrites its status and finished_at, and GitLab keeps no pipeline-level record of the first execution: the REST jobs response carries no retry flag, so ask GraphQL, which filters on the server: project(fullPath: "<path>") { pipeline(id: "gid://gitlab/Ci::Pipeline/<id>") { jobs(retried: true, first: 1) { nodes { id } } } }. Any node means a job was retried: report the pipeline as cancelled with its created_at as both times. An empty list is a complete answer, because the filter runs before the page is cut. A missing pipeline or a GraphQL error fails the collector |
A GitLab schedule lives outside the repository, so the GitLab collector is also the coverage check: it fails, before writing any history, for an active schedule whose description the registry does not declare, and for two schedules that share a description. GitLab does not require descriptions to be unique, and two schedules under one registry id would merge their histories, so one that keeps running would hide the other one stopping. A provider not listed here needs only the same contract.
The watcher on GitHub Actions
# .github/workflows/heartbeat.yml
on:
pull_request:
paths: ['.github/workflows/**', '.config/scheduled-jobs.yaml']
schedule:
- cron: '17,47 * * * *' # every 30 minutes; declared in the registry as `heartbeat` (cadence: 30m), watcher: true
permissions: { contents: read, actions: read }
env:
M11: modules/M11-process-observability
REGISTRY: .config/scheduled-jobs.yaml
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: oven-sh/setup-bun@<full-commit-sha> # v2
- run: bun test "$M11"/reference/heartbeat
- run: bun "$M11"/reference/heartbeat/check-schedules-declared.ts --registry "$REGISTRY"
watch:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<full-commit-sha> # v4
- uses: oven-sh/setup-bun@<full-commit-sha> # v2
- name: Collect the runs of every declared job
env: { GH_TOKEN: '${{ github.token }}' }
run: ./scripts/collect-runs "$REGISTRY" > runs.json # your collector: see the table above
# Always runs, so a step that failed before it is a failure report, never silence.
- name: Classify and report
if: always()
env: { MONITOR_URL: '${{ secrets.HEARTBEAT_MONITOR_URL }}', EARLIER: '${{ job.status }}' }
shell: bash
run: |
status=1
if [ "$EARLIER" = "success" ]; then
set +e
bun "$M11"/reference/heartbeat/classify-heartbeat.ts --registry "$REGISTRY" --history runs.json
status=$?
set -e
fi
# Both outcomes are reported; a missing report is the monitor's alarm.
if [ "$status" -eq 0 ]; then suffix=""; else suffix="/fail"; fi
if ! curl --fail --silent --show-error --max-time 10 --retry 2 "${MONITOR_URL}${suffix}"; then
echo "::error::the monitor report was not delivered"
[ "$status" -ne 0 ] || status=1
fi
exit "$status"The permissions: block is the least the collector needs. The schedule
trigger fires from the default branch only. The watcher is itself a scheduled
workflow, so its registry lists it with watcher: true: declared, so the
coverage check passes, and not classified, since a failed watcher run would
otherwise count against the watcher on its next run and keep it red after the
cause was gone. The external monitor is what watches it. A report that cannot
be delivered fails the run even when every job is healthy, since the monitor
will page for the missing report anyway. To emit the heartbeat event as
well, run the classifier with --json, have your adapter send the counts of
red and stale jobs, and treat a failed send the same way. Pin each action to a
full commit as the M13 conventions say;
<full-commit-sha> is a placeholder here.
The watcher on GitLab CI
heartbeat:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $HEARTBEAT == "1"'
variables: { M11: modules/M11-process-observability, REGISTRY: .config/scheduled-jobs.yaml }
script:
# One block, so a failed collection is still reported as a failure.
- |
set +e
./scripts/collect-runs "$REGISTRY" > runs.json
status=$?
if [ "$status" -eq 0 ]; then
bun "$M11"/reference/heartbeat/classify-heartbeat.ts --registry "$REGISTRY" --history runs.json
status=$?
fi
if [ "$status" -eq 0 ]; then suffix=""; else suffix="/fail"; fi
if ! curl --fail --silent --show-error --max-time 10 --retry 2 "${MONITOR_URL}${suffix}"; then
echo "the monitor report was not delivered"
[ "$status" -ne 0 ] || status=1
fi
exit "$status"MONITOR_URL is a masked, protected CI/CD variable. The pipeline schedule that
runs the watcher (the one with HEARTBEAT set to 1) belongs in the registry
like any other, marked watcher: true.
Dashboard homes
Dashboards render from the metrics registry (the SSoT for what is measured) — not from hand-built, one-off charts that drift from it.
| Home | Fits |
|---|---|
| Grafana / Datadog board | time-series metrics: gate pass-rate, CI-duration trend, cycle time; alerting on drift |
| Product-analytics dashboard (PostHog, Amplitude) | adoption rate, cost-vs-catches, per-reviewer breakdowns |
| A generated report | a scheduled job renders the registry’s metrics into a markdown/HTML summary posted to a channel — the lowest-infra dashboard |
The specific charts, thresholds, and alert values are yours and stay with your repo (see the README); Jig ships the registry contract and the two gates, not a particular board.
External-precondition issue reconciliation
The M10 reference reconciler takes a tracker port with complete open-issue listing, create, update and close operations. Its GitHub Issues implementation uses a stable body marker, pages through the open issues the reconciling login opened, excludes pull requests and refuses duplicates. Grant its token Issues write only on the repository that owns the registry. Serialize all runs that use the same marker. A complete healthy report closes the issue; pending or unknown observations keep it open. Failed tracker reads or writes fail the observation run. Other tracker adapters are future work.
Scheduled-failure issues
Implement the issue lifecycle in a separate triage job with tracker credentials. The evidence-only test job has neither those credentials nor a model call. The following are recipes for consumer repositories, not adapters shipped by Jig. Linear, GitHub Issues and Jira are the existing tracker interface’s implemented adapters; the rows below describe the equivalent provider operations for a consumer’s integration.
| Tracker | Locate and identify the cause | Create and update | Recovery and recurrence |
|---|---|---|---|
| GitHub Issues | List the repository’s issues in all states under a configured finding label and creator set to the reconciling login, follow every page, exclude pull requests, then compare the exact fingerprint in the body | Create an issue with the fingerprint, classification and evidence links in its body; create an issue comment for each permitted recurrence and the breaker announcement | Update the issue to state: closed on confirmed recovery, or state: open when the cause returns |
| Linear | Filter the team’s issues by a configured finding label and the reconciling user as creator, include closed issues, paginate and compare the exact fingerprint in the description | issueCreate creates the finding; issueUpdate maintains its description; commentCreate adds recurrence, suppression and recovery evidence | Resolve the team’s workflow state IDs and use issueUpdate with stateId for recovery and reopening; never assume a state name is shared by teams |
| Jira Cloud | List the project’s findings using a configured label, reporter = currentUser() for the reconciling account and paginated search, then compare an exact fingerprint stored in the description or an issue property | Create and edit the issue, and add comments; an issue property can hold machine-readable identity, but does not enforce uniqueness | Read the issue’s available transitions and invoke the configured recovery or reopening transition; a generic field edit does not substitute for a workflow transition |
The provider primitives above are documented in GitHub’s issue API and comment API, Linear’s GraphQL guide and filtering guide, and Jira Cloud’s issue API, comment API and issue properties. Prefer the issue ID durable state bound at creation over any search: a fingerprint, label or editable reporter field anyone can set is not ownership. Issues and comments carry links to expiring evidence, never excerpts, so nothing outlives the evidence store’s retention. These APIs provide storage and state changes; the consumer’s reconciler supplies fingerprint normalization, exact matching, ordered observation processing, durable counters and the per-cause breaker. Labels, team/project, owner, workflow states and N belong to that consumer.
Do not rely on search plus create as an atomic operation. Hold a durable per-cause lock across lookup and writes, recheck identity before creating, and retain operation markers so an ambiguous network timeout can be reconciled before retrying. A lock confined to one runner does not coordinate another runner. While comments are suppressed, retain observations in the durable ledger without updating the tracker on every run. A failure to read all pages or evidence fails triage and leaves existing issues open.
Conflict share from git and the forge
The resolve-conflicts history report
produces merge-conflicts/v1 JSON without fetching or changing repository
objects, refs, index or working tree. It lists the replayed merges, conflicts,
causes, hotspots and coverage limits. The local JSON Lines events add
rebase, cherry-pick and revert resolutions that merge replay cannot see;
forward them through the repository’s own emitter when it has an event
pipeline. The schema lint takes a flattened key=value export: retain a
null live cause as cause=unknown, and encode whitespace in paths and
optional prose before exporting.
| Implementation | Joined evidence | Coverage |
|---|---|---|
Jig drive-pr/scripts/fractal-metrics.ts (GitHub) | Replay and clone-local events, joined to the scoreboard’s merged-PR cohort; each PR counts once | The report states conflicted, observed-clean and unknown PRs; a recorded force-push prevents a clean classification |
| Another forge or event backend | The repository’s adapter joins the same records to its forge’s merged-PR list | Preserve the same unknown classification, coverage floor and whole-cohort bounds; backend adapters beyond the shipped scoreboard are future work |
The metric’s query name in the registry is a wiring example; register it only after the adapter actually runs. A local file is not a cross-clone collection service. See the metric definition for the denominator and verdict rule.
Runnable form
Jig’s drive-pr skill measures
the review process it runs, as scripts a repository can call on its own:
| Script | What it measures |
|---|---|
loop-metrics.ts | One pull request’s review-loop cost: rounds, threads, the outcome mix, and how much of the final change landed after review began. A drive prints it when it stops |
defect-escape.ts | Whether findings the loop declined to fix (wont-fix, deferred) came back as defects |
fractal-metrics.ts | The cross-PR scoreboard: review figures and merged-PR conflict share with coverage over a window, each judged against a recorded baseline whose source document must still contain it, so a stale baseline is caught |
fleet-health.ts | Ceremony against progress: review rounds and follow-ups weighed against merged product work, with the thresholds in the repository’s own fleet-health file. Beside the stalled-epic signal it keeps an epic census: started epics that are finished but still open, blocked on a last child or two, or owned by nobody. The census is read-only, feeds the closure step, and repeats that closing needs an acceptance verdict |
Their configuration is fleet_health and drive.escape_baseline_doc in the
configuration reference.
What the module provides
| Piece | What it is |
|---|---|
templates/TELEMETRY.md | The copyable model: events → metrics → promote/demote, linked to M7’s precision bar and M8’s measure step |
templates/event-schema.yaml | A generic schema of typed process events |
templates/metrics-registry.yaml | The registry of process metrics, each with a wired source and an owner |
reference/event-schema-lint/ | Validates an emitted event stream against the schema |
reference/no-dark-instruments/ | Fails when a registered metric’s source is missing, empty or a placeholder |
templates/scheduled-jobs.yaml | The cadence registry: every scheduled job, how often it must produce a result, its grace and its red threshold |
reference/heartbeat/ | The classifier (green, degraded, red, stale, running, over a run history and the registry) and the coverage check (a scheduled workflow missing from the registry fails) |
mappings.md | Telemetry and analytics backends, where events are emitted from, dashboard homes |
| maturity criteria | The criteria the audit skill scores |
Jig declares its own scheduled workflow in .config/scheduled-jobs.yaml and
runs the coverage check in its gates. It does not yet run the watcher: that
needs a monitor account, which is a person’s decision, so the watcher and its
dead-man’s switch are described and tested here but not yet switched on for
Jig itself.
Each reference gate is a standalone Bun script with a self-test and fixtures. The parity and precision computation is not repeated here: it is M8’s parity report, and M11 owns the emission, registry and dashboard side.
Left out by design
- A dashboard product and threshold values. The specific charts, layout, backend wiring, metric thresholds and alert values belong to each repository. The module provides the mechanism (typed events, a wired registry, the two gates) and the decision rules, not the numbers or a particular vendor’s dashboard.
- A monitor product, and the cadences. Which external monitor receives the watcher’s reports, and which jobs run how often, are the repository’s. mappings.md lists the products that support the pattern; the module requires only a monitor that raises an incident when an expected report does not arrive.
- Automatic repair. The heartbeat says a job is stale or red and does not restart or repair it. External-precondition findings and scheduled-failure triage maintain tracker issues for people to act on, but never repair the inspected system; classification does not approve a changed expectation.
- A required backend. Telemetry backends (product-analytics tools, data warehouses, CI-native metrics) appear only as options in mappings.md.
- CI time and cost. Measuring what each workflow and job costs, so a decision about what runs where cites a number, is M13 pipeline economy’s Strict level.
Future
A reusable scheduled-failure reconciler on the existing tracker interface is designed, but not shipped. The doctrine and tracker mappings above are adoptable with a repository’s own triage; no new runtime configuration or tracker-writing command is provided.