Repository navigation
Preserve authorship when text moves - #286
HamptonMakes wants to merge 4 commits into
Conversation
|
🤖 @codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🤖 @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33e06584df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🤖 @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af2289f253
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
🤖 @codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What changed and why
CoPlan marked a person's writing as Unknown when they cut a section and pasted it elsewhere in the same document. A move could erase the original attribution, especially when autosave recorded the cut before the paste.
Preserve the original author and introduction version of exact lines when they move. Keep a bounded record of deleted lines across saves. Human, AI, and mixed sources retain their recorded origins; unrelated paste stays Unknown. Do not choose between conflicting origins for identical lines. Each saved occurrence supplies attribution once; additional copies retain their recorded input source. Save occurrence counts across cut and paste autosaves, including when an identical line remains. Recorded new human input takes priority over archived text, so repeated checkbox actions keep their latest person and version.
Advance the history policy so the existing background job rebuilds saved attribution after deployment. Include plans with cached summaries but no backfill checkpoint. The rebuild preserves document content and actor records. Historical input assumptions do not override known authorship when sections move.
Matching is limited to exact non-whitespace lines, including emoji-only and punctuation-only content. Deleted-line evidence is capped at 100,000 characters, 2,048 distinct lines, and 4,096 source runs. Text outside those limits uses the existing attribution rules.
The lint job uses Ubuntu 24.04 because the pinned Ruby setup action cannot install Ruby 3.4.7 on Ubuntu 26.04.
Evidence
The shared demo moves Hampton's architecture section below a proposal through separate cut and paste saves. Both themes show Hampton at 100% afterward.
How to try it
bin/rails coplan:demo:seedand sign in ashampton@example.com.Local tryout: http://localhost:3168/hampton/demo-content/writing-sources/moved-paragraphs-keep-their-author
Testing
The complete non-browser suites pass on MySQL and PostgreSQL: 2,422 examples per database. All 17 attribution browser specs pass. Focused RuboCop and
git diff --checkpass. The demo was checked in light and dark themes.Commands:
bundle exec rspecwas not run locally; both complete non-browser suites and the affected browser suite passed locally. All browser suites run in CI.Generated with Codex