package main

import (
	"strings"
	"testing"
)

func TestDefaultScenarioSelectionExcludesPopulatedTargetedLane(t *testing.T) {
	defaultIDs := map[string]bool{}
	for _, scenario := range selectedScenarios(runConfig{}) {
		defaultIDs[scenario.ID] = true
	}
	for _, id := range []string{populatedHeterogeneousScenarioID, populatedFreshnessConflictScenarioID, populatedSynthesisUpdateScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted populated scenario %q", id)
		}
	}
	for _, id := range documentHistoryScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted document history scenario %q", id)
		}
	}
	for _, id := range highTouchDocumentLifecycleScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted high-touch document lifecycle scenario %q", id)
		}
	}
	for _, id := range highTouchRelationshipRecordScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted high-touch relationship-record scenario %q", id)
		}
	}
	for _, id := range highTouchMemoryRouterRecallScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted high-touch memory/router recall scenario %q", id)
		}
	}
	for _, id := range memoryRouterRecallCandidateScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted memory/router recall candidate scenario %q", id)
		}
	}
	for _, id := range memoryRouterRecallReportScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted memory/router recall report scenario %q", id)
		}
	}
	for _, id := range relationshipRecordCandidateScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted relationship-record candidate scenario %q", id)
		}
	}
	for _, id := range []string{agentChosenExplicitScenarioID, agentChosenMissingFieldsScenarioID, agentChosenPathProposalScenarioID, agentChosenAutonomousScenarioID, agentChosenSynthesisScenarioID, agentChosenAmbiguousScenarioID, agentChosenUserPathScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted agent-chosen path scenario %q", id)
		}
	}
	for _, id := range []string{pathTitleURLOnlyScenarioID, pathTitleArtifactMissingHintsScenarioID, pathTitleMultiSourceDuplicateScenarioID, pathTitleExplicitOverridesScenarioID, pathTitleDuplicateRiskScenarioID, pathTitleMetadataAuthorityScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted path-title scenario %q", id)
		}
	}
	for _, id := range captureLowRiskScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted capture low-risk scenario %q", id)
		}
	}
	for _, id := range captureExplicitOverridesScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted capture explicit overrides scenario %q", id)
		}
	}
	for _, id := range captureDuplicateCandidateScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted capture duplicate candidate scenario %q", id)
		}
	}
	for _, id := range captureSaveThisNoteScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted capture save-this-note scenario %q", id)
		}
	}
	for _, id := range captureDocumentLinksScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted capture document-these-links scenario %q", id)
		}
	}
	for _, id := range []string{sourceURLUpdateDuplicateScenarioID, sourceURLUpdateSameSHAScenarioID, sourceURLUpdateChangedScenarioID, sourceURLUpdateConflictScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted source URL update scenario %q", id)
		}
	}
	for _, id := range webProductPageScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted web product-page scenario %q", id)
		}
	}
	for _, id := range webURLStaleRepairScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted web URL stale repair scenario %q", id)
		}
	}
	for _, id := range webURLStaleImpactScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted web URL stale impact scenario %q", id)
		}
	}
	for _, id := range []string{documentThisMissingFieldsScenarioID, documentThisExplicitCreateScenarioID, documentThisSourceURLMissingHintsScenarioID, documentThisExplicitOverridesScenarioID, documentThisDuplicateCandidateScenarioID, documentThisExistingUpdateScenarioID, documentThisSynthesisFreshnessScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted document-this scenario %q", id)
		}
	}
	for _, id := range []string{candidateNoteFromPastedContentScenarioID, candidateTitleAndPathFromHeadingScenarioID, candidateMixedSourceSummaryScenarioID, candidateExplicitOverridesWinScenarioID, candidateDuplicateRiskAsksScenarioID, candidateLowConfidenceAsksScenarioID, candidateBodyFaithfulnessScenarioID} {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted document artifact candidate scenario %q", id)
		}
	}
	for _, id := range artifactIngestionScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted artifact ingestion scenario %q", id)
		}
	}
	for _, id := range unsupportedArtifactKindScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted unsupported artifact kind scenario %q", id)
		}
	}
	for _, id := range localFileArtifactScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted local file artifact scenario %q", id)
		}
	}
	for _, id := range videoYouTubeScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted video/YouTube scenario %q", id)
		}
	}
	for _, id := range synthesisCompileScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted synthesis compile scenario %q", id)
		}
	}
	for _, id := range highTouchCompileSynthesisScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted high-touch compile synthesis scenario %q", id)
		}
	}
	for _, id := range compileSynthesisCandidateScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted compile synthesis candidate scenario %q", id)
		}
	}
	for _, id := range documentLifecycleRollbackCandidateScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted document lifecycle rollback candidate scenario %q", id)
		}
	}
	for _, id := range graphSemanticsRevisitScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted graph semantics revisit scenario %q", id)
		}
	}
	for _, id := range graphContextReportScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted graph context report scenario %q", id)
		}
	}
	for _, id := range graphProductStoryScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted graph product story scenario %q", id)
		}
	}
	for _, id := range graphRelationshipReportScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted graph relationship report scenario %q", id)
		}
	}
	for _, id := range graphRelationshipMaintenanceScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted graph relationship maintenance scenario %q", id)
		}
	}
	for _, id := range memoryRouterRevisitScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted memory/router revisit scenario %q", id)
		}
	}
	for _, id := range promotedRecordDomainScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted promoted record domain scenario %q", id)
		}
	}
	for _, id := range parallelRunnerScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted parallel runner scenario %q", id)
		}
	}
	for _, id := range broadAuditScenarioIDs() {
		if defaultIDs[id] {
			t.Fatalf("default selected scenarios included targeted broad audit scenario %q", id)
		}
	}
	selected := selectedScenarioIDs(runConfig{Scenario: populatedHeterogeneousScenarioID + "," + populatedFreshnessConflictScenarioID + "," + populatedSynthesisUpdateScenarioID})
	lane, releaseBlocking := reportLane(selected)
	if lane != populatedLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, populatedLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: documentHistoryNaturalScenarioID + "," + documentHistoryInspectScenarioID + "," + documentHistoryDiffScenarioID + "," + documentHistoryRestoreScenarioID + "," + documentHistoryPendingScenarioID + "," + documentHistoryStaleScenarioID + ",missing-document-path-reject,negative-limit-reject,unsupported-lower-level-reject,unsupported-transport-reject"})
	lane, releaseBlocking = reportLane(selected)
	if lane != documentHistoryLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, documentHistoryLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: agentChosenExplicitScenarioID + "," + agentChosenMissingFieldsScenarioID + "," + agentChosenPathProposalScenarioID + "," + agentChosenAutonomousScenarioID + "," + agentChosenSynthesisScenarioID + "," + agentChosenAmbiguousScenarioID + "," + agentChosenUserPathScenarioID + ",missing-document-path-reject,negative-limit-reject,unsupported-lower-level-reject,unsupported-transport-reject"})
	lane, releaseBlocking = reportLane(selected)
	if lane != agentChosenPathLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, agentChosenPathLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: pathTitleURLOnlyScenarioID + "," + pathTitleArtifactMissingHintsScenarioID + "," + pathTitleMultiSourceDuplicateScenarioID + "," + pathTitleExplicitOverridesScenarioID + "," + pathTitleDuplicateRiskScenarioID + "," + pathTitleMetadataAuthorityScenarioID})
	lane, releaseBlocking = reportLane(selected)
	if lane != pathTitleAutonomyLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, pathTitleAutonomyLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(captureLowRiskScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != captureLowRiskLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, captureLowRiskLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(captureExplicitOverridesScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != captureExplicitOverridesLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, captureExplicitOverridesLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(captureDuplicateCandidateScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != captureDuplicateCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, captureDuplicateCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(captureSaveThisNoteScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != captureSaveThisNoteLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, captureSaveThisNoteLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(captureDocumentLinksScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != captureDocumentLinksLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, captureDocumentLinksLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: sourceURLUpdateDuplicateScenarioID + "," + sourceURLUpdateSameSHAScenarioID + "," + sourceURLUpdateChangedScenarioID + "," + sourceURLUpdateConflictScenarioID})
	lane, releaseBlocking = reportLane(selected)
	if lane != sourceURLUpdateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, sourceURLUpdateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(webProductPageScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != webProductPageLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, webProductPageLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: documentThisMissingFieldsScenarioID + "," + documentThisExplicitCreateScenarioID + "," + documentThisSourceURLMissingHintsScenarioID + "," + documentThisExplicitOverridesScenarioID + "," + documentThisDuplicateCandidateScenarioID + "," + documentThisExistingUpdateScenarioID + "," + documentThisSynthesisFreshnessScenarioID})
	lane, releaseBlocking = reportLane(selected)
	if lane != documentThisLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, documentThisLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(documentArtifactCandidateScenarioIDs(), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != documentArtifactCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, documentArtifactCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(artifactIngestionScenarioIDs(), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != artifactIngestionLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, artifactIngestionLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(unsupportedArtifactKindScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != unsupportedArtifactKindLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, unsupportedArtifactKindLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(localFileArtifactScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != localFileArtifactLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, localFileArtifactLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(videoYouTubeScenarioIDs(), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != videoYouTubeLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, videoYouTubeLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(nativeMediaTranscriptScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != nativeMediaTranscriptLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, nativeMediaTranscriptLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(webURLStaleRepairScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != webURLStaleRepairLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, webURLStaleRepairLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(webURLStaleImpactScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != webURLStaleImpactLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, webURLStaleImpactLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(synthesisCompileScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != synthesisCompileLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, synthesisCompileLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(highTouchCompileSynthesisScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != highTouchCompileSynthesisLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, highTouchCompileSynthesisLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(highTouchDocumentLifecycleScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != highTouchDocumentLifecycleLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, highTouchDocumentLifecycleLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(highTouchRelationshipRecordScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != highTouchRelationshipRecordLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, highTouchRelationshipRecordLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(highTouchMemoryRouterRecallScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != highTouchMemoryRouterRecallLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, highTouchMemoryRouterRecallLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(memoryRouterRecallCandidateScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != memoryRouterRecallCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, memoryRouterRecallCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(memoryRouterRecallReportScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != memoryRouterRecallReportLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, memoryRouterRecallReportLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(relationshipRecordCandidateScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != relationshipRecordCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, relationshipRecordCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(compileSynthesisCandidateScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != compileSynthesisCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, compileSynthesisCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(documentLifecycleRollbackCandidateScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != documentLifecycleRollbackCandidateLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, documentLifecycleRollbackCandidateLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(graphSemanticsRevisitScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != graphSemanticsRevisitLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, graphSemanticsRevisitLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(graphContextReportScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != graphContextReportLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, graphContextReportLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(graphProductStoryScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != graphProductStoryLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, graphProductStoryLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(graphRelationshipReportScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != graphRelationshipReportLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, graphRelationshipReportLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(graphRelationshipMaintenanceScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != graphRelationshipMaintenanceLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, graphRelationshipMaintenanceLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(memoryRouterRevisitScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != memoryRouterRevisitLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, memoryRouterRevisitLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(promotedRecordDomainScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != promotedRecordDomainLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, promotedRecordDomainLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(parallelRunnerScenarioIDs(), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != parallelRunnerLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, parallelRunnerLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(installUpgradeModuleScenarioIDs(), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != installUpgradeModuleLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, installUpgradeModuleLaneName)
	}
	selected = selectedScenarioIDs(runConfig{Scenario: strings.Join(append(broadAuditScenarioIDs(), "missing-document-path-reject", "negative-limit-reject", "unsupported-lower-level-reject", "unsupported-transport-reject"), ",")})
	lane, releaseBlocking = reportLane(selected)
	if lane != broadAuditLaneName || releaseBlocking {
		t.Fatalf("reportLane(%v) = %q/%t, want %q/false", selected, lane, releaseBlocking, broadAuditLaneName)
	}
}

func requireScenarioByID(t *testing.T, id string) scenario {
	t.Helper()
	for _, sc := range allScenarios() {
		if sc.ID == id {
			return sc
		}
	}
	t.Fatalf("missing scenario %q", id)
	return scenario{}
}

func containsValue(args []string, value string) bool {
	for _, arg := range args {
		if arg == value {
			return true
		}
	}
	return false
}
