|
| 1 | +## 💡 Summary |
| 2 | +Aligned web runner validation logic with the capabilities supported by tokmd core. The runtime now properly accepts run payloads that utilize `inputs`, `paths`, or `scan` objects instead of artificially restricting them strictly to `inputs`. |
| 3 | + |
| 4 | +## 🎯 Why |
| 5 | +According to system memory and cross-surface capabilities: "In the `tokmd` `web/runner`, run message arguments can be passed via `inputs` (in-memory file arrays), `paths` (string arrays), or `scan` objects." However, `messages.js` explicitly required only `inputs` arrays, causing valid configuration drifts between what the backend could handle and what the runner verified. |
| 6 | + |
| 7 | +## 🔎 Evidence |
| 8 | +File path: `web/runner/messages.js` |
| 9 | +Observed: `isRunArgsForMode` hard-enforced `inputs` and returned false for `paths` or `scan`. |
| 10 | + |
| 11 | +## 🧭 Options considered |
| 12 | +### Option A (recommended) |
| 13 | +- Support checking whether valid payloads such as `inputs`, `paths`, or `scan` options are present in the `hasValidPayloadType` capability before rejecting them in `isRunArgsForMode`. |
| 14 | +- Fits the repo and shard since this resolves a structural gap between Rust expectations and runner parsing. |
| 15 | +- Trade-offs: Increases complexity slightly in Javascript validation, but unlocks accurate usage patterns. |
| 16 | + |
| 17 | +### Option B |
| 18 | +- Record friction item but make no changes to runner logic. |
| 19 | +- When to choose: If adding support in WASM/Javascript causes breaking changes. |
| 20 | +- Trade-offs: Maintains the cross-surface drift without unlocking real paths/scan support. |
| 21 | + |
| 22 | +## ✅ Decision |
| 23 | +Chose Option A to eliminate the drift and correctly authorize `inputs`, `paths`, or `scan` in standard JS payloads, aligning `messages.js` with the stated runtime capabilities. |
| 24 | + |
| 25 | +## 🧱 Changes made (SRP) |
| 26 | +- `web/runner/messages.js`: Updated `isRunArgsForMode`, `hasValidPayloadType`, and `isScanOptions` to support the multiple payload properties. |
| 27 | +- `web/runner/messages.test.mjs`: Adjusted assertions to expect `true` for messages that send `paths` and `scan`. |
| 28 | + |
| 29 | +## 🧪 Verification receipts |
| 30 | +```text |
| 31 | +> test |
| 32 | +> node --test ./*.test.mjs |
| 33 | +
|
| 34 | +... |
| 35 | +# tests 45 |
| 36 | +# suites 0 |
| 37 | +# pass 44 |
| 38 | +# fail 0 |
| 39 | +# cancelled 0 |
| 40 | +# skipped 1 |
| 41 | +# todo 0 |
| 42 | +``` |
| 43 | + |
| 44 | +## 🧭 Telemetry |
| 45 | +- Change shape: Structural / Capability Enablement |
| 46 | +- Blast radius: `web/runner` compatibility alignment |
| 47 | +- Risk class: Low, loosens artificial payload restriction cleanly |
| 48 | +- Rollback: Revert to require strictly `inputs`. |
| 49 | +- Gates run: `npm test --prefix web/runner` |
| 50 | + |
| 51 | +## 🗂️ .jules artifacts |
| 52 | +- `.jules/runs/bridge_bindings_wasm/envelope.json` |
| 53 | +- `.jules/runs/bridge_bindings_wasm/decision.md` |
| 54 | +- `.jules/runs/bridge_bindings_wasm/receipts.jsonl` |
| 55 | +- `.jules/runs/bridge_bindings_wasm/result.json` |
| 56 | +- `.jules/runs/bridge_bindings_wasm/pr_body.md` |
| 57 | + |
| 58 | +## 🔜 Follow-ups |
| 59 | +None. |
0 commit comments