Initial commit: ai4se-harness-suite

Import harness suite (skills, installers, overnight-runner, docs) as a fresh history for InspireChina.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ning-inspire
2026-11-17 09:57:41 +08:00
commit 26975e5c3a
347 changed files with 37438 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
# overnight-runner 项目配置
#
# 这个文件回答两个问题:
# 1. agent 是什么 —— command / args / env
# 2. 无人值守时,**默认怎么决策** —— default.prompt + decisions
#
# 每次用到决策,都会写一条记录到
# .overnight-runner/queue/<队列名>/decisions.jsonl
# 方便事后回溯"昨晚它替我做了什么决定"。
#
# 这里的规则是 **全队列共享** 的 —— 决策记录才是 per-queue 的。
project:
name: example-project
agent:
command: opencode
args: ["run", "--dangerously-skip-permissions"]
env: {}
default:
# 每次任务都会用的默认提示词。
# 占位符:
# {{PLAN}} —— plan 文件的全文
# {{DECISIONS}} —— 下面的默认决策清单
prompt: |
你在无人值守模式下工作,不要停下来等待人工确认。
按下面的方案执行,遇到需要决策的问题,按"默认决策"处理:
{{DECISIONS}}
{{PLAN}}
执行要求:
1. 每做出一个决策,输出一行:DECISION: <问题> → <决策>
2. 全部完成后输出一行:DONE: <一句话总结>
3. 如果无法继续,输出一行:BLOCKED: <原因>
# 命中不了任何规则时的兜底策略。
# 可选:跳过并记录到决策日志 / 采用最安全可回滚的方案 / 停止任务并标记为阻塞
onUnknownDecision: 采用最安全、可回滚的方案(优先只改测试代码,不动生产代码),并在最终总结里明确标注这个假设
# 默认决策规则:agent 遇到这类问题时,直接用这里的答案,不要等人。
#
# match 是正则(大小写不敏感时用 (?i) 前缀),question 是精确/包含匹配。
decisions:
- id: test-failure
question: 测试失败了,是断言写错还是实现有 bug?
match: "测试失败|断言失败|用例失败|mvn test"
answer: 先读失败输出定位根因——断言与实际契约不符就按 Plan §9.5 用例清单修断言;确实是实现 bug 就做最小修复并在总结里说明,不要扩大改动范围
enabled: true
- id: db-migration
question: 是否执行数据库迁移脚本?
match: "数据库迁移|flyway|migration"
answer: 先写好回滚脚本,再执行迁移;迁移后跑一遍冒烟用例
enabled: true
- id: missing-plan
question: plan 里没有写清楚的部分
match: "plan.*(缺失|没有写|不明确)"
answer: 按项目现有实现的模式推断,并在最终总结里明确标注这个假设
enabled: true
- id: flaky-test
question: 测试偶发失败
match: "flaky|偶发|时好时坏"
answer: 不要靠重试掩盖,定位根因后修复;在总结里写明根因
enabled: true
- id: scope-creep
question: 是否扩大改动范围
match: "范围外|额外的改动|顺便"
answer: 不扩大范围,把发现的问题记录下来,不要顺手改
enabled: true

View File

@@ -0,0 +1,6 @@
{"at": "2026-11-06T16:34:29+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "测试失败根因判定(Plan §9.5 用例4)", "answer": "实现 bug,不是断言写错:resources/business-rules/*.yml 从未被加载进 Environment(测试中 mybatis-plus.mapper-locations=null 证明 test 的 application.yml 遮蔽了 main 的,且无 spring.config.import 引用这两个 YAML),导致 BusinessRuleConfig 恒为空、BusinessRuleProvider 的 if(!ruleConfig.isEmpty()) 分支永不进入,接口响应永远没有 config 字段;与 docs/designs/api.yaml、docs/designs/topic/businessrule.md、docs/standards/business-rule.md 三处事实文档矛盾 → 做最小修复(不改 API 契约、不改 YAML 文件内容)", "source": "agent", "rule_id": ""}
{"at": "2026-11-06T16:41:40+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "db-migration(是否执行数据库迁移脚本)", "answer": "本轮无任何 DDL/表结构变更,目标接口不读写数据库,schema.sql/data.sql 未改动,因此不执行迁移、无需回滚脚本;仅复用 TestBase 既有的 resetAll() 隔离机制", "source": "agent", "rule_id": ""}
{"at": "2026-11-06T16:41:40+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "missing-plan(plan 未写清的部分)", "answer": "① Plan §9.5 用例4 的断言以 docs/designs/api.yaml + docs/standards/business-rule.md 定义的契约为准(config 必须存在),而非以当前运行时行为为准——这是本轮唯一的实现侧改动;② RestAssured 5.3.2 的 JsonPath 走 Jayway/GPath,$[*] 写法不被支持,改用隐式遍历路径 ruleName / config.appointment.slot.minMinutes / items.code(已在实现前用探针实测确认);③ 探针文件 ProbeTmpTest.java 仅用于取事实,已删除,未留在仓库", "source": "agent", "rule_id": ""}
{"at": "2026-11-06T16:41:40+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "flaky-test(测试偶发失败)", "answer": "未观察到偶发失败:新用例连续 3 轮 10/10 全绿,全量 28/28 全绿;根因排查集中在配置装载一次性完成(@PostConstruct 缓存),无并发写入,不存在竞态,无需修复", "source": "agent", "rule_id": ""}
{"at": "2026-11-06T16:41:40+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "scope-creep(是否扩大改动范围)", "answer": "不扩大,记录 3 项发现不修:① AGENTS.md §7 示例 JSON 写 message/timestamp,与代码实际 ErrorResponse(errorCode/errorMessage/data) 不符(Plan §6.4 已记录,建议单独开一轮);② config.auth.publicEndpoints 因 Map<String,Object> 绑定被序列化为 {\"0\":...} 而非数组(属既有 Map 绑定设计的固有结果,非本轮引入);③ docs/designs/topic/businessrule.md 的\"配置路径\"列指向 application.yml→jwt.expiration / SecurityConfig(hardcoded),与现在对外暴露的 config.auth.* 来源(business-rules/auth.yml)不完全一致", "source": "agent", "rule_id": ""}
{"at": "2026-11-06T16:41:40+08:00", "task_id": "20261106-20261106-businessrule-datadictionary-api-tests", "question": "文档同步检查", "answer": "已更新:docs/standards/business-rule.md 补 4 行\"加载方式\"说明(防同类静默回归);application.yml.example 补 spring.config.import(该文件才是入库版本,真实 application.yml 被 gitignore);docs/designs/api.yaml、db-schema.md、topic/businessrule.md、topic/data-dict.md、docs/e2e-cases/ 均不涉及(契约、库表、规则与字典定义均未变)", "source": "agent", "rule_id": ""}

View File

@@ -0,0 +1,9 @@
queue:
- id: 20261106-20261106-businessrule-datadictionary-api-tests
plan: docs/plans/20261106-businessrule-datadictionary-api-tests.md
priority: 10
role: DEV
- id: 20261106-20261106-fix-public-endpoints-and-error-doc
plan: docs/plans/20261106-fix-public-endpoints-and-error-doc.md
priority: 10
role: DEV