Wyrd docs v0.2.0 Reference GitHub

Status: Runnable

Bind a Verifier

A Verifier on its own checks nothing. You attach it to what it checks with a verified_by binding on the Service, on one component, or on an Agent Card. The binding also decides who runs it: your code, or a schedule.

Bind a Verifier your code calls

This is the support desk’s full Service. It binds one Verifier to the whole Service and two to the agent. Switch tabs to see each Card a binding points at:

support-desk.yaml yaml
apiVersion: wyrd/v1
kind: Service
metadata:
  name: support-desk
  version: 1.0.0
  space: default
spec:
  service_type: agent
  # The Service's own Verifier checks every answer the desk gives.
  verified_by:
    - verifier: ./no-refund-promise.yaml
  tables:
    - name: tickets
      schema:
        type: object
        properties:
          question: {type: string}
          answer: {type: string}
        required: [question, answer]
  components:
    - alias: agent
      ref: ./support-agent.yaml
      verified_by:
        - verifier: ./ticket-complete.yaml
        - verifier: ./follows-policy.yaml
    - alias: prompt
      ref: ./support-prompt.yaml
Bound onVerifierApplies to
The Service’s verified_byno-refund-promiseEvery Run of the Service, as run.observe.verify(...)
The agent component’s verified_byticket-complete, follows-policyThe agent’s view of a Run, as run.for_card("agent").observe.verify(...)

None of these bindings has runs_on, so nothing runs them on its own. Your code calls verify or submit with the evidence; Verify inside the run shows both. That is the right default for anything that judges one request.

Bind a Verifier to a schedule

A schedule judges samples your service recorded over time, such as request latency, instead of one request. Add runs_on with a Trigger and optionally on_failure with the Operators to run when it fails:

latency-watch.yaml yaml
apiVersion: wyrd/v1
kind: Service
metadata:
  name: latency-watch
  version: 1.0.0
  space: default
spec:
  verified_by:
    - verifier: ./latency-shift.yaml
      runs_on: ./daily.yaml
      on_failure:
        - ./alert-on-call.yaml

Every day at midnight UTC, the server compares the day’s latency samples with the baseline and, on a failed verdict, posts to the on-call hook. Monitor drift walks through recording the samples.

Binding fields

FieldRequiredHolds
verifierYesA path to the Verifier’s Card file, or a declared Verifier
runs_onNoA Trigger, as a path, a declared Card, or inline. Absent, only your code runs the Verifier
on_failureNoOperators to run after a failed verdict, as paths, declared Cards, or inline

A Trigger is {kind: schedule, cron: "<cron>", tz: <zone>}, with tz defaulting to UTC. Schedules only judge recorded samples: binding runs_on to a Verifier with other inputs fails declaration. A binding has no other fields, and an unknown field such as when is rejected.

If it fails

You seeCauseFix
WYRD_SDK_404_UNKNOWN_VERIFIER from verify or submitThe Verifier isn’t bound to the view you called it onCall it on the view whose Card binds it, or add the binding
WYRD_SPEC_400_DUPLICATE_VERIFICATION_BINDINGThe same Verifier is bound twice on one subjectRemove one
WYRD_SPEC_400_TRIGGER_ACTIVATION_MISMATCHruns_on is set on a Verifier that doesn’t judge samplesRemove runs_on and call the Verifier from code
WYRD_PERMISSION_403_DENIED_RBAC at declarationA binding has on_failure, and your credential lacks operators:invokeDeclare with a credential that has it

Next

Declare and inspect the Service. To write your own Verifier, see Author a Verifier.

Last updated