Skip to content

feat: add /codeboarding-feedback command to capture PR feedback via PostHog#32

Merged
brovatten merged 3 commits into
mainfrom
feedback-command
Jun 14, 2026
Merged

feat: add /codeboarding-feedback command to capture PR feedback via PostHog#32
brovatten merged 3 commits into
mainfrom
feedback-command

Conversation

@brovatten

Copy link
Copy Markdown
Member

What

Adds a lightweight /codeboarding-feedback <message> PR-comment command. When a comment's first word is /codeboarding-feedback, the action sends the message text and PR context to CodeBoarding via PostHog as an explicit codeboarding_feedback_submitted event, reacts 👍 to the comment, and exits before any checkout, engine setup, cache restore, or LLM-key handling — it never runs the expensive analysis path.

Implements feedback_plan.md.

How

  • scripts/submit_feedback.py — stdlib-only (no new deps; runs before engine setup). Strips the command token (internal newlines preserved, outer whitespace trimmed), caps text at feedback_max_chars, POSTs one event to PostHog /i/v0/e/, swallows every send failure, and never prints the feedback body. Mirrors Core's telemetry/service.py: same default public ingest key, CODEBOARDING_POSTHOG_KEY/CODEBOARDING_POSTHOG_HOST overrides, and DO_NOT_TRACK / CODEBOARDING_TELEMETRY=false opt-outs.
  • action.yml — new feedback_command (default /codeboarding-feedback) and feedback_max_chars (default 4000) inputs; an early feedback branch in the guard step (before the trigger/trusted-collaborator checks) that runs the script and exits with skip=true + feedback_received=true; a new Acknowledge feedback step gated on feedback_received. The existing Acknowledge command step stays scoped to analysis (skip != 'true').
  • README.md — a "Feedback command" subsection, two Inputs-table rows, and opt-out docs that state plainly this is explicit user-submitted feedback (the text you wrote + who wrote it + PR context), not anonymous telemetry.
  • tests/test_submit_feedback.py — 26 stdlib unittest cases.

Event

codeboarding_feedback_submitted, distinct_id = github-user:<sender_id> (fallback github-run:<run_id>), source = github_action_feedback, with feedback_text (capped), feedback_length, feedback_truncated, repository, repository_id, pr_number, comment_id, comment_url, author_association, sender_login, sender_id, run_id, run_attempt, action_ref.

Trust model

The feedback branch runs no PR-head code and sends no source, so — per the plan — it is intentionally not gated on author association; the calling workflow's own if: condition is the control point. The dogfood workflow already restricts comment triggers to OWNER/MEMBER/COLLABORATOR, and its startsWith('/codeboarding') filter already matches /codeboarding-feedback, so no workflow change is needed.

Verification

  • 149/149 unit tests pass; black clean (120 cols); action.yml YAML parses; shellcheck clean; actionlint adds zero findings.
  • End-to-end subprocess test of the real entry point: opt-out → no send; empty body → nothing sent; unreachable host → graceful swallow, exit 0, no feedback-text leak.

Notes

  • Privacy: unlike Core telemetry, this event deliberately includes repository, sender_login, and the user-written feedback_text. That is appropriate for explicit feedback and is documented in the README.
  • V1 posts directly to PostHog (public ingest key). A future CodeBoarding-owned intake endpoint could add rate-limiting, redaction, and routing to Slack/Discord/Linear/Issues.

…ostHog

On an issue_comment whose first word is /codeboarding-feedback, the guard
forwards the comment text and PR context to PostHog as an explicit
codeboarding_feedback_submitted event, reacts to the comment, and exits before
any checkout, engine setup, or LLM-key handling — so feedback never runs the
analysis path.

- scripts/submit_feedback.py: stdlib-only sender. Strips the command token
  (newlines preserved), caps at feedback_max_chars, sends one event, swallows
  all send failures, and never prints the feedback body. Mirrors Core's PostHog
  key/host defaults and DO_NOT_TRACK / CODEBOARDING_TELEMETRY opt-outs.
- action.yml: feedback_command + feedback_max_chars inputs; feedback branch and
  env in the guard; a 👍 Acknowledge feedback step gated on feedback_received.
- README: Feedback command subsection, Inputs rows, and opt-out docs that state
  plainly this is explicit user feedback (text + PR context), not anonymous
  telemetry.
- tests/test_submit_feedback.py: 26 stdlib unittest cases (extraction, multiline,
  truncation, opt-outs, host override, JSON shape, no-leak).
@codeboarding-review

codeboarding-review Bot commented Jun 14, 2026

Copy link
Copy Markdown

Architecture review · 14 components changed

graph LR
    n_Analysis_Orchestrator["Analysis Orchestrator"]
    n_Structural_Diffing_Engine["Structural Diffing Engine"]
    n_Mermaid_Visualization_Engine["Mermaid Visualization Engine"]
    n_UX_Integration_Layer["UX #amp; Integration Layer"]
    n_Analysis_Orchestrator -- "orchestrates codebase scanning and diff extract…" --> n_Structural_Diffing_Engine
    n_Analysis_Orchestrator -- "provides analysis metadata for final reporting" --> n_UX_Integration_Layer
    n_Structural_Diffing_Engine -- "provides structural change data for diagram gen…" --> n_Mermaid_Visualization_Engine
    n_Mermaid_Visualization_Engine -- "queries specific file changes for component ren…" --> n_Structural_Diffing_Engine
    n_Mermaid_Visualization_Engine -- "provides rendered diagrams for GitHub comments" --> n_UX_Integration_Layer
    n_UX_Integration_Layer -- "triggers feedback loops and telemetry based on…" --> n_Analysis_Orchestrator
    classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
    classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
    classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
    class n_Structural_Diffing_Engine,n_UX_Integration_Layer modified;
    linkStyle 5 stroke:#0b5d23,stroke-width:2px;
    linkStyle 0,1,2,3,4 stroke:#7d4e00,stroke-width:2px;
Loading

Colors indicate component changes compared to main: 🟩 Added · 🟨 Modified · 🟥 Removed

Structural Diffing Engine : 1 file changed
  • scripts/diff_to_mermaid.py
UX & Integration Layer : 1 file changed
  • scripts/submit_feedback.py

Explore this PR’s architecture in your browser or VS Code.

codeboarding-action · run 27483242044

@brovatten brovatten merged commit 2df93e2 into main Jun 14, 2026
2 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