@botiverse/porthole 0.14.4 → 0.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/check/page-source.js +1 -1
  3. package/dist/check/page.js +5 -1
  4. package/dist/compile/policy.d.ts +6 -0
  5. package/dist/compile/policy.js +6 -0
  6. package/dist/conformance/entry.d.ts +25 -6
  7. package/dist/conformance/entry.js +69 -18
  8. package/dist/conformance/harness/page.d.ts +12 -0
  9. package/dist/conformance/harness/page.js +95 -51
  10. package/dist/conformance/harness-source.js +1 -1
  11. package/dist/conformance/host-kit.js +39 -13
  12. package/dist/conformance/served.js +140 -0
  13. package/dist/files/paths.d.ts +2 -2
  14. package/dist/files/paths.js +12 -2
  15. package/dist/host/client.d.ts +8 -0
  16. package/dist/host/client.js +47 -17
  17. package/dist/host/create-host.d.ts +10 -0
  18. package/dist/host/create-host.js +126 -10
  19. package/dist/host/door.d.ts +41 -0
  20. package/dist/host/door.js +55 -0
  21. package/dist/host/locate.js +2 -0
  22. package/dist/host/locator.d.ts +55 -3
  23. package/dist/host/locator.js +152 -42
  24. package/dist/host/outcome.d.ts +58 -1
  25. package/dist/host/outcome.js +74 -6
  26. package/dist/host/types.d.ts +20 -4
  27. package/dist/isolation/served.d.ts +1 -1
  28. package/dist/isolation/served.js +35 -0
  29. package/dist/isolation/types.d.ts +20 -2
  30. package/dist/isolation/types.js +2 -0
  31. package/dist/platform/types.d.ts +22 -0
  32. package/dist/platform/web.js +55 -12
  33. package/dist/react/frame.d.ts +2 -1
  34. package/dist/react/view.d.ts +13 -0
  35. package/dist/react/view.js +101 -2
  36. package/dist/server/files.d.ts +11 -0
  37. package/dist/server/files.js +26 -4
  38. package/dist/server/host.js +106 -28
  39. package/dist/server/index.d.ts +2 -1
  40. package/dist/server/index.js +6 -1
  41. package/dist/server/pages.d.ts +32 -0
  42. package/dist/server/pages.js +82 -6
  43. package/dist/server/server.js +140 -11
  44. package/dist/server/types.d.ts +15 -1
  45. package/dist/transport/post-message.d.ts +1 -9
  46. package/dist/transport/post-message.js +2 -8
  47. package/docs/ADOPTING.md +58 -0
  48. package/docs/DECISIONS.md +290 -0
  49. package/docs/DESIGN.md +24 -16
  50. package/docs/THREAT_MODEL.md +98 -3
  51. package/package.json +1 -1
  52. package/src/check/page.ts +6 -1
  53. package/src/compile/policy.ts +7 -0
  54. package/src/conformance/entry.ts +129 -24
  55. package/src/conformance/harness/page.ts +112 -49
  56. package/src/conformance/host-kit.ts +53 -16
  57. package/src/conformance/served.ts +175 -0
  58. package/src/files/paths.ts +11 -2
  59. package/src/host/client.ts +59 -22
  60. package/src/host/create-host.ts +146 -18
  61. package/src/host/door.ts +97 -0
  62. package/src/host/locate.ts +2 -0
  63. package/src/host/locator.ts +208 -57
  64. package/src/host/outcome.ts +88 -7
  65. package/src/host/types.ts +20 -4
  66. package/src/isolation/served.ts +40 -1
  67. package/src/isolation/types.ts +19 -2
  68. package/src/platform/types.ts +21 -0
  69. package/src/platform/web.ts +55 -20
  70. package/src/react/frame.tsx +2 -1
  71. package/src/react/view.tsx +149 -2
  72. package/src/server/files.ts +37 -5
  73. package/src/server/host.ts +131 -46
  74. package/src/server/index.ts +6 -1
  75. package/src/server/pages.ts +101 -6
  76. package/src/server/server.ts +186 -19
  77. package/src/server/types.ts +16 -1
  78. package/src/transport/post-message.ts +1 -9
package/CHANGELOG.md CHANGED
@@ -4,6 +4,77 @@
4
4
  section); the reasons for every change are in [docs/DECISIONS.md](docs/DECISIONS.md), by the
5
5
  P-numbers below.
6
6
 
7
+ ## 0.14.6
8
+
9
+ - **Every display ends with an outcome (P125):** a frame started again until its restarts ran out
10
+ is `blocked: error` (it had no outcome at all: an empty box), and restarts no longer start its
11
+ load timeout again — `loadTimeoutMs` covers a loading episode, from its first run until an
12
+ outcome (an outcome or `reload()` begins the next).
13
+ - **Security (P125, after the audit of 2026-10-30):** a served display that isn't nested (a served
14
+ shell, a page, a view through the sandbox proxy) now takes how loading went from a **door** — a
15
+ page of Porthole's on the display's origin, framed hidden and opaque by the host before the
16
+ content, that no same-scope content can reach — not from its own frame. This closes the audit's
17
+ P124-1: a scope's displays share one origin, so a same-scope sibling could reach another
18
+ display's first document before its shell ran and speak Porthole's word for it (a forged sign-in
19
+ with a link out), or silence it into `framing`, or reload it into a run it spoke first in. The
20
+ door decides (`open`, or `blocked` and why); the content frame's own frame status is never taken
21
+ (one `frame-status` host error a run), and its silence is a `timeout`, never a fallback. Nested
22
+ pages, url mode and opaque frames are unchanged.
23
+ - **Server/host contract:** `issue` returns `FrameLocation.door` and `/server` serves
24
+ `/__porthole/door/<key>` for those kinds (`doorResponse`, `doorStatusResponse`, `DOOR_PATH`
25
+ exported for a host's own content Worker). Additive: an old host ignores `door`. A **new** host
26
+ given a served non-nested location **without** a door is strict (no frame status taken, a block
27
+ shows as a timeout) and raises a `hostError` of a new kind `"door"`. **Deploy the server/Worker
28
+ before the host**, and a custom locator must pass `door` through.
29
+ - **A file set's entry must be a page** (P124-2): `checkFileSet`, `admitFiles` and `lintFiles`
30
+ refuse an entry that isn't `.html`/`.htm` (code `entry`); a set stored before this answers
31
+ Porthole's `not-found` status page, and the door says `not-found`.
32
+ - **Before any frame, the host asks `issue`** (P125): blocked or allowed is said by the door or by
33
+ the host's own issue endpoint, never by a frame. A refusal from the frame route is now the
34
+ display's outcome with no frame built: 401 `blocked: sign-in`, 403 `blocked: denied` (with the
35
+ host's code from an optional, additive `error.reason`), 404 `blocked: not-found`, with no
36
+ `locate` host error; any other failure stays `blocked: locate`; a backend that never answers is
37
+ a `timeout`. This holds for every locate.
38
+ - **Migration (no grace release): a clean address is for a top-level tab.** `createHost` refuses
39
+ a served non-nested location without a door before any frame (`blocked: locate`, `door` host
40
+ error), which replaces 0.14.5-P125's "frame it strict and time out" and covers both an old
41
+ server and a clean address framed as it is. To frame what a clean address names, resolve it:
42
+ `client.resolve(address)` or `<PortholeView address>` (the issue endpoint takes `{ address }`
43
+ and answers `{ ...location, instance }`). In a frame the content origin answers a clean address
44
+ (and the app's authorize route answers itself) with a page that has no script and goes nowhere:
45
+ P068's in-frame sign-in page and the transport's host-origin channel (`also`) are removed. A
46
+ locator must issue anew for every run: a reused location's door says `blocked: session`, and
47
+ `createHost` raises a `locate` host error naming the fix.
48
+ - A `PlatformHost` of a host's own must give `createDoor` (delegate to `webPlatform.createDoor`):
49
+ without doors no served non-nested display is framed (`/check`'s own platform now does).
50
+ A refusal maps to an outcome only in the issue endpoint's own shape (`{ error: { code } }`, code
51
+ `unauthenticated`, `forbidden` or `not-found`): a bare 401, 403 or 404 from a proxy stays
52
+ `blocked: locate`. `<PortholeView address>` offers the address as its fallback's tab link only
53
+ on the served content domain, and binds its resolved location to its own first frame.
54
+ - Leak suite: the `door-opaque` control (the door made non-opaque and heard from the content
55
+ origin: a sibling rewrites the live door into Porthole's own status page) and Ferryman's
56
+ `[sibling-reload]` probe (held by `door-status` and `content-status`).
57
+ - Planned, not in this release: a host-only parallel-mount variant (the door and content opened
58
+ together), to be measured against the sequential default.
59
+
60
+ ## 0.14.5
61
+
62
+ - **Security (P124, after the audit raft-security-audit#16):** any frame could say
63
+ `porthole/notifications/frame-status` (an opaque widget, a served page, an MCP Apps view, a
64
+ nested page through its shell), and the host took it as Porthole's server's word: its `outcome`
65
+ became `blocked` with the content's reason and code, and a host drew its fallback in Porthole's
66
+ wording ("Open this in a new tab to sign in") with a link out. Now an opaque frame's frame status
67
+ is never taken, and a frame that speaks is heard only before anything else it says in the run
68
+ (its first document, a page of Porthole's; content always runs after Porthole's own first word).
69
+ One not taken is no outcome and no code: the host hears a `hostError` of the new kind
70
+ `frame-status`, once a run. A url-mode app's word is taken as before (THREAT_MODEL S6). Changed:
71
+ a frame that speaks no longer tells a later block itself; a display without files starts again
72
+ and its next run says it, and in one with files a page answered by a status page (access revoked)
73
+ shows the server's page in the frame without a `blocked` outcome.
74
+ - **Tests (P124):** `test/outcome.test.ts` ("who may say how loading went"); four forgers in
75
+ `leak/served/outcome.spec.ts` (a served shell's content, an artifact page, an opaque widget, a
76
+ nested page), negative control `frame-status`.
77
+
7
78
  ## 0.14.4
8
79
 
9
80
  - **Docs (P123):** a display taking the keyboard is an accepted risk (THREAT_MODEL §5): the guard