Skip to content

core: recap contract — pipeline skills run in pre-review, briefing artifacts land in ~/.cockpit/recaps#27

Merged
alejandro-nexcade merged 2 commits into
mainfrom
alejandro/recap-contract
Jul 3, 2026
Merged

core: recap contract — pipeline skills run in pre-review, briefing artifacts land in ~/.cockpit/recaps#27
alejandro-nexcade merged 2 commits into
mainfrom
alejandro/recap-contract

Conversation

@alejandro-nexcade

Copy link
Copy Markdown
Collaborator

What

PR 3/7 of the overnight UX program (Track A backend — cockpit-docs/OVERNIGHT_UX_PLAN.md). Stacked on #26.

  • Recap directory contract: recaps_dir() / recap_dir_for_pr (findings-style slug); agent writes recap.mdx + *.excalidraw scenes there.
  • should_run_review_skills lens gate: diff is L/XL or touches rendered-UI files — exactly the promise the Skills UI copy makes.
  • Review prompt gains a delimited ## Visual Recap section (after Output, before Project Conventions) instructing the agent to invoke each review-pipeline skill (e.g. visual-recap) and write outputs to the recap dir. Inactive path is byte-identical — both existing goldens untouched, pinned by test; new golden covers the active section.
  • Review.recap_sha: string | null — head sha at generation; ingest sets it when recap.mdx is non-empty; refresh preserves it (staleness = sha vs head; Briefing shows a regenerate nudge). Recap files are never auto-deleted.
  • get_review_recap command → { mdx, scenes[], sha }; slug-derived path only, 2 MiB scene cap (symlink-safe + post-read re-check), non-UTF8 skipped, read-only.
  • start_pre_review wires it: recap dir pre-created, allow_write_under, pipeline-skill resolution fail-open (§0.1).
  • Reviewer MINORs applied: fs::metadata for the scene cap + local whitespace-flattening where skill frontmatter enters the prompt.

Verified

cargo fmt --check · clippy -D warnings · cargo test (567 across suites) · tsc · vitest 290 · vite build — all green. Golden regeneration: none of the two existing goldens changed (verified no-op); one new golden added deliberately.

🤖 Generated with Claude Code

LifeLex and others added 2 commits July 3, 2026 09:35
Let the advisory pre-review agent produce a /visual-recap-style briefing
that cockpit can render, gated by diff size / rendered-UI touch.

core:
- config: recaps_dir() + recap_dir_for_pr(&PrRef) (findings slug scheme);
  RECAP_MDX_FILE const shared by prompt/ingest/read.
- diff_signals: should_run_review_skills(signals, diff) — true for L/XL or
  a diff touching {tsx,jsx,css,scss,vue,svelte,html}; unit-tested.
- prompt: ReviewInput gains pipeline_skills + recap_dir; assemble_review_prompt
  appends a Visual Recap section after Output only when both are set. Inactive
  output is byte-identical to before (asserted), so review_prompt.txt and
  review_prompt_panel.txt are UNCHANGED; added review_prompt_recap.txt for the
  active section.
- model: Review.recap_sha (Option<String>, serde default, `string | null`
  binding). Deliberately NOT cleared on refresh.
- recap: new module reading recap.mdx + *.excalidraw scenes (sorted, 2 MiB
  cap, fail-open) into RecapPayload/RecapScene.

app:
- start_pre_review: create+authorize recap dir, resolve in_review_pipeline
  skills (fail-open), compute the gate, pass both into the prompt.
- ingest_review_findings: set recap_sha = current head_sha when a non-empty
  recap.mdx exists; recap files are never deleted. refresh preserves recap_sha
  (extracted clear_head_anchored_annotations helper, unit-tested).
- get_review_recap command (registered) → RecapPayload.
- regenerated bindings; updated Review fixture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@LifeLex LifeLex force-pushed the alejandro/recap-contract branch from 10dae8b to e7d7dd0 Compare July 3, 2026 08:35
@alejandro-nexcade alejandro-nexcade merged commit 38882c5 into main Jul 3, 2026
2 checks passed
@LifeLex LifeLex deleted the alejandro/recap-contract branch July 3, 2026 08:48
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