Skip to content

The open-source agent harness - the runtime layer that turns an LLM into a working agent.

AGE-1686: Move Fern project to .github/fern (#129)

Bhavesh Patel189e3bb5c65d
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 7dd04a06e..546313934 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -16,5 +16,5 @@ Closes #
- [ ] `pnpm build`, `pnpm test`, `pnpm typecheck`, `pnpm lint:ci`, and `pnpm format:check` pass locally
- [ ] Tests added/updated where it makes sense
-- [ ] No hand-edits to generated code (`packages/sdk`, `fern/openapi/openapi.json`)
+- [ ] No hand-edits to generated code (`packages/sdk`, `.github/fern/openapi/openapi.json`)
- [ ] Docs / `.env.example` updated if configuration or behavior changed
diff --git a/fern/.gitignore b/.github/fern/.gitignore
similarity index 100%
rename from fern/.gitignore
rename to .github/fern/.gitignore
diff --git a/fern/README.md b/.github/fern/README.md
similarity index 100%
rename from fern/README.md
rename to .github/fern/README.md
diff --git a/fern/fern.config.json b/.github/fern/fern.config.json
similarity index 100%
rename from fern/fern.config.json
rename to .github/fern/fern.config.json
diff --git a/fern/generators.yml b/.github/fern/generators.yml
similarity index 98%
rename from fern/generators.yml
rename to .github/fern/generators.yml
index 9f786a54a..65af56857 100644
--- a/fern/generators.yml
+++ b/.github/fern/generators.yml
@@ -38,7 +38,7 @@ groups:
version: 3.87.1
output:
location: local-file-system
- path: ../packages/sdk
+ path: ../../packages/sdk
config:
packageJson:
name: trueforge-sdk
diff --git a/fern/openapi/openapi.json b/.github/fern/openapi/openapi.json
similarity index 100%
rename from fern/openapi/openapi.json
rename to .github/fern/openapi/openapi.json
diff --git a/.github/workflows/generate-sdk.yaml b/.github/workflows/generate-sdk.yaml
index f3b1eef79..cedbfc351 100644
--- a/.github/workflows/generate-sdk.yaml
+++ b/.github/workflows/generate-sdk.yaml
@@ -9,7 +9,7 @@ on:
- 'packages/server/src/**'
- 'packages/server/scripts/**'
- 'packages/harness/src/**'
- - 'fern/**'
+ - '.github/fern/**'
- '.github/workflows/generate-sdk.yaml'
pull_request:
types: [opened, synchronize, reopened]
@@ -17,7 +17,7 @@ on:
- 'packages/server/src/**'
- 'packages/server/scripts/**'
- 'packages/harness/src/**'
- - 'fern/**'
+ - '.github/fern/**'
- '.github/workflows/generate-sdk.yaml'
concurrency:
@@ -74,12 +74,12 @@ jobs:
set -euo pipefail
reason=""
- if [ -n "$(git status --porcelain -- fern/openapi/openapi.json)" ]; then
+ if [ -n "$(git status --porcelain -- .github/fern/openapi/openapi.json)" ]; then
reason="the OpenAPI document changed"
elif ! git rev-parse --verify --quiet "${BASE_SHA}^{commit}" >/dev/null; then
# A branch's first push reports an all-zero base commit.
reason="there is no base commit to compare against"
- elif ! git diff --quiet "$BASE_SHA" HEAD -- fern/generators.yml fern/fern.config.json; then
+ elif ! git diff --quiet "$BASE_SHA" HEAD -- .github/fern/generators.yml .github/fern/fern.config.json; then
reason="the generator config changed"
fi
@@ -106,14 +106,14 @@ jobs:
set -euo pipefail
# --porcelain, not `git diff`, so new files count too.
- if [ -z "$(git status --porcelain -- fern/openapi packages/sdk)" ]; then
+ if [ -z "$(git status --porcelain -- .github/fern/openapi packages/sdk)" ]; then
echo "OpenAPI document and SDK are already up to date."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- git add fern/openapi packages/sdk
+ git add .github/fern/openapi packages/sdk
git commit -m "Regenerate OpenAPI document and TypeScript SDK"
git push origin "HEAD:refs/heads/$BRANCH"
diff --git a/.prettierignore b/.prettierignore
index 5ec04f11b..a669a8e5d 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -2,7 +2,7 @@ node_modules/
dist/
# Fern-generated: formatted by the generator, not by this repo's config.
packages/sdk/
-fern/openapi/
+.github/fern/openapi/
# Helm chart sources and downloaded Bitnami subcharts; not ours to reformat.
charts/
coverage/
diff --git a/AGENTS.md b/AGENTS.md
index 19410bb66..9017125d7 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -10,7 +10,7 @@
- A change that makes code unused MUST remove that dead code in the same change; it MUST NOT leave stale exports, files, documentation, duplicates, or “just in case” shims.
- Comments MUST explain intent, trade-offs, or constraints and remain concise; they MUST NOT restate the code or include issue-tracker IDs.
- Every nested `AGENTS.md` MUST have a sibling `CLAUDE.md` containing only `@AGENTS.md`, so Cursor and Claude Code load the same scoped rules.
-- OpenAPI spec under `fern/openapi/openapi.json` is autogenerated in CI and MUST NOT be edited manually
+- OpenAPI spec under `.github/fern/openapi/openapi.json` is autogenerated in CI and MUST NOT be edited manually
- Code under `packages/sdk` is autogenerated in CI and MUST NOT be edited manually
- Tests MUST live under a top-level `test` directory that mirrors the `src` layout; they MUST NOT be inlined under `src`.
- Functions with more than one parameter of the same type MUST take a single options object (e.g. `f({ a, b }: { a: string; b: string })`); they MUST NOT use multiple positional parameters of that repeated type (e.g. `f(a: string, b: string)`).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a4d7b5601..371ed079a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -176,7 +176,7 @@ Open [http://localhost:8791](http://localhost:8791). Credentials come from `pack
## Generated code — do not edit by hand
-- [`packages/sdk`](packages/sdk) and [`fern/openapi/openapi.json`](fern/openapi/openapi.json) are generated by [Fern](https://buildwithfern.com) and committed. Edit route handlers under `packages/server/src/routes/` instead; CI regenerates the outputs. To regenerate locally (Docker required): `pnpm sdk:generate`.
+- [`packages/sdk`](packages/sdk) and [`.github/fern/openapi/openapi.json`](.github/fern/openapi/openapi.json) are generated by [Fern](https://buildwithfern.com) and committed. Edit route handlers under `packages/server/src/routes/` instead; CI regenerates the outputs. To regenerate locally (Docker required): `pnpm sdk:generate`.
- Catalog YAML files under `packages/server/src/catalog/` are inlined at build time by `build:gen` scripts.
## Server entry points
diff --git a/packages/sdk/.fern/metadata.json b/packages/sdk/.fern/metadata.json
index bba644e85..98867912b 100644
--- a/packages/sdk/.fern/metadata.json
+++ b/packages/sdk/.fern/metadata.json
@@ -27,9 +27,6 @@
"streamType": "web",
"useDefaultRequestParameterValues": true
},
- "originGitCommit": "838559689e9ff839ee2524c696c240a68c4d3378",
- "originGitCommitIsDirty": true,
- "invokedBy": "ci",
"requestedVersion": "0.0.0",
"ciProvider": "github",
"sdkVersion": "0.0.0"
diff --git a/packages/server/scripts/write-openapi.ts b/packages/server/scripts/write-openapi.ts
index ef78e158a..81a35281f 100644
--- a/packages/server/scripts/write-openapi.ts
+++ b/packages/server/scripts/write-openapi.ts
@@ -1,5 +1,5 @@
/**
- * Writes the server's OpenAPI document to `fern/openapi/openapi.json` for Fern.
+ * Writes the server's OpenAPI document to `.github/fern/openapi/openapi.json` for Fern.
*
* The real app is built in-process and asked for its document, so the committed
* spec cannot drift from what the server serves. Nothing listens or dials out:
@@ -70,7 +70,7 @@ const app = createServerApp({
});
const document = buildOpenApiDocument(app);
-const outputPath = path.join(import.meta.dirname, '../../../fern/openapi/openapi.json');
+const outputPath = path.join(import.meta.dirname, '../../../.github/fern/openapi/openapi.json');
mkdirSync(path.dirname(outputPath), { recursive: true });
writeFileSync(outputPath, `${JSON.stringify(canonicalise(document), null, 2)}\n`);
console.log(`Wrote ${String(Object.keys(document.paths ?? {}).length)} paths to ${outputPath}`);
diff --git a/scripts/generate-sdk.sh b/scripts/generate-sdk.sh
index bfb7c6052..2f58a15b7 100755
--- a/scripts/generate-sdk.sh
+++ b/scripts/generate-sdk.sh
@@ -1,13 +1,15 @@
#!/usr/bin/env bash
-# Regenerates fern/openapi/openapi.json and packages/sdk (same steps as CI).
+# Regenerates .github/fern/openapi/openapi.json and packages/sdk (same steps as CI).
# Requires Docker (Fern --local) and network access for the Fern CLI/image.
set -euo pipefail
cd "$(dirname "$0")/.."
-fern_version="$(jq -r .version fern/fern.config.json)"
+fern_version="$(jq -r .version .github/fern/fern.config.json)"
fern() {
- pnpm dlx "fern-api@${fern_version}" "$@"
+ # Fern only discovers a directory literally named `fern` under the process cwd
+ # (https://buildwithfern.com/learn/docs/getting-started/project-structure).
+ (cd .github && pnpm dlx "fern-api@${fern_version}" "$@")
}
pnpm --filter @truefoundry/utils-core build