Public: anyone can read this; the crew can change it.

An issue only the owner can do is assigned to the owner when it is filed, and no builder is sent to it #18469

opened this

Merged 3h 17m ago, live in production

A plan item can now carry owner: true for work only the owner can do, like a cache rule on their edge. The issue opens already assigned to the owner. The map shows it as held by a person, and the queue never hands it to a builder.

Notes

opened this

A plan item can now carry owner: true for work only the owner can do, like a cache rule on their edge. The issue opens already assigned to the owner. The map shows it as held by a person, and the queue never hands it to a builder.

Already on main: two parts of the issue were done before this change.

  • The map and queue already hold any issue assigned to a person (not an agent) through the person hold in src/crew/held.ts, so nothing new was needed there.
  • The edge-kept duty (src/maintain/duties/edge_kept.ts) already files its finding assigned to the owner. It also takes back one that was handed to a builder.

So the change is the mark on the plan route.

What changed

  • src/actions/owner_mark.ts (new): decides whether an item's body can carry the mark. A marked item needs an Owner: line saying what the owner decides or does. It is refused as builder work if it names a file under src/, test/, docs/ or scripts/, or has a "Files I expect" list. Each refusal is one plain sentence naming the item.
  • src/actions/plan.ts:
    • parsePlan accepts owner (true or false) and checks the body with ownerMarkRefusal.
    • The plan's existing checks before anything is written refuse a marked item from anyone who can't write to the repository. An outsider's issue never carries the mark.
    • openPlan assigns a marked issue to the owner inside the plan's transaction, using the existing setAssignee. The plan's answer then lists it as held, with reason person.
  • src/http/mcp/tools/plan.ts: the plan tool's input schema now has owner.
  • docs/features/owner-only-issues.md: a how-to for the mark.

Not done

  • Ordinary issue filing (src/actions/issues.ts) does not take the mark, so only a writer's plan or a duty can file an issue held for the owner.
  • No terminal screen: the plan has no screen there, so the commit says No door for it.
  • No event is announced for the assignment made when the issue opens.

Checks: the new test test/plan-owner-mark.test.ts covers four things:

  • a marked issue is assigned to the owner, held as person, and absent from startable;
  • an unmarked issue stays unassigned and startable;
  • builder work and a body with no Owner: line are refused;
  • someone who can't write is refused.

The gate has 0 failing rules. It leaves two notes; one says the test's user helper looks like one in test/next-up.test.ts. bun x tsc --noEmit is clean. Listing the tests this change reaches named 2813 files (over its budget), so I picked these myself:

  • test/plan-*.test.ts, test/mcp-forge-plan.test.ts, test/mcp-here-plan.test.ts;
  • the dead-code, duplicate-import and process-wide-state rules;
  • the MCP tool tests.

They all pass (367 + 233 tests). I did not run scripts/similar.ts; the only existing function reused is setAssignee.

To try it: post a plan with an item {"key":"edge","title":"Cache signed-out pages","pillar":"P0","body":"Owner: add the edge cache rule.","owner":true}. The answer lists it under held with by: "person", and the issue page shows the owner as assignee. Add src/x.ts to the body and the plan is refused with not_owner_only.

🤖 Generated with Claude Code

Closes #18462

commented

A plan item can now carry owner: true for work only the owner can do, like a cache rule on their edge. The issue opens already assigned to the owner. The map shows it as held by a person, and the queue never hands it to a builder.

Already on main: two parts of the issue were done before this change.

  • The map and queue already hold any issue assigned to a person (not an agent) through the person hold in src/crew/held.ts, so nothing new was needed there.
  • The edge-kept duty (src/maintain/duties/edge_kept.ts) already files its finding assigned to the owner. It also takes back one that was handed to a builder.

So the change is the mark on the plan route.

What changed

  • src/actions/owner_mark.ts (new): decides whether an item's body can carry the mark. A marked item needs an Owner: line saying what the owner decides or does. It is refused as builder work if it names a file under src/, test/, docs/ or scripts/, or has a "Files I expect" list. Each refusal is one plain sentence naming the item.
  • src/actions/plan.ts:
    • parsePlan accepts owner (true or false) and checks the body with ownerMarkRefusal.
    • The plan's existing checks before anything is written refuse a marked item from anyone who can't write to the repository. An outsider's issue never carries the mark.
    • openPlan assigns a marked issue to the owner inside the plan's transaction, using the existing setAssignee. The plan's answer then lists it as held, with reason person.
  • src/http/mcp/tools/plan.ts: the plan tool's input schema now has owner.
  • docs/features/owner-only-issues.md: a how-to for the mark.

Not done

  • Ordinary issue filing (src/actions/issues.ts) does not take the mark, so only a writer's plan or a duty can file an issue held for the owner.
  • No terminal screen: the plan has no screen there, so the commit says No door for it.
  • No event is announced for the assignment made when the issue opens.

Checks: the new test test/plan-owner-mark.test.ts covers four things:

  • a marked issue is assigned to the owner, held as person, and absent from startable;
  • an unmarked issue stays unassigned and startable;
  • builder work and a body with no Owner: line are refused;
  • someone who can't write is refused.

The gate has 0 failing rules. It leaves two notes; one says the test's user helper looks like one in test/next-up.test.ts. bun x tsc --noEmit is clean. Listing the tests this change reaches named 2813 files (over its budget), so I picked these myself:

  • test/plan-*.test.ts, test/mcp-forge-plan.test.ts, test/mcp-here-plan.test.ts;
  • the dead-code, duplicate-import and process-wide-state rules;
  • the MCP tool tests.

They all pass (367 + 233 tests). I did not run scripts/similar.ts; the only existing function reused is setAssignee.

To try it: post a plan with an item {"key":"edge","title":"Cache signed-out pages","pillar":"P0","body":"Owner: add the edge cache rule.","owner":true}. The answer lists it under held with by: "person", and the issue page shows the owner as assignee. Add src/x.ts to the body and the plan is refused with not_owner_only.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs