Skip to content

Non-destructive apply + reaction-based scoring#4

Open
dsfaccini wants to merge 1 commit into
mainfrom
feat/merge-and-reactions
Open

Non-destructive apply + reaction-based scoring#4
dsfaccini wants to merge 1 commit into
mainfrom
feat/merge-and-reactions

Conversation

@dsfaccini

Copy link
Copy Markdown

Two capabilities that make braindump usable incrementally against a live repo, rather than as a one-off dump.

1. apply — non-destructive merge into a repo

generate writes to staging (data/<owner>/<repo>/7-generate/). The new apply command merges those files into an actual repo without clobbering hand-written content:

uv run braindump --repo owner/repo apply --into /path/to/repo [--dry-run]

Every generated file is fenced between <!-- braindump: ... --> and <!-- /braindump -->. On merge, only the fenced block is replaced; content above/below is preserved. If the target has no markers the block is appended; if it doesn't exist it's created. Topic docs under agent_docs/ are now fenced too, so nothing braindump writes clobbers manual edits — this applies uniformly to every generated .md. Files braindump doesn't generate are never touched.

2. Reactions as a human verdict on review comments

A 👍/👎 on a review comment is an explicit human verdict — the highest-precision signal in the pipeline. download now fetches reactor attribution for any comment that has reactions (only reacted comments are queried, so it's cheap). It feeds two things:

  • Reclaiming bot comments. Bot autoreview comments (github-actions[bot], coderabbitai[bot], …) are normally filtered out. A 👍 reclaims one as human-vetted signal, so you can curate a bot reviewer's output just by reacting to the good comments.
  • Scoring. The net thumbs signal across a rule's source comments adjusts its score: endorsed 1.25×, vetoed 0.4×. An endorsed single-PR rule can clear the score floor it would otherwise miss; a vetoed rule drops below it.

--reaction-authors alice,bob restricts which logins count (default: anyone). Reactions are captured at download but the allowlist is applied at extract, so changing it only needs a re-run from extract.

Notes

  • Score propagation: the reaction factor folds into calculate_rule_score, recomputed on dedupe merges (combining reaction_net across merged rules); place/group/generate inherit it with no changes.
  • Backward-compatible with existing staged data — new fields default to 0/empty when absent.
  • No test suite in this repo (per README), so changes were verified via targeted behavioral checks of the merge, reclaim, and scoring logic. Deferred (own follow-up): per-rule preservation via the <!-- rule:ID --> markers — block-level merge already protects hand-written content; edits inside the fence are still overwritten.

Two capabilities for running braindump incrementally against a repo:

- `apply --into <repo>`: merge generated AGENTS.md / agent_docs into a
  target repo, replacing only the content between the braindump markers
  and preserving hand-written content outside them. Topic docs are now
  fenced too, so nothing braindump writes clobbers manual edits.

- Reactions as a human verdict on review comments. `download` fetches
  reactor attribution for comments that have reactions. A 👍 reclaims a
  filtered bot autoreview comment as human-vetted signal; the net thumbs
  signal boosts (endorsed) or penalizes (vetoed) a rule's score, so an
  endorsed single-PR rule can clear the floor and a vetoed rule drops
  below it. `--reaction-authors` restricts which logins count.
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