feat: add lean PDD prompt mode research harness (#1473)#1479
Open
prompt-driven-github[bot] wants to merge 2 commits into
Open
feat: add lean PDD prompt mode research harness (#1473)#1479prompt-driven-github[bot] wants to merge 2 commits into
prompt-driven-github[bot] wants to merge 2 commits into
Conversation
Implements a deterministic section-level pruner under research/lean-prompt-mode/ that reduces prompt token overhead while preserving the five required field groups (source-truth content, output files, verifier, output delimiters, safety constraints). Emits prompt_policy.json and prompt_token_audit.json audit artifacts per run. Adds documentation in README.md and docs/prompting_guide.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix minor issues in lean_prompt.py, README, prompt_policy.json fixture, and prompt_token_audit.schema.json identified during review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a publishable research harness (
research/lean-prompt-mode/) that measures and reduces PDD prompt token overhead through deterministic section-level pruning, while preserving all required source-truth, output, verifier, delimiter, and safety contract fields. Emits auditableprompt_policy.jsonandprompt_token_audit.jsonartifacts on every lean run.Closes #1473
Changes Made
New Research Harness Files
research/lean-prompt-mode/lean_prompt.py— main pruner with--mode {current,lean}parameter; emits both audit artifacts; uses litellm/tiktoken for token countingresearch/lean-prompt-mode/README.md— design document, usage guide, fixture format, CI integration notesresearch/lean-prompt-mode/fixtures/current_prompt.txt— frozen golden PDD prompt in current (unmodified) formresearch/lean-prompt-mode/fixtures/lean_prompt.txt— expected lean-pruner output on the golden fixtureresearch/lean-prompt-mode/fixtures/prompt_policy.json— expectedprompt_policy.jsonfor the golden fixtureresearch/lean-prompt-mode/fixtures/prompt_token_audit.json— expectedprompt_token_audit.jsonfor the golden fixtureresearch/lean-prompt-mode/schemas/prompt_policy.schema.json— JSON Schema v1 forprompt_policy.jsonresearch/lean-prompt-mode/schemas/prompt_token_audit.schema.json— JSON Schema v1 forprompt_token_audit.jsonresearch/lean-prompt-mode/tests/test_lean_prompt.py— unit tests: pruning rules, invariant preservation, schema validation, default-mode regression, anomaly detectionDocumentation Updated
docs/prompting_guide.md— new## Lean Prompt Modesection added after## Automated Context Compression, covering pruning rules, audit artifacts, structural floor, relationship to context compression, and default behaviorREADME.md— new### Lean Prompt Mode Research Harnesssubsection under## Utilitiesafter### Regenerate Model CatalogReview Checklist
lean_prompt.pypreserves all five required field groups (source-truth content, output files, verifier command, output delimiters, safety constraints)prompt_policy.jsonandprompt_token_audit.jsonschema versions are"1.0"--mode current) leaves prompts unchangedpytest research/lean-prompt-mode/tests/Next Steps After Merge
.promptfiles modified)Created by pdd change workflow