rdy agent guide v0.55.0

Agent guide

Publications and the hub

Load this ruleset when you check or publish a profile, or use a hub.

Publications

  • A publication profile is a publication_profile block under a doc. It has a key, a title, an audience (org or public) and a select list of doc and folder ids. rdy new profile creates one.
  • Propose, land and tag a profile like any block.
  • rdy_publication_check {profile, scope?, against?} checks the selection and the refs that leave it. Pass against to see what the output newly discloses.
  • To compare with a publication of this project or of one that shares a fork origin, make a baseline file at its tag with rdy_publication_baseline {profile, scope: "tag:<name>", out}, and give the person its path. Pass that file's path as against_baseline, in place of against. On E_PUBLICATION_BASELINE, give the person the fix from the error.
  • A ref in the text of a selected block to a block outside the selection, or to no block, blocks a public profile and warns on an org one. Show the person every row and warning. The check authorizes nothing.
  • A link to a target outside the selection, such as implements, decided_by or describes, never changes the status, because no output shows it. The report lists these links apart in references.links_outside (CLI: Links outside selection: <n>.). Keep them: never remove a link to clear the check.
  • A ref by id to a decision outside the selection does not count either. A profiled output shows its display words, or nothing. So when a sentence needs the words, give the ref display words. A ref to a decision id that is no block still counts as missing.

Profiles on the live site. Call rdy_site {profile} with an optional scope. profile is an id, a key or implicit:org. CLI: rdy site --profile <profile>.

  • For a separate site that shows only that profile, call rdy_site {profile, only: true}. The scope must be canon: otherwise E_BAD_INPUT. CLI: rdy serve --profile <profile>.
  • On E_SITE, follow the fix in the message.
  • Pass on W_SITE_PROFILE. It says a profile-only site is open, or its profile is no longer in canon.
  • A public profile that has blocked references still serves on the live site, with a warning. It is not publishable. Run the check before any publish.

Publish. Call rdy_publish {tag, to, site, keep_latest?}. CLI: rdy publish <tag> --to <remote> --site <site>.

  • to names a remote in publish mode. The hub site selects the profile: don't pass one.
  • Sign in first. Tag the profile and the content first.
  • The call creates a candidate on the hub and publishes nothing. Show the person the warnings, the candidate link and the disclosure review. Never claim that the content is public.
  • Pass keep_latest only when the person says so. Without it the hub's default applies.
  • On E_UPSTREAM_UNCERTAIN, check the candidate on the hub before you try again.

Sharing and the hub

rdy can connect to a hub service for sharing and publication.

  • rdy_remote lists and edits remotes offline. A remote has a name, an HTTPS url and a mode, share or publish. At most one remote is share.
  • Sign-in: rdy_auth {op: "start", install, machine_name} returns a card and sends nothing. Show the card.
  • Relay the answer: start again with card_hash, answer (confirm or cancel), evidence and question. Give the person the user_code and verification_uri, and poll state.
  • You never see, ask for or handle a token. rdy auth token is for credential programs, not for agents.
  • rdy_key_bind {kind} returns a confirm_url and state pending. Give the person the link: the key binds only when they confirm it on the hub's page.
  • Retire or revoke a key only on the person's word. Revoke is for a key that may be compromised.
  • On E_UPSTREAM_UNCERTAIN, the request may have completed. For a push or a pull, call rdy_push or rdy_pull again: rdy finds the outcome of the write before it writes again. For any other request, check its state on the hub before you try again.
  • Sign-in fails with E_UPSTREAM_PROTOCOL when the hub names an account handle outside the actor form. Tell the person.
  • machine_name is optional in start: rdy uses the host name, and the card names it. After the person confirms in the browser, the next hub call checks the sign-in once, so it needs no state call first. A person at a terminal can run rdy auth sign-in --install <origin> alone: it asks, opens the link and waits.

Push and pull. Call rdy_push {remote?, views?, force?, restore?} to send canon, and the views that you name, to a share remote's hub repo. Call rdy_pull {remote?, views?, take?, strict?} to get them from it. CLI: rdy push [--remote <name>] [--view <name>]... [--force | --restore <dump>] and rdy pull [--remote <name>] [--view <name>]... [--take] [--strict]. Call rdy_pull {dump, out, remote?, url?} to fetch a hub dump into a new file. CLI: rdy pull --dump <id> --out <file> [--remote <name> | --url <url>].

  • Both need the writer role, a sign-in on this machine and a remote in share mode. Without remote, rdy uses the share remote, else the only remote. Name at most 256 views, each one time. Both run in the daemon: a server with --no-daemon refuses them with E_BAD_INPUT.
  • A push sends canon first, then each view. When local canon does not hold the hub tip, the push refuses with E_DIVERGED: pull, then push again. Pass force only when the person tells you to replace hub canon.
  • A forced push, a restore into a hub repo that holds canon, and take with no views each remove landings from a canon. Each returns a card first, with status: confirmation_required, and writes nothing. Show the person the card and the landings in leaving. Then call again with the same inputs, the card_hash, the person's answer and their words as evidence. On E_ITEM_MOVED, show the new card. Never answer a card yourself.
  • A pull replays the unpushed local landings onto hub canon. At the first landing that conflicts or fails the gate, the replay stops. Canon keeps the landings replayed so far, and the rest go into a new view pull-<n> that you own. strict replays no landing: canon takes the hub tip, and the unpushed landings go into pull-<n>. take with views takes only those views, with no card. A view that the hub does not have is refused.
  • The hub can hold a push for review in a request: the status is held. Give the person the request number. While local canon's head is the held head, a push sends no write and reports the open request, with the status held_open. A pull asks the hub for the outcome of the held push, and clears the hold when the request is closed.
  • On W_UPSTREAM_HELD_LOOKUP, the hub did not give that outcome. The pull goes on and keeps the hold. Give the person the code and the fix in the warning. The next pull asks again.
  • A push sends each tag that it carries with the render inputs that it captures: the rdy version, the theme, the effective pack, and the project's title and description. When the hub repo already has a tag with that name, the hub refuses that write with E_TAG_EXISTS. The push goes on with its other writes.
  • restore takes the path of a dump file, absolute or relative to the project directory, and sends the dump to the hub repo. It takes no views and no force. Tell the person which tags it sent without render inputs, and which hub views it did not change.
  • On E_UPSTREAM_UNCERTAIN, the write may have reached the hub. Do not send it again yourself: run rdy_push or rdy_pull again, and rdy finds the outcome first. On E_LOCKED, another push or pull to that remote is running.
  • Relay the whole result: the status of canon and of each view, the views and tags taken, refused or kept, conflicts, a held request, warnings, and each hub refusal with its fix.
  • dump fetches the hub dump with that id into the new file out. It takes only out and one of remote or url. It needs no project role and writes no store. Give the person digest, and ask them to compare it with the digest on the hub's dump page. Then follow next: rdy push --restore <file>, or rdy load <file> <dir> for a copy.
  • rdy_overview and rdy status show the sync state of each remote in sync.