refactor(agent): gadfly round 2 — shared leadingMarkers, explicit mode, comment altitude
All tidiness, no behavior change: the leading-marker class is one shared constant for citationLabelRe and summaryCloserRe (hand-copying it is how '+' went missing the first time); the deliberate 'all' duplication across summaryCopulas/summaryArticle is now stated at both sites; the weak-final switch case assigns modeBackRef explicitly; test comments state the constraint they guard instead of which reviewer asked for them. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
+10
-10
@@ -354,11 +354,11 @@ func TestFinalOutput(t *testing.T) {
|
||||
want: b3cb9ee9Closer,
|
||||
},
|
||||
{
|
||||
// Gadfly (opus, correctness): the modeSummary scan must stop at the
|
||||
// most recent user message. Here the current turn's answer sits in
|
||||
// the 1x-3x band (rejected by the ratio) while a dwarfing answer to
|
||||
// a DIFFERENT question sits in history — resurrecting it would be
|
||||
// strictly worse than keeping the closer.
|
||||
// The modeSummary scan must stop at the most recent user message.
|
||||
// Here the current turn's answer sits in the 1x-3x band (rejected
|
||||
// by the ratio) while a dwarfing answer to a DIFFERENT question
|
||||
// sits in history — resurrecting it would be strictly worse than
|
||||
// keeping the closer.
|
||||
name: "summary closer never resurrects a stale answer across the user boundary",
|
||||
msgs: []llm.Message{
|
||||
llm.UserText("earlier, unrelated question?"),
|
||||
@@ -388,11 +388,11 @@ func TestFinalOutput(t *testing.T) {
|
||||
want: hugeAnswer,
|
||||
},
|
||||
{
|
||||
// Gadfly (opus, error-handling): a closer matching BOTH the ack
|
||||
// shape and a back-reference carries no answer content, so the
|
||||
// back-ref test must win and the ordinary recovery bar apply —
|
||||
// under the summary bar this ~106-byte terminal would demand a
|
||||
// ~318-byte prior and wrongly keep the closer over longAnswer.
|
||||
// A closer matching BOTH the ack shape and a back-reference
|
||||
// carries no answer content, so the back-ref test must win and the
|
||||
// ordinary recovery bar apply — under the summary bar this
|
||||
// ~106-byte terminal would demand a ~318-byte prior and wrongly
|
||||
// keep the closer over longAnswer.
|
||||
name: "back-reference wins over the summary ack when both match",
|
||||
msgs: []llm.Message{
|
||||
llm.UserText("q?"),
|
||||
|
||||
Reference in New Issue
Block a user