Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- "apis/README.md"
- "scripts/guards/check_docs_contracts.sh"
- "crates/plasm-core/**"
- "fixtures/schemas/plasm_language_matrix/**"
- "fixtures/schemas/**"
- ".github/workflows/docs.yml"
pull_request:
paths:
Expand All @@ -26,7 +26,7 @@ on:
- "apis/README.md"
- "scripts/guards/check_docs_contracts.sh"
- "crates/plasm-core/**"
- "fixtures/schemas/plasm_language_matrix/**"
- "fixtures/schemas/**"
- ".github/workflows/docs.yml"
workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Durable, non-obvious notes for working in this OSS subtree on a Cursor Cloud VM.
- **System deps** (already installed in snapshot, not in the update script): `libssl-dev` + `pkg-config` (`openssl-sys`, pulled by `auth-framework`'s native-tls path) and `protobuf-compiler` (`baml` build script needs `protoc`).
- **Generated `baml_client`**: `crates/plasm-eval/baml_client`, `crates/plasm-semantic-seed/baml_client`, and `crates/plasm-discovery-eval/baml_client` are **gitignored** and produced by `baml-cli generate` (v0.220.0) from the repo root. Default **library** builds of `plasm-eval` / `plasm-repl` / `plasm-semantic-seed` do not require them (`baml` / `llm-rerank` are opt-in). **`plasm-server` defaults include `semantic-auto-seed`**, so appliance source builds still need `plasm-semantic-seed/baml_client` unless you pass `--no-default-features`. Re-run `baml-cli generate` after editing anything under `baml_src/`.
- **`plasm-trace-sink` (SaaS ops binary)**: durable Iceberg ingest for the execution-trace lane (`PLASM_TRACE_SINK_URL`); not OTEL and not a Cargo dep of the appliance. Often fails to build in this OSS subtree (floating `datafusion_iceberg` vs workspace `datafusion` pin). Build/lint/test with `--exclude plasm-trace-sink`.
- **Some test targets can't compile in this subtree** (they assume the deeper parent-monorepo layout / unexported fixtures): `plasm-core` & `plasm-runtime` lib tests and several `plasm-discovery`/`plasm-e2e` tests `include_str!`/read `../../../fixtures/schemas/*_overlay/`, `pokeapi_mini`, `workflow_matrix` paths that resolve outside `/workspace`; `plasm-agent-core`'s `cross_pod_operations` test overflows the type-layout recursion limit on current rustc. Run the rest with `cargo test --workspace --exclude plasm-trace-sink --exclude plasm-core --exclude plasm-runtime --exclude plasm-agent-core --no-fail-fast` (≈235 pass; network/live tests self-ignore).
- **Schema overlay fixtures** live in this tree at `fixtures/schemas/*_overlay/` (not the parent monorepo). `plasm-core` / `plasm-runtime` lib tests `include_str!` them via `CARGO_MANIFEST_DIR/../../fixtures/schemas/`. `workflow_matrix` still lives only in the private super-repo, so some `plasm-e2e` tests that probe parent paths will skip or fail here. `plasm-agent-core`'s `cross_pod_operations` test overflows the type-layout recursion limit on current rustc. Overlay-free smoke: `cargo test --workspace --exclude plasm-trace-sink --no-fail-fast` (network/live tests self-ignore).
- **Lint**: `scripts/ci/rust-quality.sh` runs `cargo fmt --all -- --check` + `cargo clippy --workspace --all-targets -- -D warnings`. Under this OSS subtree/newer clippy it will trip on the items above; `cargo clippy --workspace --exclude plasm-trace-sink` (lib/bins) is clean apart from one newer style lint in `plasm-runtime/src/view_template.rs`.
- **Running live queries**: `plasm-cgs` (package `plasm-cli`) does schema validation/round-trips; after BAML generation, the live REPL is `cargo run -p plasm-repl --features baml -- --schema apis/<x> --backend <url>` (pipe an expression then `:quit` on stdin for non-interactive use; get-by-id form is `Entity(id)`). Debug builds can **stack-overflow** on large recursive catalogs (e.g. `pokeapi`) because debug stack frames are larger — use a small flat catalog (`xkcd`, backend `https://xkcd.com`) or build `--release` for those.
- **Appliance**: `cargo run -p plasm-server -- --no-tui --schema fixtures/schemas/capability_with_input` boots headless, **auto-starts an embedded Postgres** (`pg-embed`), and serves HTTP+MCP on `127.0.0.1:3000` (`/v1/health`, `/v1/registry`, `/execute`). Pass a split catalog directory (`domain.yaml` + `mappings.yaml`) or a packaged plugin dir.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Entries before **0.4.35** live in [`CHANGELOG-ARCHIVE.md`](CHANGELOG-ARCHIVE.md)

## [Unreleased]

### Fixed

- **In-repo overlay fixtures:** schema-overlay JSON/bootstrap trees now live under
`fixtures/schemas/*_overlay/` so `plasm-core` test compiles (docs CI fenced-example
gate) no longer `include_str!` files from the private parent monorepo.

## [0.4.45] - 2026-08-10

### Changed
Expand Down
65 changes: 36 additions & 29 deletions crates/plasm-core/src/schema_overlay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,12 +1154,13 @@ mod tests {

#[test]
fn build_schema_overlay_from_fixture() {
let json: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
))
let json: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
)))
.expect("fixture JSON");
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/fibery_schema_overlay/bootstrap");
.join("../../fixtures/schemas/fibery_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand Down Expand Up @@ -1212,12 +1213,13 @@ mod tests {

#[test]
fn build_schema_overlay_object_map() {
let json: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/notion_schema_overlay/sample_database_search.json"
))
let json: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/notion_schema_overlay/sample_database_search.json"
)))
.expect("fixture JSON");
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/notion_schema_overlay/bootstrap");
.join("../../fixtures/schemas/notion_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand All @@ -1240,7 +1242,7 @@ mod tests {
]
});
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/augment_base_overlay/bootstrap");
.join("../../fixtures/schemas/augment_base_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand All @@ -1259,7 +1261,7 @@ mod tests {
]
});
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/augment_base_overlay/bootstrap");
.join("../../fixtures/schemas/augment_base_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand All @@ -1277,16 +1279,18 @@ mod tests {

#[test]
fn clickup_multi_step_pipeline_merges_fields_from_fixture_rows() {
let teams: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/clickup_schema_overlay/sample_team_query.json"
))
let teams: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/clickup_schema_overlay/sample_team_query.json"
)))
.expect("teams JSON");
let fields_a: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
))
let fields_a: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
)))
.expect("fields JSON");
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/clickup_schema_overlay/bootstrap");
.join("../../fixtures/schemas/clickup_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
base.validate().expect("clickup overlay fixture validates");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
Expand Down Expand Up @@ -1315,12 +1319,13 @@ mod tests {

#[test]
fn clickup_augment_base_fixture_sanitizes_field_names() {
let json: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
))
let json: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
)))
.expect("fixture JSON");
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/clickup_schema_overlay/bootstrap");
.join("../../fixtures/schemas/clickup_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand All @@ -1337,11 +1342,12 @@ mod tests {
#[test]
fn cgs_with_overlay_merges_and_validates() {
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/fibery_schema_overlay/bootstrap");
.join("../../fixtures/schemas/fibery_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let json: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
))
let json: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
)))
.expect("fixture JSON");
let spec = base.schema_overlay.as_ref().unwrap();
let overlay = build_schema_overlay(spec, &base, &json).expect("overlay");
Expand Down Expand Up @@ -1401,12 +1407,13 @@ mod tests {

#[test]
fn build_schema_overlay_jira_nested_createmeta() {
let json: JsonValue = serde_json::from_str(include_str!(
"../../../../fixtures/schemas/jira_schema_overlay/sample_createmeta.json"
))
let json: JsonValue = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/jira_schema_overlay/sample_createmeta.json"
)))
.expect("fixture JSON");
let base_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/jira_schema_overlay/bootstrap");
.join("../../fixtures/schemas/jira_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("load bootstrap fixture");
let spec = base.schema_overlay.as_ref().expect("schema_overlay spec");
let overlay = build_schema_overlay(spec, &base, &json).expect("build overlay");
Expand Down
55 changes: 31 additions & 24 deletions crates/plasm-runtime/src/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4329,11 +4329,12 @@ mod tests {
use plasm_core::schema_overlay::build_schema_overlay;

let base_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/fibery_schema_overlay/bootstrap");
.join("../../fixtures/schemas/fibery_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("bootstrap fixture");
let json: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
))
let json: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
)))
.expect("sample schema JSON");
let spec = base.schema_overlay.as_ref().unwrap();
let overlay = build_schema_overlay(spec, &base, &json).expect("overlay");
Expand All @@ -4357,11 +4358,12 @@ mod tests {
use plasm_core::schema_overlay::{build_decode_scope_key, build_schema_overlay};

let base_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/fibery_schema_overlay/bootstrap");
.join("../../fixtures/schemas/fibery_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("bootstrap fixture");
let json: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
))
let json: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
)))
.expect("sample schema JSON");
let spec = base.schema_overlay.as_ref().unwrap();
let overlay = build_schema_overlay(spec, &base, &json).expect("overlay");
Expand Down Expand Up @@ -4393,11 +4395,12 @@ mod tests {
use plasm_core::schema_overlay::build_schema_overlay;

let base_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../../fixtures/schemas/clickup_schema_overlay/bootstrap");
.join("../../fixtures/schemas/clickup_schema_overlay/bootstrap");
let base = load_schema_dir(&base_dir).expect("bootstrap fixture");
let json: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
))
let json: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/clickup_schema_overlay/sample_custom_field_query.json"
)))
.expect("sample custom field JSON");
let spec = base.schema_overlay.as_ref().unwrap();
let overlay = build_schema_overlay(spec, &base, &json).expect("overlay");
Expand Down Expand Up @@ -4427,9 +4430,10 @@ mod tests {
plasm_compile::CapabilityTemplate::Http(c) => c,
_ => panic!("expected HTTP template"),
};
let json: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
))
let json: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_schema_query.json"
)))
.expect("sample schema JSON");
let normalized = prepare_http_query_response(json, cml, &CmlEnv::new());
let decoder = create_entity_decoder_for_capability(
Expand Down Expand Up @@ -4458,9 +4462,10 @@ mod tests {
let cap = cgs.get_capability("user_get_me").expect("user_get_me");
let capability_template =
parse_capability_template(&cap.mapping.template).expect("parse template");
let body: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_user_get_me.json"
))
let body: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_user_get_me.json"
)))
.expect("sample user_get_me JSON");
let narrowed = narrow_http_graphql_response_for_entity_decode(&capability_template, body)
.expect("narrow user_get_me");
Expand Down Expand Up @@ -4500,9 +4505,10 @@ mod tests {
let cap = cgs.get_capability("entity_create").expect("entity_create");
let capability_template =
parse_capability_template(&cap.mapping.template).expect("parse template");
let body: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_entity_create.json"
))
let body: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_entity_create.json"
)))
.expect("sample entity_create JSON");
let narrowed = narrow_http_graphql_response_for_entity_decode(&capability_template, body)
.expect("narrow entity_create");
Expand Down Expand Up @@ -4644,9 +4650,10 @@ mod tests {
plasm_compile::CapabilityTemplate::Http(c) => c,
_ => panic!("expected HTTP template"),
};
let body: serde_json::Value = serde_json::from_str(include_str!(
"../../../../../fixtures/schemas/fibery_schema_overlay/sample_view_query.json"
))
let body: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/../../fixtures/schemas/fibery_schema_overlay/sample_view_query.json"
)))
.expect("sample view_query JSON");
let normalized = prepare_http_query_response(body, cml, &CmlEnv::new());
let decoder = create_entity_decoder_for_capability(
Expand Down
74 changes: 74 additions & 0 deletions fixtures/schemas/augment_base_overlay/bootstrap/domain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
version: 1
http_backend: https://api.clickup.com

schema_overlay:
source:
capability: custom_field_query
projection:
mode: augment_base
items_path:
- fields
entity:
from_template: Task
name:
template: Task
scope_key:
template: global
dynamic_fields:
from:
kind: array
path: []
wire_name_path:
- name
wire_type_path:
- type
name:
template: "{{ field.name | sanitize_identifier }}"
type_map:
text: nv_wire_str_short
number: nv_wire_int
default: nv_wire_str_short
extract:
kind: name_value_array
array_path:
- custom_fields
match_key_field: name
match_equals:
template: "{{ field.name }}"
value_field: value
decode:
scope:
params: []
key:
template: global
capabilities:
- task_get

entities:
Task:
id_field: id
description: ClickUp task (overlay augments with custom fields).
fields:
id:
required: true
value_ref: nv_wire_str_short
name:
required: false
value_ref: nv_wire_str_short

capabilities:
custom_field_query:
description: List workspace custom fields.
kind: query
entity: Task
task_get:
description: Get a task.
kind: get
entity: Task

values:
nv_wire_str_short:
type: string
string_semantics: short
nv_wire_int:
type: integer
21 changes: 21 additions & 0 deletions fixtures/schemas/augment_base_overlay/bootstrap/mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
custom_field_query:
method: GET
path:
- type: literal
value: v2
- type: literal
value: team
- type: var
name: team_id
- type: literal
value: field

task_get:
method: GET
path:
- type: literal
value: v2
- type: literal
value: task
- type: var
name: id
Loading
Loading