|
| 1 | +/** |
| 2 | + * SDLC-focused scenarios — validate that ADF modules stay updated and portable |
| 3 | + * as project guidance evolves from requirements through release. |
| 4 | + */ |
| 5 | + |
| 6 | +import type { Scenario } from '../types'; |
| 7 | + |
| 8 | +export const sdlcScenarios: Scenario[] = [ |
| 9 | + { |
| 10 | + id: 'fullstack-sdlc-handoff-portability', |
| 11 | + archetype: 'fullstack', |
| 12 | + description: 'Rules evolve across SDLC phases while remaining portable through ADF modules', |
| 13 | + manifest: { |
| 14 | + onDemand: [ |
| 15 | + { path: 'frontend.adf', triggers: ['react', 'component', 'ui', 'css', 'vite', 'tsx'] }, |
| 16 | + { path: 'backend.adf', triggers: ['api', 'endpoint', 'route', 'handler', 'database', 'auth', 'zod', 'request', 'response'] }, |
| 17 | + { path: 'infra.adf', triggers: ['deploy', 'release', 'rollback', 'ci', 'pipeline', 'docker', 'env', 'artifact'] }, |
| 18 | + { path: 'qa.adf', triggers: ['test', 'testing', 'playwright', 'contract', 'smoke', 'verification', 'evidence', 'auditability'] }, |
| 19 | + ], |
| 20 | + }, |
| 21 | + sessions: [ |
| 22 | + { |
| 23 | + label: 'session-1: requirements', |
| 24 | + inject: ` |
| 25 | +## API Requirements |
| 26 | +
|
| 27 | +- Every API endpoint must publish request and response schemas |
| 28 | +- Auth is required for all write endpoints |
| 29 | +- Route handlers must return structured error codes |
| 30 | +- Database migrations must be reviewed before merge |
| 31 | +`, |
| 32 | + expected: { 'backend.adf': 4 }, |
| 33 | + }, |
| 34 | + { |
| 35 | + label: 'session-2: design', |
| 36 | + inject: ` |
| 37 | +## System Design |
| 38 | +
|
| 39 | +- React UI components must map one-to-one to approved design tokens |
| 40 | +- API handlers must validate all payloads with Zod |
| 41 | +- Route naming must stay stable across versions |
| 42 | +- Frontend component props must be typed in TSX files |
| 43 | +`, |
| 44 | + expected: { 'frontend.adf': 2, 'backend.adf': 2 }, |
| 45 | + }, |
| 46 | + { |
| 47 | + label: 'session-3: implementation', |
| 48 | + inject: ` |
| 49 | +## Implementation Rules |
| 50 | +
|
| 51 | +- API route files live under \`app/api/\` and use one handler per endpoint |
| 52 | +- Database writes must run inside transactions |
| 53 | +- Auth checks execute before any handler business logic |
| 54 | +- Build artifacts are generated only in CI pipeline jobs |
| 55 | +`, |
| 56 | + expected: { 'backend.adf': 3, 'infra.adf': 1 }, |
| 57 | + }, |
| 58 | + { |
| 59 | + label: 'session-4: verification', |
| 60 | + inject: ` |
| 61 | +## Verification |
| 62 | +
|
| 63 | +- CI pipeline must run unit, integration, and Playwright suites on every PR |
| 64 | +- API contract tests validate request and response schema compatibility |
| 65 | +- Deploy preview environments must run smoke checks before approval |
| 66 | +- Test artifacts are uploaded from CI for auditability |
| 67 | +`, |
| 68 | + expected: { 'qa.adf': 4 }, |
| 69 | + }, |
| 70 | + { |
| 71 | + label: 'session-5: release and portability handoff', |
| 72 | + inject: ` |
| 73 | +## Release Handoff |
| 74 | +
|
| 75 | +- Deploy jobs must consume versioned artifacts from the pipeline only |
| 76 | +- Rollback instructions must be validated in staging before production release |
| 77 | +- Environment configuration uses env keys defined in the deployment checklist |
| 78 | +- Release evidence includes CI run ID, artifact hash, and deployment timestamp |
| 79 | +`, |
| 80 | + expected: { 'infra.adf': 4 }, |
| 81 | + }, |
| 82 | + ], |
| 83 | + }, |
| 84 | + { |
| 85 | + id: 'fullstack-sdlc-generic-checklist-routing', |
| 86 | + archetype: 'fullstack', |
| 87 | + description: 'Generic SDLC handoff headings still separate verification evidence from release operations', |
| 88 | + manifest: { |
| 89 | + onDemand: [ |
| 90 | + { path: 'frontend.adf', triggers: ['react', 'component', 'ui', 'css', 'vite', 'tsx'] }, |
| 91 | + { path: 'backend.adf', triggers: ['api', 'endpoint', 'route', 'handler', 'database', 'auth', 'zod', 'request', 'response'] }, |
| 92 | + { path: 'infra.adf', triggers: ['deploy', 'release', 'rollback', 'ci', 'pipeline', 'docker', 'env', 'artifact'] }, |
| 93 | + { path: 'qa.adf', triggers: ['test', 'testing', 'playwright', 'contract', 'smoke', 'verification', 'evidence', 'auditability'] }, |
| 94 | + ], |
| 95 | + }, |
| 96 | + sessions: [ |
| 97 | + { |
| 98 | + label: 'session-1: generic checklist handoff', |
| 99 | + inject: ` |
| 100 | +## Checklist |
| 101 | +
|
| 102 | +- Playwright smoke tests must pass before release approval |
| 103 | +- Contract test evidence is attached to the deployment record for auditability |
| 104 | +- Release artifact hashes are recorded before deploy starts |
| 105 | +- Rollback drills must use the staged deploy artifact from the pipeline |
| 106 | +`, |
| 107 | + expected: { 'qa.adf': 2, 'infra.adf': 2 }, |
| 108 | + }, |
| 109 | + ], |
| 110 | + }, |
| 111 | + { |
| 112 | + id: 'fullstack-sdlc-mixed-qa-backend-signals', |
| 113 | + archetype: 'fullstack', |
| 114 | + description: 'Mixed backend and QA wording in a generic checklist should still route by dominant verification vs API intent', |
| 115 | + manifest: { |
| 116 | + onDemand: [ |
| 117 | + { path: 'frontend.adf', triggers: ['react', 'component', 'ui', 'css', 'vite', 'tsx'] }, |
| 118 | + { path: 'backend.adf', triggers: ['api', 'endpoint', 'route', 'handler', 'database', 'auth', 'zod', 'request', 'response'] }, |
| 119 | + { path: 'infra.adf', triggers: ['deploy', 'release', 'rollback', 'ci', 'pipeline', 'docker', 'env', 'artifact'] }, |
| 120 | + { path: 'qa.adf', triggers: ['test', 'testing', 'playwright', 'contract', 'smoke', 'verification', 'evidence', 'auditability'] }, |
| 121 | + ], |
| 122 | + }, |
| 123 | + sessions: [ |
| 124 | + { |
| 125 | + label: 'session-1: mixed checklist bullets', |
| 126 | + inject: ` |
| 127 | +## Checklist |
| 128 | +
|
| 129 | +- API contract test evidence must be attached to the release review for auditability |
| 130 | +- Request and response schema contract tests must pass before merging backend changes |
| 131 | +- Endpoint smoke tests run in CI before deploy approval |
| 132 | +- API handler error responses are verified against contract fixtures |
| 133 | +`, |
| 134 | + expected: { 'qa.adf': 3, 'backend.adf': 1 }, |
| 135 | + }, |
| 136 | + ], |
| 137 | + }, |
| 138 | +]; |
0 commit comments