| 1 | # Selected-team dashboard |
| 2 | |
| 3 | Status: product direction recorded from Paul, 2026-10-24. Implementation proposal; |
| 4 | not shipped. Independently reviewed and approved as a proposal by GPT-6 (Codex, |
| 5 | inherited session model; exact variant not exposed), 2026-10-24. Review confirmed |
| 6 | selected-team scope, omission of todos, and the source assertions below. The |
| 7 | credential protocol and provider endpoints remain implementation prerequisites |
| 8 | requiring their own review. Base: Home origin/main at ba81936. |
| 9 | |
| 10 | ## Product decision |
| 11 | |
| 12 | After signing in to oficina.works, show a consolidated dashboard for the selected |
| 13 | team, including the app launcher and recent work across that team's Oficina apps. |
| 14 | Paul explicitly chose **only the selected team**, not a combined personal feed |
| 15 | across teams. Switching teams switches every dashboard section together. |
| 16 | |
| 17 | This extends the front-door activity design of 2026-09-05: the app list remains, |
| 18 | but documents and the calendar become the primary reason to visit Home. Paul |
| 19 | subsequently clarified that no task support exists today and todos should be left |
| 20 | out for now; Calendar is a possible future owner, not part of this delivery. |
| 21 | It does not change the team boundary or move ownership of content into Home. |
| 22 | |
| 23 | ## Page |
| 24 | |
| 25 | Use the existing Oficina chrome and Calma appearance. The heading names the |
| 26 | selected team and exposes a team switcher. Preserve a compact list of apps near |
| 27 | the 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 | |
| 40 | On narrow screens stack recent documents and the agenda. Navigation, |
| 41 | team selection, refresh, and item links must work without JavaScript. Use native |
| 42 | links, headings, lists, and machine-readable time elements. |
| 43 | |
| 44 | A successful empty answer says that section has no matching items. An unavailable |
| 45 | source says which app could not load and offers refresh/open-app navigation. |
| 46 | Do not claim "no documents" or "nothing scheduled" when a provider |
| 47 | has not answered. Do not infer support from a 404 or show invented example data |
| 48 | in the live dashboard. Unsupported sections explain availability without claiming |
| 49 | an integration exists. |
| 50 | |
| 51 | ## Implementation evidence and dependencies |
| 52 | |
| 53 | The existing signed-in route in `internal/home/directory.go` renders only |
| 54 | `directoryCatalog`; there is no aggregation handler. `directorydata.Store.Choices` |
| 55 | provides current member/team/app destinations; it is not a document authorization |
| 56 | check and is not the personal guest directory described in the older design. |
| 57 | |
| 58 | The 2026-09-05 activity spec remains the starting point for response bounds, |
| 59 | per-person authorization, safe links, partial failures, and memory-only content. |
| 60 | Its 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 | |
| 76 | Before wiring live aggregation, specify and independently review a read-only, |
| 77 | person-bound credential flow compatible with the separated roles. It must bind |
| 78 | the authenticated person, selected team, destination and read purpose, resist |
| 79 | replay, and have explicit expiry/revocation behavior. A caller-supplied subject |
| 80 | plus a service secret is not sufficient. Do not give Directory the credential |
| 81 | signing key or reuse login assertions without deciding their replay boundary. |
| 82 | This proposal deliberately does not claim that missing protocol is implemented. |
| 83 | |
| 84 | ## Data and loading contract |
| 85 | |
| 86 | Sources authorize each item for the authenticated viewer in the selected team. |
| 87 | Home never infers item access from team membership. Guest visibility requires a |
| 88 | real viewer-specific source directory before it can be advertised as supported. |
| 89 | Preview origins must have explicit viewer/team mapping before they participate; |
| 90 | operator configuration alone is not proof of a person's access. |
| 91 | |
| 92 | Use separate typed results for recent objects and upcoming event occurrences. The |
| 93 | existing change-event shape alone cannot describe recurrence, all-day events, or |
| 94 | stable object deduplication. |
| 95 | Define a versioned extension and fixtures before provider implementation, with |
| 96 | stable source-scoped object IDs, safe source-owned URLs, and bounded fields. |
| 97 | Deduplicate documents by source and object ID; preserve distinct recurrence |
| 98 | occurrences in the agenda. Keep source truncation visible. |
| 99 | |
| 100 | Fan out only to the selected team's viewer-authorized participating sources. |
| 101 | Bound total render time, response bytes, item counts, and process-wide parallel |
| 102 | requests. Never follow redirects. Validate source URLs and escape titles. Return |
| 103 | private no-store responses at the app, Home, and edge. Preserve the prior spec's |
| 104 | named partial-failure states and bounded per-person/source RAM cache rules. |
| 105 | Content, titles, event details and deep links must not enter Home's |
| 106 | database, on-disk caches, logs, metrics or error strings. Revalidate the selected |
| 107 | team and source access on each request; clear/partition cached results on team or |
| 108 | person changes and respect the hard maximum age after failed pulls. |
| 109 | |
| 110 | ## Delivery and acceptance |
| 111 | |
| 112 | 1. Settle the credential protocol and typed response fixtures. Review amendments |
| 113 | to the older activity spec and the suite contract. |
| 114 | 2. Implement authorized source endpoints in document apps and Calendar. Keep |
| 115 | capability flags disabled until endpoints and their authorization tests are |
| 116 | deployed. |
| 117 | 3. 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. |
| 121 | 4. 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. |
| 126 | 5. 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 | |
| 129 | The acceptance case is concrete: signing in with a selected team presents its |
| 130 | real recent documents, upcoming events, and app links; switching to another team |
| 131 | replaces all of that data. A failed provider leaves the rest of the dashboard usable and identifies the missing part. |
| 132 | A launcher with empty placeholder sections does not meet this acceptance case. |
| 133 | |
| 134 | ## Implementation amendment, 2026-10-25 |
| 135 | |
| 136 | Paul authorized build, review and deployment. GPT-6 independently reviewed the |
| 137 | credential protocol and pilot mapping below before implementation. |
| 138 | |
| 139 | Directory starts a bounded browser-bound pending request carrying the current |
| 140 | session digest, actual subject, selected team and pinned source set. Credential |
| 141 | reads 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, |
| 143 | source audience, Directory recipient, subject, team, purpose, nonce and jti. A |
| 144 | fixed-origin form returns the batch; Directory validates it against pending state |
| 145 | and its current session before consuming the pending request and pulling. Sources |
| 146 | consume replay IDs durably before resolving existing accounts and item access. |
| 147 | No signing key moves into Directory, and no service accepts a supplied subject |
| 148 | as proof of identity. Fresh uncached pulls require a new browser round trip. |
| 149 | |
| 150 | The live apex sources are explicitly assigned to one pilot team grouping. This |
| 151 | is navigation configuration, not roster-established membership: no owner/member |
| 152 | claim, inferred identity link, provisioning or roster write follows from it. Each |
| 153 | provider independently resolves an existing Home link, rechecks current local |
| 154 | admission, and uses its usual item scope. A failed link is not an empty success. |
| 155 | Each origin belongs to exactly one grouping and verifies that configured team. |
| 156 | Only the selected grouping is pulled; failure never selects another grouping. |
| 157 | This pilot exception supersedes the draft's requirement for a preexisting Home |
| 158 | roster for these sources. The reviewer withdrew that prerequisite after checking |
| 159 | the actual source authorization boundary; no item access follows from grouping. |
| 160 | |
| 161 | The implementation uses a 30-second refresh TTL and 120-second absolute maximum |
| 162 | for RAM-only results, with bounded entry count and expiry sweeps on each request. |
| 163 | Every cache key includes session digest, subject, team and source configuration; |
| 164 | sign-out loses access to that key. Existing short-lived bearer tokens can still |
| 165 | be spent once until expiry. Source unlink and permission changes are enforced on |
| 166 | each new pull; displayed cached content has the explicit bounded staleness above. |
| 167 | |