Skip to content

FE-698: Prompt registry + observer context-pack foundation#101

Merged
lunelson merged 3 commits into
mainfrom
ln/fe-698-slice-a
May 8, 2026
Merged

FE-698: Prompt registry + observer context-pack foundation#101
lunelson merged 3 commits into
mainfrom
ln/fe-698-slice-a

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented May 7, 2026

Stack Context

This FE-698 stack establishes the prompt/context scenario substrate that future agent-heavy Brunch features can probe before UI work.

What?

  • Moves interviewer, observer, and side-chat prompt text into packaged markdown assets loaded through a typed prompt registry.
  • Copies prompt assets into the server-runtime build output.
  • Adds the first typed observer-capture context pack seam while preserving the existing observer context rendering.

Why?

Prompt text and graph context need to become inspectable, reusable server subsystems. This PR makes prompt assets package-safe and gives observer capture the first typed context-pack boundary without changing production prompt behavior.

@lunelson lunelson changed the title FE-698 package server prompt registry FE-698: Prompt/context substrate slice 1 May 7, 2026
@lunelson lunelson marked this pull request as ready for review May 7, 2026 15:44
@cursor
Copy link
Copy Markdown

cursor Bot commented May 7, 2026

PR Summary

Medium Risk
Medium risk because it changes how core LLM prompts are sourced (asset loading/interpolation) and adjusts the server-runtime build output to ship those assets; mistakes could subtly change prompt text or break runtime builds.

Overview
Externalizes server prompts into packaged markdown assets and introduces a typed prompt registry (prompt-loader.ts) with explicit interpolation and newline normalization, then updates interviewer (getSystemPrompt), observer system prompt construction, and side-chat role prompting to render via renderPromptAsset().

Introduces the first typed context-pack seam for observer capture (context-pack.ts) and rewires buildObserverContext() to render through this pack while preserving existing output via new snapshot-style tests.

Hardens build/package boundaries for prompt assets by copying src/server/prompts into dist/server/prompts during the server-runtime Vite build and adding a build-boundary test to assert the assets are present.

Reviewed by Cursor Bugbot for commit 5e5ca78. Bugbot is set up for automated code reviews on this repo. Configure here.

@lunelson lunelson self-assigned this May 7, 2026
@lunelson lunelson requested a review from kostandinang May 7, 2026 15:44
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 7, 2026

🤖 Augment PR Summary

Summary: This PR introduces a packaged markdown prompt registry and the first typed context-pack slice for FE-698, moving server prompts and observer context rendering onto explicit asset/context-pack seams.

Changes:

  • Added src/server/prompt-loader.ts to load and render named markdown prompt assets (with explicit variable interpolation and caching).
  • Migrated interviewer phase system prompts (getSystemPrompt), the observer system prompt, and the side-chat role prompt to use the prompt registry.
  • Added a typed context-pack module (src/server/context-pack.ts) and implemented the initial observer-capture context pack builder + renderer.
  • Refactored buildObserverContext to render via the new observer-capture context pack to preserve existing output semantics.
  • Added tests for prompt loading/interpolation, observer context-pack behavior, and a build-boundary check that prompt assets are copied into the built server runtime.
  • Updated the server-runtime Vite build to copy prompt markdown assets into dist/server/prompts.

Technical Notes: Prompt asset resolution is based on import.meta.url at runtime, and the server-runtime build includes a copy step to ensure markdown prompts ship alongside the built server entrypoint.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/context-pack.test.ts Outdated
@lunelson lunelson changed the title FE-698: Prompt/context substrate slice 1 FE-698: Prompt registry + observer context-pack foundation May 7, 2026
Comment thread src/server/prompt-loader.ts
Comment thread src/server/context-pack.test.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 204af9d. Configure here.

Comment thread src/server/prompt-loader.ts
kostandinang
kostandinang previously approved these changes May 8, 2026
Base automatically changed from ln/fe-698-new-prompting-strategies to main May 8, 2026 10:37
@lunelson lunelson force-pushed the ln/fe-698-slice-a branch from 204af9d to 5e5ca78 Compare May 8, 2026 10:37
@github-actions github-actions Bot dismissed kostandinang’s stale review May 8, 2026 10:38

Latest approval commit 204af9d is not an ancestor of 5e5ca78, indicating rewritten history after approval

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 8, 2026

Merge activity

  • May 8, 10:38 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@kostandinang kostandinang self-requested a review May 8, 2026 10:44
@lunelson lunelson added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit b83ff5f May 8, 2026
6 checks passed
@lunelson lunelson deleted the ln/fe-698-slice-a branch May 8, 2026 10:45
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