Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(build): retain embedded Deno assets in deployment sources (#8177)

Wolf Mermelsteinff9aefc583d0
diff --git a/.github/workflows/code_check_cloud_storage.yml b/.github/workflows/code_check_cloud_storage.yml
index b1c2eadabe..04a71023bf 100644
--- a/.github/workflows/code_check_cloud_storage.yml
+++ b/.github/workflows/code_check_cloud_storage.yml
@@ -282,6 +282,8 @@ jobs:
else
echo "::warning::Namespace remote sccache setup failed; using local cache fallback"
fi
+ - name: Check embedded code execution assets
+ run: nix build --no-link .#checks.x86_64-linux.code-execution-assets
- name: fmt
run: cargo fmt --check
- name: clippy
diff --git a/docs/development/infrastructure.md b/docs/development/infrastructure.md
index de0fed23c1..0575f88489 100644
--- a/docs/development/infrastructure.md
+++ b/docs/development/infrastructure.md
@@ -117,6 +117,15 @@ specifically:
must live in Pulumi itself.
- Never resolve `secretString` into a plaintext env var.
+## Embedded build assets
+
+Deployment builds use the filtered source in `nix/cloud-storage.nix`, rather than
+an entire checkout. Include any new `include_str!` or `include_bytes!` assets in
+its source filter. The `code-execution-assets` Nix check verifies that the Deno
+bootstrap, SDK and Handlebars bundles survive both the workspace filter and the
+pruned agent-harness deployment source; Rust CI runs this check before clippy.
+Run it locally with `nix build --no-link .#checks.x86_64-linux.code-execution-assets`.
+
## Other resources
| Need | Use | Example |
diff --git a/nix/cloud-storage.nix b/nix/cloud-storage.nix
index f128d44d27..30124503d4 100644
--- a/nix/cloud-storage.nix
+++ b/nix/cloud-storage.nix
@@ -57,8 +57,11 @@
# `.ttf` and `.xml` for the fonts and preset shape definitions that
# `crates/pptx_engine` embeds with `include_bytes!`; `.graphql` for the
# `static_assets/schema.graphql` that `cache-core`'s build script reads;
- # `.jsonl` for the recorded sessions `agent_fold` tests embed.
- assetFilter = path: _type: builtins.match ".*\\.(md|html|txt|json|jsonl|canvas|sql|sh|ttf|xml|graphql)$" path != null;
+ # `.jsonl` for the recorded sessions `agent_fold` tests embed; `.mjs`
+ # for the Deno bootstrap and bundled public SDK/Handlebars runtime.
+ assetFilter =
+ path: _type:
+ builtins.match ".*\\.(md|html|txt|json|jsonl|canvas|sql|sh|ttf|xml|graphql|mjs)$" path != null;
# Rust local HTTP clients embed only the public proxy CA, never its keys.
localCaFilter = path: _type: pkgs.lib.hasSuffix "/infra/local/certs/ca.pem" (toString path);
binFilter = path: _type: builtins.match ".*\\.bin$" path != null;
@@ -960,6 +963,14 @@
in
{
checks = {
+ code-execution-assets = pkgs.runCommand "cloud-storage-code-execution-assets" { } ''
+ for source in ${src} ${prunedDeploySrc "service-agent-harness-service" "agent_harness_service"}; do
+ for asset in bootstrap.mjs sdk.mjs handlebars.mjs; do
+ test -s "$source/crates/code_execution/src/outbound/deno/$asset"
+ done
+ done
+ touch $out
+ '';
fmt = craneLib.cargoFmt {
inherit src;
pname = "cloud-storage";
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
index 74b241802e..23ea769b83 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/code_check_cloud_storage.rs
@@ -99,6 +99,10 @@ fn check() -> Job {
.add_step(steps::setup_nix())
.add_step(steps::setup_dev_shell())
.add_step(steps::configure_namespace_sccache(vars::CI_SCCACHE_NAME))
+ .add_step(
+ Step::new("Check embedded code execution assets")
+ .run("nix build --no-link .#checks.x86_64-linux.code-execution-assets"),
+ )
.add_step(cargo_fmt())
.add_step(cargo_clippy())
.add_step(steps::show_sccache_stats())