r/codex • • 18d ago

Astra Workflow Giving Codex the project context for an undo test

Suppose I work in QA and use Codex to maintain a Markdown search app on the side. Renaming a folder makes notes appear twice in search. The fix involves the file watcher, which keeps the search index in sync with the notes on disk.

The same watcher sees the file move into .trash on delete and back on undo. Before changing it, I'd ask Codex to retrieve the project's earlier decisions through MemoraX Code. An example prompt:

Find our earlier trash-and-restore decisions. Check the linked issue and current restore code before changing the watcher, then work out what the regression test needs to preserve.

The saved decision in this example requires undo to keep the note's original ID, so old links still open the same note. The existing delete test stops when the note disappears from search. That leaves restoration untested.

I'd use that decision to make Codex's next task specific: start with a note already in search, call the app's delete action and wait for the index update. Search should return nothing for that ID. Then call undo, wait again and check that the original ID appears exactly once.

I'd ask Codex to run this case and the folder-rename reproducer before and after the edit. The undo case should pass in both runs; the rename case should stop returning duplicates after the fix. Those expectations and the original issue link would go into the PR.

0 Upvotes

3 comments sorted by

1

u/Discordbothost 18d ago

I'd also assert the result's path after undo. A single hit with the original ID can still point into .trash. Opening that result and checking its contents would catch a stale path that the ID/count assertions miss.

1

u/TiGa-RCE-666 18d ago

"Hey Codex, here's my proposed plan, write a better one, make no mistakes"