Downloads

The capdag command

The command line is arranged as commands, each with help and examples (capdag help <command>, -h, --help):

Now Was
capdag caps [query] [--in <type>] [--out <type>] [--pick] (none)
capdag info <cap or media>… capdag find, capdag resolve, capdag <cap> --help
capdag run <cap> … capdag <cap> …
capdag run <file.machine> … capdag run <file.machine> …
capdag plan … capdag plan …
capdag check <file.machine> (none)
capdag graph <file.machine> [--format text|mermaid|dot] capdag dag-viz
capdag view, capdag edit (none)
capdag cartridge list | install | remove capdag cartridges, capdag install
capdag model list | search | pull | remove (none)
capdag cache refresh | clear capdag cache [clear|refresh]
capdag dev new <path> --lang <language> capdag new <name> --<language> -o <dir>
capdag dev install [<dir>] capdag dev-install
capdag dev hash-dir, capdag dev bundle-manifest capdag hash-cartridge-dir, capdag bundle-manifest
--dev-bin <path> (repeatable) --dev-bins <path>…

A cap’s name typed as a command is answered with how to run it (capdag run <cap>), a mistyped command with the one it was closest to.

  • Names. Capabilities, media types and machines are shown by their aliases; the URN behind a name is shown with -v and is in every --json record. Every machine plan lists, plan --save and edit write, and check, graph (in every format) and view show is in alias form: [(pdf) -> disbind -> (page-text)]. The editor opens a machine in alias form, and a cap chosen in it is written by its alias.
  • Errors. Every error says what is wrong (error:), what was expected and found, and the next command to type (hint:). A usage error exits 2, a failure 1, a run with tolerated failures 3, a stopped or aborted run 130. Internal names, step tokens and debug-formatted values are no longer shown.
  • --json. Every command writes JSON Lines on stdout: listings, a run’s events, the choices a command needs, and its error. capdag run writes nothing else there: every result, a single value too, is written as a file and named in the run’s run_finished record.
  • Choices. On a terminal, a choice a command needs — what to make of a file, which machine, which cap, which model — is made in an inline picker: type to filter, arrows, Enter. Without one, or with --no-input, nothing prompts: the choice is a flag, and the error for a choice not made names the flag and the values it takes.
  • The live view. A run is drawn under the command while it runs — each step with its state and progress, a map’s items, the last thing a cartridge said — and leaves its summary in the scrollback. It is drawn on stderr, so it is shown with stdout redirected to a file or a pipe, and a run started from view or edit is shown in it as any run is. Without a terminal it prints a line per change (--progress plain|live|none). Cartridges’ info and debug logs are shown with -v and -vv.
  • Stopping. Ctrl-C on a run admits nothing new — no new item into a map, no run for the next input — closes its live feeds, and lets what started finish and be written; the summary names what never started. A second Ctrl-C aborts: every live request is cancelled as the user’s cancel and the cartridges are given 5 s to end, after which, or at a third Ctrl-C, what is left is ended. It used to be refused on a run with no live input, and the second Ctrl-C ended the process without cancelling anything.
  • --offline uses the network for nothing; what is not cached or bundled is an error naming it.
  • The binary is built with the cli feature, which replaces tui and implies capture.

Bundled cartridges

A command no longer starts and hashes every bundled cartridge before it does anything. The bundle’s signed manifest (capdag.bundle/v2) records each cartridge’s hash, the fabric manifest version it was built for and the caps it provides, so capdag cartridge list, caps, info and plan read that one file, and capdag run hashes only the cartridges it starts, each time it starts one. A cartridge changed after the bundle was built is not started, and the run says which one, where it is, what it hashes to and what was recorded. A bundled cartridge recorded for another fabric manifest version is refused as such. capdag dev bundle-manifest starts each staged cartridge once to record its caps, and a manifest in the earlier format is refused. A build records the manifest as soon as the cartridges are staged, before it signs them for their platform, and capdag dev bundle-rehash hashes it again after that signing, keeping the recorded caps and starting no cartridge: a cartridge signed into the macOS app sandbox cannot be started outside its app. It refuses a tree that is not the set the manifest records.

Swift cartridges’ manifests

A Swift cartridge’s manifest carries each of its caps as the fabric publishes it. The Swift CapDefinition holds every field the Rust Cap does — version, documentation, dims, metadata, metadata_json, registered_by, supported_model_types and default_model_spec — and writes each key exactly when the Rust library does; it used to drop all of them, so a cap’s dims went missing from the manifest a Swift cartridge reported. A CapArg carries its metadata. An argument, output, argument source or dim entry with a key the library does not know is refused, naming the key, and an argument without required or sources is refused, as in the Rust library.

The cartridge capdag dev new scaffolds, in every language, declares its cap for English text (language=en), because the classify-en cap it calls is English-only, and lists the dim that tag comes from in the cap’s dims. The getting-started guide shows the new cap URN.

Stopping a run

A stop (15.2 §Runs stop) admits no new work and closes the run’s live feeds; what the run admitted drains to its outputs. execute_plan takes a RunControl from its caller, and a map admits an item only while the run admits work. What each ask — a person’s interrupt, a stop, an abort, the drain, the abort’s grace running out — does is decided by code generated from a new proved model, CapDAG.Run.Control, in every library; CapDAG.Run.Step decides what a watcher shows of each step. A stop of a run with no open feed is no longer refused; a stop of a run that is already stopped, aborted or over is StopInputsError::NotRunning.

A refused registry fetch is reported as itself

When the fabric registry refuses a fetch (an HTTP status such as 403 or 503) or does not answer, capdag says so: what it was fetching, the URL, the status or the timeout, and the fabric manifest version it was fetching for. A capability, media definition or alias is reported missing — “undefined alias”, “not available”, “there is no capability named” — only when the registry answers that it does not have it (404, or the manifest does not name it). Before, a refused fetch read as a missing definition, and sent a user looking for a definition that exists.

  • capdag run, info, plan and cartridge stop on a refused fetch with that message, and a hint to run the command again.
  • The Rust, Go, Python, JavaScript and Swift/Objective-C libraries report a failed fetch as a distinct error (FetchFailed) carrying the URL, the status and the manifest version; a lookup that cannot wait on the network reports what the last fetch of a definition came to, or that it has not been fetched yet, instead of coming back empty.
  • The Objective-C library’s fabric registry no longer has resolveAliasCached:, which answered nothing for every alias it did not hold, whatever the reason; getAlias: says why an alias is not at hand: the pinned manifest does not name it, or the name is not a valid alias name.

The fabric cache: one folder per manifest version, entries replaced whole

capdag keeps its fabric cache in one folder for each fabric manifest version (<os cache>/capdag/<charter slug>/v<N>/), and writes a cache entry to a temporary file it then renames over the entry. Before, every capdag on a machine shared one folder, and an entry was rewritten in place while other runs read it.

  • Runs that read the cache while another writes the same entry read the old entry or the new one, never part of one.
  • capdag releases built for different fabric manifests, installed on one machine, never read each other’s definitions.
  • A cache entry that is there but cannot be read, does not parse, or holds another definition than its path names stops the command with an error naming the file, instead of being dropped as missing. Remove the file, or run capdag cache clear.
  • capdag cache clear and capdag cache refresh clear a cache that holds a corrupt entry without reading it first, and remove the folders of the older shared layout (caps, media, aliases, dims and manifests directly in the registry’s folder). Nothing is migrated from them: everything in them is fetched again.
  • The Rust, Go, Python and Swift/Objective-C libraries keep the cache the same way. The layout is described in the CLI reference, under the fabric cache on disk.

The profile-schema cache: one folder per library and version, entries replaced whole

The JSON Schemas that media definitions name as their profile are cached in <os cache>/capdag/profile_schemas/, now in one folder per capdag library and version (capdag-rs-<version>/, capdag-go-<version>/), and an entry is written to a temporary file then renamed over the entry. Before, the Rust and Go libraries of every version shared one folder and one file per schema, rewritten in place while other runs read it, and a file that did not parse or whose schema did not compile was skipped without a word.

  • Runs that load the cache while another writes the same schema read the old schema or the new one, never part of one.
  • A library at one version never reads a schema another library, or another version, cached. After an upgrade, schemas are fetched again.
  • A cached schema that cannot be read, does not parse, holds another URL than its file name is the hash of, or does not compile stops validation from starting with an error naming the file. Remove the file.
  • Clearing the profile-schema cache empties the library’s own folder and removes the files of the older flat layout (profile_schemas/<16 hex digits>.json), which no release reads now.
  • The layout is described in the CLI reference, under the profile-schema cache on disk.

A cartridge that calls a cartridge not installed

A cartridge’s peer call to a cap no hosted cartridge serves no longer fails with NO_HANDLER when the cartridge that serves it can be brought. A relay switch given a peer provider (RelaySwitch::set_peer_provider) holds the call — its REQ and every frame sent for it after — while the provider brings that cartridge, then replays it in order. The capdag command line’s provider follows the rule a run follows for its own cap’s cartridge: a dev cartridge given with --dev-bin, else the registry’s, installed when it is not installed. So capdag run summarize-en installs ggufcartridge the first time, as capdag run of a gguf cap would. A hold keeps at most 4096 frames and 64 MiB and waits at most 100 s; past those, or when the cartridge cannot be found, installed or started, the call ends with an ERR that names the cartridge and the command that installs it (PEER_HOLD_OVERFLOW, PEER_PROVIDER_TIMEOUT, CARTRIDGE_INSTALL_FAILED, CARTRIDGE_REFUSED, CARTRIDGE_REGISTRY_UNAVAILABLE, CARTRIDGE_UNAVAILABLE, NO_HANDLER). Whether a call is held, what each of its frames does to the hold, and how the hold ends are decided by code generated from a new proved model, CapDAG.Bifaci.Hold. The Go and Swift/Objective-C libraries’ relay switches hold such a call the same way, given a provider with SetPeerProvider and setPeerProvider(_:bound:).

Windows: a frame that arrives in pieces is no longer a closed connection

On Windows, the Rust library’s local socket (bifaci::local_socket) answered a read that already held part of what it asked for, and was waiting for the rest, as the end of the stream. A frame that arrived in two pieces failed as UnexpectedEof, which the relay reports as “Relay master connection closed unexpectedly” and a run as MASTER_DIED, as a large payload did, and reading a stream to its end stopped after 8 MiB. A read now waits for the rest, and ends only at the real end of the stream. A write answered Pending has written nothing, so a write given up on (a timeout, select!) sends none of its bytes.

Go, Python and Swift cartridges answer heartbeats while a handler is busy

A cartridge built on the Go, Python or Swift/Objective-C library answers the host’s heartbeat from its input reader, ahead of everything its main loop is doing, as the Rust library does: a reader of its own (a goroutine in Go, a thread in Python and Swift) answers a heartbeat itself and passes every frame, heartbeats included, to the main loop in the order it arrived. The main loop answered heartbeats when it reached them, so a reply waited on whatever the loop did first. A Go cartridge whose handler was slow to read a peer call’s answer kept its main loop waiting, stopped answering heartbeats, and was declared unhealthy in the middle of correct work; it no longer is. A heartbeat still says only that the cartridge is alive and reading its input, not that its handlers are making progress.

CapMatcher chooses as dispatch does

CapMatcher in every library (Rust, Go, Python, JavaScript, Swift/Objective-C) chooses among caps the way a request is routed: it considers only the caps that serve the request (is_dispatchable), ranks first the one closest to the request in specificity (an exact match, then the nearest more specific cap, then the nearest more general one), and of caps that rank alike keeps the first registered. It considered the caps the request accepted read as a pattern, which takes in a cap narrower than what the request sends and leaves out a broader one that serves it, and it chose the most specific of them: the Rust library the last of equals, the Objective-C library the first in alphabetical order. find_all_matches lists the serving caps in that ranking order. Every library now has select, which gives the position of the chosen cap (the Rust library already had CapUrn::select). The Objective-C library’s sortCapsBySpecificity: and cap:acceptsRequest:withContext: are removed, and it has areCompatible:with:, as the other libraries have are_compatible.

A marker predicate reads the marker

Every media URN marker predicate is true only when the marker is present, as media:image writes it: is_void, is_image, is_audio, is_video, is_numeric and is_bool in every library (IsVoid, isImage and so on in Go, JavaScript and Objective-C), and IsFilePath and IsLiveFeed in Go. Each was true whenever the URN named its tag at all, so media:!image, which says the media must not be an image, and media:?image, which leaves it open, counted as an image, and media:!void as void: a cap with !void or ?void on a side was classified as a source, sink or effect, and the planner went no further through a cap whose output said !void. They are now ordinary media URNs; such a cap is a transform.

media:void stays atomic, and only the marker is: media:!void;enc=utf8 and media:?void;enc=utf8 parse, where they were refused as VoidNotAtomic, while media:void;enc=utf8 is still refused, naming enc.

Machine notation: a retried step may not stream

A step written with retry whose cap declares a streaming output is refused when the machine is read (RetryOnStreamingStep), in every library (Rust, Go, Python, JavaScript): a retried step’s outputs are held until an attempt succeeds, and a streaming output cannot be held. Such a step used to resolve and run. The Rust library’s MachineAbstractionError loses MissingAnchorSource, SourceBoundToNonAnchor and AnchorSourceMismatch, which nothing raised.

Paths of equal rank are listed in one order in every library

Among paths with as many cap steps and the same total specificity, the Go, Python and Objective-C planners list them in the Rust library’s order: step by step, a cap before a ForEach before a Collect, caps by the structural order of their cap URNs and then of their output, then each step’s input and output media URNs, the shorter path first. Go ordered them by the titles of their caps, Python and Objective-C by the text of their cap URNs, so the same caps could be listed in a different order in each library. The Objective-C CSMediaUrn and CSCapUrn gain compareStructurally:.

Cardinality is never read from a media URN

InputCardinality::apply_to_urn and MediaShape::apply_to_urn (Rust, Go, Python) and Python’s InputCardinality.from_media_urn are removed. Whether a value is a sequence is the is_sequence flag of the arg or output that carries it; the list marker of a media URN describes one value’s content.

A run’s progress gives every step the same weight

When a chain is split into pipelines (where two caps share a bounded pool, or a streaming output meets a consumer that does not stream), each pipeline’s part of the run’s progress is the steps it holds, not an equal share: splitting three steps into one and two gave the first step half the chain.

A cap’s activity timeout must be a whole number of seconds

A cap whose activity_timeout_secs metadata is not a whole number of seconds greater than 0 ("0", "10m", "-5") fails the run with ExecutionError::CapMetadataInvalid, naming the cap and the value; it was silently given the default 120 seconds. A cap that does not set it still gets 120 seconds. When a cap is silent for its timeout, the run logs one warning and keeps waiting, as before: stopping a silent step is a cancel.

The Swift library’s DEFAULT_ACTIVITY_TIMEOUT_SECS and ACTIVITY_TIMEOUT_METADATA_KEY, which nothing read, are removed.

Installed cartridges: one rule for listing and running

capdag never runs an installed cartridge that capdag cartridge list refuses: listing and running hold an installed cartridge to one rule, and both take its newest version by number. A cartridge’s installed version and the registry’s latest are ordered by their dotted numbers in every library, so 1.174.414 is newer than 1.99.0.

  • A run that needs a cartridge installed for another fabric manifest stops, naming the cartridge, the manifest it was installed for and the one capdag reads, and says to replace it with capdag cartridge remove <id> && capdag cartridge install <id>; capdag cartridge install refuses it the same way rather than overwriting it. Before, a run used it, and an argument whose media had changed between the two manifests was silently ignored.
  • The refusal says what to do by where the cartridge came from: install a registry cartridge again, rebuild a dev cartridge for the host’s manifest, and, for a bundled one, that the build which bundled it is inconsistent.
  • Every library (Rust, Go, Python, JavaScript, Swift/Objective-C) decides whether, and how, it attaches a cartridge by that one rule, which reads nothing on disk but what a bundled cartridge’s signed bundle manifest records. The JavaScript library verifies no bundle manifest, so it refuses a cartridge that says it was bundled, and says so.
  • When capdag dev install refuses a published cartridge, the Go, Python and Swift libraries say what to do instead, as the Rust one does: publish it through the cartridge registry, or set registry_url to null for local development.

What a file is

A file’s media is told from its extension and its content as the fabric’s file types say, the same way in the capdag command and the desktop clients, and in every library (Rust, Go, Python, JavaScript, Swift/Objective-C).

  • The file types an extension names come from the whole pinned manifest: every media definition with the ext= file-type tag that lists the extension. They are loaded the first time a file’s type is asked, fetched 16 at a time into the manifest version’s cache, and never at start-up. Before, only the definitions an earlier command happened to cache were known, so .csv and .yaml files were unknown. With no cache and no network the question fails, naming every file type it could not fetch.
  • A definition without the ext= tag is content, not a file type: a model download’s result lists json so it is saved as a .json file, and a .json file is no longer taken for one.
  • A refinement nothing proves is never claimed: a .txt file is plain text, not digitized text, and a .json file is JSON unless a cartridge that inspects it says it is a record or a list of records. The validation rules a definition declares, and what an inspecting cartridge claims, are the proof. Which candidates stand, which are kept, and which one a host that cannot ask takes are decided by code generated from the proved CapDAG model.
  • A detected file keeps its list and record markers, so a CSV file is a list of records and the caps that take one take it.
  • An extension the fabric declares no file type for, and a file with no extension, are errors that say so. A pinned manifest that names a media definition by something that is not a media URN stops detection with an error naming the manifest version and the entry, where the entry was left out without a word.
  • The capdag command asks a cartridge when a file’s candidate media fall under its content-inspection adapter, so a cartridge that inspects JSON makes an object a JSON record and an array of objects a list of records. A command learns the adapters on the first file it detects, a bundled cartridge’s from the build’s signed record and an installed one’s by starting it once; a command that reads no file starts nothing, and a run uses the cartridge started to inspect its input. Of two cartridges whose adapters overlap the second is refused, as the desktop clients refuse it, and a file under the refused one is an error naming both. When a cartridge cannot be asked, the detection error says why. Under --json, capdag plan first names the media each file was taken as, in an input record.
  • capdag keeps the list of the manifest’s file types beside the cached manifest, with the hash of the manifest file it came from, and reads it back while that file is unchanged, so a command that reads a file no longer works it out from the whole manifest every time (capdag plan on a CSV file on a warm cache: 223 ms before, 120 ms now). A kept list that cannot be read is an error naming its file; capdag cache clear removes it.
  • The JavaScript library exports survivingCandidates and settle, and the Objective-C library declares CSFileMediaCandidate, CSSurvivingCandidates and CSSettle.

capdag plan reads the whole fabric

capdag plan finds its machines among every capability the fabric defines, not only those an earlier command happened to cache: the capabilities not cached are fetched, 16 at a time, with the media types and dims they name, and kept in the cache of the manifest version capdag reads. capdag caps, capdag info of a media type, the near names offered for a mistyped capability, a run of a capability that a more specific one stands in for, and the palette of capdag edit read the fabric’s capabilities the same way.

  • A capability that cannot be had stops the command, naming each one and why; with --offline, one that is not cached is such a capability. Before, a capability whose fetch failed was left out without a word, and what plan found depended on what earlier commands had cached.
  • Commands that do not look at every capability no longer fetch them all when they start, so a first capdag info <capability> on an empty cache fetches only what it shows.
  • A capdag plan --to that names a kind of which the files can become one target, rather than the target itself, says which target it is making: --to json: making embedding-vector, the one json 1 pdf can become on stderr, or a to record (given, alias, urn) under --json. Before, it took that target without a word.
  • In the Rust library, FabricRegistry::manifest_caps answers every cap the pinned manifest names, LiveCapFab::from_fabric builds the planning graph of the whole fabric from them, and StoredMediaDef::is_bookend marks its bookends.

The universal media type is drawn on a fresh install

A machine with a node of the universal type media: is drawn on a fresh install, the blank machine a new machine starts from included. Every library reads media:‘s definition (“Any Media”) at the version its fabric manifest pins, as it does every other media type, and fetches it with any capability that names it; they asked for it at version 0, which the fabric does not serve, so such a node had no title and the machine could not be drawn. The Rust registry asks only once for a definition the fabric says it does not hold, until its cache is cleared; a fetch that failed for any other reason is asked again.

Whether a cap can be declared is decided by the proved model

Whether a cap can be declared is decided by code generated from the proved CapDAG model, which every library carries with the claim that it is the model’s decision (Rust, Go, Python, JavaScript, Objective-C). A cap URN is refused as the bare top form, or as an effect=none cap whose input is not inside its output, exactly when the model says so, with the same messages as before.

  • A patch cap is always admissible: given its declared in=, it gives in= with the delta to out= applied, which is the declared out= itself. The check each library made of a patch cap’s delta is gone.
  • The Python library raises IllegalDeclarationError, a CapUrnError, for a cap that cannot be declared.
  • The model’s conformance tables, which every library replays through its own parser, detection and peer holds, gain which caps can be declared, what a file is, what a switch does with a peer request no master serves and with each frame of one it holds, and the first thing a receiver finds wrong in a flow’s order.
  • The cap URN structure and validation rules documents say a patch cap is always admissible and that the model decides admissibility.

Swift: the proved model’s enums are plain enums

The proved model’s code is generated by lungo 1.127.0. In the Swift/Objective-C library its enums (RunPhase, StepState, Fate, Constraint and the others) are plain enums rather than indirect enums, since none of them can hold one of its own; code that uses them is written as before. A release build of the library with Swift 6.4 no longer crashes the compiler’s optimizer, which failed compiling a switch over such an enum.

The Rust library: observing runs and drawing plans

The Rust library gains run flow statistics (FlowRecorder, RunFlowRegistry), a plan’s drawable view (PlanView), run observation (RunObserver, RunEvent) and the command line’s strand runs and output emission as library functions, which the capdag command’s live view, graph, view and edit are built on. A cartridge started only to read its manifest no longer writes on the caller’s stderr; when that start fails, the error includes the end of what the cartridge wrote.

The identity cap is recognised as itself

Every library (Rust, Go, Python, JavaScript, Swift/Objective-C) recognises the identity cap by equivalence wherever a cartridge manifest, a host’s RelayNotify or a request names it. A wider pattern the identity refines, such as cap:?effect, no longer counts as declaring the identity, and the identity written another way, such as cap:effect=none;in=media:;out=media:, is the identity: the in-process hosts serve it before a policy and leave it out of their advertised caps once, as they do cap:effect=none. An in-process host answers a request whose cap is no cap URN with INVALID_REQUEST, naming it, and a cartridge manifest or RelayNotify cap that is no cap URN is refused, naming it.

Cap-tags and media tags are constraints

Every library (Rust, Go, Python, JavaScript, Objective-C and Swift) holds a cap’s tags, and a media URN’s, as the constraint each writes: tagged-urn’s Constraint (CSTagConstraint in Objective-C and Swift), one of exact, present, absent, unconstrained, optionalNot and presentNot. get_tag returns the constraint; exact_value (ExactValue, exactValue, exactValue:) returns the value of an exact tag; has_tag(key, value) asks for that exact value and has_marker_tag for a marker; with_tag takes a constraint. The builder’s tag sets an exact value, taken literally, marker a marker, and constraint (tag:constraint: in Objective-C) any form. The Rust and JavaScript libraries export Constraint and TaggedUrn.

  • The direction and the effect are not cap-tags. get_tag("in"), get_tag("out") and get_tag("effect") return nothing; read them with in_spec, out_spec and the effect. A constructor or with_tag given in, out or effect as a tag refuses it.
  • A direction is a media URN. A missing in or out, or one written as a marker (in, in=*), is media:; an exact value is a media URN, kept in canonical form by every constructor as by parsing; any other form is refused, and so is a quoted in="*", which is the literal value *. A quoted effect="?" is refused for the same reason.
  • Errors name the rule. A cap built without a direction says Cap URN requires 'in' tag (or 'out'); a direction that is no media URN says Invalid 'in' media URN: <value>. Must start with 'media:' or be '*', or names the parser’s reason when it begins media:.
  • Keys. A cap-tag’s key is an identifier, as in tagged-urn: generate_thumbnail and 1a are refused. The standard caps of the Python library use the same kebab-case keys as the others (generate-embeddings, render-page-image, convert-format), and its caps that carried ml-model=* or constrained=* carry markers.
  • The numeric-key error is gone.

Value adapters are chosen by the media URN they refine

A value adapter is registered under a media URN, and a base media URN is refined by the adapter whose key it conforms to, the most specific of them, as the proved model chooses (CapDAG.Detect.adapterFor), in the Rust, Go and Python libraries. It used to be chosen by the longest key that the base’s text began with, so media:enc=utf8;llm;model-spec never reached the adapter registered under media:model-spec. A key that is no media URN, a key equivalent to one registered, a base under two keys neither of which refines the other, and a refinement that is no media URN or does not conform to its base are each refused with a ValueAdapterError naming them.

In-process hosts choose a handler as dispatch does

The in-process cartridge host, in the Rust, Go, Python and Swift libraries, chooses the handler for a request with the proved ranking (CapUrn::select): the cap closest to the request, and of caps that rank alike the first registered. It ranked by a sort of its own, which in Swift did not promise the first registered of equals, and it read every registered cap from its text again on every request. The manifest leaves out a handler’s identity cap by comparing caps, not their text.

A media definition reads the marker

The predicates of a resolved media definition (is_image, is_audio, is_video, is_numeric, is_bool, is_record, is_list) are true only when the marker is present, in the Go, JavaScript and Objective-C libraries, as in Rust and Python. media:!image was an image there. Whether a media definition is text asks whether its URN guarantees an encoding (it conforms to media:enc): media:?enc and media:!enc are not text.

Download CapDAG