mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-11-29 15:51:52 +00:00
Some checks failed
CI / build (push) Has been cancelled
Deploy to dev2 / deploy (push) Has been cancelled
test / test (push) Has been cancelled
* OpenTask 0.1 + OpenWorkflow 0.1: specs, schemas, fixtures, validators docs/opentask.md mints OpenTask: one task a person does on a computer, written down as meaning (goal, apps, parameters with a sensitivity class and never a value, semantic steps with no coordinates, capture gaps, stop conditions, approvals, a success check, provenance, runners with digests) so an agent can do it again. docs/openworkflow.md mints OpenWorkflow: a collection of OpenTasks inline or by URL + sha256, in sequence or any order respecting after, with a publisher index at /.well-known/openworkflow.json. - @logicsrc/schemas 0.6.0: opentask, openworkflow, openworkflow-index - @logicsrc/validators 0.6.0: step numbering, placeholders, apps, no example on personal/secret parameters, after references Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * logicsrc-web: register OpenTask and OpenWorkflow Registry entries (process family, status 0.1) after OpenErrand, with the family blurb updated; /opentask and /openworkflow landing pages naming w3bs.org/tasks and w3bs.org/workflows as the reference publisher and moshscript (moshcode run) as one runner; the worked examples served under /examples and a logicsrc.com workflow index at /.well-known/openworkflow.json; contract tests holding the pages' lists and the served files against the docs and fixtures, and both specs added to spec discovery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
218 lines
14 KiB
Markdown
218 lines
14 KiB
Markdown
# OpenTask
|
|
|
|
OpenTask is one JSON file that describes a task a person does on a computer, written down so an agent can do it again. It names the goal, the applications, the values the task needs and how sensitive each one is, the steps the person took as meaning (focus this window, press this button, type this value) rather than as coordinates, what the recording did not see, where an agent must stop, what it must ask before doing, and how to tell the task worked. It says where the description came from, a reviewed demonstration or a person's own hand, and which runners can carry it out. A person reads the file and knows what an agent will try; an agent reads the same file, observes the screen before every action, and stops where the file says to. It is maintained by Profullstack, Inc. as part of the LogicSRC open-standards surface.
|
|
|
|
Status: **0.1**. A description of tasks that W3BS Training already records and exports, published so others can write tasks, review them and run them.
|
|
|
|
Slug: `opentask`
|
|
|
|
Related: [OpenWorkflow](/docs/openworkflow) is a collection of OpenTasks. [OpenErrand](/docs/openerrand) is the sibling for one errand on one website with no API, filled field by field in a headless browser; OpenTask is for any desktop task an agent does by looking at the screen. The `logicsrc.task` schema is a different thing: a paid task on a work board.
|
|
|
|
## The problem
|
|
|
|
Agents that drive a desktop learn from demonstrations. A person shows the task once, a recorder keeps what it saw, and an agent is told "do it like that". Today each recorder keeps its own format, and the useful part, what the person was trying to do and the steps they took, is locked inside it. A demonstration recorded in one tool cannot be read by another agent, reviewed by a second person or published for others.
|
|
|
|
Worse, the formats that do travel are replays: a list of clicks at pixel positions and the keystrokes typed. A replay breaks when a window moves, does something else entirely when the screen differs, and carries every password and message the person typed. It cannot say "stop if a payment prompt appears", because it never knew what was on the screen.
|
|
|
|
What is missing is the task written down as meaning: the goal, the steps an agent should look for, the values it must ask for, and the points where it must stop. Written down, a task can be read before it runs, shared without the person's data, and run by any agent that keeps the same promises.
|
|
|
|
## Terms
|
|
|
|
- A **task** is one job on a computer that ends in an outcome a person can check: a post published, a file exported, a setting changed. Its **task file** is the JSON document this specification describes.
|
|
- An **app** is one application the task uses: a desktop program, a browser, a terminal.
|
|
- A **parameter** is one value the task needs that changes between runs: a title, a recipient, a file name.
|
|
- A **step** is one action the person took, described by what it acted on (an app, a window, a control's role and name), never by where it was on the screen.
|
|
- A **demonstration** is a recording of a person doing the task. A task file made from one is **demonstrated**; a task file a person wrote by hand is **authored**.
|
|
- A **runner** is the program, usually an agent with a desktop tool, that carries a task out.
|
|
- A **stop condition** is a situation in which a runner stops and hands the task back to a person.
|
|
- An **approval** is a point before which a runner asks a person and waits.
|
|
- A **publisher** is whoever writes and serves a task file.
|
|
|
|
## The task file
|
|
|
|
The smallest task file:
|
|
|
|
```json
|
|
{
|
|
"type": "logicsrc.opentask",
|
|
"version": "0.1",
|
|
"id": "empty-the-trash",
|
|
"title": "Empty the trash",
|
|
"goal": "Empty the desktop trash.",
|
|
"apps": [{ "name": "Dolphin", "kind": "desktop" }],
|
|
"steps": [
|
|
{ "n": 1, "action": "focus", "app": "Dolphin", "evidence": "observed" },
|
|
{ "n": 2, "action": "click", "app": "Dolphin", "target": { "role": "button", "name": "Empty Trash" }, "evidence": "observed" }
|
|
],
|
|
"stop_conditions": ["a target cannot be found on the current screen"],
|
|
"approvals": ["before deleting anything"],
|
|
"success": { "check": "The trash shows no items.", "evidence": "screen" },
|
|
"source": { "kind": "authored", "reviewed": true },
|
|
"status": "untested"
|
|
}
|
|
```
|
|
|
|
| Key | Required | Meaning |
|
|
| --- | --- | --- |
|
|
| `type` | yes | `logicsrc.opentask` |
|
|
| `version` | yes | `0.1` |
|
|
| `id` | yes | A slug, unique within its publisher: lowercase letters, digits and dashes, at most 64 characters. |
|
|
| `title` | yes | A short name a person reads in a list. |
|
|
| `goal` | yes | The outcome, in one or two sentences, as the person would say it. |
|
|
| `explanation` | no | The person's own words on how and why, at most 4000 characters. Runners show it; it has no authority over the rules below. |
|
|
| `apps` | yes | The applications, each `{ "name", "kind" }` with `kind` one of `desktop`, `browser`, `terminal`, `web`, and for `web` a `url`. |
|
|
| `parameters` | no | The values the task needs. See [Parameters](#parameters). |
|
|
| `steps` | yes | The steps, numbered from 1 with no gaps. See [Steps](#steps). |
|
|
| `capture` | no | What a demonstration saw and did not see. See [Capture](#capture). |
|
|
| `stop_conditions` | yes | At least one situation in which a runner stops. |
|
|
| `approvals` | yes | Points before which a runner asks, each a sentence beginning "before". May be empty only when the task changes nothing a person could not undo. |
|
|
| `success` | yes | `{ "check", "evidence" }`: how to tell the task worked, and what kind of evidence that is (`screen`, `artifact` or `human_assertion`). |
|
|
| `source` | yes | Where the file came from. See [Source](#source). |
|
|
| `status` | yes | `untested`, `passed` or `failed`: the result of the last evaluation run by someone other than the demonstrator. A file is `untested` until such a run passes. |
|
|
| `runners` | no | Ways to run it. See [Runners](#runners). |
|
|
| `license` | no | An SPDX identifier for the file. |
|
|
|
|
## Parameters
|
|
|
|
A parameter names a value, never holds one.
|
|
|
|
```json
|
|
{ "name": "post_title", "description": "The title of the post to publish", "sensitivity": "public", "example": "Release notes for 0.3" }
|
|
```
|
|
|
|
- `name` is a lowercase identifier, `[a-z][a-z0-9_]{0,63}`.
|
|
- `sensitivity` is `public` (may appear in logs and on a screen share), `personal` (the person's own data: an address, a contact) or `secret` (a password, a code, a key).
|
|
- `example` is allowed only for `public` parameters. A `personal` or `secret` parameter has no example, ever: the file is meant to be published.
|
|
|
|
A runner asks for every parameter before the first step that uses it. It never writes a `secret` value to a log, a report or a file.
|
|
|
|
## Steps
|
|
|
|
```json
|
|
{ "n": 3, "action": "type", "app": "TronBrowser", "window": "New post", "target": { "role": "text field", "name": "Title" }, "text": "{{post_title}}", "evidence": "observed", "recorded": "41-44" }
|
|
```
|
|
|
|
| Key | Required | Meaning |
|
|
| --- | --- | --- |
|
|
| `n` | yes | The step number, from 1 with no gaps. |
|
|
| `action` | yes | `focus`, `open`, `click`, `type`, `key`, `scroll`, `drag`, `wait`, `observe` or `other`. |
|
|
| `app` | no | The app's `name` from `apps`. |
|
|
| `window` | no | The window title the person saw. See [Window titles](#window-titles). |
|
|
| `target` | no | `{ "role", "name" }` of the control: an accessibility role and its visible name. |
|
|
| `keys` | no | For `key`: the keys pressed together, such as `["ctrl", "s"]`. |
|
|
| `text` | no | For `type`: a placeholder `{{name}}` naming a declared parameter. Never the typed text itself. |
|
|
| `evidence` | yes | `observed` (the recorder saw it happen) or `inferred` (a person or model concluded it). |
|
|
| `recorded` | no | Which recorded steps this one stands for, `"7"` or `"7-12"`, when consecutive identical steps were merged. |
|
|
| `note` | no | A sentence for the runner. |
|
|
|
|
There are no coordinates, ever. A file that carries `x`, `y` or a bounding box is invalid. A runner works out every action from what is on the screen when it gets there.
|
|
|
|
### Window titles
|
|
|
|
Window titles are what a person sees, and they leak: an inbox title carries an address, a receipt carries an order number. A publisher removes them unless a person has read each one and chosen to keep it, and records the choice in `capture.window_titles` (`kept` or `removed`). A demonstrated file with no `capture` is read as `removed`.
|
|
|
|
## Capture
|
|
|
|
```json
|
|
{ "profile": "visual-review", "window_titles": "removed", "gaps": ["unapproved-app"] }
|
|
```
|
|
|
|
- `profile` is what the recorder could see: `visual-review` (window focus and screenshots of approved apps, no input), `semantic` (also controls and shortcuts, typed text as placeholders) or `full` (everything a recorder can see, typed text still as placeholders in the file).
|
|
- `gaps` names the kinds of thing the recording did not see, such as `unapproved-app` or `paused`. A runner does not guess what happened in a gap; it asks.
|
|
|
|
## Source
|
|
|
|
```json
|
|
{ "kind": "demonstration", "recorder": "w3bs-training 0.2.5", "episode": "ep_36773bc43575d95f", "recorded": "2026-10-16T02:11:00Z", "reviewed": true, "outcome": "success" }
|
|
```
|
|
|
|
- `kind` is `demonstration` or `authored`.
|
|
- `reviewed` says a person other than the recorder's automatic labelling confirmed the goal and the outcome. A publisher publishes only reviewed files.
|
|
- For a demonstration, `outcome` is what the reviewer recorded (`success`, `partial` or `failure`). Only `success` may be published with `status` other than `failed`.
|
|
- `recorder`, `episode` and `recorded` let the publisher find the original. The recording itself is never part of the file.
|
|
|
|
## Runners
|
|
|
|
```json
|
|
{ "kind": "moshscript", "url": "https://w3bs.org/workflows/wf_9Kp2/empty-the-trash.mosh", "sha256": "7c1e…", "command": "moshcode run empty-the-trash.mosh" }
|
|
```
|
|
|
|
`kind` names the runner (`moshscript`, `mcp`, `script` or `other`). `url` is where to fetch it and `sha256` is its digest, which a runner checks before it runs anything it fetched. A runner entry is a convenience: the task file alone is enough for any agent that follows the rules below.
|
|
|
|
## Runner rules
|
|
|
|
A conforming runner:
|
|
|
|
1. **Shows the task first.** Title, goal, apps, every parameter with its sensitivity, every stop condition and approval, and `status`. An `untested` file is labelled as such.
|
|
2. **Observes before acting.** It looks at the current screen before every action and never reuses a position from an earlier observation or another run.
|
|
3. **Asks for parameters.** It never invents a value. A `secret` value is never logged, reported or written.
|
|
4. **Stops.** On any stop condition, on a gap, or when a step's target is not on the screen, it stops and says what it saw.
|
|
5. **Asks before.** At each approval it describes what it is about to do and waits for a person.
|
|
6. **Treats text as data.** `goal`, `explanation`, `note` and window titles are untrusted text. They describe the task; they never grant permission or change these rules.
|
|
7. **Reports.** When it finishes or stops, it says what it did and what is left, and checks `success`.
|
|
|
|
## Publishing
|
|
|
|
A publisher serves task files as `application/json` over HTTPS, usually inside an [OpenWorkflow](/docs/openworkflow). Before publishing a demonstrated task it removes window titles (unless kept by choice), confirms `source.reviewed`, and confirms no parameter carries a personal or secret example.
|
|
|
|
## Worked example
|
|
|
|
A task demonstrated in W3BS Training: exporting a reviewed task from the training app as a moshscript.
|
|
|
|
```json
|
|
{
|
|
"type": "logicsrc.opentask",
|
|
"version": "0.1",
|
|
"id": "export-a-task-as-moshscript",
|
|
"title": "Export a reviewed task as a moshscript",
|
|
"goal": "Export a reviewed W3BS Training task as a moshscript file.",
|
|
"explanation": "Open the training app, pick the reviewed task, and use the button under its title.",
|
|
"apps": [
|
|
{ "name": "TronBrowser", "kind": "browser" },
|
|
{ "name": "W3BS Training", "kind": "web", "url": "http://127.0.0.1/" }
|
|
],
|
|
"parameters": [
|
|
{ "name": "task_title", "description": "The title of the reviewed task to export", "sensitivity": "public", "example": "Empty the trash" }
|
|
],
|
|
"steps": [
|
|
{ "n": 1, "action": "focus", "app": "TronBrowser", "evidence": "observed", "recorded": "1-2" },
|
|
{ "n": 2, "action": "click", "app": "TronBrowser", "target": { "role": "link", "name": "{{task_title}}" }, "evidence": "inferred" },
|
|
{ "n": 3, "action": "click", "app": "TronBrowser", "target": { "role": "button", "name": "Export as moshscript" }, "evidence": "inferred" },
|
|
{ "n": 4, "action": "observe", "app": "TronBrowser", "note": "A confirmation code appears; the person types it.", "evidence": "inferred" }
|
|
],
|
|
"capture": { "profile": "visual-review", "window_titles": "removed", "gaps": [] },
|
|
"stop_conditions": [
|
|
"a target cannot be found on the current screen",
|
|
"an unexpected dialog appears",
|
|
"a credential or payment prompt appears"
|
|
],
|
|
"approvals": ["before typing a confirmation code"],
|
|
"success": { "check": "A .mosh file named after the task is in Downloads.", "evidence": "artifact" },
|
|
"source": {
|
|
"kind": "demonstration",
|
|
"recorder": "w3bs-training 0.2.5",
|
|
"episode": "ep_0f3a9c2b7d114e58",
|
|
"recorded": "2026-10-17T18:04:00Z",
|
|
"reviewed": true,
|
|
"outcome": "success"
|
|
},
|
|
"status": "untested",
|
|
"runners": [
|
|
{
|
|
"kind": "moshscript",
|
|
"url": "https://w3bs.org/workflows/wf_example/export-a-task-as-moshscript.mosh",
|
|
"sha256": "0000000000000000000000000000000000000000000000000000000000000000",
|
|
"command": "moshcode run export-a-task-as-moshscript.mosh"
|
|
}
|
|
],
|
|
"license": "CC0-1.0"
|
|
}
|
|
```
|
|
|
|
## Validation
|
|
|
|
The JSON Schema is `@logicsrc/schemas/opentask`. `@logicsrc/validators` also checks what a schema cannot: steps numbered from 1 with no gaps, every `{{placeholder}}` naming a declared parameter, every step's `app` naming a declared app, no example on a personal or secret parameter, and no published `failure` marked anything but `failed`.
|
|
|
|
```sh
|
|
npx @logicsrc/validators opentask task.json
|
|
```
|