Enforce rulespec creation with plan_write for new plans
Solves the tautology problem where the LLM would write invariants after implementation, making them match what was done rather than constrain it. Changes: - plan_write now accepts 'rulespec' parameter - New plans REQUIRE rulespec (fails with helpful error if missing) - Plan updates don't require rulespec (backward compatible) - Rulespec is parsed, validated, and written atomically with plan - Updated system prompt with clear examples for new vs update - Updated tool definition schema - Updated all affected tests New flow: task → plan+rulespec → user reviews BOTH → approve → implement
This commit is contained in:
@@ -621,6 +621,15 @@ items:
|
||||
boundary:
|
||||
- desc: Edge cases
|
||||
target: test::module"#
|
||||
,
|
||||
"rulespec": r#"claims:
|
||||
- name: test_feature
|
||||
selector: test.done
|
||||
predicates:
|
||||
- claim: test_feature
|
||||
rule: exists
|
||||
source: task_prompt
|
||||
notes: Test invariant"#
|
||||
}),
|
||||
};
|
||||
let write_result = agent.execute_tool(&write_call).await.unwrap();
|
||||
|
||||
@@ -425,6 +425,14 @@ items:
|
||||
boundary:
|
||||
- desc: Edge
|
||||
target: test"#
|
||||
,
|
||||
"rulespec": r#"claims:
|
||||
- name: test_feature
|
||||
selector: test.done
|
||||
predicates:
|
||||
- claim: test_feature
|
||||
rule: exists
|
||||
source: task_prompt"#
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -479,6 +487,14 @@ items:
|
||||
happy: {desc: Works, target: test}
|
||||
negative: [{desc: Errors, target: test}]
|
||||
boundary: [{desc: Edge, target: test}]"#
|
||||
,
|
||||
"rulespec": r#"claims:
|
||||
- name: approval_test
|
||||
selector: test.approved
|
||||
predicates:
|
||||
- claim: approval_test
|
||||
rule: exists
|
||||
source: task_prompt"#
|
||||
}),
|
||||
);
|
||||
agent.execute_tool(&write_call).await.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user