genroc

    docs / Reference

    Resolver protocol

    What genctl sends a resolver on stdin, and what it reads back.

    Manifest

    genctl runs a resolver's command once per entry, from the .genroc directory, with every site naming it in one manifest on stdin. A non-zero exit fails the command, with stderr as the message. As JSON Schema: resolver-manifest.json.

    FieldTypeRequiredDescription
    moderesolve | generateyesWhether genctl uses the reply. "generate" (genctl generate, typed resolvers only) reads none, so a resolver may skip the work behind it and only write its files; answering anyway is still correct.
    processesProcess[]yesOne entry per definition with a site for this resolver, in the order the files were read. The reply answers every site, in this order.

    Process

    One entry of processes.

    FieldTypeRequiredDescription
    dirstringyesThe definition's directory, absolute: what a relative argument joins to. One call can span several directories, so the resolver's working directory (the .genroc directory) is not it.
    filestringyesThe definition's file name, within dir.
    namestringyesThe definition's name.
    sitesSite[]yesThe directives in this definition that name this resolver.
    $defsobjectThe definitions the sites' types reach, and no others. Absent when they reach none, and for a structural resolver.

    Site

    One entry of sites: a directive naming this resolver.

    FieldTypeRequiredDescription
    argsstring[]yesThe argument's words (blanks separate them, '...' quotes one literally). Not paths: a resolver may take a URL, a package name or nothing, which is [].
    levelprocess | task | actionyesWhich namespace the directive sits in, so a resolver need not parse pointer to know where it landed.
    pointerany[]yesWhere the directive is: keys and array indices from the definition's root, a task named by its id rather than its index. Where the slot has a type, this is its genctl schema type address.
    actionstringThe action's type. Only at level action.
    childstringThe process the action spawns. Only at level action, on an action that names one.
    taskstringThe id of the task the directive is in. Absent at level process.
    typesobjectWhat this resolver's types entry asked for, by the name it gave each: a JSON Schema whose $ref points into the process's $defs, or null where nothing is at that address. Absent for a structural resolver.

    Reply

    What the resolver writes to stdout on success. As JSON Schema: resolver-reply.json.

    FieldTypeRequiredDescription
    valuesany[]yesOne value per site, in the manifest's order: processes as listed, then sites within each. A typed resolver answers strings; a structural one answers any JSON value, and a mapping where the directive is a spread.