Skip to content

feat(trellis): delegate_task forks are worker spawns with a knowledge option - #25

Merged
Andrey170170 merged 4 commits into
dev_v2from
trellis-v2/c-spawn-knowledge
Oct 3, 2026
Merged

Andrey170170 merged 4 commits into
dev_v2from
trellis-v2/c-spawn-knowledge

Conversation

@Andrey170170

Copy link
Copy Markdown
Owner

Lane T3 for the Env lane's knowledge tiers (Trellis "Knowledge tiers" in docs/api.md; design in docs/v1/agent-profiles.md §6 and §8).

Change

  • Worker spawns: a fork made for a delegated child (delegate_task workspace: {fork}) is sent to POST /v1/fork with spawn: true. Trellis then gives the worker the project tier read-only by default.
  • New workspace.fork.knowledge option: {project?: rw|ro|none, notes?: inherit|empty, groups?, groupsRw?}, sent as Trellis's knowledge (groupsRw → groups_rw). Group names follow Trellis's [a-z0-9_-]. The tool description explains the defaults.
  • The lead is the ceiling (design §6). T3 forks on the user socket, which Trellis does not limit, so delegate_task checks the lead's own access first, through GET /v1/knowledge and GET /v1/knowledge/groups:
    • the project tier, defaults included: a lead that sees none hands its worker none, and the worker default (read) is lowered to none;
    • each existing group at the access handed out, looked up only among the lead's own groups;
    • a group that does not exist yet is created by the spawn, with the lead in it, as designed.
    • A Trellis without knowledge tiers still forks a worker that asked for nothing in particular.
  • Worker guide: names /trellis/knowledge/project, the groups and /trellis/notes.

Open (Trellis side)

Checking access and creating the fork are separate calls. A group created by someone else, or a grant revoked, between the check and the fork escapes the check. Closing this needs an atomic check in Trellis's fork, e.g. Trellis checking groups against the spawned_by/source workspace's access when a fork carries spawn: true.

Checks

  • Tests:
    • TrellisWorkers.test.ts: spawn and knowledge passed through; refusals for project write, a hidden group, write to a read-only group, and a hidden group named constructor; the lead's own and new groups allowed; a lead with no project tier refused ro and its default lowered to none.
    • Trellis.test.ts: the fork body uses Trellis's names.
  • Local CI: knip:check, vp check, vpr typecheck and release-smoke pass. t3 tests fail only on the known CodexInstallation and AcpSessionRuntime.processTree failures. Package tests fail only on the known desktop libsecret and snapshot file-mode failures; client-runtime, relay and mobile pass when run separately. build:desktop fails on the known libsecret helper.
  • Reviews:
    • Codex gpt-6.1-sol: no access check, group name pattern; fixed.
    • Codex gpt-6-astra: defaults not counted, inherited object properties, check/fork race. The first two are fixed; the race is the Trellis-side item above.

🤖 Generated with Claude Code

Andrey170170 and others added 3 commits October 2, 2026 21:17
…edge option

A fork made for a delegated child is sent with spawn: true, so Trellis
gives it the project knowledge tier read-only by default, and
workspace.fork.knowledge ({project, notes, groups, groupsRw}) passes
through to POST /v1/fork. The worker guide names the knowledge paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…group names checked

T3 forks on the user socket, which Trellis does not limit, so delegate_task
checks the lead's own access (GET /v1/knowledge): project write, and each
existing group at the access handed out; new groups are created by the
spawn. Group names follow Trellis's [a-z0-9_-].

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s and only the lead's own groups

A lead that sees no project tier hands its worker none (the worker
default, read, is lowered), group access is looked up only among the
lead's own groups, and a Trellis without knowledge tiers still forks a
worker that asked for none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T03:44:39.831637Z d7cd6b7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 3, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7cd6b7e7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +452 to +455
Effect.catch((error) =>
input.knowledge === undefined && error.message.startsWith("This Trellis does not support")
? Effect.succeed({ knowledge: undefined })
: Effect.fail(unavailable(error)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat empty knowledge objects as default requests

On a Trellis version without the knowledge endpoints, knowledge: {} (or an object containing only empty group arrays) has exactly the same effective defaults as omitting knowledge, but this compatibility branch only accepts literal undefined. Since the contract permits an empty object, an agent can make a no-op knowledge request and unexpectedly get an orchestration error instead of the fork that the adjacent fallback promises; normalize empty/default-only knowledge before deciding whether the unsupported endpoint should block the spawn.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid: an absent knowledge, {} or empty group lists all count as the worker defaults, so a Trellis without knowledge tiers forks for any of them. Fixed in bbdf6b0.

…Trellis without tiers

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Andrey170170
Andrey170170 merged commit 409ba28 into dev_v2 Oct 3, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant