Skip to content

Preserve authorship when text moves - #286

Draft
HamptonMakes wants to merge 4 commits into
mainfrom
hampton-preserve-moved-authorship
Draft

HamptonMakes wants to merge 4 commits into
mainfrom
hampton-preserve-moved-authorship

Conversation

@HamptonMakes

@HamptonMakes HamptonMakes commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Moved writing retains Hampton's authorship in light mode

Moved writing retains Hampton's authorship in dark mode

How to try it

  1. Seed the shared demo library with bin/rails coplan:demo:seed and sign in as hampton@example.com.
  2. Open Demo library → Writing sources → “Moved paragraphs keep their author.”
  3. Open the authorship icon. Expect Hampton at 100% after the section moves.
  4. Choose “Inspect writing” and hover the moved paragraph. Expect its original author and “Added in v1.”

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 --check pass. The demo was checked in light and dark themes.

Commands:

DATABASE_URL=mysql2://root@localhost/coplan_c8ea_provenance_test bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' --seed 50820 --format progress --format json --out tmp/provenance-mysql-rspec-results.json
DATABASE_URL='postgresql://hampton@localhost:5432/coplan_c8ea_provenance_pg_test?encoding=unicode' SCHEMA=tmp/provenance-pg-schema.rb bundle exec rspec --exclude-pattern 'spec/system/**/*_spec.rb' --seed 50820 --format progress --format json --out tmp/provenance-postgres-rspec-results.json
DATABASE_URL=mysql2://root@localhost/coplan_c8ea_provenance_ui_test bundle exec rspec spec/system/writing_provenance_spec.rb
  • Added a real browser regression for cut, autosave, paste, and source inspection.
  • Added service, history-rebuild, job, and repeatable demo coverage.
  • Full bundle exec rspec was not run locally; both complete non-browser suites and the affected browser suite passed locally. All browser suites run in CI.
  • Checked the affected UI in both light and dark themes.
  • Attached screenshots demonstrating retained authorship in both themes.

Generated with Codex

@HamptonMakes

Copy link
Copy Markdown
Collaborator Author

🤖 @codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:10:34.352006Z 7c8cd3e Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@HamptonMakes

Copy link
Copy Markdown
Collaborator Author

🤖 @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@HamptonMakes

Copy link
Copy Markdown
Collaborator Author

🤖 @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@HamptonMakes

Copy link
Copy Markdown
Collaborator Author

🤖 @codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 7c8cd3ec77

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant