Skip to content

Add the documented pairwise-duplicate failure case to 07-context-budget #4

Description

@josharsh

Example 07-context-budget declares its own failure mode in example.mjs:

Two individually useful snippets can duplicate each other. This small example scores novelty against alreadyKnown, not pairwise redundancy.

No case currently shows that failure. Add one. Give the state two non-mandatory snippets that both add the same new fact (say, the same deploy freeze date, worded differently), neither of which is in alreadyKnown, with a budget that fits both. The novelty scores will both be high, and the greedy packer at example.mjs#L24-L25 will select both.

Set expected and expectedDetails.selected to what the policy actually does today, and use the note to say plainly that this is the documented limitation, not the ideal answer. The CONTRIBUTING guide asks every example for "an ambiguous or failure case", and this is the natural one for 07.

If you want to go further, propose in the PR how a second pass could de-duplicate selected snippets pairwise without adding a dependent question to the same request. That part is optional.

Done when

  • New case in cases.mjs with authored Score fixtures (a probabilities array per rubric level, mean consistent with the distribution, as the existing cases do).
  • npm run check passes and the regenerated example README lists the new case.

How to work on this

  1. Fork, then git clone and run npm run check (Node 20.17+, no install step, no API key needed).
  2. Make the change, run npm run check and npm run docs (CI fails if a generated example README is stale).
  3. Open one focused PR. Say what you verified, and mention any substantial AI assistance (see CONTRIBUTING.md).

Comment here if you want to take it, and ask anything that is unclear.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions