Skip to content

Accept can silently overwrite an existing worked example #42

Description

@ryandmonk

Found during merged-main verification of #40 (c046ef8). Recording only.

build-view.tsx:50 prefills the Accept id from the turn index (ex.chat-${turn.id}), and the turn counter (state.tsx turnSeq) restarts at 1 on every page load. saveExample (apps/agent/src/project.ts) replaces an existing entry with the same id without asking:

  • session 2's first Accept silently destroys session 1's ex.chat-1;
  • an owner-authored example whose id happens to collide is replaced, losing its description and any x-* fields;
  • accepting several turns from one thread writes duplicate examples under distinct ids (no surface-level dedupe), and accepting a refinement stores the refinement instruction ("make the title clearer") as the example's prompt — that pair then becomes few-shot context for the intent, which is corpus poisoning rather than corpus growth.

The ledger, harness, and S1–S3 gates all behave correctly; the destructive part is id selection plus replace-without-confirmation. Candidate directions (not decided): content-addressed or timestamped default ids, an explicit overwrite confirmation when the id exists, storing the originating ask rather than the last instruction as prompt, and a corpus view with delete.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions