Skip to content

initiative: establish one canonical plugin entrypoint pattern #567

Description

@ss-o

Outcome

Establish one concise, portable, and tested Zsh plugin entrypoint pattern that
preserves caller state and resolves the actual source file correctly even when
plugin initialization is wrapped in an anonymous function.

Context

The existing caller-preserving wrapper moved initialization into an anonymous
function, but $0 inside that function is not a reliable source-file locator.
The canonical boundary should resolve the source identity outside the function,
pass it as argument 1, localize Zsh state with builtin emulate -L zsh, and
derive read-only absolute paths inside the function.

This requires coordination because the public standard, organization template,
semantic analyzer guidance, and a real Zi annex must describe and exercise the
same contract.

Expected deliverables

  • z-shell/wiki: define the primary canonical pattern in Zsh Plugin Standard v2.
  • z-shell/.github: align organization Zsh guidance, the new-plugin template,
    and policy validation.
  • z-shell/zsh-lint: align plugin/zero-handling guidance and fixtures with the
    canonical source-path argument boundary.
  • z-shell/z-a-meta-plugins: adopt the canonical boundary and cover direct and
    manager-provided source identity at runtime.

Dependencies and risks

The standard is the public contract. Templates, analyzer guidance, and the
reference annex must remain consistent with it. GitHub-generated zsh-lint
reference documentation remains owned by its existing automation.

Completion criteria

  • The standard defines one minimal pattern for wrapped entrypoints.
  • Organization guidance and scaffolding reproduce that exact pattern.
  • zsh-lint accepts and recommends the same boundary.
  • z-a-meta-plugins resolves its source directory correctly under direct
    sourcing, manager-provided ZERO, and caller-sensitive $0 states.
  • Repository checks pass and all implementation pull requests are linked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:metaOrganization-wide policy, templates, or meta-repo work.meta:initiativeMarks a parent issue coordinating two or more independently deliverable sub-issues.meta:org-trackedIndicates this issue has cross-repository tracking implications (synced to Linear).status:triageAwaiting initial review or classification.type:maintenanceNon-feature maintenance, cleanup, or org work.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions