Sync ctx de646b5 (part 2)
Browse filesGitHub commit: de646b52b9d87ec28e88b8a5dca388f9602342d7
- pyproject.toml +1 -0
- qa/feature_status.csv +1 -0
- scripts/ci_preflight.py +79 -64
- scripts/local_fast_gate.py +23 -8
- scripts/no_mistakes_run.sh +79 -1
pyproject.toml
CHANGED
|
@@ -97,6 +97,7 @@ ctx-mcp-server = "ctx.mcp_server.server:main"
|
|
| 97 |
dev = [
|
| 98 |
"pytest>=8",
|
| 99 |
"pytest-cov>=5",
|
|
|
|
| 100 |
"hypothesis>=6",
|
| 101 |
"mypy>=1.8",
|
| 102 |
"numpy<2.5",
|
|
|
|
| 97 |
dev = [
|
| 98 |
"pytest>=8",
|
| 99 |
"pytest-cov>=5",
|
| 100 |
+
"pytest-xdist>=3.8",
|
| 101 |
"hypothesis>=6",
|
| 102 |
"mypy>=1.8",
|
| 103 |
"numpy<2.5",
|
qa/feature_status.csv
CHANGED
|
@@ -135,6 +135,7 @@ DIST-004,,docs/qa/feature-user-story-status.csv,Distribution,Hugging Face sync w
|
|
| 135 |
DIST-005,,docs/qa/feature-user-story-status.csv,Distribution,Clean host contract workflow,.github/workflows/clean-host-contract.yml,.github/workflows/clean-host-contract.yml,High,As a new installer I can verify ctx works on a clean host,Workflow installs the package in a clean environment and runs the clean-host smoke contract,GitHub Actions available,gh run view 28340695216,Automated Test,Retested Pass,PASS: Clean host contract job 83954561453 passed inside main Tests run 28340695216 for 16c96b1.,,,,,,2026-06-29,Telemetry/Release Lane,Revalidated through the current required main workflow after the inventory wording merge.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 136 |
DIST-006,,docs/qa/feature-user-story-status.csv,Distribution,PyPI publish workflow,.github/workflows/publish.yml,.github/workflows/publish.yml,High,As a PyPI user I can install the tagged release with matching graph artifacts,Tag publish builds the wheel validates graph artifacts uploads release assets and publishes the package,Published release tag and clean temporary PyPI install environment,Inspect publish workflow run plus release/PyPI metadata; install claude-ctx from PyPI and load ctx-telemetry-export; run local full graph/dashboard smoke,CI/CD Gate,Retested Pass,"PASS: v1.0.20 Publish to PyPI workflow run 28371022076 succeeded for 2bfce9275b34ecabda1742180607020fab3f8b0c; release assets include wiki-graph.tar.gz, wiki-graph-runtime.tar.gz, skills-sh-catalog.json.gz, communities.json, and entity-overlays.jsonl with SHA-256 digests; PyPI exposes claude-ctx 1.0.20 wheel and sdist; clean temp venv installed claude-ctx==1.0.20 and loaded ctx-telemetry-export.",,,,,,2026-06-29,Telemetry/Release Lane,"Release v1.0.20 is published on GitHub and PyPI; full local ctx-init --graph --graph-install-mode full populated the LLM-wiki, and dashboard smoke passed all graph/wiki/entity routes.",Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 137 |
DIST-007,,docs/qa/feature-user-story-status.csv,Distribution,Parallel pytest experiment workflow,.github/workflows/xdist-experiment.yml,.github/workflows/xdist-experiment.yml,High,As a maintainer I can benchmark pytest-xdist safely before adopting it,Workflow runs only when explicitly dispatched and does not affect required checks until proven stable,GitHub Actions available,Manual workflow_dispatch run for xdist experiment,Automated Test,Tested Pass,GitHub Actions run 28133264595 passed on ubuntu-latest windows-latest and macos-latest with Python 3.12.,,,,,,2026-06-24,Telemetry/Release Lane,Dispatched manually on main; optional experiment remains out of required checks.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
|
|
|
| 138 |
CICD-001,,docs/qa/feature-user-story-status.csv,Distribution,Tracker gates in docs and release workflows,".github/workflows/docs.yml, .github/workflows/publish.yml","src/tests/test_bug_smoke_tracker.py, src/tests/test_feature_user_story_tracker.py, src/tests/test_dashboard_user_story_tracker.py, and src/tests/test_toolbox_cli.py",High,As a release reviewer I can trust docs deploys and release tags cannot bypass tracker integrity,"Docs deploy and publish release canaries run bug-smoke, feature, dashboard, and toolbox tracker suites before deployment or publishing",GitHub Actions available,python -m pytest src/tests/test_bug_smoke_tracker.py src/tests/test_feature_user_story_tracker.py src/tests/test_dashboard_user_story_tracker.py src/tests/test_toolbox_cli.py -q --no-cov,Automated Test,Tested Pass,Tracker enforcement test checks docs and publish workflows run the canonical public docs tracker suite list.,,,,,,2026-06-29,Telemetry/Release Lane,Added after expert audit found docs deploy and publish could rely on strict build without tracker checks.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 139 |
SEC-001,,docs/qa/feature-user-story-status.csv,Distribution,Hugging Face token fail-closed workflow policy,.github/workflows/huggingface-sync.yml,.github/workflows/huggingface-sync.yml,High,As a repository owner I want canonical Hugging Face sync to fail when its publishing secret is absent,The canonical stevesolun/ctx workflow exits non-zero without HF_TOKEN while forks may skip safely without publishing,GitHub Actions workflow metadata available,python -m pytest src/tests/test_feature_user_story_tracker.py -q,Automated Test,Tested Pass,Tracker enforcement test checks canonical repository guard and Missing HF_TOKEN error marker in the workflow.,,,,,,2026-06-29,Telemetry/Release Lane,Separate from DIST-004 credential rotation which still requires external token revocation.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 140 |
SEC-002,,docs/qa/feature-user-story-status.csv,Distribution,No-mistakes development gate,no-mistakes axi run,imported-skills/no-mistakes and no-mistakes binary,High,As a maintainer I can gate feature branches through no-mistakes before merge,The no-mistakes pipeline runs intent rebase review test docs lint push PR and CI before changes reach main,Feature branch with committed changes,no-mistakes axi run --intent tracker-governance-change,Automated Test,Tested Pass,no-mistakes run 01KW9N9RP1F7N9T593164EPZY6 reached checks-passed and PR #206 merged after CI success.,,,,,,2026-06-29,Telemetry/Release Lane,Tracks the required development-process gate requested for enterprise readiness.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
|
|
|
| 135 |
DIST-005,,docs/qa/feature-user-story-status.csv,Distribution,Clean host contract workflow,.github/workflows/clean-host-contract.yml,.github/workflows/clean-host-contract.yml,High,As a new installer I can verify ctx works on a clean host,Workflow installs the package in a clean environment and runs the clean-host smoke contract,GitHub Actions available,gh run view 28340695216,Automated Test,Retested Pass,PASS: Clean host contract job 83954561453 passed inside main Tests run 28340695216 for 16c96b1.,,,,,,2026-06-29,Telemetry/Release Lane,Revalidated through the current required main workflow after the inventory wording merge.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 136 |
DIST-006,,docs/qa/feature-user-story-status.csv,Distribution,PyPI publish workflow,.github/workflows/publish.yml,.github/workflows/publish.yml,High,As a PyPI user I can install the tagged release with matching graph artifacts,Tag publish builds the wheel validates graph artifacts uploads release assets and publishes the package,Published release tag and clean temporary PyPI install environment,Inspect publish workflow run plus release/PyPI metadata; install claude-ctx from PyPI and load ctx-telemetry-export; run local full graph/dashboard smoke,CI/CD Gate,Retested Pass,"PASS: v1.0.20 Publish to PyPI workflow run 28371022076 succeeded for 2bfce9275b34ecabda1742180607020fab3f8b0c; release assets include wiki-graph.tar.gz, wiki-graph-runtime.tar.gz, skills-sh-catalog.json.gz, communities.json, and entity-overlays.jsonl with SHA-256 digests; PyPI exposes claude-ctx 1.0.20 wheel and sdist; clean temp venv installed claude-ctx==1.0.20 and loaded ctx-telemetry-export.",,,,,,2026-06-29,Telemetry/Release Lane,"Release v1.0.20 is published on GitHub and PyPI; full local ctx-init --graph --graph-install-mode full populated the LLM-wiki, and dashboard smoke passed all graph/wiki/entity routes.",Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 137 |
DIST-007,,docs/qa/feature-user-story-status.csv,Distribution,Parallel pytest experiment workflow,.github/workflows/xdist-experiment.yml,.github/workflows/xdist-experiment.yml,High,As a maintainer I can benchmark pytest-xdist safely before adopting it,Workflow runs only when explicitly dispatched and does not affect required checks until proven stable,GitHub Actions available,Manual workflow_dispatch run for xdist experiment,Automated Test,Tested Pass,GitHub Actions run 28133264595 passed on ubuntu-latest windows-latest and macos-latest with Python 3.12.,,,,,,2026-06-24,Telemetry/Release Lane,Dispatched manually on main; optional experiment remains out of required checks.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 138 |
+
DIST-008,,docs/qa/feature-user-story-status.csv,Distribution,M5 local-fast accelerator workflow,.github/workflows/m5-local-fast.yml,.github/workflows/m5-local-fast.yml,High,As a maintainer I can run trusted local-fast gates on the M5 runner before spending no-mistakes review time,Workflow runs only when manually dispatched by a maintainer targets ctx-m5 self-hosted macOS ARM64 creates a local Python 3.12 venv runs local_fast_gate.py with the PR profile and uploads timing evidence,ctx-m5 self-hosted runner online and workflow ref trusted,gh workflow run M5 local-fast accelerator plus gh run view latest M5 local-fast accelerator run plus python -m pytest src/tests/test_feature_user_story_tracker.py -q,Automated Test,Retested Pass,PASS: M5 workflow routed to ctx-m5 and executed local-fast lanes with timing evidence; tracker coverage now includes the workflow path.,,,,,,2026-07-09,Telemetry/Release Lane,Manual trusted accelerator only. It does not run automatically on pull_request so self-hosted queue outages cannot block PR merge.,Reviewed locally,Focused tracker and live M5 workflow evidence reviewed.,Ponytail: keep M5 as a manual accelerator so required PR checks remain hosted and merge-safe.,Validated by focused tracker tests and live M5 workflow rerun
|
| 139 |
CICD-001,,docs/qa/feature-user-story-status.csv,Distribution,Tracker gates in docs and release workflows,".github/workflows/docs.yml, .github/workflows/publish.yml","src/tests/test_bug_smoke_tracker.py, src/tests/test_feature_user_story_tracker.py, src/tests/test_dashboard_user_story_tracker.py, and src/tests/test_toolbox_cli.py",High,As a release reviewer I can trust docs deploys and release tags cannot bypass tracker integrity,"Docs deploy and publish release canaries run bug-smoke, feature, dashboard, and toolbox tracker suites before deployment or publishing",GitHub Actions available,python -m pytest src/tests/test_bug_smoke_tracker.py src/tests/test_feature_user_story_tracker.py src/tests/test_dashboard_user_story_tracker.py src/tests/test_toolbox_cli.py -q --no-cov,Automated Test,Tested Pass,Tracker enforcement test checks docs and publish workflows run the canonical public docs tracker suite list.,,,,,,2026-06-29,Telemetry/Release Lane,Added after expert audit found docs deploy and publish could rely on strict build without tracker checks.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 140 |
SEC-001,,docs/qa/feature-user-story-status.csv,Distribution,Hugging Face token fail-closed workflow policy,.github/workflows/huggingface-sync.yml,.github/workflows/huggingface-sync.yml,High,As a repository owner I want canonical Hugging Face sync to fail when its publishing secret is absent,The canonical stevesolun/ctx workflow exits non-zero without HF_TOKEN while forks may skip safely without publishing,GitHub Actions workflow metadata available,python -m pytest src/tests/test_feature_user_story_tracker.py -q,Automated Test,Tested Pass,Tracker enforcement test checks canonical repository guard and Missing HF_TOKEN error marker in the workflow.,,,,,,2026-06-29,Telemetry/Release Lane,Separate from DIST-004 credential rotation which still requires external token revocation.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
| 141 |
SEC-002,,docs/qa/feature-user-story-status.csv,Distribution,No-mistakes development gate,no-mistakes axi run,imported-skills/no-mistakes and no-mistakes binary,High,As a maintainer I can gate feature branches through no-mistakes before merge,The no-mistakes pipeline runs intent rebase review test docs lint push PR and CI before changes reach main,Feature branch with committed changes,no-mistakes axi run --intent tracker-governance-change,Automated Test,Tested Pass,no-mistakes run 01KW9N9RP1F7N9T593164EPZY6 reached checks-passed and PR #206 merged after CI success.,,,,,,2026-06-29,Telemetry/Release Lane,Tracks the required development-process gate requested for enterprise readiness.,Reviewed by no-mistakes,Historical tracker import; current canonical row is covered by completed goal-loop review and no-mistakes gate.,Ponytail: no fix needed unless retest produces a concrete regression.,Validated by completed goal-loop and no-mistakes gate
|
scripts/ci_preflight.py
CHANGED
|
@@ -30,6 +30,7 @@ PUBLIC_DOCS_TRACKER_TESTS = (
|
|
| 30 |
"src/tests/test_dashboard_user_story_tracker.py",
|
| 31 |
"src/tests/test_toolbox_cli.py",
|
| 32 |
)
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
GRAPH_VALIDATE_ARGS = (
|
|
@@ -298,6 +299,7 @@ def select_checks(
|
|
| 298 |
"same contracts on this host."
|
| 299 |
]
|
| 300 |
|
|
|
|
| 301 |
source_required = profile == "full" or (not flags["docs_only"] and not flags["graph_only"])
|
| 302 |
policy_required = not flags["docs_only"] and not flags["graph_only"]
|
| 303 |
if policy_required:
|
|
@@ -316,72 +318,80 @@ def select_checks(
|
|
| 316 |
(python, "-m", "ruff", "format", "--check", "src", "hooks", "scripts"),
|
| 317 |
),
|
| 318 |
Check("ruff", (python, "-m", "ruff", "check", "src", "hooks", "scripts")),
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
"-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
),
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
|
| 345 |
),
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
),
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
)
|
| 365 |
|
| 366 |
if flags["docs_changed"]:
|
| 367 |
-
checks.
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
*PUBLIC_DOCS_TRACKER_TESTS,
|
| 378 |
-
),
|
| 379 |
),
|
| 380 |
-
|
| 381 |
-
]
|
| 382 |
)
|
|
|
|
|
|
|
| 383 |
|
| 384 |
-
if profile == "full" or flags["telemetry_changed"]:
|
| 385 |
checks.append(
|
| 386 |
Check(
|
| 387 |
"telemetry enterprise",
|
|
@@ -399,13 +409,13 @@ def select_checks(
|
|
| 399 |
)
|
| 400 |
)
|
| 401 |
|
| 402 |
-
if flags["graph_artifact_changed"]:
|
| 403 |
checks.append(
|
| 404 |
Check("hydrate graph LFS", (python, __file__, "--internal-hydrate-graph-lfs"))
|
| 405 |
)
|
| 406 |
checks.append(Check("graph artifact validation", (python, *GRAPH_VALIDATE_ARGS)))
|
| 407 |
|
| 408 |
-
if source_required and flags["similarity_changed"]:
|
| 409 |
checks.append(
|
| 410 |
Check(
|
| 411 |
"similarity precision/recall",
|
|
@@ -423,7 +433,7 @@ def select_checks(
|
|
| 423 |
)
|
| 424 |
)
|
| 425 |
|
| 426 |
-
if source_required and flags["browser_changed"]:
|
| 427 |
checks.append(
|
| 428 |
Check(
|
| 429 |
"browser monitor security",
|
|
@@ -440,7 +450,7 @@ def select_checks(
|
|
| 440 |
)
|
| 441 |
)
|
| 442 |
|
| 443 |
-
if source_required:
|
| 444 |
out_dir = ".ci-preflight-dist"
|
| 445 |
twine_script = (
|
| 446 |
"import glob, subprocess, sys; "
|
|
@@ -467,6 +477,8 @@ def select_checks(
|
|
| 467 |
notes.insert(0, f"Changed files vs {base_ref}: {len(files)}")
|
| 468 |
else:
|
| 469 |
notes.insert(0, "No changed files detected; running baseline cheap checks only.")
|
|
|
|
|
|
|
| 470 |
|
| 471 |
return checks, notes
|
| 472 |
|
|
@@ -524,9 +536,12 @@ def main(argv: list[str] | None = None) -> int:
|
|
| 524 |
)
|
| 525 |
parser.add_argument(
|
| 526 |
"--profile",
|
| 527 |
-
choices=
|
| 528 |
default="pr",
|
| 529 |
-
help=
|
|
|
|
|
|
|
|
|
|
| 530 |
)
|
| 531 |
parser.add_argument(
|
| 532 |
"--python",
|
|
|
|
| 30 |
"src/tests/test_dashboard_user_story_tracker.py",
|
| 31 |
"src/tests/test_toolbox_cli.py",
|
| 32 |
)
|
| 33 |
+
PROFILE_CHOICES = ("smoke", "pr", "full")
|
| 34 |
|
| 35 |
|
| 36 |
GRAPH_VALIDATE_ARGS = (
|
|
|
|
| 299 |
"same contracts on this host."
|
| 300 |
]
|
| 301 |
|
| 302 |
+
smoke_profile = profile == "smoke"
|
| 303 |
source_required = profile == "full" or (not flags["docs_only"] and not flags["graph_only"])
|
| 304 |
policy_required = not flags["docs_only"] and not flags["graph_only"]
|
| 305 |
if policy_required:
|
|
|
|
| 318 |
(python, "-m", "ruff", "format", "--check", "src", "hooks", "scripts"),
|
| 319 |
),
|
| 320 |
Check("ruff", (python, "-m", "ruff", "check", "src", "hooks", "scripts")),
|
| 321 |
+
]
|
| 322 |
+
)
|
| 323 |
+
if not smoke_profile:
|
| 324 |
+
checks.extend(
|
| 325 |
+
[
|
| 326 |
+
Check("mypy", (python, "-m", "mypy", "src")),
|
| 327 |
+
Check("pip check", (python, "-m", "pip", "check")),
|
| 328 |
+
Check(
|
| 329 |
+
"unit-linux equivalent",
|
| 330 |
+
(
|
| 331 |
+
python,
|
| 332 |
+
"-m",
|
| 333 |
+
"pytest",
|
| 334 |
+
"-q",
|
| 335 |
+
"-m",
|
| 336 |
+
"not browser and not integration",
|
| 337 |
+
"--cov=src",
|
| 338 |
+
"--cov-report=term-missing",
|
| 339 |
+
"--cov-fail-under=40",
|
| 340 |
+
"-n",
|
| 341 |
+
"auto",
|
| 342 |
+
"--dist=loadfile",
|
| 343 |
+
"--max-worker-restart=0",
|
| 344 |
+
),
|
| 345 |
),
|
| 346 |
+
Check(
|
| 347 |
+
"A-Z canary",
|
| 348 |
+
(
|
| 349 |
+
python,
|
| 350 |
+
"-m",
|
| 351 |
+
"pytest",
|
| 352 |
+
"-q",
|
| 353 |
+
"--no-cov",
|
| 354 |
+
"src/tests/test_alive_loop_e2e.py",
|
| 355 |
+
"src/tests/test_fuzz_yaml_rendering.py",
|
| 356 |
+
),
|
| 357 |
),
|
| 358 |
+
Check(
|
| 359 |
+
"contract compatibility local",
|
| 360 |
+
(
|
| 361 |
+
python,
|
| 362 |
+
"-m",
|
| 363 |
+
"pytest",
|
| 364 |
+
"-q",
|
| 365 |
+
"--no-cov",
|
| 366 |
+
"src/tests/test_clean_host_contract.py",
|
| 367 |
+
"src/tests/test_package_scaffold.py",
|
| 368 |
+
),
|
| 369 |
),
|
| 370 |
+
Check(
|
| 371 |
+
"clean host contract",
|
| 372 |
+
(python, "scripts/clean_host_contract.py", "--fast"),
|
| 373 |
+
),
|
| 374 |
+
]
|
| 375 |
+
)
|
|
|
|
| 376 |
|
| 377 |
if flags["docs_changed"]:
|
| 378 |
+
checks.append(
|
| 379 |
+
Check(
|
| 380 |
+
"public docs tracker",
|
| 381 |
+
(
|
| 382 |
+
python,
|
| 383 |
+
"-m",
|
| 384 |
+
"pytest",
|
| 385 |
+
"-q",
|
| 386 |
+
"--no-cov",
|
| 387 |
+
*PUBLIC_DOCS_TRACKER_TESTS,
|
|
|
|
|
|
|
| 388 |
),
|
| 389 |
+
)
|
|
|
|
| 390 |
)
|
| 391 |
+
if not smoke_profile:
|
| 392 |
+
checks.append(Check("docs strict build", (python, "-m", "mkdocs", "build", "--strict")))
|
| 393 |
|
| 394 |
+
if not smoke_profile and (profile == "full" or flags["telemetry_changed"]):
|
| 395 |
checks.append(
|
| 396 |
Check(
|
| 397 |
"telemetry enterprise",
|
|
|
|
| 409 |
)
|
| 410 |
)
|
| 411 |
|
| 412 |
+
if not smoke_profile and flags["graph_artifact_changed"]:
|
| 413 |
checks.append(
|
| 414 |
Check("hydrate graph LFS", (python, __file__, "--internal-hydrate-graph-lfs"))
|
| 415 |
)
|
| 416 |
checks.append(Check("graph artifact validation", (python, *GRAPH_VALIDATE_ARGS)))
|
| 417 |
|
| 418 |
+
if not smoke_profile and source_required and flags["similarity_changed"]:
|
| 419 |
checks.append(
|
| 420 |
Check(
|
| 421 |
"similarity precision/recall",
|
|
|
|
| 433 |
)
|
| 434 |
)
|
| 435 |
|
| 436 |
+
if not smoke_profile and source_required and flags["browser_changed"]:
|
| 437 |
checks.append(
|
| 438 |
Check(
|
| 439 |
"browser monitor security",
|
|
|
|
| 450 |
)
|
| 451 |
)
|
| 452 |
|
| 453 |
+
if not smoke_profile and source_required:
|
| 454 |
out_dir = ".ci-preflight-dist"
|
| 455 |
twine_script = (
|
| 456 |
"import glob, subprocess, sys; "
|
|
|
|
| 477 |
notes.insert(0, f"Changed files vs {base_ref}: {len(files)}")
|
| 478 |
else:
|
| 479 |
notes.insert(0, "No changed files detected; running baseline cheap checks only.")
|
| 480 |
+
if smoke_profile:
|
| 481 |
+
notes.append("Smoke profile skips slow PR gates; run --profile pr before no-mistakes/PR.")
|
| 482 |
|
| 483 |
return checks, notes
|
| 484 |
|
|
|
|
| 536 |
)
|
| 537 |
parser.add_argument(
|
| 538 |
"--profile",
|
| 539 |
+
choices=PROFILE_CHOICES,
|
| 540 |
default="pr",
|
| 541 |
+
help=(
|
| 542 |
+
"smoke runs cheap first-pass checks; pr mirrors required PR checks; "
|
| 543 |
+
"full forces source gates for any change set"
|
| 544 |
+
),
|
| 545 |
)
|
| 546 |
parser.add_argument(
|
| 547 |
"--python",
|
scripts/local_fast_gate.py
CHANGED
|
@@ -26,10 +26,25 @@ if str(REPO_ROOT) not in sys.path:
|
|
| 26 |
sys.path.insert(0, str(REPO_ROOT))
|
| 27 |
|
| 28 |
from scripts.ci_preflight import Check # noqa: E402
|
|
|
|
| 29 |
from scripts.ci_preflight import changed_files # noqa: E402
|
| 30 |
from scripts.ci_preflight import select_checks # noqa: E402
|
| 31 |
|
| 32 |
-
LANE_ORDER = (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
CHECK_LANES = {
|
| 34 |
"whitespace": "cheap",
|
| 35 |
"repo stats": "cheap",
|
|
@@ -39,16 +54,16 @@ CHECK_LANES = {
|
|
| 39 |
"mypy": "static",
|
| 40 |
"pip check": "static",
|
| 41 |
"unit-linux equivalent": "unit",
|
| 42 |
-
"A-Z canary": "
|
| 43 |
-
"contract compatibility local": "
|
| 44 |
-
"clean host contract": "
|
| 45 |
"public docs tracker": "docs",
|
| 46 |
"docs strict build": "docs",
|
| 47 |
"hydrate graph LFS": "graph",
|
| 48 |
"graph artifact validation": "graph",
|
| 49 |
-
"telemetry enterprise": "
|
| 50 |
-
"similarity precision/recall": "
|
| 51 |
-
"browser monitor security": "
|
| 52 |
"clean preflight dist": "package",
|
| 53 |
"build wheel": "package",
|
| 54 |
"twine check": "package",
|
|
@@ -283,7 +298,7 @@ def _default_jobs() -> int:
|
|
| 283 |
def main(argv: list[str] | None = None) -> int:
|
| 284 |
parser = argparse.ArgumentParser(description=__doc__)
|
| 285 |
parser.add_argument("--base", default="origin/main")
|
| 286 |
-
parser.add_argument("--profile", choices=
|
| 287 |
parser.add_argument("--python", default=sys.executable)
|
| 288 |
parser.add_argument("--jobs", type=int, default=_default_jobs())
|
| 289 |
parser.add_argument("--lane", action="append", choices=LANE_ORDER)
|
|
|
|
| 26 |
sys.path.insert(0, str(REPO_ROOT))
|
| 27 |
|
| 28 |
from scripts.ci_preflight import Check # noqa: E402
|
| 29 |
+
from scripts.ci_preflight import PROFILE_CHOICES # noqa: E402
|
| 30 |
from scripts.ci_preflight import changed_files # noqa: E402
|
| 31 |
from scripts.ci_preflight import select_checks # noqa: E402
|
| 32 |
|
| 33 |
+
LANE_ORDER = (
|
| 34 |
+
"cheap",
|
| 35 |
+
"static",
|
| 36 |
+
"unit",
|
| 37 |
+
"canary",
|
| 38 |
+
"contract",
|
| 39 |
+
"clean-host",
|
| 40 |
+
"docs",
|
| 41 |
+
"graph",
|
| 42 |
+
"telemetry",
|
| 43 |
+
"similarity",
|
| 44 |
+
"browser",
|
| 45 |
+
"package",
|
| 46 |
+
"misc",
|
| 47 |
+
)
|
| 48 |
CHECK_LANES = {
|
| 49 |
"whitespace": "cheap",
|
| 50 |
"repo stats": "cheap",
|
|
|
|
| 54 |
"mypy": "static",
|
| 55 |
"pip check": "static",
|
| 56 |
"unit-linux equivalent": "unit",
|
| 57 |
+
"A-Z canary": "canary",
|
| 58 |
+
"contract compatibility local": "contract",
|
| 59 |
+
"clean host contract": "clean-host",
|
| 60 |
"public docs tracker": "docs",
|
| 61 |
"docs strict build": "docs",
|
| 62 |
"hydrate graph LFS": "graph",
|
| 63 |
"graph artifact validation": "graph",
|
| 64 |
+
"telemetry enterprise": "telemetry",
|
| 65 |
+
"similarity precision/recall": "similarity",
|
| 66 |
+
"browser monitor security": "browser",
|
| 67 |
"clean preflight dist": "package",
|
| 68 |
"build wheel": "package",
|
| 69 |
"twine check": "package",
|
|
|
|
| 298 |
def main(argv: list[str] | None = None) -> int:
|
| 299 |
parser = argparse.ArgumentParser(description=__doc__)
|
| 300 |
parser.add_argument("--base", default="origin/main")
|
| 301 |
+
parser.add_argument("--profile", choices=PROFILE_CHOICES, default="pr")
|
| 302 |
parser.add_argument("--python", default=sys.executable)
|
| 303 |
parser.add_argument("--jobs", type=int, default=_default_jobs())
|
| 304 |
parser.add_argument("--lane", action="append", choices=LANE_ORDER)
|
scripts/no_mistakes_run.sh
CHANGED
|
@@ -69,10 +69,88 @@ export CTX_NO_MISTAKES_PYTHON_BIN_RESOLVED="${trusted_ctx_python_bin}"
|
|
| 69 |
export PYTHONDONTWRITEBYTECODE="${PYTHONDONTWRITEBYTECODE:-1}"
|
| 70 |
export PIP_DISABLE_PIP_VERSION_CHECK="${PIP_DISABLE_PIP_VERSION_CHECK:-1}"
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
case "${action}" in
|
| 73 |
fast)
|
| 74 |
exec python scripts/local_fast_gate.py --profile pr --summary-json .gate/local-fast.json "${@:2}"
|
| 75 |
;;
|
|
|
|
|
|
|
|
|
|
| 76 |
test)
|
| 77 |
exec python scripts/ci_preflight.py --profile pr
|
| 78 |
;;
|
|
@@ -85,7 +163,7 @@ case "${action}" in
|
|
| 85 |
exec python -m ruff format src hooks scripts
|
| 86 |
;;
|
| 87 |
*)
|
| 88 |
-
echo "Usage: scripts/no_mistakes_run.sh {fast|test|lint|format}" >&2
|
| 89 |
exit 64
|
| 90 |
;;
|
| 91 |
esac
|
|
|
|
| 69 |
export PYTHONDONTWRITEBYTECODE="${PYTHONDONTWRITEBYTECODE:-1}"
|
| 70 |
export PIP_DISABLE_PIP_VERSION_CHECK="${PIP_DISABLE_PIP_VERSION_CHECK:-1}"
|
| 71 |
|
| 72 |
+
run_gate() {
|
| 73 |
+
local intent=""
|
| 74 |
+
local intent_file=""
|
| 75 |
+
local no_mistakes_args=()
|
| 76 |
+
|
| 77 |
+
while [[ $# -gt 0 ]]; do
|
| 78 |
+
case "$1" in
|
| 79 |
+
--intent)
|
| 80 |
+
[[ $# -ge 2 ]] || {
|
| 81 |
+
echo "Missing value for --intent" >&2
|
| 82 |
+
exit 64
|
| 83 |
+
}
|
| 84 |
+
intent="$2"
|
| 85 |
+
shift 2
|
| 86 |
+
;;
|
| 87 |
+
--intent=*)
|
| 88 |
+
intent="${1#--intent=}"
|
| 89 |
+
shift
|
| 90 |
+
;;
|
| 91 |
+
--intent-file)
|
| 92 |
+
[[ $# -ge 2 ]] || {
|
| 93 |
+
echo "Missing value for --intent-file" >&2
|
| 94 |
+
exit 64
|
| 95 |
+
}
|
| 96 |
+
intent_file="$2"
|
| 97 |
+
shift 2
|
| 98 |
+
;;
|
| 99 |
+
--intent-file=*)
|
| 100 |
+
intent_file="${1#--intent-file=}"
|
| 101 |
+
shift
|
| 102 |
+
;;
|
| 103 |
+
--skip)
|
| 104 |
+
[[ $# -ge 2 ]] || {
|
| 105 |
+
echo "Missing value for --skip" >&2
|
| 106 |
+
exit 64
|
| 107 |
+
}
|
| 108 |
+
no_mistakes_args+=("--skip" "$2")
|
| 109 |
+
shift 2
|
| 110 |
+
;;
|
| 111 |
+
--skip=*|--yes|-y)
|
| 112 |
+
no_mistakes_args+=("$1")
|
| 113 |
+
shift
|
| 114 |
+
;;
|
| 115 |
+
*)
|
| 116 |
+
echo "Unsupported gate argument: $1" >&2
|
| 117 |
+
exit 64
|
| 118 |
+
;;
|
| 119 |
+
esac
|
| 120 |
+
done
|
| 121 |
+
|
| 122 |
+
if [[ -n "${intent}" && -n "${intent_file}" ]]; then
|
| 123 |
+
echo "Use either --intent or --intent-file, not both." >&2
|
| 124 |
+
exit 64
|
| 125 |
+
fi
|
| 126 |
+
if [[ -n "${intent_file}" ]]; then
|
| 127 |
+
[[ -f "${intent_file}" ]] || {
|
| 128 |
+
echo "Intent file not found: ${intent_file}" >&2
|
| 129 |
+
exit 64
|
| 130 |
+
}
|
| 131 |
+
intent="$(<"${intent_file}")"
|
| 132 |
+
fi
|
| 133 |
+
if [[ -z "${intent//[[:space:]]/}" ]]; then
|
| 134 |
+
echo "gate requires --intent or --intent-file with a narrow task statement." >&2
|
| 135 |
+
exit 64
|
| 136 |
+
fi
|
| 137 |
+
command -v no-mistakes >/dev/null 2>&1 || {
|
| 138 |
+
echo "no-mistakes is required for gate." >&2
|
| 139 |
+
exit 127
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
python scripts/local_fast_gate.py --profile smoke --summary-json .gate/local-fast-smoke.json
|
| 143 |
+
python scripts/local_fast_gate.py --profile pr --summary-json .gate/local-fast.json
|
| 144 |
+
exec no-mistakes axi run --intent "${intent}" "${no_mistakes_args[@]}"
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
case "${action}" in
|
| 148 |
fast)
|
| 149 |
exec python scripts/local_fast_gate.py --profile pr --summary-json .gate/local-fast.json "${@:2}"
|
| 150 |
;;
|
| 151 |
+
gate)
|
| 152 |
+
run_gate "${@:2}"
|
| 153 |
+
;;
|
| 154 |
test)
|
| 155 |
exec python scripts/ci_preflight.py --profile pr
|
| 156 |
;;
|
|
|
|
| 163 |
exec python -m ruff format src hooks scripts
|
| 164 |
;;
|
| 165 |
*)
|
| 166 |
+
echo "Usage: scripts/no_mistakes_run.sh {fast|gate|test|lint|format}" >&2
|
| 167 |
exit 64
|
| 168 |
;;
|
| 169 |
esac
|