cortex_context_pack
Select and pack relevant context chunks under a token budget using dynamic programming, reserving the top-ranked failed-attempt warning first.
Instructions
Optimal 0/1 dynamic-programming knapsack context selector (ROMS engine) that reserves the highest-ranked failed-attempt warning first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| costs | Yes | Character/token costs of candidate chunks | |
| budget | Yes | Maximum character/token budget | |
| values | Yes | Relevance value scores of candidate chunks | |
| required_index | No | Mandatory failed-attempt warning index (-1 if none) |