oficina / base Public
Base First Slice Implementation Plan
> For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.
Goal: A team signs in to Base, invites a teammate, and installs and uninstalls real apps (Welcome and Scratchpad) on Base's own Platform account; installed apps know who the person is.
Architecture: One Go module holds three binaries:
base: the front door.scratchpadandwelcome: two tiny apps installed through Base.
Base talks to Platform through a narrow platform.Client. Installing means writing an instance's config environment and then creating the instance. Identity flows by Base minting rastrillo/assertion tokens, using the handoff flow designed for Oficina home. Every installed app verifies them through one shared consumer package.
Tech Stack: Go (GOTOOLCHAIN=go1.26.10, CGO_ENABLED=0), amadan.net/rastrillo/rastrillo v0.33.0 (auth, passkey, sessions, csrf, migrate, mail, assertion, crypto, assets, harness), chi, SQLite.
Spec: docs/superpowers/specs/2026-11-06-base-first-slice-design.md. The visual reference is .superpowers/mockups/index.html, which is git-ignored and published at https://base-first-slice.docs-t1.dev.platform.tito.io.
Global Constraints
- Module and layout: module path
amadan.net/oficina/base. Copy equipo's boot shape (oficina/equipo/cmd/equipo/main.go:26-55):rastrillo.Resolve→db.Open→ app →rastrillo.Serve. Routes use chi. - Pages work with scripts off (app spec 12.5): - Every write is a plain
<form method="post">answered with a 303. - Scripts aredeferadd-ons. - Anything that waits uses a<noscript>meta refresh. - Not an operating system (spec 18.2): no windows, title bars or window controls. Opening an app is a normal link to its origin.
- Assertions: - Signed with
rastrillo/assertion(P-256), withiss= Base origin andaud= the installed instance's origin. - Lifetime 120 s. -kid= lowercase hex SHA-256 ofKeypair.SignPub()(65 bytes). -Extcarries display fields only. - Origins must behttps://hostnames; the verifier rejects IP addresses. - Shared app contract: every app Base installs reads exactly these four variables. Nothing in Base is specific to Scratchpad. -
BASE_APP_ORIGIN-BASE_APP_ISSUER-BASE_APP_CONSUMER_ID-BASE_APP_KEYS(base64 of a JSON object mapping eachkidto the base64 of its 65-byte public key) - Platform: - Two service credentials, because a credential holds one role: -
BASE_PLATFORM_INSTANCE_TOKEN(roleinstance) -BASE_PLATFORM_OPERATE_TOKEN(roleoperate) - Both are account-wide (no--app). Header:Authorization: Bearer <token>. - Never callinstances-manifest; an operator enables each catalogue app once (spec 5.6). - Instance hosts: - Each is
<BASE_SLUG>-<appid>.<BASE_APPS_DOMAIN>: one DNS label, at most 32 characters, matching[a-z0-9]([a-z0-9-]*[a-z0-9])?. - The instance's config environment has the same name as the label. - Look (spec 6): - Approved colours:
#2FC6C0,#8B5CF6,#F472B6,#6EE7DC; glass tintrgba(14,17,42,.40); secondary text#DDE3F0. - Fog loops of 10–17 s; everything stops underprefers-reduced-motion. - Controls are 44px tall. - Timeless Sans only:STYL100 for body text, 0 for headings and the wordmark. Preloaded withfont-display: block. - WCAG AA contrast. - Timeless font: never committed.
hack/fonts.shfetcheshttps://media.timeless.co/type/Timeless-Type-Family-1.094.zip, checks SHA-256510685dfce6010b74a1a250af7de1204e1b9901be152a39f5dd6be85fc6d6084, and extractsSans-Grotesk/TimelessSansVF.woff2. The fallback is DM Sans (OFL, committed), with metrics matched as in ppl. - Copy (exact strings the spec fixes): - Uninstall confirmation: "Uninstall {App}? It's removed from Home for everyone at {Base name}. Its data is kept, and comes back if you install it again." - Steps: "Signed in", "Invite your team", "Install your first app". - Invited state: "Invited. Hasn't signed in yet." - All new user-facing copy goes through the copy-review skill before it lands.
- Commits: subject under 80 characters, a body after a blank line, and the trailer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. Work on branchfirst-slice, notmain. - Servers you start for local checks: bind them to
127.0.0.1only, and share them withcarlos devbox share --port, which also supplies the HTTPS origins assertions need.
Review Focus
- A replayed or late assertion: posting the same assertion twice, or posting it after 120 s, must not sign anyone in. Test:
TestAssertionReplayRefused,TestAssertionExpiredRefused(Task 9). - Install pressed twice, or in two tabs: this must create one instance, not two and not an error. Test:
TestInstallTwiceIsOneInstance(Task 6). - An install that fails halfway: config written but the create refused, or an instance that never answers. The app must show as failed with a retry, never as a tile that leads nowhere. Test:
TestInstallCreateRefusedMarksFailed,TestInstallNeverAnswersMarksFailed(Task 6). - Someone who shouldn't get an assertion asks for one: a signed-in person who has been removed, a request for an app that isn't installed, or an unknown consumer. They must be refused without an assertion. Test:
TestAuthorizeRefusals(Task 8). - Inviting an existing address in different case (
Maria@Acme.covsmaria@acme.co): this must not create a second member. Test:TestInviteIsCaseInsensitive(Task 4).
---
File map
cmd/base/main.go boot Base
cmd/scratchpad/main.go boot Scratchpad
cmd/welcome/main.go boot Welcome
internal/config/config.go Base settings from the environment
internal/store/ migrations, members, installs, owner bootstrap
internal/look/ layout, CSS, fonts handler, shared template funcs
internal/web/ Base routes and handlers (signin, home, people, store, settings)
internal/catalog/ catalog.json (embedded) and its type
internal/platform/ Client interface, HTTP client, Fake
internal/install/ Installer: install, uninstall, readiness, first-boot Welcome
internal/issuer/ /authorize: mints assertions for installed apps
internal/consumer/ shared app side: start, assertion, finish, sessions, replay store
internal/scratchpad/ Scratchpad's notes page
internal/welcome/ Welcome's page
hack/fonts.sh fetch Timeless (pinned)
scripts/prepare-apps.sh operator: create, ship and enable each catalogue app once
Makefile, run.sh, .env.local.example, README.mdTask 1: Skeleton, config, store and owner bootstrap
Files:
- Create:
go.mod,Makefile,run.sh,.env.local.example,cmd/base/main.go,internal/config/config.go,internal/store/{migrations.go,migrations/0001_base.sql,members.go,installs.go,bootstrap.go} - Modify:
.gitignore(add/.env.local,/.local/,*.db*,/releases/,internal/look/static/fonts/timeless/) - Test:
internal/config/config_test.go,internal/store/store_test.go
Interfaces:
- Produces: -
config.Load(getenv func(string) string) (config.Config, error).Confighas these fields: -Origin,Name,Slug,Owner,AppsDomain,Timezone *time.Location-PlatformConsole,PlatformAccount,InstanceToken,OperateToken-AssertionKey *crypto.Keypair-AllowLoggedMail bool- Environment variables, all prefixedBASE_:ORIGIN,NAME,SLUG,OWNER,APPS_DOMAIN,TIMEZONE(defaultEurope/London),PLATFORM_CONSOLE,PLATFORM_ACCOUNT,PLATFORM_INSTANCE_TOKEN,PLATFORM_OPERATE_TOKEN,ASSERTION_KEY(base64 ofcrypto.MarshalKeypair),ALLOW_LOGGED_MAIL. -store.Schema, andstore.BootSchema = migrate.Merge(sessions.Schema, auth.Schema, pow.Schema, store.Schema). -store.Member{ID, Email, Name string; Role string /* "owner"|"member" */; InvitedAt time.Time; JoinedAt *time.Time}, plus: -store.Members(ctx, db) ([]Member, error)-store.MemberByEmail(ctx, db, email) (Member, bool, error)-store.Invite(ctx, db, email string) (Member, bool /*created*/, error)-store.MarkJoined(ctx, db, id string) error-store.Bootstrap(ctx, db, ownerEmail string) error: seeds the owner only when there are no members. -store.Install{App, Host, State string /* "installing"|"installed"|"failed" */; Error string; UpdatedAt time.Time}, plus: -store.Installs(ctx, db) ([]Install, error)-store.ClaimInstall(ctx, db, app, host string) (bool, error): true only for the caller that moves the app intoinstalling. -store.SetInstallState(ctx, db, app, state, errMsg string) error-store.DeleteInstall(ctx, db, app string) error
- [ ] Step 1: Write failing tests. -
TestLoadRequiresOriginAndOwner: a missingBASE_ORIGINorBASE_OWNERgives an error naming the variable. -TestLoadRefusesLoggedMailOffLoopback:BASE_ALLOW_LOGGED_MAIL=1with a non-loopback origin gives an error. -TestSlugMakesLegalHosts: a slug that would make a label over 32 characters, or with illegal characters, is refused. -TestBootstrapSeedsOwnerOnce: the first call gives one member with roleowner; a second call with a different email leaves one member. -TestClaimInstallOnlyOnce: two claims on the same app givetrue, thenfalse. - [ ] Step 2: Run
go test ./internal/... -run 'TestLoad|TestSlug|TestBootstrap|TestClaim'. Expected: FAIL (packages missing). - [ ] Step 3: Implement the code above. The member
IDisassertion.RandomID(). It becomes the assertionsub, so it is never the email.Makefilecopies equipo's targets:ci,test(rastrillo budget test -count=1 ./...) andreleasebuilding all three binaries.run.shcopies equipo's, withBASE_*names. - [ ] Step 4: Run the same tests. Expected: PASS. Also run
go vet ./.... - [ ] Step 5: Commit: "Add Base skeleton, config and member store".
Task 2: The look: layout, CSS and fonts
Files:
- Create: -
internal/look/look.go-internal/look/templates/layout.html-internal/look/static/app.css-internal/look/static/fonts/dm-sans/4.004/DMSans-VF.woff2(copy from~/amadan.net/ppl/ppl/.claude/worktrees/profile-instance/internal/ppl/static/fonts/dm-sans/4.004/, withOFL.txt) -internal/look/static/fonts/timeless/.keep-hack/fonts.sh - Test:
internal/look/look_test.go
Interfaces:
- Produces: -
look.Assets(arastrillo.NewAssetsover the embeddedstatic). -look.FontHandler() http.Handler, mounted atGET /static/fonts/withCache-Control: public, max-age=31536000, immutable. -look.Page(w http.ResponseWriter, name string, data any) error: renderslayout.htmlwith one page template. Every Task 3–7 page uses it. - Layout blocks:title,main. The layout carries the atmosphere:.light, plus.fogwith four<i>.
- [ ] Step 1: Write failing tests. -
TestLayoutPreloadsTimeless: the rendered layout contains<link rel="preload" href="/static/fonts/timeless/1.094/TimelessSansVF.woff2" as="font" type="font/woff2" crossorigin>. -TestFontsImmutable: the DM Sans path answers 200 with the immutable header. A missing Timeless file answers 404. -TestLayoutHasNoRequiredScript: every<script>in the layout hasdefer, and the page has no inlineonclick. - [ ] Step 2: Run
go test ./internal/look/. Expected: FAIL. - [ ] Step 3: Implement. Port
app.cssfrom the mockup's<style>: - Keep the tokens, glass, fog paths, light sway, tiles and controls. - Drop the mockup-only.page,.row,figureandfigcaptionrules. - Add the@font-faceblocks:Timeless Sanswithfont-display: block, and theDM Sansfallback withsize-adjust: 98%andascent-override: 98.3%, as ppl'sapp.css:59-75does. -hack/fonts.shdownloads the zip, checks the SHA-256, extracts intointernal/look/static/fonts/timeless/1.094/, and exits non-zero on a mismatch. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Add Base layout, glass styles and fonts".
Task 3: Sign in, sign out and the member gate
Files:
- Create:
internal/web/app.go,internal/web/signin.go,internal/web/templates/{signin.html,confirm.html} - Modify:
cmd/base/main.go - Test:
internal/webtest/harness_test.go,internal/webtest/signin_test.go
Interfaces:
- Consumes:
config.Config,store.*,look.Page. - Produces: -
web.App(db *sql.DB, cfg config.Config, mailer mail.Sender, inst Installer, logger *slog.Logger) (http.Handler, error). - The Installer interface (implemented in Task 6):type Installer interface { Install(ctx context.Context, app string) error; Uninstall(ctx context.Context, app string) error }. -web.CurrentMember(r *http.Request) (store.Member, bool). - The test harnessnewApp(t) *testApp, withget,post(setsOrigin),signIn(email)andmailbox(), copied from equipo'sinternal/equipotest/harness_test.go. - Until Task 6 lands,mainand the harness pass a no-opInstaller.
- [ ] Step 1: Write failing tests. -
TestOwnerCanSignIn: the bootstrapped owner gets a link in the mailbox; following it reaches/with 200. -TestStrangerRefused: an address that is neither owner nor invited gets no session. The page says sign-in isn't available for that address; the wording goes through copy-review. -TestInvitedMemberJoinsOnFirstSignIn: after signing in,JoinedAtis set. -TestSignOut: after a POST to/auth/signout,/redirects to/signin. - [ ] Step 2: Run
go test ./internal/webtest/ -run 'TestOwner|TestStranger|TestInvited|TestSignOut'. Expected: FAIL. - [ ] Step 3: Implement by copying equipo's
setup/session_handlers.go:32-63: -auth.NewwithKeymailServers: []string{"keymail.dev"},SigninScreen: true,BeginPath: "/auth/begin", andpow.NoProof. - TheAuthorizecallback callsstore.MemberByEmailand marks the member joined. - Wrap every browser route incsrf.Protect. - Mail comes frommail.FromEnv("CARLOS", logger), as in equipo'sconfig.go:39-44. Boot is refused without it unlessAllowLoggedMailis set. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Sign in to Base with email or Keymail".
Task 4: People and invites
Files:
- Create:
internal/web/people.go,internal/web/templates/people.html - Test:
internal/webtest/people_test.go
Interfaces:
- Consumes:
store.Invite,store.Members,web.CurrentMember.
- [ ] Step 1: Write failing tests. -
TestOwnerInvites: a POST to/peoplewithemail=maria@acme.coadds a row showing "Invited. Hasn't signed in yet." and puts one invitation in the mailbox. The invitation links toBASE_ORIGIN/signin. -TestInviteIsCaseInsensitive: invitingMaria@Acme.coaftermaria@acme.coleaves one member and sends no second invitation. -TestMemberCannotInvite: a non-owner's POST gets 403. -TestPeopleWorksWithoutScripts: the page's form posts to/peopleand the reply is a 303. - [ ] Step 2: Run
go test ./internal/webtest/ -run 'TestOwnerInvites|TestInvite|TestMemberCannot|TestPeople'. Expected: FAIL. - [ ] Step 3: Implement. Lowercase and trim the email before
store.Invite. Run the invitation copy through copy-review. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Invite teammates to Base".
Task 5: Catalogue and Platform client
Files:
- Create:
internal/catalog/{catalog.go,catalog.json},internal/platform/{client.go,http.go,fake.go} - Test:
internal/catalog/catalog_test.go,internal/platform/http_test.go
Interfaces:
- Produces: -
catalog.Entry{ID, Name, Summary, Tint string /* "amber"|"teal"|"violet"|"mist"|"rose" */; Icon string; Default bool}, withcatalog.All() []Entryandcatalog.Get(id string) (Entry, bool). -catalog.jsonlistswelcome(Default true, amber) andscratchpad(rose). - Theplatform.Clientinterface: -SetEnv(ctx context.Context, app, environment string, vars map[string]string) error-CreateInstance(ctx context.Context, app, host, environment string) error: a 409 counts as success. -DeleteInstance(ctx context.Context, app, host string) error-platform.NewHTTP(console, account, instanceToken, operateToken string, hc *http.Client) platform.Client. -platform.Fake: records calls, can be told to fail a given call, and implementsClient.
- [ ] Step 1: Write failing tests against an
httptest.Serverthat records requests. -TestSetEnvShape:PUT {console}/api/cli/apps/{account}/{app}/configwith the operate token and body{"environment":E,"message":"Base: install","set":{K:{"kind":"env","value":V}}}. -TestCreateInstanceShape:POST .../instanceswith the instance token and body{"host":H,"environment":E,"message":"Base: install"}. A 201 or a 409 is success. -TestDeleteInstanceShape:DELETE .../instances/{host}withX-Carlos-Message: Base: uninstall. -TestErrorsCarryStatusNotBody: a 403 gives an error naming the call and the status, without the response body. -TestCatalogIDsAreLabels: every ID is a legal label part. - [ ] Step 2: Run
go test ./internal/catalog/ ./internal/platform/. Expected: FAIL. - [ ] Step 3: Implement. Endpoints and bodies follow
carlos/platform/internal/console/apiinstances.go:608-683,1476-1537andapiconfig.go:279-304. Base sets onlykind: "env", because nothing it sends is secret, so no sealing is needed. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Add the catalogue and a Platform client".
Task 6: Installer
Files:
- Create:
internal/install/install.go - Test:
internal/install/install_test.go
Interfaces:
- Consumes:
platform.Client,catalog.Get, thestoreinstall functions,config.Config. - Produces: -
install.New(db *sql.DB, cfg config.Config, pc platform.Client, probe func(ctx context.Context, origin string) error, logger *slog.Logger) *install.Installer, which implementsweb.Installer. -install.HostFor(cfg config.Config, app string) (label, host string). -install.ProbeVersion(hc *http.Client) func(ctx, origin) error: pollsGET {origin}/api/versionevery 2 s until it gets a 200, giving up after 5 minutes. -(*Installer).EnsureDefaults(ctx) error: installs everyDefaultentry that isn't installed. Called once frommainat boot, in the background. -install.AppVars(cfg config.Config, app, origin string) map[string]string: the fourBASE_APP_*values.
- [ ] Step 1: Write failing tests using
platform.Fakeand a probe stub. -TestInstallWritesEnvThenCreates:SetEnvis called with exactlyBASE_APP_ORIGIN=https://acme-scratchpad.bab.oncarlos.com,BASE_APP_ISSUER=<cfg.Origin>,BASE_APP_CONSUMER_ID=scratchpadandBASE_APP_KEYS=<base64 JSON {kid: base64 SignPub}>. ThenCreateInstanceis called with the same label as environment. Then the state isinstalled. -TestInstallTwiceIsOneInstance: two concurrentInstallcalls make oneCreateInstancecall. -TestInstallCreateRefusedMarksFailed: the Fake fails the create. The state becomesfailedwith an error message, and a laterInstallretries. -TestInstallNeverAnswersMarksFailed: the probe returns a timeout, and the state becomesfailed. -TestUninstallDeletesInstanceKeepsNothingInBase:DeleteInstanceis called with the host, and the install row is gone. -TestEnsureDefaultsInstallsWelcomeOnce. - [ ] Step 2: Run
go test ./internal/install/. Expected: FAIL. - [ ] Step 3: Implement. -
Install: claim the app (store.ClaimInstall), thenSetEnv, thenCreateInstance, then the probe, then mark itinstalled, orfailedwith a short message that holds no response body. - Thekidis the lowercase hex SHA-256 ofcfg.AssertionKey.SignPub(). - Install runs in a goroutine started by the handler; the request doesn't wait for it. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Install and uninstall apps on Base's account".
Task 7: Home, Store and Settings pages
Files:
- Create:
internal/web/{home.go,store.go,settings.go},internal/web/templates/{home.html,store.html,uninstall.html,settings.html} - Test:
internal/webtest/home_test.go,internal/webtest/store_test.go
Interfaces:
- Consumes:
web.Installer,store.Installs,catalog.All,install.HostFor.
- [ ] Step 1: Write failing tests. -
TestHomeGreetsByTimeOfDay: with a fixed clock at 09:00 inEurope/London, the page shows "Good morning, Paul." The name is the member'sName, or else the email's local part capitalised. -TestHomeSteps: a fresh Base shows "Signed in" done and the other two steps not done. After an invitation and an installed non-default app, all three are done. -TestHomeTilesLinkToOrigins: eachinstalledapp's tile is<a href="https://acme-scratchpad.bab.oncarlos.com/">with its tint class. Apps stillinstallingorfailedshow no tile. -TestStoreInstallButtonPostsAndRedirects: an owner's POST to/store/scratchpad/installcallsInstaller.Installand answers 303 to/store. -TestStoreShowsInstallingWithRefresh: while an app isinstalling, the page has<noscript><meta http-equiv="refresh" content="2"></noscript>and the button is disabled. -TestStoreShowsFailedWithRetry. -TestUninstallNeedsConfirm:GET /store/scratchpad/uninstallshows the exact confirmation copy from Global Constraints. Only aPOSTuninstalls. -TestMemberSeesStoreButCannotInstall: there's no install button for a member, and their POST gets 403. - [ ] Step 2: Run
go test ./internal/webtest/ -run 'TestHome|TestStore|TestUninstall|TestMember'. Expected: FAIL. - [ ] Step 3: Implement against the mockup's markup and classes. "Ask Base anything" is drawn but inert: a disabled field with a
titlesaying it arrives later. Settings shows the Base name, the signed-in address and Sign out. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Add Home, Store and Settings".
Task 8: Issuer: assertions for installed apps
Files:
- Create:
internal/issuer/issuer.go,internal/issuer/templates/handoff.html - Modify:
internal/web/app.go(mountGET /authorizebehindRequireSession) - Test:
internal/issuer/issuer_test.go
Interfaces:
- Consumes:
web.CurrentMember,store.Installs,install.HostFor,cfg.AssertionKey. - Produces: -
GET /authorize?consumer=<app>&nonce=<n>rendershandoff.html: a form that POSTs a fieldassertionto{aud}/auth/assertion, with a Continue button and a deferred script that submits it. - The claims: -iss= Base origin,aud= the app's origin,sub=Member.ID. -nonce= the request's nonce;jti=assertion.RandomID(). -iat= now,exp= now + 120,auth_time= the session's sign-in time. -Ext={"name":…, "email":…, "base":cfg.Name}.
- [ ] Step 1: Write failing tests. -
TestAuthorizeSignsForInstalledApp: a verifier built withassertion.NewVerifier(base, app, keys)accepts the posted token.aud,subandnoncematch. -TestAuthorizeRefusals, a table test. Each case gets 4xx and no assertion in the body: - no session: redirect to sign-in - unknown consumer - consumer known but notinstalled- missing or malformed nonce - member removed after signing in - [ ] Step 2: Run
go test ./internal/issuer/. Expected: FAIL. - [ ] Step 3: Implement with
assertion.Sign(cfg.AssertionKey, claims). The handoff page setsCache-Control: no-store. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Issue identity assertions to installed apps".
Task 9: Consumer package, Scratchpad and Welcome
Files:
- Create: -
internal/consumer/{consumer.go,migrations/0001_consumer.sql}-internal/scratchpad/{scratchpad.go,templates/notes.html,migrations/0001_notes.sql}-internal/welcome/{welcome.go,templates/welcome.html}-cmd/scratchpad/main.go,cmd/welcome/main.go - Test:
internal/consumer/consumer_test.go,internal/scratchpad/scratchpad_test.go,internal/e2e/handoff_test.go
Interfaces:
- Produces: -
consumer.Load(getenv) (consumer.Config, error): reads the fourBASE_APP_*variables and builds theassertion.Verifier. -consumer.Mount(r chi.Router, db *sql.DB, cfg consumer.Config, sess *sessions.Manager), which mounts: 1.GET /auth/start?return_to=: sets a__Host-base-pendingcookie holding the nonce, then 303 to{issuer}/authorize?consumer=…&nonce=…. 2.POST /auth/assertion: requiresOriginto equal the issuer, verifies the token, stores it pending, then 303 to/auth/finish. 3.GET /auth/finish: compares the nonce withsubtle.ConstantTimeCompare, atomically consumes the pending row and records thejti, then starts the session. -consumer.Require(next http.Handler) http.Handler: an unauthenticated request redirects to/auth/start. -consumer.Person(r) (sub, name, base string, ok bool). - Lifetimes: pending 600 s, inbox 120 s, as in home'shandoff/store.go:40-48.
- [ ] Step 1: Write failing tests. -
TestHandoffEndToEnd(ininternal/e2e): seed Scratchpad asinstalledwithstore.ClaimInstallandstore.SetInstallState, then build the Base app (Task 3 harness) and the Scratchpad app in-process. Base's origin ishttps://base.testand Scratchpad's ishttps://acme-scratchpad.test; requests use thoseHostvalues. A cookie jar shared per origin drives start, authorize, assertion and finish. Scratchpad's page then shows "Signed in as Paul, Acme Ltd". -TestAssertionReplayRefused: posting the same assertion a second time gives no session. -TestAssertionExpiredRefused: verifying atiat + 121gives no session. -TestAssertionWrongOriginRefused: a POST withOriginother than the issuer gets 403. -TestSessionOutlivesBase: after the handoff, Base's handler is replaced with one that always gives 503. Scratchpad's/still answers 200 for the signed-in person. -TestNotesSharedAcrossMembers: two people's sessions see the same notepad text after one saves. - [ ] Step 2: Run
go test ./internal/consumer/ ./internal/scratchpad/ ./internal/e2e/. Expected: FAIL. - [ ] Step 3: Implement. - Scratchpad is one page with a
<textarea>form that saves the shared note, plus the signed-in line. - Scratchpad's access rule (spec 1.7: the app decides): anyone the configured Base vouches for may read and write. Say so in a code comment and in its README section. - Welcome is one page: a greeting, the Base name, and a link back to Home. - Both use thelookpackage, so they share the atmosphere. - [ ] Step 4: Run the tests again. Expected: PASS.
- [ ] Step 5: Commit: "Add the consumer side, Scratchpad and Welcome".
Task 10: Passkeys on Base sign-in
Files:
- Modify:
internal/web/signin.go,internal/web/templates/signin.html,internal/store/migrations/(add passkey schema viapasskey.SchemainBootSchema) - Test:
internal/webtest/passkey_browser_test.go(//go:build browser)
Interfaces:
- Consumes:
rastrillo/passkey:New,DiscoverBegin/DiscoverFinish,RegisterBegin/RegisterFinish,JS(). Wiring follows rastrillo'sskill/signin.md("Sign-in screen") anddocs/site/passkeys.md.
- [ ] Step 1: Write a failing browser test.
TestPasskeyRegisterThenSignIn, usingrastrillo/harnesswith a virtual authenticator: 1. The owner signs in by email. 2. They add a passkey from Settings. 3. They sign out. 4. They sign in with "Use a passkey". - [ ] Step 2: Run
RASTRILLO_CHROME=$(which chromium) go test -tags browser ./internal/webtest/ -run TestPasskey. Expected: FAIL. - [ ] Step 3: Implement. With scripts off, the passkey button is hidden and email sign-in still works.
- [ ] Step 4: Run the test again. Expected: PASS. Also run the non-browser suite.
- [ ] Step 5: Commit: "Sign in to Base with a passkey".
Task 11: Release, operator script and live check
Files:
- Create:
scripts/prepare-apps.sh,README.md - Modify:
Makefile(release buildsbase,scratchpadandwelcomefor linux/arm64)
- [ ] Step 1: Write
scripts/prepare-apps.sh <account> <release-dir>. For each catalogue ID it runs: 1.carlos apps create2.carlos deploy --app <id> --account <account> --channel stablewith the binary 3.carlos instances enable --app <id>
It stops on the first failure. Re-running it is safe: steps that are already done are skipped.
- [ ] Step 2: Write the README with humane-docs: what Base is, local run (
run.shpluscarlos devbox share --portfor HTTPS origins), deploying, the operator's one-time steps, and the fourBASE_APP_*variables an app must read. - [ ] Step 3: Run
make ci. Expected: PASS. Run the browser suite once. - [ ] Step 4: Live check on a flagship account Paul names (never on
main's behalf without asking): 1. Deploy Base to theedgechannel. 2. Runprepare-apps.sh. 3. Sign in as owner and invite a second address. 4. Install Scratchpad, open it, and confirm "Signed in as". 5. Write a note, uninstall, then install again. Confirm the note is back. This settles the spec 5.6 question about the parked database. If the note is gone, file the Platform request from spec section 9; don't work around it. 6. Record the results indocs/live-check.md. - [ ] Step 5: Commit: "Add release, operator script and README".