feat: Scribe-as-plugin foundation (push-channel endpoint, in-repo plugin, plugin-install Settings UI, backup v3) #62

Merged
bvandeusen merged 5 commits from dev into main 2026-06-10 00:02:54 -04:00
Owner

Lands the foundation of the Scribe-as-plugin work (plan #755) on main so the plugin is installable from the git marketplace (a marketplace clones the default branch).

What's included (all CI-green on dev):

  • Push-channel endpointGET /api/plugin/context renders always-on rule titles (by topic) + active-project context for the plugin's SessionStart hook. services/plugin_context.py, routes/plugin.py.
  • In-repo plugin + marketplace.claude-plugin/marketplace.json (source ./plugin) + plugin/ (plugin.json with userConfig, .mcp.json, SessionStart hook, using-scribe skill, README). Ships in lockstep with the app.
  • Settings UI — Claude Code tab now leads with /plugin marketplace add + install; raw claude mcp add demoted to an "Advanced" disclosure.
  • Backup v3export_full_backup/export_user_backup/restore now cover rulebooks, topics, rules, the subscription + 2 suppression join tables, and events (v2 silently dropped all of these); _not_included names the still-deferred tables.
  • Cleanup — retired dead fable-mcp wheel-distribution docs; untracked docs/superpowers/.

No migrations (dev and main were at the same head). Enables the single-instance cutover: deploy :latest on prod data, install the plugin from this repo's marketplace.

🤖 Generated with Claude Code

Lands the foundation of the Scribe-as-plugin work (plan #755) on main so the plugin is installable from the git marketplace (a marketplace clones the default branch). **What's included (all CI-green on dev):** - **Push-channel endpoint** — `GET /api/plugin/context` renders always-on rule titles (by topic) + active-project context for the plugin's SessionStart hook. `services/plugin_context.py`, `routes/plugin.py`. - **In-repo plugin + marketplace** — `.claude-plugin/marketplace.json` (source `./plugin`) + `plugin/` (plugin.json with userConfig, `.mcp.json`, SessionStart hook, `using-scribe` skill, README). Ships in lockstep with the app. - **Settings UI** — Claude Code tab now leads with `/plugin marketplace add` + install; raw `claude mcp add` demoted to an "Advanced" disclosure. - **Backup v3** — `export_full_backup`/`export_user_backup`/restore now cover rulebooks, topics, rules, the subscription + 2 suppression join tables, and events (v2 silently dropped all of these); `_not_included` names the still-deferred tables. - **Cleanup** — retired dead `fable-mcp` wheel-distribution docs; untracked `docs/superpowers/`. No migrations (dev and main were at the same head). Enables the single-instance cutover: deploy `:latest` on prod data, install the plugin from this repo's marketplace. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
bvandeusen added 5 commits 2026-06-10 00:02:39 -04:00
The old standalone fable-mcp wheel/download flow is gone from code (no route,
no Dockerfile build, no FABLE_MCP_DIST_DIR). Update api-keys-and-mcp,
api-reference, architecture, configuration, development to describe the
in-app HTTP MCP at /mcp (Bearer auth). Untrack the 18 committed
docs/superpowers/ files so the existing .gitignore takes effect.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(plugin): add /api/plugin/context push-channel endpoint + dogfood hook
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 35s
CI & Build / Python tests (push) Successful in 49s
CI & Build / Build & push image (push) Successful in 1m6s
3ab16fcbdb
Phase 1 of plan #755 (Scribe-as-plugin). Gives Scribe its own session-start
push channel so always-on rules + active-project context surface without being
asked — the gap behind 'I have to prompt for everything'.

- services/plugin_context.build_session_context: renders always-on rule titles
  grouped by topic (under the 10k additionalContext cap; full text stays one
  list_always_on_rules/get_rule call away) + optional project goal/open-task
  count + a recall/update-over-create reflex line. Capped at 9000 chars.
- routes/plugin GET /api/plugin/context (login_required already accepts Bearer
  fmcp_ keys; read scope suffices).
- tests: titles-not-statements, project scoping, length cap (pure mocks).
- scripts/scribe_session_context.sh: dogfood SessionStart hook, fail-open,
  reads url+token from .mcp.json. Superseded in Phase 2 by the plugin-bundled
  hook using userConfig.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per operator: the plugin lives in the app repo so it ships and versions in
lockstep with the app and the /api/plugin/context contract it targets (same
co-location rationale as the former in-repo MCP). A git-cloned marketplace
supports relative plugin sources, so the FabledScribe repo IS the marketplace.

- .claude-plugin/marketplace.json — source ./plugin
- plugin/.claude-plugin/plugin.json — userConfig (base URL, api key, project id)
- plugin/.mcp.json — http scribe server, ${user_config.*} substitution
- plugin/hooks/ — SessionStart push-channel hook (fail-open)
- plugin/skills/using-scribe — bootstrap skill
- plugin/README.md — install via the FabledScribe repo marketplace

Phase 2 of plan #755. Install/userConfig-substitution test pending.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The v2 backup silently dropped the entire rulebook system (rulebooks, topics,
rules), the project subscription/suppression join tables, and events — so a
'full' backup wasn't. v3 adds all of them with FK re-mapping on restore, and a
_not_included field that names the still-deferred tables (ACL groups/shares,
api_keys, embeddings, transient/operational) so the gap is explicit, not silent.

restore_full_backup routes v2 and v3 through one path; v3-only sections are
guarded by data.get so a v2 payload still restores cleanly.

Tests: version/coverage constants, pure join-table row helpers, and the export
contract via a mocked session (CI has no DB; full round-trip is a manual check).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(settings): lead MCP Access with plugin install, demote raw MCP
CI & Build / Python lint (push) Successful in 2s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 47s
CI & Build / Build & push image (push) Successful in 57s
c0b3ec7d9b
Per operator: the plugin install should supersede the bare MCP connection in
Settings, since the plugin incorporates the MCP and adds the session-start hook
+ skills. The Claude Code tab now leads with /plugin marketplace add + install
(with a persisted marketplace-URL field and the base-URL/key/project-id prompts
spelled out), and the old 'claude mcp add' command moves into a collapsed
'Advanced: connect the MCP only' disclosure.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bvandeusen merged commit b1674169a0 into main 2026-06-10 00:02:53 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledScribe#62