@@ -313,3 +313,176 @@ allowed_transformations = ["删除 owner 外键与 index", "重置为初始 migr
313313removed_references = [" owner_id、users.id ForeignKey、ix_items_owner_id、legacy down_revision" ]
314314approved_deviation = [" 保留 revision 0021_create_items 身份且 down_revision=None" ]
315315verification = [" test_item_crud_switch_controls_the_complete_generated_slice" , " test_both_orms_pass_real_postgresql_contract" ]
316+
317+ # Issue #9 Redis consumers 与 Taskiq 独立 profile。
318+
319+ [[target ]]
320+ profile = " redis_consumers"
321+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/pyproject.toml"
322+ target = " pyproject.toml"
323+ allowed_transformations = [" Copier 模板语法" , " 仅保留 Redis、cache 与 rate limit 依赖" , " 依赖版本兼容修改" ]
324+ removed_references = [" V1 排除能力依赖" ]
325+ approved_deviation = [" Logfire 关闭时不生成 instrumentation extras" ]
326+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
327+
328+ [[target ]]
329+ profile = " redis_consumers"
330+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/.env.example"
331+ target = " .env.example"
332+ allowed_transformations = [" Copier 模板语法" , " 仅保留启用 consumer 的环境变量" ]
333+ removed_references = [" V1 排除能力与 Taskiq 变量" ]
334+ approved_deviation = [" RATE_LIMIT_STORAGE 显式记录 redis" ]
335+ verification = [" test_issue_9_generation_boundaries" ]
336+
337+ [[target ]]
338+ profile = " redis_consumers"
339+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/main.py"
340+ target = " app/main.py"
341+ allowed_transformations = [" 删除 V1 排除生命周期" , " 保留 Redis、cache 与 limiter 生命周期" ]
342+ removed_references = [" 用户、RAG、消息渠道、admin 与其他 V1 排除能力" ]
343+ approved_deviation = [" FastAPICache shutdown 显式 reset" , " SlowAPI 使用 ASGI middleware 与统一异常 envelope" ]
344+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
345+
346+ [[target ]]
347+ profile = " redis_consumers"
348+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/config.py"
349+ target = " app/core/config.py"
350+ allowed_transformations = [" 删除 V1 排除 Settings" , " 保留 Redis 与 limiter Settings" ]
351+ removed_references = [" 身份、billing、文件、RAG 与 provider Settings" ]
352+ approved_deviation = [" RATE_LIMIT_STORAGE 作为显式 Settings" ]
353+ verification = [" test_issue_9_generation_boundaries" ]
354+
355+ [[target ]]
356+ profile = " redis_consumers"
357+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/clients/redis.py"
358+ target = " app/clients/redis.py"
359+ allowed_transformations = [" Copier 模板语法" , " 当前 redis asyncio close API" ]
360+ removed_references = [" 无" ]
361+ approved_deviation = [" raw client 保持 binary 供 FastAPICache 使用,get 执行 UTF-8 decode" ]
362+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
363+
364+ [[target ]]
365+ profile = " redis_consumers"
366+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/cache.py"
367+ target = " app/core/cache.py"
368+ allowed_transformations = [" Copier 模板语法" , " 增加 shutdown reset" ]
369+ removed_references = [" disabled no-op 分支" ]
370+ approved_deviation = [" 文件仅在启用 cache 时生成" ]
371+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
372+
373+ [[target ]]
374+ profile = " redis_consumers"
375+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/rate_limit.py"
376+ target = " app/core/rate_limit.py"
377+ allowed_transformations = [" Copier 模板语法" , " 增加 Redis storage URI" , " 保留 low/medium/high decorators" ]
378+ removed_references = [" disabled 空模块" ]
379+ approved_deviation = [" Redis rate limit 使用 settings.REDIS_URL 共享服务端状态" ]
380+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
381+
382+ [[target ]]
383+ profile = " redis_consumers"
384+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/api/deps.py"
385+ target = " app/api/deps.py"
386+ allowed_transformations = [" 删除 V1 排除 dependencies" , " deployment API Key 替换" , " 保留 Redis dependency" ]
387+ removed_references = [" 用户、JWT、teams 与排除 service dependencies" ]
388+ approved_deviation = [" Redis client 从 app lifespan state 注入" ]
389+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
390+
391+ [[target ]]
392+ profile = " redis_consumers"
393+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/api/routes/v1/health.py"
394+ target = " app/api/health.py"
395+ allowed_transformations = [" 根路径迁移" , " 删除排除资源 probes" , " 保留 Redis readiness" ]
396+ removed_references = [" RAG、provider、billing、Celery probes" ]
397+ approved_deviation = [" Redis probe 使用 dependency-injected RedisClient" ]
398+ verification = [" test_redis_consumers_pass_real_redis_contract" ]
399+
400+ [[target ]]
401+ profile = " rate_limit_memory"
402+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/pyproject.toml"
403+ target = " pyproject.toml"
404+ allowed_transformations = [" Copier 模板语法" , " 仅保留 SlowAPI 依赖" ]
405+ removed_references = [" V1 排除能力与 Redis 依赖" ]
406+ approved_deviation = [" 无" ]
407+ verification = [" test_memory_rate_limit_uses_no_redis" ]
408+
409+ [[target ]]
410+ profile = " rate_limit_memory"
411+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/.env.example"
412+ target = " .env.example"
413+ allowed_transformations = [" Copier 模板语法" , " 仅保留 limiter 环境变量" ]
414+ removed_references = [" V1 排除能力与 Redis 变量" ]
415+ approved_deviation = [" RATE_LIMIT_STORAGE 显式记录 memory" ]
416+ verification = [" test_memory_rate_limit_uses_no_redis" ]
417+
418+ [[target ]]
419+ profile = " rate_limit_memory"
420+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/config.py"
421+ target = " app/core/config.py"
422+ allowed_transformations = [" 删除 V1 排除 Settings" , " 保留 limiter Settings" ]
423+ removed_references = [" Redis 与其他未启用能力 Settings" ]
424+ approved_deviation = [" RATE_LIMIT_STORAGE 作为显式 Settings" ]
425+ verification = [" test_memory_rate_limit_uses_no_redis" ]
426+
427+ [[target ]]
428+ profile = " rate_limit_memory"
429+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/rate_limit.py"
430+ target = " app/core/rate_limit.py"
431+ allowed_transformations = [" Copier 模板语法" , " 显式 memory storage URI" , " 保留 low/medium/high decorators" ]
432+ removed_references = [" disabled 空模块" ]
433+ approved_deviation = [" memory:// 明确限制为 process-local storage" ]
434+ verification = [" test_memory_rate_limit_uses_no_redis" ]
435+
436+ [[target ]]
437+ profile = " rate_limit_memory"
438+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/main.py"
439+ target = " app/main.py"
440+ allowed_transformations = [" 删除 V1 排除生命周期" , " 保留 SlowAPI middleware" ]
441+ removed_references = [" Redis 与其他未启用资源生命周期" ]
442+ approved_deviation = [" 使用 SlowAPIASGIMiddleware 与统一异常 envelope" ]
443+ verification = [" test_memory_rate_limit_uses_no_redis" ]
444+
445+ [[target ]]
446+ profile = " taskiq"
447+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/pyproject.toml"
448+ target = " pyproject.toml"
449+ allowed_transformations = [" Copier 模板语法" , " 仅保留 Taskiq 与 taskiq-redis 依赖" , " 依赖版本兼容修改" ]
450+ removed_references = [" V1 排除 queue 与 API Redis client 依赖" ]
451+ approved_deviation = [" 无" ]
452+ verification = [" test_taskiq_process_commands_start_and_stop_against_real_redis" ]
453+
454+ [[target ]]
455+ profile = " taskiq"
456+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/.env.example"
457+ target = " .env.example"
458+ allowed_transformations = [" Copier 模板语法" , " 仅保留 Taskiq 环境变量" ]
459+ removed_references = [" V1 排除能力与 API Redis client 变量" ]
460+ approved_deviation = [" result backend 变量命名为 TASKIQ_RESULT_BACKEND_URL" ]
461+ verification = [" test_issue_9_generation_boundaries" ]
462+
463+ [[target ]]
464+ profile = " taskiq"
465+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/core/config.py"
466+ target = " app/core/config.py"
467+ allowed_transformations = [" 删除 V1 排除 Settings" , " 保留独立 Taskiq URLs" ]
468+ removed_references = [" API Redis client 与其他未启用能力 Settings" ]
469+ approved_deviation = [" result backend 变量命名为 TASKIQ_RESULT_BACKEND_URL" ]
470+ verification = [" test_issue_9_generation_boundaries" ]
471+
472+ [[target ]]
473+ profile = " taskiq"
474+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/app/worker/taskiq_app.py"
475+ target = " app/worker/taskiq_app.py"
476+ allowed_transformations = [" Copier 模板语法" , " 删除 legacy schedule import" , " startup 与 shutdown 执行 Redis health" ]
477+ removed_references = [" RAG schedule 与虚构业务 task" ]
478+ approved_deviation = [" 生命周期 hooks 同时验证 broker 与 result backend,pool 关闭仍由 Taskiq owner 管理" ]
479+ verification = [" test_taskiq_process_commands_start_and_stop_against_real_redis" ]
480+
481+ [[target ]]
482+ profile = " taskiq"
483+ legacy_source = " legacy/template/{{cookiecutter.project_slug}}/backend/cli/commands.py"
484+ target = " cli/commands.py"
485+ allowed_transformations = [" 删除 V1 排除 commands" , " 保留 server 与 Taskiq commands" ]
486+ removed_references = [" 用户、Celery、database 与 custom commands" ]
487+ approved_deviation = [" subprocess.run 使用 check=True" ]
488+ verification = [" test_taskiq_process_commands_start_and_stop_against_real_redis" ]
0 commit comments