Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
regional-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d3402784
authored
Jul 30, 2026
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: 添加 ROP 安全导入实施计划
1 parent
456a6126
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
docs/superpowers/plans/2026-07-30-rop-safe-import.md
docs/superpowers/plans/2026-07-30-rop-safe-import.md
0 → 100644
View file @
d340278
# ROP Swagger 安全导入与小程序改造门禁实施计划
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans. Follow TDD for every behavior change.
**Goal:**
加固
`dj-car-life-system`
的 ROP Swagger 契约工具,并把安全导入、离线快照、迁移门禁和项目级聊天导入能力同步到
`regional-assistant`
与
`dj-car-boutique-work-wechat`
。
**Architecture:**
先修复后台项目的 Swagger 2.0 契约核心,再把相同行为以内置工具形式分别适配到两个小程序。小程序使用测试环境 boutique Swagger 完整快照;业务 API 只允许通过默认 dry-run、唯一 AST 定位和显式
`--apply`
改写。
**Tech Stack:**
Node.js、Jest、Node test runner、Swagger 2.0、Babel parser/generator、微信小程序。
## Global Constraints
-
直接在三个当前分支开发,不创建 worktree 或新分支。
-
`regional-assistant`
以
`456a612`
为基线。
-
小程序默认 Swagger 为
`http://dj.test.glsx.com.cn/rop-dj-car-boutique/swagger-rop/api-docs`
。
-
本轮只用
`dj.api.smartcarlife.auth.phone`
做 dry-run,不正式迁移业务接口。
-
生产请求 method、payload 引用、完整响应 envelope 和 Promise reject 行为不得改变。
-
完整 Swagger 快照提交仓库,但
`docs/`
、
`tests/`
、
`scripts/rop/`
不得进入小程序上传包。
-
默认验证不得访问真实业务环境;真实 API/UI 只允许显式安全开关开启。
---
### Task 1: 小程序迁移前置门禁
在两个小程序中以测试先行增加 migration manifest 模板、API 清单、测试验收模板、
`check:migration -- --manifest <path> --phase pre|post`
和对应
`AGENTS.md`
规则。验证缺失材料、占位符、缺失测试文件和 post 阶段未通过/未阻塞用例会失败;验证工具、文档、测试和 Swagger 快照被上传配置排除。
### Task 2: 加固后台 ROP 契约核心
先扩展
`tests/unit/libs/rop`
,覆盖深层分页 DTO、
`allOf`
、循环引用、required、HTTP 非 2xx/重定向/超时/非法 JSON、嵌套契约漂移、线上差异方向、AST 唯一/歧义定位、默认 dry-run、幂等和人工契约。再最小修改
`swaggerInspect`
、
`contractDiff`
、
`ropImport`
和 CLI,使测试通过;
`rop:verify`
保持离线,真实冒烟拆到
`rop:verify:live`
。
### Task 3: 适配 regional-assistant
在
`scripts/rop/`
内置通过 Task 2 验证的契约行为,提交 boutique 测试环境完整快照,增加
`rop:swagger:fetch`
、
`rop:swagger`
、
`rop:import`
、
`rop:contract:check`
、
`rop:verify`
、
`rop:verify:live`
。契约输出到
`docs/rop/contracts`
,adapter 输出到
`api/adapters`
;支持 CommonJS 对象方法和 ESM 导出函数,默认透明传递。用
`auth.phone`
dry-run 验证唯一定位且工作区无业务改动。
### Task 4: 适配 dj-car-boutique-work-wechat
复用 Task 3 的工具接口、黄金 fixture 和快照策略,按精品小程序代码风格适配并验证。同样只执行
`auth.phone`
dry-run,不落盘业务接口。
### Task 5: 项目级聊天导入与最终验收
先基线测试再更新后台项目已有
`rop-api-import`
skill;随后逐个初始化、编写并验证两个小程序的项目级 skill。固定“解析 method → JSON dry-run → 用户确认 →
`--apply`
→ 契约检查”的流程。执行三个仓库专项回归、上传排除检查、工作区审计和最终代码审查。
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment