Repository navigation
OpenErrand reference runner: @logicsrc/openerrand and logicsrc errand - #228
Merged
Merged
Conversation
…eps kept human docs/openerrand.md mints OpenErrand: one JSON file per errand (register an account, download a transcript) naming the site, the inputs with a sensitivity class and ordered sources (document, vault, prompt, generate, derive, candidate, literal), field rules matched by id then label, page and wait steps, five human gates a runner never performs (declare, identity-proofing, code, mail, captcha), outcomes, the never-retried shared secret, vault and download outputs, hand-off cards that may name only public inputs, the publisher index at /.well-known/openerrand.json, and thirteen runner rules. The worked example is the MyFTB business registration that cli-tools `ftb` performs (profullstack/cli-tools#125), with no personal data. - @logicsrc/schemas: openerrand + openerrand-index schemas and fixtures - @logicsrc/validators: semantic checks (references, templates, no personal or secret input on a card) and tests that validate the spec's own examples - logicsrc-web: registry entry (process family), /openerrand landing page, the example and the index served as static files, contract tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Anthony's ruling: tax and finance data never touches a social or promotion tool, and nothing is sent to a CPA or preparer. - Hand-off cards are delivered only on the surface that owns the errand's data (for a tax or finance errand, the principal's finance app through its CLI, PWA, MCP server or API, such as CoinPay, or the runner's terminal), never a social, promotion or third-party posting service, and never to anyone but the principal. A card for an errand with personal or secret inputs does not leave that surface. Runner rule 9 says the same. - The run record and the sample run name the card by an opaque id (pin-letter/7f3k2q) instead of a mynaposter.com URL; the myna mention is gone. - `principal: represented` no longer cites a preparer with a power of attorney. - The FTB card's last step no longer suggests sending the PIN to someone else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…note Anthony's answers on #227 ("go with your recommendations"): - Rule 11: a runner may run headless with a normal desktop browser user agent (dropping HeadlessChrome) and nothing more: no fingerprint spoofing beyond the UA string, no stealth plugins, no solving or evading a bot challenge. A challenge the browser completes itself is a wait step; any other is a captcha gate. - Captcha solvers: new site.sector and captcha step `solver` (forbidden by default | allowed). Never allowed on government, tax, financial, healthcare or identity-provider sites, nor on any errand with a declare or identity-proofing step or a secret input; elsewhere only when the file says so, with every use logged. The validator rejects `allowed` in the forbidden set or without a stated sector; six new tests. The FTB example states sector "tax". - Reference runner: @logicsrc/openerrand / `logicsrc errand run`, marked in progress; ftb stays the runner the example was taken from. - Name stays OpenErrand; family stays Agents and process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ship the runner docs/openerrand.md promised. `logicsrc errand run <file>` reads an OpenErrand 0.1 file, validates it with @logicsrc/validators, and drives headless Chrome through it under the spec's thirteen rules; `errand validate` shows what a file will ask of you and `errand status` shows the last run of each errand, its card and any lockout. The engine is generalised from cli-tools `ftb` (PR #125) with no dependency on cli-tools: the CDP client and Chrome finder from wcag.ts, the page reader, native-setter fill and forward-button picker from ftb-run.ts, and the rule matcher, throttle and outcome logic from ftb.ts, all now driven by the file. - Inputs: document (an extractor hook; the one shipped runs a local command that reads JSON requests and prints records), vault (teams or OpenCreds), prompt (no echo for secrets), generate, derive, candidate, literal. `--input name=value` wins. Shared-secret candidates are ranked as the spec says, one is submitted, and a rejection lists the others for --candidate. - Rules: id before label, step rules first, choices before text, an id match final, an unmatched required field stops the run naming it. - Gates: declare only with --declare after the values are shown; identity proofing never touched (URL only) and handed over or stopped on; code from the terminal or a code file, used once, a wrong code waits for the next; mail ends the run waiting with the card; captcha is the person's, and a CaptchaSolver interface is called only where the spec permits (no solver is bundled); wait steps are polled, never solved. - Throttle: 2 runs per errand and account in 30 minutes, 4 a day, 2 minutes between runs on a site, lockouts from metadata.lockout or a default, held per site and account, never lifted by --force. - Outputs: credentials written before success to a teams vault by pull, merge, push (metadata.vault or --vault), else a 0600 file said aloud; downloads type-checked and never overwritten with different bytes; cards only in the local run record. - The user agent is Chrome's own with HeadlessChrome replaced, given at launch: a CDP override did not reach a navigation the page's own script started, which is exactly the proof-of-work interstitial case. Tests: 85 in the package (rule engine, inputs, gates, throttle, outcomes, captcha gating, vaults, outputs, commands) including an integration test that runs the published FTB example unchanged in real headless Chrome against a local HTTPS fake site (Chrome maps webapp.ftb.ca.gov to it and every other host to NOTFOUND; all data fictional), and 2 in the CLI. CLI 0.6.0 -> 0.7.0; @logicsrc/schemas and @logicsrc/validators 0.3.0 -> 0.4.0 (the OpenErrand schemas, and the vocabularies now exported for runners); PRD 0009; the spec's Reference runner section and the landing page say it ships. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| /** `linux-152.0.7977.42` before `linux-131.0.6778.204`: newest first by version. */ | ||
| const byVersionDesc = (a: string, b: string): number => { | ||
| const parse = (name: string): number[] => (/(\d+(?:\.\d+)*)/.exec(name)?.[1] ?? "0").split(".").map(Number); |
ThreatCrush Security Scan26 finding(s) HIGH/CRITICAL: 3 | MEDIUM: 11 | LOW: 12
Snippets are redacted; ThreatCrush never prints matched credential material. |
Keeps the runner's wording in docs/openerrand.md and the /openerrand page (the runner now exists, not 'in progress'). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reference runner for OpenErrand 0.1:
@logicsrc/openerrand(new package, 0.1.0) andlogicsrc errand run|validate|status(CLI 0.6.0 -> 0.7.0).Stacked on #227. The spec is not merged yet, so this branch is based on
openerrand-specand this PR targets it, which keeps the diff to the runner. When #227 is squash-merged, rebase this branch ontomaster(a squash leaves the spec commits looking new) and retarget.What it does
logicsrc errand run <file>reads an errand file and validates it with@logicsrc/validators. It shows the errand (title, publisher, every gate with itswhy, every input with its sensitivity and sources) and works out every input before Chrome opens. Then, page by page, it finds the step, tests the outcomes, fills the form from the rules and presses the forward button. It stops at every step that belongs to a person.--yesor a yes at the terminal.site.originsstops the run (off-site). The one exception is an identity provider's origins while that gate is handed to the person.idrules are tried before anylabelrule. A step's own rules come first. Selects, radios and checkboxes are filled before text boxes. An id match is final. A required field that nothing fills stops the run and is named (or asked, withunmatched: askat a terminal).declare: ticked only with--declare, after the values are shown.identity-proofing: the runner reads the URL only, never the page; it stops when headless, or waits when--headfulat a terminal.code: typed at the terminal or written to a code file, used once; a wrong code waits for the next one.mail: the run ends as waiting, with the card.captcha: left to the person (see below).wait: polled until it clears.--candidate Npicks the next one for the next run.documentsources go through an extractor hook. The only one shipped runs a local command (--extractor "...") that gets JSON requests on stdin and prints records.••••on the terminal. The page log keeps fields only (plus a result page's text). The run record never holds a value. Tests check for each value by name.errand status, never posted anywhere. A card that names a personal or secret input is refused.HeadlessChromechanged toChrome, passed at launch. Nothing else changes.limits.same_pageandlimits.pagesThrottle (STANDING RULE): 2 runs of an errand per account in 30 minutes and 4 a day, plus 2 minutes between any two runs on one site. A lockout comes from
metadata.lockout.text/durationor a default pattern lasting 35 minutes. It applies to every errand on that site and account, so an activate errand respects a lock that a register errand hit.--forcelifts the caps but never a lockout.Captcha: a
CaptchaSolverinterface that an embedding program may pass. It is called only when the step sayssolver: allowedandsolverPermittedagrees with the validator: a stated sector outside government, tax, financial, healthcare and identity-provider, no declare or identity-proofing step, and no secret input. Every use is logged with time, URL and service. No solver is bundled.Vault target:
--vault, or a string in the file'smetadata.vault(the schema has no slot for it, andmetadatais open):teams:<team>/<project>/<env>,opencreds[:<field>]orfile:<path>. The umbrella reachesteams pull/pushby running itself again.Ported from
ftb(cli-tools #125), no dependency on cli-toolswcag.ts:findChrome,Cdp,launchBrowserftb-run.ts:READ_PAGE,fillScript,SUBMIT(now driven bysubmit.labels/never/ignore),waitOutChallenge(now anywaitstep),waitForCode, the refill-once after an interstitial replays a form, and the persistent profile per siteftb.ts:decide,outcomeOf(now the file's outcomes, rejected first), andcheckThrottle/recordAttempt/recordLockout/isLockoutOther changes
@logicsrc/schemasand@logicsrc/validatorsgo 0.3.0 -> 0.4.0. OpenErrand 0.1: an errand on a website with no API, with the human steps kept human #227 added the OpenErrand schema without a bump, and@logicsrc/openerranddepends on^0.4.0. Validators now also exportsGATE_KINDS,NO_SOLVER_SECTORSandHANDOFF_BUILTINS.bun.lockwas edited by hand in its existing style. Letting bun 1.4.2 regenerate it turns everyfile:dependency of the CLI into a copied snapshot instead of a workspace link.workspace:*would avoid that, but the public installer runsnpm install.bun install --frozen-lockfilepasses, and was checked to fail on real drift.Verification
bun run check(full build, Next site included, plus every workspace's tests),bun run schemas:validateandbun run test:contract: all green locally.@logicsrc/openerrand: 85 tests. That includes an integration test that runs the published FTB example unchanged in real headless Chrome against a local HTTPS fake MyFTB (Terms, Profile with 3 security questions, a proof-of-work interstitial, Business with the declaration, Phone, Code (one wrong code, then the right one), Confirmation). Chrome mapswebapp.ftb.ca.govto the fake server and every other host to NOTFOUND. All data is fictional (Jane Doe, corp 1234567). It checks what the site received, one Business POST, two Code POSTs, noHeadlessChromein any request, the merged teams vault, no values in the log or record, and the throttle refusing a third run before Chrome starts.@logicsrc/cli: 95 (2 new).@logicsrc/validators: 119.@profullstack/logicsrc-mcp: 17.Not verified
--dry-run.--headfulhand-over (identity proofing, captcha) was tested only with the scripted fake browser.logicsrc vault get <KEY> --field ... --reveal) and reallogicsrc teams pull/pushwere not exercised. Tests used a fake exec.--no-sandboxwhenCIis set, and skips when there is no Chrome or openssl.Open question for the spec
The rule text ranks shared-secret candidates "sources in order, newest year first within each". The worked example's
ftb secretslisting orders by year first (2025 l20, 2025 l15, 2024 l20). The runner follows the text.🤖 Generated with Claude Code