Skip to content

prototype: notes on a real-stack prototype (feedback picker slice S7) #16411

Closed
4 of 4 issues completed
Closed

Description

@kyle-sexton

Summary

Slice S7 of the prototype feedback picker: take notes on a real-stack prototype (one route of the running app), not only on the standalone HTML mockup. It is the last unbuilt slice of the plan the owner approved on 2026-11-13; the owner deferred it out of the landing session on 2026-11-15 ("Go with recommendations") so it gets a session of its own.

What exists

What S7 delivers

  • reference/real-stack.md gains how the notes harness is mounted on a real-stack route and where its fence sits, so step 5 removes it (addition).
  • The bridge accepts notes from the app's dev origin. The plan's first design (a hidden relay frame on the bridge origin, with an opt-in frame-ancestors parameter on lib/session-bridge/session_bridge.py send()) was written before the host-page design landed; the owner's later answer says the relay "is replaced where the host page already sits on the bridge origin". The design step is to decide which of these holds for a dev server on another origin, and to record it in the ui-feedback contract.
  • relocate-note.mjs restores real-stack state where the route allows.
  • Eval case ed-real-stack-harness-removed: step 5 removes the harness file and the build output carries no marker.

Constraints

  • lib/session-bridge/session_bridge.py is shared by every session-bridge adopter (the planning interview among them): any change is opt-in with the default unchanged, with test_session_bridge and test_view_bridge passing unchanged for existing apps, and copies synced through scripts/shared-copies.txt.
  • A postMessage from any origin but the one dev origin given at start is ignored; the token never leaves the bridge's origin.
  • A real-stack screenshot may show real records and is never pushed (reference/feedback.md, "Where a notes session's files go", once feat(prototype): say where a notes session's files go and add the dossier case #16346 merges).
  • Single-source rules of the plan apply: one note contract, one controls manifest, no second loopback server, token scheme or untrusted-data framing.
  • real-stack.md is skill text: additions only, a fresh-context review before any eval is registered, then a registered before/after eval.

Done when

  • A note taken on a real-stack route reaches the session through the bridge, and one sent from another origin is refused (tests).
  • git grep -n data-prototype-harness and a grep of the scaffold's build output print nothing after step 5.
  • The session-bridge suites pass unchanged for existing adopters.
  • ed-real-stack-harness-removed passes, and the registered eval shows no loss.

Left out

Frameworks without an environment gate.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    needs-triage
    on Nov 15, 2026
  2. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: High
    Uncertainty: Knowable
    Flags: none
    Blocked by: none
    Blast radius: lib/ui-feedback (host page, bridge, proto-pin, relocate-note), the ui-feedback contract, the prototype skill's real-stack.md, scaffold tests and one eval case; read by prototype-skill users and maintainers.
    Reversible: yes; each change is a code or doc revert, and session_bridge.py send() stays unchanged.
    Open questions: none
    Understood: slice S7 lets the notes picker take notes on a real-stack dev route, with the host page on the bridge origin framing the dev route.

    Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.
    [quote truncated; the full decision is at the link]

    #16411 (comment)

    This decision settles the open questions: the host page frames the dev route, there is no relay frame, and send() is unchanged. The later amendment adds a checklist of lane-checkable items. The eval run and the before/after registration need a host step and are not part of that checklist. No duplicate or merged fix found.

    Automated triage. A maintainer reviews it.

  3. added
    needs-owner-decision
    on Nov 15, 2026
  4. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  5. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: Notes taken on a real-stack route reach the session through the bridge from the one dev origin given at start, with the mount and fence documented in real-stack.md, relocate-note.mjs support, and eval ed-real-stack-harness-removed; the transport design is not yet chosen.

    Related work

    Open questions

    1. For a dev server on another origin, which transport holds: (a) a hidden relay frame on the bridge origin with an opt-in frame-ancestors parameter on session_bridge.py send(), or (b) the host page on the bridge origin frames the dev route and accepts postMessage only from the one dev origin, with no relay and send() unchanged? Note that notes_bridge.py sets frame-ancestors 'none' at line 59 and host.html frames the mockup sandboxed with an opaque origin, so a dev route that must post from its own
      RECOMMENDED: (b): the issue quotes the owner saying the relay is replaced where the host page already sits on the bridge origin, and (b) leaves shared send() unchanged for other adopters. Basis: lib/ui-feedback/notes_bridge.py:59
    2. Does the dev route get framed inside the host page, which needs the dev server to allow framing from the bridge origin, or does the harness run in the dev tab and message a host window opened separately? Dev servers often send X-Frame-Options or frame-ancestors that block framing.
      RECOMMENDED: Frame the route in the host page and have the harness fence in the dev server config allow only the bridge origin; if framing is blocked, report that and stop. Basis: judgment
    3. Is the decision recorded by the owner as a Decision recorded comment? Only the issue text carries the 2026-11-15 answer, and no such comment exists, so the choice in question 1 is not settled.
      RECOMMENDED: Post a Decision recorded comment naming the chosen design so the contract change can cite it. Basis: judgment
    4. How far must relocate-note.mjs restore real-stack state, given the issue says only where the route allows it?
      RECOMMENDED: Restore only the route URL and viewport, with no data or auth state, and report anything else as not restored. Basis: judgment

    Sources read

    • /home/runner/work/claude-code-plugins/claude-code-plugins/refine-data/context.json: issue 16411 body, triage asks the same relay-versus-direct question, no maintainer comments
    • lib/ui-feedback/notes_bridge.py:59: the content security policy sets frame-ancestors 'none'
    • lib/ui-feedback/host.html:5: the mockup frame is sandboxed with allow-scripts and no allow-same-origin, so it has an opaque origin; the host alone holds the token and network
    • lib/ui-feedback/host.html:83: the host posts to the frame with target origin *
    • lib/session-bridge/session_bridge.py: shared bridge file, which the issue requires stay unchanged by default
    • plugins/prototype/skills/explore-directions/reference/real-stack.md: exists, the skill text to extend
    • plugins/prototype/notes-bridge/relocate-note.mjs: exists, to extend for real-stack routes

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  6. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.

    Q127 (REVISED A)

    Option A, with five specifics the standards require. Option A: the host page on the bridge origin frames the dev route. There is no relay frame, and session_bridge.py send() is unchanged. If framing is blocked, the run reports and stops. relocate-note.mjs restores only the route URL and the viewport. The five specifics: (1) The real-stack host takes a message only when e.source === frame.contentWindow and e.origin exactly equals the one dev origin given at start. That origin is checked at start as a loopback http:// origin with an explicit port, and the message's data still passes note.schema.json as today. (2) Every host-to-frame postMessage names that dev origin as its targetOrigin, never "*". Today's "*" (host.html:109, proto-pin.js:19) exists only because the srcdoc frame is opaque. (3) The dev-route frame either has no sandbox or has sandbox="allow-scripts allow-same-origin". Without allow-same-origin its origin is opaque, so e.origin is null and check (1) can never pass. Pairing the two tokens is safe here because the dev origin differs from the bridge origin: MDN discourages it only for a same-origin embed. (4) For the real-stack page only, the host's CSP adds frame-src <dev origin>. Today's default-src 'none' with no frame-src or child-src would block loading the dev URL; srcdoc never needed it. The host's own frame-ancestors 'none' stays. (5) The harness fence makes the dev server send Content-Security-Policy: frame-ancestors <bridge origin> as an HTTP header (a <meta> tag does not work for this directive), so only the bridge's host page can frame the route. The token stays in the host page, which a cross-origin frame cannot read.

    Basis

    Dissent considered

    none found against A, and B's relay adds a shared send() parameter that touches every adopter, against the issue's constraint. One code fact to settle in the build: host.html stops listening once the frame loads a second document (loads > 1). That suits a model-written srcdoc, but on a real dev route a full navigation or a framework's full reload would end the session. With the origin check in (1), the load-count rule can be relaxed for the real-stack host. That is a design detail the lane can decide.

  7. removed
    needs-owner-decision
    on Nov 21, 2026
  8. removed
    needs-triage
    on Nov 21, 2026
  9. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: sub-issue #17751 is open.

  10. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    Amendment to the decision above, from the research re-check (owner direction of 2026-11-20 recorded there).

    Amendment

    Q127 stays REVISED A. The host page on the bridge origin frames the dev route, there is no relay frame, and session_bridge.py send() is unchanged. relocate-note.mjs restores only the route URL and the viewport. The five specifics stand:

    1. Accept a message only when e.source is the framed window and e.origin exactly equals the one dev origin given at start.
    2. Post to the frame with that origin as targetOrigin, never "*".
    3. Frame the dev route with no sandbox, or with allow-same-origin beside allow-scripts, so its origin is not opaque.
    4. The real-stack host page's CSP adds frame-src <dev origin>.
    5. The dev server sends frame-ancestors <bridge origin> as an HTTP header, not in a <meta> tag.

    The research supports them as follows. Each claim below is quoted from the research record with its qualifiers. The probe claims were observed in headless Chromium 158 only; Firefox and Safari were not probed.

    • Specific 1 rests on the WHATWG standard and the event fields.
      • PM1a: "The WHATWG HTML Standard tells authors to check the origin attribute of a message so that messages are accepted from expected domains, and then to check the data format." (WHATWG HTML, web messaging, 9.3.2.1). Qualifier: the standard says "should" and does not mention the source property.
      • PM2: "A message posted by a cross-origin frame with a tuple origin arrives with e.origin set to the frame serialized origin and e.source set to the iframe contentWindow." (WHATWG HTML, web messaging).
      • The MDN postMessage and OWASP HTML5 passages the decision quoted restate the WHATWG rule. They are not separate evidence.
    • Specific 2. PM3: "A postMessage call with a specific targetOrigin delivers the message when the target document origin matches it and drops it without error when it does not." (WHATWG HTML, web messaging).
    • Specific 3.
      • SB1: "Without allow-same-origin a sandboxed iframe document has an opaque origin, so its messages arrive with e.origin set to the string null and a message posted to it with a specific targetOrigin is dropped." (WHATWG HTML, browsers).
      • SB2: "WHATWG HTML warns against combining allow-scripts and allow-same-origin when the embedded page has the same origin as the page containing the iframe." (WHATWG HTML, iframe). The dev origin differs from the bridge origin, so the warning does not apply here.
    • Specific 4. FS1: "frame-src governs iframe loads and falls back to child-src and then default-src, so a host policy of default-src 'none' with neither directive blocks the dev frame until frame-src names the dev origin." (CSP Level 3). FA1 says the host page's own frame-ancestors 'none' does not limit what the host page frames (CSP Level 3).
    • Specific 5 covers the framing header and DOM and script access only.
      • FA2: "frame-ancestors is ignored in a policy delivered by a meta element and takes effect from the HTTP response header, where a source list naming one embedder origin blocks other embedder origins." (CSP Level 3).
      • SB3: "A cross-origin framed document, unsandboxed or sandboxed with allow-scripts allow-same-origin, cannot read the parent document and gets a SecurityError when it tries." (WHATWG HTML, nav-history-apis).
      • The research did not examine whether the bridge's /api/token route rejects a request from the dev origin (same site, different origin), or how cookies are scoped across ports. So the decision's "the token stays in the host page" holds for DOM and script access only. The token route gets a test in the build (below).

    Two amendments:

    • A, to specific 1. At start, canonicalize the dev origin with new URL(input).origin and refuse an input that differs from the result. OR1: "An exact string comparison with a configured origin fails when the configured string carries the scheme default port, because URL parsing drops a default port and origin serialization then omits it." (WHATWG HTML, browsers). Use one host spelling across the origin check, the frame URL and the frame-ancestors source. OR2: "localhost and 127.0.0.1 with the same port are different origins, so the dev origin used for checks, the frame URL and the frame-ancestors source must share one host spelling." (WHATWG HTML, browsers). Refusing an input with no port is a design choice for the build, not a sourced claim.
    • B, to "if framing is blocked, the run reports and stops". Detect a blocked frame by a ready message from the dev route within a timeout, not by the iframe's load event. LD1: "An iframe whose load is blocked by CSP still fires its load event and no error event, so the load event cannot tell the host that framing was blocked." (web-platform-tests, frame-src-blocked). Whether a fresh ready message after a reload restarts the session, in place of the loads > 1 stop, is a design choice for the build.

    Caveats. The research's verifier failed three rows: row 4 (the single-source flag), row 7 (confidence grading) and row 12 (claims following jointly from their sources). The flag failed on the MDN and OWASP restatements of the WHATWG rule, which is why specific 1 rests on PM1a and PM2 alone. SB1's null-origin evidence has one counted corroborator, below the research's floor of two. The research index also said a sandboxed route that opens dialogs needs allow-modals. MDN contradicts that for opening a <dialog> element, so this amendment drops the claim.

    The issue's eval items (ed-real-stack-harness-removed and the before-and-after registration) need a real eval run, a host step. They are not in the list below.

    Done when

    • The real-stack host accepts a message only when e.source is the dev frame's window and e.origin equals the dev origin, and a test shows a message from another origin, or from another window, ignored.
    • Every host-to-frame postMessage on the real-stack page names the dev origin as targetOrigin, and git grep finds no "*" target origin in the real-stack host code.
    • At start the dev origin is canonicalized with new URL(input).origin, and a test shows an input that differs from its canonical origin refused, such as one that spells the default port.
    • The dev-route frame carries no sandbox attribute, or one that includes both allow-scripts and allow-same-origin, and the real-stack host page's CSP adds frame-src <dev origin> while keeping frame-ancestors 'none'.
    • The harness fence makes the dev server send Content-Security-Policy: frame-ancestors <bridge origin> as a response header, shown by a test that reads the header, and the fence adds no <meta> CSP tag for it.
    • One host spelling is used for the origin check, the frame URL and the frame-ancestors source, shown by a test that compares the three.
    • The host detects a blocked frame by a missing ready message within a timeout, not by the load event, shown by a test where the frame sends no ready message.
    • The bridge's token route rejects a request from the dev origin, shown by a test.
    • A note taken on a real-stack route reaches the session through the bridge in a test.
    • test_session_bridge and test_view_bridge pass unchanged, and session_bridge.py send() keeps its signature and default behavior.
    • git grep -n data-prototype-harness prints nothing after step 5 in the scaffold test.
  11. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    Split at intake (owner Q93). This issue is Size Large, so its done-when is split into 4 sub-issues, each holding its task-list lines as written.

    Automated split by the lanes App. Admission waits on this issue while a sub-issue is open; work-unblock closes it as completed once every sub-issue is closed as completed by a merge or a listed human and its done-when is covered.

  12. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    Every sub-issue of this split is closed as completed by a listed human or a merge (#17748, #17749, #17750, #17751), so the lanes App closes it as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Work status

    ready

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions