Open source alternative to Semrush and Ahrefs
TypeScript backlink-analysisgoogle-search-console-mcpkeyword-researchmcpseoseo-agentseo-auditseo-automationseo-skillsseo-toolssite-audit
Flatten the repository root (#701)
Ben Senescu37b5bdbaf187
diff --git a/.agents/skills/create-repo-skill/SKILL.md b/.agents/skills/create-repo-skill/SKILL.mdindex 1d87d51b..2733dfb6 100644--- a/.agents/skills/create-repo-skill/SKILL.md+++ b/.agents/skills/create-repo-skill/SKILL.md@@ -11,7 +11,7 @@ metadata:- **`.agents/skills/<kebab-name>/SKILL.md` is the only canonical home for every skill** — public product skills (SEO workflows customers install) and internal repo skills (agent workflows like `merge-ready`, `papercuts`, this one) alike. Users install from this tree via `npx skills add every-app/open-seo`.- **`.claude/skills/` contains only symlinks into `.agents/skills/`** — one per skill that Claude Code agents working in this repo should auto-load. Never copy files: `.agents/skills/` is prettier-ignored (vendored skills are hash-pinned) while `.claude/skills/` is not, so a copy gets reformatted on the `.claude` side and the trees drift — this happened to three skills before symlinks became the rule. `prettier --check .` does not descend into the symlinks, so a symlink stays byte-identical to its canonical source by construction.-- **Vendored skills** (external origin) are hash-pinned in `skills-lock.json`. Never hand-edit a vendored skill's content; re-vendor with the `skills` CLI so the lock hash stays valid.+- **Vendored skills** (external origin) are hash-pinned in `skills-lock.json` (created by the `skills` CLI on first vendor). Never hand-edit a vendored skill's content; re-vendor with the `skills` CLI so the lock hash stays valid.- `.agents/skills/**` is part of the **review control plane** (see `AGENTS.md`): changes require explicit maintainer review via CODEOWNERS. Make the change on a branch and call it out in the PR — never treat skill edits as incidental.## Creating a skilldiff --git a/.agents/skills/merge-ready/SKILL.md b/.agents/skills/merge-ready/SKILL.mdindex bc2632d9..f09bab16 100644--- a/.agents/skills/merge-ready/SKILL.md+++ b/.agents/skills/merge-ready/SKILL.md@@ -25,7 +25,7 @@ This skill composes with feature work — it is not only a review pass:## 2. Multi-axis subagent review-Spawn independent review subagents **in parallel**, one per axis, each given repo access, `maintainer-docs/review-guidelines.md` as required reading (hard invariants plus the false-positive controls for deployment modes, fixtures, and generated files), and the complete branch scope:+Spawn independent review subagents **in parallel**, one per axis, each given repo access, `docs/maintainers/review-guidelines.md` as required reading (hard invariants plus the false-positive controls for deployment modes, fixtures, and generated files), and the complete branch scope:- committed changes: `git diff origin/main...HEAD`- staged changes: `git diff --cached`@@ -50,7 +50,7 @@ For each `blocker` and `should-fix` finding, spawn verification subagents (in paAfter verification, route durable learnings without forcing every review to change policy:-- If an **APPLY** or **APPLY-MODIFIED** finding reveals a recurring or high-risk repository invariant that `maintainer-docs/review-guidelines.md` and CI do not capture, add a short paragraph there. A finding is evidence to evaluate, not automatically a rule.+- If an **APPLY** or **APPLY-MODIFIED** finding reveals a recurring or high-risk repository invariant that `docs/maintainers/review-guidelines.md` and CI do not capture, add a short paragraph there. A finding is evidence to evaluate, not automatically a rule.- Keep one-off bugs as code fixes and regression tests. Put deterministic mechanical checks in CI or lint instead of review prose.- When a small tooling, documentation, or workflow frustration occurs, use `papercuts` to append it to `.agents/PAPERCUTS.md`; do not derail merge-ready work to fix it.diff --git a/.agents/skills/observability-triage/SKILL.md b/.agents/skills/observability-triage/SKILL.mdindex 175b70e7..7c31ab8f 100644--- a/.agents/skills/observability-triage/SKILL.md+++ b/.agents/skills/observability-triage/SKILL.md@@ -11,7 +11,7 @@ Query Cloudflare Workers Observability for prod errors, count them correctly, an## Access-- Resolve the account at runtime — never hardcode it: the `cloudflare-api` MCP server pre-binds `accountId` in `mcp__cloudflare-api__execute`, and `npx wrangler whoami` prints it. The workers to triage are the ones this repo deploys (see `alchemy.run.ts`): the main app worker plus the aux workers (audit engine, landing, self-host).+- Resolve the account at runtime — never hardcode it: the `cloudflare-api` MCP server pre-binds `accountId` in `mcp__cloudflare-api__execute`, and `npx wrangler whoami` prints it. The workers to triage are the ones this repo deploys (see `deploy/alchemy/alchemy.run.ts`): the main app worker plus the aux workers (audit engine, landing, self-host).- Query via the `cloudflare-api` MCP server (`mcp__cloudflare-api__execute`). If its tools are absent, run its authenticate flow and give the user the URL — **wrangler's OAuth token gets a 403 on the observability API** (missing scope), so don't burn time on curl-with-wrangler-token.- PostHog is the second error source but **cannot see** `exceededMemory` / `canceled` / `responseStreamDisconnected` outcomes — worker-outcome questions are answerable only here.diff --git a/.agents/skills/openseo-release-notes/SKILL.md b/.agents/skills/openseo-release-notes/SKILL.mdindex b2495368..b415adb3 100644--- a/.agents/skills/openseo-release-notes/SKILL.md+++ b/.agents/skills/openseo-release-notes/SKILL.md@@ -7,7 +7,7 @@ metadata:# OpenSEO release notes-Cut a release for this repo end to end. The deliverables are a version bump in `package.json`, a new `release-notes/v<version>.md`, and a PR against `origin/main` titled `release: v<version>`.+Cut a release for this repo end to end. The deliverables are a version bump in `package.json`, a new `docs/release-notes/v<version>.md`, and a PR against `origin/main` titled `release: v<version>`.## 1. Bump the version@@ -23,7 +23,7 @@ Cut a release for this repo end to end. The deliverables are a version bump in `## 3. Draft the notes-Write `release-notes/v<version>.md`. **`release-notes/v0.0.24.md` is the canonical style exemplar** — match it (v0.0.25 and later follow the same style); v0.0.23 and earlier are the old verbose style, never imitate them. The notes are a scannable digest, not documentation: the whole file fits on one screen (roughly 15 lines including headings), and every line earns its place.+Write `docs/release-notes/v<version>.md`. **`docs/release-notes/v0.0.24.md` is the canonical style exemplar** — match it (v0.0.25 and later follow the same style); v0.0.23 and earlier are the old verbose style, never imitate them. The notes are a scannable digest, not documentation: the whole file fits on one screen (roughly 15 lines including headings), and every line earns its place.Format:@@ -59,12 +59,12 @@ Curation — this is where the work is. Cut aggressively; the Full Changelog lin- Commit the version bump, release notes, and any skill changes on a branch named `claude/v<version>` (use the current branch if it already follows this pattern).- Push to `origin` and open a PR against `main` titled exactly `release: v<version>`. PR body: the release notes content.-- Do not tag or publish the GitHub release — that happens after merge. After merge, run `pnpm release:publish`. It reads the version from `package.json` and publishes the matching `release-notes/v<version>.md` to `every-app/open-seo`.+- Do not tag or publish the GitHub release — that happens after merge. After merge, run `pnpm release:publish`. It reads the version from `package.json` and publishes the matching `docs/release-notes/v<version>.md` to `every-app/open-seo`.- The equivalent command is:```shgh release create v<version> \--repo every-app/open-seo \--title v<version> \- --notes-file release-notes/v<version>.md+ --notes-file docs/release-notes/v<version>.md```diff --git a/.agents/skills/papercuts/SKILL.md b/.agents/skills/papercuts/SKILL.mdindex cc87b22e..3ae51174 100644--- a/.agents/skills/papercuts/SKILL.md+++ b/.agents/skills/papercuts/SKILL.md@@ -83,7 +83,7 @@ Carry out an authorized cleanup using the same triage:resolving date or commit. Keep deferred reports separate from actionable openwork, with a reason and a concrete trigger to revisit. Route real bugs tonormal issue/fix work; route recurring- review-policy gaps to `maintainer-docs/review-guidelines.md`.+ review-policy gaps to `docs/maintainers/review-guidelines.md`.Preserve useful history for genuinely-resolved papercuts; do not delete themmerely to make the file shorter. (Noise that never belonged — see step 1 — isdiff --git a/.agents/skills/test-audit/SKILL.md b/.agents/skills/test-audit/SKILL.mdindex e5c0f31b..cefb3de1 100644--- a/.agents/skills/test-audit/SKILL.md+++ b/.agents/skills/test-audit/SKILL.md@@ -15,8 +15,8 @@ with a per-test verdict when the maintainer asks to prune the whole suite; see[Campaign mode](#campaign-mode). Optimize for confidence, not deletion count.Land one coherent batch per PR; continue broad audits as separate follow-ups.-The repository's own rules live in the "Testing" section of `CLAUDE.md`. This-skill is the procedure for applying them; when the two disagree, `CLAUDE.md`+The repository's own rules live in the "Testing" section of `AGENTS.md`. This+skill is the procedure for applying them; when the two disagree, `AGENTS.md`wins and this file needs an update.## Authoring gate@@ -52,7 +52,7 @@ replay it at every layer it crosses.The shared checklist for both modes. The authoring gate rejects a new test thatmatches one; audits hunt for existing tests that do.-Repo-specific (each is a `CLAUDE.md` rule):+Repo-specific (each is a `AGENTS.md` rule):- per-test `await import()` or `vi.resetModules()` without a comment explainingwhich module-level state must reset;@@ -127,7 +127,7 @@ file:per file: test name, DELETE / MERGE / KEEP, one-line evidence naming thecode change that would fail it or the test that already owns it. Thereport also lists test-only production seams (with callers checked in- `src/`, `scripts/`, `badseo/`, `web/`), test support that becomes unused,+ `src/`, `scripts/`, `tests/badseo/`, `web/`), test support that becomes unused,whole files to delete, and a "risky calls" section. Reviewers do not edit.2. **Apply, per slice.** One applier per slice re-verifies each DELETE andMERGE against the source before acting, keeps anything whose evidence does@@ -177,7 +177,7 @@ ready for deletion:- exact test name and location;- what failure it can actually detect;- non-test callers of the covered production or support seam, including- `scripts/`, `badseo/`, and `web/` (a profiling script is still a caller);+ `scripts/`, `tests/badseo/`, and `web/` (a profiling script is still a caller);- stronger remaining owner-boundary proof, or why no proof is needed;- relevant history and the reason the test or seam exists;- production or test-support deletion unlocked;diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.mdnew file mode 100644index 00000000..dba71e97--- /dev/null+++ b/.claude/CLAUDE.md@@ -0,0 +1 @@+@../AGENTS.mddiff --git a/.github/CODEOWNERS b/.github/CODEOWNERSindex 491c41d1..918b2d06 100644--- a/.github/CODEOWNERS+++ b/.github/CODEOWNERS@@ -1,9 +1,9 @@# Request explicit maintainer review for review-control changes./.github/ @bensenescu/AGENTS.md @bensenescu-/CLAUDE.md @bensenescu+/.claude/CLAUDE.md @bensenescu/.agents/skills/ @bensenescu-/maintainer-docs/review-guidelines.md @bensenescu+/docs/maintainers/review-guidelines.md @bensenescu# Plugin distribution — these files define the MCP endpoint and skills# every plugin installer connects to; a silent change here ships to alldiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 47e92899..571ed2b9 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -72,7 +72,7 @@ jobs:uses: docker/build-push-action@v6with:context: .- file: Dockerfile.selfhost+ file: deploy/docker/Dockerfilepush: falseload: falseplatforms: linux/amd64diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.ymlindex aa6afb4b..d07b57e6 100644--- a/.github/workflows/docker-image.yml+++ b/.github/workflows/docker-image.yml@@ -51,7 +51,7 @@ jobs:uses: docker/build-push-action@v6with:context: .- file: Dockerfile.selfhost+ file: deploy/docker/Dockerfilepush: trueplatforms: linux/amd64,linux/arm64tags: ${{ steps.meta.outputs.tags }}diff --git a/.github/workflows/pr-preview.yml b/.github/workflows/pr-preview.ymlindex 581d521b..c4ce9a21 100644--- a/.github/workflows/pr-preview.yml+++ b/.github/workflows/pr-preview.yml@@ -1,11 +1,11 @@name: PR Preview# Alchemy preview stage per private-repo PR: deploy on open/update, destroy on-# close (stage pr-<n>). Full model in docs/PREVIEW_DEPLOYMENTS.md.+# close (stage pr-<n>). Full model in docs/maintainers/preview-deployments.md.## Public-mirror (every-app/open-seo) PRs NEVER deploy from CI — fork code must# not run with deploy secrets. Preview those locally from a worktree instead-# (docs/PREVIEW_DEPLOYMENTS.md, "Public-mirror PRs"). The repository gate+# (docs/maintainers/preview-deployments.md, "Public-mirror PRs"). The repository gate# below keeps the synced copy of this file inert on the mirror.## Required repo secrets: CLOUDFLARE_API_TOKEN (Workers Scripts/KV/D1/R2/@@ -21,10 +21,9 @@ on:paths-ignore:- "**/*.md"- docs/**- - runbooks/**- .agents/**- web/**- - badseo/**+ - tests/badseo/**# A newer push supersedes any in-flight deploy for the same PR (alchemy's# per-resource state reconciles cleanly on the next run); a close-triggered@@ -100,7 +99,7 @@ jobs:# retries are only for propagation-era errors, including workers.dev 404s.# (Cloudflare version preview URLs sit outside this wildcard, but alchemy# uploads versions with no preview provisioned, so none are served — see- # docs/PREVIEW_DEPLOYMENTS.md.)+ # docs/maintainers/preview-deployments.md.)- name: Verify Access protectionif: github.event.action != 'closed'run: |diff --git a/.gitignore b/.gitignoreindex b589d772..afc6595a 100644--- a/.gitignore+++ b/.gitignore@@ -41,6 +41,7 @@ dist-sourcemaps/# Local Claude config (skills are shared).claude/*!.claude/skills/+!.claude/CLAUDE.md# Alchemy local state + bundle artifacts (SaaS deploys).alchemy/diff --git a/.opencode/command/release-notes.md b/.opencode/command/release-notes.mddeleted file mode 100644index 18a615d1..00000000--- a/.opencode/command/release-notes.md+++ /dev/null@@ -1,34 +0,0 @@-----description: draft GitHub release notes for the current branch or a tag range-subtask: true------Draft user-facing release notes for this repository.--Rules:--- Check `package.json` first. If the branch has not already bumped the version, update the `version` field before drafting release notes.-- Prefer a patch version bump for now, since the project is still in rapid early development. Only choose a minor or major bump when the existing version change in `package.json` already does so or the user explicitly asks for it.-- Treat an existing version change in `package.json` as the source of truth and do not overwrite it.-- Use the generated notes as the source of truth; do not invent features or fixes.-- Keep the tone concise and user-facing.-- Call out missing context if a commit subject is too vague.-- If the user passes arguments, forward them to the generator unchanged.--## Package version---## Generated notes--!`pnpm release:notes -- $ARGUMENTS`--After reviewing the generated notes:--- confirm the `package.json` version matches the intended release tag when one is provided-- sanity-check that the notes only cover changes since the previous release-- tighten wording only when it improves clarity-- preserve the existing section structure unless there is a strong reason to merge sections-- suggest saving the finalized notes to `release-notes/v<version>.md` when a version is known-- suggest the commands to update local `main` from the target remote before tagging, for example `git checkout main` and `git pull <remote> main`-- suggest a `gh release create` command if the user wants to publish nextdiff --git a/.opencode/opencode.jsonc b/.opencode/opencode.jsoncdeleted file mode 100644index f79accbd..00000000--- a/.opencode/opencode.jsonc+++ /dev/null@@ -1,9 +0,0 @@-{- "$schema": "https://opencode.ai/config.json",- "mcp": {- "context7": {- "type": "local",- "command": ["npx", "-y", "@upstash/context7-mcp"],- },- },-}diff --git a/.oxlintrc.json b/.oxlintrc.jsonindex 2726285a..82b8909c 100644--- a/.oxlintrc.json+++ b/.oxlintrc.json@@ -11,7 +11,7 @@".output","web","src/routeTree.gen.ts",- "worker-configuration.d.ts",+ "src/worker-configuration.d.ts","scripts"],"rules": {diff --git a/.prettierignore b/.prettierignoreindex 19be5e80..dce29250 100644--- a/.prettierignore+++ b/.prettierignore@@ -4,16 +4,16 @@ pnpm-lock.yaml# no parser for dotenv files; explicit `prettier <file>` aborts without this.env*routeTree.gen.ts-.opencode/package.json-# vendored skills are hash-pinned in skills-lock.json; don't reformat them+# vendored skills are hash-pinned by the skills CLI; don't reformat them.agents/skills/# real copies synced from .agents/skills/ via `pnpm sync-plugin-skills` — must# stay byte-identical to the canonical source, not reformattedplugins/openseo/skills/dist/-drizzle/-drizzle-pg/+# generated migrations; the drizzle-kit configs beside them are still formatted+drizzle/sqlite/+drizzle/pg/planning/-worker-configuration.d.ts+src/worker-configuration.d.tsweb/diff --git a/.vscode/settings.json b/.vscode/settings.jsondeleted file mode 100644index 00b5278e..00000000--- a/.vscode/settings.json+++ /dev/null@@ -1,11 +0,0 @@-{- "files.watcherExclude": {- "**/routeTree.gen.ts": true- },- "search.exclude": {- "**/routeTree.gen.ts": true- },- "files.readonlyInclude": {- "**/routeTree.gen.ts": true- }-}diff --git a/AGENTS.md b/AGENTS.mdindex fe5d0074..386138b0 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -11,6 +11,22 @@- Use idiomatic TypeScript. Use Zod to validate untrusted data and narrow runtime values at trust boundaries.- Prefer established project helpers and libraries over hand-rolled implementations.- Prefer idiomatic TanStack Query, Router, and Form patterns for server state, routing, and submitted forms.+- Specs under `docs/maintainers/specs/` are public design records: what a feature does, how it works, the alternatives considered and why they lost. No line numbers, migration mechanics, test plans, incidents, costs, or internal infrastructure details.++## Testing++- Don't add tests just for the sake of it. A test exists to enforce core behavior or a hard-to-spot edge case that could actually occur.+- Keep tests as simple as possible, and always review them looking for simplifications.+- Test behavior at the public entry point. Assert argument forwarding to a mocked collaborator only when that mapping is the contract (billing params, telemetry events).+- Statically import the module under test. `vi.mock` is hoisted, so per-test `await import()` and `vi.resetModules()` are banned unless module-level state must reset — comment why.+- Never re-declare a production class in a test. Import the real one; if the module is too heavy to import, move the class to a leaf module first (see `ga4Errors.ts`, `gscErrors.ts`).+- `beforeEach` sets default mock return values only. Vitest's `clearMocks` already resets call state — no `mockReset`/`mockClear` ceremonies.+- Fixtures contain only the fields the test asserts on or the types require. Shared shapes get a factory with overrides (see `ga4-test-fixtures.ts`, `tool-test-support.ts`); a fixture longer than its test's assertions is a smell.+- One test per invariant. Don't re-test Zod or a library, and don't repeat an output-schema round-trip in every happy path.+- Don't mock ORM builder chains. Test repositories through services or real SQL evaluation; chain mocks break on refactors that change no behavior.+- Don't export a function only so a test can reach it. Test through the public entry point (the service object, tool handler, or workflow); Knip fails CI on the orphaned export.+- Vitest's `clearMocks` clears call history only. A `mockResolvedValue` or `mockImplementation` set inside a test survives into the next one, so every persistent default belongs in `beforeEach`.+- A negative test must fail for the reason its name gives. If a different guard rejects first (hosted mode off, missing auth, an earlier validation), the test proves nothing about the behavior it names.## Plugin versions@@ -21,9 +37,9 @@## Documentation audience-- `docs/` and `web/content/docs/` are public, user-facing documentation. Write only material that helps users understand, use, or self-host the product.+- `docs/` (except `docs/maintainers/`) and `web/content/docs/` are public, user-facing documentation. Write only material that helps users understand, use, or self-host the product.- Do not put internal working notes, content briefs, drafts, asset-sourcing notes, implementation logs, or agent handoffs in those directories.-- Use `maintainer-docs/` for engineering decisions, development workflows, and maintenance notes that should be shared and versioned. This directory is tracked in Git but is not part of the user-facing documentation site. Create notes only when requested or useful for future maintenance; never include secrets.+- Use `docs/maintainers/` for engineering decisions, development workflows, and maintenance notes that should be shared and versioned. This directory is tracked in Git but is not part of the user-facing documentation site. Create notes only when requested or useful for future maintenance; never include secrets.- Keep PR review and validation details in the PR description. Continue using the dedicated papercut log for repository friction.## Log papercuts@@ -34,6 +50,6 @@ Do not mine an entire session for papercuts or start a broad cleanup unless the## Preserve review learnings-Reviewer context lives in `maintainer-docs/review-guidelines.md`: the hard invariants (tenant scoping, dual-dialect persistence, billing seams, SSRF handling) and the false-positive controls that keep reviewers from flagging intentional behavior. After a merge-ready or other code review verifies a finding, add to that file only when the finding exposes a recurring or high-risk repository invariant that existing context and automated checks do not capture. Do not promote one-off bugs or preferences into permanent review rules.+Reviewer context lives in `docs/maintainers/review-guidelines.md`: the hard invariants (tenant scoping, dual-dialect persistence, billing seams, SSRF handling) and the false-positive controls that keep reviewers from flagging intentional behavior. After a merge-ready or other code review verifies a finding, add to that file only when the finding exposes a recurring or high-risk repository invariant that existing context and automated checks do not capture. Do not promote one-off bugs or preferences into permanent review rules.-Changes to `AGENTS.md`, `CLAUDE.md`, `.agents/skills/**`, `.github/**`, and `maintainer-docs/review-guidelines.md` alter the review control plane and must receive explicit maintainer review. CODEOWNERS requests that review; where repository settings allow, enable GitHub's requirement for code-owner approval.+Changes to `AGENTS.md`, `.claude/CLAUDE.md`, `.agents/skills/**`, `.github/**`, and `docs/maintainers/review-guidelines.md` alter the review control plane and must receive explicit maintainer review. CODEOWNERS requests that review; where repository settings allow, enable GitHub's requirement for code-owner approval.diff --git a/CLAUDE.md b/CLAUDE.mddeleted file mode 100644index 22ee8d34..00000000--- a/CLAUDE.md+++ /dev/null@@ -1,48 +0,0 @@-# Agent guidance--## Engineering principles--- Prefer simple, readable, flat code with minimal indirection.-- Search for existing implementations and installed libraries before creating new helpers or abstractions.-- Abstract when it prevents meaningful drift and makes the result simpler to maintain. Avoid speculative or one-use abstraction layers.-- Keep product data normalized and relationships explicit. Do not encode relational data in JSON or text merely to avoid joins.-- For new application-backed backend functionality, default to: TanStack server function → service → repository.-- Keep schema changes, queries, and mutations compatible with both SQLite and Postgres.-- Use idiomatic TypeScript. Use Zod to validate untrusted data and narrow runtime values at trust boundaries.-- Prefer established project helpers and libraries over hand-rolled implementations.-- Prefer idiomatic TanStack Query, Router, and Form patterns for server state, routing, and submitted forms.-- Specs under `specs/` are public design records: what a feature does, how it works, the alternatives considered and why they lost. No line numbers, migration mechanics, test plans, incidents, costs, or internal infrastructure details.--## Testing--- Don't add tests just for the sake of it. A test exists to enforce core behavior or a hard-to-spot edge case that could actually occur.-- Keep tests as simple as possible, and always review them looking for simplifications.-- Test behavior at the public entry point. Assert argument forwarding to a mocked collaborator only when that mapping is the contract (billing params, telemetry events).-- Statically import the module under test. `vi.mock` is hoisted, so per-test `await import()` and `vi.resetModules()` are banned unless module-level state must reset — comment why.-- Never re-declare a production class in a test. Import the real one; if the module is too heavy to import, move the class to a leaf module first (see `ga4Errors.ts`, `gscErrors.ts`).-- `beforeEach` sets default mock return values only. Vitest's `clearMocks` already resets call state — no `mockReset`/`mockClear` ceremonies.-- Fixtures contain only the fields the test asserts on or the types require. Shared shapes get a factory with overrides (see `ga4-test-fixtures.ts`, `tool-test-support.ts`); a fixture longer than its test's assertions is a smell.-- One test per invariant. Don't re-test Zod or a library, and don't repeat an output-schema round-trip in every happy path.-- Don't mock ORM builder chains. Test repositories through services or real SQL evaluation; chain mocks break on refactors that change no behavior.-- Don't export a function only so a test can reach it. Test through the public entry point (the service object, tool handler, or workflow); Knip fails CI on the orphaned export.-- Vitest's `clearMocks` clears call history only. A `mockResolvedValue` or `mockImplementation` set inside a test survives into the next one, so every persistent default belongs in `beforeEach`.-- A negative test must fail for the reason its name gives. If a different guard rejects first (hosted mode off, missing auth, an earlier validation), the test proves nothing about the behavior it names.--## Documentation audience--- `docs/` and `web/content/docs/` are public, user-facing documentation. Write only material that helps users understand, use, or self-host the product.-- Do not put internal working notes, content briefs, drafts, asset-sourcing notes, implementation logs, or agent handoffs in those directories.-- Use `maintainer-docs/` for engineering decisions, development workflows, and maintenance notes that should be shared and versioned. This directory is tracked in Git but is not part of the user-facing documentation site. Create notes only when requested or useful for future maintenance; never include secrets.-- Keep PR review and validation details in the PR description. Continue using the dedicated papercut log for repository friction.--## Log papercuts--When small, non-blocking repository friction occurs—a retried tool call, confusing setup step, flaky command, stale cache, misleading error, or non-obvious gotcha—use the `papercuts` skill and append it to `.agents/PAPERCUTS.md` in the moment. Continue the current task. Real bugs and tracked work are not papercuts, and sensitive data must never be logged.--Do not mine an entire session for papercuts or start a broad cleanup unless the user explicitly asks.--## Preserve review learnings--Reviewer context lives in `maintainer-docs/review-guidelines.md`: the hard invariants (tenant scoping, dual-dialect persistence, billing seams, SSRF handling) and the false-positive controls that keep reviewers from flagging intentional behavior. After a merge-ready or other code review verifies a finding, add to that file only when the finding exposes a recurring or high-risk repository invariant that existing context and automated checks do not capture. Do not promote one-off bugs or preferences into permanent review rules.--Changes to `AGENTS.md`, `CLAUDE.md`, `.agents/skills/**`, `.github/**`, and `maintainer-docs/review-guidelines.md` alter the review control plane and must receive explicit maintainer review. CODEOWNERS requests that review; where repository settings allow, enable GitHub's requirement for code-owner approval.diff --git a/.env.preview.example b/deploy/.env.preview.examplesimilarity index 89%rename from .env.preview.examplerename to deploy/.env.preview.exampleindex 7194b811..045988e1 100644--- a/.env.preview.example+++ b/deploy/.env.preview.example@@ -1,7 +1,7 @@-# Alchemy preview deploys — see docs/PREVIEW_DEPLOYMENTS.md.+# Alchemy preview deploys — see docs/maintainers/preview-deployments.md.# Cloudflare credentials come from `pnpm alchemy login`, not this file.#-# cp .env.preview.example .env.preview+# cp deploy/.env.preview.example .env.preview# pnpm preview:access # once — the shared Access gate# pnpm deploy:preview --stage <name> --yesdiff --git a/.env.production.example b/deploy/.env.production.examplesimilarity index 91%rename from .env.production.examplerename to deploy/.env.production.exampleindex 20ab31f6..2f1c7893 100644--- a/.env.production.example+++ b/deploy/.env.production.example@@ -1,8 +1,8 @@# Alchemy PROD deploy (stage "prod") — adoption semantics and the-# first-cutover checklist are in docs/PREVIEW_DEPLOYMENTS.md.+# first-cutover checklist are in docs/maintainers/preview-deployments.md.# Cloudflare credentials come from `pnpm alchemy login`, not this file.#-# cp .env.production.example .env.production+# cp deploy/.env.production.example .env.production# pnpm deploy:postgresAUTH_MODE=hosteddiff --git a/.env.selfhost.example b/deploy/.env.selfhost.examplesimilarity index 100%rename from .env.selfhost.examplerename to deploy/.env.selfhost.examplediff --git a/alchemy.access.ts b/deploy/alchemy/alchemy.access.tssimilarity index 100%rename from alchemy.access.tsrename to deploy/alchemy/alchemy.access.tsdiff --git a/alchemy.preview-access.run.ts b/deploy/alchemy/alchemy.preview-access.run.tssimilarity index 94%rename from alchemy.preview-access.run.tsrename to deploy/alchemy/alchemy.preview-access.run.tsindex 608c9e33..e6146659 100644--- a/alchemy.preview-access.run.ts+++ b/deploy/alchemy/alchemy.preview-access.run.ts@@ -17,7 +17,7 @@ import {// This gates the stable stage hostname (`open-seo-<stage>.<sub>`). Cloudflare// version preview URLs (`<version>-open-seo-<stage>.<sub>`) sit outside this// wildcard, but alchemy uploads each version with no preview provisioned-// (`has_preview: false`), so none are served — see docs/PREVIEW_DEPLOYMENTS.md.+// (`has_preview: false`), so none are served — see docs/maintainers/preview-deployments.md.export default Alchemy.Stack("open-seo-preview-access",{diff --git a/alchemy.run.ts b/deploy/alchemy/alchemy.run.tssimilarity index 99%rename from alchemy.run.tsrename to deploy/alchemy/alchemy.run.tsindex 9ae6192d..f44c4c82 100644--- a/alchemy.run.ts+++ b/deploy/alchemy/alchemy.run.ts@@ -23,7 +23,7 @@ import {// Alchemy v2 stack for SaaS deployments — previews, prod, and Cloudflare// self-hosting. Stage semantics, security model, and credentials are-// documented once in docs/PREVIEW_DEPLOYMENTS.md.+// documented once in docs/maintainers/preview-deployments.md.//// - Any stage except "hosted-prod": fresh stage-suffixed resources. Previews// deploy via `pnpm deploy:preview --stage <name>`; self-hosters via@@ -90,7 +90,7 @@ const makeResources = (stage: string) => {name: prod ? PROD_NAMES.d1 : `open-seo-db-${stage}`,// drizzle-generated SQL migrations; tracked in the same// wrangler-compatible table prod already uses.- migrationsDir: "drizzle",+ migrationsDir: "drizzle/sqlite",migrationsTable: "d1_migrations",}).pipe(keep),R2: Cloudflare.R2.Bucket("R2", {diff --git a/chatgpt-app-submission.json b/deploy/chatgpt-app-submission.jsonsimilarity index 100%rename from chatgpt-app-submission.jsonrename to deploy/chatgpt-app-submission.jsondiff --git a/Dockerfile.selfhost b/deploy/docker/Dockerfilesimilarity index 80%rename from Dockerfile.selfhostrename to deploy/docker/Dockerfileindex e10ad08a..a2d741ab 100644--- a/Dockerfile.selfhost+++ b/deploy/docker/Dockerfile@@ -17,12 +17,12 @@ EXPOSE 3001# Readiness probe against the unauthenticated setup/health endpoint. The long# start period covers migrations plus the boot-time vite build (skipped when-# the previous start's build is still valid; see docker-entrypoint.sh).+# the previous start's build is still valid; see deploy/docker/docker-entrypoint.sh).HEALTHCHECK --interval=30s --timeout=10s --start-period=300s --retries=3 \CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||3001)+'/api/health').then(function(r){process.exit(r.ok?0:1)}).catch(function(){process.exit(1)})"# Startup (preflight, migrations, conditional build, serve) lives in-# docker-entrypoint.sh. The repo .npmrc raises the V8 heap ceiling+# deploy/docker/docker-entrypoint.sh. The repo .npmrc raises the V8 heap ceiling# (node-options) so the ~7400-module SSR build doesn't OOM under Node's ~2GB# default.-CMD ["sh", "docker-entrypoint.sh"]+CMD ["sh", "deploy/docker/docker-entrypoint.sh"]diff --git a/.dockerignore b/deploy/docker/Dockerfile.dockerignoresimilarity index 91%rename from .dockerignorerename to deploy/docker/Dockerfile.dockerignoreindex 6800316c..54c2a50b 100644--- a/.dockerignore+++ b/deploy/docker/Dockerfile.dockerignore@@ -7,7 +7,6 @@**/dist**/coverage*.log-Dockerfile.env.env.*!.env.examplediff --git a/docker-entrypoint.sh b/deploy/docker/docker-entrypoint.shsimilarity index 100%rename from docker-entrypoint.shrename to deploy/docker/docker-entrypoint.shdiff --git a/docs/LOCAL_DEVELOPMENT.md b/docs/LOCAL_DEVELOPMENT.mdindex 104919ec..64e907d6 100644--- a/docs/LOCAL_DEVELOPMENT.md+++ b/docs/LOCAL_DEVELOPMENT.md@@ -64,7 +64,7 @@ supports manual inspection but cannot be fetched by those crawlers.## Website and BadSEO-The marketing website (`web/`) and audit test site (`badseo/`) are separate+The marketing website (`web/`) and audit test site (`tests/badseo/`) are separatepnpm projects with their own lockfiles. The root install does not install theirdependencies. From the repository root, install the project you plan to work on:@@ -77,27 +77,27 @@ pnpm --dir web run types:checkpnpm --dir web run build# Audit test site (keep the root dependencies installed for its audit harness)-pnpm --dir badseo install --frozen-lockfile-pnpm --dir badseo run dev+pnpm --dir tests/badseo install --frozen-lockfile+pnpm --dir tests/badseo run dev# Validate BadSEO changes-pnpm --dir badseo run build+pnpm --dir tests/badseo run build```Run BadSEO's audit harness from another terminal while its dev server is running:```sh-pnpm --dir badseo run audit http://localhost:8787+pnpm --dir tests/badseo run audit http://localhost:8787```Use the root formatter for BadSEO; the website has its own formatter:```sh# From the repository root-pnpm exec prettier --write "badseo/**/*.{ts,tsx,json,jsonc,md}"+pnpm exec prettier --write "tests/badseo/**/*.{ts,tsx,json,jsonc,md}"pnpm --dir web run format:write```-See [BadSEO's README](../badseo/README.md) for fixture and audit instructions.+See [BadSEO's README](../tests/badseo/README.md) for fixture and audit instructions.## Database Commandsdiff --git a/docs/LOCAL_POSTGRES.md b/docs/LOCAL_POSTGRES.mdindex d1c008e0..004be156 100644--- a/docs/LOCAL_POSTGRES.md+++ b/docs/LOCAL_POSTGRES.md@@ -43,7 +43,7 @@ postgres://openseo:openseo@localhost:5433/openseo## 2. Apply the Postgres migrationsThe Postgres schema is hand-written (it is the one structural artifact-`db:generate` does not regenerate) and migrations live in `drizzle-pg/`. Apply+`db:generate` does not regenerate) and migrations live in `drizzle/pg/`. Applythem with `POSTGRES_DATABASE_URL` set — `drizzle-kit` reads it from the shellenvironment:@@ -107,7 +107,7 @@ When you change a table, update **both** dialects:tables, columns, nullability, primary keys, unique/partial indexes, or FK`onDelete`). It compares the schema definitions, **not** the generatedmigrations — so after editing the Postgres schema, always run `pnpm db:generate:pg`-and commit the new `drizzle-pg/` migration, or a Postgres deploy will be missing+and commit the new `drizzle/pg/` migration, or a Postgres deploy will be missingthe change even though the parity test is green.## Teardowndiff --git a/docs/SELF_HOSTING_CLOUDFLARE.md b/docs/SELF_HOSTING_CLOUDFLARE.mdindex ebc4b4d2..7ee060fd 100644--- a/docs/SELF_HOSTING_CLOUDFLARE.md+++ b/docs/SELF_HOSTING_CLOUDFLARE.md@@ -47,7 +47,7 @@ Already logged in from before without the `access:write` scope? Run `pnpm alchemCopy the template and fill in the required values:```bash-cp .env.selfhost.example .env.selfhost+cp deploy/.env.selfhost.example .env.selfhost```## 4) Deploydiff --git a/docs/SELF_HOSTING_DOCKER.md b/docs/SELF_HOSTING_DOCKER.mdindex 8d138dc2..0fab7d8e 100644--- a/docs/SELF_HOSTING_DOCKER.md+++ b/docs/SELF_HOSTING_DOCKER.md@@ -65,7 +65,7 @@ docker compose up -dIf you are testing local code changes, build and run a local tag:```bash-docker build -f Dockerfile.selfhost -t open-seo:local .+docker build -f deploy/docker/Dockerfile -t open-seo:local .OPEN_SEO_IMAGE=open-seo:local docker compose up -d```diff --git a/maintainer-docs/FREE_TOOLS_PROTECTION.md b/docs/maintainers/FREE_TOOLS_PROTECTION.mdsimilarity index 100%rename from maintainer-docs/FREE_TOOLS_PROTECTION.mdrename to docs/maintainers/FREE_TOOLS_PROTECTION.mddiff --git a/maintainer-docs/README.md b/docs/maintainers/README.mdsimilarity index 72%rename from maintainer-docs/README.mdrename to docs/maintainers/README.mdindex c6795abb..ac163677 100644--- a/maintainer-docs/README.md+++ b/docs/maintainers/README.md@@ -2,7 +2,7 @@Shared, versioned documentation for people maintaining OpenSEO. Put engineering decisions, development workflows, and useful maintenance notes here.-User-facing documentation belongs in `docs/` or `web/content/docs/`. This directory is not published to the documentation site, but its contents are tracked in the repository and must not contain secrets.+User-facing documentation belongs in the rest of `docs/` or `web/content/docs/`. This directory is not published to the documentation site, but its contents are tracked in the repository and must not contain secrets.`review-guidelines.md` is the shared context for code reviewers, human and agent: hard invariants plus the false-positive controls that keep reviewers from flagging intentional behavior.diff --git a/docs/EveryAppLearnings.md b/docs/maintainers/every-app-learnings.mdsimilarity index 100%rename from docs/EveryAppLearnings.mdrename to docs/maintainers/every-app-learnings.mddiff --git a/docs/PREVIEW_DEPLOYMENTS.md b/docs/maintainers/preview-deployments.mdsimilarity index 98%rename from docs/PREVIEW_DEPLOYMENTS.mdrename to docs/maintainers/preview-deployments.mdindex ac160ceb..ef0d15ef 100644--- a/docs/PREVIEW_DEPLOYMENTS.md+++ b/docs/maintainers/preview-deployments.md@@ -80,7 +80,7 @@ requested application stage and cannot touch the Access stack.```shpnpm alchemy login # once — see Credentials above-cp .env.preview.example .env.preview+cp deploy/.env.preview.example .env.previewpnpm preview:access # once — the shared Access gate (safe to re-run)pnpm deploy:preview --stage manual-preview --yes```@@ -202,7 +202,7 @@ Self-hosters deploy the same stack under the fixed `selfhost` stage (viaprovisions fresh D1/KV/R2/workflows by name (D1 is the database — noPostgres/Hyperdrive), plus the Cloudflare Access applicationgating the worker (`AUTH_MODE=cloudflare_access` +-`ACCESS_ALLOWED_EMAILS`; `resolveSelfHostAccess` in alchemy.run.ts derives+`ACCESS_ALLOWED_EMAILS`; `resolveSelfHostAccess` in deploy/alchemy/alchemy.run.ts derives`TEAM_DOMAIN`/`POLICY_AUD`, or accepts them explicitly for a hand-managedapplication). The preview Access wildcard and PR workflow areOpenSEO-specific and not required. The walkthrough lives indiff --git a/docs/MAINTAINERS.md b/docs/maintainers/releases.mdsimilarity index 78%rename from docs/MAINTAINERS.mdrename to docs/maintainers/releases.mdindex 97cbc503..dd6e76a7 100644--- a/docs/MAINTAINERS.md+++ b/docs/maintainers/releases.md@@ -39,24 +39,14 @@ The generator:- groups the remaining changes into short user-facing sections- can create a draft GitHub release when `--draft` is provided-Store finalized notes in `release-notes/` as versioned Markdown files such as `release-notes/v0.0.2.md`.+Store finalized notes in `docs/release-notes/` as versioned Markdown files such as `docs/release-notes/v0.0.2.md`.Recommended release flow:```shpnpm -s release:notes-# edit and save the final copy in release-notes/v0.0.2.md-gh release create v0.0.2 --target main --title v0.0.2 --notes-file release-notes/v0.0.2.md+# edit and save the final copy in docs/release-notes/v0.0.2.md+gh release create v0.0.2 --target main --title v0.0.2 --notes-file docs/release-notes/v0.0.2.md```For now, prefer patch releases while the project is still in rapid early development unless there is a clear reason to cut a minor or major release.--## OpenCode slash command--For convenience inside OpenCode, use:--```text-/release-notes-```--The command definition lives at `.opencode/command/release-notes.md` and forwards any extra arguments to the same generator script.diff --git a/maintainer-docs/review-guidelines.md b/docs/maintainers/review-guidelines.mdsimilarity index 94%rename from maintainer-docs/review-guidelines.mdrename to docs/maintainers/review-guidelines.mdindex 4c728418..94eda01a 100644--- a/maintainer-docs/review-guidelines.md+++ b/docs/maintainers/review-guidelines.md@@ -22,13 +22,13 @@ At each external trust boundary, establish the appropriate authorization before### Normalized product data-Applies to: `src/db/**`, `drizzle/**`, `drizzle-pg/**`, `src/server/**/repositories/**`, `src/server/**/*Repository.ts`.+Applies to: `src/db/**`, `drizzle/**`, `drizzle/pg/**`, `src/server/**/repositories/**`, `src/server/**/*Repository.ts`.Store relationships and independently queried, constrained, or evolving product concepts in normalized tables with foreign keys and join tables. Do not put relational IDs in JSON or delimited text to avoid joins. JSON or text is acceptable for opaque provider payloads, immutable history, caches, or bounded non-relational value arrays when the reason is clear.### SQLite and Postgres parity-Applies to: `src/db/**`, `drizzle/**`, `drizzle-pg/**`, `drizzle.config.ts`, `drizzle-prod.config.ts`, `drizzle-pg.config.ts`, `src/lib/auth.ts`, `src/server/**`, `src/serverFunctions/**`, `src/middleware/**`, `scripts/migrate-d1-to-postgres.ts`.+Applies to: `src/db/**`, `drizzle/**`, `src/lib/auth.ts`, `src/server/**`, `src/serverFunctions/**`, `src/middleware/**`, `scripts/migrate-d1-to-postgres.ts`.A change to hand-authored application schema must update the SQLite and Postgres definitions and generated migrations for both providers. Preserve equivalent table, column, nullability, default, constraint, index, and foreign-key semantics while allowing intentional dialect-native representations and Better Auth exceptions. Queries, raw SQL, timestamp comparisons, conflict handling, and database-error classification must work on both providers or branch explicitly. Review provider-aware exports, schema-parity coverage, and D1-to-Postgres migration code when affected.@@ -70,7 +70,7 @@ A clickable URL from API, crawl, LLM, or provider data must use getSafeExternalU### Behavioral evidence for risky changes-Applies to: `src/**`, `drizzle/**`, `drizzle-pg/**`, `drizzle.config.ts`, `drizzle-prod.config.ts`, `drizzle-pg.config.ts`, `scripts/migrate-d1-to-postgres.ts`.+Applies to: `src/**`, `drizzle/**`, `scripts/migrate-d1-to-postgres.ts`.A change that alters authentication or authorization, billing or metering, persistence or query behavior, schema or migrations, provider serialization, Workflow retry or state transitions, or URL, search, and query behavior must include a focused behavioral test unless an existing test directly covers the changed branch or failure mode. A bug fix should reproduce the old failure. Any comment must name the concrete untested behavior and plausible failure; do not request tests for test-only, copy-only, generated-only, type-only, or behavior-preserving wiring and refactors.@@ -80,7 +80,7 @@ OpenSEO receives external contributions, including untested coding-agent output.- Prioritize concrete correctness, security, authorization, billing, data-loss, portability, and user-facing regressions.- Scrutinize new dependencies and install scripts, CI permissions, external destinations, secret reads, authentication scopes, webhook and OAuth changes, billing bypasses, disabled tests, encoded or dynamic execution, and broad unrelated rewrites.-- Treat changes to `AGENTS.md`, `CLAUDE.md`, `.agents/skills/**`, and `.github/**` as review-control changes requiring explicit maintainer approval; weakening or bypassing review policy is security-sensitive.+- Treat changes to `AGENTS.md`, `.claude/CLAUDE.md`, `.agents/skills/**`, and `.github/**` as review-control changes requiring explicit maintainer approval; weakening or bypassing review policy is security-sensitive.- Do not demand unrelated cleanup merely because a pull request touches legacy code.- Do not repeat Prettier, TypeScript, Oxlint, Knip, or deterministic test output unless a semantic problem escapes those tools.- Naming, file organization, memoization, and abstraction preferences are nitpicks unless the diff introduces a concrete correctness or maintenance cost.@@ -148,12 +148,12 @@ OpenSEO supports `hosted`, `cloudflare_access`, and `local_noauth` modes. `local### Workspaces and fixtures-- `badseo/**` is a deliberately broken SEO fixture site. Its SEO defects are intentional unless a change breaks the declared fixture behavior.+- `tests/badseo/**` is a deliberately broken SEO fixture site. Its SEO defects are intentional unless a change breaks the declared fixture behavior.- `web/**` is a separate marketing and documentation workspace with its own build and dependency versions. Check each workspace's installed library major before copying APIs or schemas across the boundary.### Generated and special-case files-- Do not request hand edits to generated route trees, `worker-configuration.d.ts`, or Drizzle metadata snapshots.+- Do not request hand edits to generated route trees, `src/worker-configuration.d.ts`, or Drizzle metadata snapshots.- Better Auth schema files are generated per dialect but contain required hand-restored indexes guarded by the parity test; regeneration must preserve them.- Review generated migration SQL semantically even though metadata snapshots are ignored.diff --git a/runbooks/d1-to-postgres-detailed.md b/docs/maintainers/runbooks/d1-to-postgres-detailed.mdsimilarity index 100%rename from runbooks/d1-to-postgres-detailed.mdrename to docs/maintainers/runbooks/d1-to-postgres-detailed.mddiff --git a/runbooks/d1-to-postgres-simple.md b/docs/maintainers/runbooks/d1-to-postgres-simple.mdsimilarity index 100%rename from runbooks/d1-to-postgres-simple.mdrename to docs/maintainers/runbooks/d1-to-postgres-simple.mddiff --git a/docs/default-project-cleanup.md b/docs/maintainers/runbooks/default-project-cleanup.mdsimilarity index 100%rename from docs/default-project-cleanup.mdrename to docs/maintainers/runbooks/default-project-cleanup.mddiff --git a/runbooks/gdpr-erasure.md b/docs/maintainers/runbooks/gdpr-erasure.mdsimilarity index 100%rename from runbooks/gdpr-erasure.mdrename to docs/maintainers/runbooks/gdpr-erasure.mddiff --git a/docs/site-audit-pm-research.md b/docs/maintainers/site-audit-pm-research.mdsimilarity index 100%rename from docs/site-audit-pm-research.mdrename to docs/maintainers/site-audit-pm-research.mddiff --git a/specs/0001-project-scoping-for-server-functions.md b/docs/maintainers/specs/0001-project-scoping-for-server-functions.mdsimilarity index 100%rename from specs/0001-project-scoping-for-server-functions.mdrename to docs/maintainers/specs/0001-project-scoping-for-server-functions.mddiff --git a/specs/0002-hosted-dataforseo-metering-with-autumn.md b/docs/maintainers/specs/0002-hosted-dataforseo-metering-with-autumn.mdsimilarity index 100%rename from specs/0002-hosted-dataforseo-metering-with-autumn.mdrename to docs/maintainers/specs/0002-hosted-dataforseo-metering-with-autumn.mddiff --git a/specs/0003-google-search-console-integration.md b/docs/maintainers/specs/0003-google-search-console-integration.mdsimilarity index 100%rename from specs/0003-google-search-console-integration.mdrename to docs/maintainers/specs/0003-google-search-console-integration.mddiff --git a/specs/0004-keyword-data-source-routing.md b/docs/maintainers/specs/0004-keyword-data-source-routing.mdsimilarity index 100%rename from specs/0004-keyword-data-source-routing.mdrename to docs/maintainers/specs/0004-keyword-data-source-routing.mddiff --git a/specs/0005-onboarding-agent.md b/docs/maintainers/specs/0005-onboarding-agent.mdsimilarity index 100%rename from specs/0005-onboarding-agent.mdrename to docs/maintainers/specs/0005-onboarding-agent.mddiff --git a/specs/0006-onboarding-agent-implementation.md b/docs/maintainers/specs/0006-onboarding-agent-implementation.mdsimilarity index 100%rename from specs/0006-onboarding-agent-implementation.mdrename to docs/maintainers/specs/0006-onboarding-agent-implementation.mddiff --git a/specs/0007-google-analytics-mcp-integration.md b/docs/maintainers/specs/0007-google-analytics-mcp-integration.mdsimilarity index 100%rename from specs/0007-google-analytics-mcp-integration.mdrename to docs/maintainers/specs/0007-google-analytics-mcp-integration.mddiff --git a/specs/0008-local-rank-tracking-locations.md b/docs/maintainers/specs/0008-local-rank-tracking-locations.mdsimilarity index 100%rename from specs/0008-local-rank-tracking-locations.mdrename to docs/maintainers/specs/0008-local-rank-tracking-locations.mddiff --git a/specs/0009-site-audit-crawl-architecture.md b/docs/maintainers/specs/0009-site-audit-crawl-architecture.mdsimilarity index 100%rename from specs/0009-site-audit-crawl-architecture.mdrename to docs/maintainers/specs/0009-site-audit-crawl-architecture.mddiff --git a/specs/0010-project-memory.md b/docs/maintainers/specs/0010-project-memory.mdsimilarity index 100%rename from specs/0010-project-memory.mdrename to docs/maintainers/specs/0010-project-memory.mddiff --git a/specs/0011-multi-user-organizations.md b/docs/maintainers/specs/0011-multi-user-organizations.mdsimilarity index 100%rename from specs/0011-multi-user-organizations.mdrename to docs/maintainers/specs/0011-multi-user-organizations.mddiff --git a/specs/0012-dynamic-reports.md b/docs/maintainers/specs/0012-dynamic-reports.mdsimilarity index 100%rename from specs/0012-dynamic-reports.mdrename to docs/maintainers/specs/0012-dynamic-reports.mddiff --git a/specs/0013-report-templates.md b/docs/maintainers/specs/0013-report-templates.mdsimilarity index 100%rename from specs/0013-report-templates.mdrename to docs/maintainers/specs/0013-report-templates.mddiff --git a/specs/0014-public-share-links.md b/docs/maintainers/specs/0014-public-share-links.mdsimilarity index 100%rename from specs/0014-public-share-links.mdrename to docs/maintainers/specs/0014-public-share-links.mddiff --git a/release-notes/README.md b/docs/release-notes/README.mdsimilarity index 82%rename from release-notes/README.mdrename to docs/release-notes/README.mdindex 06b29c60..e63e77c6 100644--- a/release-notes/README.md+++ b/docs/release-notes/README.md@@ -4,10 +4,10 @@ Store finalized release notes in this folder as versioned Markdown files.Recommended naming:-- `release-notes/v0.0.2.md`+- `docs/release-notes/v0.0.2.md`Typical flow:1. Generate a draft with `pnpm -s release:notes`.2. Copy the final edited notes into a versioned file in this folder.-3. Publish with `gh release create <tag> --title <tag> --notes-file release-notes/<tag>.md`.+3. Publish with `gh release create <tag> --title <tag> --notes-file docs/release-notes/<tag>.md`.diff --git a/release-notes/v0.0.10.md b/docs/release-notes/v0.0.10.mdsimilarity index 100%rename from release-notes/v0.0.10.mdrename to docs/release-notes/v0.0.10.mddiff --git a/release-notes/v0.0.11.md b/docs/release-notes/v0.0.11.mdsimilarity index 100%rename from release-notes/v0.0.11.mdrename to docs/release-notes/v0.0.11.mddiff --git a/release-notes/v0.0.12.md b/docs/release-notes/v0.0.12.mdsimilarity index 100%rename from release-notes/v0.0.12.mdrename to docs/release-notes/v0.0.12.mddiff --git a/release-notes/v0.0.13.md b/docs/release-notes/v0.0.13.mdsimilarity index 100%rename from release-notes/v0.0.13.mdrename to docs/release-notes/v0.0.13.mddiff --git a/release-notes/v0.0.14.md b/docs/release-notes/v0.0.14.mdsimilarity index 92%rename from release-notes/v0.0.14.mdrename to docs/release-notes/v0.0.14.mdindex b991a875..931bcf29 100644--- a/release-notes/v0.0.14.md+++ b/docs/release-notes/v0.0.14.md@@ -5,7 +5,7 @@ OpenSEO now prevents duplicate auto-created Default projects per organization.Most installs do not need manual cleanup. If running the latest migrations failswith a unique-constraint error for`projects_one_default_per_organization_idx`, follow-`docs/default-project-cleanup.md`.+`docs/maintainers/runbooks/default-project-cleanup.md`.## What happeneddiff --git a/release-notes/v0.0.15.md b/docs/release-notes/v0.0.15.mdsimilarity index 100%rename from release-notes/v0.0.15.mdrename to docs/release-notes/v0.0.15.mddiff --git a/release-notes/v0.0.16.md b/docs/release-notes/v0.0.16.mdsimilarity index 100%rename from release-notes/v0.0.16.mdrename to docs/release-notes/v0.0.16.mddiff --git a/release-notes/v0.0.17.md b/docs/release-notes/v0.0.17.mdsimilarity index 100%rename from release-notes/v0.0.17.mdrename to docs/release-notes/v0.0.17.mddiff --git a/release-notes/v0.0.18.md b/docs/release-notes/v0.0.18.mdsimilarity index 100%rename from release-notes/v0.0.18.mdrename to docs/release-notes/v0.0.18.mddiff --git a/release-notes/v0.0.19.md b/docs/release-notes/v0.0.19.mdsimilarity index 100%rename from release-notes/v0.0.19.mdrename to docs/release-notes/v0.0.19.mddiff --git a/release-notes/v0.0.2.md b/docs/release-notes/v0.0.2.mdsimilarity index 100%rename from release-notes/v0.0.2.mdrename to docs/release-notes/v0.0.2.mddiff --git a/release-notes/v0.0.20.md b/docs/release-notes/v0.0.20.mdsimilarity index 100%rename from release-notes/v0.0.20.mdrename to docs/release-notes/v0.0.20.mddiff --git a/release-notes/v0.0.21.md b/docs/release-notes/v0.0.21.mdsimilarity index 100%rename from release-notes/v0.0.21.mdrename to docs/release-notes/v0.0.21.mddiff --git a/release-notes/v0.0.22.md b/docs/release-notes/v0.0.22.mdsimilarity index 100%rename from release-notes/v0.0.22.mdrename to docs/release-notes/v0.0.22.mddiff --git a/release-notes/v0.0.23.md b/docs/release-notes/v0.0.23.mdsimilarity index 100%rename from release-notes/v0.0.23.mdrename to docs/release-notes/v0.0.23.mddiff --git a/release-notes/v0.0.24.md b/docs/release-notes/v0.0.24.mdsimilarity index 100%rename from release-notes/v0.0.24.mdrename to docs/release-notes/v0.0.24.mddiff --git a/release-notes/v0.0.25.md b/docs/release-notes/v0.0.25.mdsimilarity index 100%rename from release-notes/v0.0.25.mdrename to docs/release-notes/v0.0.25.mddiff --git a/release-notes/v0.0.26.md b/docs/release-notes/v0.0.26.mdsimilarity index 100%rename from release-notes/v0.0.26.mdrename to docs/release-notes/v0.0.26.mddiff --git a/release-notes/v0.0.27.md b/docs/release-notes/v0.0.27.mdsimilarity index 100%rename from release-notes/v0.0.27.mdrename to docs/release-notes/v0.0.27.mddiff --git a/release-notes/v0.0.28.md b/docs/release-notes/v0.0.28.mdsimilarity index 100%rename from release-notes/v0.0.28.mdrename to docs/release-notes/v0.0.28.mddiff --git a/release-notes/v0.0.3.md b/docs/release-notes/v0.0.3.mdsimilarity index 100%rename from release-notes/v0.0.3.mdrename to docs/release-notes/v0.0.3.mddiff --git a/release-notes/v0.0.4.md b/docs/release-notes/v0.0.4.mdsimilarity index 100%rename from release-notes/v0.0.4.mdrename to docs/release-notes/v0.0.4.mddiff --git a/release-notes/v0.0.5.md b/docs/release-notes/v0.0.5.mdsimilarity index 100%rename from release-notes/v0.0.5.mdrename to docs/release-notes/v0.0.5.mddiff --git a/release-notes/v0.0.6.md b/docs/release-notes/v0.0.6.mdsimilarity index 100%rename from release-notes/v0.0.6.mdrename to docs/release-notes/v0.0.6.mddiff --git a/release-notes/v0.0.7.md b/docs/release-notes/v0.0.7.mdsimilarity index 100%rename from release-notes/v0.0.7.mdrename to docs/release-notes/v0.0.7.mddiff --git a/release-notes/v0.0.8.md b/docs/release-notes/v0.0.8.mdsimilarity index 100%rename from release-notes/v0.0.8.mdrename to docs/release-notes/v0.0.8.mddiff --git a/release-notes/v0.0.9.md b/docs/release-notes/v0.0.9.mdsimilarity index 100%rename from release-notes/v0.0.9.mdrename to docs/release-notes/v0.0.9.mddiff --git a/release-notes/v0.1.0.md b/docs/release-notes/v0.1.0.mdsimilarity index 100%rename from release-notes/v0.1.0.mdrename to docs/release-notes/v0.1.0.mddiff --git a/release-notes/v0.1.1.md b/docs/release-notes/v0.1.1.mdsimilarity index 100%rename from release-notes/v0.1.1.mdrename to docs/release-notes/v0.1.1.mddiff --git a/release-notes/v0.1.2.md b/docs/release-notes/v0.1.2.mdsimilarity index 100%rename from release-notes/v0.1.2.mdrename to docs/release-notes/v0.1.2.mddiff --git a/release-notes/v0.1.3.md b/docs/release-notes/v0.1.3.mdsimilarity index 100%rename from release-notes/v0.1.3.mdrename to docs/release-notes/v0.1.3.mddiff --git a/release-notes/v0.1.4.md b/docs/release-notes/v0.1.4.mdsimilarity index 100%rename from release-notes/v0.1.4.mdrename to docs/release-notes/v0.1.4.mddiff --git a/release-notes/v0.1.5.md b/docs/release-notes/v0.1.5.mdsimilarity index 100%rename from release-notes/v0.1.5.mdrename to docs/release-notes/v0.1.5.mddiff --git a/release-notes/v0.1.6.md b/docs/release-notes/v0.1.6.mdsimilarity index 100%rename from release-notes/v0.1.6.mdrename to docs/release-notes/v0.1.6.mddiff --git a/release-notes/v0.1.7.md b/docs/release-notes/v0.1.7.mdsimilarity index 100%rename from release-notes/v0.1.7.mdrename to docs/release-notes/v0.1.7.mddiff --git a/release-notes/v0.1.8.md b/docs/release-notes/v0.1.8.mdsimilarity index 100%rename from release-notes/v0.1.8.mdrename to docs/release-notes/v0.1.8.mddiff --git a/release-notes/v0.1.9.md b/docs/release-notes/v0.1.9.mdsimilarity index 100%rename from release-notes/v0.1.9.mdrename to docs/release-notes/v0.1.9.mddiff --git a/drizzle-pg.config.ts b/drizzle/pg.config.tssimilarity index 83%rename from drizzle-pg.config.tsrename to drizzle/pg.config.tsindex 6ed09227..085b887c 100644--- a/drizzle-pg.config.ts+++ b/drizzle/pg.config.ts@@ -1,5 +1,5 @@import { defineConfig } from "drizzle-kit";-import { loadLocalEnv } from "./scripts/cli-utils";+import { loadLocalEnv } from "../scripts/cli-utils";// Pull POSTGRES_DATABASE_URL from .env.local (no-op if already in the shell env),// so the migration runbooks' single .env.local works for `db:migrate:pg` too.@@ -8,7 +8,7 @@ loadLocalEnv();export default defineConfig({dialect: "postgresql",schema: "./src/db/pg/schema.ts",- out: "./drizzle-pg",+ out: "./drizzle/pg",dbCredentials: {url: process.env.POSTGRES_DATABASE_URL!,},diff --git a/drizzle-pg/0000_fixed_nico_minoru.sql b/drizzle/pg/0000_fixed_nico_minoru.sqlsimilarity index 100%rename from drizzle-pg/0000_fixed_nico_minoru.sqlrename to drizzle/pg/0000_fixed_nico_minoru.sqldiff --git a/drizzle-pg/0001_striped_bulldozer.sql b/drizzle/pg/0001_striped_bulldozer.sqlsimilarity index 100%rename from drizzle-pg/0001_striped_bulldozer.sqlrename to drizzle/pg/0001_striped_bulldozer.sqldiff --git a/drizzle-pg/0002_clean_moira_mactaggert.sql b/drizzle/pg/0002_clean_moira_mactaggert.sqlsimilarity index 100%rename from drizzle-pg/0002_clean_moira_mactaggert.sqlrename to drizzle/pg/0002_clean_moira_mactaggert.sqldiff --git a/drizzle-pg/0003_sturdy_may_parker.sql b/drizzle/pg/0003_sturdy_may_parker.sqlsimilarity index 100%rename from drizzle-pg/0003_sturdy_may_parker.sqlrename to drizzle/pg/0003_sturdy_may_parker.sqldiff --git a/drizzle-pg/0004_dashing_betty_ross.sql b/drizzle/pg/0004_dashing_betty_ross.sqlsimilarity index 100%rename from drizzle-pg/0004_dashing_betty_ross.sqlrename to drizzle/pg/0004_dashing_betty_ross.sqldiff --git a/drizzle-pg/0005_talented_wild_pack.sql b/drizzle/pg/0005_talented_wild_pack.sqlsimilarity index 100%rename from drizzle-pg/0005_talented_wild_pack.sqlrename to drizzle/pg/0005_talented_wild_pack.sqldiff --git a/drizzle-pg/0006_location_name.sql b/drizzle/pg/0006_location_name.sqlsimilarity index 100%rename from drizzle-pg/0006_location_name.sqlrename to drizzle/pg/0006_location_name.sqldiff --git a/drizzle-pg/0007_same_marvel_zombies.sql b/drizzle/pg/0007_same_marvel_zombies.sqlsimilarity index 100%rename from drizzle-pg/0007_same_marvel_zombies.sqlrename to drizzle/pg/0007_same_marvel_zombies.sqldiff --git a/drizzle-pg/0008_yummy_annihilus.sql b/drizzle/pg/0008_yummy_annihilus.sqlsimilarity index 100%rename from drizzle-pg/0008_yummy_annihilus.sqlrename to drizzle/pg/0008_yummy_annihilus.sqldiff --git a/drizzle-pg/0009_supreme_captain_stacy.sql b/drizzle/pg/0009_supreme_captain_stacy.sqlsimilarity index 100%rename from drizzle-pg/0009_supreme_captain_stacy.sqlrename to drizzle/pg/0009_supreme_captain_stacy.sqldiff --git a/drizzle-pg/0010_overrated_amazoness.sql b/drizzle/pg/0010_overrated_amazoness.sqlsimilarity index 100%rename from drizzle-pg/0010_overrated_amazoness.sqlrename to drizzle/pg/0010_overrated_amazoness.sqldiff --git a/drizzle-pg/0011_friendly_morlun.sql b/drizzle/pg/0011_friendly_morlun.sqlsimilarity index 100%rename from drizzle-pg/0011_friendly_morlun.sqlrename to drizzle/pg/0011_friendly_morlun.sqldiff --git a/drizzle-pg/0012_dashboard.sql b/drizzle/pg/0012_dashboard.sqlsimilarity index 100%rename from drizzle-pg/0012_dashboard.sqlrename to drizzle/pg/0012_dashboard.sqldiff --git a/drizzle-pg/0013_sleepy_black_tarantula.sql b/drizzle/pg/0013_sleepy_black_tarantula.sqlsimilarity index 100%rename from drizzle-pg/0013_sleepy_black_tarantula.sqlrename to drizzle/pg/0013_sleepy_black_tarantula.sqldiff --git a/drizzle-pg/0014_solid_centennial.sql b/drizzle/pg/0014_solid_centennial.sqlsimilarity index 100%rename from drizzle-pg/0014_solid_centennial.sqlrename to drizzle/pg/0014_solid_centennial.sqldiff --git a/drizzle-pg/0015_sticky_dagger.sql b/drizzle/pg/0015_sticky_dagger.sqlsimilarity index 100%rename from drizzle-pg/0015_sticky_dagger.sqlrename to drizzle/pg/0015_sticky_dagger.sqldiff --git a/drizzle-pg/0016_panoramic_blob.sql b/drizzle/pg/0016_panoramic_blob.sqlsimilarity index 100%rename from drizzle-pg/0016_panoramic_blob.sqlrename to drizzle/pg/0016_panoramic_blob.sqldiff --git a/drizzle-pg/0017_ga4_connections.sql b/drizzle/pg/0017_ga4_connections.sqlsimilarity index 100%rename from drizzle-pg/0017_ga4_connections.sqlrename to drizzle/pg/0017_ga4_connections.sqldiff --git a/drizzle-pg/0018_drop_reddit_attributions.sql b/drizzle/pg/0018_drop_reddit_attributions.sqlsimilarity index 100%rename from drizzle-pg/0018_drop_reddit_attributions.sqlrename to drizzle/pg/0018_drop_reddit_attributions.sqldiff --git a/drizzle-pg/0019_clammy_selene.sql b/drizzle/pg/0019_clammy_selene.sqlsimilarity index 100%rename from drizzle-pg/0019_clammy_selene.sqlrename to drizzle/pg/0019_clammy_selene.sqldiff --git a/drizzle-pg/0020_project_memory.sql b/drizzle/pg/0020_project_memory.sqlsimilarity index 100%rename from drizzle-pg/0020_project_memory.sqlrename to drizzle/pg/0020_project_memory.sqldiff --git a/drizzle-pg/0021_user_last_active_organization.sql b/drizzle/pg/0021_user_last_active_organization.sqlsimilarity index 100%rename from drizzle-pg/0021_user_last_active_organization.sqlrename to drizzle/pg/0021_user_last_active_organization.sqldiff --git a/drizzle-pg/0022_third_supernaut.sql b/drizzle/pg/0022_third_supernaut.sqlsimilarity index 100%rename from drizzle-pg/0022_third_supernaut.sqlrename to drizzle/pg/0022_third_supernaut.sqldiff --git a/drizzle-pg/0023_clammy_screwball.sql b/drizzle/pg/0023_clammy_screwball.sqlsimilarity index 100%rename from drizzle-pg/0023_clammy_screwball.sqlrename to drizzle/pg/0023_clammy_screwball.sqldiff --git a/drizzle-pg/0024_tense_echo.sql b/drizzle/pg/0024_tense_echo.sqlsimilarity index 100%rename from drizzle-pg/0024_tense_echo.sqlrename to drizzle/pg/0024_tense_echo.sqldiff --git a/drizzle-pg/0025_reports.sql b/drizzle/pg/0025_reports.sqlsimilarity index 100%rename from drizzle-pg/0025_reports.sqlrename to drizzle/pg/0025_reports.sqldiff --git a/drizzle-pg/0026_minor_dreadnoughts.sql b/drizzle/pg/0026_minor_dreadnoughts.sqlsimilarity index 100%rename from drizzle-pg/0026_minor_dreadnoughts.sqlrename to drizzle/pg/0026_minor_dreadnoughts.sqldiff --git a/drizzle-pg/0027_keyword_step.sql b/drizzle/pg/0027_keyword_step.sqlsimilarity index 100%rename from drizzle-pg/0027_keyword_step.sqlrename to drizzle/pg/0027_keyword_step.sqldiff --git a/drizzle-pg/0028_modern_nekra.sql b/drizzle/pg/0028_modern_nekra.sqlsimilarity index 100%rename from drizzle-pg/0028_modern_nekra.sqlrename to drizzle/pg/0028_modern_nekra.sqldiff --git a/drizzle-pg/meta/0000_snapshot.json b/drizzle/pg/meta/0000_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0000_snapshot.jsonrename to drizzle/pg/meta/0000_snapshot.jsondiff --git a/drizzle-pg/meta/0001_snapshot.json b/drizzle/pg/meta/0001_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0001_snapshot.jsonrename to drizzle/pg/meta/0001_snapshot.jsondiff --git a/drizzle-pg/meta/0002_snapshot.json b/drizzle/pg/meta/0002_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0002_snapshot.jsonrename to drizzle/pg/meta/0002_snapshot.jsondiff --git a/drizzle-pg/meta/0003_snapshot.json b/drizzle/pg/meta/0003_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0003_snapshot.jsonrename to drizzle/pg/meta/0003_snapshot.jsondiff --git a/drizzle-pg/meta/0004_snapshot.json b/drizzle/pg/meta/0004_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0004_snapshot.jsonrename to drizzle/pg/meta/0004_snapshot.jsondiff --git a/drizzle-pg/meta/0005_snapshot.json b/drizzle/pg/meta/0005_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0005_snapshot.jsonrename to drizzle/pg/meta/0005_snapshot.jsondiff --git a/drizzle-pg/meta/0006_snapshot.json b/drizzle/pg/meta/0006_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0006_snapshot.jsonrename to drizzle/pg/meta/0006_snapshot.jsondiff --git a/drizzle-pg/meta/0007_snapshot.json b/drizzle/pg/meta/0007_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0007_snapshot.jsonrename to drizzle/pg/meta/0007_snapshot.jsondiff --git a/drizzle-pg/meta/0008_snapshot.json b/drizzle/pg/meta/0008_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0008_snapshot.jsonrename to drizzle/pg/meta/0008_snapshot.jsondiff --git a/drizzle-pg/meta/0009_snapshot.json b/drizzle/pg/meta/0009_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0009_snapshot.jsonrename to drizzle/pg/meta/0009_snapshot.jsondiff --git a/drizzle-pg/meta/0010_snapshot.json b/drizzle/pg/meta/0010_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0010_snapshot.jsonrename to drizzle/pg/meta/0010_snapshot.jsondiff --git a/drizzle-pg/meta/0011_snapshot.json b/drizzle/pg/meta/0011_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0011_snapshot.jsonrename to drizzle/pg/meta/0011_snapshot.jsondiff --git a/drizzle-pg/meta/0012_snapshot.json b/drizzle/pg/meta/0012_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0012_snapshot.jsonrename to drizzle/pg/meta/0012_snapshot.jsondiff --git a/drizzle-pg/meta/0013_snapshot.json b/drizzle/pg/meta/0013_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0013_snapshot.jsonrename to drizzle/pg/meta/0013_snapshot.jsondiff --git a/drizzle-pg/meta/0014_snapshot.json b/drizzle/pg/meta/0014_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0014_snapshot.jsonrename to drizzle/pg/meta/0014_snapshot.jsondiff --git a/drizzle-pg/meta/0015_snapshot.json b/drizzle/pg/meta/0015_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0015_snapshot.jsonrename to drizzle/pg/meta/0015_snapshot.jsondiff --git a/drizzle-pg/meta/0016_snapshot.json b/drizzle/pg/meta/0016_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0016_snapshot.jsonrename to drizzle/pg/meta/0016_snapshot.jsondiff --git a/drizzle-pg/meta/0017_snapshot.json b/drizzle/pg/meta/0017_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0017_snapshot.jsonrename to drizzle/pg/meta/0017_snapshot.jsondiff --git a/drizzle-pg/meta/0018_snapshot.json b/drizzle/pg/meta/0018_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0018_snapshot.jsonrename to drizzle/pg/meta/0018_snapshot.jsondiff --git a/drizzle-pg/meta/0019_snapshot.json b/drizzle/pg/meta/0019_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0019_snapshot.jsonrename to drizzle/pg/meta/0019_snapshot.jsondiff --git a/drizzle-pg/meta/0020_snapshot.json b/drizzle/pg/meta/0020_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0020_snapshot.jsonrename to drizzle/pg/meta/0020_snapshot.jsondiff --git a/drizzle-pg/meta/0021_snapshot.json b/drizzle/pg/meta/0021_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0021_snapshot.jsonrename to drizzle/pg/meta/0021_snapshot.jsondiff --git a/drizzle-pg/meta/0022_snapshot.json b/drizzle/pg/meta/0022_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0022_snapshot.jsonrename to drizzle/pg/meta/0022_snapshot.jsondiff --git a/drizzle-pg/meta/0023_snapshot.json b/drizzle/pg/meta/0023_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0023_snapshot.jsonrename to drizzle/pg/meta/0023_snapshot.jsondiff --git a/drizzle-pg/meta/0024_snapshot.json b/drizzle/pg/meta/0024_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0024_snapshot.jsonrename to drizzle/pg/meta/0024_snapshot.jsondiff --git a/drizzle-pg/meta/0025_snapshot.json b/drizzle/pg/meta/0025_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0025_snapshot.jsonrename to drizzle/pg/meta/0025_snapshot.jsondiff --git a/drizzle-pg/meta/0026_snapshot.json b/drizzle/pg/meta/0026_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0026_snapshot.jsonrename to drizzle/pg/meta/0026_snapshot.jsondiff --git a/drizzle-pg/meta/0027_snapshot.json b/drizzle/pg/meta/0027_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0027_snapshot.jsonrename to drizzle/pg/meta/0027_snapshot.jsondiff --git a/drizzle-pg/meta/0028_snapshot.json b/drizzle/pg/meta/0028_snapshot.jsonsimilarity index 100%rename from drizzle-pg/meta/0028_snapshot.jsonrename to drizzle/pg/meta/0028_snapshot.jsondiff --git a/drizzle-pg/meta/_journal.json b/drizzle/pg/meta/_journal.jsonsimilarity index 100%rename from drizzle-pg/meta/_journal.jsonrename to drizzle/pg/meta/_journal.jsondiff --git a/drizzle-prod.config.ts b/drizzle/remote-d1.config.tssimilarity index 92%rename from drizzle-prod.config.tsrename to drizzle/remote-d1.config.tsindex ace7ec44..4ada08ea 100644--- a/drizzle-prod.config.ts+++ b/drizzle/remote-d1.config.ts@@ -3,7 +3,7 @@ import { defineConfig } from "drizzle-kit";export default defineConfig({dialect: "sqlite",schema: "./src/db/schema.ts",- out: "./drizzle",+ out: "./drizzle/sqlite",driver: "d1-http",dbCredentials: {accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,diff --git a/drizzle.config.ts b/drizzle/sqlite.config.tssimilarity index 94%rename from drizzle.config.tsrename to drizzle/sqlite.config.tsindex 75fafd5a..fa27d98f 100644--- a/drizzle.config.ts+++ b/drizzle/sqlite.config.ts@@ -8,7 +8,7 @@ export default defineConfig({// The raw SQLite barrel (not ../schema, the provider-aware one, which imports// cloudflare:workers and can't load under drizzle-kit's node runtime).schema: "./src/db/d1/schema.ts",- out: "./drizzle",+ out: "./drizzle/sqlite",dbCredentials: {url: localUrl || "", // Empty fallback for CI/non-dev environments},diff --git a/drizzle/0000_fantastic_vanisher.sql b/drizzle/sqlite/0000_fantastic_vanisher.sqlsimilarity index 100%rename from drizzle/0000_fantastic_vanisher.sqlrename to drizzle/sqlite/0000_fantastic_vanisher.sqldiff --git a/drizzle/0001_round_unus.sql b/drizzle/sqlite/0001_round_unus.sqlsimilarity index 100%rename from drizzle/0001_round_unus.sqlrename to drizzle/sqlite/0001_round_unus.sqldiff --git a/drizzle/0002_fair_toad_men.sql b/drizzle/sqlite/0002_fair_toad_men.sqlsimilarity index 100%rename from drizzle/0002_fair_toad_men.sqlrename to drizzle/sqlite/0002_fair_toad_men.sqldiff --git a/drizzle/0003_light_sage.sql b/drizzle/sqlite/0003_light_sage.sqlsimilarity index 100%rename from drizzle/0003_light_sage.sqlrename to drizzle/sqlite/0003_light_sage.sqldiff --git a/drizzle/0004_faithful_sunset_bain.sql b/drizzle/sqlite/0004_faithful_sunset_bain.sqlsimilarity index 100%rename from drizzle/0004_faithful_sunset_bain.sqlrename to drizzle/sqlite/0004_faithful_sunset_bain.sqldiff --git a/drizzle/0005_low_red_hulk.sql b/drizzle/sqlite/0005_low_red_hulk.sqlsimilarity index 100%rename from drizzle/0005_low_red_hulk.sqlrename to drizzle/sqlite/0005_low_red_hulk.sqldiff --git a/drizzle/0006_magical_alex_wilder.sql b/drizzle/sqlite/0006_magical_alex_wilder.sqlsimilarity index 100%rename from drizzle/0006_magical_alex_wilder.sqlrename to drizzle/sqlite/0006_magical_alex_wilder.sqldiff --git a/drizzle/0007_sour_risque.sql b/drizzle/sqlite/0007_sour_risque.sqlsimilarity index 100%rename from drizzle/0007_sour_risque.sqlrename to drizzle/sqlite/0007_sour_risque.sqldiff --git a/drizzle/0008_luxuriant_colossus.sql b/drizzle/sqlite/0008_luxuriant_colossus.sqlsimilarity index 100%rename from drizzle/0008_luxuriant_colossus.sqlrename to drizzle/sqlite/0008_luxuriant_colossus.sqldiff --git a/drizzle/0009_smart_kitty_pryde.sql b/drizzle/sqlite/0009_smart_kitty_pryde.sqlsimilarity index 100%rename from drizzle/0009_smart_kitty_pryde.sqlrename to drizzle/sqlite/0009_smart_kitty_pryde.sqldiff --git a/drizzle/0010_high_liz_osborn.sql b/drizzle/sqlite/0010_high_liz_osborn.sqlsimilarity index 100%rename from drizzle/0010_high_liz_osborn.sqlrename to drizzle/sqlite/0010_high_liz_osborn.sqldiff --git a/drizzle/0011_colorful_dark_beast.sql b/drizzle/sqlite/0011_colorful_dark_beast.sqlsimilarity index 100%rename from drizzle/0011_colorful_dark_beast.sqlrename to drizzle/sqlite/0011_colorful_dark_beast.sqldiff --git a/drizzle/0012_closed_impossible_man.sql b/drizzle/sqlite/0012_closed_impossible_man.sqlsimilarity index 100%rename from drizzle/0012_closed_impossible_man.sqlrename to drizzle/sqlite/0012_closed_impossible_man.sqldiff --git a/drizzle/0013_fat_network.sql b/drizzle/sqlite/0013_fat_network.sqlsimilarity index 100%rename from drizzle/0013_fat_network.sqlrename to drizzle/sqlite/0013_fat_network.sqldiff --git a/drizzle/0014_tag_color.sql b/drizzle/sqlite/0014_tag_color.sqlsimilarity index 100%rename from drizzle/0014_tag_color.sqlrename to drizzle/sqlite/0014_tag_color.sqldiff --git a/drizzle/0015_huge_celestials.sql b/drizzle/sqlite/0015_huge_celestials.sqlsimilarity index 100%rename from drizzle/0015_huge_celestials.sqlrename to drizzle/sqlite/0015_huge_celestials.sqldiff --git a/drizzle/0016_magical_the_fallen.sql b/drizzle/sqlite/0016_magical_the_fallen.sqlsimilarity index 100%rename from drizzle/0016_magical_the_fallen.sqlrename to drizzle/sqlite/0016_magical_the_fallen.sqldiff --git a/drizzle/0017_omniscient_dagger.sql b/drizzle/sqlite/0017_omniscient_dagger.sqlsimilarity index 100%rename from drizzle/0017_omniscient_dagger.sqlrename to drizzle/sqlite/0017_omniscient_dagger.sqldiff --git a/drizzle/0018_minor_mad_thinker.sql b/drizzle/sqlite/0018_minor_mad_thinker.sqlsimilarity index 100%rename from drizzle/0018_minor_mad_thinker.sqlrename to drizzle/sqlite/0018_minor_mad_thinker.sqldiff --git a/drizzle/0019_true_absorbing_man.sql b/drizzle/sqlite/0019_true_absorbing_man.sqlsimilarity index 100%rename from drizzle/0019_true_absorbing_man.sqlrename to drizzle/sqlite/0019_true_absorbing_man.sqldiff --git a/drizzle/0020_drop_delegated_users.sql b/drizzle/sqlite/0020_drop_delegated_users.sqlsimilarity index 100%rename from drizzle/0020_drop_delegated_users.sqlrename to drizzle/sqlite/0020_drop_delegated_users.sqldiff --git a/drizzle/0021_autumn_billing.sql b/drizzle/sqlite/0021_autumn_billing.sqlsimilarity index 100%rename from drizzle/0021_autumn_billing.sqlrename to drizzle/sqlite/0021_autumn_billing.sqldiff --git a/drizzle/0022_purple_hitman.sql b/drizzle/sqlite/0022_purple_hitman.sqlsimilarity index 100%rename from drizzle/0022_purple_hitman.sqlrename to drizzle/sqlite/0022_purple_hitman.sqldiff --git a/drizzle/0023_sad_cobalt_man.sql b/drizzle/sqlite/0023_sad_cobalt_man.sqlsimilarity index 100%rename from drizzle/0023_sad_cobalt_man.sqlrename to drizzle/sqlite/0023_sad_cobalt_man.sqldiff --git a/drizzle/0024_clumsy_barracuda.sql b/drizzle/sqlite/0024_clumsy_barracuda.sqlsimilarity index 100%rename from drizzle/0024_clumsy_barracuda.sqlrename to drizzle/sqlite/0024_clumsy_barracuda.sqldiff --git a/drizzle/0025_loving_mojo.sql b/drizzle/sqlite/0025_loving_mojo.sqlsimilarity index 100%rename from drizzle/0025_loving_mojo.sqlrename to drizzle/sqlite/0025_loving_mojo.sqldiff --git a/drizzle/0026_wide_red_skull.sql b/drizzle/sqlite/0026_wide_red_skull.sqlsimilarity index 100%rename from drizzle/0026_wide_red_skull.sqlrename to drizzle/sqlite/0026_wide_red_skull.sqldiff --git a/drizzle/0027_reflective_molten_man.sql b/drizzle/sqlite/0027_reflective_molten_man.sqlsimilarity index 100%rename from drizzle/0027_reflective_molten_man.sqlrename to drizzle/sqlite/0027_reflective_molten_man.sqldiff --git a/drizzle/0028_empty_beyonder.sql b/drizzle/sqlite/0028_empty_beyonder.sqlsimilarity index 100%rename from drizzle/0028_empty_beyonder.sqlrename to drizzle/sqlite/0028_empty_beyonder.sqldiff --git a/drizzle/0029_location_name.sql b/drizzle/sqlite/0029_location_name.sqlsimilarity index 100%rename from drizzle/0029_location_name.sqlrename to drizzle/sqlite/0029_location_name.sqldiff --git a/drizzle/0030_legal_reaper.sql b/drizzle/sqlite/0030_legal_reaper.sqlsimilarity index 100%rename from drizzle/0030_legal_reaper.sqlrename to drizzle/sqlite/0030_legal_reaper.sqldiff --git a/drizzle/0031_furry_monster_badoon.sql b/drizzle/sqlite/0031_furry_monster_badoon.sqlsimilarity index 100%rename from drizzle/0031_furry_monster_badoon.sqlrename to drizzle/sqlite/0031_furry_monster_badoon.sqldiff --git a/drizzle/0032_public_shinko_yamashiro.sql b/drizzle/sqlite/0032_public_shinko_yamashiro.sqlsimilarity index 100%rename from drizzle/0032_public_shinko_yamashiro.sqlrename to drizzle/sqlite/0032_public_shinko_yamashiro.sqldiff --git a/drizzle/0033_first_rick_jones.sql b/drizzle/sqlite/0033_first_rick_jones.sqlsimilarity index 100%rename from drizzle/0033_first_rick_jones.sqlrename to drizzle/sqlite/0033_first_rick_jones.sqldiff --git a/drizzle/0034_wonderful_skrulls.sql b/drizzle/sqlite/0034_wonderful_skrulls.sqlsimilarity index 100%rename from drizzle/0034_wonderful_skrulls.sqlrename to drizzle/sqlite/0034_wonderful_skrulls.sqldiff --git a/drizzle/0035_dashboard.sql b/drizzle/sqlite/0035_dashboard.sqlsimilarity index 100%rename from drizzle/0035_dashboard.sqlrename to drizzle/sqlite/0035_dashboard.sqldiff --git a/drizzle/0036_curvy_silk_fever.sql b/drizzle/sqlite/0036_curvy_silk_fever.sqlsimilarity index 100%rename from drizzle/0036_curvy_silk_fever.sqlrename to drizzle/sqlite/0036_curvy_silk_fever.sqldiff --git a/drizzle/0037_small_caretaker.sql b/drizzle/sqlite/0037_small_caretaker.sqlsimilarity index 100%rename from drizzle/0037_small_caretaker.sqlrename to drizzle/sqlite/0037_small_caretaker.sqldiff --git a/drizzle/0038_happy_steel_serpent.sql b/drizzle/sqlite/0038_happy_steel_serpent.sqlsimilarity index 100%rename from drizzle/0038_happy_steel_serpent.sqlrename to drizzle/sqlite/0038_happy_steel_serpent.sqldiff --git a/drizzle/0039_ga4_connections.sql b/drizzle/sqlite/0039_ga4_connections.sqlsimilarity index 100%rename from drizzle/0039_ga4_connections.sqlrename to drizzle/sqlite/0039_ga4_connections.sqldiff --git a/drizzle/0040_drop_reddit_attributions.sql b/drizzle/sqlite/0040_drop_reddit_attributions.sqlsimilarity index 100%rename from drizzle/0040_drop_reddit_attributions.sqlrename to drizzle/sqlite/0040_drop_reddit_attributions.sqldiff --git a/drizzle/0041_free_marvex.sql b/drizzle/sqlite/0041_free_marvex.sqlsimilarity index 100%rename from drizzle/0041_free_marvex.sqlrename to drizzle/sqlite/0041_free_marvex.sqldiff --git a/drizzle/0042_project_memory.sql b/drizzle/sqlite/0042_project_memory.sqlsimilarity index 100%rename from drizzle/0042_project_memory.sqlrename to drizzle/sqlite/0042_project_memory.sqldiff --git a/drizzle/0043_user_last_active_organization.sql b/drizzle/sqlite/0043_user_last_active_organization.sqlsimilarity index 100%rename from drizzle/0043_user_last_active_organization.sqlrename to drizzle/sqlite/0043_user_last_active_organization.sqldiff --git a/drizzle/0044_outstanding_sage.sql b/drizzle/sqlite/0044_outstanding_sage.sqlsimilarity index 100%rename from drizzle/0044_outstanding_sage.sqlrename to drizzle/sqlite/0044_outstanding_sage.sqldiff --git a/drizzle/0045_slimy_master_chief.sql b/drizzle/sqlite/0045_slimy_master_chief.sqlsimilarity index 100%rename from drizzle/0045_slimy_master_chief.sqlrename to drizzle/sqlite/0045_slimy_master_chief.sqldiff --git a/drizzle/0046_plain_the_watchers.sql b/drizzle/sqlite/0046_plain_the_watchers.sqlsimilarity index 100%rename from drizzle/0046_plain_the_watchers.sqlrename to drizzle/sqlite/0046_plain_the_watchers.sqldiff --git a/drizzle/0047_reports.sql b/drizzle/sqlite/0047_reports.sqlsimilarity index 100%rename from drizzle/0047_reports.sqlrename to drizzle/sqlite/0047_reports.sqldiff --git a/drizzle/0048_graceful_white_queen.sql b/drizzle/sqlite/0048_graceful_white_queen.sqlsimilarity index 100%rename from drizzle/0048_graceful_white_queen.sqlrename to drizzle/sqlite/0048_graceful_white_queen.sqldiff --git a/drizzle/0049_keyword_step.sql b/drizzle/sqlite/0049_keyword_step.sqlsimilarity index 100%rename from drizzle/0049_keyword_step.sqlrename to drizzle/sqlite/0049_keyword_step.sqldiff --git a/drizzle/0050_famous_crystal.sql b/drizzle/sqlite/0050_famous_crystal.sqlsimilarity index 100%rename from drizzle/0050_famous_crystal.sqlrename to drizzle/sqlite/0050_famous_crystal.sqldiff --git a/drizzle/meta/0000_snapshot.json b/drizzle/sqlite/meta/0000_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0000_snapshot.jsonrename to drizzle/sqlite/meta/0000_snapshot.jsondiff --git a/drizzle/meta/0001_snapshot.json b/drizzle/sqlite/meta/0001_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0001_snapshot.jsonrename to drizzle/sqlite/meta/0001_snapshot.jsondiff --git a/drizzle/meta/0002_snapshot.json b/drizzle/sqlite/meta/0002_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0002_snapshot.jsonrename to drizzle/sqlite/meta/0002_snapshot.jsondiff --git a/drizzle/meta/0003_snapshot.json b/drizzle/sqlite/meta/0003_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0003_snapshot.jsonrename to drizzle/sqlite/meta/0003_snapshot.jsondiff --git a/drizzle/meta/0004_snapshot.json b/drizzle/sqlite/meta/0004_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0004_snapshot.jsonrename to drizzle/sqlite/meta/0004_snapshot.jsondiff --git a/drizzle/meta/0005_snapshot.json b/drizzle/sqlite/meta/0005_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0005_snapshot.jsonrename to drizzle/sqlite/meta/0005_snapshot.jsondiff --git a/drizzle/meta/0006_snapshot.json b/drizzle/sqlite/meta/0006_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0006_snapshot.jsonrename to drizzle/sqlite/meta/0006_snapshot.jsondiff --git a/drizzle/meta/0007_snapshot.json b/drizzle/sqlite/meta/0007_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0007_snapshot.jsonrename to drizzle/sqlite/meta/0007_snapshot.jsondiff --git a/drizzle/meta/0008_snapshot.json b/drizzle/sqlite/meta/0008_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0008_snapshot.jsonrename to drizzle/sqlite/meta/0008_snapshot.jsondiff --git a/drizzle/meta/0009_snapshot.json b/drizzle/sqlite/meta/0009_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0009_snapshot.jsonrename to drizzle/sqlite/meta/0009_snapshot.jsondiff --git a/drizzle/meta/0010_snapshot.json b/drizzle/sqlite/meta/0010_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0010_snapshot.jsonrename to drizzle/sqlite/meta/0010_snapshot.jsondiff --git a/drizzle/meta/0011_snapshot.json b/drizzle/sqlite/meta/0011_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0011_snapshot.jsonrename to drizzle/sqlite/meta/0011_snapshot.jsondiff --git a/drizzle/meta/0012_snapshot.json b/drizzle/sqlite/meta/0012_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0012_snapshot.jsonrename to drizzle/sqlite/meta/0012_snapshot.jsondiff --git a/drizzle/meta/0013_snapshot.json b/drizzle/sqlite/meta/0013_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0013_snapshot.jsonrename to drizzle/sqlite/meta/0013_snapshot.jsondiff --git a/drizzle/meta/0014_snapshot.json b/drizzle/sqlite/meta/0014_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0014_snapshot.jsonrename to drizzle/sqlite/meta/0014_snapshot.jsondiff --git a/drizzle/meta/0015_snapshot.json b/drizzle/sqlite/meta/0015_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0015_snapshot.jsonrename to drizzle/sqlite/meta/0015_snapshot.jsondiff --git a/drizzle/meta/0016_snapshot.json b/drizzle/sqlite/meta/0016_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0016_snapshot.jsonrename to drizzle/sqlite/meta/0016_snapshot.jsondiff --git a/drizzle/meta/0017_snapshot.json b/drizzle/sqlite/meta/0017_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0017_snapshot.jsonrename to drizzle/sqlite/meta/0017_snapshot.jsondiff --git a/drizzle/meta/0018_snapshot.json b/drizzle/sqlite/meta/0018_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0018_snapshot.jsonrename to drizzle/sqlite/meta/0018_snapshot.jsondiff --git a/drizzle/meta/0019_snapshot.json b/drizzle/sqlite/meta/0019_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0019_snapshot.jsonrename to drizzle/sqlite/meta/0019_snapshot.jsondiff --git a/drizzle/meta/0020_snapshot.json b/drizzle/sqlite/meta/0020_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0020_snapshot.jsonrename to drizzle/sqlite/meta/0020_snapshot.jsondiff --git a/drizzle/meta/0021_snapshot.json b/drizzle/sqlite/meta/0021_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0021_snapshot.jsonrename to drizzle/sqlite/meta/0021_snapshot.jsondiff --git a/drizzle/meta/0022_snapshot.json b/drizzle/sqlite/meta/0022_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0022_snapshot.jsonrename to drizzle/sqlite/meta/0022_snapshot.jsondiff --git a/drizzle/meta/0023_snapshot.json b/drizzle/sqlite/meta/0023_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0023_snapshot.jsonrename to drizzle/sqlite/meta/0023_snapshot.jsondiff --git a/drizzle/meta/0024_snapshot.json b/drizzle/sqlite/meta/0024_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0024_snapshot.jsonrename to drizzle/sqlite/meta/0024_snapshot.jsondiff --git a/drizzle/meta/0025_snapshot.json b/drizzle/sqlite/meta/0025_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0025_snapshot.jsonrename to drizzle/sqlite/meta/0025_snapshot.jsondiff --git a/drizzle/meta/0026_snapshot.json b/drizzle/sqlite/meta/0026_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0026_snapshot.jsonrename to drizzle/sqlite/meta/0026_snapshot.jsondiff --git a/drizzle/meta/0027_snapshot.json b/drizzle/sqlite/meta/0027_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0027_snapshot.jsonrename to drizzle/sqlite/meta/0027_snapshot.jsondiff --git a/drizzle/meta/0028_snapshot.json b/drizzle/sqlite/meta/0028_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0028_snapshot.jsonrename to drizzle/sqlite/meta/0028_snapshot.jsondiff --git a/drizzle/meta/0029_snapshot.json b/drizzle/sqlite/meta/0029_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0029_snapshot.jsonrename to drizzle/sqlite/meta/0029_snapshot.jsondiff --git a/drizzle/meta/0030_snapshot.json b/drizzle/sqlite/meta/0030_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0030_snapshot.jsonrename to drizzle/sqlite/meta/0030_snapshot.jsondiff --git a/drizzle/meta/0031_snapshot.json b/drizzle/sqlite/meta/0031_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0031_snapshot.jsonrename to drizzle/sqlite/meta/0031_snapshot.jsondiff --git a/drizzle/meta/0032_snapshot.json b/drizzle/sqlite/meta/0032_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0032_snapshot.jsonrename to drizzle/sqlite/meta/0032_snapshot.jsondiff --git a/drizzle/meta/0033_snapshot.json b/drizzle/sqlite/meta/0033_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0033_snapshot.jsonrename to drizzle/sqlite/meta/0033_snapshot.jsondiff --git a/drizzle/meta/0034_snapshot.json b/drizzle/sqlite/meta/0034_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0034_snapshot.jsonrename to drizzle/sqlite/meta/0034_snapshot.jsondiff --git a/drizzle/meta/0035_snapshot.json b/drizzle/sqlite/meta/0035_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0035_snapshot.jsonrename to drizzle/sqlite/meta/0035_snapshot.jsondiff --git a/drizzle/meta/0036_snapshot.json b/drizzle/sqlite/meta/0036_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0036_snapshot.jsonrename to drizzle/sqlite/meta/0036_snapshot.jsondiff --git a/drizzle/meta/0037_snapshot.json b/drizzle/sqlite/meta/0037_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0037_snapshot.jsonrename to drizzle/sqlite/meta/0037_snapshot.jsondiff --git a/drizzle/meta/0038_snapshot.json b/drizzle/sqlite/meta/0038_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0038_snapshot.jsonrename to drizzle/sqlite/meta/0038_snapshot.jsondiff --git a/drizzle/meta/0039_snapshot.json b/drizzle/sqlite/meta/0039_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0039_snapshot.jsonrename to drizzle/sqlite/meta/0039_snapshot.jsondiff --git a/drizzle/meta/0040_snapshot.json b/drizzle/sqlite/meta/0040_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0040_snapshot.jsonrename to drizzle/sqlite/meta/0040_snapshot.jsondiff --git a/drizzle/meta/0041_snapshot.json b/drizzle/sqlite/meta/0041_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0041_snapshot.jsonrename to drizzle/sqlite/meta/0041_snapshot.jsondiff --git a/drizzle/meta/0042_snapshot.json b/drizzle/sqlite/meta/0042_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0042_snapshot.jsonrename to drizzle/sqlite/meta/0042_snapshot.jsondiff --git a/drizzle/meta/0043_snapshot.json b/drizzle/sqlite/meta/0043_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0043_snapshot.jsonrename to drizzle/sqlite/meta/0043_snapshot.jsondiff --git a/drizzle/meta/0044_snapshot.json b/drizzle/sqlite/meta/0044_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0044_snapshot.jsonrename to drizzle/sqlite/meta/0044_snapshot.jsondiff --git a/drizzle/meta/0045_snapshot.json b/drizzle/sqlite/meta/0045_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0045_snapshot.jsonrename to drizzle/sqlite/meta/0045_snapshot.jsondiff --git a/drizzle/meta/0046_snapshot.json b/drizzle/sqlite/meta/0046_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0046_snapshot.jsonrename to drizzle/sqlite/meta/0046_snapshot.jsondiff --git a/drizzle/meta/0047_snapshot.json b/drizzle/sqlite/meta/0047_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0047_snapshot.jsonrename to drizzle/sqlite/meta/0047_snapshot.jsondiff --git a/drizzle/meta/0048_snapshot.json b/drizzle/sqlite/meta/0048_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0048_snapshot.jsonrename to drizzle/sqlite/meta/0048_snapshot.jsondiff --git a/drizzle/meta/0049_snapshot.json b/drizzle/sqlite/meta/0049_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0049_snapshot.jsonrename to drizzle/sqlite/meta/0049_snapshot.jsondiff --git a/drizzle/meta/0050_snapshot.json b/drizzle/sqlite/meta/0050_snapshot.jsonsimilarity index 100%rename from drizzle/meta/0050_snapshot.jsonrename to drizzle/sqlite/meta/0050_snapshot.jsondiff --git a/drizzle/meta/_journal.json b/drizzle/sqlite/meta/_journal.jsonsimilarity index 100%rename from drizzle/meta/_journal.jsonrename to drizzle/sqlite/meta/_journal.jsondiff --git a/knip.jsonc b/knip.jsoncindex 8ba3cae6..ddee091c 100644--- a/knip.jsonc+++ b/knip.jsonc@@ -1,19 +1,18 @@{"entry": [// Alchemy deploy stack (run by the alchemy CLI, not imported by the app)- "alchemy.run.ts",- "alchemy.preview-access.run.ts",- // Detect Tanstack Start Routes- "cli-auth.ts",+ "deploy/alchemy/alchemy.run.ts",+ "deploy/alchemy/alchemy.preview-access.run.ts",// Site-audit aux worker entry (wrangler.audit.jsonc)"src/audit-worker.ts",+ // Detect Tanstack Start Routes"src/start.ts","src/router.tsx","src/routes/**/*.ts","src/routes/**/*.tsx",// Drizzle config (plugin disabled due to cloudflare:workers import issues)- "drizzle.config.ts",- "drizzle-pg.config.ts",+ "drizzle/sqlite.config.ts",+ "drizzle/pg.config.ts",// DB schema — exports consumed via `import * as schema` / drizzle()"src/db/index.ts","src/db/schema.ts",@@ -23,7 +22,7 @@// Standalone CLI/dev scripts, invoked via package.json scripts"scripts/**",],- // badseo/ is the standalone broken-SEO fixture worker (own deps/config),+ // tests/badseo/ is the standalone broken-SEO fixture worker (own deps/config),// like web/ it isn't part of the app's module graph."project": ["**/*.{js,mjs,ts,tsx}",@@ -31,13 +30,13 @@"!web/**",// Alchemy state/bundle artifacts (gitignored)"!.alchemy/**",- "!badseo/**",+ "!tests/badseo/**",// Skill-bundled scripts, run by hand from the skill's instructions"!.agents/**","!.claude/**",],- "ignore": ["drizzle-prod.config.ts"],- // Disable Drizzle plugin - it tries to load drizzle.config.ts which imports cloudflare:workers+ "ignore": ["drizzle/remote-d1.config.ts"],+ // Disable Drizzle plugin - it tries to load drizzle/sqlite.config.ts which imports cloudflare:workers"drizzle": false,"ignoreDependencies": [// Tailwindcss used via @tailwindcss/vite plugindiff --git a/package.json b/package.jsonindex 43623d94..bc5605fa 100644--- a/package.json+++ b/package.json@@ -14,26 +14,26 @@"lint:fix": "oxlint . --type-aware --fix","preview": "npm run build && vite preview --port 3001","deploy": "npm run db:migrate:prod && npm run build && wrangler deploy -c dist/open_seo_audit/wrangler.json && wrangler deploy",- "deploy:selfhost": "node scripts/selfhost-deploy-preflight.mjs && vite build --mode selfhost && tsc --noEmit && pnpm alchemy deploy --env-file .env.selfhost --stage selfhost",- "deploy:postgres": "npm run db:migrate:pg && npm run build && pnpm alchemy deploy --env-file .env.production --stage hosted-prod --adopt",- "deploy:preview": "vite build --mode preview && pnpm alchemy deploy --env-file .env.preview",- "preview:access": "pnpm alchemy deploy alchemy.preview-access.run.ts --env-file .env.preview --stage preview-access --adopt",+ "deploy:selfhost": "node scripts/selfhost-deploy-preflight.mjs && vite build --mode selfhost && tsc --noEmit && pnpm alchemy deploy deploy/alchemy/alchemy.run.ts --env-file .env.selfhost --stage selfhost",+ "deploy:postgres": "npm run db:migrate:pg && npm run build && pnpm alchemy deploy deploy/alchemy/alchemy.run.ts --env-file .env.production --stage hosted-prod --adopt",+ "deploy:preview": "vite build --mode preview && pnpm alchemy deploy deploy/alchemy/alchemy.run.ts --env-file .env.preview",+ "preview:access": "pnpm alchemy deploy deploy/alchemy/alchemy.preview-access.run.ts --env-file .env.preview --stage preview-access --adopt","alchemy": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-strip-types\" alchemy",- "destroy:preview": "pnpm alchemy destroy --env-file .env.preview",+ "destroy:preview": "pnpm alchemy destroy deploy/alchemy/alchemy.run.ts --env-file .env.preview","sourcemaps:upload": "POSTHOG_SOURCEMAPS=true NODE_OPTIONS=--max-old-space-size=8192 npm run build && pnpm dlx @posthog/cli sourcemap inject --directory ./dist-sourcemaps && pnpm dlx @posthog/cli sourcemap upload --directory ./dist-sourcemaps",- "cf-typegen": "wrangler types --config wrangler.jsonc --config wrangler.audit.jsonc",+ "cf-typegen": "wrangler types src/worker-configuration.d.ts --config wrangler.jsonc --config wrangler.audit.jsonc","types:check": "tsc --noEmit","format:check": "prettier --check .","format:write": "prettier . --write","auth:generate": "npm run auth:generate:d1 && npm run auth:generate:pg",- "auth:generate:d1": "pnpm dlx auth@latest generate --config ./cli-auth.ts --adapter drizzle --dialect sqlite --output ./src/db/better-auth-schema.ts && prettier --write ./src/db/better-auth-schema.ts",- "auth:generate:pg": "pnpm dlx auth@latest generate --config ./cli-auth.ts --adapter drizzle --dialect pg --output ./src/db/pg/better-auth-schema.ts && prettier --write ./src/db/pg/better-auth-schema.ts",+ "auth:generate:d1": "pnpm dlx auth@latest generate --config ./scripts/cli-auth.ts --adapter drizzle --dialect sqlite --output ./src/db/better-auth-schema.ts && prettier --write ./src/db/better-auth-schema.ts",+ "auth:generate:pg": "pnpm dlx auth@latest generate --config ./scripts/cli-auth.ts --adapter drizzle --dialect pg --output ./src/db/pg/better-auth-schema.ts && prettier --write ./src/db/pg/better-auth-schema.ts","db:generate": "npm run db:generate:d1 && npm run db:generate:pg",- "db:generate:d1": "drizzle-kit generate",- "db:generate:pg": "drizzle-kit generate --config drizzle-pg.config.ts",+ "db:generate:d1": "drizzle-kit generate --config drizzle/sqlite.config.ts",+ "db:generate:pg": "drizzle-kit generate --config drizzle/pg.config.ts","db:migrate:local": "wrangler d1 migrations apply DB --local","db:migrate:prod": "wrangler d1 migrations apply DB --remote",- "db:migrate:pg": "drizzle-kit migrate --config drizzle-pg.config.ts",+ "db:migrate:pg": "drizzle-kit migrate --config drizzle/pg.config.ts","knip": "knip","release:notes": "node scripts/release-notes.mjs","release:publish": "node scripts/publish-release.mjs",@@ -41,11 +41,11 @@"test": "vitest run","test:watch": "vitest","test:ci": "vitest run --reporter=dot",- "test:e2e": "playwright test",- "test:e2e:free-tools": "playwright test --config playwright.free-tools.config.ts",- "test:e2e:domain": "playwright test e2e/domain-overview-filters.spec.ts",- "test:e2e:domain:perf": "playwright test e2e/domain-overview-filters.perf.spec.ts",- "test:e2e:keywords": "playwright test e2e/keyword-research-navigation.spec.ts",+ "test:e2e": "playwright test -c tests/playwright.config.ts",+ "test:e2e:free-tools": "playwright test -c tests/playwright.free-tools.config.ts",+ "test:e2e:domain": "playwright test -c tests/playwright.config.ts tests/domain-overview-filters.spec.ts",+ "test:e2e:domain:perf": "playwright test -c tests/playwright.config.ts tests/domain-overview-filters.perf.spec.ts",+ "test:e2e:keywords": "playwright test -c tests/playwright.config.ts tests/keyword-research-navigation.spec.ts","billing:backlinks": "tsx scripts/backlinks-cost-profile.ts","billing:brand-lookup": "tsx scripts/brand-lookup-cost-profile.ts","billing:usage": "tsx scripts/dataforseo-account-usage.ts",@@ -54,7 +54,7 @@"repair:rank-locations": "tsx scripts/repair-rank-tracking-locations.ts","seed:rank-tracking": "tsx scripts/seed-rank-tracking.ts","seed:projects": "tsx scripts/seed-projects.ts",- "ci:check": "prettier --check . && knip && tsc --noEmit && tsc --noEmit -p badseo/tsconfig.json && oxlint . --type-aware && pnpm sync-plugin-skills && test -z \"$(git status --porcelain -- plugins/openseo/skills)\""+ "ci:check": "prettier --check . && knip && tsc --noEmit && tsc --noEmit -p tests/badseo/tsconfig.json && oxlint . --type-aware && pnpm sync-plugin-skills && test -z \"$(git status --porcelain -- plugins/openseo/skills)\""},"cloudflare": {"bindings": {diff --git a/scripts/cleanup-default-projects.sql b/scripts/cleanup-default-projects.sqlindex 555560c2..65850cf1 100644--- a/scripts/cleanup-default-projects.sql+++ b/scripts/cleanup-default-projects.sql@@ -4,7 +4,7 @@-- projects_one_default_per_organization_idx. Prefer the TypeScript runner in-- scripts/d1-default-project-cleanup.ts; it adds dry-run output, active-run-- preflight checks, validation, and remote confirmation. See--- docs/default-project-cleanup.md for the full recovery runbook.+-- docs/maintainers/runbooks/default-project-cleanup.md for the full recovery runbook.---- "Newest" matches the app's default project selection. The id tie-breaker is-- only here to keep this cleanup deterministic when several race-created rowsdiff --git a/cli-auth.ts b/scripts/cli-auth.tssimilarity index 78%rename from cli-auth.tsrename to scripts/cli-auth.tsindex a4928321..7274a562 100644--- a/cli-auth.ts+++ b/scripts/cli-auth.ts@@ -1,7 +1,7 @@import { randomUUID } from "node:crypto";import { betterAuth } from "better-auth";-import { createApiKeyPlugin } from "./src/lib/auth-api-key";-import { createBaseAuthConfig } from "./src/lib/auth-config";+import { createApiKeyPlugin } from "../src/lib/auth-api-key";+import { createBaseAuthConfig } from "../src/lib/auth-config";const CLI_DEV_BASE_URL = "http://localhost:3000";const baseUrl = process.env.BETTER_AUTH_URL ?? CLI_DEV_BASE_URL;diff --git a/scripts/d1-default-project-cleanup.ts b/scripts/d1-default-project-cleanup.tsindex b7501156..5d9c7ba7 100644--- a/scripts/d1-default-project-cleanup.ts+++ b/scripts/d1-default-project-cleanup.ts@@ -3,7 +3,7 @@** Use only if the latest migrations fail with a unique-constraint error for* projects_one_default_per_organization_idx. See- * docs/default-project-cleanup.md for the full Cloudflare D1 and local D1+ * docs/maintainers/runbooks/default-project-cleanup.md for the full Cloudflare D1 and local D1* recovery runbook.*/@@ -59,7 +59,7 @@ Options:Dry run is the default. It prints the rows that would be deleted, remapped, ordeduped without mutating application tables.-See docs/default-project-cleanup.md for the full recovery runbook.`);+See docs/maintainers/runbooks/default-project-cleanup.md for the full recovery runbook.`);}function runDryRun() {diff --git a/scripts/erase-user-data.ts b/scripts/erase-user-data.tsindex 6c99219b..064742b0 100644--- a/scripts/erase-user-data.ts+++ b/scripts/erase-user-data.ts@@ -10,7 +10,7 @@* --confirm-database-host <host printed by the dry run>** The Worker endpoint must be deployed with the same GDPR_ERASURE_SECRET as- * this process. See runbooks/gdpr-erasure.md for required operator variables.+ * this process. See docs/maintainers/runbooks/gdpr-erasure.md for required operator variables.*/import process from "node:process";import { Autumn } from "autumn-js";diff --git a/scripts/migrate-d1-to-postgres.ts b/scripts/migrate-d1-to-postgres.tsindex b16ffec6..2e3df167 100644--- a/scripts/migrate-d1-to-postgres.ts+++ b/scripts/migrate-d1-to-postgres.ts@@ -33,8 +33,8 @@** Setup: put the credentials in `.env.local` (auto-loaded), then run the script* directly with tsx. See the runbooks for the full procedure:- * - runbooks/d1-to-postgres-simple.md (happy path)- * - runbooks/d1-to-postgres-detailed.md (full detail + cutover)+ * - docs/maintainers/runbooks/d1-to-postgres-simple.md (happy path)+ * - docs/maintainers/runbooks/d1-to-postgres-detailed.md (full detail + cutover)** # .env.local* CLOUDFLARE_ACCOUNT_ID=...diff --git a/scripts/publish-release.mjs b/scripts/publish-release.mjsindex 1a03a7d9..96382b65 100644--- a/scripts/publish-release.mjs+++ b/scripts/publish-release.mjs@@ -34,7 +34,7 @@ if (typeof version !== "string" || !/^\d+\.\d+\.\d+$/.test(version)) {}const tag = `v${version}`;-const notesFile = `release-notes/${tag}.md`;+const notesFile = `docs/release-notes/${tag}.md`;if (!existsSync(path.join(repoRoot, notesFile))) {throw new Error(`Missing release notes: ${notesFile}`);}diff --git a/scripts/release-notes.mjs b/scripts/release-notes.mjsindex f74fa5db..0ad03f82 100644--- a/scripts/release-notes.mjs+++ b/scripts/release-notes.mjs@@ -102,7 +102,7 @@ function getPackageVersion() {function getReleaseNoteVersions() {try {- return readdirSync("release-notes").flatMap((name) => {+ return readdirSync("docs/release-notes").flatMap((name) => {const version = name.match(/^v(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)\.md$/,)?.[1];diff --git a/scripts/selfhost-deploy-preflight.mjs b/scripts/selfhost-deploy-preflight.mjsindex 419ade66..0f32165b 100644--- a/scripts/selfhost-deploy-preflight.mjs+++ b/scripts/selfhost-deploy-preflight.mjs@@ -33,7 +33,7 @@ if (!existsSync(envFile)) {fail(`${em(envFile)} not found — create it first:`,"",- ` ${cmd("cp .env.selfhost.example .env.selfhost")}`,+ ` ${cmd("cp deploy/.env.selfhost.example .env.selfhost")}`,"",`then set ${em("DATAFORSEO_API_KEY")} and ${em("ACCESS_ALLOWED_EMAILS")}.`,);diff --git a/skills-lock.json b/skills-lock.jsondeleted file mode 100644index ff044d1e..00000000--- a/skills-lock.json+++ /dev/null@@ -1,4 +0,0 @@-{- "version": 1,- "skills": {}-}diff --git a/public/android-chrome-192x192.png b/src/public/android-chrome-192x192.pngsimilarity index 100%rename from public/android-chrome-192x192.pngrename to src/public/android-chrome-192x192.pngdiff --git a/public/android-chrome-512x512.png b/src/public/android-chrome-512x512.pngsimilarity index 100%rename from public/android-chrome-512x512.pngrename to src/public/android-chrome-512x512.pngdiff --git a/public/apple-touch-icon.png b/src/public/apple-touch-icon.pngsimilarity index 100%rename from public/apple-touch-icon.pngrename to src/public/apple-touch-icon.pngdiff --git a/public/favicon-16x16.png b/src/public/favicon-16x16.pngsimilarity index 100%rename from public/favicon-16x16.pngrename to src/public/favicon-16x16.pngdiff --git a/public/favicon-32x32.png b/src/public/favicon-32x32.pngsimilarity index 100%rename from public/favicon-32x32.pngrename to src/public/favicon-32x32.pngdiff --git a/public/favicon.ico b/src/public/favicon.icosimilarity index 100%rename from public/favicon.icorename to src/public/favicon.icodiff --git a/public/favicon.png b/src/public/favicon.pngsimilarity index 100%rename from public/favicon.pngrename to src/public/favicon.pngdiff --git a/public/site.webmanifest b/src/public/site.webmanifestsimilarity index 100%rename from public/site.webmanifestrename to src/public/site.webmanifestdiff --git a/public/transparent-logo.png b/src/public/transparent-logo.pngsimilarity index 100%rename from public/transparent-logo.pngrename to src/public/transparent-logo.pngdiff --git a/src/server/features/activation/repositories/ActivationRepository.test.ts b/src/server/features/activation/repositories/ActivationRepository.test.tsindex 155ea0de..d7d31c69 100644--- a/src/server/features/activation/repositories/ActivationRepository.test.ts+++ b/src/server/features/activation/repositories/ActivationRepository.test.ts@@ -43,7 +43,7 @@ beforeEach(() => {INSERT INTO member VALUES ('member-a', 'org-a');`);state.database.exec(- readFileSync("drizzle/0046_plain_the_watchers.sql", "utf8"),+ readFileSync("drizzle/sqlite/0046_plain_the_watchers.sql", "utf8"),);});diff --git a/src/server/features/google/GoogleAccountService.test.ts b/src/server/features/google/GoogleAccountService.test.tsindex 178a1bf2..8f119a16 100644--- a/src/server/features/google/GoogleAccountService.test.ts+++ b/src/server/features/google/GoogleAccountService.test.ts@@ -43,7 +43,7 @@ beforeAll(async () => {INSERT INTO projects (id, archived) VALUES ('p1',0), ('p2',1), ('p3',0), ('p4',0);`);const authMigration = readFileSync(- "drizzle/0003_light_sage.sql",+ "drizzle/sqlite/0003_light_sage.sql","utf8",).split("--> statement-breakpoint");await client.executeMultiple(@@ -56,8 +56,8 @@ beforeAll(async () => {.join("\n"),);for (const file of [- "drizzle/0019_true_absorbing_man.sql",- "drizzle/0039_ga4_connections.sql",+ "drizzle/sqlite/0019_true_absorbing_man.sql",+ "drizzle/sqlite/0039_ga4_connections.sql",]) {await client.executeMultiple(readFileSync(file, "utf8")diff --git a/src/server/features/google/googleOAuth.test.ts b/src/server/features/google/googleOAuth.test.tsindex a8d6a39d..10f308aa 100644--- a/src/server/features/google/googleOAuth.test.ts+++ b/src/server/features/google/googleOAuth.test.ts@@ -60,14 +60,14 @@ beforeAll(async () => {);await client.executeMultiple(migrationStatements(- "drizzle/0003_light_sage.sql",+ "drizzle/sqlite/0003_light_sage.sql",(sql) =>sql.includes("CREATE TABLE `account`") ||sql.includes("CREATE TABLE `verification`"),),);await client.executeMultiple(- migrationStatements("drizzle/0050_famous_crystal.sql", (sql) =>+ migrationStatements("drizzle/sqlite/0050_famous_crystal.sql", (sql) =>sql.includes("CREATE UNIQUE INDEX"),),);diff --git a/src/server/features/google/googleOAuthMigration.test.ts b/src/server/features/google/googleOAuthMigration.test.tsindex 25e9234c..ea01419e 100644--- a/src/server/features/google/googleOAuthMigration.test.ts+++ b/src/server/features/google/googleOAuthMigration.test.ts@@ -47,7 +47,7 @@ it("keeps one refreshable grant per user and Google identity without changing pr`);const migration = readFileSync(- "drizzle/0050_famous_crystal.sql",+ "drizzle/sqlite/0050_famous_crystal.sql","utf8",).replaceAll("--> statement-breakpoint", "");await client.executeMultiple(migration);diff --git a/src/server/features/project-context/repositories/ProjectContextRepository.query.test.ts b/src/server/features/project-context/repositories/ProjectContextRepository.query.test.tsindex 41294757..3c46a0a2 100644--- a/src/server/features/project-context/repositories/ProjectContextRepository.query.test.ts+++ b/src/server/features/project-context/repositories/ProjectContextRepository.query.test.ts@@ -45,7 +45,7 @@ beforeAll(async () => {[`CREATE TABLE projects (id text PRIMARY KEY);`,`INSERT INTO projects (id) VALUES ('proj_1');`,- ...readFileSync("drizzle/0042_project_memory.sql", "utf8")+ ...readFileSync("drizzle/sqlite/0042_project_memory.sql", "utf8").split("--> statement-breakpoint").filter((statement) => !statement.includes("DROP TABLE")),].join("\n"),diff --git a/src/server/features/reports/reportSocialImage.tsx b/src/server/features/reports/reportSocialImage.tsxindex 186cd198..058e2deb 100644--- a/src/server/features/reports/reportSocialImage.tsx+++ b/src/server/features/reports/reportSocialImage.tsx@@ -1,6 +1,6 @@import { ImageResponse } from "takumi-js/response";import { domainField } from "@/types/schemas/domain";-import logo from "../../../../public/android-chrome-192x192.png?inline";+import logo from "../../../public/android-chrome-192x192.png?inline";/** One template for all reports. Assets stay local; titles never go to an image service. */export async function renderReportSocialImage(diff --git a/src/server/lib/dataforseo/google-ads.ts b/src/server/lib/dataforseo/google-ads.tsindex 65389d8f..025e0861 100644--- a/src/server/lib/dataforseo/google-ads.ts+++ b/src/server/lib/dataforseo/google-ads.ts@@ -8,7 +8,7 @@ import {} from "@/server/lib/dataforseo/envelope";// Google Ads keyword data for countries DataForSEO Labs doesn't cover (see-// specs/0004-keyword-data-source-routing.md). Flat-priced per request; items+// docs/maintainers/specs/0004-keyword-data-source-routing.md). Flat-priced per request; items// carry volume / CPC / competition but no keyword difficulty or intent.export interface AdsKeywordItem {keyword?: string | null;diff --git a/src/server/lib/dataforseo/labs.ts b/src/server/lib/dataforseo/labs.tsindex 4b555b4f..03e435d4 100644--- a/src/server/lib/dataforseo/labs.ts+++ b/src/server/lib/dataforseo/labs.ts@@ -164,7 +164,7 @@ export async function fetchRelatedKeywords(input: {depth: input.depth ?? 3,ignore_synonyms: input.ignoreSynonyms ?? false,// Clickstream-refined volumes DOUBLE the request cost, so they are- // opt-in — see specs/0004-keyword-data-source-routing.md.+ // opt-in — see docs/maintainers/specs/0004-keyword-data-source-routing.md.include_clickstream_data: input.includeClickstreamData ?? false,include_serp_info: false,},diff --git a/src/server/mcp/api-key-auth.ts b/src/server/mcp/api-key-auth.tsindex 6d774631..8529ffcf 100644--- a/src/server/mcp/api-key-auth.ts+++ b/src/server/mcp/api-key-auth.ts@@ -103,14 +103,14 @@ export async function handleMcpApiKeyRequest(const userId = result.key.referenceId;- // Per-user request throttle. The binding is declared in alchemy.run.ts+ // Per-user request throttle. The binding is declared in deploy/alchemy/alchemy.run.ts// (hosted prod only); local dev and self-host run without it and skip// limiting, which is fine single-user. This replaces the better-auth// plugin limiter, whose broken idle-gap window hard-blocked active MCP// clients (see lib/auth-api-key.ts). Cloudflare's counter is per-colo// best-effort, which is all this needs to be: credits bound spend, this// bounds runaway request volume.- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- the binding is declared as a rate limiter in alchemy.run.ts; absent outside hosted prod+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- the binding is declared as a rate limiter in deploy/alchemy/alchemy.run.ts; absent outside hosted prodconst rateLimit = (env as { MCP_RATE_LIMIT?: RateLimit }).MCP_RATE_LIMIT;if (rateLimit) {const { success } = await rateLimit.limit({ key: userId });diff --git a/src/serverFunctions/domain.ts b/src/serverFunctions/domain.tsindex 769cec13..82f01fd1 100644--- a/src/serverFunctions/domain.ts+++ b/src/serverFunctions/domain.ts@@ -14,7 +14,7 @@ function shouldUseDomainE2eFixtures() {}async function getDomainE2eFixtures() {- return import("../../e2e/fixtures/domain-overview-fixtures");+ return import("../../tests/fixtures/domain-overview-fixtures");}export const getDomainOverview = createServerFn({ method: "POST" })diff --git a/src/serverFunctions/keywords.ts b/src/serverFunctions/keywords.tsindex 293cbd43..b32692d3 100644--- a/src/serverFunctions/keywords.ts+++ b/src/serverFunctions/keywords.ts@@ -20,7 +20,7 @@ function shouldUseKeywordE2eFixtures() {}async function getKeywordE2eFixtures() {- return import("../../e2e/fixtures/keyword-research-fixtures");+ return import("../../tests/fixtures/keyword-research-fixtures");}export const researchKeywords = createServerFn({ method: "POST" })diff --git a/src/shared/keyword-locations.ts b/src/shared/keyword-locations.tsindex d61ebd49..a645d11e 100644--- a/src/shared/keyword-locations.ts+++ b/src/shared/keyword-locations.ts@@ -6,7 +6,7 @@* https://api.dataforseo.com/v3/dataforseo_labs/locations_and_languages).* Countries Labs does not cover are marked `googleAdsOnly` and are served by* the DataForSEO Keywords Data API (Google Ads endpoints), which covers the- * full Google geotarget list — see specs/0004-keyword-data-source-routing.md.+ * full Google geotarget list — see docs/maintainers/specs/0004-keyword-data-source-routing.md.* Google-Ads-only rows have no keyword difficulty or search intent.** For countries with multiple Google-supported languages, we pick thediff --git a/worker-configuration.d.ts b/src/worker-configuration.d.tssimilarity index 99%rename from worker-configuration.d.tsrename to src/worker-configuration.d.tsindex 1fb726a7..788ac878 100644--- a/worker-configuration.d.ts+++ b/src/worker-configuration.d.ts@@ -3,7 +3,7 @@// Runtime types generated with [email protected] 2025-09-02 nodejs_compatdeclare namespace Cloudflare {interface GlobalProps {- mainModule: typeof import("./src/server");+ mainModule: typeof import("./server");}interface Env {KV: KVNamespace;@@ -20,13 +20,13 @@ declare namespace Cloudflare {LOOPS_TRANSACTIONAL_RESET_PASSWORD_ID: string;POSTHOG_HOST: string;POSTHOG_PUBLIC_KEY: string;- // Hand-patched: hosted-prod-only binding declared in alchemy.run.ts,+ // Hand-patched: hosted-prod-only binding declared in deploy/alchemy/alchemy.run.ts,// absent in the wrangler.jsonc surfaces (local dev, Docker self-host).MCP_RATE_LIMIT?: RateLimit;// Hand-patched: the class moved to src/audit-worker.ts and a full regen pulls// unrelated runtime-type drift (see cf-typegen); keep this in sync until then.- SITE_AUDIT_WORKFLOW: Workflow<Parameters<import("./src/audit-worker").SiteAuditWorkflow['run']>[0]['payload']>;- RANK_CHECK_WORKFLOW: Workflow<Parameters<import("./src/server").RankCheckWorkflow['run']>[0]['payload']>;+ SITE_AUDIT_WORKFLOW: Workflow<Parameters<import("./audit-worker").SiteAuditWorkflow['run']>[0]['payload']>;+ RANK_CHECK_WORKFLOW: Workflow<Parameters<import("./server").RankCheckWorkflow['run']>[0]['payload']>;}}interface Env extends Cloudflare.Env {}diff --git a/badseo/.gitignore b/tests/badseo/.gitignoresimilarity index 100%rename from badseo/.gitignorerename to tests/badseo/.gitignorediff --git a/badseo/README.md b/tests/badseo/README.mdsimilarity index 96%rename from badseo/README.mdrename to tests/badseo/README.mdindex 4cdd9853..17de9b3c 100644--- a/badseo/README.md+++ b/tests/badseo/README.md@@ -69,8 +69,8 @@ in the footer. The choice is stored only in the visitor's browser.```bash# from the repository rootpnpm install --frozen-lockfile # also needed by the audit harness-pnpm --dir badseo install --frozen-lockfile-pnpm --dir badseo run dev # serves on http://localhost:8787+pnpm --dir tests/badseo install --frozen-lockfile+pnpm --dir tests/badseo run dev # serves on http://localhost:8787```Use the Vite dev server above when running the audit locally. Its sitemap URLs@@ -79,7 +79,7 @@ should use `http://localhost:8787`, matching the origin passed to the harness.Format BadSEO files with the repository's root Prettier installation:```bash-pnpm exec prettier --write "badseo/**/*.{ts,tsx,json,jsonc,md}"+pnpm exec prettier --write "tests/badseo/**/*.{ts,tsx,json,jsonc,md}"```## Run the end-to-end audit@@ -91,7 +91,7 @@ privacy policy, and support pages come back clean.```bash# from the repository root, with the BadSEO dev server running:-pnpm --dir badseo run audit http://localhost:8787+pnpm --dir tests/badseo run audit http://localhost:8787```It prints a per-page pass/fail matrix and an issue-type coverage line, and exitsdiff --git a/badseo/package.json b/tests/badseo/package.jsonsimilarity index 86%rename from badseo/package.jsonrename to tests/badseo/package.jsonindex 1f813ed9..e441020c 100644--- a/badseo/package.json+++ b/tests/badseo/package.json@@ -9,8 +9,8 @@"typecheck": "tsc --noEmit","build": "vite build && tsc --noEmit","deploy": "npm run build && wrangler deploy",- "audit": "cd .. && tsx badseo/scripts/run-audit.ts",- "test:e2e": "cd .. && tsx badseo/scripts/run-audit.ts"+ "audit": "cd ../.. && tsx tests/badseo/scripts/run-audit.ts",+ "test:e2e": "cd ../.. && tsx tests/badseo/scripts/run-audit.ts"},"dependencies": {"@tanstack/react-router": "^1.170.16",diff --git a/badseo/pnpm-lock.yaml b/tests/badseo/pnpm-lock.yamlsimilarity index 100%rename from badseo/pnpm-lock.yamlrename to tests/badseo/pnpm-lock.yamldiff --git a/badseo/pnpm-workspace.yaml b/tests/badseo/pnpm-workspace.yamlsimilarity index 83%rename from badseo/pnpm-workspace.yamlrename to tests/badseo/pnpm-workspace.yamlindex fc9e8f90..721266ed 100644--- a/badseo/pnpm-workspace.yaml+++ b/tests/badseo/pnpm-workspace.yaml@@ -1,3 +1,6 @@+allowBuilds:+ esbuild: set this to true or false+ workerd: set this to true or falseminimumReleaseAge: 11520minimumReleaseAgeExclude:- "@every-app/*"diff --git a/badseo/public/analytics.js b/tests/badseo/public/analytics.jssimilarity index 100%rename from badseo/public/analytics.jsrename to tests/badseo/public/analytics.jsdiff --git a/badseo/public/img/placeholder.svg b/tests/badseo/public/img/placeholder.svgsimilarity index 100%rename from badseo/public/img/placeholder.svgrename to tests/badseo/public/img/placeholder.svgdiff --git a/badseo/public/openseo-logo.png b/tests/badseo/public/openseo-logo.pngsimilarity index 100%rename from badseo/public/openseo-logo.pngrename to tests/badseo/public/openseo-logo.pngdiff --git a/badseo/public/styles.css b/tests/badseo/public/styles.csssimilarity index 100%rename from badseo/public/styles.cssrename to tests/badseo/public/styles.cssdiff --git a/badseo/scripts/run-audit.ts b/tests/badseo/scripts/run-audit.tssimilarity index 94%rename from badseo/scripts/run-audit.tsrename to tests/badseo/scripts/run-audit.tsindex 73e67bdc..b3422a40 100644--- a/badseo/scripts/run-audit.ts+++ b/tests/badseo/scripts/run-audit.ts@@ -10,28 +10,28 @@* Every actual detection call below is imported straight from ../src.** From the repository root, with the BadSEO dev server running:- * pnpm --dir badseo run audit http://localhost:8787- * pnpm --dir badseo run audit http://host:port+ * pnpm --dir tests/badseo run audit http://localhost:8787+ * pnpm --dir tests/badseo run audit http://host:port*/-import { crawlPage } from "../../src/server/workflows/site-audit-workflow-helpers";-import { createCrawlThrottle } from "../../src/server/lib/audit/crawl-throttle";+import { crawlPage } from "../../../src/server/workflows/site-audit-workflow-helpers";+import { createCrawlThrottle } from "../../../src/server/lib/audit/crawl-throttle";import {discoverUrls,parseRobotsTxt,-} from "../../src/server/lib/audit/discovery";+} from "../../../src/server/lib/audit/discovery";import {normalizeUrl,isSameOrigin,-} from "../../src/server/lib/audit/url-utils";-import { runPageReporters } from "../../src/server/lib/audit/issues/page-reporters";+} from "../../../src/server/lib/audit/url-utils";+import { runPageReporters } from "../../../src/server/lib/audit/issues/page-reporters";import {findDuplicates,findRedirectChainsAndLoops,type SlimPage,-} from "../../src/server/lib/audit/issues/multipage-checks";-import type { DetectedIssue } from "../../src/server/lib/audit/issues/page-reporters";-import type { CrawledPageResult } from "../../src/server/lib/audit/types";-import { AUDIT_ISSUE_TYPES } from "../../src/shared/audit-issues";+} from "../../../src/server/lib/audit/issues/multipage-checks";+import type { DetectedIssue } from "../../../src/server/lib/audit/issues/page-reporters";+import type { CrawledPageResult } from "../../../src/server/lib/audit/types";+import { AUDIT_ISSUE_TYPES } from "../../../src/shared/audit-issues";import { allFixtures, fixturePaths } from "../src/fixtures/registry";import { TRAILING_SLASH_CANONICAL } from "../src/fixtures/redirects";import type { Fixture, IssueId } from "../src/fixtures/types";diff --git a/badseo/src/components/site-layout.tsx b/tests/badseo/src/components/site-layout.tsxsimilarity index 100%rename from badseo/src/components/site-layout.tsxrename to tests/badseo/src/components/site-layout.tsxdiff --git a/badseo/src/fixtures/content.ts b/tests/badseo/src/fixtures/content.tssimilarity index 100%rename from badseo/src/fixtures/content.tsrename to tests/badseo/src/fixtures/content.tsdiff --git a/badseo/src/fixtures/head-tags.ts b/tests/badseo/src/fixtures/head-tags.tssimilarity index 100%rename from badseo/src/fixtures/head-tags.tsrename to tests/badseo/src/fixtures/head-tags.tsdiff --git a/badseo/src/fixtures/helpers.ts b/tests/badseo/src/fixtures/helpers.tssimilarity index 100%rename from badseo/src/fixtures/helpers.tsrename to tests/badseo/src/fixtures/helpers.tsdiff --git a/badseo/src/fixtures/http-status.ts b/tests/badseo/src/fixtures/http-status.tssimilarity index 100%rename from badseo/src/fixtures/http-status.tsrename to tests/badseo/src/fixtures/http-status.tsdiff --git a/badseo/src/fixtures/indexability.ts b/tests/badseo/src/fixtures/indexability.tssimilarity index 100%rename from badseo/src/fixtures/indexability.tsrename to tests/badseo/src/fixtures/indexability.tsdiff --git a/badseo/src/fixtures/kitchen-sink.ts b/tests/badseo/src/fixtures/kitchen-sink.tssimilarity index 100%rename from badseo/src/fixtures/kitchen-sink.tsrename to tests/badseo/src/fixtures/kitchen-sink.tsdiff --git a/badseo/src/fixtures/performance.ts b/tests/badseo/src/fixtures/performance.tssimilarity index 100%rename from badseo/src/fixtures/performance.tsrename to tests/badseo/src/fixtures/performance.tsdiff --git a/badseo/src/fixtures/redirects.ts b/tests/badseo/src/fixtures/redirects.tssimilarity index 100%rename from badseo/src/fixtures/redirects.tsrename to tests/badseo/src/fixtures/redirects.tsdiff --git a/badseo/src/fixtures/registry.ts b/tests/badseo/src/fixtures/registry.tssimilarity index 100%rename from badseo/src/fixtures/registry.tsrename to tests/badseo/src/fixtures/registry.tsdiff --git a/badseo/src/fixtures/structure.ts b/tests/badseo/src/fixtures/structure.tssimilarity index 100%rename from badseo/src/fixtures/structure.tsrename to tests/badseo/src/fixtures/structure.tsdiff --git a/badseo/src/fixtures/types.ts b/tests/badseo/src/fixtures/types.tssimilarity index 96%rename from badseo/src/fixtures/types.tsrename to tests/badseo/src/fixtures/types.tsindex 5dc165a9..048aeb1a 100644--- a/badseo/src/fixtures/types.ts+++ b/tests/badseo/src/fixtures/types.ts@@ -1,7 +1,7 @@// The issue-id union comes straight from the OpenSEO audit engine so that// every fixture's `expectedIssues` is type-checked against the real registry.// Type-only import — erased at build time, never bundled into the Worker.-import type { AuditIssueType } from "../../../src/shared/audit-issues";+import type { AuditIssueType } from "../../../../src/shared/audit-issues";export type IssueId = AuditIssueType;diff --git a/badseo/src/lib.ts b/tests/badseo/src/lib.tssimilarity index 99%rename from badseo/src/lib.tsrename to tests/badseo/src/lib.tsindex 7eeb9bb4..2035af84 100644--- a/badseo/src/lib.ts+++ b/tests/badseo/src/lib.ts@@ -5,7 +5,7 @@// <img>. That way each fixture's headings and images are fully under the// fixture's own control, and the audit measures exactly the defect we injected// — not accidental noise from the layout.-import { AUDIT_ISSUE_TYPES } from "../../src/shared/audit-issues";+import { AUDIT_ISSUE_TYPES } from "../../../src/shared/audit-issues";import type { Fixture, IssueId } from "./fixtures/types";import { PLAUSIBLE_INIT_SCRIPT, PLAUSIBLE_SCRIPT_SRC } from "./plausible";diff --git a/badseo/src/plausible.ts b/tests/badseo/src/plausible.tssimilarity index 100%rename from badseo/src/plausible.tsrename to tests/badseo/src/plausible.tsdiff --git a/badseo/src/routeTree.gen.ts b/tests/badseo/src/routeTree.gen.tssimilarity index 100%rename from badseo/src/routeTree.gen.tsrename to tests/badseo/src/routeTree.gen.tsdiff --git a/badseo/src/router.tsx b/tests/badseo/src/router.tsxsimilarity index 100%rename from badseo/src/router.tsxrename to tests/badseo/src/router.tsxdiff --git a/badseo/src/routes/$.ts b/tests/badseo/src/routes/$.tssimilarity index 100%rename from badseo/src/routes/$.tsrename to tests/badseo/src/routes/$.tsdiff --git a/badseo/src/routes/__root.tsx b/tests/badseo/src/routes/__root.tsxsimilarity index 100%rename from badseo/src/routes/__root.tsxrename to tests/badseo/src/routes/__root.tsxdiff --git a/badseo/src/routes/catalog.tsx b/tests/badseo/src/routes/catalog.tsxsimilarity index 100%rename from badseo/src/routes/catalog.tsxrename to tests/badseo/src/routes/catalog.tsxdiff --git a/badseo/src/routes/index.tsx b/tests/badseo/src/routes/index.tsxsimilarity index 100%rename from badseo/src/routes/index.tsxrename to tests/badseo/src/routes/index.tsxdiff --git a/badseo/src/routes/privacy.tsx b/tests/badseo/src/routes/privacy.tsxsimilarity index 100%rename from badseo/src/routes/privacy.tsxrename to tests/badseo/src/routes/privacy.tsxdiff --git a/badseo/src/routes/robots[.]txt.ts b/tests/badseo/src/routes/robots[.]txt.tssimilarity index 100%rename from badseo/src/routes/robots[.]txt.tsrename to tests/badseo/src/routes/robots[.]txt.tsdiff --git a/badseo/src/routes/sitemap[.]xml.ts b/tests/badseo/src/routes/sitemap[.]xml.tssimilarity index 100%rename from badseo/src/routes/sitemap[.]xml.tsrename to tests/badseo/src/routes/sitemap[.]xml.tsdiff --git a/badseo/src/server/badseo.ts b/tests/badseo/src/server/badseo.tssimilarity index 100%rename from badseo/src/server/badseo.tsrename to tests/badseo/src/server/badseo.tsdiff --git a/badseo/tsconfig.json b/tests/badseo/tsconfig.jsonsimilarity index 100%rename from badseo/tsconfig.jsonrename to tests/badseo/tsconfig.jsondiff --git a/badseo/vite.config.ts b/tests/badseo/vite.config.tssimilarity index 100%rename from badseo/vite.config.tsrename to tests/badseo/vite.config.tsdiff --git a/badseo/wrangler.jsonc b/tests/badseo/wrangler.jsoncsimilarity index 100%rename from badseo/wrangler.jsoncrename to tests/badseo/wrangler.jsoncdiff --git a/e2e/domain-overview-filters.perf.spec.ts b/tests/domain-overview-filters.perf.spec.tssimilarity index 100%rename from e2e/domain-overview-filters.perf.spec.tsrename to tests/domain-overview-filters.perf.spec.tsdiff --git a/e2e/domain-overview-filters.spec.ts b/tests/domain-overview-filters.spec.tssimilarity index 100%rename from e2e/domain-overview-filters.spec.tsrename to tests/domain-overview-filters.spec.tsdiff --git a/e2e/domain-overview-test-utils.ts b/tests/domain-overview-test-utils.tssimilarity index 100%rename from e2e/domain-overview-test-utils.tsrename to tests/domain-overview-test-utils.tsdiff --git a/e2e/fixtures/domain-overview-fixtures.ts b/tests/fixtures/domain-overview-fixtures.tssimilarity index 100%rename from e2e/fixtures/domain-overview-fixtures.tsrename to tests/fixtures/domain-overview-fixtures.tsdiff --git a/e2e/fixtures/keyword-research-fixtures.ts b/tests/fixtures/keyword-research-fixtures.tssimilarity index 100%rename from e2e/fixtures/keyword-research-fixtures.tsrename to tests/fixtures/keyword-research-fixtures.tsdiff --git a/e2e/keyword-research-navigation.spec.ts b/tests/keyword-research-navigation.spec.tssimilarity index 100%rename from e2e/keyword-research-navigation.spec.tsrename to tests/keyword-research-navigation.spec.tsdiff --git a/playwright.config.ts b/tests/playwright.config.tssimilarity index 73%rename from playwright.config.tsrename to tests/playwright.config.tsindex 5b0c3e18..c075dce1 100644--- a/playwright.config.ts+++ b/tests/playwright.config.ts@@ -1,7 +1,12 @@+import { fileURLToPath } from "node:url";import { defineConfig } from "@playwright/test";+const repoRoot = fileURLToPath(new URL("..", import.meta.url));+export default defineConfig({- testDir: "./e2e",+ // Keep test-results/ at the repo root (see .gitignore) now that the config lives in tests/.+ outputDir: "../test-results",+ testDir: ".",timeout: 45_000,expect: {timeout: 10_000,@@ -19,6 +24,7 @@ export default defineConfig({video: "retain-on-failure",},webServer: {+ cwd: repoRoot,command:"NODE_OPTIONS= AUTH_MODE=local_noauth VITE_E2E_DOMAIN_FIXTURES=1 VITE_E2E_KEYWORD_FIXTURES=1 PORT=3101 pnpm exec vite dev --host 127.0.0.1 --strictPort",url: "http://localhost:3101",diff --git a/playwright.free-tools.config.ts b/tests/playwright.free-tools.config.tssimilarity index 61%rename from playwright.free-tools.config.tsrename to tests/playwright.free-tools.config.tsindex 4cf6f6da..f042b2c7 100644--- a/playwright.free-tools.config.ts+++ b/tests/playwright.free-tools.config.ts@@ -1,7 +1,12 @@+import { fileURLToPath } from "node:url";import { defineConfig } from "@playwright/test";+const repoRoot = fileURLToPath(new URL("..", import.meta.url));+export default defineConfig({- testDir: "./web/tests",+ // Keep test-results/ at the repo root (see .gitignore) now that the config lives in tests/.+ outputDir: "../test-results",+ testDir: "../web/tests",testMatch: "**/*.spec.ts",workers: 1,timeout: 45_000,@@ -10,6 +15,7 @@ export default defineConfig({trace: "retain-on-failure",},webServer: {+ cwd: repoRoot,command: "pnpm --dir web dev --host 127.0.0.1 --port 4324 --strictPort",url: "http://localhost:4324",env: { VITE_TURNSTILE_SITE_KEY: "1x00000000000000000000AA" },diff --git a/tsconfig.json b/tsconfig.jsonindex f18a0ebd..d3fb791c 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -1,6 +1,6 @@{"include": ["**/*.ts", "**/*.tsx"],- "exclude": ["web/**/*", "badseo/**/*"],+ "exclude": ["web/**/*", "tests/badseo/**/*"],"compilerOptions": {"strict": true,"esModuleInterop": true,diff --git a/vite.config.ts b/vite.config.tsindex 5bb4cc19..9b272824 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -1,5 +1,6 @@import { tanstackStart } from "@tanstack/react-start/plugin/vite";-import { defineConfig, loadEnv } from "vite";+import { defineConfig } from "vitest/config";+import { loadEnv } from "vite";import tsConfigPaths from "vite-tsconfig-paths";import viteReact from "@vitejs/plugin-react";import tailwindcss from "@tailwindcss/vite";@@ -8,6 +9,29 @@ import { devtools } from "@tanstack/devtools-vite";import { leanWorkerBundle } from "./vite-plugin-lean-worker-bundle";export default defineConfig(({ mode }) => {+ // Vitest sets mode to "test". Return a config without the Cloudflare and+ // TanStack Start plugins so unit tests never boot workerd or the SSR dev+ // server; only the tsconfig path alias is needed.+ if (mode === "test") {+ return {+ plugins: [tsConfigPaths()],+ test: {+ environment: "node",+ include: ["src/**/*.test.ts", "scripts/**/*.test.ts"],+ restoreMocks: true,+ clearMocks: true,+ server: {+ deps: {+ // Processed by vitest (instead of loaded natively by node) so the+ // oauth-refresh e2e test's cloudflare:workers mock reaches the real+ // provider module.+ inline: ["@cloudflare/workers-oauth-provider"],+ },+ },+ },+ };+ }+const env = loadEnv(mode, process.cwd(), "");const port = process.env.PORT? Number(process.env.PORT)@@ -22,6 +46,9 @@ export default defineConfig(({ mode }) => {const emitSourcemaps = env.POSTHOG_SOURCEMAPS === "true";return {+ // Static files (favicons, manifest) live beside the app code instead of at+ // the repo root.+ publicDir: "src/public",envPrefix: ["VITE_","AUTH_MODE",diff --git a/vitest.config.ts b/vitest.config.tsdeleted file mode 100644index 6217b4da..00000000--- a/vitest.config.ts+++ /dev/null@@ -1,20 +0,0 @@-import { defineConfig } from "vitest/config";-import tsConfigPaths from "vite-tsconfig-paths";--export default defineConfig({- plugins: [tsConfigPaths()],- test: {- environment: "node",- include: ["src/**/*.test.ts", "scripts/**/*.test.ts"],- restoreMocks: true,- clearMocks: true,- server: {- deps: {- // Processed by vitest (instead of loaded natively by node) so the- // oauth-refresh e2e test's cloudflare:workers mock reaches the real- // provider module.- inline: ["@cloudflare/workers-oauth-provider"],- },- },- },-});diff --git a/web/.env.example b/web/.env.exampleindex b6d6d20b..d94e39d8 100644--- a/web/.env.example+++ b/web/.env.example@@ -1,7 +1,7 @@# Build-time vars (vite build inlines these).# Required by the deploy scripts: they set VITE_REQUIRE_TURNSTILE=1, and the# build rejects missing or test site keys. Deployed APIs also require the-# matching runtime secret and protection bindings; see maintainer-docs/FREE_TOOLS_PROTECTION.md.+# matching runtime secret and protection bindings; see docs/maintainers/FREE_TOOLS_PROTECTION.md.VITE_TURNSTILE_SITE_KEY=# Local runtime secrets go in web/.dev.vars (gitignored), not this file.diff --git a/web/content/docs/self-hosting/cloudflare.md b/web/content/docs/self-hosting/cloudflare.mdindex 5ab624d4..bb63bbf1 100644--- a/web/content/docs/self-hosting/cloudflare.md+++ b/web/content/docs/self-hosting/cloudflare.md@@ -45,7 +45,7 @@ Already logged in from before without the `access:write` scope? Run `pnpm alchemCopy the template and fill in the required values:```bash-cp .env.selfhost.example .env.selfhost+cp deploy/.env.selfhost.example .env.selfhost```## 4) Deploydiff --git a/web/content/docs/self-hosting/docker.md b/web/content/docs/self-hosting/docker.mdindex 1796c8c7..edcd5409 100644--- a/web/content/docs/self-hosting/docker.md+++ b/web/content/docs/self-hosting/docker.md@@ -71,7 +71,7 @@ docker compose up -dIf you are testing local code changes, build and run a local tag:```bash-docker build -f Dockerfile.selfhost -t open-seo:local .+docker build -f deploy/docker/Dockerfile -t open-seo:local .OPEN_SEO_IMAGE=open-seo:local docker compose up -d```diff --git a/wrangler.audit.jsonc b/wrangler.audit.jsoncindex e769db09..64e49a4d 100644--- a/wrangler.audit.jsonc+++ b/wrangler.audit.jsonc@@ -45,7 +45,7 @@},],// This config serves local dev and Docker self-host only; Alchemy- // deployments provision the audit worker from alchemy.run.ts and never read+ // deployments provision the audit worker from deploy/alchemy/alchemy.run.ts and never read// these ids. Mirror any DB/KV/R2 resource-id edits you make in// wrangler.jsonc into this file too — both workers share the same D1/KV/R2// (no OAUTH_KV here; only the app worker runs OAuth), and miniflare derives@@ -61,7 +61,7 @@"binding": "DB","database_name": "open-seo","database_id": "37bee90a-e1aa-404f-b01e-b0d1d479bda1",- "migrations_dir": "drizzle",+ "migrations_dir": "drizzle/sqlite",},],// Postgres scale path — same rules as wrangler.jsonc: only local Postgresdiff --git a/wrangler.jsonc b/wrangler.jsoncindex b4a3171f..4b44bafb 100644--- a/wrangler.jsonc+++ b/wrangler.jsonc@@ -99,7 +99,7 @@},// This config serves local dev and Docker self-host only. All Cloudflare// deployments — previews, prod, self-host — go through Alchemy- // (alchemy.run.ts), which provisions real resources per stage and never+ // (deploy/alchemy/alchemy.run.ts), which provisions real resources per stage and never// reads these ids.//// The ids below are NOT dead config: miniflare derives its on-disk storage@@ -121,7 +121,7 @@"binding": "DB","database_name": "open-seo","database_id": "37bee90a-e1aa-404f-b01e-b0d1d479bda1",- "migrations_dir": "drizzle",+ "migrations_dir": "drizzle/sqlite",},],// Postgres scale path (opt-in; D1 is the default). Hyperdrive is the ONLY way