Refine taskitem workflow guidance and sprint intake shaping
This commit is contained in:
@@ -166,9 +166,84 @@ void t9() {
|
||||
PASS();
|
||||
}
|
||||
|
||||
void t10() {
|
||||
TEST(strict_contract_flags_missing_verification_metadata);
|
||||
MCPServer mcp;
|
||||
auto workspace = makeWorkspace();
|
||||
json item = validTaskitem();
|
||||
item["execution_contract"] = {
|
||||
{"stepIds", json::array({"1939"})},
|
||||
{"targetFiles", json::array({"python/hivemind_installer/models.py"})},
|
||||
{"requiredTools", json::array({"whetstone_generate_taskitems"})},
|
||||
{"acceptanceCommands", json::array({"pytest"})},
|
||||
{"executionSpecificityScore", 75}
|
||||
};
|
||||
auto out = callTool(mcp, "whetstone_validate_taskitem", {
|
||||
{"taskitems", json::array({item})},
|
||||
{"workspace", workspace},
|
||||
{"strict_execution_contract", true}
|
||||
});
|
||||
CHECK(out.value("success", false), "expected success");
|
||||
CHECK(out["report"]["results"].size() == 1, "expected one result");
|
||||
const auto& result = out["report"]["results"][0];
|
||||
CHECK(result.value("gap_class", "") == "under_constrained_taskitem",
|
||||
"expected under_constrained_taskitem");
|
||||
bool sawVerificationIssue = false;
|
||||
for (const auto& issue : result["issues"]) {
|
||||
if (!issue.is_string()) continue;
|
||||
const std::string text = issue.get<std::string>();
|
||||
if (text.find("verificationType") != std::string::npos ||
|
||||
text.find("testFiles") != std::string::npos) {
|
||||
sawVerificationIssue = true;
|
||||
}
|
||||
}
|
||||
CHECK(sawVerificationIssue, "expected verification metadata issue");
|
||||
PASS();
|
||||
}
|
||||
|
||||
void t11() {
|
||||
TEST(malformed_paths_and_wrong_language_commands_are_under_constrained);
|
||||
MCPServer mcp;
|
||||
json item = validTaskitem();
|
||||
item["execution_contract"] = {
|
||||
{"targetFiles", json::array({
|
||||
"crates/whimpwm/src/render.rs",
|
||||
"crates/whimpwm/tests/`.",
|
||||
"crates/whimpwm`."
|
||||
})},
|
||||
{"acceptanceCommands", json::array({
|
||||
"cargo test",
|
||||
"go test ./..."
|
||||
})},
|
||||
{"verificationType", "unit"},
|
||||
{"testFiles", json::array({"crates/whimpwm/tests/main_test.rs"})},
|
||||
{"executionSpecificityScore", 90}
|
||||
};
|
||||
auto out = callTool(mcp, "whetstone_validate_taskitem", {
|
||||
{"taskitems", json::array({item})},
|
||||
{"strict_execution_contract", true}
|
||||
});
|
||||
CHECK(out.value("success", false), "expected success");
|
||||
CHECK(out["report"]["results"].size() == 1, "expected one result");
|
||||
const auto& result = out["report"]["results"][0];
|
||||
CHECK(result.value("gap_class", "") == "under_constrained_taskitem",
|
||||
"expected under_constrained_taskitem");
|
||||
bool sawMalformed = false;
|
||||
bool sawIncompatible = false;
|
||||
for (const auto& issue : result["issues"]) {
|
||||
if (!issue.is_string()) continue;
|
||||
const std::string text = issue.get<std::string>();
|
||||
if (text.find("malformed_target_path") != std::string::npos) sawMalformed = true;
|
||||
if (text.find("incompatible_acceptance_commands") != std::string::npos) sawIncompatible = true;
|
||||
}
|
||||
CHECK(sawMalformed, "expected malformed target path issue");
|
||||
CHECK(sawIncompatible, "expected incompatible acceptance commands issue");
|
||||
PASS();
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::cout << "Step 682: whetstone_validate_taskitem MCP tool\n";
|
||||
t1(); t2(); t3(); t4(); t5(); t6(); t7(); t8(); t9();
|
||||
t1(); t2(); t3(); t4(); t5(); t6(); t7(); t8(); t9(); t10(); t11();
|
||||
std::cout << "\nResults: " << passed << "/" << (passed + failed) << " passed\n";
|
||||
return failed == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user