codex-workspace-bootstrap 0.7.0__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {codex_workspace_bootstrap-0.7.0/src/codex_workspace_bootstrap.egg-info → codex_workspace_bootstrap-0.9.0}/PKG-INFO +56 -5
  2. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/README.md +55 -4
  3. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/pyproject.toml +1 -1
  4. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/__init__.py +1 -1
  5. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/audit.py +8 -6
  6. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/cli.py +19 -9
  7. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/instructions.py +335 -26
  8. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/__init__.py +1 -0
  9. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github.py +79 -0
  10. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_actions_worker.py +266 -0
  11. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_app.py +30 -0
  12. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_app_service.py +94 -0
  13. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_checkout.py +274 -0
  14. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_cloud_run.py +821 -0
  15. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_delivery.py +220 -0
  16. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_manifest.py +204 -0
  17. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_runtime.py +332 -0
  18. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap/integrations/github_webhook.py +136 -0
  19. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/preflight.py +70 -4
  20. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap.egg-info}/PKG-INFO +56 -5
  21. codex_workspace_bootstrap-0.9.0/src/codex_workspace_bootstrap.egg-info/SOURCES.txt +47 -0
  22. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_audit.py +24 -0
  23. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_cli.py +32 -1
  24. codex_workspace_bootstrap-0.9.0/tests/test_github_actions_worker.py +208 -0
  25. codex_workspace_bootstrap-0.9.0/tests/test_github_app_registration.py +34 -0
  26. codex_workspace_bootstrap-0.9.0/tests/test_github_app_service.py +144 -0
  27. codex_workspace_bootstrap-0.9.0/tests/test_github_checkout.py +217 -0
  28. codex_workspace_bootstrap-0.9.0/tests/test_github_cloud_run.py +297 -0
  29. codex_workspace_bootstrap-0.9.0/tests/test_github_delivery.py +266 -0
  30. codex_workspace_bootstrap-0.9.0/tests/test_github_integration.py +94 -0
  31. codex_workspace_bootstrap-0.9.0/tests/test_github_manifest.py +161 -0
  32. codex_workspace_bootstrap-0.9.0/tests/test_github_runtime.py +570 -0
  33. codex_workspace_bootstrap-0.9.0/tests/test_github_webhook.py +160 -0
  34. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_instruction_integrity.py +510 -0
  35. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_preflight.py +132 -0
  36. codex_workspace_bootstrap-0.9.0/tests/test_public_repo_patterns.py +344 -0
  37. codex_workspace_bootstrap-0.7.0/src/codex_workspace_bootstrap.egg-info/SOURCES.txt +0 -26
  38. codex_workspace_bootstrap-0.7.0/tests/test_public_repo_patterns.py +0 -96
  39. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/LICENSE +0 -0
  40. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/setup.cfg +0 -0
  41. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/__main__.py +0 -0
  42. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/agents.py +0 -0
  43. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/doctor.py +0 -0
  44. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/fixes.py +0 -0
  45. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap/sarif.py +0 -0
  46. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap.egg-info/dependency_links.txt +0 -0
  47. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap.egg-info/entry_points.txt +0 -0
  48. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/src/codex_workspace_bootstrap.egg-info/top_level.txt +0 -0
  49. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_doctor.py +0 -0
  50. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_release_consistency.py +0 -0
  51. {codex_workspace_bootstrap-0.7.0 → codex_workspace_bootstrap-0.9.0}/tests/test_sarif.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-workspace-bootstrap
3
- Version: 0.7.0
3
+ Version: 0.9.0
4
4
  Summary: Preflight AI coding repositories before Codex, Copilot, Cline, Claude, Gemini, Continue, or Cursor touches them.
5
5
  Author: kohli217
6
6
  License: MIT
@@ -40,10 +40,23 @@ Dynamic: license-file
40
40
 
41
41
  Windows-first. Local by default. CI-friendly. Designed for repositories used with Codex, Copilot, Cline, Claude Code, Gemini CLI, Continue, Cursor, and similar coding agents.
42
42
 
43
- [日本語ガイド](docs/README.ja.md) · [Examples](docs/EXAMPLES.md) · [GitHub Action](docs/GITHUB_ACTION.md) · [Roadmap](docs/ROADMAP.md) · [Releases](https://github.com/kohli217/codex-workspace-bootstrap/releases)
43
+ [日本語ガイド](docs/README.ja.md) · [Examples](docs/EXAMPLES.md) · [GitHub Action](docs/GITHUB_ACTION.md) · [GitHub App](docs/GITHUB_APP.md) · [Free GitHub App deployment](deploy/cloudflare/README.md) · [Cloud Run alternative](deploy/cloudrun/README.md) · [Integration contract](docs/INTEGRATIONS.md) · [Roadmap](docs/ROADMAP.md) · [Releases](https://github.com/kohli217/codex-workspace-bootstrap/releases)
44
44
 
45
45
  > Community-maintained project. Not an official OpenAI product and not affiliated with OpenAI.
46
46
 
47
+ ## Why add this to your repository?
48
+
49
+ AI coding agents can move fast, but they can also follow stale or conflicting repository instructions. `codex-workspace-bootstrap` adds one repeatable check before that happens.
50
+
51
+ | Common failure | What `cwb` does |
52
+ | --- | --- |
53
+ | One instruction says `npm`, another says `pnpm` | Flags the mismatch before an agent edits the repository. |
54
+ | An instruction tells the agent to run a test/lint script that does not exist | Reports the invalid command instead of letting the mistake reach the agent. |
55
+ | A risky file such as `.env.production` is Git-tracked | Surfaces it as a blocking risk signal without printing its contents. |
56
+ | The repository is still missing important readiness pieces | `cwb preflight . --require-ready` can fail CI until the repository reaches `READY`. |
57
+
58
+ It is local-first: the core preflight does not send repository contents to a remote AI service.
59
+
47
60
  ## The 20-second demo
48
61
 
49
62
  ```powershell
@@ -219,6 +232,14 @@ cwb preflight . --require-ready
219
232
 
220
233
  Use `--require-ready` when CI should reject both `NEEDS ATTENTION` and `BLOCKED`, including missing repository-wide AI instructions or essential repository markers.
221
234
 
235
+ For a remote service such as a GitHub App, skip host-machine tool availability checks while keeping repository evidence, Git tracking, risk filenames, and instruction integrity checks:
236
+
237
+ ```powershell
238
+ cwb preflight . --repository-only
239
+ ```
240
+
241
+ This prevents a remote scanner from reporting the scanner host's Node.js, package-manager, WSL, PowerShell, or Codex availability as if it belonged to the inspected repository.
242
+
222
243
  ### Detailed audit
223
244
 
224
245
  ```powershell
@@ -267,7 +288,7 @@ The reusable Action is published on GitHub Marketplace.
267
288
  - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
268
289
  with:
269
290
  python-version: "3.13"
270
- - uses: kohli217/codex-workspace-bootstrap@v0.7.0
291
+ - uses: kohli217/codex-workspace-bootstrap@v0.9.0
271
292
  with:
272
293
  path: .
273
294
  strict: "true"
@@ -281,6 +302,36 @@ See [docs/GITHUB_ACTION.md](docs/GITHUB_ACTION.md).
281
302
 
282
303
  Read-only evaluations against real public repositories are documented in [docs/PUBLIC_REPO_EVALUATIONS.md](docs/PUBLIC_REPO_EVALUATIONS.md). They are reproducible technical evaluations, not claims of third-party adoption.
283
304
 
305
+ ## GitHub App
306
+
307
+ **Public App:** [CWB Preflight](https://github.com/apps/cwb-preflight) · [Install](https://github.com/apps/cwb-preflight/installations/new)
308
+
309
+ For public OSS repositories, CWB can also run as a self-hosted GitHub App. A verified `push` or `pull_request` event triggers repository-only preflight against the exact event revision and publishes a **CWB Preflight** Check Run on that commit.
310
+
311
+ The verified zero-cost public-OSS deployment uses:
312
+
313
+ ```text
314
+ GitHub App
315
+ -> Cloudflare Worker + Queue (Free)
316
+ -> GitHub Actions in this public repository
317
+ -> short-lived repository-scoped installation token
318
+ -> CWB Preflight Check
319
+ ```
320
+
321
+ This path does not require a Google Cloud billing account. It is intentionally **public-repository-only**: private-repository events are rejected before they are queued into the public Actions worker.
322
+
323
+ The App keeps the minimum repository permissions documented by the project: Checks read/write, Contents read-only, and Pull requests read-only.
324
+
325
+ The current public App has been revalidated after promotion: the renamed `CWB Preflight` App produced a successful `READY` Check Run through the full Cloudflare → Queue → GitHub Actions → installation-token → exact-revision checkout path.
326
+
327
+ See [docs/GITHUB_APP.md](docs/GITHUB_APP.md) for the integration contract and [deploy/cloudflare/README.md](deploy/cloudflare/README.md) for the completely free deployment.
328
+
329
+ ## Integration boundary
330
+
331
+ The CLI, reusable GitHub Action, GitHub App, and future AI-agent skills share one preflight engine and one policy evaluator. Machine-readable reports declare a schema version so integrations can detect incompatible changes instead of silently drifting.
332
+
333
+ See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md). The minimum GitHub App permissions and webhook subscriptions are defined in [docs/GITHUB_APP.md](docs/GITHUB_APP.md) and mirrored by code-level regression tests.
334
+
284
335
  ## Where it fits
285
336
 
286
337
  This project is a **preflight layer**, not an AI coding agent and not a deep security scanner.
@@ -300,7 +351,7 @@ The intent is to complement those tools, not replace them.
300
351
  - Suspected secret files are not opened or printed by the filename-risk check.
301
352
  - Repository contents are not sent to a remote AI service by the core audit.
302
353
  - Instruction files are read locally for deterministic linting; extracted commands are never executed by the integrity lint.
303
- - Repository instruction/configuration and project-marker inputs are not trusted through symbolic links.
354
+ - Repository instruction/configuration and project-marker contents are not trusted through symbolic links. CWB may recognize the exact lexical aliases `CLAUDE.md -> AGENTS.md` and `GEMINI.md -> AGENTS.md` (or `./AGENTS.md`) only when the sibling `AGENTS.md` is a regular file; linting reads that regular file directly rather than following either link. Gemini aliases are recognized only when `GEMINI.md` is an effective Gemini context filename.
304
355
  - `init-agents` and automatic fixes refuse symlinked `AGENTS.md` targets rather than writing through them.
305
356
  - Existing regular `AGENTS.md` files are protected unless overwrite is explicit.
306
357
  - A passing preflight is evidence about the checks performed, **not a security guarantee**.
@@ -334,7 +385,7 @@ py -m pip install codex-workspace-bootstrap
334
385
  Pinned GitHub release artifact:
335
386
 
336
387
  ```powershell
337
- py -m pip install "https://github.com/kohli217/codex-workspace-bootstrap/releases/download/v0.7.0/codex_workspace_bootstrap-0.7.0-py3-none-any.whl"
388
+ py -m pip install "https://github.com/kohli217/codex-workspace-bootstrap/releases/download/v0.9.0/codex_workspace_bootstrap-0.9.0-py3-none-any.whl"
338
389
  ```
339
390
 
340
391
  ## Development
@@ -12,10 +12,23 @@
12
12
 
13
13
  Windows-first. Local by default. CI-friendly. Designed for repositories used with Codex, Copilot, Cline, Claude Code, Gemini CLI, Continue, Cursor, and similar coding agents.
14
14
 
15
- [日本語ガイド](docs/README.ja.md) · [Examples](docs/EXAMPLES.md) · [GitHub Action](docs/GITHUB_ACTION.md) · [Roadmap](docs/ROADMAP.md) · [Releases](https://github.com/kohli217/codex-workspace-bootstrap/releases)
15
+ [日本語ガイド](docs/README.ja.md) · [Examples](docs/EXAMPLES.md) · [GitHub Action](docs/GITHUB_ACTION.md) · [GitHub App](docs/GITHUB_APP.md) · [Free GitHub App deployment](deploy/cloudflare/README.md) · [Cloud Run alternative](deploy/cloudrun/README.md) · [Integration contract](docs/INTEGRATIONS.md) · [Roadmap](docs/ROADMAP.md) · [Releases](https://github.com/kohli217/codex-workspace-bootstrap/releases)
16
16
 
17
17
  > Community-maintained project. Not an official OpenAI product and not affiliated with OpenAI.
18
18
 
19
+ ## Why add this to your repository?
20
+
21
+ AI coding agents can move fast, but they can also follow stale or conflicting repository instructions. `codex-workspace-bootstrap` adds one repeatable check before that happens.
22
+
23
+ | Common failure | What `cwb` does |
24
+ | --- | --- |
25
+ | One instruction says `npm`, another says `pnpm` | Flags the mismatch before an agent edits the repository. |
26
+ | An instruction tells the agent to run a test/lint script that does not exist | Reports the invalid command instead of letting the mistake reach the agent. |
27
+ | A risky file such as `.env.production` is Git-tracked | Surfaces it as a blocking risk signal without printing its contents. |
28
+ | The repository is still missing important readiness pieces | `cwb preflight . --require-ready` can fail CI until the repository reaches `READY`. |
29
+
30
+ It is local-first: the core preflight does not send repository contents to a remote AI service.
31
+
19
32
  ## The 20-second demo
20
33
 
21
34
  ```powershell
@@ -191,6 +204,14 @@ cwb preflight . --require-ready
191
204
 
192
205
  Use `--require-ready` when CI should reject both `NEEDS ATTENTION` and `BLOCKED`, including missing repository-wide AI instructions or essential repository markers.
193
206
 
207
+ For a remote service such as a GitHub App, skip host-machine tool availability checks while keeping repository evidence, Git tracking, risk filenames, and instruction integrity checks:
208
+
209
+ ```powershell
210
+ cwb preflight . --repository-only
211
+ ```
212
+
213
+ This prevents a remote scanner from reporting the scanner host's Node.js, package-manager, WSL, PowerShell, or Codex availability as if it belonged to the inspected repository.
214
+
194
215
  ### Detailed audit
195
216
 
196
217
  ```powershell
@@ -239,7 +260,7 @@ The reusable Action is published on GitHub Marketplace.
239
260
  - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
240
261
  with:
241
262
  python-version: "3.13"
242
- - uses: kohli217/codex-workspace-bootstrap@v0.7.0
263
+ - uses: kohli217/codex-workspace-bootstrap@v0.9.0
243
264
  with:
244
265
  path: .
245
266
  strict: "true"
@@ -253,6 +274,36 @@ See [docs/GITHUB_ACTION.md](docs/GITHUB_ACTION.md).
253
274
 
254
275
  Read-only evaluations against real public repositories are documented in [docs/PUBLIC_REPO_EVALUATIONS.md](docs/PUBLIC_REPO_EVALUATIONS.md). They are reproducible technical evaluations, not claims of third-party adoption.
255
276
 
277
+ ## GitHub App
278
+
279
+ **Public App:** [CWB Preflight](https://github.com/apps/cwb-preflight) · [Install](https://github.com/apps/cwb-preflight/installations/new)
280
+
281
+ For public OSS repositories, CWB can also run as a self-hosted GitHub App. A verified `push` or `pull_request` event triggers repository-only preflight against the exact event revision and publishes a **CWB Preflight** Check Run on that commit.
282
+
283
+ The verified zero-cost public-OSS deployment uses:
284
+
285
+ ```text
286
+ GitHub App
287
+ -> Cloudflare Worker + Queue (Free)
288
+ -> GitHub Actions in this public repository
289
+ -> short-lived repository-scoped installation token
290
+ -> CWB Preflight Check
291
+ ```
292
+
293
+ This path does not require a Google Cloud billing account. It is intentionally **public-repository-only**: private-repository events are rejected before they are queued into the public Actions worker.
294
+
295
+ The App keeps the minimum repository permissions documented by the project: Checks read/write, Contents read-only, and Pull requests read-only.
296
+
297
+ The current public App has been revalidated after promotion: the renamed `CWB Preflight` App produced a successful `READY` Check Run through the full Cloudflare → Queue → GitHub Actions → installation-token → exact-revision checkout path.
298
+
299
+ See [docs/GITHUB_APP.md](docs/GITHUB_APP.md) for the integration contract and [deploy/cloudflare/README.md](deploy/cloudflare/README.md) for the completely free deployment.
300
+
301
+ ## Integration boundary
302
+
303
+ The CLI, reusable GitHub Action, GitHub App, and future AI-agent skills share one preflight engine and one policy evaluator. Machine-readable reports declare a schema version so integrations can detect incompatible changes instead of silently drifting.
304
+
305
+ See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md). The minimum GitHub App permissions and webhook subscriptions are defined in [docs/GITHUB_APP.md](docs/GITHUB_APP.md) and mirrored by code-level regression tests.
306
+
256
307
  ## Where it fits
257
308
 
258
309
  This project is a **preflight layer**, not an AI coding agent and not a deep security scanner.
@@ -272,7 +323,7 @@ The intent is to complement those tools, not replace them.
272
323
  - Suspected secret files are not opened or printed by the filename-risk check.
273
324
  - Repository contents are not sent to a remote AI service by the core audit.
274
325
  - Instruction files are read locally for deterministic linting; extracted commands are never executed by the integrity lint.
275
- - Repository instruction/configuration and project-marker inputs are not trusted through symbolic links.
326
+ - Repository instruction/configuration and project-marker contents are not trusted through symbolic links. CWB may recognize the exact lexical aliases `CLAUDE.md -> AGENTS.md` and `GEMINI.md -> AGENTS.md` (or `./AGENTS.md`) only when the sibling `AGENTS.md` is a regular file; linting reads that regular file directly rather than following either link. Gemini aliases are recognized only when `GEMINI.md` is an effective Gemini context filename.
276
327
  - `init-agents` and automatic fixes refuse symlinked `AGENTS.md` targets rather than writing through them.
277
328
  - Existing regular `AGENTS.md` files are protected unless overwrite is explicit.
278
329
  - A passing preflight is evidence about the checks performed, **not a security guarantee**.
@@ -306,7 +357,7 @@ py -m pip install codex-workspace-bootstrap
306
357
  Pinned GitHub release artifact:
307
358
 
308
359
  ```powershell
309
- py -m pip install "https://github.com/kohli217/codex-workspace-bootstrap/releases/download/v0.7.0/codex_workspace_bootstrap-0.7.0-py3-none-any.whl"
360
+ py -m pip install "https://github.com/kohli217/codex-workspace-bootstrap/releases/download/v0.9.0/codex_workspace_bootstrap-0.9.0-py3-none-any.whl"
310
361
  ```
311
362
 
312
363
  ## Development
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codex-workspace-bootstrap"
7
- version = "0.7.0"
7
+ version = "0.9.0"
8
8
  description = "Preflight AI coding repositories before Codex, Copilot, Cline, Claude, Gemini, Continue, or Cursor touches them."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """codex-workspace-bootstrap package."""
2
2
 
3
- __version__ = "0.7.0"
3
+ __version__ = "0.9.0"
@@ -194,7 +194,7 @@ def _preview(paths: list[str], limit: int = 8) -> str:
194
194
  return f"{visible}{suffix}"
195
195
 
196
196
 
197
- def audit_repository(root: Path) -> list[Check]:
197
+ def audit_repository(root: Path, *, include_local_toolchain: bool = True) -> list[Check]:
198
198
  root = root.resolve()
199
199
  checks: list[Check] = []
200
200
 
@@ -285,8 +285,9 @@ def audit_repository(root: Path) -> list[Check]:
285
285
  )
286
286
  )
287
287
 
288
- for label, command in COMMON_TOOLS:
289
- checks.append(_tool_check(label, command))
288
+ if include_local_toolchain:
289
+ for label, command in COMMON_TOOLS:
290
+ checks.append(_tool_check(label, command))
290
291
 
291
292
  if (root / "package.json").is_file() and not (root / "package.json").is_symlink():
292
293
  managers = detect_node_package_managers(root)
@@ -300,9 +301,10 @@ def audit_repository(root: Path) -> list[Check]:
300
301
  + ", ".join(sorted(managers)),
301
302
  )
302
303
  )
303
- for manager in sorted(managers):
304
- command = NODE_PACKAGE_MANAGER_COMMANDS[manager]
305
- checks.append(_tool_check(manager, command))
304
+ if include_local_toolchain:
305
+ for manager in sorted(managers):
306
+ command = NODE_PACKAGE_MANAGER_COMMANDS[manager]
307
+ checks.append(_tool_check(manager, command))
306
308
  else:
307
309
  checks.append(
308
310
  Check(
@@ -10,7 +10,7 @@ from .agents import generate_agents
10
10
  from .audit import audit_repository, summary
11
11
  from .doctor import doctor_findings
12
12
  from .fixes import apply_fix_plan, build_fix_plan
13
- from .preflight import build_preflight, render_markdown
13
+ from .preflight import build_preflight, evaluate_preflight_policy, render_markdown
14
14
  from .sarif import checks_to_sarif, preflight_report_to_sarif
15
15
 
16
16
 
@@ -46,6 +46,11 @@ def _parser() -> argparse.ArgumentParser:
46
46
  action="store_true",
47
47
  help="Return a non-zero exit code unless the preflight state is READY",
48
48
  )
49
+ preflight.add_argument(
50
+ "--repository-only",
51
+ action="store_true",
52
+ help="Skip local toolchain availability checks and evaluate repository evidence only",
53
+ )
49
54
 
50
55
  fix = sub.add_parser("fix", help="Preview safe repository-readiness fixes")
51
56
  fix.add_argument("path", nargs="?", default=".")
@@ -91,13 +96,17 @@ def _run_preflight(
91
96
  strict: bool,
92
97
  fail_on_integrity: bool,
93
98
  require_ready: bool,
99
+ repository_only: bool,
94
100
  ) -> int:
95
101
  root = Path(path).expanduser().resolve()
96
102
  if not root.exists() or not root.is_dir():
97
103
  print(f"error: repository path does not exist or is not a directory: {root}", file=sys.stderr)
98
104
  return 2
99
105
 
100
- report = build_preflight(root)
106
+ report = build_preflight(
107
+ root,
108
+ include_local_toolchain=not repository_only,
109
+ )
101
110
 
102
111
  print("AI Repository Preflight")
103
112
  print(f"Repository: {root}")
@@ -163,13 +172,13 @@ def _run_preflight(
163
172
  "Preflight SARIF report",
164
173
  )
165
174
 
166
- if strict and report["state"] == "BLOCKED":
167
- return 1
168
- if fail_on_integrity and report["instruction_summary"]["findings"]:
169
- return 1
170
- if require_ready and report["state"] != "READY":
171
- return 1
172
- return 0
175
+ decision = evaluate_preflight_policy(
176
+ report,
177
+ strict=strict,
178
+ fail_on_integrity=fail_on_integrity,
179
+ require_ready=require_ready,
180
+ )
181
+ return 0 if decision.passed else 1
173
182
 
174
183
 
175
184
  def _run_fix(path: str, apply: bool) -> int:
@@ -301,6 +310,7 @@ def main(argv: list[str] | None = None) -> int:
301
310
  args.strict,
302
311
  args.fail_on_integrity,
303
312
  args.require_ready,
313
+ args.repository_only,
304
314
  )
305
315
  if args.command == "fix":
306
316
  return _run_fix(args.path, args.apply)