docs(rfc): Spike for reconstructing the narrative#1328
Merged
robertmitchellv merged 5 commits intoJun 11, 2026
Conversation
Contributor
🔒 Security Scan Results
|
| Severity | Total |
|---|---|
| 🟠 High | 12 |
| 🟡 Medium | 3 |
📦 refiner-app
✅ No vulnerabilities found
📦 refiner-lambda
| Severity | Count |
|---|---|
| 🟠 High | 4 |
📦 refiner-ops
| Severity | Count |
|---|---|
| 🟠 High | 8 |
| 🟡 Medium | 3 |
View detailed results: Security tab
Last updated: 2026-06-11 16:17:34 UTC
jakewheeler
approved these changes
Jun 10, 2026
jakewheeler
left a comment
Collaborator
There was a problem hiding this comment.
Great work Robert 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔀 PULL REQUEST
💡 Summary
Adds RFC proposing how the refiner will rebuild a section's human-readable
<text>from the entries that survive pruning, starting with Results, Problems,Medications, and Immunizations.
This is documentation only--no application code changes. The RFC records the
architecture decision and the reasoning behind it; implementation follows in a
later PR once the approach is reviewed.
In short, the chosen approach ("Option C") splits the work into three layers:
shared mechanical primitives written once (a typed-value renderer, a field
extractor, a table builder); per-section field maps as data (keyed by
template_id); and short per-section join functions as code that handle thestructural reach into ancestors/siblings. The RFC explains why this beats both a
fully-hardcoded approach and a fully-data-driven one, and how the field maps
become a down payment on the future template-aware matching engine without
building it now.
A runnable companion script (
reconstruction_toy.py) demonstrates the designend-to-end on a small eICR fragment.
Please review the RFC itself for the full context, options comparison, and
deferred questions:
docs/rfc/0010-narrative-reconstruction.md🔗 Related Issue
Fixes #1241
✅ Acceptance Criteria
🧪 How to test
You can run the toy example folded into the RFC if you'd like to test things out.
ℹ️ Additional Information