Skip to content

chore: PDD sync for #879#1396

Open
prompt-driven-github[bot] wants to merge 3 commits into
mainfrom
change/issue-879
Open

chore: PDD sync for #879#1396
prompt-driven-github[bot] wants to merge 3 commits into
mainfrom
change/issue-879

Conversation

@prompt-driven-github

Copy link
Copy Markdown
Contributor

Summary

Adds the compression_benchmark_python.prompt that generates a benchmark orchestrator comparing five compression strategies across frozen fixtures, plus the contract_loss_regression fixture set that proves contract-symbol preservation is required. Updates docs/ci.md with the new benchmark gate documentation.

Closes #879

Changes Made

Prompts Modified

  • pdd/prompts/compression_benchmark_python.prompt — new prompt generating pdd/compression_benchmark.py, a benchmark orchestrator with five strategy callables (full_tests, ast_tests, ast_contracts, full_fewshot, compressed_fewshot), CompressionBenchmarkResult dataclass, check_compression_benchmark() gate enforcement, and Markdown+JSON report output

Fixtures Added

  • tests/fixtures/compression_benchmark/contract_loss_regression/source.py — source module with contract symbols
  • tests/fixtures/compression_benchmark/contract_loss_regression/test_file.py — pytest file for the fixture scenario
  • tests/fixtures/compression_benchmark/contract_loss_regression/contract_seeds.json — required contract symbol seeds
  • tests/fixtures/compression_benchmark/contract_loss_regression/expected_output.py — canonical expected output
  • tests/fixtures/compression_benchmark/contract_loss_regression/expected_output_*.py — per-strategy expected outputs
  • tests/fixtures/compression_benchmark/contract_loss_regression/expected_results.json — per-strategy pass/token/churn baselines showing ast_tests and full_fewshot fail without contract-source preservation

Documentation Updated

  • docs/ci.md — new "Compression Benchmark Gate" section documenting five strategies, five metrics, three hard-failure conditions, fixture schema, and CI placement guidance

Architecture Updated

  • architecture.json — registers compression_benchmark module with its dependencies and interface

Review Checklist

  • Prompt syntax is valid
  • PDD conventions followed
  • Documentation is up to date
  • Fixture baseline values reflect realistic token counts and churn thresholds
  • expected_results.json correctly shows contract-loss failure for ast_tests / full_fewshot strategies

Next Steps After Merge

  1. Regenerate code from modified prompts in dependency order:
    pdd sync compression_benchmark
  2. Run tests to verify functionality:
    pytest -vv tests/test_compression_benchmark.py
  3. Deploy if applicable

Created by pdd change workflow

Add prompts/compression_benchmark_python.prompt, frozen fixture data
for the contract-loss-regression scenario, and docs/ci.md updates to
document the compression benchmark gate with five strategy modes, five
metrics, and three hard-failure conditions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@prompt-driven-github prompt-driven-github Bot changed the title feat: add compression benchmark gate with regression fixtures (#879) chore: PDD sync for #879 Jun 3, 2026
@prompt-driven-github

Copy link
Copy Markdown
Contributor Author

Step 7/8: Review Loop Final Report

PR: #1396
Issue: #879
issue_aligned: false
active-reviewer: codex
reviewer-status: codex=findings claude=fixer fresh-final=missing
fresh-final-review: missing
verified-head-sha: none
remote-pr-head-sha: none
max-rounds-reached: false
max-cost-reached: false
max-duration-reached: false

Summary

Fixer claude could not address codex's findings.

Per-Reviewer Status

Reviewer Status
codex findings
claude fixer
fresh-final missing

Findings

Severity Status Location Finding Required fix Reviewer
critical open pdd/compression_benchmark.py:44 The benchmark gate cannot run on the PR's own frozen fixture. This leaves the user workflow incomplete: CI/users get a crash from the AST test strategy instead of the required comparison and gate result. Change the AST-test strategy to use selectors that are valid for test files, or handle test slicing separately from source contract seeds, and add an unmocked integration test that runs the checked-in fixture through run_benchmark and check_compression_benchmark successfully. codex
medium open pdd/compression_benchmark.py:178 The gate does not prove compression reduces context size, which is the core issue goal. Token counts are reported but not enforced against the frozen baselines or the full-context strategy. Add a token regression rule to the prompt and implementation, for example failing when res.input_tokens > baseline['max_input_tokens'] and/or when compressed strategies are not smaller than their full-context comparator, and add tests that demonstrate the gate fails on token-budget regressions. codex
medium open pdd/prompts/compression_benchmark_python.prompt:15 The prompt source of truth is missing the gate_python.prompt dependency even though the module depends on gate types. Future architecture regeneration can drop or disagree with the current architecture dependency graph. Add <pdd-dependency>gate_python.prompt</pdd-dependency> to the compression benchmark prompt metadata and keep the generated architecture entry synchronized. codex

Fixer Rationale

  • pdd/compression_benchmark.py:44: The benchmark gate cannot run on the PR's own frozen fixture. This leaves the user workflow incomplete: CI/users get a crash from the AST test strategy instead of the required comparison and gate result. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":429,"duration_ms":651,"duration_api_ms":0,"num_turns":1,"result":"You've hit your limit · resets 9:30pm (UTC)","stop_reason":"stop_sequence","session_id":"34146e3d-7e24-41d9-8a12-4c1accb1e22e","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"server_tool_use":{"web_search_requests":0,"web_fetch_reques'; verification=unverified)
  • pdd/compression_benchmark.py:178: The gate does not prove compression reduces context size, which is the core issue goal. Token counts are reported but not enforced against the frozen baselines or the full-context strategy. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":429,"duration_ms":651,"duration_api_ms":0,"num_turns":1,"result":"You've hit your limit · resets 9:30pm (UTC)","stop_reason":"stop_sequence","session_id":"34146e3d-7e24-41d9-8a12-4c1accb1e22e","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"server_tool_use":{"web_search_requests":0,"web_fetch_reques'; verification=unverified)
  • pdd/prompts/compression_benchmark_python.prompt:15: The prompt source of truth is missing the gate_python.prompt dependency even though the module depends on gate types. Future architecture regeneration can drop or disagree with the current architecture dependency graph. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":429,"duration_ms":651,"duration_api_ms":0,"num_turns":1,"result":"You've hit your limit · resets 9:30pm (UTC)","stop_reason":"stop_sequence","session_id":"34146e3d-7e24-41d9-8a12-4c1accb1e22e","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"server_tool_use":{"web_search_requests":0,"web_fetch_reques'; verification=unverified)

Fixes Attempted

  • round=1 fixer=claude fixer_result=failed push_status=not_attempted local_sha=none pushed_sha=none changed_files=none verification=unverified summary=All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":429,"duration_ms":651,"duration_api_ms":0,"num_turns":1,"result":"You've hit your limit · resets 9:30pm (UTC)","stop_reason":"stop_sequence","session_id":"34146e3d-7e24-41d9-8a12-4c1accb1e22e","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"server_tool_use":{"web_search_requests":0,"web_fetch_reques

@prompt-driven-github

Copy link
Copy Markdown
Contributor Author

Step 7/8: Review Loop Final Report

PR: #1396
Issue: #879
issue_aligned: false
active-reviewer: codex
reviewer-status: codex=findings claude=fixer fresh-final=missing
fresh-final-review: missing
verified-head-sha: none
remote-pr-head-sha: none
max-rounds-reached: false
max-cost-reached: false
max-duration-reached: false

Summary

Fixer claude could not address codex's findings.

Per-Reviewer Status

Reviewer Status
codex findings
claude fixer
fresh-final missing

Findings

Severity Status Location Finding Required fix Reviewer
critical open pdd/compression_benchmark.py:44 The benchmark gate cannot run on the PR's own frozen fixture. A real CI/user workflow gets a crash while building the ast_tests or compressed_fewshot context instead of receiving the required five-strategy comparison and GateResult. Change the AST-test strategy to use selectors that are valid for pytest files, or handle test slicing separately from source contract seeds, then add an unmocked integration test that runs the checked-in fixture through run_benchmark and check_compression_benchmark successfully. The current tests mock ContentSelector and ApiContractSlicer around the real fixture, so they do not prove the shipped workflow works. codex
medium open pdd/compression_benchmark.py:178 The gate reports token counts but does not prove compression reduces context size, which is the core issue goal and is also promised by docs/ci.md. Token regressions or compressed strategies that are larger than their full-context comparator can pass the benchmark gate. Add a token regression rule to the prompt and implementation, for example failing when res.input_tokens > baseline['max_input_tokens'] and/or when compressed strategies are not smaller than their full-context comparator. Add tests showing the gate fails on token-budget regressions. codex
medium open pdd/prompts/compression_benchmark_python.prompt:15 The prompt source of truth is missing the gate dependency, so repository architecture/include validation fails and future regeneration can drift from the checked-in architecture entry. Add <pdd-dependency>gate_python.prompt</pdd-dependency> to pdd/prompts/compression_benchmark_python.prompt and keep the generated architecture metadata synchronized. codex

Fixer Rationale

  • pdd/compression_benchmark.py:44: The benchmark gate cannot run on the PR's own frozen fixture. A real CI/user workflow gets a crash while building the ast_tests or compressed_fewshot context instead of receiving the required five-strategy comparison and GateResult. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":403,"duration_ms":454,"duration_api_ms":0,"num_turns":1,"result":"Your organization does not have access to Claude. Please login again or contact your administrator.","stop_reason":"stop_sequence","session_id":"f6df72d4-5d41-4388-abb9-acf0f025bc10","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"ser'; verification=unverified)
  • pdd/compression_benchmark.py:178: The gate reports token counts but does not prove compression reduces context size, which is the core issue goal and is also promised by docs/ci.md. Token regressions or compressed strategies that are larger than their full-context comparator can pass the benchmark gate. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":403,"duration_ms":454,"duration_api_ms":0,"num_turns":1,"result":"Your organization does not have access to Claude. Please login again or contact your administrator.","stop_reason":"stop_sequence","session_id":"f6df72d4-5d41-4388-abb9-acf0f025bc10","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"ser'; verification=unverified)
  • pdd/prompts/compression_benchmark_python.prompt:15: The prompt source of truth is missing the gate dependency, so repository architecture/include validation fails and future regeneration can drift from the checked-in architecture entry. (fixer=claude fixer_summary='All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":403,"duration_ms":454,"duration_api_ms":0,"num_turns":1,"result":"Your organization does not have access to Claude. Please login again or contact your administrator.","stop_reason":"stop_sequence","session_id":"f6df72d4-5d41-4388-abb9-acf0f025bc10","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"ser'; verification=unverified)

Fixes Attempted

  • round=1 fixer=claude fixer_result=failed push_status=not_attempted local_sha=none pushed_sha=none changed_files=none verification=unverified summary=All agent providers failed: anthropic: Exit code 1: {"type":"result","subtype":"success","is_error":true,"api_error_status":403,"duration_ms":454,"duration_api_ms":0,"num_turns":1,"result":"Your organization does not have access to Claude. Please login again or contact your administrator.","stop_reason":"stop_sequence","session_id":"f6df72d4-5d41-4388-abb9-acf0f025bc10","total_cost_usd":0,"usage":{"input_tokens":0,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":0,"ser

sohni-tagirisa added a commit that referenced this pull request Jul 10, 2026
…ules (#1980)

The branch-diff fast path in run_agentic_sync step 7 committed to
modules_to_sync = branch_modules unconditionally, silently under-scoping
relative to the modules the issue explicitly requests (repro from the
#1868 E2E validation: issue names greeter AND textutil, diff touches only
greeter -> only greeter synced, greeter->textutil edge dropped, Success
reported).

Fix: deterministically extract explicitly-named known modules from the
issue title/body and UNION any that the diff missed into the scope —
still zero LLM calls. Extraction matches only high-precision token
classes against the architecture inventory:

  1. backticked inline-code tokens resolving to a known basename
     (.prompt / language suffixes stripped),
  2. prompt-file path tokens (FILES_MODIFIED-style lists),
  3. bare word-boundary mentions, only for underscored basenames that
     cannot be ordinary prose words (a module named 'python' is never
     pulled in by prose; single-word modules require backticks or a
     prompt path).

When the diff already covers every issue-named module, behavior is
byte-for-byte unchanged. The added modules go through the existing
normalization / invalid-basename / ambiguity pipeline like every other
scope source. The #1396 runtime-LLM-only boundary and the #1883
PDD_CHANGED_MODULES authoritative-override arm are untouched.

The mocked E2E suite gains the under-scope repro
(test_branch_diff_scope_reconciled_with_issue_named_modules); the resume
test's state fixture now marks both fixture modules succeeded since the
fixture issue explicitly names both prompts.

Fixes #1980

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sohni-tagirisa added a commit that referenced this pull request Jul 11, 2026
…ules (#1980)

The branch-diff fast path in run_agentic_sync step 7 committed to
modules_to_sync = branch_modules unconditionally, silently under-scoping
relative to the modules the issue explicitly requests (repro from the
#1868 E2E validation: issue names greeter AND textutil, diff touches only
greeter -> only greeter synced, greeter->textutil edge dropped, Success
reported).

Fix: deterministically extract explicitly-named known modules from the
issue title/body and UNION any that the diff missed into the scope —
still zero LLM calls. Extraction matches only high-precision token
classes against the architecture inventory:

  1. backticked inline-code tokens resolving to a known basename
     (.prompt / language suffixes stripped),
  2. prompt-file path tokens (FILES_MODIFIED-style lists),
  3. bare word-boundary mentions, only for underscored basenames that
     cannot be ordinary prose words (a module named 'python' is never
     pulled in by prose; single-word modules require backticks or a
     prompt path).

When the diff already covers every issue-named module, behavior is
byte-for-byte unchanged. The added modules go through the existing
normalization / invalid-basename / ambiguity pipeline like every other
scope source. The #1396 runtime-LLM-only boundary and the #1883
PDD_CHANGED_MODULES authoritative-override arm are untouched.

The mocked E2E suite gains the under-scope repro
(test_branch_diff_scope_reconciled_with_issue_named_modules); the resume
test's state fixture now marks both fixture modules succeeded since the
fixture issue explicitly names both prompts.

Fixes #1980

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Add regression benchmark gate for context compression quality

1 participant