State the seal rules a JSON shape cannot show

Run 9's research seal was refused for writing "F1" as a finding id. The rule
is real and the message was precise, but no brief had ever stated it: the
shape block shows keys and types, and a format constraint is neither.

The agent recovered in fifteen seconds, so this cost one boundary rather than
a run. It is still a refusal nobody had to earn, and the same shape hid F38 a
few runs ago.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CVbaKucEYBjMqVeUgJUsc1
This commit is contained in:
2026-08-28 15:06:54 +04:00
parent f4dbcf70f6
commit 4712c7dc0e
2 changed files with 21 additions and 0 deletions
+10
View File
@@ -132,6 +132,9 @@ func phaseRequestBrief(phase domain.WorkPhase) string {
if schema := phaseSealSchema[phase]; schema != "" {
fmt.Fprintf(&b, "\nIt must decode as this shape. Optional keys may be omitted, but no key may hold a different type:\n\n%s\n", schema)
}
if rules := phaseSealRules[phase]; rules != "" {
fmt.Fprintf(&b, "\n%s\n", rules)
}
}
b.WriteString("\nAn accepted request ends this session and starts the next phase with your sealed result. Saying you are ready in the pane is not a request and nothing reads it.\n")
// How to finish. review's only transition is backwards to implement, so a
@@ -163,6 +166,13 @@ var phaseSealFile = map[domain.WorkPhase]string{
// agent. TestPhaseSealSchemasDecode keeps these honest: each one is decoded by
// the same function the worker uses, so a struct change that is not mirrored
// here fails the build rather than a live run.
// phaseSealRules states the constraints the shape alone cannot show. Run 9
// was refused for writing "F1" as a finding id, a rule the decoder enforced
// and no brief had ever stated.
var phaseSealRules = map[domain.WorkPhase]string{
domain.WorkPhaseResearch: "A finding id is lowercase letters, digits, dash or underscore, at most 64 characters, and unique. The plan cites these, so they are names rather than labels.",
}
var phaseSealSchema = map[domain.WorkPhase]string{
domain.WorkPhaseResearch: ` {
"findings": [{"id": "", "claim": "", "evidence": "", "confidence": "fact|inference|assumption"}],
+11
View File
@@ -696,3 +696,14 @@ func TestAllPhasesStaleIsNotReportedAsFinished(t *testing.T) {
t.Errorf("a plan verified at HEAD was not reported as finished:\n%s", current)
}
}
// The shape cannot show a format rule, and run 9 was refused for writing "F1"
// as a finding id against a constraint no brief had ever stated.
func TestResearchBriefStatesTheFindingIDRule(t *testing.T) {
brief := phaseRequestBrief(domain.WorkPhaseResearch)
for _, want := range []string{"lowercase letters", "at most 64 characters", "unique"} {
if !strings.Contains(brief, want) {
t.Errorf("research brief never states %q", want)
}
}
}