fix(rectification): surface dropped probes and filter tools by the decision
Independent Staging Quality Gate / validate (push) Failing after 17m9s
Independent Staging Quality Gate / publish (push) Has been skipped

Silent unrenderable discriminators, a missing question-contract golden, and a always-on tool table were hiding fail-closed drops behind the prompt wall.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-28 20:31:15 +08:00
co-authored by Cursor
parent 69c3e94920
commit 63b4591aae
25 changed files with 856 additions and 274 deletions
+14 -38
View File
@@ -46,61 +46,37 @@ test("system prompt carries only high-priority boundaries, never the method copy
const promptStart = agentSource.indexOf("const agenticRectificationInstructions");
const promptEnd = agentSource.indexOf("export function getRectificationV9Agent");
const prompt = agentSource.slice(promptStart, promptEnd);
// No gate -> scan -> score -> diagnostics orchestration in the prompt.
assert.doesNotMatch(prompt, /rectification-gate[\s\S]*rectification-scan/);
assert.doesNotMatch(prompt, /rectification-score[\s\S]*rectification-diagnostics/);
assert.doesNotMatch(prompt, /rectification-confirm[\s\S]*rectification-save-birth-time/);
assert.doesNotMatch(prompt, /10[-]15 个事件/);
assert.match(prompt, /D9\/D10 类型/);
assert.match(prompt, /80%\/60%/);
assert.match(prompt, /skill_verification_report/);
assert.doesNotMatch(prompt, /run the required gate/);
assert.doesNotMatch(prompt, /candidate_range/);
assert.match(prompt, /jyotish-birth-time-rectification/);
assert.match(prompt, /display_date_label/);
assert.match(prompt, /rectification-record-evidence-batch/);
assert.match(prompt, /不可分区间/);
assert.match(prompt, /confirmation_gate/);
assert.match(prompt, /session_outcome=adopt_representative/);
assert.doesNotMatch(prompt, /本会话以代表性时间收口|本轮校正已收口/);
assert.match(prompt, /unique_minute_path=closed_at_representative/);
assert.match(prompt, /next_user_action/);
assert.match(prompt, /rectification-offer-candidates/);
assert.match(prompt, /on_user_stop/);
assert.match(prompt, /禁止只说记下了/);
assert.match(prompt, /工具执行过程保持静默/);
assert.match(prompt, /思考过程必须用简体中文/);
assert.match(prompt, /对用户说的话必须自己写在正文里,不要只写规划等服务器代写/);
assert.match(prompt, /skill_verification_report/);
assert.match(prompt, /不要因家人或职业方法层未覆盖而改回收集/);
assert.match(prompt, /ask_candidate_discriminator/);
assert.match(prompt, /offer_provisional_range/);
assert.match(prompt, /不要再问整窗 D9\/D24/);
assert.match(prompt, /不得询问外貌、体质、胎记或疤痕/);
assert.match(prompt, /不要调用 rectification-set-focus/);
assert.match(prompt, /题干和动态选项只由选择卡展示/);
assert.match(prompt, /正文只做简短自然承接/);
assert.match(prompt, /不得另写、改写或复述题干与选项/);
assert.match(prompt, /80%\/60%/);
assert.match(prompt, /confirmation_allowed/);
assert.doesNotMatch(prompt, /本会话以代表性时间收口|本轮校正已收口/);
assert.match(prompt, /工具执行保持静默/);
assert.match(prompt, /思考用简体中文写在思维链/);
assert.match(prompt, /对用户说的话必须自己写在正文里/);
assert.match(prompt, /题干和选项只由选择卡展示/);
assert.match(prompt, /正文只自然承接/);
assert.match(prompt, /「先这样」由服务器/);
assert.doesNotMatch(prompt, /不得询问外貌、体质、胎记或疤痕/);
assert.doesNotMatch(prompt, /财务与健康只有用户主动说才问/);
assert.doesNotMatch(prompt, /id 不是 adopt_representative/);
assert.doesNotMatch(prompt, /不要调用 rectification-set-focus/);
assert.doesNotMatch(prompt, /自己写一句自然语言追问/);
assert.doesNotMatch(prompt, /运行器会把口语接到这句题干/);
assert.doesNotMatch(prompt, /运行器只在你没问/);
assert.doesNotMatch(prompt, /不得另起高考发挥/);
assert.doesNotMatch(prompt, /不得根据出生年推算高考或入学年份/);
assert.doesNotMatch(prompt, /不要再问那一件发生在哪一年/);
assert.match(prompt, /「先这样」由服务器/);
assert.match(prompt, /盘外核对(不计分)/);
assert.match(prompt, /verify_adopted_time/);
assert.match(prompt, /event_probe/);
assert.match(prompt, /至少 3 条训练事件/);
assert.match(prompt, /2 个领域/);
assert.match(prompt, /发挥质量/);
assert.doesNotMatch(prompt, /两套盘各自的前事/);
assert.doesNotMatch(prompt, /外貌、体质、胎记或疤痕可以问/);
assert.doesNotMatch(prompt, /分盘句和宫位表由界面展示/);
assert.doesNotMatch(prompt, /不是整张宫位表/);
assert.doesNotMatch(prompt, /分别 propose\+confirm/);
// Keep the prompt short (~30 lines max).
assert.ok(prompt.split("\n").length <= 60, "instructions must stay bounded");
assert.ok(prompt.split("\n").length <= 30, "instructions must stay bounded");
});
test("agent pins the dedicated rectification skill and its fixed version", () => {