Skip to content

Add default-off skill prompt dedup canary#55

Open
SecretSettler wants to merge 1 commit into
feat/prompt-dedup-ab-harnessfrom
feat/skill-prompt-dedup-canary
Open

Add default-off skill prompt dedup canary#55
SecretSettler wants to merge 1 commit into
feat/prompt-dedup-ab-harnessfrom
feat/skill-prompt-dedup-canary

Conversation

@SecretSettler

Copy link
Copy Markdown
Member

Summary

  • Add the first runtime gray/canary replacement path for prompt dedup, default OFF
  • Gate by env: CONTEXTPILOT_PROMPT_DEDUP_MODE=off|shadow|canary and kill switch CONTEXTPILOT_PROMPT_DEDUP_DISABLE=1
  • Only mutates in canary mode, only same_type_skill_prompt_only exact duplicate blocks
  • Keeps first occurrence verbatim; replaces later duplicates only if the reference is strictly shorter
  • Never touches ordinary system, cross-type system/skill, user, assistant, or tool content
  • Adds broad safety denylist for hard instruction/safety/security/tool/auth/secret/must/never/always/required/etc. blocks
  • Adds metadata-only telemetry fields for realized prompt-dedup savings
  • Documents canary usage and rollback

Verification

  • /usr/local/lib/hermes-agent/venv/bin/python -m pytest tests/test_prompt_dedup_canary.py tests/test_hermes_plugin_patch.py -q
  • /usr/local/lib/hermes-agent/venv/bin/python -m pytest tests/test_prompt_dedup_canary.py tests/test_hermes_plugin_patch.py tests/test_hermes_context_opportunity_analyzer.py tests/test_contextpilot_savings.py tests/test_contextpilot_savings_skill.py tests/test_hermes_contextpilot_monitor.py -q
  • /usr/local/lib/hermes-agent/venv/bin/python scripts/analyze_hermes_context_opportunities.py --since-hours 24 --out-dir /tmp/contextpilot_canary_check --date canary_check --top-n 5
  • /usr/local/lib/hermes-agent/venv/bin/python -m pytest -q
  • Claude Code read-only review: PASS, no blockers

Full tests: 532 passed, 37 skipped, 3 warnings.
Stacked on PR #54.

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