preflight-scan 0.1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wellness Agents
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: preflight-scan
3
+ Version: 0.1.0
4
+ Summary: Is your vibe-coded project ready to ship? A zero-dependency architecture and cleanliness scanner.
5
+ Author: preflight
6
+ License: MIT
7
+ Keywords: code-quality,vibe-coding,static-analysis,cleanup,refactoring
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Quality Assurance
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Dynamic: license-file
18
+
19
+ # Preflight
20
+
21
+ **Is your vibe-coded project ready to ship?**
22
+
23
+ You built something with AI — it works on your machine, and now you want it to
24
+ be a real product. `preflight` reads your codebase the way a senior engineer
25
+ skims it on day one and tells you, concretely, what stands between "it runs"
26
+ and "it ships": dead code, copy-paste forks, hardcoded keys, missing licenses
27
+ and tests, leftover `final_v2.py` files, functions nobody can review.
28
+
29
+ - **Zero dependencies.** Pure Python stdlib. Nothing to break.
30
+ - **Zero LLM calls. Runs entirely offline.** Your code never leaves your machine.
31
+ - **Every finding comes with a concrete fix**, not just a complaint.
32
+ - **A ship-readiness score (0–100)** you can put in CI and watch improve.
33
+
34
+ ```
35
+ SHIP-READINESS SCORE: 21/100 — not ready to ship
36
+
37
+ [HIGH] 1 possible hardcoded secret(s)
38
+ config.py:1 — OpenAI/Anthropic-style key
39
+ fix -> Move secrets to environment variables NOW, rotate any real
40
+ key that was committed, and add the files to .gitignore.
41
+
42
+ [HIGH] 2 module(s) appear unreachable
43
+ fix -> Verify with your test suite, then delete them.
44
+
45
+ [HIGH] Version strings disagree across files
46
+ myapp/__init__.py = 1.0.0; setup.py = 1.2.0
47
+ fix -> Pick one source of truth (pyproject.toml).
48
+ ```
49
+
50
+ ## One-click (no terminal)
51
+
52
+ Download this repo, open the `launchers/` folder, and double-click:
53
+
54
+ - **Mac:** `Check My Code (Mac).command` — first run may need right-click → Open
55
+ - **Windows:** `Check My Code (Windows).bat`
56
+
57
+ It installs itself the first time, asks you to drag your project folder in,
58
+ and writes `preflight_report.md` next to your project with everything it
59
+ found and how to fix each one. That's it.
60
+
61
+ ## 30 seconds in a terminal
62
+
63
+ ```bash
64
+ pip install preflight-scan
65
+ preflight demo # builds a deliberately messy project and scans it
66
+ preflight path/to/your/project
67
+ ```
68
+
69
+ The terminal shows the summary; the full report (with file lists and fixes)
70
+ is written to `preflight_report.md` in the scanned folder.
71
+
72
+ ## One line in CI
73
+
74
+ ```bash
75
+ preflight . --fail-under 75 # exit nonzero if the score drops below 75
76
+ ```
77
+
78
+ ## What it checks
79
+
80
+ | Check | What it catches |
81
+ |---|---|
82
+ | Dead modules | Files no code path can reach (verified by import graph) |
83
+ | Hardcoded secrets | OpenAI/Anthropic/AWS/GitHub/Slack/Google keys, private key blocks |
84
+ | Copy-paste forks | Substantial duplicated blocks across files; byte-identical files |
85
+ | Dependency hygiene | Imports you never declared; no manifest at all |
86
+ | Version truth | Version strings that disagree (or are duplicated) across files |
87
+ | Error-handling slop | Bare `except:`; `except Exception: pass` silent failures |
88
+ | Circular imports | Module-level import cycles (lazy in-function imports excluded — that's the fix, not the bug) |
89
+ | Oversized units | 700+ line files, 80+ line functions, deeply nested control flow |
90
+ | Leftover working files | `final_v2.py`, `untitled3.py`, `.DS_Store`, `*.pyc`, editor swap files |
91
+ | Ship essentials | Missing README, LICENSE, .gitignore, tests, CI |
92
+ | Broken files | Python that doesn't even parse |
93
+ | TODO debt | Heavy TODO/FIXME/HACK density |
94
+
95
+ False-positive suppression for known-fake fixtures: append `# preflight:ignore`
96
+ to the line.
97
+
98
+ ## Honesty notes (read before trusting the score)
99
+
100
+ - These are **static heuristics**, deliberately conservative. A finding is a
101
+ prompt for human judgment, not a verdict; the absence of findings is not a
102
+ security audit or a code review.
103
+ - Python gets the deepest analysis (AST-based). JavaScript/TypeScript gets
104
+ duplication, secrets, junk, size, and debug-residue checks — not import
105
+ graphs.
106
+ - preflight flags its own test suite's fake keys when scanned. A scanner that
107
+ special-cased itself would be lying; use `# preflight:ignore` like everyone
108
+ else (we do).
109
+ - Dogfooded for real: preflight's first run against a 17,500-line production
110
+ package found 3 dead modules, an undeclared-extras parser gap (in itself —
111
+ fixed), and a core scoring function duplicated across two entry points that
112
+ had already begun to drift. All fixed; that package went 62 → 90/100.
113
+
114
+ ## License
115
+
116
+ MIT.
@@ -0,0 +1,98 @@
1
+ # Preflight
2
+
3
+ **Is your vibe-coded project ready to ship?**
4
+
5
+ You built something with AI — it works on your machine, and now you want it to
6
+ be a real product. `preflight` reads your codebase the way a senior engineer
7
+ skims it on day one and tells you, concretely, what stands between "it runs"
8
+ and "it ships": dead code, copy-paste forks, hardcoded keys, missing licenses
9
+ and tests, leftover `final_v2.py` files, functions nobody can review.
10
+
11
+ - **Zero dependencies.** Pure Python stdlib. Nothing to break.
12
+ - **Zero LLM calls. Runs entirely offline.** Your code never leaves your machine.
13
+ - **Every finding comes with a concrete fix**, not just a complaint.
14
+ - **A ship-readiness score (0–100)** you can put in CI and watch improve.
15
+
16
+ ```
17
+ SHIP-READINESS SCORE: 21/100 — not ready to ship
18
+
19
+ [HIGH] 1 possible hardcoded secret(s)
20
+ config.py:1 — OpenAI/Anthropic-style key
21
+ fix -> Move secrets to environment variables NOW, rotate any real
22
+ key that was committed, and add the files to .gitignore.
23
+
24
+ [HIGH] 2 module(s) appear unreachable
25
+ fix -> Verify with your test suite, then delete them.
26
+
27
+ [HIGH] Version strings disagree across files
28
+ myapp/__init__.py = 1.0.0; setup.py = 1.2.0
29
+ fix -> Pick one source of truth (pyproject.toml).
30
+ ```
31
+
32
+ ## One-click (no terminal)
33
+
34
+ Download this repo, open the `launchers/` folder, and double-click:
35
+
36
+ - **Mac:** `Check My Code (Mac).command` — first run may need right-click → Open
37
+ - **Windows:** `Check My Code (Windows).bat`
38
+
39
+ It installs itself the first time, asks you to drag your project folder in,
40
+ and writes `preflight_report.md` next to your project with everything it
41
+ found and how to fix each one. That's it.
42
+
43
+ ## 30 seconds in a terminal
44
+
45
+ ```bash
46
+ pip install preflight-scan
47
+ preflight demo # builds a deliberately messy project and scans it
48
+ preflight path/to/your/project
49
+ ```
50
+
51
+ The terminal shows the summary; the full report (with file lists and fixes)
52
+ is written to `preflight_report.md` in the scanned folder.
53
+
54
+ ## One line in CI
55
+
56
+ ```bash
57
+ preflight . --fail-under 75 # exit nonzero if the score drops below 75
58
+ ```
59
+
60
+ ## What it checks
61
+
62
+ | Check | What it catches |
63
+ |---|---|
64
+ | Dead modules | Files no code path can reach (verified by import graph) |
65
+ | Hardcoded secrets | OpenAI/Anthropic/AWS/GitHub/Slack/Google keys, private key blocks |
66
+ | Copy-paste forks | Substantial duplicated blocks across files; byte-identical files |
67
+ | Dependency hygiene | Imports you never declared; no manifest at all |
68
+ | Version truth | Version strings that disagree (or are duplicated) across files |
69
+ | Error-handling slop | Bare `except:`; `except Exception: pass` silent failures |
70
+ | Circular imports | Module-level import cycles (lazy in-function imports excluded — that's the fix, not the bug) |
71
+ | Oversized units | 700+ line files, 80+ line functions, deeply nested control flow |
72
+ | Leftover working files | `final_v2.py`, `untitled3.py`, `.DS_Store`, `*.pyc`, editor swap files |
73
+ | Ship essentials | Missing README, LICENSE, .gitignore, tests, CI |
74
+ | Broken files | Python that doesn't even parse |
75
+ | TODO debt | Heavy TODO/FIXME/HACK density |
76
+
77
+ False-positive suppression for known-fake fixtures: append `# preflight:ignore`
78
+ to the line.
79
+
80
+ ## Honesty notes (read before trusting the score)
81
+
82
+ - These are **static heuristics**, deliberately conservative. A finding is a
83
+ prompt for human judgment, not a verdict; the absence of findings is not a
84
+ security audit or a code review.
85
+ - Python gets the deepest analysis (AST-based). JavaScript/TypeScript gets
86
+ duplication, secrets, junk, size, and debug-residue checks — not import
87
+ graphs.
88
+ - preflight flags its own test suite's fake keys when scanned. A scanner that
89
+ special-cased itself would be lying; use `# preflight:ignore` like everyone
90
+ else (we do).
91
+ - Dogfooded for real: preflight's first run against a 17,500-line production
92
+ package found 3 dead modules, an undeclared-extras parser gap (in itself —
93
+ fixed), and a core scoring function duplicated across two entry points that
94
+ had already begun to drift. All fixed; that package went 62 → 90/100.
95
+
96
+ ## License
97
+
98
+ MIT.
@@ -0,0 +1,13 @@
1
+ """preflight — is your vibe-coded project ready to ship?
2
+
3
+ A zero-dependency static scanner that reads a codebase the way a senior
4
+ engineer skims it on day one: where's the dead weight, what's duplicated,
5
+ what's going to break in production, and what's missing before this can be
6
+ deployed as a real product.
7
+
8
+ Runs entirely offline. No LLM calls. Nothing leaves your machine.
9
+ """
10
+ __version__ = "0.1.0"
11
+
12
+ from .checks import scan_project, Finding, ScanResult # noqa: F401
13
+ from .report import render_markdown, render_terminal # noqa: F401
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())