feat(data-access): guidance + feedback_subject_id + code-patch export gate for feedback#1809
Conversation
… gate for feedback
ramboz
left a comment
There was a problem hiding this comment.
Summary
The new review-view fields and code-patch export gate are well tested, but the opt-out boundary now exports customer-derived patch and guidance content for organizations with training_opt_in=false.
Blocker
B1. Preserve the canonical opt-out boundary. Keep previous_fix and guidance_markdown stripped unless the product/privacy policy and authoritative database contract are revised together.
Verdict
Ready to merge: No
Reasoning: B1 can export customer-derived content contrary to the current opt-out contract.
For a deeper dedicated security pass, consider invoking /adobe-security-foundations followed by /adobe-security-lang.
absarasw
left a comment
There was a problem hiding this comment.
LGTM. The three-way rebalance across toJsonlRow / shouldExport / toReviewView / OPT_OUT_STRIPPED_FIELDS is clean and each choice matches its downstream contract.
OPT_OUT_STRIPPED_FIELDS = ['detail_markdown', 'edited_fix']— strips only human-authored fields, so opted-out orgs still contribute the AI half of the corpus (guidance_markdown+previous_fix). This is the right posture and it's now single-sourced here.toJsonlRowincludesguidance_markdownat top level, deliberately omitsfeedback_subject_id— matches the migration'sCOMMENT ON COLUMNin #790 ("NOT exported to S3"). The Learning Agent gets the AI issue context but not the Backoffice grouping key. ✓shouldExportgates onprevious_fix != null— text-guidance-only reviews stay in Postgres for the future text corpus, patch-carrying reviews export today. Correct.toReviewViewputsfeedbackSubjectIdin the base view (the Backoffice filter needs it on every read, not gated behind?include=patches) andguidanceMarkdownbehindincludePatches(64 KB, heavy — don't load unless needed). Right trade-off.
28 tests, coverage maintained, .d.ts in sync.
Minor observation: includePatches is now a slight misnomer since it also gates guidanceMarkdown — but renaming would ripple through every caller for a naming-only win. Not worth it.
Downstream sequencing noted in the PR body — the api-service + jobs-dispatcher bumps that consume these changes are the follow-up (cross-repo comment forthcoming).
Cross-repo seam check for the 4-PR batchPosting the cross-repo view here since #1809 is the shared library — the linchpin for the other three PRs. Reviewed all four side-by-side and walked each seam (per the CR-1 lesson from the previous round). Per-PR reviews on each PR are separate; this is the seam-level pass. PRs in the batch:
✅ Seams that agree
|
|
@absarasw Thanks for the thorough read. Agreed includePatches is a slight misnomer now that it also gates guidanceMarkdown; not worth rippling through every caller for a naming-only change — leaving as-is. |
|
This PR will trigger a minor release when merged. |
## [@adobe/spacecat-shared-data-access-v4.9.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v4.8.0...@adobe/spacecat-shared-data-access-v4.9.0) (2026-07-15) ### Features * **data-access:** guidance + feedback_subject_id + code-patch export gate for feedback ([#1809](#1809)) ([941b9f9](941b9f9))
|
🎉 This PR is included in version @adobe/spacecat-shared-data-access-v4.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Feedback-event model changes for the Learning Agent loop (SITES-43974).
toJsonlRownow emitsguidance_markdown.OPT_OUT_STRIPPED_FIELDS) now strips only the human-authored fields (detail_markdown,edited_fix). The AI-generatedguidance_markdown+previous_fixand all metadata always ship.shouldExportnow requires a code patch (previous_fixpresent) and notproduct_bug. Text-guidance-only feedback stays in Postgres and is not exported (reserved for a future text-guidance corpus).toReviewViewreturnsfeedbackSubjectId(base view, for per-issue grouping) andguidanceMarkdown(with patches)..d.tsupdated.Testing
Downstream
bump
@adobe/spacecat-shared-data-accessafter release: spacecat-jobs-dispatcher (export gate + guidance in JSONL) and spacecat-api-service (read view returns the new fields).Please ensure your pull request adheres to the following guidelines:
Related Issues
Jira: https://jira.corp.adobe.com/browse/SITES-43974
Thanks for contributing!