mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-01 19:25:10 +02:00
a4a181ca92
* feat: extend gstack-diff-scope with SCOPE_MIGRATIONS, SCOPE_API, SCOPE_AUTH
Three new scope signals for Review Army specialist activation:
- SCOPE_MIGRATIONS: db/migrate/, prisma/migrations/, alembic/, *.sql
- SCOPE_API: *controller*, *route*, *endpoint*, *.graphql, openapi.*
- SCOPE_AUTH: *auth*, *session*, *jwt*, *oauth*, *permission*, *role*
* feat: add 7 specialist checklist files for Review Army
- testing.md (always-on): coverage gaps, flaky patterns, security enforcement
- maintainability.md (always-on): dead code, DRY, stale comments
- security.md (conditional): OWASP deep analysis, auth bypass, injection
- performance.md (conditional): N+1 queries, bundle impact, complexity
- data-migration.md (conditional): reversibility, lock duration, backfill
- api-contract.md (conditional): breaking changes, versioning, error format
- red-team.md (conditional): adversarial analysis, cross-cutting concerns
All use standard header with JSON output schema and NO FINDINGS fallback.
* feat: Review Army resolver — parallel specialist dispatch + merge
New resolver in review-army.ts generates template prose for:
- Stack detection and specialist selection
- Parallel Agent tool dispatch with learning-informed prompts
- JSON finding collection, fingerprint dedup, consensus highlighting
- PR quality score computation
- Red Team conditional dispatch
Registered as REVIEW_ARMY in resolvers/index.ts.
* refactor: restructure /review template for Review Army
- Replace Steps 4-4.75 with CRITICAL pass + {{REVIEW_ARMY}}
- Remove {{DESIGN_REVIEW_LITE}} and {{TEST_COVERAGE_AUDIT_REVIEW}}
(subsumed into Design and Testing specialists respectively)
- Extract specialist-covered categories from checklist.md
- Keep CRITICAL + uncovered INFORMATIONAL in main agent pass
* test: Review Army — 14 diff-scope tests + 7 E2E tests
- test/diff-scope.test.ts: 14 tests for all 9 scope signals
- test/skill-e2e-review-army.test.ts: 7 E2E tests
Gate: migration safety, N+1 detection, delivery audit,
quality score, JSON findings
Periodic: red team, consensus
- Updated gen-skill-docs tests for new review structure
- Added touchfile entries and tier classifications
* docs: update SELF_LEARNING_V0.md with Release 2 status + Release 2.5
Mark Release 2 (Review Army) as in-progress. Add Release 2.5 for
deferred expansions (E1 adaptive gating, E3 test stubs, E5 cross-review
dedup, E7 specialist tracking).
* chore: bump version and changelog (v0.14.3.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
2.2 KiB
Markdown
48 lines
2.2 KiB
Markdown
# Data Migration Specialist Review Checklist
|
|
|
|
Scope: When SCOPE_MIGRATIONS=true
|
|
Output: JSON objects, one finding per line. Schema:
|
|
{"severity":"CRITICAL|INFORMATIONAL","confidence":N,"path":"file","line":N,"category":"data-migration","summary":"...","fix":"...","fingerprint":"path:line:data-migration","specialist":"data-migration"}
|
|
If no findings: output `NO FINDINGS` and nothing else.
|
|
|
|
---
|
|
|
|
## Categories
|
|
|
|
### Reversibility
|
|
- Can this migration be rolled back without data loss?
|
|
- Is there a corresponding down/rollback migration?
|
|
- Does the rollback actually undo the change or just no-op?
|
|
- Would rolling back break the current application code?
|
|
|
|
### Data Loss Risk
|
|
- Dropping columns that still contain data (add deprecation period first)
|
|
- Changing column types that truncate data (varchar(255) → varchar(50))
|
|
- Removing tables without verifying no code references them
|
|
- Renaming columns without updating all references (ORM, raw SQL, views)
|
|
- NOT NULL constraints added to columns with existing NULL values (needs backfill first)
|
|
|
|
### Lock Duration
|
|
- ALTER TABLE on large tables without CONCURRENTLY (PostgreSQL)
|
|
- Adding indexes without CONCURRENTLY on tables with >100K rows
|
|
- Multiple ALTER TABLE statements that could be combined into one lock acquisition
|
|
- Schema changes that acquire exclusive locks during peak traffic hours
|
|
|
|
### Backfill Strategy
|
|
- New NOT NULL columns without DEFAULT value (requires backfill before constraint)
|
|
- New columns with computed defaults that need batch population
|
|
- Missing backfill script or rake task for existing records
|
|
- Backfill that updates all rows at once instead of batching (locks table)
|
|
|
|
### Index Creation
|
|
- CREATE INDEX without CONCURRENTLY on production tables
|
|
- Duplicate indexes (new index covers same columns as existing one)
|
|
- Missing indexes on new foreign key columns
|
|
- Partial indexes where a full index would be more useful (or vice versa)
|
|
|
|
### Multi-Phase Safety
|
|
- Migrations that must be deployed in a specific order with application code
|
|
- Schema changes that break the current running code (deploy code first, then migrate)
|
|
- Migrations that assume a deploy boundary (old code + new schema = crash)
|
|
- Missing feature flag to handle mixed old/new code during rolling deploy
|