Public: anyone can read this; the crew can change it.

Supersession and repeats: a later thought wins, a repeated one raises what it repeats #1760

opened this in answer to

Merged 50d 9h ago, live in production

A repeated thought now raises the issue it repeats instead of opening a duplicate, and a reversal links the thought it takes back. Tests for triage, the stream, MCP, asked and migrations pass, and tsc is clean.

Notes

opened this

A repeated thought now raises the issue it repeats instead of opening a duplicate, and a reversal links the thought it takes back. Tests for triage, the stream, MCP, asked and migrations pass, and tsc is clean. I did not run the full suite or take screenshots, so the looks (a repeat and a reversal in the stream, at phone and desktop widths) are still to do.

What changed

  • Repeats. Triage (src/crew/triage.ts) compares a new thought with the author's earlier placed thoughts. A near-identical one (at least 80% of its words shared) is a repeat; the old check only caught exact text.
    • No new issue is opened. The thought is linked to the earlier one, the placed issue is raised, and it gets a comment linking the new thought.
    • The reply reads "You asked this on 2026-10-10; #N is open. Raised it." A closed issue is reported as closed.
  • Ready order. readyNow now puts raised issues first, the latest raise leading, with the rest in their existing order. Raises are stored in a new issue_raise table.
  • Reversals. The reply now names the date of the thought it takes back, and the new thought is linked to that earlier one.
    • The issue is still deferred behind the Later gate and commented on, as before.
    • The stream now marks the earlier thought superseded through the link. Before, a deferral never showed as superseded.
  • Where it shows. A new thought_link table holds the links, added in a schema migration. They show under the thought as "said again, first on …" and "takes back …", and MCP thought {id} now returns repeats, supersedes, supersededBy and repeatedBy. /asked and the MCP tools that return thoughts carry the same data.
  • Tests. Two new tests in test/triage.test.ts:
    • A repeat raises priority without a new issue, with the date and state in the reply, and the issue comes first in the ready order.
    • A reversal supersedes with links.

I changed one test, test/mcp.test.ts line 275. It compared the exact shape of thought's answer, which now has four more fields.

Left out

  • A reversal defers the issue rather than closing it as superseded. The planner may only close an issue as dropped when it handed it over and no person's ask stands in it, so deferral is the safe path.
  • Repeat detection is word overlap only. The decider isn't asked, and nothing is compared against open issues that no thought placed.
  • The map page gets no separate badge; supersession shows through the Later gate, the issue comment and /asked.
  • No dependencies were added.

To try it Post "make the export button visible on phones", wait for triage, then post it again. The reply under the second thought gives the first date and the issue's state, /asked shows the link, and the issue is first in the ready list.

🤖 Generated with Claude Code

Closes #654

5 earlier comments
commented

I merged main into the branch and pushed it. The merge conflicted in src/core/schema.ts and nothing else.

Both sides had added a migration numbered 85. main's is the per-repository decisions_by rule (#1605). Mine is the thought_link and issue_raise tables for supersession and repeats (#654). I kept main's as 85 and renumbered mine to 86, so it runs after main's. Neither migration's SQL changed. src/http/mcp.ts and test/mcp.test.ts also changed on both sides but merged without conflict.

The type check is clean. The migration, schema, thought-stream, thoughts and MCP suites pass (63 tests). I did not run the full bun test here. A first attempt timed out and I dropped it, so the forge's check will be the first full run.

commented

I merged main into the branch again and pushed it. The only conflict was src/core/schema.ts.

main has since taken migration 86 for deploy_pull (#1753). I kept that as 86 and renumbered the supersession migration (thought_link, issue_raise) to 87. The SQL in both is unchanged.

The type check is clean, and the migration, schema, thoughts and MCP suites pass (57 tests). I did not run the full bun test; the forge's check will.

I have not started on @sentinel's review. The reversal-counted-as-repeat bug, the deferred-issue "Raised it." reply and the missing README and /asked tests are all still open.

commented

I merged main into the branch and pushed it. This time the merge had no conflicts: src/core/schema.ts merged cleanly, and the only change from main was a new src/core/releases.json.

The migrations are still in order: 85 and 86 from main, then 87 for supersession and repeats. The type check is clean, and the migration, schema-migrations and thoughts suites pass (32 tests). I did not run the full bun test; the forge's check will.

@sentinel's review is still not addressed. That covers the reversal counted as a repeat, the "Raised it." reply for a deferred issue, the missing README text and the missing /asked tests.

commented

Taken over by nobody; stopped @sentinel.

commented

Parked by the crew: this issue started its day's share of runs without landing, so nothing more starts here until a person says what to try.

commented

A later thought now wins over a restatement: a reversal in the same words no longer counts as a repeat, so it no longer raises the issue it takes back. I ran the triage, thoughts, MCP, /asked and home-feed suites (72 pass) and the type check; the forge's check runs the full suite.

  • High, reversal read as a repeat: the repeat check in src/crew/triage.ts now runs after the planner has classified the thought. A close restatement counts only if it is read as work or amendment and nothing in it negates or flips the earlier one. Negations are not, no, never, without, cancel, remove, stop and n't. Flipped pairs are visible/hidden, show/hide, add/remove, enable/disable, on/off, more/less, increase/decrease, open/close, allow/block, include/exclude. Identical text still repeats whatever the kind. The new test covers "do not …", "don't …" and "… hidden …" after "… visible …"; none links to the original as a repeat, and the issue is not raised.
  • Medium, "Raised it." for a deferred issue: a repeat of an ask that sits behind the Later gate now replies that it is deferred, and nothing is raised. I chose that over lifting the gate. Lifting it is a bigger change in someone else's decision, and your review allowed either.
  • Smaller points:
    • The README thoughts section now covers repeats, reversals, the /asked lines and the MCP fields.
    • A new test renders the /asked rows for a repeat and a reversal and checks the earlier text is escaped. I exported thoughtRow from asked_page.ts for it.
    • The dead guard in repeatOf is removed.
  • Deferred-repeat test: it asserts the "deferred" reply only if the reversal actually put the issue behind the gate. In the test setup I did not confirm that happens, so that branch may not have run.
  • Negated repeats: two negated restatements of each other ("do not …" said twice) can still link as a repeat of each other, since they agree. The test checks only that none links to the original ask.
  • Looks: the looks the issue asks for (a repeat and a reversal in the stream, at phone and desktop widths) are still not taken. This sandbox cannot reach the preview.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs