oficina / home Public

Clone
git clone https://amadan.net/oficina/home

Plain git — no account needed to clone.

Download

Download this file

1# Selected-team dashboard
2
3Status: product direction recorded from Paul, 2026-10-24. Implementation proposal;
4not shipped. Independently reviewed and approved as a proposal by GPT-6 (Codex,
5inherited session model; exact variant not exposed), 2026-10-24. Review confirmed
6selected-team scope, omission of todos, and the source assertions below. The
7credential protocol and provider endpoints remain implementation prerequisites
8requiring their own review. Base: Home origin/main at ba81936.
9
10## Product decision
11
12After signing in to oficina.works, show a consolidated dashboard for the selected
13team, including the app launcher and recent work across that team's Oficina apps.
14Paul explicitly chose **only the selected team**, not a combined personal feed
15across teams. Switching teams switches every dashboard section together.
16
17This extends the front-door activity design of 2026-09-05: the app list remains,
18but documents and the calendar become the primary reason to visit Home. Paul
19subsequently clarified that no task support exists today and todos should be left
20out for now; Calendar is a possible future owner, not part of this delivery.
21It does not change the team boundary or move ownership of content into Home.
22
23## Page
24
25Use the existing Oficina chrome and Calma appearance. The heading names the
26selected team and exposes a team switcher. Preserve a compact list of apps near
27the top; recent work occupies most of the page rather than another full tile grid.
28
29- **Recent documents:** one list across Docs, Sheets, Slides, and other participating
30 document apps. Each row has a title, app/type, last-updated time, and a direct
31 link. One row per object, newest updated first; repeated edits do not crowd out
32 other documents. Initially show 20, with links to each app's full list and a
33 clear indication when more items exist. This is recent accessible work, not a
34 claim to record which documents the viewer personally opened.
35- **Calendar:** today's remaining events and the next seven days, in chronological
36 order, with event time, calendar, and a direct link. Preserve all-day dates and
37 use the viewer's chosen timezone for timed events. This is an agenda, not a list
38 sorted by event-edit time.
39
40On narrow screens stack recent documents and the agenda. Navigation,
41team selection, refresh, and item links must work without JavaScript. Use native
42links, headings, lists, and machine-readable time elements.
43
44A successful empty answer says that section has no matching items. An unavailable
45source says which app could not load and offers refresh/open-app navigation.
46Do not claim "no documents" or "nothing scheduled" when a provider
47has not answered. Do not infer support from a 404 or show invented example data
48in the live dashboard. Unsupported sections explain availability without claiming
49an integration exists.
50
51## Implementation evidence and dependencies
52
53The existing signed-in route in `internal/home/directory.go` renders only
54`directoryCatalog`; there is no aggregation handler. `directorydata.Store.Choices`
55provides current member/team/app destinations; it is not a document authorization
56check and is not the personal guest directory described in the older design.
57
58The 2026-09-05 activity spec remains the starting point for response bounds,
59per-person authorization, safe links, partial failures, and memory-only content.
60Its authentication assumptions cannot be copied into code unchanged:
61
62- `internal/home/runtime.go` runs separate credential and directory roles.
63 Directory startup rejects `HOME_ASSERTION_KEY`, and `newDirectory` rejects a
64 signer. The old spec's single-process minting assumption is not the shipped
65 architecture.
66- Current minting uses the assertion library's configured P-256 keypair, not the
67 older spec's stated Ed25519 algorithm.
68- The app sources inspected expose their own document/event lists, but no shipped
69 implementation of the spec's `/activity` endpoint was found in those checkouts.
70 Their latest remote branches must be fetched before implementation work.
71- No Todos repository/task provider was found in the workspace search. The local
72 Calendar importer explicitly skips VTODO. Paul confirmed that no task support
73 exists and explicitly deferred todos. No task provider is required for this
74 delivery, and no empty Todos section should be rendered.
75
76Before wiring live aggregation, specify and independently review a read-only,
77person-bound credential flow compatible with the separated roles. It must bind
78the authenticated person, selected team, destination and read purpose, resist
79replay, and have explicit expiry/revocation behavior. A caller-supplied subject
80plus a service secret is not sufficient. Do not give Directory the credential
81signing key or reuse login assertions without deciding their replay boundary.
82This proposal deliberately does not claim that missing protocol is implemented.
83
84## Data and loading contract
85
86Sources authorize each item for the authenticated viewer in the selected team.
87Home never infers item access from team membership. Guest visibility requires a
88real viewer-specific source directory before it can be advertised as supported.
89Preview origins must have explicit viewer/team mapping before they participate;
90operator configuration alone is not proof of a person's access.
91
92Use separate typed results for recent objects and upcoming event occurrences. The
93existing change-event shape alone cannot describe recurrence, all-day events, or
94stable object deduplication.
95Define a versioned extension and fixtures before provider implementation, with
96stable source-scoped object IDs, safe source-owned URLs, and bounded fields.
97Deduplicate documents by source and object ID; preserve distinct recurrence
98occurrences in the agenda. Keep source truncation visible.
99
100Fan out only to the selected team's viewer-authorized participating sources.
101Bound total render time, response bytes, item counts, and process-wide parallel
102requests. Never follow redirects. Validate source URLs and escape titles. Return
103private no-store responses at the app, Home, and edge. Preserve the prior spec's
104named partial-failure states and bounded per-person/source RAM cache rules.
105Content, titles, event details and deep links must not enter Home's
106database, on-disk caches, logs, metrics or error strings. Revalidate the selected
107team and source access on each request; clear/partition cached results on team or
108person changes and respect the hard maximum age after failed pulls.
109
110## Delivery and acceptance
111
1121. Settle the credential protocol and typed response fixtures. Review amendments
113 to the older activity spec and the suite contract.
1142. Implement authorized source endpoints in document apps and Calendar. Keep
115 capability flags disabled until endpoints and their authorization tests are
116 deployed.
1173. Add the selected-team dashboard renderer, compact app launcher, merger, agenda,
118 source availability states, and bounded client. Select only among the viewer's
119 current teams; preserve the choice through refresh and app navigation. Invalid
120 or removed teams must never fall back to showing another team's content.
1214. Exercise two people and two teams, including unauthorized items, removal of
122 membership, source timeout, 404, malformed/oversized data, redirect, truncation,
123 expired credentials and cache expiry. Verify privacy gates on database/WAL and
124 logs. Exercise timezone, all-day and recurring events and
125 duplicate document edits. Run with JavaScript disabled.
1265. Review the complete change on a deployed canary, check CI, and follow the
127 repository's branch/discussion/review requirements before merging or shipping.
128
129The acceptance case is concrete: signing in with a selected team presents its
130real recent documents, upcoming events, and app links; switching to another team
131replaces all of that data. A failed provider leaves the rest of the dashboard usable and identifies the missing part.
132A launcher with empty placeholder sections does not meet this acceptance case.
133
134## Implementation amendment, 2026-10-25
135
136Paul authorized build, review and deployment. GPT-6 independently reviewed the
137credential protocol and pilot mapping below before implementation.
138
139Directory starts a bounded browser-bound pending request carrying the current
140session digest, actual subject, selected team and pinned source set. Credential
141reads its own session and signs one 120-second, single-use token per source under
142`oficina/dashboard/read/v1`, separate from login assertions. Claims bind issuer,
143source audience, Directory recipient, subject, team, purpose, nonce and jti. A
144fixed-origin form returns the batch; Directory validates it against pending state
145and its current session before consuming the pending request and pulling. Sources
146consume replay IDs durably before resolving existing accounts and item access.
147No signing key moves into Directory, and no service accepts a supplied subject
148as proof of identity. Fresh uncached pulls require a new browser round trip.
149
150The live apex sources are explicitly assigned to one pilot team grouping. This
151is navigation configuration, not roster-established membership: no owner/member
152claim, inferred identity link, provisioning or roster write follows from it. Each
153provider independently resolves an existing Home link, rechecks current local
154admission, and uses its usual item scope. A failed link is not an empty success.
155Each origin belongs to exactly one grouping and verifies that configured team.
156Only the selected grouping is pulled; failure never selects another grouping.
157This pilot exception supersedes the draft's requirement for a preexisting Home
158roster for these sources. The reviewer withdrew that prerequisite after checking
159the actual source authorization boundary; no item access follows from grouping.
160
161The implementation uses a 30-second refresh TTL and 120-second absolute maximum
162for RAM-only results, with bounded entry count and expiry sweeps on each request.
163Every cache key includes session digest, subject, team and source configuration;
164sign-out loses access to that key. Existing short-lived bearer tokens can still
165be spent once until expiry. Source unlink and permission changes are enforced on
166each new pull; displayed cached content has the explicit bounded staleness above.
167