Skip to content

Commit 9ebff63

Browse files
committed
docs: detect orphaned URLs, restore deleted-tutorial redirects, restructure llms.txt
1 parent f76190f commit 9ebff63

12 files changed

Lines changed: 1028 additions & 54 deletions

docs/bootstrap.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,54 @@ function test {
5353
test_cmds | parallelize
5454
}
5555

56+
function check_orphaned_urls {
57+
echo_header "Check orphaned URLs"
58+
# Source the baseline from the base branch, not the working tree, so a PR
59+
# cannot weaken its own gate by deleting URLs from the snapshot in the same
60+
# diff. The committed snapshot only grows the protected set for future PRs;
61+
# the check a PR must satisfy is the base-branch version it cannot edit.
62+
local snapshot=snapshots/published-urls.txt
63+
local base_ref="${GITHUB_BASE_REF:-next}"
64+
local tmp
65+
tmp=$(mktemp)
66+
# shellcheck disable=SC2064
67+
trap "rm -f '$tmp'" RETURN
68+
69+
# Resolve the base branch first, distinguishing "base unreachable" from "base
70+
# reachable but snapshot absent". Only the latter is a legitimate fallback (it
71+
# happens for the PR that first introduces the snapshot). Treating an
72+
# unreachable base as a fallback would silently reopen the bypass.
73+
local base_obj=""
74+
if git rev-parse --verify -q "origin/${base_ref}" >/dev/null; then
75+
base_obj="origin/${base_ref}"
76+
elif git fetch -q origin "$base_ref" 2>/dev/null; then
77+
base_obj="FETCH_HEAD"
78+
fi
79+
80+
local baseline
81+
if [[ -n "$base_obj" ]]; then
82+
if git show "${base_obj}:docs/${snapshot}" >"$tmp" 2>/dev/null; then
83+
echo "Using base-branch baseline (${base_obj})."
84+
baseline="$tmp"
85+
else
86+
echo "Base branch ${base_ref} has no snapshot yet; using working-tree snapshot (introducing PR)."
87+
baseline="$snapshot"
88+
fi
89+
elif [[ "${CI:-0}" -eq 1 ]]; then
90+
# In CI the base must be reachable; downgrading to the PR's own editable
91+
# snapshot would reopen the bypass this gate exists to close.
92+
echo "ERROR: cannot resolve base branch origin/${base_ref} to source the orphan-check baseline." >&2
93+
return 1
94+
else
95+
echo "Base branch origin/${base_ref} unavailable; using working-tree snapshot (local run)."
96+
baseline="$snapshot"
97+
fi
98+
99+
local rc=0
100+
FAIL_ON_ORPHAN=1 ./scripts/check_orphaned_urls.sh "$baseline" || rc=$?
101+
return $rc
102+
}
103+
56104
function check_references {
57105
if [[ "${GITHUB_EVENT_NAME:-}" != "merge_group" ]]; then
58106
echo "Skipping doc reference check (only runs in merge queue)."
@@ -81,11 +129,13 @@ case "$cmd" in
81129
build_examples
82130
build_docs
83131
test
132+
check_orphaned_urls
84133
check_references
85134
;;
86135
"")
87136
build_examples
88137
build_docs
138+
check_orphaned_urls
89139
check_references
90140
;;
91141
"hash")

docs/docs-developers/ai_tooling.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ For Claude Code, create a `CLAUDE.md` file in your project root. For Codex, crea
2222
```markdown
2323
# Aztec Project
2424

25-
## Critical: Use `aztec` CLI, not `nargo` directly
25+
## Critical: Use the `aztec` CLI, not `nargo` or `bb` directly
2626

27-
This is an Aztec smart contract project. Always use the `aztec` CLI wrapper instead of calling `nargo` directly:
27+
This is an Aztec smart contract project. Always use the `aztec` CLI wrapper instead of calling `nargo` or `bb` (the Barretenberg prover) directly:
2828

2929
- **Compile**: `aztec compile` (NOT `nargo compile`). Using `nargo compile` alone produces incomplete artifacts.
3030
- **Test**: `aztec test` (NOT `nargo test`).
31+
- **Prove**: NEVER call `bb` directly. Proof generation is handled for you by the PXE through the `aztec` CLI and `aztec.js`. There is no contract-development workflow that runs `bb` by hand.
3132
- **Other nargo commands** like `aztec-nargo fmt` and `aztec-nargo doc` are fine to use directly. The Aztec installer exposes the bundled `nargo` as `aztec-nargo`; bare `nargo` resolves to your own install (if any), not the bundled one.
3233

3334
## Error Handling
@@ -57,7 +58,7 @@ This prevents the two most common AI mistakes: using `nargo compile`/`nargo test
5758

5859
### Why this matters
5960

60-
LLMs have extensive training data for `nargo` (the standalone Noir compiler) but limited exposure to the `aztec` CLI wrapper. Without explicit instructions, they default to `nargo compile`, which produces artifacts missing the AVM transpilation step.
61+
LLMs have extensive training data for `nargo` (the standalone Noir compiler) and `bb` (the Barretenberg prover CLI) but limited exposure to the `aztec` CLI wrapper. Without explicit instructions, they default to `nargo compile` (which produces artifacts missing the AVM transpilation step) or reach for `bb` to generate proofs. In an Aztec project, compilation and proving both go through the `aztec` tooling.
6162

6263
## MCP servers
6364

docs/docs-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,4 +441,5 @@ reentrancy
441441
variadic
442442
Wonderland
443443
indistinguishability
444+
llmstxt
444445
nightlies

docs/llms.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Aztec Protocol Documentation
2+
3+
> Privacy-centric zkRollup for Ethereum. This repository builds the developer documentation site; the canonical `llms.txt` is auto-generated from it and published on the docs site.
4+
5+
The published, always-current LLM-friendly files live on the docs site:
6+
7+
- [llms.txt](https://docs.aztec.network/llms.txt): navigational index of the documentation, following the [llmstxt.org](https://llmstxt.org) standard.
8+
- [llms-full.txt](https://docs.aztec.network/llms-full.txt): the complete documentation as a single file.
9+
10+
These are regenerated on every docs build, so prefer them over this checked-in pointer for the current API surface and guides.
11+
12+
## AI tooling
13+
14+
- [AI Tooling guide](https://docs.aztec.network/developers/ai_tooling): recommended `CLAUDE.md` / `AGENTS.md` instructions, MCP servers, and skills for Aztec and Noir development. Read this first when setting up an AI coding agent for an Aztec project.

docs/netlify.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,37 @@
425425
from = "/developers/docs/tutorials/faceid_wallet"
426426
to = "/developers/docs/tutorials/contract_tutorials/counter_contract"
427427

428+
# =============================================================================
429+
# ACTIVE REDIRECTS: Removed contract tutorials (PR #16788)
430+
# These pages were deleted without a redirect; LLMs trained on older versions
431+
# of the docs still link to them. Send each to the closest current page.
432+
# =============================================================================
433+
[[redirects]]
434+
from = "/developers/docs/tutorials/contract_tutorials/private_voting_contract"
435+
to = "/developers/docs/aztec-nr/framework-description/state_variables"
436+
status = 301
437+
438+
[[redirects]]
439+
from = "/developers/docs/tutorials/contract_tutorials/crowdfunding_contract"
440+
to = "/developers/docs/tutorials/contract_tutorials/token_contract"
441+
status = 301
442+
443+
[[redirects]]
444+
from = "/developers/docs/tutorials/contract_tutorials/nft_contract"
445+
to = "/developers/docs/aztec-nr/standards/aip-721"
446+
status = 301
447+
448+
[[redirects]]
449+
from = "/developers/docs/tutorials/contract_tutorials/write_accounts_contract"
450+
to = "/developers/docs/aztec-js/how_to_create_account"
451+
status = 301
452+
453+
# Bare /developers/getting_started landed on no page after the local/testnet split
454+
[[redirects]]
455+
from = "/developers/getting_started"
456+
to = "/developers/getting_started_on_local_network"
457+
status = 301
458+
428459
# Legacy network paths - SPECIFIC PATHS MUST COME BEFORE WILDCARDS
429460
# (Netlify processes redirects top-to-bottom, first match wins)
430461
[[redirects]]

docs/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "yarn clean && yarn preprocess && yarn spellcheck && yarn preprocess:move && yarn validate:redirects && yarn validate:api-ref-links && docusaurus build && node scripts/augment_sitemap.js && node scripts/append_api_docs_to_llms.js",
6+
"build": "yarn clean && yarn preprocess && yarn spellcheck && yarn preprocess:move && yarn validate:redirects && yarn validate:api-ref-links && yarn docusaurus build && node scripts/augment_sitemap.js && node scripts/append_api_docs_to_llms.js",
77
"validate:redirects": "./scripts/validate_redirect_targets.sh",
88
"validate:api-ref-links": "./scripts/validate_api_ref_links.sh",
9+
"check:orphaned-urls": "./scripts/check_orphaned_urls.sh",
910
"clean": "./scripts/clean.sh",
1011
"dev:netlify": "yarn netlify dev",
1112
"generate:aztec-nr-api": "./scripts/aztec_nr_docs_generation/generate_aztec_nr_docs.sh",
1213
"generate:typescript-api": "./scripts/typescript_api_generation/generate_ts_api_docs.sh",
1314
"generate:node-api-reference": "./scripts/node_api_reference_generation/generate_node_api_reference.sh",
1415
"preprocess": "yarn node -r dotenv/config ./src/preprocess/index.js",
1516
"preprocess:move": "sh scripts/move_processed.sh",
16-
"serve": "docusaurus serve",
17+
"serve": "yarn docusaurus serve",
1718
"spellcheck": "yarn cspell",
1819
"spellcheck:appendwords": "yarn cspell --words-only --unique | sort --ignore-case >> docs-words.txt",
19-
"start": "yarn clean && yarn preprocess && yarn generate:aztec-nr-api && docusaurus start --host ${HOST:-localhost}",
20+
"start": "yarn clean && yarn preprocess && yarn generate:aztec-nr-api && yarn docusaurus start --host ${HOST:-localhost}",
2021
"test": "node --test src/preprocess/__tests__/*.test.js",
2122
"test:preprocess": "node --test src/preprocess/__tests__/*.test.js"
2223
},

0 commit comments

Comments
 (0)