Agency health
Read one running agency case end-to-end by composing the registry-pinned data-store read_projection (C2) keyed on the agency case and the ledger read runner (C7) by receipt id-stub only; fold the case projection in version order, grade signals against declared norms, and seal a health_verdict plus typed intervention findings with named target lanes. Read-only: appends nothing, sends nothing, executes nothing, and consumes no effect.
You’re reading version sha-f778c63767cb. Go to the current version
Overview
Agency Health assembles a health bundle for one running agency over a period.
An agency runs a standing mandate one governed turn at a time, and every turn
appends an event to that agency's case stream in the hosted data-store. Over
days that stream is operational state: turns that advanced cleanly, turns
parked in awaiting_approval, cumulative spend and act counts approaching
the charter caps, and turns making no progress.
This skill reads the domain-keyed turn state by composing two existing runners:
- the registry-pinned data-store read_projection (C2) keyed on the agency case over the supplied period; and
- the ledger read runner (C7) referenced by receipt id-stub only, because the ledger is audit-only and can never be a domain-keyed state read.
It folds the case projection in version order, grades the signals against the
declared norms (or supplied baseline), and seals a health_verdict plus typed
intervention findings. It is read-only: it appends nothing, sends nothing,
executes nothing, and consumes no effect. Each warranted finding names its
target lane (policy-author to tighten a policy or timeout, improve-skill to
debug a member behind a refusal spike). Any remedy that would widen a cap or
authority, and any critical finding, escalates to the human ops lane rather
than routing as a routine tighten.
run-history-analyst reads runs across the whole catalog ledger, and
receipt-auditor audits one receipt. This skill reads one live agency case
projection end-to-end, so it composes those two lanes without reimplementing
them.
In the manual
Runners
evaluatefoldsource-handoff
Declared by its execution profile. Read the profile
SKILL.md
Agency Health
Agency Health assembles a health bundle for one running agency over a period.
An agency runs a standing mandate one governed turn at a time, and every turn
appends an event to that agency's case stream in the hosted data-store. Over
days that stream is operational state: turns that advanced cleanly, turns
parked in awaiting_approval, cumulative spend and act counts approaching
the charter caps, and turns making no progress.
This skill reads the domain-keyed turn state by composing two existing runners:
- the registry-pinned data-store read_projection (C2) keyed on the agency case over the supplied period; and
- the ledger read runner (C7) referenced by receipt id-stub only, because the ledger is audit-only and can never be a domain-keyed state read.
It folds the case projection in version order, grades the signals against the
declared norms (or supplied baseline), and seals a health_verdict plus typed
intervention findings. It is read-only: it appends nothing, sends nothing,
executes nothing, and consumes no effect. Each warranted finding names its
target lane (policy-author to tighten a policy or timeout, improve-skill to
debug a member behind a refusal spike). Any remedy that would widen a cap or
authority, and any critical finding, escalates to the human ops lane rather
than routing as a routine tighten.
run-history-analyst reads runs across the whole catalog ledger, and
receipt-auditor audits one receipt. This skill reads one live agency case
projection end-to-end, so it composes those two lanes without reimplementing
them.
When to use this skill
- A standing agency has been running for at least one period, the operator wants a single health bundle for one case, and the agency charter snapshot (mandate, roster, cumulative limits) is in the data-store already.
- The reviewer needs to know whether a case is making progress, where it is
parked, what its cumulative cap usage looks like, and where a downstream
policy-authororimprove-skillrun should be triggered.
When not to use this skill
- One-shot or interactive work that does not span multiple agency turns. The operator should call the member skills directly; this skill is overhead when the operator already knows which move to make.
- Anything that would mutate the agency case, write to the ledger, or issue a
rail run. The intervention findings are dispatch-by-naming only: each
finding names a target lane and grounds it in a
case_idand a turn or a ledger id-stub. A downstream driver or operator issues the separate run. - Inventing a threshold or a cap that is not in the agency charter snapshot or the supplied baseline. The skill refuses to grade what it cannot ground.
Procedure
- Compose the case projection read from the data-store runner (C2), keyed on
data_source_ref,store_id,case_id, bounded byperiod. The runner returns events in version order; the skill folds them in that order. - For each grounded signal, compose the ledger read by id-stub only (C7). The ledger is audit-only; the skill never pulls aggregate state from it and never uses the ledger as a domain-keyed state source.
- Compute graded findings:
seal_ratefrom sealed vs refused turns over the period.stuck_case_countfrom turns with statusawaiting_approvalor with zero version advance across consecutive reads.cap_usage_pctfrom cumulativeactsandspendagainst the charter snapshot's limits, plus the optionalhealth_baseline.cap_pressure_pct.escalation_backlogfrom the count of turns parked inawaiting_approvalover the period.refusal_spike_ratefrom the recent refusal rate versus the optionalhealth_baseline.refusal_spike_rate.
- Emit the typed intervention findings. Each finding cites its grounding
case_idand either a turn number or a ledger id-stub. Critical findings, and any finding whose remedy would widen a cap or authority, escalate to the human ops lane and never to a routinepolicy-authortighten. - Seal the verdict. The skill never invents a turn state the sealed event order does not show, and never invents a cap or threshold the charter snapshot or the supplied baseline does not expose.
Inputs
data_source_ref(required string): the registry-pinned identifier of the hosted data-store whose runner is C2.store_id(required string): the store within the data-source that carries the agency case stream.agency_ref(required string): the agency the case belongs to.period(optional object):{ since, until }ISO timestamps bounding the read. Defaults to the entire case stream when omitted.case_id(optional string): a specific case within the agency. Defaults to the agency's current case when omitted.health_baseline(optional object):threshold_days_stuck(number): days a parked turn may stay parked before graded asstuck_case_count.cap_pressure_pct(number): percentage of a cumulative cap above which gradedcap_usage_pctisconcerningrather thanhealthy.refusal_spike_rate(number): sealed-vs-refused ratio above which gradedrefusal_spike_rateisconcerning.
Output schema
agency_health:
schema: runx.agency.health.v1
decision: ready | needs_more_evidence | needs_human
health_verdict:
status: healthy | degraded | critical
findings:
- metric: seal_rate | stuck_case_count | cap_usage_pct | escalation_backlog | refusal_spike_rate
assessment: healthy | concerning | critical
norm: string
evidence:
case_id: string
turn: number | null
ledger_id_stub: string | null
intervention_findings:
- target_lane: policy-author | improve-skill | human-ops
reason: string
remedy_class: tighten | debug | escalate
cap_widening: bool
authority_widening: bool
grounding:
case_id: string
turn: number | null
ledger_id_stub: string | null
refusals:
- when: composition_unreadable | no_case_events | baseline_missing
reason: stringRefusals
The skill refuses to grade a signal that is not grounded in the folded case projection or a ledger id-stub aggregate. It refuses to invent a cap or threshold it cannot read from the agency charter snapshot or the supplied baseline. It never invents a turn state the sealed event order does not show.
When no readable case events exist over the period, the verdict is
needs_more_evidence, no findings are graded, and no intervention is emitted.
The case is recorded in refusals with when: no_case_events.
Quality bar
- Compose the data-store read and the ledger read by id-stub; never read aggregate state from the ledger, never use the ledger as a domain-keyed source.
- Fold the case projection in version order; never reorder events and never infer state the events do not show.
- Name the target lane on every intervention finding; never claim a remedy
without grounding it in a
case_idand either a turn or a ledger id-stub. - Escalate cap-widening or authority-widening remedies, and any critical finding, to the human ops lane; never route them as routine tightens.
- Stop cleanly with
needs_more_evidenceorneeds_human; never fake areadydecision.
Worked example
Open the data-store read for one agency over the last seven days. Fold
forty-two events; thirty-eight advanced, two parked in awaiting_approval,
two refused. seal_rate is healthy at 0.95; escalation_backlog is two;
cap_usage_pct is concerning at 82 percent against the supplied baseline.
Emit one intervention finding naming policy-author with the remedy's
grounding turn numbers, and seal the verdict as degraded. The next
operator turn calls policy-author with this finding as input.
When a fresh agency has zero case events over the period, return
decision: needs_more_evidence, health_verdict.status: degraded, an empty
findings list, no intervention findings, and one refusal with
when: no_case_events.
Published execution profile
The execution profile published with sha-f778c63767cb, shown as its exact bytes.
| Runners |
|
|---|---|
| Profile digest | sha256:4f40c1ee76cfd0098fa41f4d80a4ab84ab6c7b9d546b1bce7d345ad4575800bc |
skill: agency-health
version: 0.1.1
catalog:
kind: graph
audience: operator
visibility: public
role: context
category: ops
connectors:
store:
operations:
- events.read
- projection.read
runners:
source-handoff:
inputs:
data_source_ref:
type: string
required: true
description: Operator-provided hosted data-source binding needed before a live read.
steps:
- id: source-handoff
agent:
role: operator
task: agency-health-source-handoff
inputs:
data_source_ref: $input.data_source_ref
outputs:
source_resolution:
required: false
evaluate:
inputs:
data_source_ref:
type: string
required: true
description: Registry-pinned hosted data-source reference for the live agency case.
store_id:
type: string
required: false
description: Optional store binding resolved by the data-source registry.
agency_ref:
type: string
required: true
description: Agency whose case health is being evaluated.
case_id:
type: string
required: true
description: Live agency case aggregate id.
period:
type: json
required: false
description: ISO since/until bounds applied while folding the case stream.
health_baseline:
type: json
required: false
description: Declared stuck-day, cap-pressure, and refusal-spike thresholds.
ledger_filter:
type: json
required: false
description: Ledger read filter; the health packet receives receipt id-stubs only.
steps:
- id: case_projection
operation: store/projection.read
input:
data_source_ref: $input.data_source_ref
resource: agency_cases
aggregate_id: $input.case_id
- id: ledger_read
skill: registry:runx/receipt-query@sha-f258467d0288
runner: read
inputs:
question: Which governed agency receipts ground health signals for this live case period?
filter: $input.ledger_filter
- id: case_events
operation: store/events.read
input:
data_source_ref: $input.data_source_ref
resource: agency_cases
aggregate_id: $input.case_id
- id: evaluate
skill: ./
runner: fold
inputs:
period: $input.period
health_baseline: $input.health_baseline
projection_packet: $steps.case_projection.provider_operation.result
event_packet: $steps.case_events.provider_operation.result
ledger_packet: $steps.ledger_read.ledger_answer_packet
fold:
inputs:
projection_packet:
type: json
required: true
event_packet:
type: json
required: true
ledger_packet:
type: json
required: true
period:
type: json
required: false
health_baseline:
type: json
required: false
steps:
- id: fold
tool:
command: node
args:
- run.mjs
inputs:
projection_packet: $input.projection_packet
event_packet: $input.event_packet
ledger_packet: $input.ledger_packet
period: $input.period
health_baseline: $input.health_baseline
artifacts:
wrap_as: agency_health_packet
default: true
harness:
cases:
- name: concerning-agency-sealed
runner: fold
inputs:
projection_packet:
operation: read_projection
status: read
aggregate_id: case-health-harness-concerning
after_version: 8
projection:
aggregate_id: case-health-harness-concerning
version: 8
event_count: 8
event_packet:
operation: read_events
status: read
aggregate_id: case-health-harness-concerning
after_version: 8
rows:
- version: 1
committed_at: 2026-07-01T08:00:00Z
event:
payload:
type: opened
status: advanced
charter:
limits:
max_acts: 20
max_spend: 1000
cumulative:
acts: 17
spend: 720
- version: 2
committed_at: 2026-07-01T09:00:00Z
event:
payload:
status: advanced
- version: 3
committed_at: 2026-07-01T10:00:00Z
event:
payload:
status: awaiting_approval
- version: 4
committed_at: 2026-07-02T09:00:00Z
event:
payload:
status: advanced
- version: 5
committed_at: 2026-07-02T10:00:00Z
event:
payload:
status: awaiting_approval
- version: 6
committed_at: 2026-07-03T09:00:00Z
event:
payload:
status: sealed
- version: 7
committed_at: 2026-07-04T09:00:00Z
event:
payload:
status: resolved
- version: 8
committed_at: 2026-07-05T09:00:00Z
event:
payload:
status: advanced
ledger_packet:
matched_receipts:
- receipt_id: rcpt_agency_health_001
status: sealed
- receipt_id: rcpt_agency_health_002
status: refused
period:
since: 2026-07-01T00:00:00Z
until: 2026-07-10T23:59:59Z
health_baseline:
threshold_days_stuck: 2
cap_pressure_pct: 80
refusal_spike_rate: 0.1
expect:
status: sealed
receipt:
schema: runx.receipt.v1
operator_journeys:
- mode: standalone
confusors:
- ops-desk
- run-history
request: Grade the health of this agency case over the last period.
expected_outcome: Return a typed health bundle folded from the case projection and receipt ledger aggregates.
- mode: composed
request: Continue this agency-health work from evidence already gathered upstream.
expected_outcome: Return a typed health bundle folded from the case projection and receipt ledger aggregates.
prior_evidence:
- The case projection and ledger aggregates already read for this period.
must_not_repeat:
- Do not re-read or re-fold the ledger already summarized.
- name: no-case-events-stop
runner: fold
inputs:
projection_packet:
operation: read_projection
status: read
aggregate_id: case-health-harness-empty
after_version: 0
projection:
aggregate_id: case-health-harness-empty
version: 0
event_count: 0
event_packet:
operation: read_events
status: read
aggregate_id: case-health-harness-empty
after_version: 0
rows: []
ledger_packet:
matched_receipts: []
period:
since: 2026-07-01T00:00:00Z
until: 2026-07-10T23:59:59Z
expect:
status: sealed
receipt:
schema: runx.receipt.v1
- name: source-handoff-needs-agent
runner: source-handoff
inputs: {}
expect:
status: failure
receipt:
schema: runx.receipt.v1
Published package and test evidence.
This exact version passed its recorded harness run: 3 checks passed · 0 failed.
Test result
| Harness result | Passed |
|---|---|
| Tested version | sha-f778c63767cb |
| Recorded result | 3 checks passed · 0 failed |
| Result source | Reported by the publisher (runx_registry_publish) |
| Suite | runx-harness |
| Test recorded | |
| Declared cases | 3 |
| Test record | Open the recorded run |
Inspect receipt references
sha256:053d08977b21285a2c5955381db4abdac5f9169e7da3e63de8fb78aabe0952f5sha256:062abedfaeaff1c9f5f1684e63d35d50276314c0eb8b7e0d20fdea81ff9d6e36sha256:dbfbc81f06f27a456a5188d1be0151ec423707d9904d6ae81a833c72a27e2823Package identity
| Published revision | sha-f778c63767cb |
|---|---|
| Content digest | sha256:f778c63767cb90ca1c5ff66f8e49637ec97b95ffe6c24e6c931b3c7a859cb727 |
| SKILL.md digest | sha256:b16f9a550601d2b3561b15976f61bb554d0507211eee36a0049ad3082547be26 |
| Execution profile digest | sha256:4f40c1ee76cfd0098fa41f4d80a4ab84ab6c7b9d546b1bce7d345ad4575800bc |
| Publisher identity | Unverified publisher · guoyunfeng |
| Trust tier | CommunityPublished through the registry without publisher verification. This tier is not a code assessment. |
| Attestations |
|
| Source provenance | Not published with this version |
Version history
0.1.3Content digest sha256:edb1c7a02eea1e85eb0b5ee3d8e1e0035453e78d0d8d5569cdf93a5d65328c06sha-1ef796b50be3Content digest sha256:1ef796b50be305a535a294af66fb8e329cec4e9bc739172475abc82c632796a3sha-9ca798871f8dContent digest sha256:9ca798871f8dcd84297fec76ebf07aa61171ddb0f506a9ad04f26913e55f1b3esha-f778c63767cbViewingContent digest sha256:f778c63767cb90ca1c5ff66f8e49637ec97b95ffe6c24e6c931b3c7a859cb727sha-97ff499f1248Content digest sha256:97ff499f1248768c8b4819429cc4d3e8eeefe2715668bdfa4bd7fb730d4e5b38