Skip to content

Kin: what to take from SPACES and Inkwell #381

Open

Description

@Surajsm60720

Kin: what to take from SPACES and Inkwell

Two of our earlier projects overlap with Kin:

  • SPACES (GLDRoger/spaces) is a fork of Docmost with agents added as workspace members.
  • Inkwell (GLDRoger/inkwell) is the hackathon notebook where agents write into live pages.

This issue proposes which of their ideas Kin should build, and asks @GLDRoger to confirm the list before any build work starts. Each item was checked against origin/kin at d3ce100d97.

Recommendation: rebuild the features in Kin, don't merge the repos

  • Neither repo can be dropped into Kin. SPACES runs on NestJS, Postgres, Redis/BullMQ and Mantine. Inkwell is a single Hono process with in-memory locks and events, web only, and built around Meta's API. Kin uses Effect, SQLite and T3's own components on web, desktop and mobile. Merging either repo would leave a third stack to maintain.
  • Licensing:
    • Inkwell is MIT, so we can lift its code freely.
    • SPACES is AGPL-3.0 (Docmost). Every commit since the fork began on 2026-10-14 is Nishchay's, so his own standalone files can be relicensed as MIT if he agrees in writing. Two things stay out of Kin either way:
      • anything that imports or derives from Docmost code, such as collaboration/services/page-timeline.service.ts;
      • packages/base-formula, which is still under the Docmost Enterprise license.

Kin already covers most of what these repos did

These need no import:

  • Docs: section-hash agent edits, per-version attribution, diff and restore (kin/work/docs.ts, docBody.ts).
  • Agent behaviour evals:
    • evals/mcp-tool-use/cases/kin.ndjson and kin-owed.ndjson, 178 cases in all;
    • replay recorders for every provider (apps/server/scripts/record-*-replay-fixture.ts, dev-replay-agent.ts).
  • Budget:
    • lead, worker and teammate units (KinBudget.ts);
    • one daily figure per org, kept by owner decision (PLAN W1-3).
  • Cards that update themselves: task cards follow the worker thread (TaskCardUpdater.ts), and KinRefreshHub.ts batches bursts of changes.
  • "What changed" for leads: a lead's prompt carries only what changed since it last spoke (work/workPrompt.ts).
  • Voice and routing: voice is W6-4, and routing to the right agent is W6-3.

Proposed: build these

Each one fills a real gap and is something the team would use every day.

# Feature Gap in Kin today Source to learn from Fits
1 Replay real lead turns in CI. Record a real lead wake-up once with T3's existing recorder, then replay it through kin/lead in tests with no paid calls. The eval cases test tool choice. Nothing replays a whole lead turn: prompt, tools, memory writes and reply. Inkwell server/demo/ shows the pattern: swap only the transport and keep the real runtime. Use T3's recorders, not Inkwell's code. Testing for every Kin PR. Cuts the cost of later paid eval runs.
2 Undo this wake-up. One tap reverts everything a single wake-up changed, across memory, docs and Work. It refuses, and says why, when someone changed the same item after the lead did. The owner can undo memory items one at a time (KinMemoryChangeCard, MemoryWriter.ts:221) and restore docs one at a time. Nothing undoes a whole turn. SPACES spaces/undo/preservation-proof.ts, safe-undo.service.ts, and their test cases. Read for the design; copy the code only if it is relicensed. Extend KinMemoryChangeCard. Daily trust in leads.
3 Pinned live cards. A card pinned to a chat header shows a value computed on every read, for example a project's open and done Work entries, or the time left to a due date or deferral. Cards update only for tasks. Nothing can be pinned, and charts are snapshots. DESIGN §7 promises pinned live widgets. Inkwell server/widgets.ts, for the idea: derived values, recomputed when sources change. Kin computes them on read instead, the same way it computes project health. Native card registry and chat header. No Money totals in groups: amounts are owner-only and sensitive.
4 Since you last looked. Opening a doc, project or Work entry shows one line, such as "Tech lead edited 2 sections, closed W-14", which expands into diffs. Leads get this already (workPrompt.ts). People get unread counts in chats, but no "last seen" for docs or Work. Inkwell src/client/map/greeting.ts An add-on to W6-2 (digests). Uses kinDocChanges.ts and pulse/.

Suggested order: 1 → 2 → 3 → 4. Item 1 is small and makes the other three safer to change. Item 2 is the one owners will feel most. None of them should jump ahead of W0–W5 (the milestone where the owner and the first teammate use Kin daily). Each item becomes its own task, with a done-when line, once it is placed in the PLAN.

References for planned work

  • Gated exits. SPACES spaces/policy/model-exit.service.ts records intent before each outbound call and never retries an unknown outcome. Reference for W7-4 and the secrets gateway in DESIGN §13.
  • Hostile-member trials. SPACES spaces/qualification/ is an acceptance harness for trials. Reference for the W5-5 checklist.
  • Friction reports. SPACES core/friction/ lets an agent record what got in its way, and the reports are rolled up. This could feed dreams and the weekly brief. Small, but not in the PLAN.
  • Photo to Work. Inkwell media/photo.ts and boxes.ts turn a photo of a whiteboard or sticky notes into separate notes. In Kin it would make draft Work entries the owner confirms. Belongs with W6-4 (images).

Proposed: skip

  • The map, footprints, walkers, pen gestures and lenses.
    • They're canvas-first and animate continuously, against T3's "no repainting animations" rule.
    • They don't work on a phone.
    • SPACES' own reviews made the map optional.
    • kin_visual and the Work screen already answer "show me where things stand".
  • Live co-editing of pages with Yjs and Tiptap, unless question 2 says otherwise. It's the core of both repos and a large surface on every client. Kin docs are written by agents and edited by section; people read, diff and restore them.
  • "Keep a doc updated" on a schedule (SPACES spaces/maintenance/). SPACES never turned it on (STEP1_RELEASE_BLOCK), and W4-3 delivers documents as PRs. Revisit after W4-3.
  • Docmost's wiki features, bring-your-own-key in the browser, Meta's model layer, and Muse Image covers. Kin's orgs, chats and the host's keys cover these, and image generation stays a §13 idea.

Questions for @GLDRoger

  1. Where do items 1–4 go? Place them in W5 and W6, or keep them out of the PLAN for now?
  2. Should people edit docs in Kin? Today they read, diff and restore. If W4-3 deliverables (launch plans, marketing copy) should be edited in Kin rather than through a PR, co-editing moves up from "skip". SPACES' rule was "edits land freely; history makes them safe".
  3. Should each lead have its own spend cap? W1-3 keeps one daily figure per org. SPACES reserved the cost of every model call against org, agent and page caps (spaces/admission/spend-reservation.service.ts). Revisit it with the teammate-cost decision due before W5-5, or leave it?
  4. Will you relicense your own SPACES files under MIT? That lets us copy preservation-proof.ts and published-price.ts instead of rewriting them. After that, should SPACES be archived?

Activity

  1. GLDRoger commented on Nov 16, 2026

    @GLDRoger
    Owner

    Ein commenting on Nishchay’s behalf.

    @Surajsm60720 Nishchay and I have now aligned on the intended scope. This proposal misses the main reason for bringing Spaces/Inkwell into Kin: the spatial workspace itself is the core feature, not something to skip.

    What to bring into Kin

    1. An Inkwell-like infinite canvas. People can freely pan and zoom around a persistent workspace, with pages/cards positioned anywhere, and navigate into those pages to work with their contents. This is a spatial way to explore and work, not just an overview diagram or another Work list. The exact transition into a page remains an implementation/design choice; seamless zoom directly into an editor has not been specified.
    2. Live, source-linked widgets on that canvas. Cards should reflect the underlying Kin information as it changes and let people reach the source. Pinning a computed card to a chat header alone does not fulfil this requirement.
    3. “Since you last looked” and “Needs you.” On returning, people should see what changed and what needs their attention, with actionable links into the relevant content. Use Inkwell as the spatial reference and Spaces’ richer attention summary as a reference for this part, rather than reducing it to unread counts or agent-only prompt deltas.
    4. Agent activity visible in the workspace. Make it clear where agents are working and what they have changed, connected to the relevant pages/cards. This does not mandate continuously animated walkers, footprints, or other decorative effects.

    How to approach it

    Please use Inkwell interactively before revising the plan: move around the canvas, open pages, inspect its widgets, and return to its change/attention surfaces. Compare the corresponding Spaces experience as well. The goal is to preserve the useful product experience, not necessarily its current implementation.

    A wholesale repository merge is not required. Adapting or rebuilding the selected features on Kin’s stack is fine. Phone usability and performance constraints should shape controls, rendering and presentation, not be used to remove the core canvas experience. An interaction-driven pan/zoom surface is not the same requirement as continuous ambient animation.

    CI replay and whole-wake undo may be useful supporting work, but they are not the requested outcome and should not displace it. Please revise this issue’s scope and priorities around canvas → live widgets → return/attention experience, with clear acceptance criteria and any actual design tradeoffs called out. Keep unrelated imports and optional visual flourishes separate.

  2. Surajsm60720 commented on Nov 16, 2026

    @Surajsm60720
    CollaboratorAuthor

    @GLDRoger, Ein: agreed, and thanks. The canvas is the feature. I've now used the live Inkwell app (the recorded demo plus my own notebook, on desktop and at phone width) and read SPACES' architecture. Below is what I learned and the scope I'd revise this issue to. I'd like your go-ahead on it before the issue body is rewritten.

    Nothing was built or changed. I sent no agent requests to the live app, so no API spend.

    What Inkwell gets right

    The canvas isn't a picture of the work. It's where you delegate the work and watch it get done. Every agent action leaves a visible mark on a place you can return to.

    • Pages are cards. Cards sit in labelled groups (a trip, a launch plan) and are joined by link lines. Semantic zoom shows titles at overview, and an excerpt plus "Last edited by Atlas · 2m ago" up close. A minimap, a "Show the whole map" control and keyboard pan and zoom keep you oriented.
    • Peek, then open. One click opens a live editor beside the map, with its own "Saved" state (a bottom sheet on phones). Double-click opens the full page, with breadcrumbs, "Ask an agent", "On the map" and "Add a page inside". Returning puts you back where you were (/?focus=<id>).
    • Delegation happens in the context you're looking at. The Diary opens scoped to the page ("About Packing & logistics ×") with suggested requests: Summarise, Tighten, Link related pages. "Who answers" is Any agent or a named role. ⌘K mixes jump-to-page, "Show on the map", "Ask an agent: …" and "New page called …" in one box. The pen circles cards to scope the next request.
    • You can see what agents are doing:
      • a chip row: "Wren · working in Trip to Lisbon", "Atlas · resting at Startup: launch plan";
      • the agent's token on the card it's touching;
      • "Being written now" on that card, and "Atlas is writing here" with a named caret in the open page;
      • a reply that ends with "What Atlas did · 9 steps", which you can expand;
      • handoffs between agents (Scout found the decision, then Wren drafted the post).
    • Live widgets sit on the canvas as cards: a countdown ("17 days"), "Launch progress 6 of 13" counted from the checklists on the source pages, and "Lisbon budget €1,087 across 7 items". They update when a source page changes, with no agent turn.
    • Lens: a question rearranges the canvas. "What's left before we launch?" puts the relevant cards into Done, In progress and To do columns, each with a one-line reason and the widgets beside them. A banner reads "Arranged by Atlas · Back to map", and the stored layout never moves.
    • Coming back. "Good afternoon. Wren, Scout and Atlas worked on 13 pages just now." It's driven by a per-browser last-seen time.
    • Phone. The same canvas, with 44-pt controls, the pen and zoom at the bottom, and peek as a sheet. "Show the whole map" reflows the groups to fit the narrow screen.

    How this maps onto Kin

    Inkwell Kin
    Page card Kin objects: Work entries, docs, projects, clients, worker threads and PRs. Groups are projects.
    Diary scoped to a page, or circled cards A message to the lead, with those cards attached as context
    Scout, Wren, Atlas Leads and their workers. The floor and the lead decide who answers, not verb routing.
    "Being written now", "working in X" Wake-up and worker state (TaskCardUpdater already tracks workers)
    Widgets recomputed from source pages Computed from Work entries, doc checklists and due dates, pushed by KinRefreshHub
    Lens Done / In progress / To do Mostly free: Work already has open, doing, waiting, done and dropped
    Photo to cards Photo to draft Work entries, which the owner confirms
    Greeting since last visit A per-person cursor on the server, so it works across devices

    What SPACES' architecture contributes

    We reuse its designs, not its code. Most of its guarantees live in Postgres (triggers, repeatable-read snapshots, advisory locks), BullMQ and Redis, and Nest. It's also AGPL. Even files only Nishchay wrote import Docmost code (for example space-map.repo.ts → PagePermissionRepo). Inkwell's map code is the better source for the canvas itself.

    Worth adopting:

    1. A per-viewer graph read. SPACES builds the set of cards a person may see before applying any cap, so hidden cards can't leak through counts or link lines (core/space-map/space-map.service.ts, space-map.repo.ts). Kin needs the same: one canvas read filtered by Kin's viewer rules, so a member never sees a money or private card or its edges.
    2. Attributing every change. SPACES records actor kind, actor and run on each revision. Kin docs already carry by / wakeupId / chatId per version, so "what agents changed" and "since you last looked" come from versions newer than the person's cursor, grouped by actor. That's cheap, and it needs no Yjs update log.
    3. "Needs you" items (spaces/inbox/). Each has one primary action, links to the exact card, run or revision, and clears itself when its condition clears. Dismiss and snooze are per person. It would build on Kin's Waiting on you and pulse, keyed to cards so the canvas can highlight them.
    4. Re-checking the ceiling on every agent write and every live connection, not only when the run starts (agent-run-access.service.ts). This is Kin's provenance ceiling, applied to each canvas write.
    5. Replay as a pure client function over the activity list (space-map/model.ts: buckets, glow, trails). It shows where agents went without a stored animation.

    Not worth adopting:

    • a layout derived only from the page tree (it contradicts "cards anywhere");
    • polling every 15 s and 5 s;
    • the Yjs update log and undo-safety proof, for now;
    • Postgres triggers, Redis leases and Nest adapters;
    • last-seen kept in the browser's localStorage.

    Proposed scope: canvas → live widgets → return and attention

    1. Canvas (web, desktop and mobile)

    • Kin has a Canvas beside Chats and Work. It shows every Work entry, doc and project the viewer may read as cards, grouped by project, with link lines.
    • Pan and zoom by drag, pinch and wheel, plus keyboard on web. A minimap and "show everything" are always available. Overview shows titles; closer shows an excerpt, the owner, the state and "last changed by X · time".
    • Tap opens a peek (side panel on desktop, sheet on phone). Open goes to the existing Kin screen, and Back returns to the same camera.
    • People drag cards, and positions persist per org across devices. New items get a free slot near their project.
    • Select or circle cards, then Ask: a message goes to the chosen lead with those cards attached.
    • A member never sees a card, count or link line they can't read (a test per role). Money and sensitive cards follow Kin's existing rules.
    • Performance: hundreds of cards stay smooth on an iPhone, nothing repaints while idle, and reduced motion is honoured.

    2. Live, source-linked widgets

    • Widget kinds:
      • progress: Work entries done of total, or a doc's checklist;
      • countdown: to a due date or deferral;
      • total: owner-only;
      • facts.
    • Every widget names its sources. Tapping one highlights or opens them.
    • Values are recomputed by server code when a source changes, with no model turn. A deleted source updates the widget instead of breaking it.
    • A lens: a question produces an arrangement such as Done / In progress / To do, "Back to map" returns, and the stored layout doesn't move.

    3. Return and attention, plus agent activity

    • On return, one line says what changed since you last looked, using a server-side cursor that follows you across devices. Changed cards are marked, and each change links to its diff.
    • "Needs you" lists approvals, entries waiting on you, overdue items and failed workers. Each has one main action and the card it belongs to. Items clear when resolved, and dismiss and snooze are per person.
    • While a lead or worker runs, its chip and the card it's on show it ("Tech lead · working in W-14", "being changed now"). Afterwards the card says who changed it, with a link to the run. Movement is driven by events only; nothing animates while idle.

    Kept separate: CI replay, undo for a whole wake-up, photo to Work, covers, pen link and strike gestures, and walkers and footprints.

    Design trade-offs to decide

    1. Are cards Kin objects, or editable pages? Inkwell's pages are live Tiptap docs people type into. Kin docs are written by agents and edited by section, and people read, diff and restore them. Building the canvas over Kin objects ships far sooner. Making cards co-editable (Yjs plus safe undo) is the single biggest cost here, so I'd decide it separately.
    2. The mobile renderer. Inkwell uses DOM cards under one CSS transform. The React Native app needs its own approach (a gesture-driven transform, possibly Skia for very large canvases), with the same model shared through packages/client-runtime.
    3. One layout per org, or per person? I propose a shared layout per org, with each person's camera kept separately.
    4. Who can move or arrange cards, and whether a lead's lens can be saved as a view.
    5. Real-time delivery. I'd add a canvas topic on KinRefreshHub for card changes, plus a separate short-lived presence stream for agent position, so nothing is polled and it works over Tailscale and the tunnel.

    If this scope works for you, I'll rewrite the issue body to match.

  3. Surajsm60720 commented on Nov 18, 2026

    @Surajsm60720
    CollaboratorAuthor

    The canvas from this scope is up for review in #496. It covers the first three steps we agreed:

    • The canvas: tasks and docs grouped by project, arranged by the owner and co-owner, on web, desktop, iOS and Android.
    • Live widgets: progress, a countdown and "at a glance", counted by Kin as their source changes.
    • Return and attention: "since you last looked", a Needs you panel, and agent activity on the cards an agent is working on, with "Ask an agent" drafting the card into that agent's chat.

    I tested it in an isolated seeded Kin, on web as the owner, co-owner and members, and on the iOS simulator. Screenshots are in the PR. @GLDRoger, Ein: a review when you have time.

    🤖 Generated with Claude Code

  4. Surajsm60720 commented on Nov 23, 2026

    @Surajsm60720
    CollaboratorAuthor

    @GLDRoger, Ein: an update on the canvas, after talking it through with Nishchay. It is narrower than the 16 Nov scope, on purpose, and #496 now holds this version.

    What we agreed: the canvas is a calm, well-designed view of what's being worked on, the way Inkwell shows its pages. Zooming into a doc opens it inside Kin. It doesn't get its own page in the tab bar, because the iOS tab bar is already full.

    What it is now: a second view of Docs, List | Map. On web, List | Map sits in the Docs header. On the phone, it's a Map button in the Docs toolbar. There's no sixth tab, server code, stream or migration.

    Taken from Inkwell

    • Groups as places. Each project, client and the company's own docs is an area, holding its tasks and docs. An area where an agent is working right now comes first. Kin lays the areas out the same way every time.
    • Semantic zoom. Zoomed out, you see coloured dots by state. Further in come titles, then cards with their holder and latest change. Closest in, a doc's card shows its opening text: the three docs nearest the middle of the screen, read on demand.
    • Read in place, then open. A tap opens the doc or task over the map (a side panel on web, a sheet on phone). Open goes to its full page, and Back returns to the same spot on the map.
    • Agent work is visible. A task an agent is working on now (KinRecord.working) is marked on its card and its area.
    • Keeping it fast at scale. Like Inkwell, the camera runs outside React and offscreen cards aren't drawn. Measured on web with 300 open tasks and 100 docs, panning and zooming ran about 2,600 frames at p95 18 ms, none over 34 ms. Switching to All open costs 17 KB compressed.

    Left out from the 16 Nov scope

    • Free placement and arranging. Nothing is stored and nobody drags, so there's no layout to share, authorise or conflict over.
    • Live widgets (progress, countdown, "at a glance"), "since you last looked", the Needs you panel and Ask an agent from a card. Ask already lives on task and project pages (feat(kin): ask an agent about a task or project #559). Each can come back later with its own written scope if we miss it.

    SPACES

    Nothing from SPACES is in this change. The SPACES items in the issue body (agents as workspace members, docs) stand as written.

    Nishchay's three questions on #496

    1. One layout per company or per person? Neither is stored. The layout follows from the projects, so it's the same for everyone.
    2. Who may arrange? Nobody, since there is no drag.
    3. What may a lens save? There is no lens. The only choice is "In progress" or "All open".

    The #496 findings

    • Gone with the code: 1 (open stream), 3 (migration), 5 (two arrangers), 6 (since watermark), 9 (widgets and places), 11 (holder lens). The Map reads only through the Work and Docs reads and live updates the rest of Kin uses. So a removal, revocation or demotion ends what it shows, just as it does for Tasks and Docs.
    • Fixed: 4 (it reads at most 300 tasks and 400 docs, filtered on the host, and says where it stops), 8 ("working" is Kin's own flag), 10 (the phone re-culls while panning) and 12.
    • Not applicable now: 7.

    A fresh review model also went over the rework. It found eight problems; seven are fixed and the eighth checked out in the browser. Among the fixes: switching views blanked the map, a failed read showed nothing, the phone read every doc body at the closest zoom, and the Map sent reads for screens the viewer can't open.

    If this narrower scope matches what you both want, I'll rewrite the issue body to match.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions