Skip to content

Commit bab3c68

Browse files
authored
Merge branch 'develop' into docs/homepage-and-nav-refresh
2 parents 5ea78f5 + 4dfad2f commit bab3c68

16 files changed

Lines changed: 194 additions & 169 deletions

File tree

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Mypy Checks
1+
name: Ty Checks
22

33
on:
44
pull_request:
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
mypy:
13+
ty:
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 20
1616

@@ -32,23 +32,20 @@ jobs:
3232
run: |
3333
python_files=()
3434
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
35-
if [[ $file == *.py ]]; then
35+
if [[ $file == src/graph_sitter/*.py || $file == src/codemods/*.py || $file == src/gsbuild/*.py ]]; then
3636
python_files+=("${file}")
3737
fi
3838
done
3939
echo "python_files=${python_files[*]}" >> $GITHUB_ENV
4040
41-
- name: Add MyPy annotator
42-
uses: pr-annotators/mypy-pr-annotator@v1.0.0
43-
4441
- name: Skip rust rewrite baseline type debt
4542
if: ${{ env.python_files != '' && github.event.pull_request.head.ref == 'rust-rewrite' }}
4643
run: |
47-
echo "Skipping PR-wide mypy for the rust-rewrite baseline merge."
44+
echo "Skipping PR-wide ty for the rust-rewrite baseline merge."
4845
echo "Known type debt is documented in rust-rewrite/agent-handoff.md."
4946
50-
- name: Run mypy
47+
- name: Run ty
5148
if: ${{ env.python_files != '' && github.event.pull_request.head.ref != 'rust-rewrite' }}
5249
run: |
53-
echo "Running mypy on changed files: ${{ env.python_files }}"
54-
uv run mypy --no-pretty --show-absolute-path ${{ env.python_files }}
50+
echo "Running ty on changed files: ${{ env.python_files }}"
51+
uv run ty check --output-format=github ${{ env.python_files }}

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Frontend
44

55
- The Vercel app lives in `site/`.
6+
- Vercel is configured by `site/vercel.json`; preview builds skip full docs prerendering, and the ignored build step skips builds unless `site/` or `docs/` changed.
67
- Use Aura Dark from `daltonmenezes/aura-theme` for frontend dark mode and code surfaces. Core palette: background `#15141b`, foreground `#edecee`, muted `#6d6d6d`, purple `#a277ff`, green `#61ffca`, orange `#ffca85`, pink `#f694ff`, blue `#82e2ff`, red `#ff6767`.
78
- Keep docs syntax highlighting aligned with the Aura Dark palette.
89
- Use Node 22 for local site commands: `PATH="$HOME/.nvm/versions/node/v22.19.0/bin:$PATH" npm --prefix site run build`.

mypy.ini

Lines changed: 0 additions & 51 deletions
This file was deleted.

pyproject.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ dev-dependencies = [
130130
"pytest>=8.3.3",
131131
"pytest-cov>=6.3.0,<6.3.1",
132132
"ruff>=0.6.8",
133-
"mypy[mypyc,faster-cache]>=1.13.0",
134133
"pre-commit>=4.0.1",
135134
"pytest-xdist>=3.6.1,<4.0.0",
136135
"pytest-mock<4.0.0,>=3.14.0",
@@ -162,6 +161,7 @@ dev-dependencies = [
162161
"pytest-lsp>=1.0.0b1",
163162
"cython>=3.0.11",
164163
"pytest-split>=0.10.0",
164+
"ty>=0.0.51",
165165
]
166166

167167
[tool.uv.workspace]
@@ -202,6 +202,23 @@ show_contexts = true
202202
[tool.pyright]
203203
pythonVersion = "3.12"
204204
enableExperimentalFeatures = true
205+
206+
[tool.ty.environment]
207+
python-version = "3.12"
208+
209+
[tool.ty.src]
210+
include = ["src/graph_sitter", "src/codemods", "src/gsbuild"]
211+
exclude = [
212+
".idea/**",
213+
".vscode/**",
214+
"**/codegen_tests/**",
215+
"tests/**",
216+
"scripts/**",
217+
"**/codemods/**/test_*/**",
218+
"expected/**",
219+
"tests/unit/skills/snapshots/**",
220+
]
221+
205222
[tool.pytest.ini_options]
206223
# addopts = -v
207224
pythonpath = "."

rust-rewrite/agent-handoff.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Hosted checks on the current branch are the stronger merge signal for large-repo
5858
- Complete mutable expression object parity.
5959
- Promise-chain async conversion parity.
6060
- Rust backend readiness as a default backend for production without explicit rollout gates.
61-
- Clean branch-wide mypy. The rust-rewrite baseline PR intentionally skips PR-wide mypy because the branch changes a large Python surface with known type debt; future focused PRs should restore normal mypy expectations for the files they touch.
61+
- Clean branch-wide ty. The rust-rewrite baseline PR intentionally skips PR-wide ty because the branch changes a large Python surface with known type debt; future focused PRs should restore normal ty expectations for the files they touch.
6262

6363
## High-Value Fanout Lanes
6464

rust-rewrite/future-agent-brief.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This branch is intended to become the new development baseline, not the final Ru
1010
- Public API stance: keep the Python shell for users and codemods.
1111
- Backend stance: Rust compact mode is opt-in and covers the supported subset documented in `supported-subset.json`.
1212
- Python backend stance: keep it after this merge. Delete it only after the deletion gates below pass.
13-
- CI stance: fast Rust checks, extension builds, wheel smokes, docs/site checks, and large-repo opt-in checks are the meaningful signal for this baseline. Branch-wide mypy is intentionally skipped for the baseline PR because the branch carries known type debt across a large changed Python surface. The legacy GitHub fixture-push integration tests are also skipped only for the `rust-rewrite` baseline PR because they push branches to an external fixture repo and require a writable PAT; restore or replace that lane after merge. Current `pull_request_target` runs get this through test-level `GITHUB_HEAD_REF == "rust-rewrite"` skips because workflow edits in this PR are not used until they land on `develop`. General release wheels still build `macos-13` on tags/workflow calls, but PRs skip that queue-heavy duplicate and rely on `macos-latest` for macOS smoke.
13+
- CI stance: fast Rust checks, extension builds, wheel smokes, docs/site checks, and large-repo opt-in checks are the meaningful signal for this baseline. Branch-wide ty is intentionally skipped for the baseline PR because the branch carries known type debt across a large changed Python surface. The legacy GitHub fixture-push integration tests are also skipped only for the `rust-rewrite` baseline PR because they push branches to an external fixture repo and require a writable PAT; restore or replace that lane after merge. Current `pull_request_target` runs get this through test-level `GITHUB_HEAD_REF == "rust-rewrite"` skips because workflow edits in this PR are not used until they land on `develop`. General release wheels still build `macos-13` on tags/workflow calls, but PRs skip that queue-heavy duplicate and rely on `macos-latest` for macOS smoke.
1414

1515
## What Future Agents Should Trust
1616

@@ -27,7 +27,7 @@ This branch is intended to become the new development baseline, not the final Ru
2727
- Full TypeScript type-system, namespace, JSX prop, and mutable expression-object parity.
2828
- Python backend deletion readiness.
2929
- Published-package `uvx graph-sitter ...` claims until a real released artifact is validated.
30-
- Branch-wide mypy cleanliness.
30+
- Branch-wide ty cleanliness.
3131
- Legacy GitHub push integration coverage on the baseline PR; the Rust merge signal comes from unit, fast, extension, wheel, docs/site, and large-repo proof lanes.
3232

3333
## Python Backend Deletion Gates
@@ -40,7 +40,7 @@ The Python backend can be removed only after these are complete:
4040
- [ ] Add full graph-wide parity harnesses for pinned Airflow and Next.js. Evidence: file, import, export, reference, dependency, external-reference, subclass, and deterministic ordering comparisons.
4141
- [ ] Expand codemod parity beyond smoke flows. Evidence: real codemods on pinned large repos assert exact file-byte diffs, changed-file sets, wall time, and RSS.
4242
- [ ] Replace or remove Python-only graph internals. Evidence: no required public path depends on `rustworkx.PyDiGraph`, eager `SourceFile._nodes`, persistent `tree_sitter.Node` wrappers, or Python object graph traversal.
43-
- [ ] Restore normal mypy and external integration expectations. Evidence: remove the `rust-rewrite` PR skip in `.github/workflows/mypy.yml`, remove the baseline-only `integration-tests` skip in `.github/workflows/test.yml`, or replace the fixture-push tests with hermetic/local equivalents.
43+
- [ ] Restore normal ty and external integration expectations. Evidence: remove the `rust-rewrite` PR skip in `.github/workflows/ty.yml`, remove the baseline-only `integration-tests` skip in `.github/workflows/test.yml`, or replace the fixture-push tests with hermetic/local equivalents.
4444
- [ ] Validate released `uvx graph-sitter ...` package behavior. Evidence: `uvx graph-sitter doctor`, `parse`, `run`, and `transform` work from a clean environment with a published version.
4545

4646
## Highest-Value Fanout Work

site/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,23 @@ Recommended project settings:
5757
```text
5858
Framework Preset: Next.js
5959
Root Directory: site
60-
Build Command: default
60+
Build Command: checked in via `site/vercel.json`
6161
Output Directory: default
6262
Install Command: default
63+
Ignored Build Step: node scripts/ignore-build.mjs
6364
Production Branch: the integrator-approved trunk branch
6465
```
6566

67+
The Vercel build command is checked in via `site/vercel.json`. Preview builds
68+
set `GRAPH_SITTER_PRERENDER_DOCS=0`, so the docs route renders pages on demand
69+
instead of prerendering every MD/MDX page during deployment. Production and
70+
local `npm run build` builds still prerender the full docs tree.
71+
72+
The ignored build step is also checked in via `site/vercel.json`. It skips
73+
Vercel builds when a commit does not change `site/` or `docs/`, using
74+
`VERCEL_GIT_PREVIOUS_SHA` when Vercel exposes system environment variables and
75+
falling back to `HEAD^` otherwise.
76+
6677
From an authenticated Vercel CLI session:
6778

6879
```bash

site/app/docs/[[...slug]]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ type DocsPageProps = {
3535
}>;
3636
};
3737

38-
export const dynamicParams = false;
38+
const shouldPrerenderDocs = process.env.GRAPH_SITTER_PRERENDER_DOCS !== "0";
3939

4040
export function generateStaticParams() {
41-
return getDocsStaticParams();
41+
return shouldPrerenderDocs ? getDocsStaticParams() : [];
4242
}
4343

4444
export async function generateMetadata({

site/next.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
66
/** @type {import('next').NextConfig} */
77
const nextConfig = {
88
outputFileTracingRoot: path.join(__dirname, ".."),
9+
outputFileTracingIncludes: {
10+
"/docs/\\[\\[\\.\\.\\.slug\\]\\]": ["../docs/**/*"],
11+
},
912
};
1013

1114
export default nextConfig;

site/scripts/ignore-build.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { spawnSync } from "node:child_process";
2+
3+
const watchedPaths = [":/site", ":/docs"];
4+
const currentRef = process.env.VERCEL_GIT_COMMIT_SHA || "HEAD";
5+
const previousRef = process.env.VERCEL_GIT_PREVIOUS_SHA;
6+
7+
if (isTruthy(process.env.VERCEL_FORCE_BUILD)) {
8+
console.log("Vercel build forced by VERCEL_FORCE_BUILD.");
9+
process.exit(1);
10+
}
11+
12+
const baseRef = pickBaseRef(previousRef);
13+
if (!baseRef) {
14+
console.log("No previous git ref found; running the Vercel build.");
15+
process.exit(1);
16+
}
17+
18+
const diff = spawnSync(
19+
"git",
20+
["diff", "--quiet", baseRef, currentRef, "--", ...watchedPaths],
21+
{ stdio: "inherit" },
22+
);
23+
24+
if (diff.status === 0) {
25+
console.log(`No site/docs changes since ${baseRef}; skipping Vercel build.`);
26+
process.exit(0);
27+
}
28+
29+
if (diff.status === 1) {
30+
console.log(
31+
`Detected site/docs changes since ${baseRef}; running Vercel build.`,
32+
);
33+
process.exit(1);
34+
}
35+
36+
console.log("Could not evaluate site/docs diff; running Vercel build.");
37+
process.exit(1);
38+
39+
function pickBaseRef(ref) {
40+
if (ref && hasCommit(ref)) {
41+
return ref;
42+
}
43+
44+
return hasCommit("HEAD^") ? "HEAD^" : undefined;
45+
}
46+
47+
function hasCommit(ref) {
48+
const result = spawnSync("git", ["cat-file", "-e", `${ref}^{commit}`], {
49+
stdio: "ignore",
50+
});
51+
52+
return result.status === 0;
53+
}
54+
55+
function isTruthy(value) {
56+
return /^(1|true|yes)$/iu.test(value ?? "");
57+
}

0 commit comments

Comments
 (0)