Loaded remote library GitHub issue

vibecode
{"vibecode": {"example": "loaded_remote_library",
    "shows": "drinian_after_runtime_loading_a_puck_library_and_calling_a_method_on_it; demonstrates_trust_barrier_via_cross_role_chain_wipe",
    "shape": "srcs_mixes_file_and_uns_entries; roles_includes_loaded_library; chain_isolation_at_role_boundary",
    "key_idea": "loaded_library_is_structurally_identical_to_any_other_role_introducing_thing"}}

A program loads a remote Caspian library via %puck and calls a method on it. Before the call, the user stashes an API token in %chain.misc — the library MUST NOT be able to see it. The trust barrier falls out of the existing cross-role chain wipe; no new mechanism needed.

Caspian source (capture happens during the to_html call, inside the loaded library — there's no user-source line to mark; the library is doing the work):

caspian
$markdown = %puck['https://markdown.uno/render']
%chain.misc.api_token = 'sk-secret-abc123'
$html = $markdown.to_html('# Hello')    # CAPTURED while inside to_html
puts $html

Paused inside to_html in the loaded library, after the library has tokenized the input and started building output.

json
{
  "srcs": {
    "a": {"file": "/home/miko/render_post.casp"},
    "b": {"uns": "markdown.uno/render/render.casp"}
  },
  "roles": {
    "user": {},
    "stdlib": {},
    "markdown.uno/render": {
      "loaded_from": "puck://markdown.uno/render",
      "loaded_at": ["a", 1],
      "trust": []
    }
  },
  "call_stack": [
    {
      "action": "top_level",
      "role": "user",
      "lexical_parent": null,
      "src": ["a", 3],
      "locals": {
        "markdown": {"class_ref": "Renderer", "src": ["a", 1]}
      },
      "chain": {
        "log": {},
        "misc": {
          "api_token": {"value": "sk-secret-abc123", "src": ["a", 2]}
        }
      }
    },
    {
      "action": "method_call",
      "role": "markdown.uno/render",
      "receiver_type": "Renderer",
      "method": "to_html",
      "lexical_parent": null,
      "src": ["b", 47],
      "locals": {
        "input": {"value": "# Hello", "src": ["a", 3]},
        "tokens": {"array": [
          {"value": "H1_OPEN", "src": ["b", 32]},
          {"value": "Hello", "src": ["b", 35]},
          {"value": "H1_CLOSE", "src": ["b", 38]}
        ], "src": ["b", 41]}
      }
    }
  ]
}

What to notice:


© 2026 Puck.uno