carlos / platform Public

console: the backups door, GET .../instances/{host}/backups (#898)

Member backups slice 1, task 3. The door answers backupsFor's view of one
instance record for a member and for deploy, operate and admin service
credentials; every other role meets the kindCLI role gate's 403, and a
caller whose scope does not reach the app meets the instance gate's
byte-identical 404, as does a badly shaped or unknown host. No audit row:
it reads metadata, like the other GET doors.

The door joins the route census (claim-routes.txt, a claim fixture and a
read probe), the linked-app policy (refused, as the instance GET is), the
deploy credential's door list and the team role's closed list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f5b886ffe15b7cf0198d087656d6568dd88b1db4 parent 477cdc5
9 files changed, +371 −0
  • internal/console/apibackups.go +48 −0
  • internal/console/apibackups_test.go +307 −0
  • internal/console/claim_invariant_fixtures_test.go +3 −0
  • internal/console/claim_invariant_probes_read_test.go +2 −0
  • internal/console/deploydoors_test.go +3 −0
  • internal/console/linkedpolicy.go +1 −0
  • internal/console/routedecls.go +5 −0
  • internal/console/teamdoors_test.go +1 −0
  • internal/console/testdata/claim-routes.txt +1 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>aac22fe9ea88305c0</task-id> <tool-use-id>toolu_01A8i3Xb5njPFcEz7Y3cPipt</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ab362fc0-f177-4a7f-a92e-4a29ea210aad/tasks/aac22fe9ea88305c0.output</output-file> <status>completed</status> <summary>Agent "Implement slice 1 Task 2" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: DONE. All three fix-round findings are fixed. Commits: `cf2ef5d9` (the task) and `477cdc56` (fix round 1). Not pushed. What changed, all in the read step of `internal/console/backups.go`: 1. A deadline hit while opening the replica now answers `not_shown`/`too_large_to_plan` and is cached, like a listing deadline. 2. Only answers that read a position, and `too_large_to_plan`, are cached for 5 minutes. `nothing_replicated` and `unavailable` are read again on the next call. 3. With `HostClaim` on, a would-be-replicated instance answers `not_shown`/`unavailable` without calling `dbReplica`. Tests: the three new tests failed against the old code and pass now. All targeted backups, ResolveReplica, ResolveDBSource and APIDB tests pass, the backups tests also pass under `-race`, and vet and `go build ./...` are clean. Concerns: only the earlier one remains. `resolveReplica` calls `replicaPlacement` (the pool and fleet half of `replicaIntrinsic`) so its errors stay byte for byte. Report (fix round appended): /home/paulca/amadan.net/carlos/platform/.claude/worktrees/member-backups-1/.superpowers/sdd/2026-11-11-member-backups-slice1/task-2-report.md</result> <usage><subagent_tokens>151014</subagent_tokens><tool_uses>6</tool_uses><duration_ms>307066</duration_ms></usage> </task-notification>

diff --git a/internal/console/apibackups.go b/internal/console/apibackups.go
new file mode 100644
index 000000000..305e2ac42
--- /dev/null
+++ b/internal/console/apibackups.go
@@ -0,0 +1,48 @@
+// The backups door (member backups spec 2026-11-11 §1): what the console
+// knows about one instance's copy, for `carlos backups`.
+
+package console
+
+import (
+ "context"
+ "errors"
+ "log"
+ "net/http"
+ "os"
+
+ "github.com/carlosframework/platform/internal/provision"
+)
+
+// handleAPIInstanceBackups answers GET .../instances/{host}/backups with
+// backupsFor's view of the record. The instance family's order: the gate
+// (principal first, then budget and bucket), then the byte-identical 404
+// for a host that is badly shaped or names no record. It reads metadata
+// only, so, like the other GET doors, it writes no activity row.
+func (s *Server) handleAPIInstanceBackups(w http.ResponseWriter, r *http.Request) {
+ _, acct, app, ok := s.instanceGate(w, r)
+ if !ok {
+ return
+ }
+ host := r.PathValue("host")
+ // Shape-checked before the key builder, as the instance GET does it:
+ // {host} arrives percent-decoded.
+ if !provision.ValidHostShape(host) {
+ http.NotFound(w, r)
+ return
+ }
+ ctx, cancel := context.WithTimeout(r.Context(), instanceStoreTimeout)
+ defer cancel()
+ rec, _, err := s.readRecord(ctx, acct.Sqid, app, host)
+ if errors.Is(err, os.ErrNotExist) {
+ http.NotFound(w, r)
+ return
+ }
+ if err != nil {
+ log.Printf("console: api instances backups %s/%s/%s: %v", acct.Sqid, app, host, err)
+ jsonError(w, http.StatusBadGateway, "could not read the instance")
+ return
+ }
+ // The read has its own deadline (backupsDeadline), so it runs on the
+ // request's context, not the record read's shorter one.
+ writeJSON(w, http.StatusOK, s.backupsFor(r.Context(), *rec))
+}
diff --git a/internal/console/apibackups_test.go b/internal/console/apibackups_test.go
new file mode 100644
index 000000000..1693b1690
--- /dev/null
+++ b/internal/console/apibackups_test.go
@@ -0,0 +1,307 @@
+package console
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "io"
+ "net/http"
+ "slices"
+ "sort"
+ "testing"
+ "time"
+
+ "github.com/superfly/ltx"
+
+ "github.com/carlosframework/platform/internal/dbdoor"
+ "github.com/carlosframework/platform/internal/dbreads"
+ "github.com/carlosframework/platform/internal/provision"
+ "github.com/carlosframework/platform/internal/regionlabel"
+ "github.com/carlosframework/platform/internal/release"
+ "github.com/carlosframework/platform/internal/svcrole"
+)
+
+func backupsURL(fx *consoleFixture, app, host string) string {
+ return fx.ts.URL + "/api/cli/apps/" + release.OpsAccount + "/" + app + "/instances/" + host + "/backups"
+}
+
+// untimedReplica is listedReplica with no times on its listing, which is
+// what makes PositionAndHistory answer the position with history unknown.
+type untimedReplica struct{ listedReplica }
+
+func (r *untimedReplica) LTXFiles(ctx context.Context, level int, seek ltx.TXID, useMetadata bool) (ltx.FileIterator, error) {
+ itr, err := r.listedReplica.LTXFiles(ctx, level, seek, useMetadata)
+ if err != nil {
+ return nil, err
+ }
+ defer itr.Close()
+ var fs []*ltx.FileInfo
+ for itr.Next() {
+ f := *itr.Item()
+ f.CreatedAt = time.Time{}
+ fs = append(fs, &f)
+ }
+ return ltx.NewFileInfoSliceIterator(fs), nil
+}
+
+// backupsKeys is the sorted top-level key set of a JSON object, and the
+// object itself.
+func backupsKeys(t *testing.T, body string) ([]string, map[string]any) {
+ t.Helper()
+ var m map[string]any
+ if err := json.Unmarshal([]byte(body), &m); err != nil {
+ t.Fatalf("not a JSON object: %s: %v", body, err)
+ }
+ keys := make([]string, 0, len(m))
+ for k := range m {
+ keys = append(keys, k)
+ }
+ sort.Strings(keys)
+ return keys, m
+}
+
+// TestAPIInstanceBackupsKeySets (P2-17): each class carries exactly its
+// keys and no others, read as a member through the door itself.
+func TestAPIInstanceBackupsKeySets(t *testing.T) {
+ fx := dbFixture(t)
+ here := fx.srv.cfg.Region // dbTestHost's record is homed here
+ const untimed = "untimed.go.tito.io"
+ onDisk := fx.srv.dbReplica
+ fx.srv.dbReplica = func(ctx context.Context, prefix string) (replicaReader, error) {
+ if prefix == "instances/"+untimed {
+ return &untimedReplica{listedReplica{n: 2, at: time.Date(2026, 11, 11, 9, 0, 0, 0, time.UTC)}}, nil
+ }
+ return onDisk(ctx, prefix)
+ }
+ for _, rec := range []provision.Record{
+ {Host: untimed, Region: here},
+ {Host: "born-ha.go.tito.io", Region: here, HA: true},
+ {Host: "awake.go.tito.io", Region: here, Hibernate: backupsNo()},
+ {Host: "svc.go.tito.io", Region: here, Kind: "service"},
+ {Host: "far.go.tito.io", Region: "uk"},
+ {Host: "pool.go.tito.io", Region: here, Pool: "shared"},
+ {Host: "fleet.go.tito.io", Region: "fleet/acme"},
+ {Host: "empty.go.tito.io", Region: here},
+ } {
+ putDBRecord(t, fx.consoleFixture, rec)
+ }
+ fx.replicate(t, dbTestHost, 2)
+ fx.replicate(t, "born-ha.go.tito.io", 1)
+
+ far := regionlabel.ForCode("uk", fx.srv.regionHome(), fx.srv.regionNames()).Text
+ for _, c := range []struct {
+ host, class, reason, files string
+ keys []string
+ }{
+ {dbTestHost, "replicated", "", "not_copied", []string{"class", "copied_to", "files", "history_from"}},
+ {untimed, "replicated", "", "not_copied", []string{"class", "copied_to", "files"}},
+ {"born-ha.go.tito.io", "replicated", "", "not_shown", []string{"class", "copied_to", "files", "history_from"}},
+ {"awake.go.tito.io", "no_copy", "no_sleep", "not_copied", []string{"class", "files", "reason"}},
+ {"svc.go.tito.io", "no_copy", "not_instance", "not_copied", []string{"class", "files", "reason"}},
+ {"far.go.tito.io", "not_shown", "other_region", "not_copied", []string{"class", "files", "reason", "region"}},
+ {"pool.go.tito.io", "not_shown", "pooled", "not_copied", []string{"class", "files", "reason"}},
+ {"fleet.go.tito.io", "not_shown", "fleet", "not_copied", []string{"class", "files", "reason"}},
+ {"empty.go.tito.io", "not_shown", "nothing_replicated", "not_copied", []string{"class", "files", "reason"}},
+ } {
+ t.Run(c.host, func(t *testing.T) {
+ status, h, body := rawReq(t, http.MethodGet, backupsURL(fx.consoleFixture, "titogo", c.host), fx.member, "")
+ if status != http.StatusOK || h.Get("Content-Type") != "application/json" {
+ t.Fatalf("backups = %d %q %s, want 200 JSON", status, h.Get("Content-Type"), body)
+ }
+ keys, m := backupsKeys(t, body)
+ if !slices.Equal(keys, c.keys) {
+ t.Fatalf("keys = %v, want exactly %v: %s", keys, c.keys, body)
+ }
+ if m["class"] != c.class || m["files"] != c.files {
+ t.Fatalf("class %v files %v, want %s and %s: %s", m["class"], m["files"], c.class, c.files, body)
+ }
+ if c.reason != "" && m["reason"] != c.reason {
+ t.Fatalf("reason = %v, want %s", m["reason"], c.reason)
+ }
+ if c.reason == "other_region" && (m["region"] != far || far == "") {
+ t.Fatalf("region = %v, want %q", m["region"], far)
+ }
+ if pos, ok := m["copied_to"]; ok {
+ p, _ := pos.(map[string]any)
+ pk := make([]string, 0, len(p))
+ for k := range p {
+ pk = append(pk, k)
+ }
+ sort.Strings(pk)
+ if !slices.Equal(pk, []string{"transaction", "written_at"}) {
+ t.Fatalf("copied_to keys = %v, want exactly transaction and written_at: %s", pk, body)
+ }
+ if _, err := time.Parse(time.RFC3339Nano, p["written_at"].(string)); err != nil {
+ t.Fatalf("written_at %v is not Go's time encoding: %v", p["written_at"], err)
+ }
+ }
+ })
+ }
+}
+
+// backupsToken is serviceToken for every role, the two that are minted
+// with a scope included: deploy with a rung, run with a command.
+func backupsToken(t *testing.T, st *Store, accountID int64, name, app string, role svcrole.Role) string {
+ t.Helper()
+ var rungs []string
+ var commands [][]string
+ switch role {
+ case svcrole.Deploy:
+ rungs = []string{"edge"}
+ case svcrole.Run:
+ commands = [][]string{{"rake", "db:migrate"}}
+ default:
+ return serviceToken(t, st, accountID, name, app, role)
+ }
+ tok, err := st.NewServicePrincipalScoped(accountID, name, app, role, rungs, commands, "paul@example.test", time.Now())
+ if err != nil {
+ t.Fatalf("mint %s %q: %v", role, name, err)
+ }
+ return tok
+}
+
+// TestAPIInstanceBackupsRoles (P-2): a member and the deploy, operate and
+// admin credentials of the app read the door; every other role meets the
+// role gate's 403 as cliGate writes it; a credential or member whose scope
+// does not reach the app meets the instance gate's byte-identical 404.
+func TestAPIInstanceBackupsRoles(t *testing.T) {
+ fx := dbFixture(t)
+ fx.replicate(t, dbTestHost, 1)
+ u := backupsURL(fx.consoleFixture, "titogo", dbTestHost)
+ if status, _, body := rawReq(t, http.MethodGet, u, fx.member, ""); status != http.StatusOK {
+ t.Fatalf("member = %d %s, want 200", status, body)
+ }
+
+ for _, role := range []svcrole.Role{svcrole.Deploy, svcrole.Operate, svcrole.Admin} {
+ tok := backupsToken(t, fx.st, OpsAccountID, "ok-"+string(role), "titogo", role)
+ status, _, body := rawReq(t, http.MethodGet, u, tok, "")
+ if status != http.StatusOK {
+ t.Errorf("%s bound to titogo = %d %s, want 200", role, status, body)
+ continue
+ }
+ if keys, m := backupsKeys(t, body); m["class"] != "replicated" || !slices.Contains(keys, "copied_to") {
+ t.Errorf("%s bound to titogo = %s, want the replicated view", role, body)
+ }
+ }
+ // An account-scoped operate or admin credential reaches every app of
+ // its account, this one included.
+ for _, role := range []svcrole.Role{svcrole.Operate, svcrole.Admin} {
+ tok := serviceToken(t, fx.st, OpsAccountID, "acct-"+string(role), "", role)
+ if status, _, body := rawReq(t, http.MethodGet, u, tok, ""); status != http.StatusOK {
+ t.Errorf("account-scoped %s = %d %s, want 200", role, status, body)
+ }
+ }
+
+ // Every other role: the role gate's 403, before the handler runs.
+ for _, role := range svcrole.All() {
+ if role == svcrole.Deploy || role == svcrole.Operate || role == svcrole.Admin {
+ continue
+ }
+ tok := backupsToken(t, fx.st, OpsAccountID, "no-"+string(role), "titogo", role)
+ status, h, body := rawReq(t, http.MethodGet, u, tok, "")
+ want := `{"error":"this credential holds role \"` + string(role) + `\"; this door needs one of [admin deploy operate]"}` + "\n"
+ if status != http.StatusForbidden || h.Get("Content-Type") != "application/json" || body != want {
+ t.Errorf("%s = %d %q %q, want 403 %q", role, status, h.Get("Content-Type"), body, want)
+ }
+ }
+
+ // Scope refusals: the instance gate's byte-identical 404.
+ nf := canonicalNotFound(t)
+ if _, err := fx.st.CreateAppIn(OpsAccountID, "other", "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ for _, role := range []svcrole.Role{svcrole.Deploy, svcrole.Operate, svcrole.Admin} {
+ tok := backupsToken(t, fx.st, OpsAccountID, "elsewhere-"+string(role), "other", role)
+ status, h, body := rawReq(t, http.MethodGet, u, tok, "")
+ assertNotFound(t, string(role)+" bound to another app", nf, status, h, body)
+ }
+ // A deploy credential is never app-less: the gate's app binding is
+ // required for it at the mint.
+ if _, err := fx.st.NewServicePrincipalScoped(OpsAccountID, "loose-deploy", "", svcrole.Deploy, []string{"edge"}, nil, "paul@example.test", time.Now()); !errors.Is(err, ErrAccountScopedDeploy) {
+ t.Fatalf("app-less deploy mint = %v, want ErrAccountScopedDeploy", err)
+ }
+ otherID := testAccountID()
+ if err := fx.st.CreateAccount(otherID, accountSqid(otherID), "other-account", "sam@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := fx.st.CreateAppIn(otherID, "titogo", "sam@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ for _, role := range []svcrole.Role{svcrole.Operate, svcrole.Admin} {
+ for _, app := range []string{"", "titogo"} {
+ tok := serviceToken(t, fx.st, otherID, "foreign-"+string(role)+app, app, role)
+ status, h, body := rawReq(t, http.MethodGet, u, tok, "")
+ assertNotFound(t, "another account's "+string(role)+" (app "+app+")", nf, status, h, body)
+ }
+ }
+ if err := fx.st.AddMember(otherID, "bob@keymail.dev", RoleMember, time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ stranger := cliToken(t, fx.consoleFixture, "bob@keymail.dev", "code-backups-stranger")
+ status, h, body := rawReq(t, http.MethodGet, u, stranger, "")
+ assertNotFound(t, "another account's member", nf, status, h, body)
+}
+
+// TestAPIInstanceBackupsBadHostAndMissing: a host that cannot name a record
+// and one that names none are the instance family's byte-identical 404.
+func TestAPIInstanceBackupsBadHostAndMissing(t *testing.T) {
+ fx := dbFixture(t)
+ nf := canonicalNotFound(t)
+ for name, host := range map[string]string{
+ "bad shape": "..%2f..%2fchannels",
+ "unknown host": "nobody.go.tito.io",
+ } {
+ status, h, body := rawReq(t, http.MethodGet, backupsURL(fx.consoleFixture, "titogo", host), fx.member, "")
+ assertNotFound(t, name, nf, status, h, body)
+ }
+ if n := fx.opens.Load(); n != 0 {
+ t.Fatalf("dbReplica opened %d times for refused hosts", n)
+ }
+}
+
+// TestAPIInstanceBackupsOtherRegion: an instance homed in another region is
+// not_shown with that region's label, and `carlos db pull`'s forward for
+// the same host is still admitted (spec §1, R2-2): the door's region rule
+// is its own and never reaches db pull's path.
+func TestAPIInstanceBackupsOtherRegion(t *testing.T) {
+ fx := newDBFFixture(t, true)
+ fx.srv.dbf.pickup = 200 * time.Millisecond
+ status, _, body := rawReq(t, http.MethodGet, backupsURL(fx.consoleFixture, "shop", dbfHost), fx.member, "")
+ if status != http.StatusOK {
+ t.Fatalf("backups = %d %s", status, body)
+ }
+ var v struct {
+ Class, Reason, Region, Files string
+ }
+ if err := json.Unmarshal([]byte(body), &v); err != nil {
+ t.Fatal(err)
+ }
+ label := regionlabel.ForCode("uk", fx.srv.regionHome(), fx.srv.regionNames()).Text
+ if v.Class != "not_shown" || v.Reason != "other_region" || v.Region != label || label == "" {
+ t.Fatalf("backups = %s, want not_shown/other_region in %q", body, label)
+ }
+
+ // The list door still marks the host for forwarding...
+ status, _, body = rawReq(t, http.MethodGet, fx.listURL(), fx.member, "")
+ var mark dbdoor.ForwardBody
+ if err := json.Unmarshal([]byte(body), &mark); err != nil || status != http.StatusConflict || mark.Forward != 1 ||
+ !slices.Contains(mark.ForwardOps, dbreads.OpPull) {
+ t.Fatalf("list door = %d %s, want the forward marker offering pull", status, body)
+ }
+ // ...and the forwarded pull is admitted, not refused for residency.
+ key, err := dbreads.NewReplyKey()
+ if err != nil {
+ t.Fatal(err)
+ }
+ res := fx.openRead(t, dbfHost, fx.member, dbreads.ReadBody{Op: dbreads.OpPull, ReplyKey: dbreads.EncodeReplyKey(key.PublicKey())})
+ if res.StatusCode != http.StatusOK {
+ b, _ := io.ReadAll(res.Body)
+ res.Body.Close()
+ t.Fatalf("forwarded pull = %d %s, want admitted", res.StatusCode, b)
+ }
+ lines := readLines(t, res.Body)
+ res.Body.Close()
+ if len(lines) == 0 || lines[0].Admitted == "" {
+ t.Fatalf("forwarded pull lines %+v, want an admitted read", lines)
+ }
+}
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index 2ffec9cb0..7fe976732 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -858,6 +858,9 @@ var claimFixtures = map[string]claimFixture{
// The placements read (#447).
"route GET /api/cli/apps/{account}/{app}/domains/{host}/placements": claimRead("reads one domain claim, the edges files and the box heartbeats"),
+ // The backups door (member backups §1, #898).
+ "route GET /api/cli/apps/{account}/{app}/instances/{host}/backups": claimRead("reads the instance record and, off a host-claim console, lists its copy's files; writes nothing"),
+
"route GET /api/cli/apps/{account}/{app}/door-keys": claimRead("lists door keys"),
"route GET /api/cli/apps/{account}/{app}/edge-refs/{code}": claimRead("reads one edge record and the mesh key to verify the code"),
"route GET /api/cli/apps/{account}/{app}/email": claimRead("reads the email record"),
diff --git a/internal/console/claim_invariant_probes_read_test.go b/internal/console/claim_invariant_probes_read_test.go
index 63a954a3d..940decbd8 100644
--- a/internal/console/claim_invariant_probes_read_test.go
+++ b/internal/console/claim_invariant_probes_read_test.go
@@ -305,6 +305,8 @@ var claimReadProbes = map[string]claimProbe{
"route GET /api/cli/apps/{account}/{app}/instances": claimAPIRead(claimWorldInstance, "/api/cli/apps/bab/titogo/instances", "acme.go.tito.io"),
"route GET /api/cli/apps/{account}/{app}/instances/{host}": claimAPIRead(claimWorldInstance,
"/api/cli/apps/bab/titogo/instances/acme.go.tito.io", "acme.go.tito.io"),
+ "route GET /api/cli/apps/{account}/{app}/instances/{host}/backups": claimAPIRead(claimWorldInstance,
+ "/api/cli/apps/bab/titogo/instances/acme.go.tito.io/backups", `"class":"not_shown","reason":"pooled"`),
"route GET /api/cli/apps/{account}/{app}/instances/{host}/move": claimAPIRead(claimWorldMove,
"/api/cli/apps/bab/titogo/instances/acme.go.tito.io/move", `"state":"none"`),
"route GET /api/cli/apps/{account}/{app}/instances/{host}/rate-limit": claimAPIRead(claimWorldInstance,
diff --git a/internal/console/deploydoors_test.go b/internal/console/deploydoors_test.go
index d4eadc724..17f7bb9dc 100644
--- a/internal/console/deploydoors_test.go
+++ b/internal/console/deploydoors_test.go
@@ -33,6 +33,9 @@ var deployDoors = []string{
// #164: carlos deploy's watch through a password gate, refused per host
// outside the credential's rungs (TestAPIInstanceGatePassDeployScope).
"POST /api/cli/apps/{account}/{app}/instances/{host}/gate-pass",
+ // Member backups §1 (#898): a pipeline reads where its app's copies
+ // stand. Metadata only (TestAPIInstanceBackupsRoles).
+ "GET /api/cli/apps/{account}/{app}/instances/{host}/backups",
}
func TestDeployReachesExactlyItsDoors(t *testing.T) {
diff --git a/internal/console/linkedpolicy.go b/internal/console/linkedpolicy.go
index 943e735b7..acd1e5d4e 100644
--- a/internal/console/linkedpolicy.go
+++ b/internal/console/linkedpolicy.go
@@ -188,6 +188,7 @@ var linkedPolicies = map[string]linkedPolicy{
"POST /api/cli/apps/{account}/{app}/assets/purge": linkedRefuse,
"GET /api/cli/apps/{account}/{app}/assets": linkedRefuse,
"POST /api/cli/apps/{account}/{app}/instances/{host}/gate-pass": linkedRefuse,
+ "GET /api/cli/apps/{account}/{app}/instances/{host}/backups": linkedRefuse,
"GET /api/cli/apps/{account}/{app}/instances/{host}/move": linkedRefuse,
"GET /api/cli/apps/{account}/{app}/instances/{host}/rate-limit": linkedRefuse,
"POST /api/cli/apps/{account}/{app}/instances/{host}/move": linkedRefuse,
diff --git a/internal/console/routedecls.go b/internal/console/routedecls.go
index f2c7c4ec0..46741eed1 100644
--- a/internal/console/routedecls.go
+++ b/internal/console/routedecls.go
@@ -688,6 +688,11 @@ var routeDecls = []routeDecl{
// (a passkey or approval rung turns its promote into a proposal), and it
// cannot list instances, so `carlos deploy` never reaches this with one.
{Pattern: "POST /api/cli/apps/{account}/{app}/instances/{host}/gate-pass", Kind: kindCLI, Allow: svcrole.Allow(svcrole.Instance, svcrole.Deploy), Handler: (*Server).handleAPIInstanceGatePass},
+ // The backups door (member backups spec 2026-11-11 §1, #898): what the
+ // console knows about one instance's copy, for `carlos backups`. Read
+ // only, and no data: a member, and the deploy and operate credentials a
+ // pipeline or an operator holds (admin by Allow).
+ {Pattern: "GET /api/cli/apps/{account}/{app}/instances/{host}/backups", Kind: kindCLI, Allow: svcrole.Allow(svcrole.Deploy, svcrole.Operate), Handler: (*Server).handleAPIInstanceBackups},
// The residence-move doors (issue #331): requested by the tenant's
// ROUTER with the app-held instance token (titogo's residence design —
// never by an instance about itself... which the role system cannot yet
diff --git a/internal/console/teamdoors_test.go b/internal/console/teamdoors_test.go
index ea973e529..f1939c735 100644
--- a/internal/console/teamdoors_test.go
+++ b/internal/console/teamdoors_test.go
@@ -77,6 +77,7 @@ var teamClosed = []string{
"PUT /api/cli/apps/{account}/{app}/domains/{host}/paths",
"POST /api/cli/apps/{account}/{app}/instances/{host}/gate-pass",
"GET /api/cli/apps/{account}/{app}/instances/{host}/rate-limit",
+ "GET /api/cli/apps/{account}/{app}/instances/{host}/backups",
"GET /api/cli/apps/{account}/{app}/logs",
"GET /api/cli/apps/{account}/{app}/errors",
"GET /api/cli/apps/{account}/{app}/analytics",
diff --git a/internal/console/testdata/claim-routes.txt b/internal/console/testdata/claim-routes.txt
index be779d7ad..e676d5094 100644
--- a/internal/console/testdata/claim-routes.txt
+++ b/internal/console/testdata/claim-routes.txt
@@ -97,6 +97,7 @@ route GET /api/cli/apps/{account}/{app}/features
route GET /api/cli/apps/{account}/{app}/geo
route GET /api/cli/apps/{account}/{app}/instances
route GET /api/cli/apps/{account}/{app}/instances/{host}
+route GET /api/cli/apps/{account}/{app}/instances/{host}/backups
route GET /api/cli/apps/{account}/{app}/instances/{host}/interactive
route GET /api/cli/apps/{account}/{app}/instances/{host}/move
route GET /api/cli/apps/{account}/{app}/instances/{host}/move/offline