Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/ISSUE_TEMPLATE/experiment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Experiment feedback
description: Share a result or problem from the sign in, invoice or settings experiment.
description: Share a synthetic example from the actions, form review or team rule.
title: "Experiment: "
body:
- type: dropdown
Expand All @@ -12,6 +12,7 @@ body:
- Change a setting
- All three in the terminal
- Saved HTML form
- Team rule and CI starter
- Desktop bundle
validations:
required: true
Expand All @@ -33,6 +34,11 @@ body:
description: Browser and URL, or operating system, Node version and commit.
validations:
required: true
- type: textarea
id: first_confusion
attributes:
label: Where did you first hesitate?
description: Mention any help you needed. Leave out pasted content, private links and personal details.
- type: textarea
id: usefulness
attributes:
Expand Down
Binary file added .github/assets/developer-pilot.mp4
Binary file not shown.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

## Unreleased

* Added a separate offline first attempt kit and a keyboard accessible inspector that opens on the MCP tool. Updated the locked development copies of cross-spawn and node-forge.

* Added a browser preview of the CI consent check with both starter files available offline. The opening film now shows one selectable scene at a time on phones.

* Added a copyable application policy test and fixed draft compatibility vectors for implementers. Run `npm run conformance` in the source checkout.
* Added `npm run build:demo` for the offline pilot ZIP. Integration checks rebuild it in two time zones and run the extracted demo outside the checkout.
* Added form specific review notes for omitted inputs, unchecked choices and numeric constraints in browser review, CLI output and MCP inference. Draft contracts and scoring are unchanged.
* Added explicit cancellation to sign in and invoice review. A double click or held Enter on Run action now stops at review.
* Added local browser review for saved forms, JSON sample checks and copyable draft contracts and MCP descriptions. The Settings demo now leads into form review.

* Expanded the synthetic corpus to six cases: blog 100, legacy 60, shop 45, settings 40, sign-in 80 and invoice 40; mean 60.8/100, 2/6 at the 80 threshold. Each fixture records the contract fields inference cannot establish.
* Recorded a maintainer-run Codex CLI 0.145.0 protocol check with synthetic data; an independent outside report remains open.
* Audited the experiment by keyboard, fixed redundant live-region writes while preserving repeated error announcements, and added `npm run test:browser` with a Chrome CI workflow for playground tab order, focus, experiment journeys, film playback, reduced motion and narrow layouts.
* Inference now ignores inert template and textarea markup. The probe applies RFC 9309 specificity to root allow/disallow rules before capping a robots.txt disallow, ignores a leading UTF-8 BOM, and private-host screening rejects mapped, translated, NAT64, site-local and reserved IPv6 literals.
* Added a daily maintainer guide, a scoped work queue and standalone coding assistant instructions.
* Added `npm run dev` and `npm run check:quick`; full package and bundle verification remains required before merging.
* Configured weekly dependency update proposals and made independent first run completion explicit in the feedback form.
* Preserved the public API, contract formats, visual experience and released 0.9.0 artifacts.
* Preserved the public API, contract formats and released 0.9.0 artifacts.

## 0.9.0

Expand Down
7 changes: 4 additions & 3 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm run dev
```

Open http://127.0.0.1:8787/playground/experiment.html. Run sign in, the invoice and
the setting. The local server prints both page URLs. Stop with Ctrl+C and restart
the setting. Choose **Review a form** and check the two samples. Stop with Ctrl+C and restart
after editing an asset. The server reads its explicit asset list at startup.

Already have a checkout? Inspect `git status` first. With a clean tree, switch
Expand Down Expand Up @@ -52,7 +52,8 @@ that order.
| Types and approval declarations | `src/panel-schema.mjs`, `test/panel.test.mjs` | `node --test test/panel.test.mjs test/foundation.test.mjs` |
| Corpus evidence | `examples/corpus/`, `src/score.mjs` | `node --test test/corpus.test.mjs test/score.test.mjs` |
| Sign in, invoice, settings | `playground/comparison.mjs`, `playground/experiment-model.mjs` | `npm run experiment` and `node --test test/comparison.test.mjs test/experiment.test.mjs` |
| Visual experience | `playground/art.mjs`, `app.mjs`, `experiment.mjs`, CSS | `npm run dev`, then the checks in [CONTRIBUTING.md](CONTRIBUTING.md); `npm run test:browser` locks the experiment and film primitives in headless Chrome |
| Offline demo | `scripts/build-demo.mjs` and `examples/demo/assets.mjs` | `npm run build:demo` then `node --test test/integration/offline-demo.test.mjs` |
| Visual experience | `playground/art.mjs`, `app.mjs`, `experiment.mjs`, CSS | `npm run dev`, then the checks in [CONTRIBUTING.md](CONTRIBUTING.md); `npm run test:browser` locks the form review, experiment and film primitives in headless Chrome |
| MCP tools | `src/toolkit.mjs`, `src/mcp-server.mjs` | `npm run test:mcp` |
| Distribution | `scripts/check-package.mjs`, `scripts/build-bundle.mjs`, workflows | `npm run check` |

Expand All @@ -70,7 +71,7 @@ Node 22 and 24, Windows with Node 24, and the headless Chrome playground check.
Do not merge a failing job by reclassifying it as a local environment problem.

After merging, GitHub Pages builds and deploys from main. Check the `playground`
workflow and both public routes. A source merge updates the site; it does not
workflow and all three public routes. A source merge updates the site; it does not
replace an existing downloadable package. Roll back a source or site change with
a reviewed revert, keeping published packages immutable.

Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The goal is simple: applications should tell agents what they can do, what each
action changes and which approval it needs. Hardwire provides the format and
checks. Your application supplies the authorized handler.

[Try the three actions](https://automatron-workflows.github.io/hardwire/experiment.html)
[Review a form](#try-a-form-in-your-browser)
· [Try the three actions](https://automatron-workflows.github.io/hardwire/experiment.html)
· [Watch the demo](https://automatron-workflows.github.io/hardwire/)
· [Download](https://github.com/Automatron-workflows/hardwire/releases/tag/v0.9.0)
· [MCP Registry](https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.Automatron-workflows/hardwire)
Expand All @@ -20,6 +21,22 @@ checks. Your application supplies the authorized handler.

[![Sign in, invoice payment and settings: interface navigation compared with direct actions](docs/assets/demo.gif)](https://automatron-workflows.github.io/hardwire/)

In the review build, choose **Check inputs** on the sample form and try the
team rule. Remove confirmation to see a valid contract fail the team's
consent check. Restore it to get the [two file CI starter](examples/ci/README.md).

[Watch the captioned walkthrough](.github/assets/developer-pilot.mp4) · [Presenter script](docs/DEMO.md#presenter-script) · [Build the offline demo](docs/DEMO.md#take-the-demo-offline)

## Try a form in your browser

For an independent trial, use the [pilot kit](docs/DEMO.md#independent-pilot)
before watching the walkthrough. For a guided review of this branch, run
`npm ci --ignore-scripts` and `npm run dev` with Node 22 or newer.
[Open the local sample](http://127.0.0.1:8787/playground/form.html)
and choose **Check inputs**. See why a checkbox accepts `false` and rejects `"false"`.
Open **Contract and MCP tool** to inspect the draft, or replace the sample with
sanitized HTML. Your browser processes the text locally. Nothing is submitted.

## One form. One command.

With Node 22 or newer, run the bundled email preference from the demo:
Expand Down Expand Up @@ -82,6 +99,14 @@ npm install --ignore-scripts github:Automatron-workflows/hardwire#v0.9.0
[Use the library on one known action](docs/ADOPT.md), or use the guide’s MCP
configuration to connect without cloning the repository.

### Catch a policy change in CI

[Try the two file starter](examples/ci/README.md). Remove confirmation from a
reversible email change. The panel stays valid, but the application test
rejects the change because this team requires consent.

[Framework launch plan](docs/LAUNCH.md) · [Draft compatibility vectors](examples/conformance/README.md)

## Where it fits

| You already have | Hardwire adds |
Expand Down
7 changes: 7 additions & 0 deletions docs/ADOPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ The server exposes exactly five fixed inspection tools. It has no browse, file,
shell, login or mutation tool. [The MCP guide](MCP.md) has the checkout
alternative, a first task and troubleshooting.

## Add a pull request check

Copy the [application starter](../examples/ci/README.md) into your project
and run `node --test contracts/action.test.mjs`. The example pairs a reviewed
action with an independent application expectation. Try the documented policy
change and make sure CI catches it before adapting the example.

## First integration checklist

1. Pick one action with a clear input and a known effect.
Expand Down
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Lower-level exports: `traceDigest(document)` hashes everything except its own

| Export | Inputs → result |
| --- | --- |
| `inferFromHtml(html, { origin })` | Static HTML → candidate report with evidence and limitations. No network. |
| `inferFromHtml(html, { origin })` | Static HTML → candidate report with evidence and limitations. Optional `candidate.reviewNotes` lists detected control limitations as plain strings. No network. |
| `inferFromUrl(origin, options)` **async** | Fetch origin root once → inference report. |
| `toPanelDraft(inference)` | Candidate report → normalized draft panel; rejects empty or invalid drafts. |
| `comparePanels(expected, actual)` | Two panels → structural score, missing/invented ports and unsafe differences. |
Expand Down
26 changes: 22 additions & 4 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ flowchart TD
| `panel.mjs`, `trace.mjs` | Preserve the synchronous Node API and build or check trace digests | Node cryptography |
| `probe.mjs`, `infer.mjs`, `corpus.mjs` | Explicit network and filesystem operations | Bounded reads through documented adapters |
| `toolkit.mjs`, `mcp-server.mjs` | Expose five fixed inspection tools through the official MCP SDK | Stdio transport; no supplied action execution |
| `playground/model.mjs`, `worker.mjs` | Keep the bounded inspection helpers available for experiments | Worker messaging only |
| `playground/model.mjs`, `worker.mjs` | Inspect bounded input and check arguments using the portable core | Worker messaging only |
| `playground/form.mjs` | Review HTML as text, compare JSON samples and inspect one selected output at a time | Browser memory, DOM and explicit clipboard writes |
| `playground/policy.mjs` | Normalize a copy of the CI example and preview the team consent rule | Reads one bundled JSON asset from the same origin. No form content or execution |
| `playground/comparison.mjs` | Validate and dispatch fixed session, invoice and preference handlers; bind approval to exact requests | Local fixtures and call records |
| `playground/experiment-model.mjs`, `experiment.mjs` | Review requests, collect explicit local approval and show fixture results | Browser memory and DOM |
| `examples/experiment.mjs` | Exercise all three handlers and assert rejection, result and duplicate behavior | Local fixtures and stdout |
Expand Down Expand Up @@ -64,7 +66,9 @@ three fixed ports: `start-session`, `pay-invoice` and `set-preferences`. It uses
portable core to pin the contract digest, validate exact arguments and dispatch
only known local fixture handlers. It is not loaded by the public film. The separate `experiment.html` page imports
it through `experiment-model.mjs`, which snapshots reviewed arguments and cancels
pending approval when an input changes. The UI only dispatches after a user
pending approval when an input changes or the user cancels. The browser
ignores repeated key presses and extra clicks in a single click sequence on
the primary control. The UI only dispatches after a user
action, exposes actual state and records, and resets into a new fixture. Each
scenario is isolated; the sign in fixture does not authorize the payment fixture.
Visual phases follow model state. Review stops at a lock, errors stop the route,
Expand All @@ -79,6 +83,13 @@ Their levels are local assertions, not remote authentication. Concurrent duplica
calls, changed contracts and aborted requests cannot dispatch. Tests retain
coverage for these boundaries and input isolation.

The form review runs inference in a module worker. Editing the source or origin
terminates pending work and clears the draft. Changing the selected action
clears prior input results. The page checks both samples with the portable
validator. It inserts submitted and generated text through text properties,
never renders the submitted form and has no fixture handler imports.
The selected tool describes one action. The draft contract includes all actions.

The separate calendar example keeps conflict planning, atomic changes and undo.
No example connects to a real account or payment provider. The inspection worker
is also separate from the film. Page delivery uses the hosting provider.
Expand All @@ -88,10 +99,17 @@ is also separate from the film. Page delivery uses the hosting provider.
`npm run demo` serves the playground at `/playground/` and keeps the original
fixture origin at `/` for probe and inference experiments. The server serves an
explicit asset allowlist. It does not expose repository files through arbitrary
paths. The package includes both the film and experiment. The
paths. The package includes the film, experiment and form review. The
`hardwire-experiment` binary runs the three fixtures from an installed package.

`npm run build:playground` copies only portable source modules, static assets and
The dev server, static build and offline ZIP share the explicit portable asset
list in `examples/demo/assets.mjs`. The ZIP builder reads tracked sources and
the captioned MP4 directly. It uses the development dependency `fflate` and
a fixed archive timestamp. The extracted launcher uses Node builtins and the
same local server on a free loopback port. The video, invoice text and guide
stay outside the server's asset list.

`npm run build:playground` copies portable source modules, static assets, two downloadable starter files and
the license into `output/playground`. There is no bundler or third party script.
The public GitHub Pages workflow runs the full checks before deploying this
artifact from main. GitHub Pages must use GitHub Actions as its publishing source.
Expand Down
106 changes: 106 additions & 0 deletions docs/DEMO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Hardwire demo

[Watch the captioned walkthrough](../.github/assets/developer-pilot.mp4).
The recording shows the local examples, form review and team rule in Chrome. The opening
animation illustrates the concept. Its timing does not measure performance.

Run `npm run dev` and open [the film](http://127.0.0.1:8787/playground/).
Allow about two minutes. Use only the supplied synthetic examples.

## Take the demo offline

From a source checkout with Node 22 or newer, run these commands.

```sh
npm ci --ignore-scripts
npm run build:demo
```

The preview is saved as `output/Hardwire-offline-demo.zip`. Extract the whole
archive, open a terminal in the extracted `Hardwire` folder and run
`node start.mjs`. Use the first printed address. The server picks a free port
on this computer. Press Ctrl+C to stop it. The extracted demo needs no npm
installation or internet connection. Documentation links open external sites.

Open `Watch.mp4` to watch without Node. Use `Invoice-example.txt` for the
optional comparison below. The ZIP is a review preview, separate from the
GitHub package release and desktop bundle.

## Presenter script

1. **Watch.** “An app can describe what an agent may request, which inputs
it accepts and whose approval it needs.” Pause the film. “The timing is
illustrative. Let’s check what actually happens.”
2. **Try it.** Run sign in and give local consent. Advance to the invoice.
Choose **Try invalid input** to show the altered amount being rejected.
Run the original €24 request, choose **Cancel** and show that it stays
unpaid. Run it again and approve it locally. “These are fixed
examples. No account is connected and no money moves.”
3. **Settings.** Run the preference change. “This reviewed example knows
how to undo the change. What could we learn from its HTML alone?”
4. **Review a form.** Point out the write and user confirmation. “The
checkbox tells us the input type. A reviewer still has to establish
whether a change can be undone.” Choose **Check inputs**. Compare
`false` with `"false"`.
5. **Contract and MCP tool.** Open the inspector. Switch between **MCP tool** and **Draft contract**. “A developer can copy this
description, review the proposed behavior and connect their own authorized
handler.” Press Escape to return to the form.
6. **Try a team rule.** Open the sample contract link. This is a separate
reviewed fixture. No form content carries over. Remove confirmation.
“The contract still validates because the change is reversible. This team
requires consent anyway.” Restore confirmation and download both files.
Run the [Node test](../examples/ci/README.md) to reproduce the failure
in a project. The browser previews the consent check only.

On phones, the film cycles through one scene at a time. Choose a scene to
stay on it. With reduced motion, use the scene buttons to compare results.

## Optional invoice comparison

Copy the [synthetic invoice markup](../examples/corpus/invoice/page.html)
into the form review and use `https://invoice.example.com` as the origin.
Choose **Review form**, then **Check inputs**. The draft accepts a number and
a text value. Compare that result with the reviewed invoice in the experiment.
It requires a fixed ID, 2400 cents, EUR and owner approval. The differences
explain why an inferred tool description needs review before integration.

## Independent pilot

Run the [offline build](#take-the-demo-offline) and give each participant
only `output/Hardwire-developer-pilot.zip` once outreach is approved.
The guided archive contains the answers. The pilot archive starts at the
sample form and contains no walkthrough or video. It requires Node 22 or
newer. Participants extract the folder, run `node start.mjs` and open the
printed address. No package installation or account is needed.

Use the [same prompt](../scripts/offline-demo/PILOT.txt) for five independent
developers. Leave them time to try it before offering help. Record setup
failures separately. A completed task means showing an accepted input, a
rejected input and the matching MCP description. Record any assistance.
A blocked attempt counts toward attempts only. Record the first confusion
verbatim with permission. The optional [notes](../scripts/offline-demo/NOTES.txt)
stay on the participant's computer unless they share them.

Keep a copy of this table outside the repository. Use anonymous identifiers.
Leave unknowns blank. Separate sample results from later custom form trials.

| Attempt | Setup | Outcome and help | First confusion | Useful output | Next step |
| --- | --- | --- | --- | --- | --- |
| 01 | | | | | |
| 02 | | | | | |
| 03 | | | | | |
| 04 | | | | | |
| 05 | | | | | |

After the attempt, offer the team rule and the [CI starter](../examples/ci/README.md).
Count a repository only with evidence of integration. Use the
[repeat use definition](LAUNCH.md#distribution-and-measurement) for follow up.
Fix the first repeated blocker before expanding. Report totals for independent
attempts, unassisted completions, assisted completions and blocked attempts.
Exclude internal runs, downloads and automated checks.

## Browser reference

[Desktop](assets/form-1280.png) · [Mobile](assets/form-390.png)

[Desktop inspector](assets/inspector-1280.png) · [Mobile inspector](assets/inspector-390.png)
Loading