Skip to content

Commit f108199

Browse files
hyperpolymathclaude
andcommitted
chore: complete Ecto removal — delete schemas, repo, migrations
Linter cleanup from VeriSimDB migration: remove Repo module, 3 Ecto schemas (Stack, User, UserSettings), 3 migrations, update auth.ex, native_bridge.ex, settings_store.ex, mix.lock to drop Ecto references. Application.ex and client.ex path adjustments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3c58693 commit f108199

13 files changed

Lines changed: 24 additions & 200 deletions

backend/lib/stapeln/application.ex

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
12
defmodule Stapeln.Application do
23
# See https://hexdocs.pm/elixir/Application.html
34
# for more information on OTP Applications
@@ -7,22 +8,18 @@ defmodule Stapeln.Application do
78

89
@impl true
910
def start(_type, _args) do
10-
children =
11-
[
12-
StapelnWeb.Telemetry,
13-
{DNSCluster, query: Application.get_env(:stapeln, :dns_cluster_query) || :ignore},
14-
{Phoenix.PubSub, name: Stapeln.PubSub},
15-
Stapeln.StackStore,
16-
Stapeln.PipelineStore,
17-
Stapeln.Auth.UserStore,
18-
Stapeln.SettingsStore,
19-
Stapeln.Firewall.PinholeManager,
20-
{Task.Supervisor, name: Stapeln.TaskSupervisor},
21-
# Start a worker by calling: Stapeln.Worker.start_link(arg)
22-
# {Stapeln.Worker, arg},
23-
# Start to serve requests, typically the last entry
24-
StapelnWeb.Endpoint
25-
]
11+
children = [
12+
StapelnWeb.Telemetry,
13+
{DNSCluster, query: Application.get_env(:stapeln, :dns_cluster_query) || :ignore},
14+
{Phoenix.PubSub, name: Stapeln.PubSub},
15+
Stapeln.StackStore,
16+
Stapeln.PipelineStore,
17+
Stapeln.Auth.UserStore,
18+
Stapeln.SettingsStore,
19+
Stapeln.Firewall.PinholeManager,
20+
{Task.Supervisor, name: Stapeln.TaskSupervisor},
21+
StapelnWeb.Endpoint
22+
]
2623

2724
# See https://hexdocs.pm/elixir/Supervisor.html
2825
# for other strategies and supported options

backend/lib/stapeln/auth.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ defmodule Stapeln.Auth do
55
@moduledoc """
66
Authentication context.
77
8-
Tries Ecto-backed `Stapeln.DbStore` when PostgreSQL is available, and
9-
falls back to in-memory `UserStore` otherwise.
8+
Tries `Stapeln.DbStore` (VeriSimDB) when available, and falls back to
9+
in-memory `UserStore` otherwise.
1010
1111
Passwords are hashed with :crypto.hash/2 (SHA-256). For production,
1212
swap to bcrypt/argon2.

backend/lib/stapeln/native_bridge.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
12
defmodule Stapeln.NativeBridge do
23
@moduledoc """
34
Single API boundary for ABI/FFI interaction.
@@ -7,8 +8,8 @@ defmodule Stapeln.NativeBridge do
78
- Zig FFI implementation: `ffi/zig/src/main.zig`
89
910
If `STAPELN_NATIVE_FFI_BIN` points to an executable, this module calls it.
10-
Otherwise it tries Ecto-backed `Stapeln.DbStore` (PostgreSQL), and finally
11-
falls back to in-memory GenServer stores.
11+
Otherwise it tries `Stapeln.DbStore` (VeriSimDB), and finally falls back
12+
to in-memory GenServer stores.
1213
"""
1314

1415
alias Stapeln.DbStore

backend/lib/stapeln/repo.ex

Lines changed: 0 additions & 14 deletions
This file was deleted.

backend/lib/stapeln/schemas/stack.ex

Lines changed: 0 additions & 34 deletions
This file was deleted.

backend/lib/stapeln/schemas/user.ex

Lines changed: 0 additions & 35 deletions
This file was deleted.

backend/lib/stapeln/schemas/user_settings.ex

Lines changed: 0 additions & 34 deletions
This file was deleted.

backend/lib/stapeln/settings_store.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ defmodule Stapeln.SettingsStore do
55
@moduledoc """
66
In-memory settings store backed by a GenServer.
77
8-
Tries Ecto-backed `Stapeln.DbStore` when PostgreSQL is available, and
9-
falls back to the GenServer state otherwise.
8+
Tries `Stapeln.DbStore` (VeriSimDB) when available, and falls back to
9+
the GenServer state otherwise.
1010
1111
Settings persist to /tmp/stapeln-settings.json for dev convenience.
1212
"""

backend/lib/stapeln/verisimdb/client.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ defmodule Stapeln.VeriSimDB.Client do
1212
local storage.
1313
"""
1414

15-
@write_path "/api/v1/audit"
16-
@query_path "/api/v1/audit"
15+
@write_path "/audit"
16+
@query_path "/audit"
1717
@default_connect_timeout 5_000
1818
@default_receive_timeout 10_000
1919

@@ -48,7 +48,7 @@ defmodule Stapeln.VeriSimDB.Client do
4848
@spec health_check() :: :ok | {:error, term()}
4949
def health_check do
5050
with {:ok, base_url} <- verisimdb_url() do
51-
case get(base_url <> "/api/v1/health") do
51+
case get(base_url <> "/health") do
5252
{:ok, %{status: status}} when status in 200..299 -> :ok
5353
{:ok, %{status: status}} -> {:error, {:verisimdb_status, status}}
5454
{:error, reason} -> {:error, {:verisimdb_request, reason}}
@@ -112,7 +112,7 @@ defmodule Stapeln.VeriSimDB.Client do
112112
# Generic Octad CRUD (for data storage, not just audit)
113113
# ---------------------------------------------------------------------------
114114

115-
@octad_path "/api/v1/octads"
115+
@octad_path "/octads"
116116

117117
@doc """
118118
Create a new octad entity.

backend/mix.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
"bandit": {:hex, :bandit, "1.10.2", "d15ea32eb853b5b42b965b24221eb045462b2ba9aff9a0bda71157c06338cbff", [:mix], [{:hpax, "~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "27b2a61b647914b1726c2ced3601473be5f7aa6bb468564a688646a689b3ee45"},
55
"cowboy": {:hex, :cowboy, "2.14.2", "4008be1df6ade45e4f2a4e9e2d22b36d0b5aba4e20b0a0d7049e28d124e34847", [:make, :rebar3], [{:cowlib, ">= 2.16.0 and < 3.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, ">= 1.8.0 and < 3.0.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "569081da046e7b41b5df36aa359be71a0c8874e5b9cff6f747073fc57baf1ab9"},
66
"cowlib": {:hex, :cowlib, "2.16.0", "54592074ebbbb92ee4746c8a8846e5605052f29309d3a873468d76cdf932076f", [:make, :rebar3], [], "hexpm", "7f478d80d66b747344f0ea7708c187645cfcc08b11aa424632f78e25bf05db51"},
7-
"db_connection": {:hex, :db_connection, "2.9.0", "a6a97c5c958a2d7091a58a9be40caf41ab496b0701d21e1d1abff3fa27a7f371", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "17d502eacaf61829db98facf6f20808ed33da6ccf495354a41e64fe42f9c509c"},
8-
"decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"},
97
"dns_cluster": {:hex, :dns_cluster, "0.2.0", "aa8eb46e3bd0326bd67b84790c561733b25c5ba2fe3c7e36f28e88f384ebcb33", [:mix], [], "hexpm", "ba6f1893411c69c01b9e8e8f772062535a4cf70f3f35bcc964a324078d8c8240"},
10-
"ecto": {:hex, :ecto, "3.13.5", "9d4a69700183f33bf97208294768e561f5c7f1ecf417e0fa1006e4a91713a834", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df9efebf70cf94142739ba357499661ef5dbb559ef902b68ea1f3c1fabce36de"},
11-
"ecto_sql": {:hex, :ecto_sql, "3.13.5", "2f8282b2ad97bf0f0d3217ea0a6fff320ead9e2f8770f810141189d182dc304e", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aa36751f4e6a2b56ae79efb0e088042e010ff4935fc8684e74c23b1f49e25fdc"},
128
"expo": {:hex, :expo, "1.1.1", "4202e1d2ca6e2b3b63e02f69cfe0a404f77702b041d02b58597c00992b601db5", [:mix], [], "hexpm", "5fb308b9cb359ae200b7e23d37c76978673aa1b06e2b3075d814ce12c5811640"},
139
"finch": {:hex, :finch, "0.21.0", "b1c3b2d48af02d0c66d2a9ebfb5622be5c5ecd62937cf79a88a7f98d48a8290c", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.6.2 or ~> 1.7", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 1.1", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "87dc6e169794cb2570f75841a19da99cfde834249568f2a5b121b809588a4377"},
1410
"flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"},
@@ -29,7 +25,6 @@
2925
"phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
3026
"plug": {:hex, :plug, "1.19.1", "09bac17ae7a001a68ae393658aa23c7e38782be5c5c00c80be82901262c394c0", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "560a0017a8f6d5d30146916862aaf9300b7280063651dd7e532b8be168511e62"},
3127
"plug_crypto": {:hex, :plug_crypto, "2.1.1", "19bda8184399cb24afa10be734f84a16ea0a2bc65054e23a62bb10f06bc89491", [:mix], [], "hexpm", "6470bce6ffe41c8bd497612ffde1a7e4af67f36a15eea5f921af71cf3e11247c"},
32-
"postgrex": {:hex, :postgrex, "0.22.0", "fb027b58b6eab1f6de5396a2abcdaaeb168f9ed4eccbb594e6ac393b02078cbd", [:mix], [{:db_connection, "~> 2.9", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a68c4261e299597909e03e6f8ff5a13876f5caadaddd0d23af0d0a61afcc5d84"},
3328
"protobuf": {:hex, :protobuf, "0.16.0", "d1878725105d49162977cf3408ccc3eac4f3532e26e5a9e250f2c624175d10f6", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "f0d0d3edd8768130f24cc2cfc41320637d32c80110e80d13f160fa699102c828"},
3429
"ranch": {:hex, :ranch, "2.2.0", "25528f82bc8d7c6152c57666ca99ec716510fe0925cb188172f41ce93117b1b0", [:make, :rebar3], [], "hexpm", "fa0b99a1780c80218a4197a59ea8d3bdae32fbff7e88527d7d8a4787eff4f8e7"},
3530
"req": {:hex, :req, "0.5.17", "0096ddd5b0ed6f576a03dde4b158a0c727215b15d2795e59e0916c6971066ede", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 2.0.6 or ~> 2.1", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "0b8bc6ffdfebbc07968e59d3ff96d52f2202d0536f10fef4dc11dc02a2a43e39"},

0 commit comments

Comments
 (0)