Skip to content

Give collections a declared description that the CLI, agent and workspace context use #3421

Closed

Description

@malibio

Overview

A collection's description says what the collection is for. Users and agents should be able to set it, and the agent should see it when deciding where to file a node. Today the field half exists: it's written to an undeclared, flat property, and nothing ever supplies a value. This issue declares it on the collection schema, stores it in the schema's bucket, makes it writable from the CLI and agent tools, and adds it to the agent's workspace context. A UI for setting it comes later and is out of scope.

Problem Statement

  • Undeclared, and stored in the wrong place. create_collection (packages/core/src/ops/collection_ops.rs) writes properties.description as a flat key, outside the collection bucket. The collection schema in packages/core/src/models/core_schemas.rs doesn't declare it.
  • Never set. The only UI caller, navigation-sidebar.svelte (collectionsData.createCollection(name)), passes no description. The CLI has no way to set it, and nothing can edit it after creation.
  • Read in one place. The collection viewer header (collection-node-viewer.svelte) shows collection.properties.description when present, reading the flat key.
  • The agent can't see it. The resident workspace context lists collection names only (COLLECTIONS: a, b, c in WorkspaceContext::format_for_prompt, packages/core/src/ops/context_ops.rs), so the agent has nothing but a name to go on when filing a node.
  • components/node-types.md already documents description as a collection property ("Purpose description"). The code never declared it.

Proposed Solution

  1. Declare description (string, optional) on the collection schema. It's stored at properties.collection.description.
  2. Fix the writer. create_collection writes into the bucket, and the viewer header reads from the bucket. The create path in the store, Tauri command and proto keeps its optional description parameter.
  3. CLI: no new command or flag. nodespace node create --type collection … --property description="…" and nodespace node update <id> --property description="…" work once the field is declared. Verify that node create --type collection goes through the collection create path, which derives a deterministic id from the name (deterministic_collection_id). If it doesn't, route it there.
  4. Agent tools: create_node / update_node set the declared field through the shared pipeline. No new tool.
  5. Workspace context: each listed collection shows its description after its name, truncated, within the existing max_chars budget. A collection without a description stays a bare name.
  6. Skill guidance: the CLI references and generated SKILL.md teach setting a collection's description with --property description=…, and say why: it tells agents what the collection is for.

Architecture Impact

  • components/node-types.md (Collection) already lists description. This issue makes the code match. The doc's icon and color rows aren't stored or used anywhere and are left to the separate dead-code cleanup decision.
  • ADR-083 §5 / [Core release blocker] Strip all Pro code, edition branching and sync/ACL state from core in one pass (ADR-081 steps 0 and 2) #3412 remove restrictedToMembers from the same schema. This is an independent field with no ordering dependency; if both are in flight, rebase whichever lands second.
  • ADR-064: the workspace context is the context-block channel. A description is data about the workspace, not instructions, which fits that channel.
  • No ADR changes this decision. Companion docs change: none beyond keeping node-types.md accurate (it already lists the field).

Acceptance Criteria

  • The collection schema declares description (string, optional); create_collection stores it at properties.collection.description, and nothing writes a flat properties.description on a collection (test)
  • The collection viewer header reads the description from the bucket
  • nodespace node create --type collection --content <name> --property description=<text> creates the collection through the deterministic-id path with the description, and node update <id> --property description=<text> changes it (CLI tests)
  • The agent's create_node / update_node set and change a collection description (test)
  • The workspace context renders name — description for collections that have one, truncated, within max_chars; a test covers with, without, and truncated
  • Skill guidance (CLI references, generated SKILL.md) teaches setting a collection description; the SKILL.md drift check passes
  • Prompt golden regenerated (UPDATE_GOLDEN=1) and the diff reviewed (the eval:decisions before/after run was dropped: its fixture has no collection scenario, see the comment below)
  • bun run test:changed passes; bun run quality:fix clean

Technical Specifications

Reference Files

  • Schema: packages/core/src/models/core_schemas.rs (collection)
  • Create op: packages/core/src/ops/collection_ops.rs (create_collection, deterministic_collection_id)
  • Collection service: packages/core/src/services/collection_service.rs
  • Workspace context: packages/core/src/ops/context_ops.rs (WorkspaceContext, format_for_prompt, collection names fetch)
  • Viewer: packages/desktop-app/src/lib/components/viewers/collection-node-viewer.svelte
  • Frontend create path: packages/desktop-app/src/lib/stores/collections.svelte.ts, packages/desktop-app/src/lib/services/collection-service.ts
  • CLI: packages/cli/src/commands/node.rs (--property); skill references under packages/skill/; packages/cli/examples/gen_skill_md.rs

Implementation Notes

  • No migration: the database is reset (CLAUDE.md).
  • Model-facing text changes fail prompt_assembly_snapshot; regenerate with UPDATE_GOLDEN=1.
  • Check the eval fixture's age before an eval run.

Non-Goals

  • Any UI for entering or editing a collection description (later work)
  • Collection icon / color

Activity

  1. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 298 test files passed, 5510 tests passed

  2. self-assigned this
    on Oct 1, 2026
  3. added 2 commits that reference this issue on Oct 1, 2026
    c0f485b
    a7ca568
  4. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    The eval:decisions before/after criterion was dropped, with the issue owner's agreement. The decisions fixture has no collection scenario and its database holds no collections, so the collections section this change touches never appears in the prompt the eval exercises; a before/after run would differ only by model noise. For collections without a description the context is byte-identical to before, which the test format_for_prompt_collections_only pins. One rep was run against the build of main before stopping (9 of 11 scored scenarios passed); it measures main, not this change. A filing scenario where the collection descriptions decide the right answer does not exist in the fixture yet and would be the way to measure this.

  5. added a commit that references this issue on Oct 1, 2026
    b9c10d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions