Files
tools-legacy/openspec/changes/archive/2026-10-02-fpagent-device-availability/tasks.md
T
adebisi-fa 548e33390c feat(fpagent): show scanner availability and gate capture
Consume fpagent's fprint-device-status {available, device, captureAgentId}
in the /fingerprint wizard. Availability is tracked tri-state so an agent
that does not report it leaves capture working as before; the header tag
shows offline / no-scanner / ready, the capture panel warns, and capture is
disabled until a supported reader is attached.

Adds a vm-sandbox test for the wizard logic and the OpenSpec change
fpagent-device-availability, archived with the fingerprint-wizard spec.
2026-10-02 15:12:16 +01:00

41 lines
1.6 KiB
Markdown

# Tasks
## 1. Consume the availability event
- [x] 1.1 In `tools/public/assets/fp/app.js`, add `agent.available` (default
`null`) and `agent.device` (default `''`); handle `fprint-device-status` to set
both and re-render the tag. Verify the handler is present.
- [x] 1.2 Clear `available` back to `null` and `device` to `''` on `disconnect`
and `connect_error`.
## 2. Show availability
- [x] 2.1 Extend `renderAgentTag` to the four states (offline, scanner not
connected, agent ready, agent connected/unknown) with the device name in the
tag `title`.
- [x] 2.2 Add a computed notice (title/subtitle) for agent-offline and
no-scanner, and render it as a warning `cds-inline-notification` in the
capture panel.
- [x] 2.3 Disable the capture and recapture buttons while
`agent.available === false`, and make `capture()` refuse an attempt in the
same state.
## 3. Docs
- [x] 3.1 Add a paragraph to `README.md` under "The Fingerprint Agent".
- [x] 3.2 Add a line to `tools/public/assets/help.html`.
## 4. Verification
- [x] 4.1 `cd tools && npm test` passes (65 tests, 6 new in
`test/fp-wizard.test.js`).
- [x] 4.2 `openspec validate 2026-10-02-fpagent-device-availability --strict`
passes.
- [x] 4.3 `test/fp-wizard.test.js` loads `app.js` in a vm sandbox and asserts the
availability states, tag labels, capture refusal, and disconnect reset.
- [x] 4.4 End-to-end browser pass against a running agent (tag transitions and
disabled controls) — done with Playwright driving the real page against a
stubbed agent socket; screenshots in the harness run.
- [x] 4.5 Archive the change (`openspec archive`), which syncs the
`fingerprint-wizard` spec.