R007-program_upgradability.plan.cspec
1 # R007-program_upgradability.plan.cspec 2 # Implementation plan for Program Upgradability - Registry + Editions 3 4 plan_metadata: 5 component_id: R007 6 component_ref: components/runtime/R007-program_upgradability.component.cspec 7 plan_version: 1.0.0 8 plan_status: complete # phases 1-5 complete, phase 6 optional 9 created: 2026-01-15 10 updated: 2026-01-15 11 completed: 2026-01-15 12 13 wave_context: 14 topological_level: 2 15 is_root: false 16 upstream_components: [R001, A007, D008] 17 downstream_components: [] 18 critical_path: true 19 cascade_group: runtime 20 21 phases: 22 - phase_id: phase_1 23 name: "Registry Program - Alpha Chain" 24 status: complete 25 blocked_by: [] 26 27 tasks: 28 - task_id: R007-T001 29 name: "Create registry.alpha program" 30 description: "Implement registry program with resolve/register/update functions and governance checks" 31 target_files: 32 - path: alphavm/synthesizer/program/src/resources/registry.alpha 33 action: create 34 estimate: 35 effort: medium 36 confidence: high 37 38 - task_id: R007-T002 39 name: "Add governance attestation verification" 40 description: "Implement cryptographic verification of governance approval attestations" 41 target_files: 42 - path: alphavm/synthesizer/program/src/resources/registry.alpha 43 action: modify 44 estimate: 45 effort: medium 46 confidence: medium 47 48 - task_id: R007-T003 49 name: "Include registry.alpha in genesis" 50 description: "Add registry.alpha to genesis block generation" 51 target_files: 52 - path: alphavm/ledger/src/helpers/genesis.rs 53 action: modify 54 estimate: 55 effort: small 56 confidence: high 57 58 deliverables: 59 - deliverable_id: R007-D001 60 name: "Alpha registry program" 61 type: code 62 verification: "Registry resolve/register/update work with governance" 63 64 test_requirements: 65 unit: 66 - test_id: R007-UT001 67 description: "resolve returns (program_id, edition) for registered name" 68 - test_id: R007-UT002 69 description: "register fails without governance attestation" 70 - test_id: R007-UT003 71 description: "register succeeds with valid governance attestation" 72 73 - phase_id: phase_2 74 name: "Registry Program - Delta Chain" 75 status: complete 76 blocked_by: 77 - dependency_ref: R007.phase_1 78 reason: "Pattern established on Alpha first" 79 wait_for: complete 80 81 tasks: 82 - task_id: R007-T004 83 name: "Create registry.delta program" 84 description: "Port registry program to Delta chain" 85 target_files: 86 - path: deltavm/synthesizer/program/src/resources/registry.delta 87 action: create 88 estimate: 89 effort: small 90 confidence: high 91 92 - task_id: R007-T005 93 name: "Include registry.delta in genesis" 94 description: "Add registry.delta to genesis block generation" 95 target_files: 96 - path: deltavm/ledger/src/helpers/genesis.rs 97 action: modify 98 estimate: 99 effort: small 100 confidence: high 101 102 deliverables: 103 - deliverable_id: R007-D002 104 name: "Delta registry program" 105 type: code 106 verification: "Registry works identically on Delta chain" 107 108 test_requirements: 109 unit: 110 - test_id: R007-UT004 111 description: "resolve works on Delta" 112 - test_id: R007-UT005 113 description: "register/update require governance on Delta" 114 115 - phase_id: phase_3 116 name: "Edition Governance Integration" 117 status: complete 118 blocked_by: [] 119 120 tasks: 121 - task_id: R007-T006 122 name: "Add DeployProgram action to governance.alpha" 123 description: "Add governance action type for program deployments" 124 target_files: 125 - path: alphavm/synthesizer/program/src/resources/governance.alpha 126 action: modify 127 estimate: 128 effort: medium 129 confidence: high 130 131 - task_id: R007-T007 132 name: "Add DeployProgram action to governance.delta" 133 description: "Add governance action type for program deployments" 134 target_files: 135 - path: deltavm/synthesizer/program/src/resources/governance.delta 136 action: modify 137 estimate: 138 effort: medium 139 confidence: high 140 141 - task_id: R007-T008 142 name: "Wire deploy to check governance attestation - Alpha" 143 description: "Modify Process::deploy to require governance attestation for all deployments" 144 target_files: 145 - path: alphavm/synthesizer/process/src/stack/deploy.rs 146 action: modify 147 estimate: 148 effort: medium 149 confidence: medium 150 risk: 151 level: medium 152 factors: [consensus_change] 153 154 - task_id: R007-T009 155 name: "Wire deploy to check governance attestation - Delta" 156 description: "Modify Process::deploy to require governance attestation for all deployments" 157 target_files: 158 - path: deltavm/synthesizer/process/src/stack/deploy.rs 159 action: modify 160 estimate: 161 effort: medium 162 confidence: medium 163 risk: 164 level: medium 165 factors: [consensus_change] 166 167 deliverables: 168 - deliverable_id: R007-D003 169 name: "Governance-gated deployments" 170 type: code 171 verification: "All program deployments require 67% governance approval" 172 173 test_requirements: 174 unit: 175 - test_id: R007-UT006 176 description: "deployment without attestation fails at consensus" 177 - test_id: R007-UT007 178 description: "deployment with valid attestation succeeds" 179 - test_id: R007-UT008 180 description: "attestation forgery detected and rejected" 181 182 - phase_id: phase_4 183 name: "Consensus Validation" 184 status: complete 185 blocked_by: 186 - dependency_ref: R007.phase_3 187 wait_for: complete 188 189 tasks: 190 - task_id: R007-T010 191 name: "Add attestation verification to verify_deployment - Alpha" 192 description: "Ensure consensus validates governance attestation before accepting deployment" 193 target_files: 194 - path: alphavm/synthesizer/process/src/verify_deployment.rs 195 action: modify 196 estimate: 197 effort: medium 198 confidence: high 199 200 - task_id: R007-T011 201 name: "Add attestation verification to verify_deployment - Delta" 202 description: "Ensure consensus validates governance attestation before accepting deployment" 203 target_files: 204 - path: deltavm/synthesizer/process/src/verify_deployment.rs 205 action: modify 206 estimate: 207 effort: medium 208 confidence: high 209 210 deliverables: 211 - deliverable_id: R007-D004 212 name: "Consensus-level governance enforcement" 213 type: code 214 verification: "Network rejects deployments without valid attestations" 215 216 test_requirements: 217 integration: 218 - test_id: R007-IT001 219 description: "Multi-node consensus rejects unauthorized deployments" 220 - test_id: R007-IT002 221 description: "Multi-node consensus accepts governance-approved deployments" 222 223 - phase_id: phase_5 224 name: "Update TODOs and Documentation" 225 status: complete 226 blocked_by: [] 227 228 tasks: 229 - task_id: R007-T012 230 name: "Update ACDC-FUTURE TODO in deployment storage - Alpha" 231 description: "Replace TODO with implementation reference" 232 target_files: 233 - path: alphavm/ledger/store/src/transaction/deployment.rs 234 action: modify 235 estimate: 236 effort: small 237 confidence: high 238 239 - task_id: R007-T013 240 name: "Update ACDC-FUTURE TODO in deployment storage - Delta" 241 description: "Replace TODO with implementation reference" 242 target_files: 243 - path: deltavm/ledger/store/src/transaction/deployment.rs 244 action: modify 245 estimate: 246 effort: small 247 confidence: high 248 249 deliverables: 250 - deliverable_id: R007-D005 251 name: "Updated implementation notes" 252 type: docs 253 verification: "No outstanding ACDC-FUTURE TODOs for upgradability" 254 255 - phase_id: phase_6 256 name: "Integration Testing" 257 status: pending 258 blocked_by: 259 - dependency_ref: R007.phase_4 260 wait_for: complete 261 262 tasks: 263 - task_id: R007-T014 264 name: "End-to-end registry resolution tests" 265 description: "Test full flow: propose → approve → register → resolve" 266 target_files: 267 - path: alphavm/synthesizer/tests/registry_tests.rs 268 action: create 269 - path: deltavm/synthesizer/tests/registry_tests.rs 270 action: create 271 estimate: 272 effort: medium 273 confidence: high 274 275 - task_id: R007-T015 276 name: "End-to-end edition upgrade tests" 277 description: "Test full flow: propose → approve → deploy edition 1" 278 target_files: 279 - path: alphavm/synthesizer/tests/edition_governance_tests.rs 280 action: create 281 - path: deltavm/synthesizer/tests/edition_governance_tests.rs 282 action: create 283 estimate: 284 effort: medium 285 confidence: high 286 287 deliverables: 288 - deliverable_id: R007-D006 289 name: "Integration test suite" 290 type: tests 291 verification: "All governance-gated upgrade flows tested" 292 293 repository_targets: 294 primary_repo: 295 name: alphavm 296 branch_strategy: feature_branch 297 feature_branch_name: feat/R007-program-upgradability 298 299 secondary_repos: 300 - name: deltavm 301 branch_name: feat/R007-program-upgradability 302 303 complexity_assessment: 304 overall_complexity: high 305 rationale: "Touches consensus, governance, and genesis - requires careful coordination" 306 307 dependencies_summary: 308 blocks: [] 309 blocked_by: [R001, A007, D008] 310 parallel_candidates: [phase_1, phase_3, phase_5] 311 312 changelog: 313 - version: 1.0.0 314 date: 2026-01-15 315 type: initial 316 description: "Initial implementation plan for R007 program upgradability"