drives: read the app-door QR two ways — jsqr over the bridge's PNG + the page's open-app-here anchor, single-use asks (WKT-DEMO B, plan Task 4) #1840

Closed
opened 2026-09-24 18:26:25 +00:00 by ben · 2 comments
Owner

What

app/package.json devDependencies jsqr, pngjs, @types/pngjs (no repo carries a QR DECODER today — dashboard has uqr (encode only), matou-app has qrcode (encode)); new app/tests/e2e/fixtures/qrRead.ts (plan Task 4 Step 3, verbatim): decodeQrPng, askIsFresh (a challenge c is single-use / 2-min TTL — never handed to the app twice), readAppDoor(page, shot) (waits [data-field="app-door"] + img[data-field="signin-qr"] naturalWidth>0, screenshots the image, decodes it, reads a[data-action="open-app-here"]'s href, REFUSES if they differ, returns askFromDeepLink(link)). Test fixtures testdata/signin-qr.png (qrencode of the exact link in the test) and testdata/blank.png.

Acceptance

  • New qrRead.test.ts (plan Task 4 Step 1, verbatim) green; eslint clean; pnpm install --frozen-lockfile shape holds (lockfile committed).

depends_on: none.

Plan: docs/superpowers/plans/2026-09-24-wkt-app-drive.md (commit bc1d4ccc) — steps, exact code, tests and commands live there; this ticket is the work order. Spec: docs/superpowers/specs/2026-09-24-wkt-demo-founding-and-app-drives-design.md (Drive B). Read the plan header (Global Constraints, Review Focus) first. Drive A's plan/tickets: docs/superpowers/plans/2026-09-24-wkt-founding-drive.md, #1829–#1836.

Discipline: TDD as the plan orders it; one commit per task with the plan's subject line; STATUS entry in the same commit; nothing here changes any other target; the founder words are read from the kept bundle into memory only — never logged, never copied.

## What `app/package.json` devDependencies `jsqr`, `pngjs`, `@types/pngjs` (no repo carries a QR DECODER today — dashboard has `uqr` (encode only), matou-app has `qrcode` (encode)); new `app/tests/e2e/fixtures/qrRead.ts` (plan Task 4 Step 3, verbatim): `decodeQrPng`, `askIsFresh` (a challenge `c` is single-use / 2-min TTL — never handed to the app twice), `readAppDoor(page, shot)` (waits `[data-field="app-door"]` + `img[data-field="signin-qr"]` naturalWidth>0, screenshots the image, decodes it, reads `a[data-action="open-app-here"]`'s href, REFUSES if they differ, returns `askFromDeepLink(link)`). Test fixtures `testdata/signin-qr.png` (qrencode of the exact link in the test) and `testdata/blank.png`. ## Acceptance - New `qrRead.test.ts` (plan Task 4 Step 1, verbatim) green; eslint clean; `pnpm install --frozen-lockfile` shape holds (lockfile committed). depends_on: none. **Plan:** `docs/superpowers/plans/2026-09-24-wkt-app-drive.md` (commit `bc1d4ccc`) — steps, exact code, tests and commands live there; this ticket is the work order. **Spec:** `docs/superpowers/specs/2026-09-24-wkt-demo-founding-and-app-drives-design.md` (Drive B). Read the plan header (Global Constraints, Review Focus) first. Drive A's plan/tickets: `docs/superpowers/plans/2026-09-24-wkt-founding-drive.md`, #1829–#1836. **Discipline:** TDD as the plan orders it; one commit per task with the plan's subject line; STATUS entry in the same commit; nothing here changes any other target; the founder words are read from the kept bundle into memory only — never logged, never copied.

swarm-claim host=elitebook-distributed-server-03 run=32049
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=32049 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1840 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1840,
  "status": "success",
  "commits": [
    "67b4dc00ddc1e26baabb28921e82f1f4dd4ca935"
  ],
  "changed_files": [
    "STATUS.md",
    "app/package.json",
    "app/tests/e2e/fixtures/qrRead.test.ts",
    "app/tests/e2e/fixtures/qrRead.ts",
    "app/tests/e2e/fixtures/testdata/blank.png",
    "app/tests/e2e/fixtures/testdata/signin-qr.png",
    "pnpm-lock.yaml"
  ],
  "tests": [
    {
      "command": "cd app && pnpm exec vitest run tests/e2e/fixtures/qrRead.test.ts",
      "exit_code": 0
    },
    {
      "command": "cd app && pnpm exec eslint tests/e2e/fixtures/qrRead.ts tests/e2e/fixtures/qrRead.test.ts",
      "exit_code": 0
    },
    {
      "command": "pnpm install --frozen-lockfile",
      "exit_code": 0
    },
    {
      "command": "pnpm run lint",
      "exit_code": 0
    }
  ],
  "criteria": {
    "New qrRead.test.ts (plan Task 4 Step 1, verbatim) green": "app/tests/e2e/fixtures/qrRead.test.ts committed verbatim; `pnpm exec vitest run tests/e2e/fixtures/qrRead.test.ts` = 3 passed / exit 0. Decodes testdata/signin-qr.png to the exact matou://signin link + askFromDeepLink reads challenge_id 'abc'/service 'Files'; blank.png throws /no QR/; the same c is fresh once then never again (askIsFresh).",
    "eslint clean": "`pnpm exec eslint tests/e2e/fixtures/qrRead.ts tests/e2e/fixtures/qrRead.test.ts` exit 0; whole-tree `pnpm run lint` (eslint .) exit 0 (also ran as the push TS gate).",
    "pnpm install --frozen-lockfile shape holds (lockfile committed)": "app/package.json gains devDeps jsqr ^1.4.0, pngjs ^7.0.0, @types/pngjs ^6.0.5; pnpm-lock.yaml committed (additions only); `pnpm install --frozen-lockfile` = 'Already up to date' exit 0."
  },
  "summary": "WKT-DEMO Drive B Task 4: app/tests/e2e/fixtures/qrRead.ts reads the app-door QR two ways (jsqr over the bridge's PNG + the page's open-app-here anchor, refusing on disagreement) with single-use challenge tracking, backed by verbatim tests and a committed QR fixture.",
  "blockers": []
}
**close-report** for #1840 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1840, "status": "success", "commits": [ "67b4dc00ddc1e26baabb28921e82f1f4dd4ca935" ], "changed_files": [ "STATUS.md", "app/package.json", "app/tests/e2e/fixtures/qrRead.test.ts", "app/tests/e2e/fixtures/qrRead.ts", "app/tests/e2e/fixtures/testdata/blank.png", "app/tests/e2e/fixtures/testdata/signin-qr.png", "pnpm-lock.yaml" ], "tests": [ { "command": "cd app && pnpm exec vitest run tests/e2e/fixtures/qrRead.test.ts", "exit_code": 0 }, { "command": "cd app && pnpm exec eslint tests/e2e/fixtures/qrRead.ts tests/e2e/fixtures/qrRead.test.ts", "exit_code": 0 }, { "command": "pnpm install --frozen-lockfile", "exit_code": 0 }, { "command": "pnpm run lint", "exit_code": 0 } ], "criteria": { "New qrRead.test.ts (plan Task 4 Step 1, verbatim) green": "app/tests/e2e/fixtures/qrRead.test.ts committed verbatim; `pnpm exec vitest run tests/e2e/fixtures/qrRead.test.ts` = 3 passed / exit 0. Decodes testdata/signin-qr.png to the exact matou://signin link + askFromDeepLink reads challenge_id 'abc'/service 'Files'; blank.png throws /no QR/; the same c is fresh once then never again (askIsFresh).", "eslint clean": "`pnpm exec eslint tests/e2e/fixtures/qrRead.ts tests/e2e/fixtures/qrRead.test.ts` exit 0; whole-tree `pnpm run lint` (eslint .) exit 0 (also ran as the push TS gate).", "pnpm install --frozen-lockfile shape holds (lockfile committed)": "app/package.json gains devDeps jsqr ^1.4.0, pngjs ^7.0.0, @types/pngjs ^6.0.5; pnpm-lock.yaml committed (additions only); `pnpm install --frozen-lockfile` = 'Already up to date' exit 0." }, "summary": "WKT-DEMO Drive B Task 4: app/tests/e2e/fixtures/qrRead.ts reads the app-door QR two ways (jsqr over the bridge's PNG + the page's open-app-here anchor, refusing on disagreement) with single-use challenge tracking, backed by verbatim tests and a committed QR fixture.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1840
No description provided.