carlos / platform Public

Fix claimed source CI checks without changing access rules

Keep the source door's identical 404 and assert it explicitly in the
87-door service-credential walk. Register the browser download through a
named wrapper and mark the archive download as a non-screen perf route.

Restore the approved apps usage line; source pull remains on its separate
help line. Refresh the root census envelope for that help-only change.
codex agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0d64f55f561e36646be0914ced1f62e29fef937e parent 4c7668a
6 files changed, +26 −12
  • apps.go +1 −1
  • internal/console/app_source.go +4 −0
  • internal/console/server.go +1 −1
  • internal/console/svcroutes_test.go +18 −9
  • internal/console/testdata/perf-budgets.txt +1 −0
  • internal/provision/testdata/plan14-root-reads-claim-source.tsv +1 −1

CI failed — run details

Intent

Human

<paseo-system version="1" kind="agent-message" source-agent-id="32157efb-ed29-443f-b428-8c9e3320fa50" message-id="1355a8b1-0fe6-4663-a1db-69fb2f196931"> From platform-f6: Paul says remove the robot marker on this site (carlosframework.com) entirely. Switch agent-start-demo-4 to the full-removal variant (6694311 / agent-start-demo-4-norobots), including start.authorship in src/_data/start-copy.json (I&apos;ll apply Paul&apos;s homepage edits on top later). The skills-repo files under src/well-known/agent-skills stay as synced (they&apos;re a separate repo; note it for a skills change). The three changed disclosure sentences are going to Paul for OK now; don&apos;t push until he answers on them and on after-you-keep-it. </paseo-system>

Attributed to this commit: 13.9 g CO₂e (1,800,573 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on claim-source, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/apps.go b/apps.go
index a986c0853..38fd37be6 100644
--- a/apps.go
+++ b/apps.go
@@ -34,7 +34,7 @@ import (
"github.com/carlosframework/platform/internal/release"
)
-const appsUsage = `usage: carlos apps <create|place|build-probe|set|show|delete|restore|ttl|keep|list|source> [flags] <app>
+const appsUsage = `usage: carlos apps <create|place|build-probe|set|show|delete|restore|ttl|keep|list> [flags] <app>
source pull --app <app> [--account <name-or-sqid> | --account-id <sqid>] --console <origin> [--output <path>]
diff --git a/internal/console/app_source.go b/internal/console/app_source.go
index fe654201d..75ed04ad1 100644
--- a/internal/console/app_source.go
+++ b/internal/console/app_source.go
@@ -185,6 +185,10 @@ func (s *Server) sourceAdmission(next http.HandlerFunc, cli bool) http.HandlerFu
next(w, r)
}
}
+func (s *Server) handleBrowserAppSource(w http.ResponseWriter, r *http.Request) {
+ s.sourceAdmission(s.handleAppSource, false)(w, r)
+}
+
func (s *Server) handleAppSource(w http.ResponseWriter, r *http.Request) {
gate := sourceGateWriter{make(http.Header)}
actor, _, acct, _, app, ok := s.accountApp(gate, r)
diff --git a/internal/console/server.go b/internal/console/server.go
index 94ef25e75..42670a55c 100644
--- a/internal/console/server.go
+++ b/internal/console/server.go
@@ -2048,7 +2048,7 @@ func NewServer(cfg Config, st *Store) (*Server, error) {
s.registerRoute("GET /a/{sqid}/apps/new", s.handleNewAppForm)
s.registerRoute("POST /a/{sqid}/apps/new", s.handleNewApp)
s.registerRoute("POST /a/{sqid}/apps/new/region", s.handleNewAppRegion)
- s.registerRoute("GET /a/{sqid}/apps/{app}/source", s.sourceAdmission(s.handleAppSource, false))
+ s.registerRoute("GET /a/{sqid}/apps/{app}/source", s.handleBrowserAppSource)
s.registerRoute("GET /a/{sqid}/apps/{app}", s.handleApp)
s.registerRoute("GET /a/{sqid}/apps/{app}/index", s.handleAppIndex)
s.registerRoute("GET /a/{sqid}/apps/{app}/releases", s.handleAppReleases)
diff --git a/internal/console/svcroutes_test.go b/internal/console/svcroutes_test.go
index 79b81e57d..ab86d009e 100644
--- a/internal/console/svcroutes_test.go
+++ b/internal/console/svcroutes_test.go
@@ -1147,8 +1147,11 @@ func TestServiceRoleReachesTheDoorItNames(t *testing.T) {
//
// The credential holds ADMIN, the role most likely to slip through, and it is
// account-scoped so no app binding can be doing the refusing instead of the
-// role gate. Every answer must be the closed-door 403, whose body is the same
-// bytes at every door (TestClosedDoorRefusalIsItsOwnMessage).
+// role gate. Answers use the closed-door 403, whose body is constant
+// (TestClosedDoorRefusalIsItsOwnMessage), except for the claimed source door.
+// Its admission wrapper requires the same 404 for service/app credentials
+// and non-members; TestAppSourceDoors proves that no
+// storage read precedes these refusals. The walk checks its exact 404 too.
func TestEveryClosedDoorRefusesAServiceCredential(t *testing.T) {
fx := newConsoleFixture(t)
tok := serviceToken(t, fx.st, OpsAccountID, "root", "", svcrole.Admin)
@@ -1181,16 +1184,22 @@ func TestEveryClosedDoorRefusesAServiceCredential(t *testing.T) {
body = `{}`
}
status, _, out := rawReq(t, method, fx.ts.URL+u, tok, body)
- if status != http.StatusForbidden {
- t.Errorf("%s = %d %s, want the closed-door 403", pattern, status, out)
- }
- if !strings.Contains(out, "closed to service credentials") {
- t.Errorf("%s body = %s, want the closed-door refusal", pattern, out)
+ if pattern == "GET /api/cli/apps/{account}/{app}/source" {
+ if status != http.StatusNotFound || out != "404 page not found\n" {
+ t.Errorf("%s = %d %q, want the claimed source door's identical 404", pattern, status, out)
+ }
+ } else {
+ if status != http.StatusForbidden {
+ t.Errorf("%s = %d %s, want the closed-door 403", pattern, status, out)
+ }
+ if !strings.Contains(out, "closed to service credentials") {
+ t.Errorf("%s body = %s, want the closed-door refusal", pattern, out)
+ }
}
seen++
}
- if seen != len(closedDoors) || seen != 86 {
- t.Errorf("walked %d closed doors, want all %d (and 86 today: three domain purchase doors, two managed admission doors, the fleet show door, two managed configuration doors, three environment ownership doors, instance-token, three door-key doors, the routes door, the regional placements write, instances-manifest, the app update policy, sidecars-manifest, the route-channel move, three instance update settings doors, two db replica doors, the forwarded db read, seven fleets, the fleet secrets key door, four services, two email credentials, email pause, the build probe, the swap policy, the copy count, the interactive setting, the interactive session door, two app policy doors, two app region doors, the live tenancy read, the layout read, the activation-cancel door, ten system doors, three deployment-wide antivirus, the PDF status door, three platform geoip doors, two pointer digest doors, the hostname history status, the channel resign, two release authorize doors, four store-entitlement doors, two account plan doors, two billing problem doors, and the billing house door)",
+ if seen != len(closedDoors) || seen != 87 {
+ t.Errorf("walked %d closed doors, want all %d (and 87 today: three domain purchase doors, two managed admission doors, the fleet show door, two managed configuration doors, three environment ownership doors, instance-token, three door-key doors, the routes door, the regional placements write, instances-manifest, the app update policy, sidecars-manifest, the route-channel move, three instance update settings doors, two db replica doors, the forwarded db read, seven fleets, the fleet secrets key door, four services, two email credentials, email pause, the build probe, the swap policy, the copy count, the interactive setting, the interactive session door, two app policy doors, two app region doors, the live tenancy read, the layout read, the activation-cancel door, ten system doors, three deployment-wide antivirus, the PDF status door, three platform geoip doors, two pointer digest doors, the hostname history status, the channel resign, two release authorize doors, four store-entitlement doors, two account plan doors, two billing problem doors, the billing house door, and the claimed source door)",
seen, len(closedDoors))
}
}
diff --git a/internal/console/testdata/perf-budgets.txt b/internal/console/testdata/perf-budgets.txt
index 35ca3fbc7..d277fb8ba 100644
--- a/internal/console/testdata/perf-budgets.txt
+++ b/internal/console/testdata/perf-budgets.txt
@@ -35,6 +35,7 @@
GET /auth/callback skip: needs a live OAuth state and makes a token POST to Keymail
GET /auth/stepup/callback skip: needs a live OAuth state and makes a token POST to Keymail
GET /auth/cli/whoami skip: a bearer-token JSON door, not a screen; timed in production
+GET /a/{sqid}/apps/{app}/source skip: an authenticated archive download, not a screen; covered by TestAppSource
GET /fleet/protection/data skip: the operator Protection page's JSON door, not a screen; the page makes the same reads (protectionview.go)
GET /static/{hash}/{file...} skip: static asset, not a screen; consolePerfSkip leaves it unmeasured
/fleet/architecture/refresh skip: POST-only door; a GET answers 404 on its first line by design (archpage.go)
diff --git a/internal/provision/testdata/plan14-root-reads-claim-source.tsv b/internal/provision/testdata/plan14-root-reads-claim-source.tsv
index 2bcc45d5f..88bcfcb4a 100644
--- a/internal/provision/testdata/plan14-root-reads-claim-source.tsv
+++ b/internal/provision/testdata/plan14-root-reads-claim-source.tsv
@@ -7,5 +7,5 @@ apps_source.go pullAppSource legacy accepted-legacy accepted-legacy;rev3=census-
internal/demobuild/source.go validateSource legacy accepted-legacy accepted-legacy;rev3=census-ruling-claim-source;basis=Shared bounded parser accepts the same gzip framing for publish and retrieval, including FEXTRA; structural archive validation retains path, type, duplicate, expansion, framing and size checks. Publish-only forbiddenFile policy is skipped for historical downloads; publish validation remains unchanged. Existing ReadAll sites only. file:ReadAll@2025,file:ReadAll@430,file:ReadAll@733 4676f3aecb28adbda6fdb84d909ba2f5448ac3e763a9024a50afc419481d145f
@remove internal/demobuild/source.go ValidateSource
@removed internal/demobuild/source.go ValidateSource H3 census-ruling-claim-source;basis=Publication delegates to validateSource with archiveOnly=false; all publish-time file exclusions and dependency checks remain enforced. No direct reads.
-@coverage . 202c387d274562d8b7d9274012e0b448f7c34ba859f7ff9d1d9e7ae85b6e26c1
+@coverage . 53a314c86fbc8de278a574d7a54a65a01a7c85629739a50740ec5c31f1e71330
@coverage internal/demobuild 43b41e2ef861a0bced6f3cc11eaf25ae1949c8d9d8b9961ca768a2c58eeda78d