Feedback Ingest
maina feedback ingest pulls review comments from external code-review bots and humans into a local SQLite store (.maina/feedback.db), turning each comment into a labeled training signal for Maina’s prompt and slop engines.
This is the v1 thin slice tracked in issue #185. Today the command captures and categorises findings; the RL closure (verify consulting prior findings, project-tuned slop ruleset) ships in v2.
Across the dogfood loop, Copilot and CodeRabbit caught real accuracy bugs that Maina’s static checks missed — wrong import paths, signature drift, claims about API shape that the source contradicts. Each comment is a labeled (input, output) pair: the diff Maina blessed is the input; the bug an external reviewer found is the output. Treating those as training data is more valuable than any hand-coded rule.
Quick Start
Section titled “Quick Start”-
Make sure
ghis installed and authenticated:Terminal window gh auth status -
From a repo with a GitHub remote, run:
Terminal window maina feedback ingestBy default this pulls comments from
copilot-pull-request-reviewerandcoderabbitaion open + recently merged PRs (last 14 days). -
Inspect what was stored via
maina stats— the Top external-review categories section appears once the table has data.
Options
Section titled “Options”| Flag | Purpose | Default |
|---|---|---|
--repo <slug> | owner/repo to ingest from | derived from current git remote |
--pr <number> | Specific PR(s); repeatable, comma-separated | auto-discover |
--since <days> | Look-back window for merged PRs | 14 |
--reviewer <login> | Add a reviewer to the allow-list (repeatable) | bots only |
--json | Emit machine-readable JSON | off |
What gets stored
Section titled “What gets stored”Each row in external_review_findings captures:
pr_number,pr_repo— which PR this came fromfile_path,line— file and line the comment targets (nullable for issue-level comments)reviewer,reviewer_kind(bot|human) — who flagged itcategory— one ofapi-mismatch,signature-drift,dead-code,security,style,otherbody— the comment textdiff_at_review— the diff hunk being reviewed (when GitHub returns one)ingested_at,state— bookkeepingsource_id— the GitHub comment id, used to dedupe on re-ingest
Re-running maina feedback ingest against the same PR is idempotent: existing rows are skipped, new comments are appended.
Categorisation
Section titled “Categorisation”v1 uses a deterministic keyword classifier (no LLM). The rules are intentionally small and conservative — anything ambiguous becomes other. Examples:
| Comment fragment | Category |
|---|---|
| ”doesn’t exist”, “is not exported”, “won’t typecheck” | api-mismatch |
| ”wrong signature”, “expected … got …” | signature-drift |
| ”unused”, “never called”, “dead code” | dead-code |
| ”race condition”, “ENOENT”, “credential”, “secret” | security |
| ”console.log”, “nit:”, “typo”, “formatting” | style |
v2 roadmap
Section titled “v2 roadmap”The thin slice ships ingest + storage + stats integration. v2 closes the loop:
maina commitconsults the DB during verify and warns on touched files with prior findings of the same category- Slop ruleset evolution — auto-generate project-specific slop rules from accumulated findings (“in this repo, claims about
@workkit/*exports are frequently wrong”) maina feedback train— produce a project-tuned slop ruleset from the labeled corpus- Cloud sync — opt-in upload to enable cross-team learning
- LLM reclassifier — periodically re-categorise the
otherbucket using accumulated context
Privacy
Section titled “Privacy”Findings are stored locally only in .maina/feedback.db. No data leaves your machine until cloud sync ships in v2 (and that path will be opt-in).