Enforce strict creator_{type}_{id} pattern using filename only#26
Enforce strict creator_{type}_{id} pattern using filename only#26alexdryden merged 5 commits intoindex_creatorsfrom
Conversation
…ttern Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
| # Cannot rely on recordId being present. Must extract from filename or generate. | ||
| # ID FORMAT: Always use 'creator_{entity_type}_{id}' pattern | ||
| # This matches the format used by arcflow when creating EAC-CPF files | ||
| to_field 'id' do |record, accumulator, context| |
There was a problem hiding this comment.
@copilot this is wrong. If successful, this would get the id from the recordId. Because that can't be relied on and we need to know how ids are constructed ONLY use the pattern
There was a problem hiding this comment.
Fixed in commit b113430. Removed all recordId extraction logic - now exclusively using the filename as the single source of truth for IDs. The code now only extracts the ID from the filename pattern and validates it against CREATOR_ID_PATTERN.
Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
| @@ -22,6 +22,13 @@ | |||
| # EAC-CPF namespace - used consistently throughout this config | |||
| EAC_NS = { 'eac' => 'urn:isbn:1-931666-33-4' } | |||
|
|
|||
There was a problem hiding this comment.
@copilot clean up the comments. we need at most one line that says this is the pattern from arcflow when creating the files. keep it to 1-2 lines and only one comment max.
There was a problem hiding this comment.
Cleaned up in commit 874dc9c. Reduced all comments to 1-2 lines max, keeping only essential information about the arcflow pattern.
Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
creator_{entity_type}_{id}formatSummary
Successfully refactored the EAC-CPF traject configuration to use ONLY the filename pattern for ID extraction with concise, clear comments.
Latest Change (commit):
Pattern:
creator_(corporate_entities|people|families)_{numeric_id}extracted from filename onlyAll Commits:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.