Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/changelog/2026-12-04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 4 December 2026 — Agents never own rooms, and legacy agent-owned canvases recover

An agent (`isocan identity --session` or proxy session claim) creating a
canvas left `project.createdBy` stamped with the agent's own actor ID. On a
hosted home like `isocan.corp.goog`, the browser badge held the person's own
actor and verified email rather than the proxy agent's claim — so setting
the link to `read` swept the human down to read-only, locked the Share dialog
out, and `namesTheCreator` refused an explicit owner grant because it treated
the creator as already owning the canvas by right.

Ownership is now human-only, and existing agent-owned canvases resolve back to
their person:

- **Server enforcement (`AGENT_OWNER` / `agent-owner`):** `project.create`
(`Engine.submit` and `createProject`), `POST /api/spaces`, and
`POST /api/groups` refuse actors classified as `"agent"` in `actorKinds`.
- **Client owner resolution (`resolveOwnerActor`):** `@isocan/api` (`ctx.ts`
directory binding/creation), `@isocan/cli` (room, space, group, and mutating
share commands via `ownerCtx`), and `@isocan/voice-agent` (`POST /canvas/create`
and `project_create`) resolve the badge's human actor (`home:person`, another
person-harness claim, or `~/.isocan/identity.json` reclaimed under
`home:person`) before creating or administering ownership.
- **Recovery and floor fixes:** `admittingGrant` and `heldRung` share
`claimsCanvasCreator` (via `CreatorOwnership`), recognizing the human who
`ownsAgent` a legacy agent `createdBy`; `admittingGrant` checks the
creator/space floor before returning any grant below `edit`; `ws.ts` and
`GET /api/projects/:id/canvas` elevate capability to `own` for legacy
agent-owned canvases owned by the caller's person; and `namesTheCreator`
returns `false` when `createdBy` is an agent so explicit email grants remain
issuable.

Also landed today on `main`:

- **Embedded mode & navigation:** Web app preserves `?embed=1&chat=0` across
client-side navigation, emits `isocan:active-canvas` (`ed7626e51`), moves
the home `TopNav` inline to top-left without the redundant wordmark
(`7a69801ba`), and cleans a literal canvas path from a `panels.ts` comment
(`07b41dd56`).
- **CI & daily reviews:** Fixed `catalog-budget` test guards and closed
`2026-11-30` reviewer findings (`af779e65d`), merged daily persona runs
(`d09ea404f`), and synced the `2026-11-29` changelog (`ec7f423d2`).
1 change: 1 addition & 0 deletions docs/changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ screen per day, one row per week, open to anyone with the address.

| Day | | What happened |
| --- | --- | --- |
| **[4 Dec](2026-12-04.md)** | Agents never own rooms, and legacy agent-owned canvases recover | Refused agent actors on `project.create`, spaces, and groups (`agent-owner`); resolved the human owner in `@isocan/api`, `@isocan/cli`, and `@isocan/voice-agent`; and fixed `admittingGrant`/`heldRung`/`namesTheCreator` so legacy agent-created canvases resolve `own` back to the human who owns the agent. Also preserved `?embed=1&chat=0` across web navigation and moved home `TopNav` inline. |
| **[29 Nov](2026-11-29.md)** | *Draft* | Not written up yet: the day's commits, quoted in full. Whoever writes the entry replaces this row. |
| **[28 Nov](2026-11-28.md)** | *Draft* | Not written up yet: the day's commits, quoted in full. Whoever writes the entry replaces this row. |
| **[27 Nov](2026-11-27.md)** | *Draft* | Not written up yet: the day's commits, quoted in full. Whoever writes the entry replaces this row. |
Expand Down
1 change: 1 addition & 0 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const {
requireIdentity,
resolveExplicitIdentity,
resolveIdentity,
resolveOwnerActor,
resolved,
retireStrandedIdentities,
writeIdentity,
Expand Down
13 changes: 9 additions & 4 deletions packages/api/src/ctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
requireIdentity,
resolveExplicitIdentity,
resolveIdentity,
resolveOwnerActor,
reclaimIdentity,
retireStrandedIdentities,
type ExplicitIdentity,
Expand Down Expand Up @@ -808,7 +809,8 @@ function refuseOfflineBirth(binding: DirBinding): void {
*/
async function materializeBinding(ctx: Ctx, binding: DirBinding): Promise<Canvas> {
const title = binding.title ?? path.basename(binding.root);
await ctx.client.sendOp(null, ctx.actor, {
const owner = await resolveOwnerActor(ctx.client, ctx.home, ctx.actor);
await ctx.client.sendOp(null, owner, {
type: "project.create",
canvasId: binding.canvasId,
title,
Expand Down Expand Up @@ -843,9 +845,10 @@ async function bindFresh(ctx: Ctx): Promise<Canvas | null> {
// byte what it was.
const birth = ctx.birthHome;
const markerHome = birth ?? (ctx.client.direct ? ctx.client.base : null);
const owner = await resolveOwnerActor(ctx.client, ctx.home, ctx.actor);
await ctx.client.sendOp(
null,
ctx.actor,
owner,
{ type: "project.create", canvasId, title },
undefined,
birth ?? undefined,
Expand Down Expand Up @@ -905,9 +908,10 @@ export async function ensureDirBinding(
// marker's id could be minted a second time locally.
refuseOfflineBirth(binding);
const title = binding.title ?? path.basename(binding.root);
const owner = await resolveOwnerActor(client, home, actor);
await client.sendOp(
null,
actor,
owner,
{ type: "project.create", canvasId: binding.canvasId, title },
undefined,
birthHome ?? undefined,
Expand All @@ -923,9 +927,10 @@ export async function ensureDirBinding(
if (!root) return null;
const canvasId = newCanvasId();
const title = path.basename(root);
const owner = await resolveOwnerActor(client, home, actor);
await client.sendOp(
null,
actor,
owner,
{ type: "project.create", canvasId, title },
undefined,
birthHome ?? undefined,
Expand Down
41 changes: 40 additions & 1 deletion packages/api/src/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import os from "node:os";
import path from "node:path";
import readline from "node:readline/promises";
import type { Actor, ActorBindingRecord, ActorClaimOp } from "@isocan/core";
import { BADGE_ENDED, elapsedLabel } from "@isocan/core";
import { agentOwnerMessage, BADGE_ENDED, elapsedLabel, harnessOf, isAgentHarness } from "@isocan/core";
import { adoptIdentity as adoptStoredIdentity, paths, writeIdentityActor, writeIdentityName } from "@isocan/server";
import { ApiError } from "./routes.ts";
import type { DaemonClient } from "./client.ts";
Expand Down Expand Up @@ -608,3 +608,42 @@ export async function requireIdentity(client: DaemonClient, home: string): Promi
console.error(`Hi ${actor.name} — identity saved to ${paths.identityFile(home)}`);
return actor;
}

/**
* Resolve the human actor who owns rooms/spaces/groups created from this
* machine or proxy badge. If `current` is already a person (or unknown to be an
* agent), return `current`; if `current` is an agent, resolve `home:person` or
* another person claim on the badge, or claim `identity.json` under `home:person`.
*/
export async function resolveOwnerActor(
client: DaemonClient,
home: string,
current: Actor,
noun: "canvas" | "space" | "group" = "canvas",
): Promise<Actor> {
if (isBadgeUpstream()) return current;
await client.ensureDaemon();
const [kinds, bindings] = await Promise.all([
client.actorKinds().catch(() => null),
legacyTolerant(client.actorBindings()).catch(() => null),
]);
const isAgent = kinds
? kinds[current.id] === "agent"
: bindings?.some((b) => b.actor.id === current.id && isAgentHarness(harnessOf(b.key))) ?? false;
if (!isAgent) return current;

const homePerson = bindings?.find((b) => b.key === HOME_CLAIM_KEY && kinds?.[b.actor.id] !== "agent");
if (homePerson) return homePerson.actor;
const anyPerson = bindings?.find((b) => {
const harness = harnessOf(b.key);
return !isAgentHarness(harness) && harness?.toLowerCase() !== "replica" && kinds?.[b.actor.id] !== "agent";
});
if (anyPerson) return anyPerson.actor;

const localPerson = await readIdentity(home);
if (localPerson) {
await reclaimIdentity(client, { actor: localPerson, key: HOME_CLAIM_KEY });
return localPerson;
}
throw new Error(agentOwnerMessage(noun, current.name));
}
9 changes: 6 additions & 3 deletions packages/api/test/connect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ describe("connect()", () => {
it("canvases open by ref off one connection, and the only canvas is the default reach", async () => {
await claim("acme-board", "acme", "Roster");
const h = await connect({ port, identity: { session: "acme-board", harness: "acme" } });
const owner = (await h.ctx.client.claimActor({ type: "actor.claim", sessionKey: "home:owner", name: "Owner" })).envelope.actor;
const canvasId = newCanvasId();
await h.ctx.client.sendOp(null, h.actor, {
await h.ctx.client.sendOp(null, owner, {
type: "project.create",
canvasId,
title: "Acme Panels",
Expand All @@ -129,8 +130,9 @@ describe("connect()", () => {
it("content goes in as a value and the op returns what it made — version, blobHash, place", async () => {
await claim("acme-board", "acme", "Roster");
const h = await connect({ port, identity: { session: "acme-board", harness: "acme" } });
const owner = (await h.ctx.client.claimActor({ type: "actor.claim", sessionKey: "home:owner", name: "Owner" })).envelope.actor;
const canvasId = newCanvasId();
await h.ctx.client.sendOp(null, h.actor, {
await h.ctx.client.sendOp(null, owner, {
type: "project.create",
canvasId,
title: "Acme Panels",
Expand Down Expand Up @@ -189,8 +191,9 @@ describe("connect()", () => {
it("unreachable is a typed refusal, not a stack trace", async () => {
await claim("acme-board", "acme", "Roster");
const h = await connect({ port, identity: { session: "acme-board", harness: "acme" } });
const owner = (await h.ctx.client.claimActor({ type: "actor.claim", sessionKey: "home:owner", name: "Owner" })).envelope.actor;
const canvasId = newCanvasId();
await h.ctx.client.sendOp(null, h.actor, {
await h.ctx.client.sendOp(null, owner, {
type: "project.create",
canvasId,
title: "Acme Panels",
Expand Down
6 changes: 3 additions & 3 deletions packages/api/test/design-audit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ beforeEach(async () => {
const address = daemon.app.server.address();
if (!address || typeof address === "string") throw new Error("No daemon address");
const client = new DaemonClient(`http://127.0.0.1:${address.port}`, home);
await client.claimActor({ type: "actor.claim", sessionKey: "acme:design-audit", name: "Acme Audit" });
const actor = (await client.actorBindings(["acme:design-audit"]))[0]!.actor;
ctx = { client, actor, home, harness: "acme", birthHome: null, binding: null,
await client.claimActor({ type: "actor.claim", sessionKey: "home:design-audit", name: "Acme Audit" });
const actor = (await client.actorBindings(["home:design-audit"]))[0]!.actor;
ctx = { client, actor, home, harness: null, birthHome: null, binding: null,
homeOf: async () => null, homes: async () => ({ birth: null, links: [], rows: {}, legacy: false, rowFor: () => null }) };
});

Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/design-craft.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ it("distinguishes known absence from denied inherited authority and preserves it
const f = await designReviewFixture(true); fixture = f;
await f.agentCanvas.remove(f.system.id);
expect((await f.agentCanvas.designCraft(f.requestId, "new-work")).governing.status).toBe("none");
const libraryId = newCanvasId(); await f.client.sendOp(null, f.agent.actor, { type: "project.create", canvasId: libraryId, title: "Acme craft library" });
const libraryId = newCanvasId(); await f.client.sendOp(null, f.person.actor, { type: "project.create", canvasId: libraryId, title: "Acme craft library" });
const library = new CanvasHandle(f.agent, (await f.client.snapshot(libraryId)).project);
await library.add({ title: "Acme inherited system", content: auditDesign(), mime: "text/markdown", filename: "DESIGN.md", properties: designSystemProperties() });
await f.agentCanvas.add({ title: "Acme inherited link", content: f.base, mime: "text/plain", properties: { ...canvasItemOf(f.base, libraryId).properties, memory: "inherit" } });
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/design-system.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ it("retains lost-ack intent, refuses stale metadata before upload, and keeps acc

it("opens and reconciles inherited bytes through policy-bearing actual reads and writes, retaining exemption independently", async () => {
const f = fixture = await questionnaireFixture(), libraryId = newCanvasId();
await f.client.sendOp(null, f.agent.actor, { type: "project.create", canvasId: libraryId, title: "Acme library" });
await f.client.sendOp(null, f.person.actor, { type: "project.create", canvasId: libraryId, title: "Acme library" });
const library = new CanvasHandle(f.agent, (await f.client.snapshot(libraryId)).project);
const item = await library.add({ title: "Acme inherited system", content: auditDesign("Acme library"), mime: "text/markdown", filename: "DESIGN.md", properties: designSystemProperties() });
await f.agentCanvas.add({ title: "Acme library source", content: f.base, mime: "text/plain", properties: { ...canvasItemOf(f.base, libraryId).properties, memory: "inherit" } });
Expand Down
3 changes: 2 additions & 1 deletion packages/api/test/tail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ async function opened(): Promise<{
await client.claimActor({ type: "actor.claim", sessionKey: "acme:acme-other", name: "Other" })
).envelope.actor;
const h = await connect({ port, identity: { session: "acme-watch", harness: "acme" } });
const owner = (await client.claimActor({ type: "actor.claim", sessionKey: "home:owner", name: "Owner" })).envelope.actor;
const canvasId = newCanvasId();
await h.ctx.client.sendOp(null, h.actor, {
await h.ctx.client.sendOp(null, owner, {
type: "project.create",
canvasId,
title: "Acme Panels",
Expand Down
Loading
Loading