Skip to content

Fix Zenbu IDE root detection for Pi house-rules prompt #2

Description

@dr-baker

Problem

The app-owned Pi extension that injects Zenbu editing guidance tries to identify the Zenbu source root with:

const ROOT_MARKERS = ["zenbu.config.ts", "AGENTS.md"] as const

That root identification is flawed for two separate reasons:

  1. It unnecessarily requires AGENTS.md. The release/dev checkout may not contain AGENTS.md, so root resolution returns null even when the directory is clearly the running app root. That silently prevents the house-rules prompt from being appended.
  2. It identifies any Zenbu.js app, not specifically the Zenbu IDE app. zenbu.config.ts is a framework-level marker for any app built with Zenbu.js. The prompt being injected is IDE-specific guidance about editing this app, so the detector should verify that the host app is the Zenbu IDE, e.g. via package.json#name === "zenbu" or another app-specific identity marker.

Expected behavior

The Pi house-rules extension should resolve the running Zenbu IDE app root reliably and only inject IDE-specific instructions when the host app is actually the Zenbu IDE.

Suggested direction

Instead of walking from the session/project cwd and requiring docs files as root markers:

  • derive the host app root from the running Zenbu app context, such as process.env.ZENBU_CONFIG_PATHdirname(configPath);
  • read the app package.json and require name === "zenbu" before enabling the IDE-specific prompt;
  • treat docs such as AGENTS.md as optional prompt content, not as required root markers.

This keeps framework-level Zenbu.js app detection separate from Zenbu IDE-specific behavior.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions