Skip to content

[major] Forcing fresh authoring (deleting output-*) mints a new testcase_id → duplicate TMS cases; need a re-author-in-place flag #130

Description

@tlemmonds

Environment: kane-cli 0.4.10 · Node 24.14.1 · Windows 11

Summary
The replayable action cache and the TMS case identity live in the same directory. output-<stem>/.internal/meta.json holds the testcase_id that --name reads to update a case in place:

{"testcase_id":"01KWTZ0VYX…","session_name":"Orig-Approve-AtCap","test_id":"cbfe0d13-…","project_id":"","folder_id":""}

Because the only reliable way to avoid brittle replay (companion issue) is to delete output-<stem>/, doing so also deletes the testcase_id. The next testmd run --name <same> can't find the existing case and creates a new one. Iterating a test to green therefore litters the folder with duplicates — we accumulated ~25 TMS cases for 11 tests this way.

Steps to reproduce

  1. kane-cli testmd run t_test.md --name Foo → creates TMS case A (id stored in output-t/.internal/meta.json).
  2. rm -rf output-t/ (needed to dodge brittle replay), then kane-cli testmd run t_test.md --name Foo again.
  3. A second TMS case is created instead of updating case A.

Impact
You must choose one of:

  • reliable runs (clear cache → fresh authoring → duplicate TMS cases), or
  • stable case identity (keep cache → brittle replay).

There is also no CLI to delete a TMS case, so cleanup is manual in the dashboard.

Ask

  • Decouple the action cache from the TMS-case mapping — persist testcase_id (and project/folder) separately from the replayable step-actions, so clearing replay state doesn't orphan the case; and/or
  • Add a --reauthor / --fresh flag that re-authors from scratch but keeps the same testcase_id (updates in place); and
  • Add a testmd delete --remote (or test-cases delete) for dashboard-free cleanup.

Notes
Root cause of the duplicate-case symptom is the coupling; brittle replay is what forces the cache-clear that triggers it. Fixing the replay reliability removes the need for the workaround entirely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions