PtcRunner.Lisp.Java.Project (PtcRunner v0.14.0)

Copy Markdown View Source

Total, recursive projection for native Java values at bounded host edges.

The projector validates Java leaves before converting them, tracks a bounded structural path, and rejects collection collisions introduced by projection. It never exposes an executable callable or a forged primitive.

Summary

Types

boundary()

@type boundary() ::
  :native
  | :continuation
  | :public
  | :tool_argument
  | :tool_result
  | :kernel_json

error()

@type error() ::
  {:invalid_java_value, [path_segment()], atom() | nil}
  | {:invalid_projection_list, [path_segment()]}
  | {:invalid_projection_struct, [path_segment()], module()}
  | {:java_projection_collision, [path_segment()], :map | :set}
  | {:invalid_java_tool_contract, String.t()}
  | {:inexact_java_boundary_conversion, [path_segment()], boundary(), atom()}
  | {:unsupported_java_boundary_value, [path_segment()], boundary(), atom()}

path_segment()

@type path_segment() ::
  {:list, non_neg_integer()}
  | {:tuple, non_neg_integer()}
  | {:map_key, non_neg_integer()}
  | {:map_value, non_neg_integer()}
  | {:set, non_neg_integer()}
  | {:struct_field, atom()}

Functions

project(value, boundary, contract \\ nil)

@spec project(term(), boundary(), term()) :: {:ok, term()} | {:error, error()}