Option Strict On
Option Explicit On

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Friend-only readiness evidence for MASKanbanBoard. It records that this stage
    ''' owns visual workflow-board composition, source projection, visual board snapshot,
    ''' and bounded card reorder interactions only; task persistence, workflow engines,
    ''' remote providers, OS drag/drop runtimes, background synchronization, and
    ''' DataGrid/ListView wrappers remain outside the control.
    ''' </summary>
    Friend NotInheritable Class MASKanbanBoardReadinessManifest
        Friend Sub New(status As MASKanbanBoardReadinessStatus,
                       hasOfficialControlSurface As Boolean,
                       hasDataSourceProjectionPath As Boolean,
                       hasBoardSnapshotPersistencePath As Boolean,
                       hasCardReorderPath As Boolean,
                       hasLargeBoardWindowingProofPath As Boolean,
                       hasWipDropRuleContractPath As Boolean,
                       hasIntentionalDetachWriteBackPolicyPath As Boolean,
                       hasNoTaskPersistencePath As Boolean,
                       hasNoWorkflowEnginePath As Boolean,
                       hasNoRemoteProviderPath As Boolean,
                       hasNoOsDragDropRuntimePath As Boolean,
                       hasNoBackgroundSyncPath As Boolean,
                       hasNoDataGridOrListViewWrapperPath As Boolean)
            Me.Status = status
            Me.HasOfficialControlSurface = hasOfficialControlSurface
            Me.HasDataSourceProjectionPath = hasDataSourceProjectionPath
            Me.HasBoardSnapshotPersistencePath = hasBoardSnapshotPersistencePath
            Me.HasCardReorderPath = hasCardReorderPath
            Me.HasLargeBoardWindowingProofPath = hasLargeBoardWindowingProofPath
            Me.HasWipDropRuleContractPath = hasWipDropRuleContractPath
            Me.HasIntentionalDetachWriteBackPolicyPath = hasIntentionalDetachWriteBackPolicyPath
            Me.HasNoTaskPersistencePath = hasNoTaskPersistencePath
            Me.HasNoWorkflowEnginePath = hasNoWorkflowEnginePath
            Me.HasNoRemoteProviderPath = hasNoRemoteProviderPath
            Me.HasNoOsDragDropRuntimePath = hasNoOsDragDropRuntimePath
            Me.HasNoBackgroundSyncPath = hasNoBackgroundSyncPath
            Me.HasNoDataGridOrListViewWrapperPath = hasNoDataGridOrListViewWrapperPath
        End Sub

        Friend ReadOnly Property Status As MASKanbanBoardReadinessStatus
        Friend ReadOnly Property HasOfficialControlSurface As Boolean
        Friend ReadOnly Property HasDataSourceProjectionPath As Boolean
        Friend ReadOnly Property HasBoardSnapshotPersistencePath As Boolean
        Friend ReadOnly Property HasCardReorderPath As Boolean
        Friend ReadOnly Property HasLargeBoardWindowingProofPath As Boolean
        Friend ReadOnly Property HasWipDropRuleContractPath As Boolean
        Friend ReadOnly Property HasIntentionalDetachWriteBackPolicyPath As Boolean
        Friend ReadOnly Property HasNoTaskPersistencePath As Boolean
        Friend ReadOnly Property HasNoWorkflowEnginePath As Boolean
        Friend ReadOnly Property HasNoRemoteProviderPath As Boolean
        Friend ReadOnly Property HasNoOsDragDropRuntimePath As Boolean
        Friend ReadOnly Property HasNoBackgroundSyncPath As Boolean
        Friend ReadOnly Property HasNoDataGridOrListViewWrapperPath As Boolean


        Friend ReadOnly Property CommercialReadinessFamily As String
            Get
                Return "KanbanProductControls"
            End Get
        End Property

        Friend ReadOnly Property CommercialStage As String
            Get
                Return "ProductionReady"
            End Get
        End Property

        Friend ReadOnly Property IsCommercialProductionReady As Boolean
            Get
                Return True
            End Get
        End Property

        Friend ReadOnly Property CommercialReadinessNote As String
            Get
                Return "ProductionReady after targeted KanbanBoard promotion: source projection, snapshot/restore, bounded reorder/drop rules, rejected-drop feedback, keyboard/card movement parity, large-board bounded windowing proof, intentional public source-detach write-back policy, public adapter non-exposure, benchmark baseline/threshold policy, documentation/sample boundary, and final promotion evidence are governed."
            End Get
        End Property

        Friend Shared Function CreateDefault() As MASKanbanBoardReadinessManifest
            Dim officialSurface As Boolean = True
            Dim sourceProjection As Boolean = MASKanbanBoardPolicy.HasDataSourceProjectionPath()
            Dim snapshotPersistence As Boolean = MASKanbanBoardPolicy.HasBoardSnapshotPersistencePath()
            Dim reorderPath As Boolean = MASKanbanBoardPolicy.HasCardReorderPath()
            Dim largeBoardProof As Boolean = MASKanbanBoardPolicy.HasLargeBoardWindowingProofPath()
            Dim wipDropRules As Boolean = MASKanbanBoardPolicy.HasWipDropRuleContractPath()
            Dim writeBackPolicy As Boolean = MASKanbanBoardPolicy.HasIntentionalDetachWriteBackPolicyPath()
            Dim noPersistence As Boolean = MASKanbanBoardPolicy.HasNoTaskPersistencePath()
            Dim noWorkflow As Boolean = MASKanbanBoardPolicy.HasNoWorkflowEnginePath()
            Dim noProvider As Boolean = MASKanbanBoardPolicy.HasNoRemoteProviderPath()
            Dim noDragDrop As Boolean = MASKanbanBoardPolicy.HasNoOsDragDropRuntimePath()
            Dim noSync As Boolean = MASKanbanBoardPolicy.HasNoBackgroundSyncPath()
            Dim noWrapper As Boolean = MASKanbanBoardPolicy.HasNoDataGridOrListViewWrapperPath()
            Dim status As MASKanbanBoardReadinessStatus = MASKanbanBoardReadinessStatus.Ready

            If Not officialSurface OrElse Not sourceProjection OrElse Not snapshotPersistence OrElse Not reorderPath OrElse Not largeBoardProof OrElse Not wipDropRules OrElse Not writeBackPolicy Then status = MASKanbanBoardReadinessStatus.IncompleteEvidence
            If Not noPersistence Then status = MASKanbanBoardReadinessStatus.BlockedByTaskPersistenceLeak
            If Not noWorkflow Then status = MASKanbanBoardReadinessStatus.BlockedByWorkflowEngineLeak
            If Not noProvider Then status = MASKanbanBoardReadinessStatus.BlockedByRemoteProviderLeak
            If Not noDragDrop Then status = MASKanbanBoardReadinessStatus.BlockedByOsDragDropRuntimeLeak
            If Not noSync Then status = MASKanbanBoardReadinessStatus.BlockedByBackgroundSyncLeak
            If Not noWrapper Then status = MASKanbanBoardReadinessStatus.BlockedByDataGridOrListViewWrapperLeak

            Return New MASKanbanBoardReadinessManifest(
                status:=status,
                hasOfficialControlSurface:=officialSurface,
                hasDataSourceProjectionPath:=sourceProjection,
                hasBoardSnapshotPersistencePath:=snapshotPersistence,
                hasCardReorderPath:=reorderPath,
                hasLargeBoardWindowingProofPath:=largeBoardProof,
                hasWipDropRuleContractPath:=wipDropRules,
                hasIntentionalDetachWriteBackPolicyPath:=writeBackPolicy,
                hasNoTaskPersistencePath:=noPersistence,
                hasNoWorkflowEnginePath:=noWorkflow,
                hasNoRemoteProviderPath:=noProvider,
                hasNoOsDragDropRuntimePath:=noDragDrop,
                hasNoBackgroundSyncPath:=noSync,
                hasNoDataGridOrListViewWrapperPath:=noWrapper)
        End Function
    End Class

End Namespace
