Skip to content

Identify Content comments posted via AI - #4513

Merged
3mdistal merged 3 commits into
mainfrom
codex/content-ai-comment-attribution
Sep 8, 2026
Merged

Identify Content comments posted via AI#4513
3mdistal merged 3 commits into
mainfrom
codex/content-ai-comment-attribution

Conversation

@3mdistal

@3mdistal 3mdistal commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Comments submitted through MCP or the in-app agent currently look like comments the account holder posted personally. This change keeps the authenticated account as the author and adds a separate AI badge, with “Posted via AI on behalf of …” and the submission source available from the badge.

Content records the server-provided action caller when creating each comment or reply. The two new database columns are nullable and additive: historical comments remain unclassified, and edits or thread resolution preserve the original submission attribution. The same account-based access checks still apply. Notification emails carry the AI attribution too, and the UI strings are localized. Attribution and comment excerpts are HTML-escaped before entering email paragraph markup; regression tests use the real email renderer for MCP, in-app agent, and human submissions.

This describes how a comment was submitted, not whether AI wrote every word. MCP and native in-app action tools are covered. Local development agents that invoke actions through a shell still arrive as ordinary CLI calls; those remain unbadged because that path does not carry reliable agent provenance. Client/model names are not inferred.

Validation: 85 focused tests pass, including a real database create/read/edit/resolve round trip; direct Content TypeScript compilation and localization checks pass. A real local MCP call persisted the expected source and account. All 71 repository guards pass. Independent technical review has no remaining findings after the touch, card activation, and keyboard focus repairs. Independent browser QA passes source disclosure on desktop hover/keyboard and mobile tap, unbadged human replies and reload persistence, and attribution retention through resolve/reopen. A history-boundary recheck at 390px, 768px, and 1280px confirms the repaired history boundary keeps badge disclosure inside its panel and Reopen visibly settles in under one second. The final visual polish was separately checked at 390px and 1280px: the badge is 16px tall within a larger invisible hit target, avatar/name/badge alignment and quote/body indentation are consistent, and hover, keyboard, Escape, and touch disclosure pass. The earlier technical review has no remaining findings; the final delta only changes presentation. The final email-escaping repair passes all 15 notification tests, direct TypeScript compilation, and independent security review. A direct real-renderer assertion also confirms escaped attribution and excerpts decode back to readable plain text while remaining escaped in HTML: stripTags() in packages/core/src/server/email-template.ts decodes entities after stripping tags. The automated plain-text regression report does not reproduce. These are local development checks; no production acceptance is claimed.

The repository's Content typecheck wrapper emits a production database configuration warning in this local-only environment; direct TypeScript compilation passes. No production deployment was attempted.

content_product_impact:
  lane: product_decision_candidate
  features:
    - content.feature.collaborate-in-context
  capabilities:
    - content.comment.page-owned
  record_change: included
  proof:
    - pnpm --dir templates/content exec vitest run actions/add-comment.test.ts actions/comment-attribution.db.test.ts server/lib/comment-notifications.spec.ts server/plugins/db.spec.ts app/components/editor/CommentsSidebar.layout.test.ts app/i18n-data.local-files.test.ts
    - pnpm exec tsc --noEmit -p templates/content/tsconfig.json
    - pnpm guard:i18n-catalogs
    - pnpm guard:i18n-changed-copy
  rationale: The accepted attribution design separates the authenticated account from AI submission provenance without changing permissions or guessing historical authorship.

@netlify

This comment has been minimized.

@3mdistal
3mdistal marked this pull request as ready for review September 8, 2026 18:31
builder-io-integration[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Visual recap — generation failed

The visual recap could not be generated for this pull request. This is informational only and does not block the PR.

Diagnostic:

No plan URL: create-visual-recap failed 403 Forbidden: {"error":"Creating an org-visible visual recap requires an active organization. Connect Plan from an organization or publish with private visibility."}

Agent output: The supplied diff is actually 1,007 lines on disk (rather than the stated 610), so I completed the sequential pass through line 1,007 before authoring. The recap will represent the comment-sidebar entry, attribution tooltip, resolved-state card, persistence model, notification flow, every changed file, and six load-bearing code/test excerpts. stderr: Reading additional input from stdin... 2026-09-08T23:23:30.119086Z ERROR codex_core::tools::router: error=apply_patch verification failed: invalid patch: multiple operations target /home/runner/work/agent-native/agent-native/recap-source.json

@3mdistal
3mdistal requested a review from steve8708 September 8, 2026 18:55
builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Builder reviewed your changes and found 1 potential issue 🟡

Review Details

Incremental Code Review Summary

The latest PR head fixes the previously reported HTML injection issue by escaping attribution and comment excerpts before rendering email HTML, and adds regression coverage using the real email renderer. I verified that fix and resolved the prior review thread. The additive comment attribution schema, action caller mapping, per-comment UI badge behavior, localization, and updated sidebar layout remain consistent.

New Finding

Medium: The new escaping is applied to strings passed to renderEmail, which uses the same paragraph values for both HTML and plain-text output. Because the text path strips tags but does not decode HTML entities, recipients reading the plain-text email now see encoded content such as <script> and & instead of the original text. The implementation should provide separate HTML-safe and plain-text values, or update the renderer contract to decode entities for the text output.

Browser Testing

FULL browser verification was attempted because no previous run had produced verified results. The dev server and seeded routes were healthy, but all 17 planned UI cases were couldnt_verify because Chrome automation tools were unavailable in executor sessions.

Comment thread templates/content/server/lib/comment-notifications.ts
@3mdistal
3mdistal merged commit aace73a into main Sep 8, 2026
46 of 47 checks passed
@3mdistal
3mdistal deleted the codex/content-ai-comment-attribution branch September 8, 2026 23:11
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.

2 participants