From f5d5a23da2529e96793d7c193e8c12f75bdb092d Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 12:36:09 -0500 Subject: [PATCH 1/6] fix: remove versioned mismatched Aztec OTC desk and Aztec Pay repository configurations --- src/repos/config.ts | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/repos/config.ts b/src/repos/config.ts index 211bd00..240b11f 100644 --- a/src/repos/config.ts +++ b/src/repos/config.ts @@ -91,27 +91,7 @@ const BASE_REPOS: Omit[] = [ code: ["*.nr", "*.ts"], docs: ["*.md"], }, - }, - { - name: "aztec-otc-desk", - url: "https://github.com/aztec-pioneers/aztec-otc-desk", - branch: "main", - description: "Aztec OTC desk for peer-to-peer trading on Aztec", - searchPatterns: { - code: ["*.nr", "*.ts"], - docs: ["*.md"], - }, - }, - { - name: "aztec-pay", - url: "https://github.com/aztec-pioneers/aztec-pay", - branch: "main", - description: "Aztec Pay - payment solution built on Aztec", - searchPatterns: { - code: ["*.nr", "*.ts"], - docs: ["*.md"], - }, - }, + } ]; /** From 37f46c0c1a76647f34c38a78f2ff3ac60ec92aa9 Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 12:41:54 -0500 Subject: [PATCH 2/6] fix: update tests to reflect removal of aztec-otc-desk and aztec-pay repos Co-Authored-By: Claude Opus 4.6 --- tests/repos/config.test.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/repos/config.test.ts b/tests/repos/config.test.ts index 37bb522..df72e36 100644 --- a/tests/repos/config.test.ts +++ b/tests/repos/config.test.ts @@ -8,8 +8,8 @@ import { } from "../../src/repos/config.js"; describe("AZTEC_REPOS", () => { - it("contains 7 repos, each with name/url/description", () => { - expect(AZTEC_REPOS).toHaveLength(7); + it("contains 5 repos, each with name/url/description", () => { + expect(AZTEC_REPOS).toHaveLength(5); for (const repo of AZTEC_REPOS) { expect(repo.name).toBeTruthy(); expect(repo.url).toBeTruthy(); @@ -64,17 +64,13 @@ describe("getAztecRepos", () => { } }); - it("does not apply tags to noir-lang or aztec-pioneers repos", () => { + it("does not apply tags to noir-lang repos", () => { const repos = getAztecRepos("v2.0.0"); const noirRepos = repos.filter((r) => r.url.includes("noir-lang")); - const pioneerRepos = repos.filter((r) => - r.url.includes("aztec-pioneers") - ); expect(noirRepos).toHaveLength(2); - expect(pioneerRepos).toHaveLength(2); - for (const repo of [...noirRepos, ...pioneerRepos]) { + for (const repo of noirRepos) { expect(repo.tag).toBeUndefined(); } }); @@ -94,15 +90,13 @@ describe("getRepoConfig", () => { }); describe("getRepoNames", () => { - it("returns all 7 names", () => { + it("returns all 5 names", () => { const names = getRepoNames(); - expect(names).toHaveLength(7); + expect(names).toHaveLength(5); expect(names).toContain("aztec-packages"); expect(names).toContain("noir"); expect(names).toContain("noir-examples"); expect(names).toContain("aztec-examples"); expect(names).toContain("aztec-starter"); - expect(names).toContain("aztec-otc-desk"); - expect(names).toContain("aztec-pay"); }); }); From 131afd91b3a3b35090a4346bc7ab4ff676de365b Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 12:52:13 -0500 Subject: [PATCH 3/6] feat: add demo-wallet and gregoswap repositories Co-Authored-By: Claude Opus 4.6 --- src/repos/config.ts | 18 ++++++++++++++++++ tests/repos/config.test.ts | 12 +++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/repos/config.ts b/src/repos/config.ts index 240b11f..5a534f9 100644 --- a/src/repos/config.ts +++ b/src/repos/config.ts @@ -91,6 +91,24 @@ const BASE_REPOS: Omit[] = [ code: ["*.nr", "*.ts"], docs: ["*.md"], }, + }, + { + name: "demo-wallet", + url: "https://github.com/AztecProtocol/demo-wallet", + description: "Aztec demo wallet application", + searchPatterns: { + code: ["*.nr", "*.ts"], + docs: ["*.md"], + }, + }, + { + name: "gregoswap", + url: "https://github.com/AztecProtocol/gregoswap", + description: "Gregoswap - token swap application built on Aztec", + searchPatterns: { + code: ["*.nr", "*.ts"], + docs: ["*.md"], + }, } ]; diff --git a/tests/repos/config.test.ts b/tests/repos/config.test.ts index df72e36..92bb350 100644 --- a/tests/repos/config.test.ts +++ b/tests/repos/config.test.ts @@ -8,8 +8,8 @@ import { } from "../../src/repos/config.js"; describe("AZTEC_REPOS", () => { - it("contains 5 repos, each with name/url/description", () => { - expect(AZTEC_REPOS).toHaveLength(5); + it("contains 7 repos, each with name/url/description", () => { + expect(AZTEC_REPOS).toHaveLength(7); for (const repo of AZTEC_REPOS) { expect(repo.name).toBeTruthy(); expect(repo.url).toBeTruthy(); @@ -44,7 +44,7 @@ describe("getAztecRepos", () => { (r) => !r.url.includes("AztecProtocol") ); - expect(aztecProtocolRepos).toHaveLength(3); + expect(aztecProtocolRepos).toHaveLength(5); for (const repo of aztecProtocolRepos) { expect(repo.tag).toBe(DEFAULT_AZTEC_VERSION); } @@ -90,13 +90,15 @@ describe("getRepoConfig", () => { }); describe("getRepoNames", () => { - it("returns all 5 names", () => { + it("returns all 7 names", () => { const names = getRepoNames(); - expect(names).toHaveLength(5); + expect(names).toHaveLength(7); expect(names).toContain("aztec-packages"); expect(names).toContain("noir"); expect(names).toContain("noir-examples"); expect(names).toContain("aztec-examples"); expect(names).toContain("aztec-starter"); + expect(names).toContain("demo-wallet"); + expect(names).toContain("gregoswap"); }); }); From ea426bb676c35baab29c86c31cdc8eb3a96b6a65 Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 14:06:43 -0500 Subject: [PATCH 4/6] feat: pull aztec-packages docs from next branch via sparsePathOverrides Add sparsePathOverrides to RepoConfig so specific sparse paths can be checked out from a different branch after the tag-based clone. This keeps docs/docs on the latest next branch while other paths stay pinned to the version tag. Co-Authored-By: Claude Opus 4.6 --- src/repos/config.ts | 5 +++++ src/utils/git.ts | 8 ++++++++ tests/repos/config.test.ts | 8 ++++++++ tests/utils/git.test.ts | 30 ++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/src/repos/config.ts b/src/repos/config.ts index 5a534f9..9eb8525 100644 --- a/src/repos/config.ts +++ b/src/repos/config.ts @@ -22,6 +22,8 @@ export interface RepoConfig { code?: string[]; docs?: string[]; }; + /** Override specific sparse paths to come from a different branch instead of the tag */ + sparsePathOverrides?: { paths: string[]; branch: string }[]; } /** Default Aztec version (tag) to use - can be overridden via AZTEC_DEFAULT_VERSION env var */ @@ -43,6 +45,9 @@ const BASE_REPOS: Omit[] = [ "boxes", "playground", ], + sparsePathOverrides: [ + { paths: ["docs/docs"], branch: "next" }, + ], description: "Main Aztec monorepo - documentation, aztec-nr framework, and reference contracts", searchPatterns: { code: ["*.nr", "*.ts"], diff --git a/src/utils/git.ts b/src/utils/git.ts index f7f8d29..c3d7dad 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -90,6 +90,14 @@ export async function cloneRepo( await repoGit.raw(["sparse-checkout", "set", ...config.sparse]); await repoGit.fetch(["--depth=1", "origin", `refs/tags/${config.tag}:refs/tags/${config.tag}`]); await repoGit.checkout(config.tag); + + // Apply sparse path overrides from different branches + if (config.sparsePathOverrides) { + for (const override of config.sparsePathOverrides) { + await repoGit.fetch(["--depth=1", "origin", override.branch]); + await repoGit.checkout([`origin/${override.branch}`, "--", ...override.paths]); + } + } } else { await git.clone(config.url, repoPath, [ "--filter=blob:none", diff --git a/tests/repos/config.test.ts b/tests/repos/config.test.ts index 92bb350..7aef39e 100644 --- a/tests/repos/config.test.ts +++ b/tests/repos/config.test.ts @@ -26,6 +26,14 @@ describe("AZTEC_REPOS", () => { expect(noir!.sparse!.length).toBeGreaterThan(0); }); + it("aztec-packages has sparsePathOverrides for docs/docs on next branch", () => { + const ap = AZTEC_REPOS.find((r) => r.name === "aztec-packages"); + expect(ap?.sparse).toContain("docs/docs"); + expect(ap?.sparsePathOverrides).toEqual([ + { paths: ["docs/docs"], branch: "next" }, + ]); + }); + it('noir and noir-examples have branch: "master"', () => { const noir = AZTEC_REPOS.find((r) => r.name === "noir"); const noirExamples = AZTEC_REPOS.find((r) => r.name === "noir-examples"); diff --git a/tests/utils/git.test.ts b/tests/utils/git.test.ts index 8d45de0..5da0b74 100644 --- a/tests/utils/git.test.ts +++ b/tests/utils/git.test.ts @@ -146,6 +146,36 @@ describe("cloneRepo", () => { expect(mockGitInstance.checkout).toHaveBeenCalledWith("v1.0.0"); }); + it("sparse + tag + sparsePathOverrides: fetches override branch and checks out paths", async () => { + const overrideConfig: RepoConfig = { + ...sparseConfig, + sparsePathOverrides: [{ paths: ["docs/docs"], branch: "next" }], + }; + mockExistsSync.mockReturnValue(false); + mockGitInstance.clone.mockResolvedValue(undefined); + mockGitInstance.raw.mockResolvedValue(undefined); + mockGitInstance.fetch.mockResolvedValue(undefined); + mockGitInstance.checkout.mockResolvedValue(undefined); + + const result = await cloneRepo(overrideConfig); + expect(result).toContain("Cloned aztec-packages"); + + // Normal tag checkout happens first + expect(mockGitInstance.checkout).toHaveBeenCalledWith("v1.0.0"); + + // Then override: fetch the branch and checkout paths from it + expect(mockGitInstance.fetch).toHaveBeenCalledWith([ + "--depth=1", + "origin", + "next", + ]); + expect(mockGitInstance.checkout).toHaveBeenCalledWith([ + "origin/next", + "--", + "docs/docs", + ]); + }); + it("sparse + commit: clones with sparse flags, fetches commit", async () => { const commitConfig: RepoConfig = { ...sparseConfig, From c5dd307a1c6bca4f38ce788083af39b321873172 Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 14:09:08 -0500 Subject: [PATCH 5/6] fix: use docs instead of docs/docs for aztec-packages sparse path The next branch has the full docs directory at docs/, not docs/docs/. Co-Authored-By: Claude Opus 4.6 --- src/repos/config.ts | 4 ++-- tests/repos/config.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/repos/config.ts b/src/repos/config.ts index 9eb8525..3d8028d 100644 --- a/src/repos/config.ts +++ b/src/repos/config.ts @@ -37,7 +37,7 @@ const BASE_REPOS: Omit[] = [ name: "aztec-packages", url: "https://github.com/AztecProtocol/aztec-packages", sparse: [ - "docs/docs", + "docs", "noir-projects/aztec-nr", "noir-projects/noir-contracts", "yarn-project", @@ -46,7 +46,7 @@ const BASE_REPOS: Omit[] = [ "playground", ], sparsePathOverrides: [ - { paths: ["docs/docs"], branch: "next" }, + { paths: ["docs"], branch: "next" }, ], description: "Main Aztec monorepo - documentation, aztec-nr framework, and reference contracts", searchPatterns: { diff --git a/tests/repos/config.test.ts b/tests/repos/config.test.ts index 7aef39e..923c79c 100644 --- a/tests/repos/config.test.ts +++ b/tests/repos/config.test.ts @@ -28,9 +28,9 @@ describe("AZTEC_REPOS", () => { it("aztec-packages has sparsePathOverrides for docs/docs on next branch", () => { const ap = AZTEC_REPOS.find((r) => r.name === "aztec-packages"); - expect(ap?.sparse).toContain("docs/docs"); + expect(ap?.sparse).toContain("docs"); expect(ap?.sparsePathOverrides).toEqual([ - { paths: ["docs/docs"], branch: "next" }, + { paths: ["docs"], branch: "next" }, ]); }); From e77f4c9fa013fb8781ceb4980f36395136becc49 Mon Sep 17 00:00:00 2001 From: Josh Crites Date: Mon, 2 Mar 2026 15:22:58 -0500 Subject: [PATCH 6/6] feat: version-aware sparsePathOverrides with descriptive error messages - Use {version} placeholder in sparse path overrides, resolved from DEFAULT_AZTEC_VERSION in getAztecRepos - On override checkout failure, throw an error with the failed paths and GitHub browse links so the LLM can inspect actual folder names Co-Authored-By: Claude Opus 4.6 --- src/repos/config.ts | 16 +++++++++++-- src/utils/git.ts | 12 +++++++++- tests/repos/config.test.ts | 9 ++++++- tests/utils/git.test.ts | 48 ++++++++++++++++++++++++++++++++++++-- 4 files changed, 79 insertions(+), 6 deletions(-) diff --git a/src/repos/config.ts b/src/repos/config.ts index 3d8028d..777e556 100644 --- a/src/repos/config.ts +++ b/src/repos/config.ts @@ -27,7 +27,7 @@ export interface RepoConfig { } /** Default Aztec version (tag) to use - can be overridden via AZTEC_DEFAULT_VERSION env var */ -export const DEFAULT_AZTEC_VERSION = process.env.AZTEC_DEFAULT_VERSION || "v3.0.0-devnet.6-patch.1"; +export const DEFAULT_AZTEC_VERSION = process.env.AZTEC_DEFAULT_VERSION || "v4.0.0-devnet.2-patch.1"; /** * Base Aztec repository configurations (without version) @@ -46,7 +46,14 @@ const BASE_REPOS: Omit[] = [ "playground", ], sparsePathOverrides: [ - { paths: ["docs"], branch: "next" }, + { + paths: [ + "docs/developer_versioned_docs/version-{version}", + "docs/static/aztec-nr-api/devnet", + "docs/static/typescript-api/devnet", + ], + branch: "next", + }, ], description: "Main Aztec monorepo - documentation, aztec-nr framework, and reference contracts", searchPatterns: { @@ -128,6 +135,11 @@ export function getAztecRepos(version?: string): RepoConfig[] { ...repo, // Only apply version tag to Aztec repos, not Noir repos tag: repo.url.includes("AztecProtocol") ? tag : undefined, + // Resolve {version} placeholders in sparse path overrides + sparsePathOverrides: repo.sparsePathOverrides?.map((override) => ({ + ...override, + paths: override.paths.map((p) => p.replace("{version}", tag)), + })), })); } diff --git a/src/utils/git.ts b/src/utils/git.ts index c3d7dad..b12b050 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -95,7 +95,17 @@ export async function cloneRepo( if (config.sparsePathOverrides) { for (const override of config.sparsePathOverrides) { await repoGit.fetch(["--depth=1", "origin", override.branch]); - await repoGit.checkout([`origin/${override.branch}`, "--", ...override.paths]); + try { + await repoGit.checkout([`origin/${override.branch}`, "--", ...override.paths]); + } catch (error) { + const repoBase = config.url.replace(/\.git$/, ""); + const parentDirs = [...new Set(override.paths.map((p) => p.split("/").slice(0, -1).join("/")))]; + const browseLinks = parentDirs.map((d) => `${repoBase}/tree/${override.branch}/${d}`); + throw new Error( + `sparsePathOverrides failed for branch "${override.branch}": could not checkout paths [${override.paths.join(", ")}]. ` + + `Check the actual folder names at: ${browseLinks.join(" , ")}`, + ); + } } } } else { diff --git a/tests/repos/config.test.ts b/tests/repos/config.test.ts index 923c79c..e1169e3 100644 --- a/tests/repos/config.test.ts +++ b/tests/repos/config.test.ts @@ -30,7 +30,14 @@ describe("AZTEC_REPOS", () => { const ap = AZTEC_REPOS.find((r) => r.name === "aztec-packages"); expect(ap?.sparse).toContain("docs"); expect(ap?.sparsePathOverrides).toEqual([ - { paths: ["docs"], branch: "next" }, + { + paths: [ + `docs/developer_versioned_docs/version-${DEFAULT_AZTEC_VERSION}`, + "docs/static/aztec-nr-api/devnet", + "docs/static/typescript-api/devnet", + ], + branch: "next", + }, ]); }); diff --git a/tests/utils/git.test.ts b/tests/utils/git.test.ts index 5da0b74..8b79f89 100644 --- a/tests/utils/git.test.ts +++ b/tests/utils/git.test.ts @@ -149,7 +149,15 @@ describe("cloneRepo", () => { it("sparse + tag + sparsePathOverrides: fetches override branch and checks out paths", async () => { const overrideConfig: RepoConfig = { ...sparseConfig, - sparsePathOverrides: [{ paths: ["docs/docs"], branch: "next" }], + sparsePathOverrides: [ + { + paths: [ + "docs/developer_versioned_docs/version-v1.0.0", + "docs/static/api", + ], + branch: "next", + }, + ], }; mockExistsSync.mockReturnValue(false); mockGitInstance.clone.mockResolvedValue(undefined); @@ -172,10 +180,46 @@ describe("cloneRepo", () => { expect(mockGitInstance.checkout).toHaveBeenCalledWith([ "origin/next", "--", - "docs/docs", + "docs/developer_versioned_docs/version-v1.0.0", + "docs/static/api", ]); }); + it("sparse + tag + sparsePathOverrides: throws descriptive error with GitHub links on failure", async () => { + const overrideConfig: RepoConfig = { + ...sparseConfig, + sparsePathOverrides: [ + { + paths: [ + "docs/developer_versioned_docs/version-v1.0.0", + "docs/static/aztec-nr-api/devnet", + "docs/static/typescript-api/devnet", + ], + branch: "next", + }, + ], + }; + mockExistsSync.mockReturnValue(false); + mockGitInstance.clone.mockResolvedValue(undefined); + mockGitInstance.raw.mockResolvedValue(undefined); + mockGitInstance.fetch.mockResolvedValue(undefined); + // Tag checkout succeeds, override checkout fails + mockGitInstance.checkout + .mockResolvedValueOnce(undefined) // tag checkout + .mockRejectedValueOnce(new Error("pathspec did not match")); + + try { + await cloneRepo(overrideConfig); + expect.unreachable("should have thrown"); + } catch (e: any) { + expect(e.message).toMatch(/sparsePathOverrides failed for branch "next"/); + expect(e.message).toContain("docs/developer_versioned_docs/version-v1.0.0"); + expect(e.message).toContain("https://github.com/AztecProtocol/aztec-packages/tree/next/docs/developer_versioned_docs"); + expect(e.message).toContain("https://github.com/AztecProtocol/aztec-packages/tree/next/docs/static/aztec-nr-api"); + expect(e.message).toContain("https://github.com/AztecProtocol/aztec-packages/tree/next/docs/static/typescript-api"); + } + }); + it("sparse + commit: clones with sparse flags, fetches commit", async () => { const commitConfig: RepoConfig = { ...sparseConfig,