Skip to content

BE-783: Wire the atlas into the graph CLI, API proxy, and embedding workflows - #9306

Open
indietyp wants to merge 2 commits into
bm/be-782-atlas-fit-2d-semantic-maps-over-graph-entities-and-servefrom
bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding
Open

BE-783: Wire the atlas into the graph CLI, API proxy, and embedding workflows#9306
indietyp wants to merge 2 commits into
bm/be-782-atlas-fit-2d-semantic-maps-over-graph-entities-and-servefrom
bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding

Conversation

@indietyp

@indietyp indietyp commented Aug 24, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Wires the atlas into the running system. hash-graph gains an atlas subcommand (fit, serve) and hash-api gains an authenticated proxy in front of the atlas server plus a cluster-entities primitive. The compose stack gains the atlas service, and the embedding workflow keeps fitted maps fed with fresh embeddings.

Secret handling refuses before it runs: the compose service interpolates HASH_GRAPH_ATLAS_SECRET with :?, so a compose without the secret refuses to start rather than starting open. The service is profile-hidden, and default compose invocations are unchanged.

The release profile moves to lto = "thin". At fat, the release image build was killed on the 16 GB arm runner (signal 9), and thin fits in its memory.

Review focus: the proxy as the auth boundary. Every path to the atlas service passes the proxy's authentication, and the secret stays out of logs and error bodies. Both are worth verifying.

🔍 What does this change?

  • apps/hash-graph: the atlas subcommand (subcommand/atlas.rs), with create_temporal_client widened to pub(crate) in server.rs.
  • apps/hash-api: atlas-proxy.ts and its tests, cluster-entities.ts, router registration in index.ts.
  • infra/compose/compose.yml: the atlas service, profile-hidden, with the :? secret refusal, Postgres env, and a generations volume.
  • .env and .env.development: atlas host and port, the dev secret.
  • .github/workflows/{bench,test}.yml: COMPOSE_ENV_FILES, so CI's compose reads the same env files the yarn scripts feed it.
  • libs/@local/graph/embeddings: a memory-footprint example.
  • Root Cargo.toml: lto = "thin".
  • Dependency diagrams and yarn.lock regenerated.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

🛡 What tests cover this?

  • atlas-proxy.test.ts: 11 tests (build @local/hash-backend-utils first in a fresh tree, the package resolves through dist/).
  • hash-api type-checks clean (lint:tsc).
  • Compose control and treatment: docker compose config refuses without the secret and interpolates it exactly once with it.
  • hash-graph atlas --help and atlas fit --help parse.
  • Workspace battery: cargo check, clippy at zero warnings across targets and features, fmt clean, sync:turborepo zero drift.

❓ How to test this?

cargo run -p hash-graph -- atlas --help
docker compose -f infra/compose/compose.yml --profile '*' config   # refuses without HASH_GRAPH_ATLAS_SECRET

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 27, 2026 3:27pm
petrinaut Ready Ready Preview Aug 27, 2026 3:27pm
petrinaut-docs Ready Ready Preview Aug 27, 2026 3:27pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 27, 2026 3:27pm

Request Review

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps > hash* Affects HASH (a `hash-*` app) area/infra Relates to version control, CI, CD or IaC (area) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests area/apps area/apps > hash-graph labels Aug 24, 2026
Comment thread .env.development
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.77%. Comparing base (d969b6c) to head (3fbfc66).

Files with missing lines Patch % Lines
.../src/graph/knowledge/primitive/cluster-entities.ts 0.00% 7 Missing ⚠️
apps/hash-api/src/atlas-proxy.ts 78.26% 5 Missing ⚠️
Additional details and impacted files
@@                                          Coverage Diff                                           @@
##           bm/be-782-atlas-fit-2d-semantic-maps-over-graph-entities-and-serve    #9306      +/-   ##
======================================================================================================
+ Coverage                                                               60.74%   60.77%   +0.02%     
======================================================================================================
  Files                                                                    1440     1443       +3     
  Lines                                                                  143477   143624     +147     
  Branches                                                                 6662     6665       +3     
======================================================================================================
+ Hits                                                                    87156    87281     +125     
- Misses                                                                  55229    55252      +23     
+ Partials                                                                 1092     1091       -1     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 14.92% <60.00%> (+0.23%) ⬆️
blockprotocol.type-system 40.84% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.hash-graph-api 24.95% <ø> (ø)
rust.hash-graph-authorization 63.14% <ø> (ø)
rust.hash-graph-postgres-store 32.02% <ø> (+0.30%) ⬆️
rust.hash-graph-temporal-versioning 50.18% <ø> (ø)
rust.hashql-ast 89.63% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)
rust.hashql-mir 87.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 98 untouched benchmarks


Comparing bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding (3fbfc66) with bm/be-782-atlas-fit-2d-semantic-maps-over-graph-entities-and-serve (4566457)1

Open in CodSpeed

Footnotes

  1. No successful run was found on bm/be-782-atlas-fit-2d-semantic-maps-over-graph-entities-and-serve (d969b6c) during the generation of this report, so f6b5dd5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@indietyp
indietyp requested a review from a team as a code owner August 25, 2026 10:57
@indietyp
indietyp force-pushed the bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding branch from 41dc1fa to 6a19553 Compare August 25, 2026 10:57
@indietyp
indietyp deployed to pull-request August 25, 2026 10:57 — with GitHub Actions Active
@indietyp
indietyp deployed to pull-request August 25, 2026 10:57 — with GitHub Actions Active
@indietyp
indietyp force-pushed the bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding branch from 6a19553 to a0621e7 Compare August 25, 2026 11:14
@indietyp
indietyp deployed to pull-request August 25, 2026 11:16 — with GitHub Actions Active
@indietyp
indietyp deployed to pull-request August 25, 2026 11:16 — with GitHub Actions Active
@indietyp
indietyp force-pushed the bm/be-783-wire-the-atlas-into-the-graph-cli-api-proxy-and-embedding branch from a0621e7 to 15526e4 Compare August 26, 2026 12:24
@indietyp
indietyp deployed to pull-request August 26, 2026 12:25 — with GitHub Actions Active
@indietyp
indietyp deployed to pull-request August 26, 2026 12:25 — with GitHub Actions Active
Comment thread infra/compose/compose.yml
Comment on lines +677 to +680
# No fallback: the atlas refuses to serve without a configured secret.
# The development stack sets one in .env.development; production supplies
# its own 64-hex-character value (openssl rand -hex 32).
HASH_GRAPH_ATLAS_SECRET: "${HASH_GRAPH_ATLAS_SECRET:?set HASH_GRAPH_ATLAS_SECRET to 64 hex characters, e.g. openssl rand -hex 32}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we follow the same pattern we have everywhere else?

Comment thread .env.development
FILE_UPLOAD_PROVIDER="AWS_S3"

# Development only dev secret for atlas
HASH_GRAPH_ATLAS_SECRET=de70de70de70de70de70de70de70de70de70de70de70de70de70de70de70de70

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just use a simple feature as we do with every other service in .env. The solution is not great and I'm working on a configuration crate to solve this, but until then, it keeps things simple. The .env file is not used in production. If we desperately want these, we can generate one and put them in .env.local

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you mean we should put it in .env? I just wanted to make sure that someone doesn't accidentally deploy it with a default secret; hence this and the other changes. If you want to, I can also put it into .env no problem.

Comment on lines +13 to +16
# The dev values compose interpolation needs (e.g. HASH_GRAPH_ATLAS_SECRET, which compose
# refuses to run without). The yarn `compose` script passes these files explicitly, and the
# raw `docker compose` invocations below read them through this variable instead.
COMPOSE_ENV_FILES: ${{ github.workspace }}/.env,${{ github.workspace }}/.env.development

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the two changes above, we don't need this:

Suggested change
# The dev values compose interpolation needs (e.g. HASH_GRAPH_ATLAS_SECRET, which compose
# refuses to run without). The yarn `compose` script passes these files explicitly, and the
# raw `docker compose` invocations below read them through this variable instead.
COMPOSE_ENV_FILES: ${{ github.workspace }}/.env,${{ github.workspace }}/.env.development

I also don't see where it's used in the first place.

Comment on lines +15 to +18
# The dev values compose interpolation needs (e.g. HASH_GRAPH_ATLAS_SECRET, which compose
# refuses to run without). The yarn `compose` script passes these files explicitly, and the
# raw `docker compose` invocations below read them through this variable instead.
COMPOSE_ENV_FILES: ${{ github.workspace }}/.env,${{ github.workspace }}/.env.development

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the two changes above, we don't need this:

Suggested change
# The dev values compose interpolation needs (e.g. HASH_GRAPH_ATLAS_SECRET, which compose
# refuses to run without). The yarn `compose` script passes these files explicitly, and the
# raw `docker compose` invocations below read them through this variable instead.
COMPOSE_ENV_FILES: ${{ github.workspace }}/.env,${{ github.workspace }}/.env.development

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

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps > hash-graph area/apps area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants