The artifacts plan records what Phase 2 decided: old pages dropped with no redirect, migration 0005 for Editors can share and once-a-day access requests (Phase 7's drop migration becomes 0006), folio_page and peek reads, posting to make one, the viewer's days on Home, the write-up's Where, the agents' choices, and what is left for later phases.
1 file+32−20/1 viewed
| 207 | 207 | CREATE VIRTUAL TABLE folio_chunks_fts USING fts5 (chunk_id UNINDEXED, scope UNINDEXED, folio_id UNINDEXED, heading, text, tokenize = 'unicode61 remove_diacritics 2'); | |
| 208 | 208 | ``` | |
| 209 | 209 | ||
| 210 | − | `repo_spaces`, `repo_files`, `repo_files_fts`, the `doc_chunks` rows for repository files, `doc_embed_usage` and `doc_index_runs` are kept: projects' docs stay a read-only source in Artifacts. In Phase 7, migration `0005_drop_pages.sql` drops `pages`, `page_*`, `favorites`, `suggestions`, `templates`, `files`, `pages_fts`, `citations`, `page_changes` and the page rows of `doc_chunks`. It runs only after no deployed code reads them. | |
| 210 | + | `repo_spaces`, `repo_files`, `repo_files_fts`, the `doc_chunks` rows for repository files, `doc_embed_usage` and `doc_index_runs` are kept: projects' docs stay a read-only source in Artifacts. In Phase 7, migration `0006_drop_pages.sql` drops `pages`, `page_*`, `favorites`, `suggestions`, `templates`, `files`, `pages_fts`, `citations`, `page_changes` and the page rows of `doc_chunks`. It runs only after no deployed code reads them. | |
| 211 | 211 | ||
| 212 | 212 | ### 2.3 Access code | |
| 213 | 213 | ||
| ⋯ | |||
| 735 | 735 | | 5b | **Dashboards** | L | `components/charts/` (extracted from usage.tsx; usage pages switched to it), `kinds/dashboard.ts`, grid editor, query builder, `query_tile` with cache, the `query_data` agent tool, 4 templates, "Beta" badge, apps/docs `guides/artifacts-dashboards.md`. | 2, 5a (each dataset lights up as its service ships) | | |
| 736 | 736 | | 6a | **Design: canvas core** | L | `kinds/design.ts`, SVG renderer, tools, select, snap, layers and properties, frames with stack layout, images, awareness cursors, comments pinned, export SVG/PNG, agent `upsert_nodes`. | 2 | | |
| 737 | 737 | | 6b | **Design: components and HTML frames** | M | Components and instances, `html` nodes in the usercontent sandbox (with server sanitizer), design templates (4), apps/docs `guides/artifacts-design.md`. | 6a | | |
| 738 | − | | 7 | **Cleanup** | S | Migration `0005_drop_pages.sql`; DO migration v3 `deleted_classes: ["PageRoom"]`; remove the legacy RPC methods, `DocPage*` contracts, `doc.page.*` from `events.ts`, `events.rs` and `subscribers.rs`, `components/docs/*` and `routes/workspace/docs/*` leftovers; delete Vectorize `g1t-docs`; rewrite docs/WORKSPACE.md "Docs" to point here. Ships only after 2, 3 and the agents switch have been deployed everywhere. | 2, 3 | | |
| 738 | + | | 7 | **Cleanup** | S | Migration `0006_drop_pages.sql`; DO migration v3 `deleted_classes: ["PageRoom"]`; remove the legacy RPC methods, `DocPage*` contracts, `doc.page.*` from `events.ts`, `events.rs` and `subscribers.rs`, `components/docs/*` and `routes/workspace/docs/*` leftovers; delete Vectorize `g1t-docs`; rewrite docs/WORKSPACE.md "Docs" to point here. Ships only after 2, 3 and the agents switch have been deployed everywhere. | 2, 3 | | |
| 739 | 739 | | 8 | **Later** | — | Public links (usercontent origin, workspace setting, `view` only); server PDF and thumbnails through the `Renderer` adapter (og `Screenshots`); imports (Markdown folders, a deck file); `folio.*` events offered to webhooks; a documenter agent routine on `folio.stale`; dashboard alerts. | — | | |
| 740 | 740 | ||
| 741 | 741 | ### Parallel worktrees and file ownership | |
| ⋯ | |||
| 879 | 879 | ||
| 880 | 880 | --- | |
| 881 | 881 | ||
| 882 | + | ## 12. Decided in Phase 2 | |
| 883 | + | ||
| 884 | + | Phase 2 shipped the Artifacts mode in `apps/web`, switched `services/agents` to the folio RPCs, and replaced apps/docs `guides/docs.mdx` with `guides/artifacts.mdx`. Where the plan was open, the build settled these: | |
| 885 | + | ||
| 886 | + | - **Old pages (D2): dropped.** Nothing copies them. The web no longer reads pages, and agents no longer call the page RPCs; the tables, `PageRoom` and the legacy methods stay until Phase 7. `-/docs` routes are gone with no redirect and answer the normal not-found page. Spaces are shared, so the web still uses the legacy space methods (`space`, `create_space`, `update_space`, `set_space_member`) and projects' docs (`add_repo_space`, `repo_page`), whose file links now point at `-/artifacts/repo/...`. | |
| 887 | + | - **Migration `0005_space_sharing_and_access_requests.sql`.** It adds `spaces.editors_can_share` (default 0) and `folio_access_requests`. Phase 7's drop migration becomes `0006_drop_pages.sql`. | |
| 888 | + | - **"Editors can share" (D7).** A switch in a space's settings, off by default. When on, an editor of something in the space can grant and change grants up to `edit`. Granting `manage`, changing a grant that is `manage`, general access, `inherit` and `agent_mode` stay with full access. `DocSpace` and `NewDocSpace` gained `editors_can_share`. | |
| 889 | + | - **Access requests.** At most one per person per folio per 24 hours (`claimAccessRequest`, one upsert, tested over the migrations); a second ask answers `conflict` with "You already asked for access to this in the last day…". It still goes to at most 20 people. | |
| 890 | + | - **Two contract additions.** | |
| 891 | + | - `folio_page` (`FolioPage`): the folio, its saved text for the read view, the readable docs above it, what's inside and what links to it, and open suggestions, in one call. It records the visit, like `folio`. Added to `FOLIO_RPC_METHODS` in TS and Rust. | |
| 892 | + | - `folio(..., { peek: true })`: a read that records no visit and doesn't find trashed folios, for chat's link cards. A card never makes a link folio readable. | |
| 893 | + | - **Addresses (D4).** `/-/artifacts/<title-slug>-<id>`, renamed slugs redirect to the current one; spaces at `/-/artifacts/spaces/<slug>`, history at `<folio>/history`. A folio someone can't read, or that doesn't exist, shows "You need access" (status 403) with **Ask for access**. | |
| 894 | + | - **Making one.** `new/:kind` makes a folio only on a POST (forms on the tiles, templates and space pages), so a prefetched or repeated link never does. Kinds not ready answer 404 there. Tiles for Slides, Design and Dashboard are disabled with a `Hint` ("… are coming soon"). | |
| 895 | + | - **Home.** Days are the viewer's: the browser's zone, remembered in the `g1t_tz` cookie so the server renders the same days. Instead of up to three avatars, a row shows a lock (only you), a globe (workspace), a link (link access) or a people count, because `Folio` carries `shared_count`, not who. Someone else's folio in no space shows its owner's name, not "Private". The owner filter takes a username. "Possibly out of date" filters the 100 most recently edited by `stale`; a person-level stale list RPC would be exact. | |
| 896 | + | - **Editor shell.** `components/folios/kinds.tsx` registers each kind on one line, with a lazy `Body`; only the doc's is set. The BlockNote editor stays browser-only inside the doc body, and Home's chunks carry no editor code. Covers aren't offered, because `Folio` has no `cover`; "Describes" and the staleness detail of Docs' pages aren't either (a doc shows "Possibly out of date" with **It's current**). | |
| 897 | + | - **Write-up (4.4).** Kind fixed to a doc. Where is "Shared with this conversation" (DMs and private channels, chosen first), "Private (just me)", or a space in the sidebar the person can add to; a public channel starts on General when they can add to it. The ask reads `@g1t write this thread up as an artifact (a doc) <where> titled "<title>". Link this thread as the source: <link>`, where `<where>` is `in the <name> space`, `privately (just for me)` or `shared with this conversation`. | |
| 898 | + | - **Agents.** | |
| 899 | + | - `list_spaces` uses the legacy `spaces_for_agent`. | |
| 900 | + | - `read_artifact` holds back content and title when `audience_can_read` is false, and DMs the asker the link. | |
| 901 | + | - After such a read, `remember` stores at the asker's `person` scope (4.3 rule 7). | |
| 902 | + | - `query_data` is left to Phase 5b. | |
| 903 | + | - **Command palette.** No "Artifacts" group yet (plan section 5); Home's search covers it. | |
| 904 | + | ||
| 905 | + | Open for later phases: | |
| 906 | + | - **A spaces-for-person RPC.** Browse spaces reads the legacy `sidebar`, and the write-up offers only sidebar spaces. A folio-side `spaces` method that returns every readable space would serve both, and Phase 3's slug lookup. | |
| 907 | + | - **Who it's shared with.** Avatars on rows need the grants' principals on `Folio` (a few, capped), or a batch access call. | |
| 908 | + | - **Phone tab.** As with Docs, Artifacts is a tab only for members without Code; others reach it from the workspace sheet. | |
| 909 | + | ||
| 910 | + | --- | |
| 911 | + | ||
| 882 | 912 | ## 13. Decided in Phase 3 | |
| 883 | 913 | ||
| 884 | 914 | Phase 3 shipped the external API in `apps/api` (`src/folios.rs`, the `artifact` tool, 17 routes) over a `DOCS` binding to `g1t-docs-service`, and made the `artifacts:*` scopes real. Where the plan was open, the build settled these: | |