Nachbearbeitung: verbliebene Meilensteinbezüge in Produktivdokumentation
bereinigt
This commit is contained in:
@@ -14,9 +14,6 @@ import java.time.Instant;
|
|||||||
* <p>
|
* <p>
|
||||||
* By isolating time access behind a port, the application can be tested with
|
* By isolating time access behind a port, the application can be tested with
|
||||||
* deterministic time values without requiring system clock manipulation.
|
* deterministic time values without requiring system clock manipulation.
|
||||||
* <p>
|
|
||||||
* This port is defined in M2 for use in later milestones where timestamps
|
|
||||||
* become relevant (e.g., run history, document date fallback).
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ClockPort {
|
public interface ClockPort {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Outbound port for configuration access.
|
* Outbound port for configuration access.
|
||||||
* AP-005: Minimal interface for loading typed startup configuration.
|
* Provides a minimal interface for loading typed startup configuration.
|
||||||
*/
|
*/
|
||||||
public interface ConfigurationPort {
|
public interface ConfigurationPort {
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import java.util.Objects;
|
|||||||
* The document is known (fingerprint exists in the persistence store) but its overall
|
* The document is known (fingerprint exists in the persistence store) but its overall
|
||||||
* status is neither {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#SUCCESS}
|
* status is neither {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#SUCCESS}
|
||||||
* nor {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#FAILED_FINAL}.
|
* nor {@link de.gecheckt.pdf.umbenenner.domain.model.ProcessingStatus#FAILED_FINAL}.
|
||||||
* The use case may continue with normal M4 processing using the provided record.
|
* The use case may continue with normal processing using the provided record.
|
||||||
* <p>
|
* <p>
|
||||||
* The existing {@link DocumentRecord} is supplied so the use case can inspect the
|
* The existing {@link DocumentRecord} is supplied so the use case can inspect the
|
||||||
* current status, failure counters, and other fields required to apply M4 retry rules
|
* current status, failure counters, and other fields required to apply retry rules
|
||||||
* without an additional lookup.
|
* without an additional lookup.
|
||||||
*
|
*
|
||||||
* @param record the current master record for this document; never null
|
* @param record the current master record for this document; never null
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import java.util.Objects;
|
|||||||
* Mapping between {@code DocumentRecord} and the persistence layer is performed
|
* Mapping between {@code DocumentRecord} and the persistence layer is performed
|
||||||
* exclusively by the repository adapter in {@code adapter-out}.
|
* exclusively by the repository adapter in {@code adapter-out}.
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>M4 field semantics:</strong>
|
* <strong>Field semantics:</strong>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link #fingerprint()} — primary identity; never changes for a given record.</li>
|
* <li>{@link #fingerprint()} — primary identity; never changes for a given record.</li>
|
||||||
* <li>{@link #lastKnownSourceLocator()} — opaque locator used by adapters; the
|
* <li>{@link #lastKnownSourceLocator()} — opaque locator used by adapters; the
|
||||||
@@ -37,8 +37,7 @@ import java.util.Objects;
|
|||||||
* <li>{@link #updatedAt()} — timestamp of the most recent update to this master record.</li>
|
* <li>{@link #updatedAt()} — timestamp of the most recent update to this master record.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Not included in M4:</strong> target path, target file name, AI-related fields.
|
* <strong>Not yet included:</strong> target path, target file name, AI-related fields.
|
||||||
* These are added in later milestones.
|
|
||||||
*
|
*
|
||||||
* @param fingerprint content-based identity; never null
|
* @param fingerprint content-based identity; never null
|
||||||
* @param lastKnownSourceLocator opaque locator to the physical source file; never null
|
* @param lastKnownSourceLocator opaque locator to the physical source file; never null
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
/**
|
/**
|
||||||
* Sealed result type for a document master record lookup via {@link DocumentRecordRepository}.
|
* Sealed result type for a document master record lookup via {@link DocumentRecordRepository}.
|
||||||
* <p>
|
* <p>
|
||||||
* The use case uses this result to make the per-document processing decision in M4
|
* The use case uses this result to make the per-document processing decision
|
||||||
* without additional assumptions:
|
* without additional assumptions:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>{@link DocumentUnknown} — the fingerprint is not yet in the persistence store;
|
* <li>{@link DocumentUnknown} — the fingerprint is not yet in the persistence store;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
* Lookup result indicating that the fingerprint is not yet present in the persistence store.
|
* Lookup result indicating that the fingerprint is not yet present in the persistence store.
|
||||||
* <p>
|
* <p>
|
||||||
* The document has never been processed before. The use case must create a new
|
* The document has never been processed before. The use case must create a new
|
||||||
* {@link DocumentRecord} and proceed with normal M4 processing.
|
* {@link DocumentRecord} and proceed with normal processing.
|
||||||
* <p>
|
* <p>
|
||||||
* This variant carries no data because there is no existing record to return.
|
* This variant carries no data because there is no existing record to return.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
/**
|
/**
|
||||||
* Immutable snapshot of the two independent failure counters maintained per document.
|
* Immutable snapshot of the two independent failure counters maintained per document.
|
||||||
* <p>
|
* <p>
|
||||||
* M4 tracks two distinct counters separately because they drive different retry rules:
|
* Two distinct counters are tracked separately because they drive different retry rules:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li><strong>Content error counter</strong> ({@link #contentErrorCount()}):
|
* <li><strong>Content error counter</strong> ({@link #contentErrorCount()}):
|
||||||
* counts how many times a deterministic content error occurred for this document
|
* counts how many times a deterministic content error occurred for this document
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import de.gecheckt.pdf.umbenenner.domain.model.SourceDocumentCandidate;
|
|||||||
* A {@link FingerprintTechnicalError} result means no
|
* A {@link FingerprintTechnicalError} result means no
|
||||||
* {@link de.gecheckt.pdf.umbenenner.domain.model.DocumentFingerprint} is available
|
* {@link de.gecheckt.pdf.umbenenner.domain.model.DocumentFingerprint} is available
|
||||||
* and the candidate cannot be identified; consequently no SQLite attempt record is
|
* and the candidate cannot be identified; consequently no SQLite attempt record is
|
||||||
* created for this candidate in M4.
|
* created for this candidate.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface FingerprintPort {
|
public interface FingerprintPort {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.Objects;
|
|||||||
* <p>
|
* <p>
|
||||||
* Carries the computed {@link DocumentFingerprint} that uniquely identifies the
|
* Carries the computed {@link DocumentFingerprint} that uniquely identifies the
|
||||||
* document by its content. The fingerprint can now be used as the primary key
|
* document by its content. The fingerprint can now be used as the primary key
|
||||||
* for all subsequent persistence operations in M4.
|
* for all subsequent persistence operations.
|
||||||
*
|
*
|
||||||
* @param fingerprint the successfully computed fingerprint; never null
|
* @param fingerprint the successfully computed fingerprint; never null
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
* <p>
|
* <p>
|
||||||
* This port is invoked exactly once per program run, <em>before</em> the batch
|
* This port is invoked exactly once per program run, <em>before</em> the batch
|
||||||
* document processing loop begins. The initialisation must ensure that all tables,
|
* document processing loop begins. The initialisation must ensure that all tables,
|
||||||
* indices, and constraints required for M4 persistence are present in the SQLite file.
|
* indices, and constraints required for document persistence are present in the SQLite file.
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Timing:</strong> The adapter implementation must perform the schema
|
* <strong>Timing:</strong> The adapter implementation must perform the schema
|
||||||
* initialisation eagerly and synchronously. Lazy or deferred initialisation during
|
* initialisation eagerly and synchronously. Lazy or deferred initialisation during
|
||||||
@@ -27,7 +27,7 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
public interface PersistenceSchemaInitializationPort {
|
public interface PersistenceSchemaInitializationPort {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates or verifies the M4 persistence schema.
|
* Creates or verifies the persistence schema.
|
||||||
* <p>
|
* <p>
|
||||||
* Must be called once at program start, before any document processing begins.
|
* Must be called once at program start, before any document processing begins.
|
||||||
* The method must be idempotent: calling it on an already-initialised database
|
* The method must be idempotent: calling it on an already-initialised database
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.Objects;
|
|||||||
* Application-facing representation of exactly one historised processing attempt
|
* Application-facing representation of exactly one historised processing attempt
|
||||||
* (Versuchshistorie-Eintrag) for an identified document.
|
* (Versuchshistorie-Eintrag) for an identified document.
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Historisation boundary (M4):</strong> Only attempts for documents whose
|
* <strong>Historisation boundary:</strong> Only attempts for documents whose
|
||||||
* {@link DocumentFingerprint} was successfully computed are historised. Failures that
|
* {@link DocumentFingerprint} was successfully computed are historised. Failures that
|
||||||
* occur <em>before</em> the fingerprint is available (e.g. the source file is
|
* occur <em>before</em> the fingerprint is available (e.g. the source file is
|
||||||
* unreadable before hashing) are <em>not</em> represented by a {@code ProcessingAttempt}
|
* unreadable before hashing) are <em>not</em> represented by a {@code ProcessingAttempt}
|
||||||
@@ -42,9 +42,8 @@ import java.util.Objects;
|
|||||||
* later run; {@code false} for final failures, successes, and skip attempts.</li>
|
* later run; {@code false} for final failures, successes, and skip attempts.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>Not included in M4:</strong> model name, prompt identifier, AI raw response,
|
* <strong>Not yet included:</strong> model name, prompt identifier, AI raw response,
|
||||||
* AI reasoning, resolved date, date source, final title, final target file name.
|
* AI reasoning, resolved date, date source, final title, final target file name.
|
||||||
* These fields are added in later milestones (M5+).
|
|
||||||
*
|
*
|
||||||
* @param fingerprint content-based document identity; never null
|
* @param fingerprint content-based document identity; never null
|
||||||
* @param runId identifier of the batch run; never null
|
* @param runId identifier of the batch run; never null
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ package de.gecheckt.pdf.umbenenner.application.port.out;
|
|||||||
* <li>Hold the lock for the entire batch run</li>
|
* <li>Hold the lock for the entire batch run</li>
|
||||||
* <li>Release the lock cleanly at batch end (even on failure, if possible)</li>
|
* <li>Release the lock cleanly at batch end (even on failure, if possible)</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
|
||||||
* This port is used by the batch use case (M2-AP-004) but not implemented in M2;
|
|
||||||
* implementation follows in M2-AP-006.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface RunLockPort {
|
public interface RunLockPort {
|
||||||
|
|||||||
@@ -490,7 +490,7 @@ public class DocumentProcessingCoordinator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// M3 → outcome mapping
|
// Extraction outcome mapping
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,14 +17,14 @@
|
|||||||
* — Pre-check evaluation logic</li>
|
* — Pre-check evaluation logic</li>
|
||||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.service.DocumentProcessingService}
|
* <li>{@link de.gecheckt.pdf.umbenenner.application.service.DocumentProcessingService}
|
||||||
* — Complete document processing pipeline orchestration</li>
|
* — Complete document processing pipeline orchestration</li>
|
||||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.service.M4DocumentProcessor}
|
* <li>{@link de.gecheckt.pdf.umbenenner.application.service.DocumentProcessingCoordinator}
|
||||||
* — Per-document idempotency, status/counter mapping and consistent
|
* — Per-document idempotency, status/counter mapping and consistent
|
||||||
* two-level persistence</li>
|
* two-level persistence</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* <h2>Document processing flow ({@code M4DocumentProcessor})</h2>
|
* <h2>Document processing flow ({@code DocumentProcessingCoordinator})</h2>
|
||||||
* <p>
|
* <p>
|
||||||
* The {@link de.gecheckt.pdf.umbenenner.application.service.M4DocumentProcessor}
|
* The {@link de.gecheckt.pdf.umbenenner.application.service.DocumentProcessingCoordinator}
|
||||||
* implements the required processing order per candidate:
|
* implements the required processing order per candidate:
|
||||||
* <ol>
|
* <ol>
|
||||||
* <li>Load the document master record by fingerprint.</li>
|
* <li>Load the document master record by fingerprint.</li>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* <li>If fingerprint computation fails: log as non-identifiable run event;
|
* <li>If fingerprint computation fails: log as non-identifiable run event;
|
||||||
* do NOT write any SQLite record; continue with next candidate.</li>
|
* do NOT write any SQLite record; continue with next candidate.</li>
|
||||||
* <li>Run the document extraction and pre-checks pipeline.</li>
|
* <li>Run the document extraction and pre-checks pipeline.</li>
|
||||||
* <li>Delegate to {@link de.gecheckt.pdf.umbenenner.application.service.M4DocumentProcessor}
|
* <li>Delegate to {@link de.gecheckt.pdf.umbenenner.application.service.DocumentProcessingCoordinator}
|
||||||
* for idempotency check, status/counter mapping, and consistent persistence.</li>
|
* for idempotency check, status/counter mapping, and consistent persistence.</li>
|
||||||
* </ol>
|
* </ol>
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
Reference in New Issue
Block a user