Skip to content

Commit b9b02c6

Browse files
hyperpolymathclaude
andcommitted
fix(build): rename duplicate bench_mod in build.zig; wire SOPS at-rest
- Rename `bench_mod` → `mcp_bench_mod` for the protocol-tests bench module (line 350) — shadowed the top-level benchmark binary name, causing `zig build` to fail in test-smoke path. - Add `.sops.yaml` with age creation rules matching estate standard (same public key as lcb-website). - Add `.env.example` documenting all env vars consumed by the bridge and cartridges (BOJ_URL, COORD_BACKEND_URL, all third-party keys). - Add `!.env.example` negation to .gitignore so the template is tracked despite the `.env.*` glob. - Update Trustfile.a2ml SECRETS_HYGIENE to record boj-server SOPS as DEPLOYED. - Minor .envrc / .gitignore housekeeping (quiet-mode flags, flake.lock). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4f729e7 commit b9b02c6

6 files changed

Lines changed: 94 additions & 14 deletions

File tree

.env.example

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
3+
#
4+
# Copy this file to .env and fill in real values.
5+
# .env is gitignored; this template is intentionally committed.
6+
# For at-rest encryption of real secret files use SOPS (see .sops.yaml).
7+
8+
# ── Core server endpoints ─────────────────────────────────────────────────────
9+
# REST API backend the MCP bridge forwards to (default: http://localhost:7700)
10+
BOJ_URL=http://localhost:7700
11+
12+
# Local coordinator backend URL (default: http://127.0.0.1:7745)
13+
COORD_BACKEND_URL=http://127.0.0.1:7745
14+
15+
# ── MCP bridge tunables ───────────────────────────────────────────────────────
16+
# Log level: trace | debug | info | warn | error (default: info)
17+
BOJ_LOG_LEVEL=info
18+
19+
# Max requests per minute per client (default: 60)
20+
BOJ_RATE_LIMIT=60
21+
22+
# Require Nickel schema validation for coordinator payloads: 0 | 1 (default: 0)
23+
COORD_REQUIRE_NICKEL=0
24+
25+
# ── Forge tokens (bridge + cartridges) ───────────────────────────────────────
26+
GITHUB_TOKEN=
27+
GITLAB_TOKEN=
28+
GITLAB_URL=https://gitlab.com
29+
30+
# ── Third-party API keys (cartridges) ────────────────────────────────────────
31+
AIRTABLE_API_KEY=
32+
ANTHROPIC_API_KEY=
33+
BUILDKITE_API_TOKEN=
34+
CF_API_TOKEN=
35+
CIRCLECI_TOKEN=
36+
CRATES_IO_TOKEN=
37+
DIGITALOCEAN_TOKEN=
38+
DOCKER_HUB_USERNAME=
39+
DOCKER_HUB_PASSWORD=
40+
DOCKER_HUB_TOKEN=
41+
FLY_API_TOKEN=
42+
GOOGLE_DOCS_ACCESS_TOKEN=
43+
GOOGLE_SHEETS_ACCESS_TOKEN=
44+
GRAFANA_API_TOKEN=
45+
GRAFANA_BASE_URL=
46+
HACKAGE_CREDENTIALS=
47+
HETZNER_API_TOKEN=
48+
HEX_API_KEY=
49+
LINODE_TOKEN=
50+
NPM_TOKEN=
51+
OBSIDIAN_REST_API_KEY=
52+
PROMETHEUS_BASE_URL=
53+
PROMETHEUS_TOKEN=
54+
PYPI_TOKEN=
55+
RAILWAY_TOKEN=
56+
RENDER_API_KEY=
57+
SENTRY_AUTH_TOKEN=
58+
SENTRY_BASE_URL=
59+
TODOIST_API_TOKEN=
60+
ZOTERO_API_KEY=

.envrc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
# Activate development environment
2+
# Activate development environment - QUIET MODE
33
# Install direnv: https://direnv.net/
44

5+
# Suppress direnv output
6+
export DIRENV_LOG_FORMAT=
7+
58
# Load .tool-versions if asdf is available
69
if has asdf; then
710
use asdf
811
fi
912

10-
# Load Guix shell if guix.scm exists
13+
# Load Guix shell if guix.scm exists (quiet mode)
1114
if has guix && [ -f guix.scm ]; then
12-
use guix
15+
use guix --quiet
1316
fi
1417

15-
# Load Nix flake if flake.nix exists
18+
# Load Nix flake if flake.nix exists (quiet mode)
1619
if has nix && [ -f flake.nix ]; then
17-
use flake
20+
use flake --quiet
1821
fi
1922

2023
# Project environment variables
2124
export PROJECT_NAME="Bundle of Joy Server"
2225
export RSR_TIER="infrastructure"
23-
# export DATABASE_URL="..."
24-
# export API_KEY="..."
2526

2627
# Source .env if it exists (gitignored)
2728
dotenv_if_exists
29+
30+
# Suppress guix locale warnings
31+
export GUIX_LOCPATH="${GUIX_LOCPATH:-$HOME/.guix-profile/lib/locale}"

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ __pycache__/
5353
/bin/
5454

5555
# Nix
56-
# flake.lock is ignored in the template repo because each project should
57-
# generate its own lock file on first use. In derived projects, REMOVE this
58-
# line and track flake.lock for reproducible builds.
59-
flake.lock
56+
# flake.lock is tracked in derived projects for reproducible builds.
57+
# flake.lock
6058

6159
# Haskell
6260
/.stack-work/
@@ -68,6 +66,7 @@ flake.lock
6866
# Secrets
6967
.env
7068
.env.*
69+
!.env.example
7170
*.pem
7271
*.key
7372
secrets/

.machine_readable/contractiles/trust/Trustfile.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ at_rest:
470470
- repo: "lcb-website"
471471
status: "DEPLOYED"
472472
- repo: "boj-server"
473-
status: "PENDING / runtime-only via Rokur"
473+
status: "DEPLOYED — .sops.yaml + .env.example wired 2026-04-25"
474474
pre_commit_hooks:
475475
- "gitleaks"
476476
- "plaintext detector"

.sops.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
3+
#
4+
# SOPS creation rules for boj-server.
5+
# Public age recipient below is safe to commit; only the matching secret key
6+
# (kept at ~/.config/sops/age/keys.txt, NEVER in this repo) can decrypt.
7+
#
8+
# Any file path matched by a rule below is auto-encrypted on `sops -e -i FILE`
9+
# and auto-decrypted on `sops -d FILE`.
10+
11+
creation_rules:
12+
# Convention: anything ending `.enc.yaml` / `.enc.json` / `.enc.env` is ciphertext.
13+
- path_regex: \.enc\.(ya?ml|json|toml|env)$
14+
age: age1jsaw33jj6gv75csgt0a0lyh8zufzyhzewv5308yccjenn8k34cgq4273pe
15+
# Convention: anything inside `secrets/` is ciphertext (belt + braces).
16+
- path_regex: secrets/.*\.(ya?ml|json|toml|env)$
17+
age: age1jsaw33jj6gv75csgt0a0lyh8zufzyhzewv5308yccjenn8k34cgq4273pe

ffi/zig/build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,12 @@ pub fn build(b: *std.Build) void {
347347
const p2p_tests = b.addTest(.{ .root_module = p2p_mod });
348348
const run_p2p = b.addRunArtifact(p2p_tests);
349349

350-
const bench_mod = b.createModule(.{
350+
const mcp_bench_mod = b.createModule(.{
351351
.root_source_file = b.path("../../tests/mcp_bench.zig"),
352352
.target = target,
353353
.optimize = optimize,
354354
});
355-
const bench_tests = b.addTest(.{ .root_module = bench_mod });
355+
const bench_tests = b.addTest(.{ .root_module = mcp_bench_mod });
356356
const run_bench = b.addRunArtifact(bench_tests);
357357

358358
const protocol_step = b.step("protocol-tests", "Run protocol-layer Zig tests");

0 commit comments

Comments
 (0)