Skip to content

Refactor using AWS Ai Development software lifecycle

Latest

Choose a tag to compare

@defless defless released this 19 Jun 12:54
· 21 commits to main since this release
f59da04

Release Notes: AI-DLC Refactoring v2.0

This release documents the completion of the AI-Driven Development Lifecycle (AI-DLC) refactoring on the project.


πŸ“‹ AI-DLC Execution Summary

Phase Status
Inception βœ… Complete
Construction (Units 1–4) βœ… Complete
Operations βœ… Closed

Inception Phase

  • Workspace Detection
  • Reverse Engineering
  • Requirements Analysis
  • Workflow Planning
  • Units Generation

Construction Phase

Unit Scope Status
Unit 1 Core & Models βœ… Done
Unit 2 Middlewares βœ… Done
Unit 3 Controllers βœ… Done
Unit 4 Routes βœ… Done

πŸ› οΈ What's Changed

Unit 4: Routes (Primary Deliverable)

  • Renamed ressources.ts β†’ resources.ts and corrected all paths from /ressources to /resources
  • Deleted 4 legacy .js route files (auth.js, helpers.js, index.js, ressources.js)
  • Fixed auth.ts register schema: corrected username property to email
  • Added JSON Schema response validation for /resources/* endpoints
  • Added querystring + response schemas for /helpers/pkce and /helpers/callback
  • Updated tests to use /resources instead of deprecated /ressources

TypeScript Migration

  • Rewrote tsconfig.json with proper skipLibCheck, bun-types, allowImportingTsExtensions, and noEmit
  • Removed 3 stale .js files in src/core/ (env.js, types.js, utils.js)
  • Fixed server.ts error handler typing for strict TypeScript compliance
  • Improved tests/utils/request.ts return types

Linting Overhaul

  • Migrated from .eslintrc (legacy) to eslint.config.js (flat config)
  • Adopted @poool/eslint-config as the shared lint standard
  • Removed old dependencies: eslint-config-airbnb-base, @typescript-eslint/* v7
  • Added @eslint/js as an explicit peer dependency for CI stability
  • Resolved ESLint 9.x / @poool/eslint-config / typescript-eslint version matrix incompatibilities
  • Generated bun.lock for reproducible dependency installs

CI/CD Modernization

  • Migrated CI from Node.js/Yarn to Bun (oven-sh/setup-bun@v2)
  • Replaced matrix Node builds with a single Bun runner
  • Fixed dynamic port allocation (port: 0) in tests to avoid hardcoded 3000 conflicts
  • Fixed test request helper so GET no longer sends a body
  • Fixed package.json formatting (removed trailing comma that caused mongodb-memory-server JSON parse crash)

Security Hardening

  • Authorization middleware now explicitly validates the Bearer scheme instead of accepting any scheme (e.g. Basic)
  • generateAccessToken now reads PRIVATE_KEY dynamically from process.env at call time instead of caching it at module load β€” prevents silent failures when .env is missing

πŸ§ͺ Test Results

bun test v1.2.0

βœ“ /helpers > PKCE generation
βœ“ /auth > authenticate (password grant)
βœ“ /auth > authenticate (password grant) > unknown user
βœ“ /auth > authenticate (password grant) > invalid grant
βœ“ /auth > authenticate (refresh_token grant)
βœ“ /auth > authenticate (client_credentials grant)
βœ“ /resources > GET unrestricted
βœ“ /resources > GET restricted

8 pass Β· 0 fail Β· 19 assertions

⚠️ Breaking Changes

  • CI now requires Bun instead of Node.js + Yarn.