LearnNewsExamplesServices
Frontmatter
id16148
titleAdd reviewer Memory Core provenance to PR review templates
stateClosed
labels
enhancementaitestingmodel-experience
assigneesneo-gpt
createdAtJul 30, 2026, 12:04 AM
updatedAtJul 30, 2026, 1:06 AM
githubUrlhttps://github.com/neomjs/neo/issues/16148
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 30, 2026, 1:06 AM

Add reviewer Memory Core provenance to PR review templates

Closed Backlog/active-chunk-10 enhancementaitestingmodel-experience
neo-gpt
neo-gpt commented on Jul 30, 2026, 12:04 AM

Context

PR authors already publish their Neo Memory Core origin session in the canonical pull-request body, which gives later peers a direct reasoning trail. The three committed PR-review template assets omit the reviewer's equivalent provenance, so a peer reading a formal review cannot jump directly from that artifact to the reviewer session that produced it.

The operator observed this as a friction-to-gold quick win on 2026-07-29. Memory Core prior-art also surfaced the critical identity boundary: this must be the peer-discoverable Neo Memory Core session UUID, not a harness transcript identifier.

Live latest-open sweep: checked the latest 20 open issues created-descending at 2026-07-29T22:03Z; no equivalent ticket found. The immediately preceding 30-message A2A claim sweep also found no overlapping lane. Semantic KB, Memory Core, exact GitHub search, and resources/content/{issues,discussions} sweeps found prior template-fidelity machinery but no owner for reviewer-session provenance.

The Problem

The provenance contract is asymmetric:

  • Pull-request authorship guidance carries Session <Origin Session ID>.
  • The review-response template carries Origin Session ID.
  • Formal review templates do not carry the reviewer's session.
  • validate_pr_review_body and the GitHub review-body lint enforce template shape, but therefore cannot prevent this provenance field from being omitted or left as a non-queryable placeholder.

Later peers can search semantically, but must reconstruct reviewer intent instead of querying the exact Neo Memory Core session. That is avoidable retrieval friction and weakens the review artifact as graph-ingestion substrate.

The Architectural Reality

Exactly three PR-review template assets exist:

  • .agents/skills/pr-review/assets/pr-review-template.md
  • .agents/skills/pr-review/assets/pr-review-followup-template.md
  • .agents/skills/pr-review/assets/pr-review-micro-delta-template.md

The full and follow-up shapes are validated by ai/services/github-workflow/PullRequestService.mjs; micro-delta has its own state-vector validation there. The mirrored GitHub enforcement lives in .github/workflows/agent-pr-review-body-lint.yml. Focused fixtures live in test/playwright/unit/ai/services/github-workflow/PullRequestService.spec.mjs.

Progressive-disclosure placement: the three assets are conditional Atlas payloads. .agents/skills/pr-review/SKILL.md is the always-loaded Map and should remain unchanged. Structure-map V-B-A confirms the validator belongs with its existing ai/services/github-workflow siblings; no new .mjs file or service is needed.

The Fix

Add one consistently named Origin Session ID field to each of the three template assets:

  • Full review: provenance beside Context & Graph Linking.
  • Follow-up: provenance beside the prior/current review anchors.
  • Micro-delta: provenance in the State Vector.

The value must be a concrete Neo Memory Core UUID. Extend both existing validation layers to reject a missing field, a template placeholder, or a non-UUID value for each of the three documented formats. Update the existing unit/workflow fixtures and add focused negative coverage.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
pr-review-template.md This ticket + current pull-request provenance precedent Requires Origin Session ID with the reviewer's Neo Memory Core UUID Placeholder or non-UUID remains invalid at submission Template asset Full-body positive + missing/malformed negative validator tests
pr-review-followup-template.md This ticket + existing follow-up skeleton contract Carries the current follow-up review session UUID, independent of prior review comment/session anchors Missing or malformed value fails preflight/lint Template asset Follow-up positive + negative validator tests
pr-review-micro-delta-template.md This ticket + existing micro-delta State Vector Carries the current micro-delta review session UUID in the State Vector Missing or malformed value fails the micro-delta path Template asset Micro-delta positive + negative validator tests
PullRequestService.validatePrReviewBody() / managed review guard Existing PullRequestService.mjs template-fidelity validator Accepts all three documented shapes only with a concrete UUID-shaped origin session Returns structured template-validation failure before GitHub dispatch JSDoc stays current Focused Playwright unit suite
Agent PR review-body workflow lint Existing .github/workflows/agent-pr-review-body-lint.yml parity layer Mirrors the service rule for gate-bearing reviews Posts the existing corrective lint comment and fails the check Workflow comments stay current Workflow-harness unit fixtures

Decision Record impact

None. This aligns the existing review-provenance and template-fidelity contracts; it does not change an ADR.

Acceptance Criteria

  • All three committed PR-review template assets include a clearly labeled Origin Session ID field for the reviewer's Neo Memory Core session UUID.
  • The field wording distinguishes the Neo Memory Core UUID from a harness transcript/session identifier.
  • Full, follow-up, and micro-delta review bodies with a concrete UUID pass validate_pr_review_body.
  • Each documented format fails closed when the field is missing, left as a placeholder, or malformed.
  • PullRequestService.mjs and .github/workflows/agent-pr-review-body-lint.yml enforce equivalent behavior.
  • Focused unit tests cover the positive and negative contract without issuing GitHub writes on validation failure.
  • node ai/scripts/lint/lint-skill-manifest.mjs --base origin/dev passes and the always-loaded pr-review/SKILL.md byte delta is zero.

Out of Scope

  • Adding a new MCP tool or changing Memory Core APIs.
  • Resolving or dereferencing the UUID against Memory Core during GitHub lint.
  • Retrofitting historical reviews.
  • Creating a fourth review template or expanding the blast-scaled shorthand format.
  • Changing PR-author or author-response provenance formats.

Avoided Traps

  • A template-only change would be advisory and drift immediately; both existing enforcement layers must move with it.
  • Accepting any free-form session token would preserve the harness-ID ambiguity rather than fix retrieval.
  • Adding provenance mechanics to the always-loaded SKILL.md would bloat the Map for a conditional review-composition detail.

Related

Related: #14688, #13547

Origin Session ID: 13ebbc76-8321-4446-8d0b-5f044e145bcd

Retrieval Hint: PR review Origin Session ID reviewer provenance three templates validate_pr_review_body

tobiu referenced in commit 1b9f080 - "feat(ai): add review origin session provenance (#16148) (#16149)" on Jul 30, 2026, 1:06 AM
tobiu closed this issue on Jul 30, 2026, 1:06 AM