Skip to content

feat: add prompt construction examples#21

Merged
rlippmann merged 3 commits into
mainfrom
prompt-construction
Jun 29, 2026
Merged

feat: add prompt construction examples#21
rlippmann merged 3 commits into
mainfrom
prompt-construction

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

Adds generic Python and TypeScript prompt-construction examples.

The examples demonstrate that Context Compiler authoritative state influences host-owned prompt assembly. The host constructs prompts from explicit authoritative state, while Context Compiler owns the state that determines which prompt guidance is applied.

Why

Prompt construction is a distinct enforcement point.

These examples show that prompt content changes because authoritative state changes, not because of user requests embedded in the current message. The host assembles prompts before any model call would occur.

The examples use a writing-assistant domain with style preferences to demonstrate observable prompt construction behavior.

Example metadata

  • Enforcement point: prompt construction
  • Domain: writing assistant
  • Technology/runtime: generic Python, generic TypeScript
  • Example type: minimal example
  • Does this use directive drafter? should normally be no: no
  • Does this derive state from model output? must be no for primary examples: no

Checklist

  • Repository scaffolding / governance change
  • One primary enforcement point
  • Explicit authoritative state
  • No model-derived state mutation
  • Adversarial stub or equivalent test
  • Observable runtime behavior change
  • Domain vocabulary is natural
  • Framework is secondary to the enforcement point
  • Docs updated
  • Tests/smoke checks added where practical

Notes

Both implementations demonstrate:

  • default prompt construction when no style state exists
  • concise-writing guidance when use concise_style is authorized
  • formal-writing guidance when use formal_style is authorized
  • prohibited styles are not silently applied
  • adversarial user text does not modify authoritative prompt state
  • contradictory directives produce clarification behavior rather than silent overwrite

The examples intentionally stop at prompt construction. No model call is performed. This keeps the enforcement point focused on host-owned prompt assembly rather than model compliance or generation quality.

TypeScript validation scripts were updated so the new example participates in repository validation.

@rlippmann
rlippmann merged commit 2bcd190 into main Jun 29, 2026
5 checks passed
@rlippmann
rlippmann deleted the prompt-construction branch June 29, 2026 06:24
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.

1 participant