Skip to content

feat: distinguish premise and policy in prompt construction#45

Merged
rlippmann merged 1 commit into
mainfrom
premise-examples
Jul 5, 2026
Merged

feat: distinguish premise and policy in prompt construction#45
rlippmann merged 1 commit into
mainfrom
premise-examples

Conversation

@rlippmann

Copy link
Copy Markdown
Owner

Summary

Strengthens the generic prompt-construction writing-assistant example by showing premise and policy as distinct authoritative state roles.

The example now uses premise for factual document context, such as:

  • set premise draft is a board update summarizing quarterly results
  • change premise to draft is an internal engineering handoff for a sev-1 incident

It keeps use concise_style as the policy contrast.

The observable behavior remains provider-free and deterministic: the host builds different system prompts based on authoritative state. Premise changes document-context guidance, while policy changes explicit writing constraints.

Why

Most existing examples visibly emphasize policy-style state such as use and prohibit.

This change gives prompt construction a clearer premise-based example:

authoritative fact -> host-derived prompt construction

That helps show Context Compiler state is not only allow/deny policy. Premise represents factual context that changes how host request construction is derived.

Example metadata

  • Enforcement point: prompt construction / request construction
  • Domain: writing assistant
  • Technology/runtime: generic Python and 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

Validation performed:

  • uv run --no-sync pytest python/tests/test_prompt_construction_writing_assistant.py
  • ./scripts/validate_python.sh
  • cd typescript/examples/prompt_construction/writing_assistant && npm test
  • cd typescript/examples/prompt_construction/writing_assistant && npm run typecheck
  • cd typescript/examples/prompt_construction/writing_assistant && npm run build
  • ./scripts/validate_typescript_fast.sh
  • npx --yes markdownlint-cli2 python/examples/prompt_construction/writing_assistant/README.md typescript/examples/prompt_construction/writing_assistant/README.md python/examples/prompt_construction/README.md typescript/examples/prompt_construction/README.md

All validation passed.

@rlippmann
rlippmann merged commit 784fed1 into main Jul 5, 2026
6 checks passed
@rlippmann
rlippmann deleted the premise-examples branch July 5, 2026 06:26
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