v0.263.0: a failed update puts the app back by itself (09 decision 15, R-637)
gates / gates (push) Successful in 26s
gates / gates (push) Successful in 26s
The guarded update gains a folder copy of the app's named volumes, taken after the pull where the app stops anyway (decision 19, chosen by the 2026-09-23 bake-off). On a failed health check the box undoes: every copy validated by its finished-marker first, volumes refilled, definition and pin from the job's own pre-update copies, the old version checked with the OLD .felhom.yml probe. It holds only if the undo fails, and the hold sentence says so and what state the data is in. Bind-mounted folders are never touched. - R-637 built; R-638/R-640/R-641 do not arise with a folder copy; R-639 (pre-update copies incl. .felhom.yml kept until the undo is over). - journal phases copying/undoing with power-cut recovery. - app.yaml last_update_undone + one line on the app page (hu/en). - R-642: start/restart never answer "completed". - Removal deletes kept undo copies. MinAgent unchanged (0.131.0). Nine red-proofs in REPORT.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// R-642 (v0.263.0): a start or restart is never answered "completed" — measured 2026-09-23 on docmost
|
||||
// and romm, both 200 "start completed" while `Restarting (1)` behind a 404 front door.
|
||||
//
|
||||
// COMPANION RED-PROOF (REPORT.md): put `Message: "Stack " + name + " " + action + " completed"` back in
|
||||
// startAnswer — the first assertion fails.
|
||||
func TestR642_StartIsNeverReportedCompleted(t *testing.T) {
|
||||
for _, action := range []string{"start", "restart"} {
|
||||
a := startAnswer("docmost", action, "restarting")
|
||||
if strings.Contains(a.Message, "completed") {
|
||||
t.Errorf("%s answered %q — a start cannot know it completed", action, a.Message)
|
||||
}
|
||||
if !strings.Contains(a.Message, "restarting") {
|
||||
t.Errorf("%s must say the state it sees, got %q", action, a.Message)
|
||||
}
|
||||
if d, _ := a.Data.(map[string]interface{}); d["state"] != "restarting" {
|
||||
t.Errorf("%s data = %v", action, a.Data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestR642_TheHandlerUsesStartAnswer walks the router's AST: the stack-action handler must CALL
|
||||
// startAnswer (a comment naming it would not count — the v0.154.0 / R-106 inert-seam class).
|
||||
func TestR642_TheHandlerUsesStartAnswer(t *testing.T) {
|
||||
f, err := parser.ParseFile(token.NewFileSet(), "router.go", nil, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
calls := 0
|
||||
ast.Inspect(f, func(n ast.Node) bool {
|
||||
if c, ok := n.(*ast.CallExpr); ok {
|
||||
if id, ok := c.Fun.(*ast.Ident); ok && id.Name == "startAnswer" {
|
||||
calls++
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
if calls != 1 {
|
||||
t.Errorf("startAnswer must be called exactly once from router.go, found %d", calls)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user