Skip to content

feat(advisor-mode-for-zcode): add dual-tier advisor and executor workflow plugin - #127

Open
jannotix wants to merge 1 commit into
zai-org:mainfrom
jannotix:feat/advisor-mode-for-zcode
Open

jannotix wants to merge 1 commit into
zai-org:mainfrom
jannotix:feat/advisor-mode-for-zcode

Conversation

@jannotix

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面

Affected plugin name(s) / 涉及的插件名称:advisor-mode-for-zcode

What / 改动内容

Adds a new community plugin, Advisor Mode for Zcode (v0.1.0, Apache-2.0, author Gianluca Iannotta), under external_plugins/advisor-mode-for-zcode/, plus its marketplace entry.

Advisor Mode pairs a frontier Advisor and Reviewer subagent (pinned model with explicit reasoning level) with a fast Executor subagent (model: inherit, follows the session model), and enforces the workflow with hard lifecycle gates on six ZCode hook events:

  • SessionStart classifies the session role from the session model id (unknown models fail closed to executor) and injects gate directives plus craft standards (minimalist engineering, clean prose, action-first ergonomics, UI direction).
  • PreToolUse denies a second distinct file edit until the advisor validates the plan (pre-task plan gate) and blocks commands and edits while the two-strike circuit breaker is tripped (normalized identical failure signatures).
  • PostToolUse tracks failure signatures, records SHA-256 hashes of modified files, and captures advisor verdicts from completed advisor subagent runs.
  • Stop enforces the mandatory final review: every modified file needs an approved advisor review whose recorded hash still matches the file on disk, with a bounded continuation cap.

Models are swappable for future releases: the executor follows the session model, and the advisor model is one frontmatter line (with $suffix reasoning level). Configuration lives in advisor-config.json (labels, agent names, model patterns, gate thresholds). State persists per session under the plugin data directory. Includes a seven-test Node suite (node --test tests/advisor-hook.test.mjs) covering roles, gates, failure signatures, the circuit breaker, hash verification, and standalone CLI execution.

Source repository: https://github.com/jannotix/advisor-mode-for-zcode

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins//
  • Usage category is set independently of publisher ownership (productivity)
  • Plugin type and affected names are declared above
  • version 0.1.0 identical in plugin.json and marketplace.json (new plugin, first release)
  • README.md (EN) and README_CN.md both present and equivalent
  • description_i18n has both en and zh-CN (in manifest and marketplace entry)
  • No secrets, machine-specific paths, or private dependencies
  • Model/API/network dependencies documented (README section Side Effects and Dependencies: node runtime for hooks, session model plus one pinned frontier model via the user's Z.ai account, state writes only in the plugin data directory)
  • python3 scripts/validate.py passes locally (51 plugins OK). scripts/build_dist.py fails in this environment on the pre-existing excalidraw plugin (missing its pnpm build artifacts, an internal-machine step); this plugin's zip builds (the loop reaches excalidraw, which sorts after advisor-mode-for-zcode, without errors on this plugin).

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants