Skip to content

Context layer: refs, aliases, packs, cu onboard, pickers #38

Description

@timimsms

Tracking epic for the accepted context-layer design. Full spec: docs/design/context-layer.md (lands via PR #39). Keystone prerequisite: #37.

The four layers

Layer What it is
Refs Named resources (support-bugs → list IDs) and saved queries (my-sprint → a compiled Filtered-Team-Tasks call, #25). Consumed anywhere a resource is accepted, via bare name or @name; introspectable via cu ref resolve --json.
Aliases gh-identical command macros ($1..$9, expand-once, registration-based dispatch). ! shell aliases are legal only from the user's global config or a TOFU-content-hash-trusted project .cu.yml.
Packs Installable, pinned, declarative-inert git repos bundling refs + aliases + defaults. Trust = a single mechanism: manifest-wide sha256 in the lockfile, semantic-diff re-consent on any change, fail-closed --yes/non-TTY, SHA-pin authority, git fetch hardening, source TOFU.
Interfaces cu onboard wizard, cu pick, disambiguation prompts, later cu browse — all veneers over the same resolver; nothing interactive is un-scriptable.

Sequencing ladder (S/M/L sizes; details in spec §10)

  1. P0 — keystone: config layering rework (config: project .cu.yml merges via viper.Set and Save() writes merged state back to global config #37), remove . from the search path, search/export: unbounded N+1 workspace crawl with silent truncation; adopt Get Filtered Team Tasks #25 Filtered-Team-Tasks rebuild shaped for id slices.
  2. P1 — scripting-contract release: universal resolver, resource refs + @ sigil, --json/--jq/--template, cu alias, cu which. The contract freezes here — packs serialize exactly these schemas.
  3. P2 — packs: query refs, PATH extensions, internal/ui pickers (bubbletea), cu pick, cu pack (M), cu onboard, dynamic completions.
  4. Post-P2 — browse: cu browse [@ref], pack discovery, demand-gated extras.

Maintainer decisions (final; spec §9.1)

  1. The wizard is cu onboard, not cu initonboard reserved now, init future-reserved; no confusion with the existing cu config init.
  2. No shell (!) aliases in packs — packs are 100% declarative-inert. Manifest parser rejects ! at install (fail-closed); grant machinery deleted; lockfile = source/pin/rev/manifest_sha256 (+ trusted_projects); cu pack info prints a static capability report; escape hatches = project .cu.yml (PR-reviewed shell macros), cu-<name> PATH extensions, future declarative url: alias type.
  3. bubbletea/bubbles in core accepted for internal/ui pickers and, later, cu browse.
  4. Future-reserved word list approved (with the init/onboard swap) as an API commitment; cu which --reserved stays.
  5. Root cu @ref sugar kept, with a cut line: if @-parsing complicates cobra arg/completion handling, fall back to requiring cu task list @x.

Sub-issues for the individual workstreams will be filed as each phase approaches; none exist yet by design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions