Skip to content

Complete agent attribution coverage - #181

Merged
HamptonMakes merged 1 commit into
mainfrom
hampton/complete-agent-attribution
Aug 17, 2026
Merged

Complete agent attribution coverage#181
HamptonMakes merged 1 commit into
mainfrom
hampton/complete-agent-attribution

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Why

PR #178 attributed agent-created content, plan events, and comments, but two API audit paths still lost full agent identity: comment deletion events and library/folder events.

What

  • Persist agent name and API-token provenance on library events
  • Carry agent attribution through folder CRUD, bulk organization, plan placement, and comment deletion
  • Add direct provenance associations and expose library-event identity through the API
  • Add request coverage for each previously missing path

Risk Assessment

Low — this extends nullable audit metadata and leaves human/web attribution behavior unchanged.

Testing

  • Full suite: 1,485 examples, 0 failures
  • Focused attribution suite: 59 examples, 0 failures
  • RuboCop: 15 files, no offenses

Generated with Amp

@HamptonMakes
HamptonMakes marked this pull request as ready for review August 17, 2026 22:20

@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: 7a5074c2ec

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

add_column :coplan_library_events, :agent_name, :string
add_column :coplan_library_events, :api_token_id, :string, limit: 36
add_index :coplan_library_events, :api_token_id
add_foreign_key :coplan_library_events, :coplan_api_tokens, column: :api_token_id

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow deleting tokens that have library audit events

When a token has produced a library or folder event, this restrictive foreign key prevents the existing ActiveAdmin token deletion action from deleting it; it also causes User#destroy to fail because the user destroys associated API tokens. This newly affects tokens used only for library organization. Preserve the append-only event while allowing credential cleanup by nullifying api_token_id on token deletion, either through the foreign key or a corresponding dependent association.

Useful? React with 👍 / 👎.

@HamptonMakes
HamptonMakes merged commit 2ac2775 into main Aug 17, 2026
3 checks passed
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