Plan auto capture of provenance metadata (2.2.5 ExecPlan)#147
Draft
Plan auto capture of provenance metadata (2.2.5 ExecPlan)#147
Conversation
…provenance metadata automatically in TEI headers Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Reviewer's GuideAdds a new ExecPlan document that defines the staged implementation plan, architecture boundaries, interfaces, and validation/acceptance criteria for automatically capturing provenance metadata in TEI headers across both ingestion and script-generation flows, without making any code changes. Sequence diagram for provenance capture in TEI header generationsequenceDiagram
actor User
participant IngestionAdapter
participant ScriptGenerationAdapter
participant CaptureProvenance
participant ClockPort
participant ReviewerIdentityPort
participant SourcePriorityPort
participant TEIHeaderAdapter
alt Ingestion flow
User->>IngestionAdapter: submit ingestion request
IngestionAdapter->>CaptureProvenance: assembleProvenance(ingestion, sources, reviewerContext)
else Script generation flow
User->>ScriptGenerationAdapter: request script generation
ScriptGenerationAdapter->>CaptureProvenance: assembleProvenance(script_generation, sources, reviewerContext)
end
CaptureProvenance->>ClockPort: nowUtc()
ClockPort-->>CaptureProvenance: timestamp
CaptureProvenance->>ReviewerIdentityPort: resolveReviewer()
ReviewerIdentityPort-->>CaptureProvenance: reviewerIdentity
CaptureProvenance->>SourcePriorityPort: resolveSourcePriorities(sources)
SourcePriorityPort-->>CaptureProvenance: orderedSourcePriorities
CaptureProvenance-->>IngestionAdapter: ProvenanceRecord
CaptureProvenance-->>ScriptGenerationAdapter: ProvenanceRecord
IngestionAdapter->>TEIHeaderAdapter: renderHeader(ProvenanceRecord, existingHeader)
ScriptGenerationAdapter->>TEIHeaderAdapter: renderHeader(ProvenanceRecord, existingHeader)
TEIHeaderAdapter-->>User: TEI with provenance header
Class diagram for provenance capture domain, application service, and portsclassDiagram
class ProvenanceRecord {
+operationType string
+sources SourcePriority[]
+timestamp IngestionTimestamp
+reviewer ReviewerIdentity
}
class SourcePriority {
+sourceId string
+priority int
}
class ReviewerIdentity {
+id string
+displayName string
}
class IngestionTimestamp {
+value datetime
}
class CaptureProvenance {
+assembleProvenance(operationType string, sources SourcePriority[], reviewerContext ReviewerIdentity) ProvenanceRecord
}
class ClockPort {
<<interface>>
+nowUtc() datetime
}
class ReviewerIdentityPort {
<<interface>>
+resolveReviewer() ReviewerIdentity
}
class SourcePriorityPort {
<<interface>>
+resolveSourcePriorities(sources string[]) SourcePriority[]
}
class IngestionAdapter {
+handleIngestionRequest(rawSourceMetadata any)
}
class ScriptGenerationAdapter {
+handleScriptGenerationRequest(generationContext any)
}
class TEIHeaderAdapter {
+renderHeader(provenance ProvenanceRecord, existingHeader any) string
}
%% Layer groupings (conceptual)
ProvenanceRecord --> SourcePriority
ProvenanceRecord --> IngestionTimestamp
ProvenanceRecord --> ReviewerIdentity
CaptureProvenance --> ProvenanceRecord
CaptureProvenance --> ClockPort
CaptureProvenance --> ReviewerIdentityPort
CaptureProvenance --> SourcePriorityPort
IngestionAdapter --> CaptureProvenance
ScriptGenerationAdapter --> CaptureProvenance
TEIHeaderAdapter --> ProvenanceRecord
IngestionAdapter --> TEIHeaderAdapter
ScriptGenerationAdapter --> TEIHeaderAdapter
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Summary
Adds an Execution Plan (ExecPlan) for roadmap item 2.2.5: automatically capture provenance metadata in TEI headers for both ingestion and script-generation flows, aligned with hexagonal architecture principles and ensuring compatibility with existing TEI consumers.
Changes
docs/execplans/2-2-5-capture-provenance-metadata.md(390+ lines in diff, 391 insertions).Rationale
Plan of work (stages A–H)
Each stage includes concrete validation tasks (unit tests, behavioural tests, fixtures), decisions, and go/no-go criteria as described in the ExecPlan.
Validation and acceptance
make check-fmt,make typecheck,make lint,make test(and behavioural tests) must pass.Interfaces and dependencies (high level)
Review guidance
Notes
◳ Generated by DevBoxer ◰
ℹ️ Tag @devboxerhub to ask questions and address PR feedback
📎 Task: https://www.devboxer.com/task/f7d6eac4-b20d-44c8-8bc9-7bf283d97e47
Summary by Sourcery
Documentation: