Task Summary
Add dedicated unit-specs for three small storage-layer model classes in common/workflow-core/. Pin defaults, equality, and trait conformance so accidental drift in the result-store schema (tupleCount, changeDetector) or in the OnDataset accessor surface is caught early.
Background
Three small storage-layer model classes in common/workflow-core currently lack a dedicated unit-spec:
| Source class |
Package |
Purpose |
OperatorResultMetadata |
core/storage/result |
Per-operator result metadata: tupleCount: Int = 0, changeDetector: String = "" |
WorkflowResultStore |
core/storage/result |
Map-wrapping case class: resultInfo: Map[OperatorIdentity, OperatorResultMetadata] = Map.empty |
OnDataset |
core/storage/model |
Trait with getRepositoryName / getVersionHash / getFileRelativePath — accessor contract for dataset-backed documents |
Behavior to pin
OperatorResultMetadata
| Surface |
Contract |
| Default constructor |
OperatorResultMetadata() has tupleCount == 0 and changeDetector == "" |
| Custom values |
preserved via the case-class constructor |
| Equality |
case-class equality compares both fields |
copy |
replaces only the field passed, preserves the rest |
WorkflowResultStore
| Surface |
Contract |
| Default constructor |
WorkflowResultStore() has resultInfo == Map.empty |
| Equality |
two stores with the same resultInfo are case-equal |
copy |
replaces resultInfo |
| Map carrying multiple operator metadatas |
each key/value is preserved |
OnDataset
| Surface |
Contract |
| Trait declares three accessors |
getRepositoryName, getVersionHash, getFileRelativePath — all (): String |
| A test-only concrete subclass |
returns each accessor's value verbatim |
| Pattern matching |
a value of type OnDataset can be matched via type-test for cross-module dispatch |
Scope
- New spec files (one per source class per the spec-filename convention):
OperatorResultMetadataSpec.scala
WorkflowResultStoreSpec.scala
OnDatasetSpec.scala
- No production-code changes.
OnDataset is a trait; exercise it through a minimal test-only concrete subclass.
Task Type
Task Summary
Add dedicated unit-specs for three small storage-layer model classes in
common/workflow-core/. Pin defaults, equality, and trait conformance so accidental drift in the result-store schema (tupleCount,changeDetector) or in theOnDatasetaccessor surface is caught early.Background
Three small storage-layer model classes in
common/workflow-corecurrently lack a dedicated unit-spec:OperatorResultMetadatacore/storage/resulttupleCount: Int = 0,changeDetector: String = ""WorkflowResultStorecore/storage/resultresultInfo: Map[OperatorIdentity, OperatorResultMetadata] = Map.emptyOnDatasetcore/storage/modelgetRepositoryName/getVersionHash/getFileRelativePath— accessor contract for dataset-backed documentsBehavior to pin
OperatorResultMetadataOperatorResultMetadata()hastupleCount == 0andchangeDetector == ""copyWorkflowResultStoreWorkflowResultStore()hasresultInfo == Map.emptyresultInfoare case-equalcopyresultInfoOnDatasetgetRepositoryName,getVersionHash,getFileRelativePath— all(): StringOnDatasetcan be matched via type-test for cross-module dispatchScope
OperatorResultMetadataSpec.scalaWorkflowResultStoreSpec.scalaOnDatasetSpec.scalaOnDatasetis a trait; exercise it through a minimal test-only concrete subclass.Task Type