# dog-and-duck.quack.picky documentation

## Generated by Codox

# Dog-and-duck 0.1.0-SNAPSHOT

# dog-and-duck.quack.picky

Fault-finder for ActivityPub documents.

Generally, each `-faults` function will return:

1. `nil` if no faults were found;
2. a sequence of fault objects if faults were found.

Each fault object shall have the properties:

1. `:@context` whose value shall be the URL of a document specifying this vocabulary;
2. `:type` whose value shall be `Fault`;
3. `:severity` whose value shall be one of `info`, `minor`, `should`, `must` or `critical`;
4. `:fault` whose value shall be a unique token representing the particular fault type;
5. `:narrative` whose value shall be a natural language description of the fault type.

Note that the reason for the `:fault` property is to be able to have a well known place, linked to from the @context URL, which allows narratives for each fault type to be served in as many natural languages as possible.

The idea further is that it should ultimately be possible to serialise a fault report as a document which in its own right conforms to the ActivityStreams spec.

### accept-required-properties

As base-activity-required-properties, except that the type of the object is restricted.

view source

### activity-faults

`(activity-faults x)`

TODO: write docs

view source

### activity-required-properties

Properties activities should have, keyed by activity type. Values are maps of the format of `base-activity-required-properties`, q.v.

view source

### activity-type-faults

`(activity-type-faults x)``(activity-type-faults x type)`

Return a list of faults found in the activity `x`; if `type` is also specified, it should be a string naming a specific activity type for which checks should be performed.

Some specific activity types have specific requirements which are not requirements.

view source

### actor-faults

`(actor-faults x)`

Return a list of faults found in actor `x`, or `nil` if none are.

view source

### base-activity-required-properties

Properties most activities should have. Values are validating functions, each.

See https://www.w3.org/TR/activitystreams-vocabulary/#dfn-activity

view source

### collection-faults

`(collection-faults x)``(collection-faults x type)`

Return a list of faults found in the collection `x`; if `type` is also specified, it should be a string naming a specific collection type for which checks should be performed.

Every collection should(?) have a `totalItems` field (an integer).

Beyond that, collections are either ‘just collections’ (in which case they should have an `items` field (a sequence)), or else they’re paged collections, in which case they must(?) have a `first` field which is a collection page or a URI pointing to a collection page, and should have a `last` field which is similar.

The pages of collections should be collection pages; the pages of ordered collections should be ordered collection pages.

view source

### intransitive-activity-required-properties

Properties intransitive activities should have.

See https://www.w3.org/TR/activitystreams-vocabulary/#dfn-intransitiveactivity

view source

### link-faults

`(link-faults x)`

A link object is required to have an `href` property. It may have all of `rel` | `mediaType` | `name` | `hreflang` | `height` | `width` | `preview` but I think they’re all optional.

view source

### persistent-object-faults

`(persistent-object-faults x)``(persistent-object-faults x types severity token)`

Return a list of faults found in persistent object `x`, or `nil` if none are.

view source

### uri-or-fault

`(uri-or-fault u severity if-missing-token)``(uri-or-fault u severity if-missing-token if-invalid-token)`

If `u` is not a valid URI, return a fault object with this `severity` and `if-invalid-token`. If it’s `nil`, return a fault object with this `severity` and `if-missing-token`. Otherwise return nil.

view source