Skip to content

Library core, conformance test, and cross-platform CI - #1

Merged
jeffreyaven merged 5 commits into
mainfrom
feature/library-core-and-ci
Jun 13, 2026
Merged

Library core, conformance test, and cross-platform CI#1
jeffreyaven merged 5 commits into
mainfrom
feature/library-core-and-ci

Conversation

@jeffreyaven

Copy link
Copy Markdown
Member

Scaffolds the stackql_mcp Hex package (the Gleam / BEAM member of the StackQL embedded-MCP family) and stands up CI.

What this adds

Library core (Erlang target only for v1 - the strategic thesis is the BEAM):

  • platform - shared family cache path + platform-key resolution (~/.stackql/mcp-server-bin/<version>/<platform-key>/)
  • launch - canonical, cwd-independent argv (mandatory --approot)
  • mode - ReadOnly default; safe/delete_safe/full_access are explicit opt-ins
  • auth - provider auth descriptors incl. the github null_auth fixture
  • stackql_mcp - Config/default_config, resolve_command, start/list_tools/call_tool/stop, and child_spec for the BEAM-native supervised path (mcp_client 0.1.x owns the subprocess and JSON-RPC framing)

Tests (gleeunit):

  • Unit: launch-arg shape, cache-path layout, platform keys, resolve_command env precedence, auth rendering - all run with no stackql binary present
  • Conformance: the family handshake (initialize -> tools/list -> pull github null_auth -> list_services), self-gated on STACKQL_MCP_BIN so it logs+passes with no binary and runs for real in CI

CI: GitHub Actions matrix (ubuntu + macos + windows) running gleam format --check, gleam check, gleam test. Triggers on pull_request to main (this PR) and push to main (merge). Windows is in the matrix deliberately - Erlang ports there have sharp edges.

Notes

  • No local Gleam/Erlang toolchain was available, so this PR's CI run is the first real compile/format/test of the code. Expect to iterate on any compiler findings here before merge.
  • pipewatch demo and the extracted minimal Anthropic client are follow-up milestones.

[Generated with Claude Code]

jeffreyaven and others added 5 commits June 13, 2026 19:48
Scaffold the stackql_mcp Hex package: the embedded StackQL MCP server for
Gleam / BEAM. Erlang target only for v1 (the strategic thesis is the BEAM;
the JS target would just be a worse npm wrapper).

Library core:
- platform: shared cache path + platform-key resolution (the cross-family
  contract: ~/.stackql/mcp-server-bin/<version>/<platform-key>/)
- launch: canonical, cwd-independent argv (--approot is mandatory)
- mode: ReadOnly default; safe/delete_safe/full_access are explicit opt-ins
- auth: provider auth descriptors incl. the github null_auth fixture
- stackql_mcp: Config/default_config, resolve_command, start/list_tools/
  call_tool/stop, and child_spec for the BEAM-native supervised path
- mcp_client (0.1.x) owns the subprocess and JSON-RPC framing; this module
  builds the argv and wires the session

Tests (gleeunit):
- unit: launch-arg shape, cache-path layout, platform keys, resolve_command
  env precedence, auth rendering - all run with no stackql binary present
- conformance: the family handshake (initialize -> tools/list ->
  pull github null_auth -> list_services), self-gated on STACKQL_MCP_BIN so
  it logs and passes when no binary is available and runs for real in CI

CI: GitHub Actions matrix (ubuntu + macos + windows) running
gleam format --check, gleam check, gleam test. Triggers on pull_request to
main (PR raise/update) and push to main (merge). Windows is in the matrix
deliberately - Erlang ports there have sharp edges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
First CI run surfaced two issues:
- mcp_client 0.1.x requires gleam_json >= 3.0.0; the previous < 3.0.0 pin
  made dependency resolution unsatisfiable. Track the 3.x major.
- erlef/setup-beam@v1 could not map the new win25-vs2026 runner image
  ("Tried to map a target OS from env. variable 'ImageOS'... but failed").
  Pin to @v1.24.0, which supports win25.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Second CI run surfaced:
- gleam format --check failed: canonicalize all src/test with gleam format.
- setup-beam still could not map the windows-latest ImageOS
  (win25-vs2026). Pin the Windows matrix leg to windows-2022 (ImageOS
  win22), which the action maps. Revisit when setup-beam supports win25.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Third CI run surfaced:
- Type check failed: `mcp_client.ServerConfig is a type constructor, it
  cannot be used as a value`. The value constructor lives in
  mcp_client/manager (mcp_client only re-exports the type alias). Construct
  manager.ServerConfig with manager.NoRetry.
- Windows format --check failed because the runner checks out CRLF
  (core.autocrlf=true) while gleam format emits LF. Add .gitattributes
  pinning .gleam/.erl/.toml/.yml/.md to eol=lf so the check is stable
  cross-platform.

Verified locally with gleam 1.17.0: gleam format --check passes; deps
resolve to gleam_json 3.1.0 / mcp_client 0.1.0 / envoy 1.2.0. (gleam check
needs Erlang, which is not installed locally - CI compiles.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gleam generated the lockfile pinning the resolved versions (gleam_json
3.1.0, mcp_client 0.1.0, envoy 1.2.0, gleam_stdlib 1.0.3, etc.). The file
itself instructs that it be checked in; doing so keeps CI from re-resolving
and matches the family stance of pinning every dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeffreyaven
jeffreyaven merged commit 6a10d1a into main Jun 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant