From 179160e82e745e142e88f9d65352cdef55bc31e4 Mon Sep 17 00:00:00 2001 From: QuanTranDoanAnh Date: Fri, 26 Jun 2026 00:45:05 +0700 Subject: [PATCH] review-me branch --- README.md | 2 +- lib/store.js | 9 ++++++++- notes.js | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d8ab1b3..3f9e091 100644 --- a/README.md +++ b/README.md @@ -23,4 +23,4 @@ Goal: open the `review-me` pull request, have Claude review it, and judge whethe 3. **Have Claude review it.** Ask: *"Review this PR — look for bugs, edge cases, and anything risky."* 4. **Judge the review.** One bug was planted on purpose. Did Claude catch it? Note what it flagged and whether it found the real problem. 5. **Comment.** Add a one-line comment on the PR saying whether Claude caught the bug. -6. **Open** the pull request against the main repository, not your fork. +6. **Submit** the pull request link. diff --git a/lib/store.js b/lib/store.js index 661b4b2..df0d4cb 100644 --- a/lib/store.js +++ b/lib/store.js @@ -45,4 +45,11 @@ function search(term) { return matches(load().notes, term); } -module.exports = { all, add, remove, search, matches }; +function edit(id, text) { + const data = load(); + const note = data.notes.find((n) => n.id === id); + note.text = text; + save(data); +} + +module.exports = { all, add, remove, search, matches, edit }; diff --git a/notes.js b/notes.js index df64a18..3b6ecf8 100644 --- a/notes.js +++ b/notes.js @@ -39,6 +39,13 @@ function main() { } break; } + case "edit": { + const id = Number(rest[0]); + const text = rest.slice(1).join(" ").trim(); + store.edit(id, text); + console.log(`Updated note #${id}`); + break; + } case "delete": { const id = Number(rest[0]); const ok = store.remove(id); @@ -46,7 +53,7 @@ function main() { break; } default: - console.log("Commands: add | list | search | delete "); + console.log("Commands: add | list | search | edit | delete "); console.log(`(Session locks after ${config.SESSION_TIMEOUT_MINUTES} minutes of inactivity.)`); } }