test(tbd_ship): pin value case/whitespace as non-low; descriptor lists the risk key (review nits)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SZkhi49hfeSqBp5aZJNXsM
This commit is contained in:
@@ -37,7 +37,7 @@ const (
|
|||||||
func (t *TBDShip) Descriptor() registry.ToolDescriptor {
|
func (t *TBDShip) Descriptor() registry.ToolDescriptor {
|
||||||
return registry.ToolDescriptor{
|
return registry.ToolDescriptor{
|
||||||
Name: "tbd_ship",
|
Name: "tbd_ship",
|
||||||
Description: "Trunk-based ship of a single-file change: branch from base, write the file, open a PR, and auto-merge (squash) to base ONLY when the head commit's CI is fully green AND the named issue carries exactly one risk/ label, risk/low. Fails closed to PR-only (never merges) when CI is pending, red, or absent, when no issue is named or its risk/ label is missing, ambiguous, unknown, risk/medium or risk/high, when the issue cannot be read, when the base branch requires reviews, or when the merge isn't clean — returning the PR for manual handling with a reason. Set ci_timeout_seconds to poll CI to completion (default 0 = snapshot, which returns pending right after opening the PR). Returns {merged, pr_url, pr_number, ci_status, reason, branch}.",
|
Description: "Trunk-based ship of a single-file change: branch from base, write the file, open a PR, and auto-merge (squash) to base ONLY when the head commit's CI is fully green AND the named issue carries exactly one risk/ label, risk/low. Fails closed to PR-only (never merges) when CI is pending, red, or absent, when no issue is named or its risk/ label is missing, ambiguous, unknown, risk/medium or risk/high, when the issue cannot be read, when the base branch requires reviews, or when the merge isn't clean — returning the PR for manual handling with a reason. Set ci_timeout_seconds to poll CI to completion (default 0 = snapshot, which returns pending right after opening the PR). Returns {merged, pr_url, pr_number, ci_status, risk, reason, branch}.",
|
||||||
InputSchema: json.RawMessage(`{
|
InputSchema: json.RawMessage(`{
|
||||||
"type":"object",
|
"type":"object",
|
||||||
"properties":{
|
"properties":{
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ func TestClassifyRisk(t *testing.T) {
|
|||||||
{"unknown value", l("risk/extreme"), riskUnknown},
|
{"unknown value", l("risk/extreme"), riskUnknown},
|
||||||
{"empty value", l("risk/"), riskUnknown},
|
{"empty value", l("risk/"), riskUnknown},
|
||||||
{"wrong case", l("Risk/Low"), riskNone},
|
{"wrong case", l("Risk/Low"), riskNone},
|
||||||
|
{"value case matters: risk/Low is unknown, not low", l("risk/Low"), riskUnknown},
|
||||||
|
{"trailing space in the value is unknown, not low", l("risk/low "), riskUnknown},
|
||||||
|
{"leading space in the value is unknown, not low", l("risk/ low"), riskUnknown},
|
||||||
{"prefix only inside a name", l("not-risk/low"), riskNone},
|
{"prefix only inside a name", l("not-risk/low"), riskNone},
|
||||||
}
|
}
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
|
|||||||
Reference in New Issue
Block a user