|
| 1 | +;;; ROADMAP.scm — sanctify-php Development Roadmap |
| 2 | +;; SPDX-License-Identifier: AGPL-3.0-or-later |
| 3 | +;; SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell |
| 4 | +;; |
| 5 | +;; This roadmap outlines the development phases for sanctify-php. |
| 6 | +;; Updated: 2025-12-17 |
| 7 | + |
| 8 | +(define-module (sanctify-php roadmap) |
| 9 | + #:export (roadmap current-milestone next-steps)) |
| 10 | + |
| 11 | +;;; ============================================================================ |
| 12 | +;;; PHASE 1: Foundation (v0.1.x) — Current Phase |
| 13 | +;;; ============================================================================ |
| 14 | + |
| 15 | +(define phase-1 |
| 16 | + '((name . "Foundation") |
| 17 | + (version . "0.1.x") |
| 18 | + (status . "in-progress") |
| 19 | + (completion . 30) |
| 20 | + (milestones |
| 21 | + (;; COMPLETED |
| 22 | + (milestone "RSR Compliance" |
| 23 | + (status . complete) |
| 24 | + (items |
| 25 | + ("SPDX headers on all files" . done) |
| 26 | + ("SHA-pinned GitHub Actions" . done) |
| 27 | + ("Security workflows configured" . done) |
| 28 | + ("Guix SCM files" . done) |
| 29 | + ("Dual licensing (MIT/AGPL)" . done))) |
| 30 | + |
| 31 | + (milestone "CI/CD Security" |
| 32 | + (status . complete) |
| 33 | + (items |
| 34 | + ("CodeQL analysis" . done) |
| 35 | + ("PHP security scanning" . done) |
| 36 | + ("Secret detection (TruffleHog)" . done) |
| 37 | + ("OpenSSF Scorecard" . done) |
| 38 | + ("Haskell extensions in security checks" . done) |
| 39 | + ("Upgraded to GHC 9.6" . done))) |
| 40 | + |
| 41 | + ;; IN PROGRESS |
| 42 | + (milestone "PHP Parser" |
| 43 | + (status . pending) |
| 44 | + (priority . high) |
| 45 | + (items |
| 46 | + ("Megaparsec-based lexer" . pending) |
| 47 | + ("PHP 7.4+ syntax support" . pending) |
| 48 | + ("PHP 8.x syntax support" . pending) |
| 49 | + ("AST representation" . pending) |
| 50 | + ("Source location tracking" . pending) |
| 51 | + ("Error recovery" . pending))) |
| 52 | + |
| 53 | + (milestone "Test Infrastructure" |
| 54 | + (status . pending) |
| 55 | + (priority . medium) |
| 56 | + (items |
| 57 | + ("HSpec test suite setup" . pending) |
| 58 | + ("Parser unit tests" . pending) |
| 59 | + ("Golden tests with PHP fixtures" . pending) |
| 60 | + ("Property-based tests (QuickCheck)" . pending) |
| 61 | + ("CI test coverage reporting" . pending))))))) |
| 62 | + |
| 63 | +;;; ============================================================================ |
| 64 | +;;; PHASE 2: Core Analysis (v0.2.x) |
| 65 | +;;; ============================================================================ |
| 66 | + |
| 67 | +(define phase-2 |
| 68 | + '((name . "Core Analysis") |
| 69 | + (version . "0.2.x") |
| 70 | + (status . "planned") |
| 71 | + (milestones |
| 72 | + ((milestone "Security Analysis Engine" |
| 73 | + (priority . critical) |
| 74 | + (items |
| 75 | + ("SQL injection detection" . planned) |
| 76 | + ("XSS vulnerability detection" . planned) |
| 77 | + ("CSRF pattern identification" . planned) |
| 78 | + ("Command injection detection" . planned) |
| 79 | + ("Path traversal detection" . planned) |
| 80 | + ("Unsafe deserialization detection" . planned))) |
| 81 | + |
| 82 | + (milestone "Taint Tracking" |
| 83 | + (priority . high) |
| 84 | + (items |
| 85 | + ("Source identification ($_GET, $_POST, etc.)" . planned) |
| 86 | + ("Sink identification (echo, query, etc.)" . planned) |
| 87 | + ("Data flow analysis" . planned) |
| 88 | + ("Sanitizer recognition" . planned) |
| 89 | + ("Cross-function taint propagation" . planned))) |
| 90 | + |
| 91 | + (milestone "Type Inference" |
| 92 | + (priority . medium) |
| 93 | + (items |
| 94 | + ("Return type inference" . planned) |
| 95 | + ("Parameter type inference" . planned) |
| 96 | + ("Property type inference" . planned) |
| 97 | + ("PHPDoc annotation parsing" . planned) |
| 98 | + ("Type hint suggestions" . planned))))))) |
| 99 | + |
| 100 | +;;; ============================================================================ |
| 101 | +;;; PHASE 3: Transformations (v0.3.x) |
| 102 | +;;; ============================================================================ |
| 103 | + |
| 104 | +(define phase-3 |
| 105 | + '((name . "Transformations") |
| 106 | + (version . "0.3.x") |
| 107 | + (status . "planned") |
| 108 | + (milestones |
| 109 | + ((milestone "Strict Types Transformation" |
| 110 | + (priority . high) |
| 111 | + (risk . "zero") |
| 112 | + (items |
| 113 | + ("Add declare(strict_types=1)" . planned) |
| 114 | + ("Preserve existing declarations" . planned) |
| 115 | + ("Handle multiple files" . planned))) |
| 116 | + |
| 117 | + (milestone "Type Hint Addition" |
| 118 | + (priority . high) |
| 119 | + (risk . "low-review-required") |
| 120 | + (items |
| 121 | + ("Add inferred parameter types" . planned) |
| 122 | + ("Add inferred return types" . planned) |
| 123 | + ("Generate PHPStan annotations" . planned) |
| 124 | + ("Preserve formatting" . planned))) |
| 125 | + |
| 126 | + (milestone "Sanitization Transforms" |
| 127 | + (priority . critical) |
| 128 | + (risk . "medium-review-required") |
| 129 | + (items |
| 130 | + ("Auto-escape echo statements" . planned) |
| 131 | + ("wpdb::query to prepare conversion" . planned) |
| 132 | + ("Superglobal sanitization" . planned) |
| 133 | + ("rand() to random_int() upgrade" . planned) |
| 134 | + ("Nonce verification insertion" . planned))) |
| 135 | + |
| 136 | + (milestone "Code Emission" |
| 137 | + (priority . high) |
| 138 | + (items |
| 139 | + ("Pretty-print transformed AST" . planned) |
| 140 | + ("Preserve comments" . planned) |
| 141 | + ("Maintain original formatting where possible" . planned) |
| 142 | + ("Diff-friendly output" . planned))))))) |
| 143 | + |
| 144 | +;;; ============================================================================ |
| 145 | +;;; PHASE 4: WordPress Support (v0.4.x) |
| 146 | +;;; ============================================================================ |
| 147 | + |
| 148 | +(define phase-4 |
| 149 | + '((name . "WordPress Support") |
| 150 | + (version . "0.4.x") |
| 151 | + (status . "planned") |
| 152 | + (milestones |
| 153 | + ((milestone "WordPress Constraints" |
| 154 | + (priority . high) |
| 155 | + (items |
| 156 | + ("ABSPATH check enforcement" . planned) |
| 157 | + ("Capability escalation detection" . planned) |
| 158 | + ("Direct database access warnings" . planned) |
| 159 | + ("Proper escaping function usage" . planned) |
| 160 | + ("Text domain consistency" . planned))) |
| 161 | + |
| 162 | + (milestone "WordPress Hooks Analysis" |
| 163 | + (priority . medium) |
| 164 | + (items |
| 165 | + ("Action hook analysis" . planned) |
| 166 | + ("Filter hook analysis" . planned) |
| 167 | + ("Priority conflict detection" . planned) |
| 168 | + ("Deprecated hook warnings" . planned))) |
| 169 | + |
| 170 | + (milestone "WordPress Security Patterns" |
| 171 | + (priority . critical) |
| 172 | + (items |
| 173 | + ("Admin-ajax.php security" . planned) |
| 174 | + ("REST API endpoint security" . planned) |
| 175 | + ("File upload handling" . planned) |
| 176 | + ("Options API security" . planned) |
| 177 | + ("User meta security" . planned))))))) |
| 178 | + |
| 179 | +;;; ============================================================================ |
| 180 | +;;; PHASE 5: Reporting & Integration (v0.5.x) |
| 181 | +;;; ============================================================================ |
| 182 | + |
| 183 | +(define phase-5 |
| 184 | + '((name . "Reporting & Integration") |
| 185 | + (version . "0.5.x") |
| 186 | + (status . "planned") |
| 187 | + (milestones |
| 188 | + ((milestone "Report Generation" |
| 189 | + (priority . high) |
| 190 | + (items |
| 191 | + ("JSON report format" . planned) |
| 192 | + ("SARIF format for IDE integration" . planned) |
| 193 | + ("HTML report with navigation" . planned) |
| 194 | + ("Markdown summary" . planned) |
| 195 | + ("Severity classification" . planned))) |
| 196 | + |
| 197 | + (milestone "Infrastructure Export" |
| 198 | + (priority . medium) |
| 199 | + (items |
| 200 | + ("php.ini recommendations export" . planned) |
| 201 | + ("nginx security rules export" . planned) |
| 202 | + ("Guix container overrides export" . planned) |
| 203 | + ("Docker security configs" . planned))) |
| 204 | + |
| 205 | + (milestone "IDE Integration" |
| 206 | + (priority . medium) |
| 207 | + (items |
| 208 | + ("VSCode extension" . planned) |
| 209 | + ("Language Server Protocol (LSP)" . planned) |
| 210 | + ("Real-time analysis" . planned) |
| 211 | + ("Quick-fix suggestions" . planned))))))) |
| 212 | + |
| 213 | +;;; ============================================================================ |
| 214 | +;;; PHASE 6: Production Ready (v1.0.0) |
| 215 | +;;; ============================================================================ |
| 216 | + |
| 217 | +(define phase-6 |
| 218 | + '((name . "Production Ready") |
| 219 | + (version . "1.0.0") |
| 220 | + (status . "planned") |
| 221 | + (milestones |
| 222 | + ((milestone "Performance Optimization" |
| 223 | + (items |
| 224 | + ("Parallel file processing" . planned) |
| 225 | + ("Incremental analysis" . planned) |
| 226 | + ("Memory optimization" . planned) |
| 227 | + ("Large codebase support" . planned))) |
| 228 | + |
| 229 | + (milestone "Documentation" |
| 230 | + (items |
| 231 | + ("User guide" . planned) |
| 232 | + ("API documentation" . planned) |
| 233 | + ("Integration examples" . planned) |
| 234 | + ("WordPress plugin guidelines" . planned))) |
| 235 | + |
| 236 | + (milestone "Release" |
| 237 | + (items |
| 238 | + ("Binary releases (Linux/macOS/Windows)" . planned) |
| 239 | + ("Guix package submission" . planned) |
| 240 | + ("Homebrew formula" . planned) |
| 241 | + ("Docker image" . planned))))))) |
| 242 | + |
| 243 | +;;; ============================================================================ |
| 244 | +;;; Summary & Export |
| 245 | +;;; ============================================================================ |
| 246 | + |
| 247 | +(define roadmap |
| 248 | + (list phase-1 phase-2 phase-3 phase-4 phase-5 phase-6)) |
| 249 | + |
| 250 | +(define current-milestone |
| 251 | + '((phase . 1) |
| 252 | + (name . "Foundation") |
| 253 | + (next-task . "Implement PHP parser with Megaparsec") |
| 254 | + (blockers . ()))) |
| 255 | + |
| 256 | +(define next-steps |
| 257 | + '(("Implement PHP lexer" . immediate) |
| 258 | + ("Add parser tests" . immediate) |
| 259 | + ("Implement AST pretty-printer" . this-week) |
| 260 | + ("Add strict_types transformation" . this-week) |
| 261 | + ("Implement basic SQL injection detection" . next-sprint))) |
0 commit comments