Skip to content

reconcile: review-feedback classifier — normalize upstream events into … - #1158

Open
warren-run-bot wants to merge 2 commits into
mainfrom
warren/run_h9cmhtxh2twm
Open

reconcile: review-feedback classifier — normalize upstream events into …#1158
warren-run-bot wants to merge 2 commits into
mainfrom
warren/run_h9cmhtxh2twm

Conversation

@warren-run-bot

Copy link
Copy Markdown
Collaborator

Summary

feat(campaign-controller): review-feedback classifier via profile-declared bot grammar (warren-2ec3)

Run

  • Warren run: run_h9cmhtxh2twm
  • Agent: pi
  • Cost: $0.672 (62.7k in / 23.0k out / 3.2M cache-r)

Seeds

  • warren-2ec3 — reconcile: review-feedback classifier — normalize upstream events into actionable categories via profile-declared bot grammar (untrusted-input discipline)

Commits (2)

  • 7bb2a71 feat(campaign-controller): review-feedback classifier via profile-declared bot grammar (warren-2ec3)
  • c7ff72f chore: close warren-2ec3, record classifier pattern (warren-2ec3)

Files changed

.../profiles/openclaw.repository-policy.json       |  10 -
 .../src/openclaw-profile.test.ts                   |  30 +-
 .../src/reconcile/bot-grammar.ts                   | 182 +++++++++
 .../src/reconcile/classifier.test.ts               | 432 +++++++++++++++++++++
 .../src/reconcile/classifier.ts                    | 233 +++++++++++
 .../src/reconcile/reconciler.ts                    |  44 +++
 .../src/repository-policy.test.ts                  |  84 +---
 .../campaign-controller/src/repository-policy.ts   |  66 ----
 extensions/campaign-controller/src/store/events.ts |  88 ++++-
 extensions/campaign-controller/src/store/schema.ts |  18 +
 .../src/store/state-store.test.ts                  |   4 +-
 extensions/campaign-controller/src/store/types.ts  |  12 +
 .../campaign-controller/src/tick/tick.test.ts      |  32 --
 extensions/campaign-controller/src/tick/tick.ts    |  27 +-
 14 files changed, 1014 insertions(+), 248 deletions(-)

Prompt

Show prompt
Work seeds issue warren-2ec3. First run `sd show warren-2ec3 --json` from the repo root — the issue body is the full spec; this summary is only a digest.

Task digest: build the review-feedback classifier in the campaign-controller reconcile path: normalize upstream PR events (review-bot comments, reviews, check results) into actionable categories via profile-declared bot grammar (bot logins, marker formats, re-review commands as data). Untrusted-input discipline is mandatory: pass through only structured fields (check names, file paths, finding titles) with provenance marked untrusted — never raw comment bodies as instructions. Classification only; do not build the follow-up coordinator that consumes it (sibling issue warren-0ad3).

Context: this issue is one step of plan pl-096b (upstream contribution loop v1, repo-agnostic phase 3) for the campaign-controller. The extension lives in extensions/campaign-controller/ — a standalone package with its own package.json, lockfile, and tests. For extension work, run `cd extensions/campaign-controller && bun install && bun test` and keep the extension green. Extensions never import src/ or scripts/ (check:layers enforces this).

IMPORTANT — parallel session: several sibling issues from this plan are being worked simultaneously by other agents. Keep your diff strictly scoped to what this issue requires; do not refactor shared files beyond your scope, or the PRs will conflict.

Quality gates are terminal: `bun run check:all` from the repo root must be green before you commit and report done. If you touched extensions/campaign-controller, its own `bun test` must also pass.

When the work is complete and gates are green: close the issue with `sd close <id> --reason "<evidence-citing reason>"`, then commit everything (including .seeds/ changes).


🤖 Opened by warren run run_h9cmhtxh2twm

…lared bot grammar (warren-2ec3)

Adds a classifier stage after reconcile event ingestion: upstream PR
events normalize into per-work-item feedback categories (failing_check,
changes_requested, review_bot_findings, maintainer_question,
re_review_available, pr_merged, pr_closed) using bot grammar declared as
profile data (bot logins, durable-comment markers, finding-line
grammars with named capture groups, re-review command patterns) —
validated fail-closed at profile load (src/reconcile/bot-grammar.ts).

Untrusted-input discipline: classified rows carry only structured
extracted fields, each stamped provenance=untrusted; raw comment bodies
never pass onward, and no comment text can trigger a controller action
(re-review commands match in full against profile patterns only).

Feedback rows are durable in classified_feedback (migration 002),
deduplicated by (campaign, source node id, category), and stored via
the reconciler when a target declares a botGrammar. Classification
only — the follow-up coordinator is warren-0ad3.
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