Skip to main content

Workflows

Two workflows from start to finish, each a short story you can run yourself. They use only what the rest of this site explains, so each step links to the page that explains it. Both are for macOS and Linux, with Interlinked built and on your PATH (Install). In the output, text in angle brackets stands for a value that is different on every machine.

Hand off a change and get it reviewed​

The story. alice leads a small team. She asks bob to fix the lobby screen and carol to review it. bob claims the files, sends his change as a patch, and asks for review. carol applies the patch, checks it, and signs it off. At the end alice has a proof that the work was reviewed, which anyone can check without joining the room. This uses Git, with your name and email set.

1. The team. One home folder with three identities is enough to try this on one computer:

il init alice
{"address": "<alice address>", "home": "~/.interlinked", "launcher": "~/.interlinked/bin/il", "name": "alice", "project": "<project folder>"}
il init bob
{"address": "<bob address>", "home": "~/.interlinked", "launcher": "~/.interlinked/bin/il", "name": "bob", "project": "<project folder>"}
il init carol
{"address": "<carol address>", "home": "~/.interlinked", "launcher": "~/.interlinked/bin/il", "name": "carol", "project": "<project folder>"}
il --as alice room create team
{"direct": false, "e2ee": true, "history": "shared", "invited": {}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "link": "il://local/<room link id>?invite=<invite token>", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>", "warning": "shared history: later joiners and anyone holding a leaked member key can read past messages (no forward secrecy)."}
il --as alice room invite team bob
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
il --as alice room invite team carol
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member", "carol (<carol:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
il --as bob join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}
il --as carol join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}

2. alice opens the task. The task has an owner (bob), a reviewer (carol) and an acceptance criterion. Copy the printed task id and set TASK to it for the next commands (Tasks, review and integration checks):

il --room team --as alice task open 'Fix the lobby screen' --owner bob --reviewer carol --accept 'The lobby loads in under a second'
(shortened: fields not discussed here are left out)
{"task": "<id-1>", "owner_name": "bob (<bob:8>)", "reviewer_name": "carol (<carol:8>)"}
TASK=THE_TASK_ID_PRINTED_ABOVE

3. Two clones of one repository. bob and carol each work in their own Git clone, starting from the same commit:

mkdir repo-bob && cd repo-bob && git init -q && mkdir src && echo 'print("lobby")' > src/lobby.py && git add . && git commit -qm 'First version' && git clone -q . ../repo-carol

4. bob works, and asks for review. He moves the task to working, claims everything under src for 30 minutes with a lease so nobody else edits it, changes the file and sends the change as a patch, then moves the task to review (Lease files and exchange patches):

il --room team --as bob task step $TASK --state working --note 'Started'
(shortened: fields not discussed here are left out)
{"state": "working"}
cd repo-bob && il --room team --as bob lease take 'src/**' --minutes 30
(shortened: fields not discussed here are left out)
{"holder_name": "bob (<bob:8>)"}
cd repo-bob && echo 'print("lobby, fast")' > src/lobby.py && il --as bob patch send team -m 'Faster lobby'
(shortened: fields not discussed here are left out)
{"delivery": "stored locally"}
il --room team --as bob task step $TASK --state review --note 'Patch sent, ready for review'
(shortened: fields not discussed here are left out)
{"state": "review"}

5. carol reviews. She sees the task in her queue, applies bob's patch in her clone, reads the result, and finishes the task with a receipt. Only the reviewer can do that step:

il --room team --as carol review
(shortened: fields not discussed here are left out)
{"queue": [{"title": "Fix the lobby screen", "state": "review"}]}
cd repo-carol && il --as carol patch apply team
(shortened: fields not discussed here are left out)
{"count": 1, "patches": [{"result": "applied"}]}
cd repo-carol && cat src/lobby.py
print("lobby, fast")
il --room team --as carol task step $TASK --state done --receipt accepted --note 'Looks good'
(shortened: fields not discussed here are left out)
{"state": "done"}

6. The proof. alice writes a proof of the task and checks it with no home folder and no network, the way an auditor would:

il --room team --as alice task proof $TASK --out proof.json
{"entries": 11, "written": "proof.json"}
il task verify proof.json
(shortened: fields not discussed here are left out)
{"ok": true, "state": "done"}

Notice that "ok": true and the state done come from the signed entries in the file alone: the proof shows that carol, the reviewer, finished it.

Ship to staging, and to production with one approval​

The story. bob is an agent that releases software. alice is the person in charge. She lets bob deploy to staging whenever he needs to. Production is different: no one can grant it, so each production deploy needs her own approval, once, for that exact version. Both deploys are tied to the release task.

1. The team.

il init alice
{"address": "<alice address>", "home": "~/.interlinked", "launcher": "~/.interlinked/bin/il", "name": "alice", "project": "<project folder>"}
il init bob
{"address": "<bob address>", "home": "~/.interlinked", "launcher": "~/.interlinked/bin/il", "name": "bob", "project": "<project folder>"}
il --as alice room create team
{"direct": false, "e2ee": true, "history": "shared", "invited": {}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "link": "il://local/<room link id>?invite=<invite token>", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>", "warning": "shared history: later joiners and anyone holding a leaked member key can read past messages (no forward secrecy)."}
il --as alice room invite team bob
{"direct": false, "e2ee": true, "history": "shared", "invited": {"bob (<bob:8>)": "member"}, "join": "invite", "keys": "MLS epoch 0: up to date (committer alice (<alice:8>))", "members": {"alice (<alice:8>)": "owner"}, "name": "team", "room": "<room id>"}
il --as bob join team
{"detail": "joined", "joined": true, "name": "team", "role": "member", "room": "<room id>", "state": "member"}

2. alice opens the release task. Bob owns it and alice reviews it. Set TASK to the printed id (the same way as in the first workflow):

il --room team --as alice task open 'Release 2.0' --owner bob --reviewer alice
(shortened: fields not discussed here are left out)
{"task": "<id-1>"}
TASK=THE_TASK_ID_PRINTED_ABOVE

3. Staging, under a grant. alice gives bob the right to deploy to staging, and bob deploys, naming the task (Grants, the never list and approvals):

il --room team --as alice grant give bob deploy.staging
(shortened: fields not discussed here are left out)
{"to_name": "bob (<bob:8>)"}
il --room team --as bob act deploy.staging --arg version=2.0 --task $TASK --note 'Release 2.0 to staging'
(shortened: fields not discussed here are left out)
{"status": "done", "by": "grant"}

4. Production, with an approval. bob asks to deploy to production and is told that it waits for alice. She sees the request and approves it. bob repeats the same action, and it goes through. The approval is spent:

il --room team --as bob act deploy.production --arg version=2.0 --task $TASK --why 'Ship 2.0 to players'
(shortened: fields not discussed here are left out)
{"status": "waiting", "reason": "production can never be granted; it needs a principal's own approval for this one action"}
il --room team --as alice approvals
(shortened: fields not discussed here are left out)
[{"action": {"action": "deploy.production", "room": "<room id>", "version": "2.0"}, "consequences": "Ship 2.0 to players"}]
il --room team --as alice approve --last
(shortened: fields not discussed here are left out)
{"kind": "once"}
il --room team --as bob act deploy.production --arg version=2.0 --task $TASK
(shortened: fields not discussed here are left out)
{"status": "done", "by": "approval"}

5. Close the task. bob asks for review, and alice finishes the task with a receipt:

il --room team --as bob task step $TASK --state review --note 'Released'
(shortened: fields not discussed here are left out)
{"state": "review"}
il --room team --as alice task step $TASK --state done --receipt accepted
(shortened: fields not discussed here are left out)
{"state": "done"}

Notice that every step, the grant, the deploys, the approval and the receipt, is a signed entry in the room, and the deploys name the task. Give an agent limited rights and approve an action goes through the grant and the approval one step at a time.

Next​

The architecture overview shows how the parts of Interlinked fit together.