-
Notifications
You must be signed in to change notification settings - Fork 0
Context layer: refs, aliases, packs, cu onboard, pickers #38
Open
Description
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)
- 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. - 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. - P2 — packs: query refs, PATH extensions,
internal/uipickers (bubbletea),cu pick,cu pack(M),cu onboard, dynamic completions. - Post-P2 — browse:
cu browse [@ref], pack discovery, demand-gated extras.
Maintainer decisions (final; spec §9.1)
- The wizard is
cu onboard, notcu init—onboardreserved now,initfuture-reserved; no confusion with the existingcu config init. - 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 infoprints a static capability report; escape hatches = project.cu.yml(PR-reviewed shell macros),cu-<name>PATH extensions, future declarativeurl:alias type. - bubbletea/bubbles in core accepted for
internal/uipickers and, later,cu browse. - Future-reserved word list approved (with the init/onboard swap) as an API commitment;
cu which --reservedstays. - Root
cu @refsugar kept, with a cut line: if@-parsing complicates cobra arg/completion handling, fall back to requiringcu task list @x.
Sub-issues for the individual workstreams will be filed as each phase approaches; none exist yet by design.