diff --git a/apps/logicsrc-web/public/examples/openerrand/ftb-register-business.json b/apps/logicsrc-web/public/examples/openerrand/ftb-register-business.json index 188d2fe3..4f1d29c1 100644 --- a/apps/logicsrc-web/public/examples/openerrand/ftb-register-business.json +++ b/apps/logicsrc-web/public/examples/openerrand/ftb-register-business.json @@ -11,6 +11,7 @@ "principal": "self", "site": { "name": "California Franchise Tax Board (MyFTB)", + "sector": "tax", "origins": ["https://webapp.ftb.ca.gov"], "start": ["https://webapp.ftb.ca.gov/MyFTBAccess/Registration/NewAccount"] }, diff --git a/apps/logicsrc-web/src/app/openerrand/data.ts b/apps/logicsrc-web/src/app/openerrand/data.ts index ed856ea5..cc1b730a 100644 --- a/apps/logicsrc-web/src/app/openerrand/data.ts +++ b/apps/logicsrc-web/src/app/openerrand/data.ts @@ -9,7 +9,7 @@ export const STEPS: Array<[string, string]> = [ ["identity-proofing", "A selfie, a video call or an ID scan at a provider such as ID.me. Never driven by the runner: the person does it in a visible window."], ["code", "A one-time code by text, email, call or app, relayed by the person through a terminal, a file or the runner's own page."], ["mail", "A letter with a PIN. The run ends as waiting and a hand-off card says what to do when it comes."], - ["captcha", "Shown to the principal, or the run stops. Never sent to a solving service or a model."] + ["captcha", "Shown to the principal, or the run stops. A solver only where the errand says so, never on a government, tax, financial, healthcare or identity-provider site, never with a declaration, identity proofing or a secret input."] ]; /** The sensitivity classes, in the order the spec lists them. */ diff --git a/apps/logicsrc-web/src/app/openerrand/page.tsx b/apps/logicsrc-web/src/app/openerrand/page.tsx index 36c4793b..7a517822 100644 --- a/apps/logicsrc-web/src/app/openerrand/page.tsx +++ b/apps/logicsrc-web/src/app/openerrand/page.tsx @@ -27,7 +27,7 @@ const EXCERPT = `"rules": [ const RULES: Array<[string, string]> = [ ["Shows the errand first", "Title, publisher, every gate with its reason, every input with its sensitivity and source. A file whose hash changed is shown again before it runs."], ["Never guesses", "Fields are matched by id first and label second. A required field no rule fills stops the run."], - ["Never performs a gate", "Declarations need the person's consent for this run. Identity proofing, captchas and letters are theirs. Codes come only through a declared relay."], + ["Never performs a gate", "Declarations need the person's consent for this run. Identity proofing and letters are theirs, and so are captchas on any sensitive site. Codes come only through a declared relay."], ["One shared secret per run", "A figure from a return is submitted once. A rejection ends the run and lists the other candidates; a person picks the next one."], ["Keeps documents and values in place", "Extraction is local. Values go to the site's fields and the vault; logs hold fields, never values; cards hold steps, never secrets."] ]; @@ -55,9 +55,10 @@ export default function OpenErrandPage(): ReactNode { values that are secret, the steps that belong to a person, and the point where it stops.
- Status: 0.1. The reference runner is ftb in cli-tools, which
- registers and activates MyFTB accounts at the California Franchise Tax Board; the worked
- example in the specification transcribes its rule table. An excerpt:
+ Status: 0.1. A generic runner, logicsrc errand run from{" "}
+ @logicsrc/openerrand, is in progress. The worked example
+ transcribes the rule table of ftb in cli-tools, which registers
+ and activates MyFTB accounts at the California Franchise Tax Board. An excerpt:
{EXCERPT}
@@ -163,7 +164,7 @@ export default function OpenErrandPage(): ReactNode {
- Not a way around a check: there is no key for proxies, fingerprints or captcha solvers.
+ Not a way around a check: a runner may present a normal browser user agent and nothing more, with no fingerprint spoofing, no stealth plugins and no challenge solving.
Not for someone else's account. Not an API: when a site has one, use{" "}
OpenConnection,{" "}
OpenAccess or OpenSaaS. Not a
diff --git a/docs/openerrand.md b/docs/openerrand.md
index 059b2358..cc9530d7 100644
--- a/docs/openerrand.md
+++ b/docs/openerrand.md
@@ -59,7 +59,7 @@ The top-level keys:
| `updated` | When anything in the file last changed, ISO 8601. |
| `reference` | A URL for the runner or the code the errand was taken from. |
| `principal` | `self`: the person running it is the principal. `represented`: they act for the principal with authority to, as a corporation's officer does for the corporation. |
-| `site` | `name`, `origins` (the https origins the runner may navigate), `start` (the URLs a run opens, in order of preference), `terms` (the site's terms of use). |
+| `site` | `name`, `sector` (`government`, `tax`, `financial`, `healthcare`, `identity-provider`, `commercial` or `other`: who runs the site, which decides whether a captcha solver may ever be allowed), `origins` (the https origins the runner may navigate), `start` (the URLs a run opens, in order of preference), `terms` (the site's terms of use). |
| `limits` | `pages` (the most pages one run may submit, default 15), `page_timeout` (default `PT30S`), `same_page` (how many times the same URL may come back before the run stops as a loop, default 2). |
| `inputs` | The values the errand needs, by name. |
| `rules` | The field rules, applied on every page step. |
@@ -153,7 +153,7 @@ On each page the runner takes the first step whose `match` fits (`url`, `title`,
| `identity-proofing` | Proving who you are to an identity provider: a selfie, a video call, a document scan. A gate. |
| `code` | A one-time code sent to the principal. A gate. |
| `mail` | A letter the site posts to the principal. A gate. |
-| `captcha` | A test meant to tell a person from a program. A gate. |
+| `captcha` | A test meant to tell a person from a program. A gate, unless the errand allows a solver where [the captcha rules](#captcha) permit one. |
## Human gates
@@ -185,7 +185,11 @@ A mail gate ends the run with outcome kind `waiting`. The runner delivers the `h
### `captcha`
-A runner does not send a captcha to a solving service, a model, or a person paid to solve them. It shows the page to the principal in a visible window, or stops. A `wait` step is not a captcha: a proof of work the page's own script solves asks nothing of a person, and waiting for it is all a runner does.
+By default a runner shows the page to the principal in a visible window, or stops. It does not send the captcha to a solving service, a model, or a person paid to solve them.
+
+`solver` on the step is `forbidden`, the default, or `allowed`. A solver is never allowed on a government, tax, financial, healthcare or identity-provider site, as `site.sector` states, and never on an errand with a `declare` or `identity-proofing` step or any `secret` input, whatever its sector. Elsewhere an errand may say `"solver": "allowed"` explicitly, and a runner that then uses a solver logs every use: the time, the page URL and the service, never the image or the answer. A validator rejects `allowed` on an errand in the forbidden set, and on an errand that does not state its `site.sector`.
+
+A `wait` step is not a captcha: a proof of work the page's own script solves asks nothing of a person, and waiting for it is all a runner does.
## Outcomes and retry
@@ -279,7 +283,7 @@ As in [Matching](#matching). A required field no rule fills stops the run, or is
### 4. It never performs a gate
-A `declare` box is ticked only on the principal's consent for this run. Identity proofing, captchas and letters are the person's. A code comes only through a declared relay.
+A `declare` box is ticked only on the principal's consent for this run. Identity proofing and letters are the person's, and so is a captcha unless the errand allows a solver where [the captcha rules](#captcha) permit one. A code comes only through a declared relay.
### 5. It submits one shared secret per run
@@ -305,9 +309,9 @@ Only built-ins and public inputs go on a card, and the card is delivered only on
To the vault in `outputs.vault`, or to a 0600 state file when there is none. A login that exists only in a terminal's scrollback is a login lost.
-### 11. It waits out an interstitial and does not defeat it
+### 11. It may look like a browser, and never defeats a check
-A `wait` step is polled until it clears or times out. A runner does not solve, skip or spoof its way past a check.
+A runner may run headless and present a normal desktop browser user agent, for example by dropping `HeadlessChrome` from it. That is as far as it goes: no fingerprint spoofing beyond the user-agent string, no stealth plugins, and no solving, skipping or evading a bot challenge. A challenge the browser completes on its own, such as a proof-of-work interstitial, is a `wait` step, polled until it clears or times out. Any other challenge is a `captcha` gate.
### 12. It has a dry run
@@ -319,7 +323,7 @@ The same URL `limits.same_page` times, or more than `limits.pages` pages, ends t
## Worked example
-Registering a MyFTB account for a California S corporation at the Franchise Tax Board. FTB has no API: the account is a browser registration checked against a figure from a filed Form 100S, a code texted to the representative's phone, and a PIN mailed to the address on file. The reference runner is `ftb` in [cli-tools](https://github.com/profullstack/cli-tools/pull/125), and this file transcribes its rule table, gates and outcomes. The file holds no personal data: every value comes from the principal's own returns, vault or terminal at run time.
+Registering a MyFTB account for a California S corporation at the Franchise Tax Board. FTB has no API: the account is a browser registration checked against a figure from a filed Form 100S, a code texted to the representative's phone, and a PIN mailed to the address on file. `ftb` in [cli-tools](https://github.com/profullstack/cli-tools/pull/125) performs it today, and this file transcribes its rule table, gates and outcomes. The file holds no personal data: every value comes from the principal's own returns, vault or terminal at run time.
```json
{
@@ -335,6 +339,7 @@ Registering a MyFTB account for a California S corporation at the Franchise Tax
"principal": "self",
"site": {
"name": "California Franchise Tax Board (MyFTB)",
+ "sector": "tax",
"origins": ["https://webapp.ftb.ca.gov"],
"start": ["https://webapp.ftb.ca.gov/MyFTBAccess/Registration/NewAccount"]
},
@@ -628,15 +633,19 @@ The next errand planned is IRS.gov: sign in through ID.me and download account a
## Schema
-The JSON Schemas are `logicsrc-openerrand.schema.json` and `logicsrc-openerrand-index.schema.json` in [`@logicsrc/schemas`](https://github.com/profullstack/logicsrc/tree/master/packages/schemas/schemas), exported as `@logicsrc/schemas/openerrand` and `@logicsrc/schemas/openerrand-index`. `@logicsrc/validators` adds the checks a schema cannot express: step, gate, outcome and card references resolve, every `{{template}}` names an input, a shared secret is `secret`, and no card names a personal or secret input.
+The JSON Schemas are `logicsrc-openerrand.schema.json` and `logicsrc-openerrand-index.schema.json` in [`@logicsrc/schemas`](https://github.com/profullstack/logicsrc/tree/master/packages/schemas/schemas), exported as `@logicsrc/schemas/openerrand` and `@logicsrc/schemas/openerrand-index`. `@logicsrc/validators` adds the checks a schema cannot express: step, gate, outcome and card references resolve, every `{{template}}` names an input, a shared secret is `secret`, no card names a personal or secret input, and a captcha solver is allowed only outside the forbidden set.
```
npx @logicsrc/validators openerrand ftb-register-business.json
```
+## Reference runner
+
+In progress: a generic runner, the `@logicsrc/openerrand` package in the LogicSRC repository, run as `logicsrc errand run