Liking cljdoc? Tell your friends :D

hive-compose.promote.fixture-evidence

Pure: the versioned fixture identity and the readiness/runtime evidence facts one scoped run records (plan 20261128195557-2102d684, task infrastructure-fixture).

A FixturePlan names what a run must run and what it must be able to observe. It is versioned data, pinned by content: the same pins and the same served assets always fingerprint the same, so a report says which fixture produced it instead of which checkout it happened to run from.

An Observation is the evidence of one run against that plan:

{:fixture/identity {:fixture/id :fixture/version :fixture/fingerprint :fixture/pins :fixture/served-digest} :fixture/observed-at ms :fixture/plan-valid? bool :fixture/readiness {:readiness/ready? bool :readiness/required [service] :readiness/not-ready {service row}} :fixture/sensors {sensor {:sensor/status :available|:unavailable |:dependency-failed :sensor/reason :sensor/detail?}} :fixture/joins [join] :fixture/readbacks [readback] :fixture/refusals [holder] :fixture/verdict :ready|:incomplete|:refused}

The distinction the plan asks for is carried as data, never collapsed:

  • :unavailable is an ABSENT SENSOR: nothing in this run could have produced the evidence (no trace store configured, no browser harness, no readback source declared). The expectation is unmeasured.
  • :dependency-failed is a PRESENT SENSOR whose dependency did not answer (Tempo unreachable, a service not running, a refused HTTP call). Something was asked and it failed.

Both make the verdict :incomplete, and each says which of the two it is, so a diagnosis never blames a dependency for a sensor that was never there.

Readiness and refusal reuse the existing seams rather than restating them: promote.stack-run/not-ready for the health rows and promote.ownership/holders for a live section that already holds what this run would start.

No IO: the pipeline gathers probes, logs and traces; this namespace folds them into facts.

Pure: the versioned fixture identity and the readiness/runtime evidence
facts one scoped run records (plan 20261128195557-2102d684, task
infrastructure-fixture).

A FixturePlan names what a run must run and what it must be able to
observe. It is versioned data, pinned by content: the same pins and the
same served assets always fingerprint the same, so a report says which
fixture produced it instead of which checkout it happened to run from.

An Observation is the evidence of one run against that plan:

  {:fixture/identity  {:fixture/id :fixture/version :fixture/fingerprint
                       :fixture/pins :fixture/served-digest}
   :fixture/observed-at ms
   :fixture/plan-valid? bool
   :fixture/readiness {:readiness/ready? bool
                       :readiness/required [service]
                       :readiness/not-ready {service row}}
   :fixture/sensors   {sensor {:sensor/status :available|:unavailable
                              |:dependency-failed
                              :sensor/reason :sensor/detail?}}
   :fixture/joins     [join]
   :fixture/readbacks [readback]
   :fixture/refusals  [holder]
   :fixture/verdict   :ready|:incomplete|:refused}

The distinction the plan asks for is carried as data, never collapsed:

- `:unavailable` is an ABSENT SENSOR: nothing in this run could have
  produced the evidence (no trace store configured, no browser harness, no
  readback source declared). The expectation is unmeasured.
- `:dependency-failed` is a PRESENT SENSOR whose dependency did not
  answer (Tempo unreachable, a service not running, a refused HTTP call).
  Something was asked and it failed.

Both make the verdict `:incomplete`, and each says which of the two it is,
so a diagnosis never blames a dependency for a sensor that was never
there.

Readiness and refusal reuse the existing seams rather than restating them:
`promote.stack-run/not-ready` for the health rows and
`promote.ownership/holders` for a live section that already holds what
this run would start.

No IO: the pipeline gathers probes, logs and traces; this namespace folds
them into facts.
raw docstring

->evidence-runclj

(->evidence-run observation run)
(->evidence-run observation run {:keys [case->check]})

observation translated into the portable run shape hive-test.evidence/read-run (and diagnose) reads.

This is the integration boundary, kept on the PRODUCER side so the receiver stays untouched: the compose adapter owns its own vocabulary and does the translation itself, which is the established adapter style. A caller that feeds raw read-run directly bypasses every rule below, so Callers of raw read-run MUST use this translator for Compose evidence.

Three things read-run cannot do are done here, deliberately:

  • :fixture/run is stamped, because an Observation names its fixture but not the run id the checks are judged against.
  • the CASE id a join carries is mapped to the CHECK id the receiver matches on, through :case->check, and ONLY through it. read-run copies :join/test-id straight onto :evidence/check-id, which would let a case id that happens to equal a check id satisfy a check BY ACCIDENT. So a join with no explicit binding is never emitted as evidence at all: it is carried under :unmapped, an overview record that names its case and witnesses nothing. A case id is never assumed to be a check id.
  • every join and readback is filtered through its attributed? / agree? flag. read-run maps join identity but not that flag, so an unattributed trace would otherwise witness a check. Unattributed joins are NOT dropped silently: they are listed under :unattributed for the overview.

Readbacks are independent: each carries its own actual :readback/id, which IS a check id by construction, so they need no mapping and are passed through unchanged.

Sensors and readiness pass through unchanged: read-run already folds the producer's three-valued vocabulary (:available :unavailable :dependency-failed) onto the portable one.

`observation` translated into the portable run shape
`hive-test.evidence/read-run` (and `diagnose`) reads.

This is the integration boundary, kept on the PRODUCER side so the receiver
stays untouched: the compose adapter owns its own vocabulary and does the
translation itself, which is the established adapter style. A caller that
feeds raw `read-run` directly bypasses every rule below, so Callers of raw
read-run MUST use this translator for Compose evidence.

Three things `read-run` cannot do are done here, deliberately:

- `:fixture/run` is stamped, because an Observation names its fixture but
  not the run id the checks are judged against.
- the CASE id a join carries is mapped to the CHECK id the receiver matches
  on, through `:case->check`, and ONLY through it. `read-run` copies
  `:join/test-id` straight onto `:evidence/check-id`, which would let a case
  id that happens to equal a check id satisfy a check BY ACCIDENT. So a join
  with no explicit binding is never emitted as evidence at all: it is
  carried under `:unmapped`, an overview record that names its case and
  witnesses nothing. A case id is never assumed to be a check id.
- every join and readback is filtered through its `attributed?` / `agree?`
  flag. `read-run` maps join identity but not that flag, so an unattributed
  trace would otherwise witness a check. Unattributed joins are NOT dropped
  silently: they are listed under `:unattributed` for the overview.

Readbacks are independent: each carries its own actual `:readback/id`, which
IS a check id by construction, so they need no mapping and are passed
through unchanged.

Sensors and readiness pass through unchanged: `read-run` already folds the
producer's three-valued vocabulary (`:available` `:unavailable`
`:dependency-failed`) onto the portable one.
sourceraw docstring

absentclj

(absent plan probes)

[sensor] the plan requires and no probe was supplied for: an absence the verdict must report rather than treat as a failure.

[sensor] the plan requires and no probe was supplied for: an absence the
verdict must report rather than treat as a failure.
sourceraw docstring

assets-canonicalclj

(assets-canonical assets)

assets as sorted path:sha256:bytes lines.

`assets` as sorted `path:sha256:bytes` lines.
sourceraw docstring

classifyclj

(classify res)

The sensor row of probe res (a hive-dsl Result or nil).

nil -> :unavailable (never collected: an absent sensor) ok -> :available error in unavailable -> :unavailable (the sensor does not exist here) any other error -> :dependency-failed (asked, and it failed)

The sensor row of probe `res` (a hive-dsl Result or nil).

nil                     -> :unavailable (never collected: an absent sensor)
ok                      -> :available
error in `unavailable`  -> :unavailable (the sensor does not exist here)
any other error         -> :dependency-failed (asked, and it failed)
sourceraw docstring

fingerprintclj

(fingerprint {:fixture/keys [pins served-assets]})

sha256:<hex> of the plan's pins and served assets: the identity a report quotes. A change to any pin or asset moves it; reordering does not.

`sha256:<hex>` of the plan's pins and served assets: the identity a report
quotes. A change to any pin or asset moves it; reordering does not.
sourceraw docstring

FixturePlanclj

A versioned fixture plan: what a run runs and what it must observe.

A versioned fixture plan: what a run runs and what it must observe.
sourceraw docstring

group-identityclj

(group-identity anchors)

Collapse the identity fields of several anchors, FAILING CLOSED.

A field every anchor agrees on is the observed value. A field two anchors disagree on is CONTRADICTORY: it is withheld and named under :identity/conflict, because picking one would let the producer assert an identity the evidence does not support. Missing is likewise not guessed.

Collapse the identity fields of several anchors, FAILING CLOSED.

A field every anchor agrees on is the observed value. A field two anchors
disagree on is CONTRADICTORY: it is withheld and named under
:identity/conflict, because picking one would let the producer assert an
identity the evidence does not support. Missing is likewise not guessed.
sourceraw docstring

identity-basisclj

(identity-basis anchors)

The observed identity of a group of anchors, and whether it is a usable check witness.

:attributed? requires one anchor with the operation, revision and any request present in the joined identity. Conflicting fields disqualify the join. A row that cannot be attributed is still returned -- it is the trace overview, which says what happened without claiming to witness a check. That distinction is the whole point: an unattributed trace must never satisfy a check.

The observed identity of a group of anchors, and whether it is a usable
check witness.

:attributed? requires one anchor with the operation, revision and any
request present in the joined identity. Conflicting fields disqualify
the join. A row that
cannot be attributed is still returned -- it is the trace overview, which
says what happened without claiming to witness a check. That distinction is
the whole point: an unattributed trace must never satisfy a check.
sourceraw docstring

log-joinsclj

(log-joins logs
           {:keys [run test-ids window slack-ms max-lines] :or {max-lines 20}})

Join log lines by their exact run and case. A case is a test.id, case.id or case field, or a bare token immediately after a run field in legacy logs. Quoted values use JSON string escapes. Conflicting scope fields disqualify a line. The first selected line supplies the operation, revision and any request. Conflicting identity fields leave that line unattributed.

Join log lines by their exact run and case. A case is a test.id, case.id or
case field, or a bare token immediately after a run field in legacy logs.
Quoted values use JSON string escapes. Conflicting scope fields disqualify
a line. The first selected line supplies the operation, revision and any
request. Conflicting identity fields leave that line unattributed.
sourceraw docstring

observationclj

(observation plan
             {:keys [health probes traces logs run test-ids window operation
                     readback-rows active self project now]
              :as in})

The evidence of one run against plan plan. in: :health {service {:state :health}} the engine's service rows :probes {sensor Result|nil} one per required sensor :traces [Trace] optional, promote.trace shape :logs {service text} optional :run the stack/test run id the joins are scoped to :test-ids the case ids the joins may match :window [start-ms end-ms] optional, for the log join :readbacks [{:id :expected :observed :sensor :source}] :active the active map, when a scope refusal is asked for :self this run's section id, with :project :project the compose project of the fixture :now epoch ms (defaults to the clock)

The plan's own required sensors drive the verdict; joining is scoped to :run so no other run's trace or log can satisfy a check.

The evidence of one run against plan `plan`. `in`:
  :health     {service {:state :health}}   the engine's service rows
  :probes     {sensor Result|nil}          one per required sensor
  :traces     [Trace]                      optional, promote.trace shape
  :logs       {service text}               optional
  :run        the stack/test run id the joins are scoped to
  :test-ids   the case ids the joins may match
  :window     [start-ms end-ms]            optional, for the log join
  :readbacks  [{:id :expected :observed :sensor :source}]
  :active     the active map, when a scope refusal is asked for
  :self       this run's section id, with :project
  :project    the compose project of the fixture
  :now        epoch ms (defaults to the clock)

The plan's own required sensors drive the verdict; joining is scoped to
`:run` so no other run's trace or log can satisfy a check.
sourceraw docstring

observed-valueclj

(observed-value v)

v read off a span attribute or log field in the type the evidence reader compares: integer text becomes a long (a revision must compare as a NUMBER, not "7" vs 7), a slash-qualified name becomes a keyword (so an operation compares against :check/operation), and anything else stays its string.

`v` read off a span attribute or log field in the type the evidence reader
compares: integer text becomes a long (a revision must compare as a
NUMBER, not "7" vs 7), a slash-qualified name becomes a keyword (so an
operation compares against :check/operation), and anything else stays its
string.
sourceraw docstring

pins-canonicalclj

(pins-canonical pins)

pins as one stable line: keys sorted, k=v joined by newline. Equal maps always render equal, so a fingerprint never moves with map order.

`pins` as one stable line: keys sorted, `k=v` joined by newline. Equal
maps always render equal, so a fingerprint never moves with map order.
sourceraw docstring

plan-identityclj

(plan-identity plan)

Result<identity map> of plan plan: id, version, fingerprint, pins and the served digest. An invalid plan is :compose/fixture-plan-invalid, carrying the version the plan named and the version this adapter reads.

Result<identity map> of plan `plan`: id, version, fingerprint, pins and
the served digest. An invalid plan is :compose/fixture-plan-invalid,
carrying the version the plan named and the version this adapter reads.
sourceraw docstring

plan-problemsclj

(plan-problems plan)

[{:path [k] :type kw}] of FixturePlan plan; empty when it is valid. malli's explain is a map with an :errors seq, not a seq of problems.

[{:path [k] :type kw}] of FixturePlan `plan`; empty when it is valid.
malli's explain is a map with an :errors seq, not a seq of problems.
sourceraw docstring

readbackclj

(readback {:keys [id expected observed sensor source run test-id] :as row})

A readback row: an INDEPENDENT observation of the same fact, and whether it agrees with the expectation. expected and observed are whatever the target's own reader returned (a row, a count, a rendered value); the row records :readback/agree? and never re-derives the expectation from the observation.

sensor is the probe Result that produced the observation: a nil or unavailable probe leaves the readback :unavailable (unmeasured), a failed one :dependency-failed.

A readback is correlated evidence like a join, so it carries the run and the identity it answers for. :readback/run and :readback/test-id are recorded as given and are never inferred from the observation, which would let the evidence name its own case. :readback/operation, :readback/revision and :readback/request come from readback-identity -- the OBSERVER's own report -- never from expected.

A readback row: an INDEPENDENT observation of the same fact, and whether
it agrees with the expectation. `expected` and `observed` are whatever the
target's own reader returned (a row, a count, a rendered value); the row
records `:readback/agree?` and never re-derives the expectation from the
observation.

`sensor` is the probe Result that produced the observation: a nil or
unavailable probe leaves the readback :unavailable (unmeasured), a failed
one :dependency-failed.

A readback is correlated evidence like a join, so it carries the run and
the identity it answers for. `:readback/run` and `:readback/test-id` are
recorded as given and are never inferred from the observation, which would
let the evidence name its own case. `:readback/operation`,
`:readback/revision` and `:readback/request` come from
`readback-identity` -- the OBSERVER's own report -- never from `expected`.
sourceraw docstring

readback-identityclj

(readback-identity {:keys [observed observed-identity]})

The identity an independent readback OBSERVED: {:operation :revision :request}, each nil when nobody observed it. Precedence, strongest first:

  1. observed-identity what the target's reader reported beside the row
  2. observed a row carrying its own :operation/:revision

Nothing is ever read off expected: an expectation that stamped the observation would make the check agree with itself.

The identity an independent readback OBSERVED: {:operation :revision
:request}, each nil when nobody observed it. Precedence, strongest first:

  1. `observed-identity`   what the target's reader reported beside the row
  2. `observed`            a row carrying its own :operation/:revision

Nothing is ever read off `expected`: an expectation that stamped the
observation would make the check agree with itself.
sourceraw docstring

readbacksclj

(readbacks rows)
(readbacks rows defaults)

[readback] of rows ([{:id :expected :observed :sensor :source :run :test-id}]). defaults ({:run :test-id}) fill only a row that names neither, so a row's own ids always win and the run the evidence belongs to is carried even when the caller set it once for the whole run.

[readback] of `rows` ([{:id :expected :observed :sensor :source :run
:test-id}]). `defaults` ({:run :test-id}) fill only a row that names
neither, so a row's own ids always win and the run the evidence belongs
to is carried even when the caller set it once for the whole run.
sourceraw docstring

readinessclj

(readiness plan health)

{:readiness/ready? :readiness/required :readiness/not-ready} of health ({service {:state :health}}) against the plan's services, using stack-run/not-ready so the rule is the same one a stack run uses.

{:readiness/ready? :readiness/required :readiness/not-ready} of `health`
({service {:state :health}}) against the plan's services, using
`stack-run/not-ready` so the rule is the same one a stack run uses.
sourceraw docstring

required-servicesclj

(required-services plan)

The services readiness must see, in plan order, distinct.

The services readiness must see, in plan order, distinct.
sourceraw docstring

scope-refusalclj

(scope-refusal active {:keys [self project]} services)

Result<[holder]>: refuse to prepare fixture plan when a LIVE section other than self already holds any of the plan's services in compose project project. Reuses ownership/holders, so the answer names the section, its agents and the services — the same rows up refuses with.

An empty answer is :ok []; a live holder is :compose/fixture-scope-held and nothing is prepared. Preparing a fixture never takes a container from under a running section.

Result<[holder]>: refuse to prepare fixture `plan` when a LIVE section
other than `self` already holds any of the plan's services in compose
project `project`. Reuses `ownership/holders`, so the answer names the
section, its agents and the services — the same rows `up` refuses with.

An empty answer is :ok []; a live holder is :compose/fixture-scope-held
and nothing is prepared. Preparing a fixture never takes a container from
under a running section.
sourceraw docstring

sensorsclj

(sensors probes)

{sensor row} of probes ({sensor Result|nil}), keeping only the sensors the plan requires plus any extra the caller collected.

{sensor row} of `probes` ({sensor Result|nil}), keeping only the sensors
the plan requires plus any extra the caller collected.
sourceraw docstring

served-digestclj

(served-digest assets)
(served-digest assets path-match)

The sha256 of the served module asset in assets, or nil when none matches path-match: the second, independent identity check beside the pins. Deterministic: the first match by sorted path.

The sha256 of the served module asset in `assets`, or nil when none
matches `path-match`: the second, independent identity check beside the
pins. Deterministic: the first match by sorted path.
sourceraw docstring

span-correlationclj

(span-correlation span)

The SELF-CONTAINED observed tuple ONE span carries: its run, case and the identity of the operation it drove, every field read off that same span's attributes. A field the span does not carry is nil -- it is never borrowed from a neighbouring span.

This is the whole of the anti-synthesis rule: identity is only ever read per span, so a tuple cannot be assembled from two requests or two runs.

The SELF-CONTAINED observed tuple ONE span carries: its run, case and the
identity of the operation it drove, every field read off that same span's
attributes. A field the span does not carry is nil -- it is never borrowed
from a neighbouring span.

This is the whole of the anti-synthesis rule: identity is only ever read
per span, so a tuple cannot be assembled from two requests or two runs.
sourceraw docstring

trace-joinsclj

(trace-joins traces {:keys [run test-ids operation]})

[join] of traces (promote.trace Trace values) for run run and test-ids: one row per (trace, test id) whose spans each carry, ON THE SAME SPAN, hive.run.id = run, test.id = that id, and (with :operation) the operation being proved.

Every identity field on a row is read off the spans that already passed that selection -- never from a wider span set, and never from a caller's expectation -- so a tuple can not be synthesized out of spans belonging to different requests or runs.

:operation narrows the selection to spans carrying that operation, so an operation identity is PROVEN by the spans that carry it. A row whose spans then disagree on revision or request is not a witness: :join/attributed? is false and the conflict is named under :join/conflict. Such a row is still listed with its errors, so an overview of what happened survives; a reader that needs a witness requires :join/attributed?.

[join] of `traces` (promote.trace Trace values) for run `run` and
`test-ids`: one row per (trace, test id) whose spans each carry, ON THE SAME
SPAN, hive.run.id = run, test.id = that id, and (with `:operation`) the
operation being proved.

Every identity field on a row is read off the spans that already passed
that selection -- never from a wider span set, and never from a caller's
expectation -- so a tuple can not be synthesized out of spans belonging to
different requests or runs.

`:operation` narrows the selection to spans carrying that operation, so an
operation identity is PROVEN by the spans that carry it. A row whose spans
then disagree on revision or request is not a witness: `:join/attributed?`
is false and the conflict is named under `:join/conflict`. Such a row is
still listed with its errors, so an overview of what happened survives; a
reader that needs a witness requires `:join/attributed?`.
sourceraw docstring

unavailableclj

Error categories that mean the sensor does not exist in this run: an absence, not a failure.

Error categories that mean the sensor does not exist in this run: an
absence, not a failure.
sourceraw docstring

valid-plan?clj

(valid-plan? plan)
source

verdictclj

(verdict {:fixture/keys [sensors readiness refusals plan-valid?]} required)

{:fixture/verdict :fixture/missing :fixture/unmeasured :fixture/failed} of an observation.

:refused a live section holds the scope (nothing was prepared) :incomplete a required sensor is not :available; :fixture/unmeasured lists the absent ones, :fixture/failed the dependency failures :ready every required sensor answered and readiness holds

{:fixture/verdict :fixture/missing :fixture/unmeasured :fixture/failed} of
an observation.

:refused     a live section holds the scope (nothing was prepared)
:incomplete  a required sensor is not :available; `:fixture/unmeasured`
             lists the absent ones, `:fixture/failed` the dependency
             failures
:ready       every required sensor answered and readiness holds
sourceraw docstring

versionclj

The plan format this namespace reads. A plan naming another version is refused rather than half-read.

The plan format this namespace reads. A plan naming another version is
refused rather than half-read.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close