@ai-sdlc/orchestrator 0.9.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__test-helpers/git-env.d.ts +40 -0
- package/dist/__test-helpers/git-env.js +73 -0
- package/dist/adapters.d.ts +42 -3
- package/dist/adapters.js +133 -3
- package/dist/admission-composite.d.ts +134 -1
- package/dist/admission-composite.js +170 -6
- package/dist/admission-enrichment.d.ts +12 -3
- package/dist/admission-enrichment.js +71 -10
- package/dist/admission-hc.d.ts +20 -1
- package/dist/admission-hc.js +12 -1
- package/dist/admission-score.d.ts +44 -0
- package/dist/admission-score.js +11 -2
- package/dist/backlog-adapter.d.ts +45 -0
- package/dist/backlog-adapter.js +145 -1
- package/dist/calibration.d.ts +81 -0
- package/dist/calibration.js +76 -0
- package/dist/cli/commands/git-remote.d.ts +25 -0
- package/dist/cli/commands/git-remote.js +80 -1
- package/dist/cli/commands/init-features.d.ts +507 -0
- package/dist/cli/commands/init-features.js +1100 -0
- package/dist/cli/commands/init-templates.d.ts +301 -0
- package/dist/cli/commands/init-templates.js +1341 -0
- package/dist/cli/commands/init.d.ts +67 -0
- package/dist/cli/commands/init.js +301 -2
- package/dist/cli/commands/run.js +9 -1
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.js +42 -8
- package/dist/compliance/composer.d.ts +79 -0
- package/dist/compliance/composer.js +258 -0
- package/dist/compliance/errors.d.ts +64 -0
- package/dist/compliance/errors.js +85 -0
- package/dist/compliance/loader.d.ts +52 -0
- package/dist/compliance/loader.js +124 -0
- package/dist/compliance/types.d.ts +184 -0
- package/dist/compliance/types.js +41 -0
- package/dist/compliance-clearance.d.ts +269 -0
- package/dist/compliance-clearance.js +269 -0
- package/dist/config.js +17 -0
- package/dist/cost-tracker.d.ts +22 -0
- package/dist/cost-tracker.js +41 -0
- package/dist/database/adapters/external.js +5 -1
- package/dist/design-authority.d.ts +13 -0
- package/dist/design-authority.js +13 -0
- package/dist/embedding/adapters/openai-text-embedding-3-small.d.ts +71 -0
- package/dist/embedding/adapters/openai-text-embedding-3-small.js +190 -0
- package/dist/embedding/consumers/tessellation-drift.d.ts +74 -0
- package/dist/embedding/consumers/tessellation-drift.js +76 -0
- package/dist/embedding/cross-provider.d.ts +78 -0
- package/dist/embedding/cross-provider.js +75 -0
- package/dist/embedding/deprecation.d.ts +151 -0
- package/dist/embedding/deprecation.js +229 -0
- package/dist/embedding/errors.d.ts +90 -0
- package/dist/embedding/errors.js +150 -0
- package/dist/embedding/index.d.ts +29 -0
- package/dist/embedding/index.js +24 -0
- package/dist/embedding/pipeline-load.d.ts +146 -0
- package/dist/embedding/pipeline-load.js +178 -0
- package/dist/embedding/registry.d.ts +45 -0
- package/dist/embedding/registry.js +61 -0
- package/dist/embedding/stale-vector.d.ts +110 -0
- package/dist/embedding/stale-vector.js +92 -0
- package/dist/embedding/storage/index.d.ts +51 -0
- package/dist/embedding/storage/index.js +43 -0
- package/dist/embedding/storage/jsonl-backend.d.ts +150 -0
- package/dist/embedding/storage/jsonl-backend.js +332 -0
- package/dist/embedding/storage/types.d.ts +135 -0
- package/dist/embedding/storage/types.js +13 -0
- package/dist/embedding/types.d.ts +180 -0
- package/dist/embedding/types.js +10 -0
- package/dist/execute.d.ts +29 -2
- package/dist/execute.js +179 -35
- package/dist/index.d.ts +14 -2
- package/dist/index.js +19 -2
- package/dist/journey/inheritance-validator.d.ts +396 -0
- package/dist/journey/inheritance-validator.js +370 -0
- package/dist/journey/state-id-drift-rule.d.ts +137 -0
- package/dist/journey/state-id-drift-rule.js +245 -0
- package/dist/journey-sa2-router.d.ts +395 -0
- package/dist/journey-sa2-router.js +308 -0
- package/dist/models/classifier.d.ts +3 -1
- package/dist/models/classifier.js +61 -5
- package/dist/pillar-breakdown.d.ts +23 -1
- package/dist/pillar-breakdown.js +9 -0
- package/dist/runners/review-agent.js +6 -2
- package/dist/runners/runner-registry.d.ts +36 -0
- package/dist/runners/runner-registry.js +90 -0
- package/dist/runtime/attestations.d.ts +663 -11
- package/dist/runtime/attestations.js +971 -24
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/parallelism-flag.d.ts +21 -3
- package/dist/runtime/parallelism-flag.js +27 -6
- package/dist/runtime/port-allocator.d.ts +11 -0
- package/dist/runtime/port-allocator.js +30 -0
- package/dist/sa-scoring/layer3-llm.js +6 -1
- package/dist/sa-scoring/revision-proposal-config.d.ts +178 -0
- package/dist/sa-scoring/revision-proposal-config.js +198 -0
- package/dist/sa-scoring/revision-proposal.d.ts +285 -0
- package/dist/sa-scoring/revision-proposal.js +417 -0
- package/dist/signal-ingestion/adapters/community-thread.d.ts +43 -0
- package/dist/signal-ingestion/adapters/community-thread.js +55 -0
- package/dist/signal-ingestion/adapters/in-app-feedback.d.ts +67 -0
- package/dist/signal-ingestion/adapters/in-app-feedback.js +51 -0
- package/dist/signal-ingestion/adapters/manual.d.ts +78 -0
- package/dist/signal-ingestion/adapters/manual.js +112 -0
- package/dist/signal-ingestion/adapters/support-ticket.d.ts +47 -0
- package/dist/signal-ingestion/adapters/support-ticket.js +51 -0
- package/dist/signal-ingestion/classifier.d.ts +205 -0
- package/dist/signal-ingestion/classifier.js +494 -0
- package/dist/signal-ingestion/clustering-types.d.ts +36 -0
- package/dist/signal-ingestion/clustering-types.js +14 -0
- package/dist/signal-ingestion/clustering.d.ts +200 -0
- package/dist/signal-ingestion/clustering.js +413 -0
- package/dist/signal-ingestion/config.d.ts +351 -0
- package/dist/signal-ingestion/config.js +587 -0
- package/dist/signal-ingestion/d1.d.ts +252 -0
- package/dist/signal-ingestion/d1.js +235 -0
- package/dist/signal-ingestion/errors.d.ts +73 -0
- package/dist/signal-ingestion/errors.js +108 -0
- package/dist/signal-ingestion/governance-events.d.ts +181 -0
- package/dist/signal-ingestion/governance-events.js +189 -0
- package/dist/signal-ingestion/index.d.ts +35 -0
- package/dist/signal-ingestion/index.js +53 -0
- package/dist/signal-ingestion/manual-share-metric.d.ts +93 -0
- package/dist/signal-ingestion/manual-share-metric.js +106 -0
- package/dist/signal-ingestion/registry.d.ts +40 -0
- package/dist/signal-ingestion/registry.js +137 -0
- package/dist/signal-ingestion/residency.d.ts +227 -0
- package/dist/signal-ingestion/residency.js +238 -0
- package/dist/signal-ingestion/significance.d.ts +554 -0
- package/dist/signal-ingestion/significance.js +555 -0
- package/dist/signal-ingestion/types.d.ts +191 -0
- package/dist/signal-ingestion/types.js +8 -0
- package/dist/substrate/drift-composition.d.ts +270 -0
- package/dist/substrate/drift-composition.js +306 -0
- package/dist/substrate/drift-tui-surface.d.ts +61 -0
- package/dist/substrate/drift-tui-surface.js +102 -0
- package/dist/substrate/identity-class.d.ts +176 -0
- package/dist/substrate/identity-class.js +201 -0
- package/dist/tessellation/cross-soul-provenance-rule.d.ts +133 -0
- package/dist/tessellation/cross-soul-provenance-rule.js +171 -0
- package/dist/tessellation/inter-soul-embedding-distance-rule.d.ts +61 -0
- package/dist/tessellation/inter-soul-embedding-distance-rule.js +67 -0
- package/dist/tessellation/rule-registry.d.ts +269 -0
- package/dist/tessellation/rule-registry.js +92 -0
- package/dist/tessellation/soul-slug-ast-scan-rule.d.ts +90 -0
- package/dist/tessellation/soul-slug-ast-scan-rule.js +158 -0
- package/dist/tessellation-admission.d.ts +162 -0
- package/dist/tessellation-admission.js +146 -0
- package/dist/tessellation-drift.d.ts +246 -0
- package/dist/tessellation-drift.js +250 -0
- package/dist/validate-config.js +13 -0
- package/dist/validate-issue.js +2 -2
- package/dist/variant/cardinality-activation.d.ts +126 -0
- package/dist/variant/cardinality-activation.js +101 -0
- package/dist/variant/deprecation-lifecycle.d.ts +184 -0
- package/dist/variant/deprecation-lifecycle.js +208 -0
- package/dist/variant/drift-extension.d.ts +136 -0
- package/dist/variant/drift-extension.js +164 -0
- package/dist/variant/engineering-review.d.ts +185 -0
- package/dist/variant/engineering-review.js +142 -0
- package/dist/variant/index.d.ts +32 -0
- package/dist/variant/index.js +32 -0
- package/dist/variant/inheritance-validator.d.ts +165 -0
- package/dist/variant/inheritance-validator.js +139 -0
- package/dist/variant/internal-adopter/index.d.ts +11 -0
- package/dist/variant/internal-adopter/index.js +10 -0
- package/dist/variant/internal-adopter/products.d.ts +156 -0
- package/dist/variant/internal-adopter/products.js +366 -0
- package/dist/variant-admission.d.ts +316 -0
- package/dist/variant-admission.js +247 -0
- package/package.json +11 -8
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,12 @@ export { computePriority, rankWorkItems, type PriorityScore, type PriorityInput,
|
|
|
22
22
|
export { checkAction, enforceAction, DEFAULT_BLOCKED_ACTIONS, type ActionEnforcementResult, } from './action-enforcement.js';
|
|
23
23
|
export { scoreIssueForAdmission, mapIssueToPriorityInput, type AdmissionInput, type AdmissionThresholds, type IssueAdmissionResult, type AuthorAssociation, type DesignSystemContext, type AutonomyContext, type CodeAreaQuality, type DesignAuthoritySignal, type DesignAuthoritySignalType, type DesignQualityMetrics, } from './admission-score.js';
|
|
24
24
|
export { enrichAdmissionInput, computeDesignSystemReadiness, computeReadinessFromDesignSystemContext, computeDefectRiskFactor, computeAutonomyFactor, computeDesignAuthorityWeight, complexityToAutonomyLevel, type EnrichmentContext, type LifecyclePhase, } from './admission-enrichment.js';
|
|
25
|
-
export { computeAdmissionComposite, type AdmissionComposite } from './admission-composite.js';
|
|
26
|
-
export {
|
|
25
|
+
export { computeAdmissionComposite, type AdmissionComposite, type AdmissionCompositeOptions, } from './admission-composite.js';
|
|
26
|
+
export { resolveAffectedSouls, applyCrossSoulRule, computeTessellatedScores, type DepGraphSoulEntry, type SoulScores, type TessellationContext, type TessellatedSaResult, } from './tessellation-admission.js';
|
|
27
|
+
export { detectTessellationDrift, DEFAULT_DIVERGENCE_THRESHOLD, type TessellationDriftRule, type TessellationDriftDetectedEvent, type AstScanDetails, type AstScanFinding, type CrossSoulProvenanceDetails, type CrossSoulProvenanceFinding, type SubstrateFile, type ProvenanceAuditEntry, type TessellationDriftConfig, type TessellationDriftInput, type TessellationDriftResult, } from './tessellation-drift.js';
|
|
28
|
+
export { parseTargetedVariantRef, resolveTargetedVariants, applyCrossVariantRule, computeVariantScopedScores, defaultCrossSoulVariantRule, type VariantOverlay, type VariantDesignOverridesFramework, type VariantDesignOverridesExt, type VariantScores, type VariantConfig, type VariantAggregationRule, type WorkItemVariantTargeting, type VariantContext, type ParsedVariantRef, type VariantScopedSaResult, } from './variant-admission.js';
|
|
29
|
+
export { combineVariantSaForSoulAlignment } from './admission-composite.js';
|
|
30
|
+
export { parseBacklogTask, loadBacklogTaskFromRoot, mapBacklogTaskToAdmissionInput, loadSoulTracks, loadMaintainers, extractCodeAreaFromReferences, parseBodyReferences, type BacklogTaskSnapshot, type BacklogAcceptanceCriterion, type BacklogMappingOptions, type BacklogAdmissionMapping, } from './backlog-adapter.js';
|
|
27
31
|
export { computePillarBreakdown, detectTensions, pillarSignalScore, type PillarBreakdown, type PillarContribution, type PillarName, type SharedDimensions, type TensionFlag, type TensionFlagType, type HcChannelBreakdown, } from './pillar-breakdown.js';
|
|
28
32
|
export { compileDid, validatePhase2bReadiness, hashDidSpec, canonicalJson, tokenize, serializeForStore, deserializeFromStore, type CompiledDid, type CompiledScopeLists, type CompiledScopeEntry, type CompiledConstraintRule, type CompiledAntiPattern, type CompiledAntiPatternLists, type CompiledMeasurableSignal, type Bm25Corpus, type Bm25Document, type PrincipleCorpora, type ReadinessResult, } from './sa-scoring/did-compiler.js';
|
|
29
33
|
export { HttpDepparseClient, FakeDepparseClient, DepparseError, type DepparseClient, type DepparseMatch, type DepparseMatchRequest, type DepparseMatchResponse, type DepparseHealth, type DepparseErrorKind, } from './sa-scoring/depparse-client.js';
|
|
@@ -36,6 +40,7 @@ export { SAFeedbackStore, SA_FEEDBACK_LABELS, classifyLabel, recordOverrideFeedb
|
|
|
36
40
|
export { computeCalibrationCoefficient, buildCategoryCoefficients, type CategoryFeedback, type BuildCategoryCoefficientsInput, } from './calibration.js';
|
|
37
41
|
export { autoCalibratePhaseWeights, computePhase3Weights, decideCalibrationDirection, renderCalibrationDiff, WEIGHT_FLOOR, WEIGHT_CEILING, DEFAULT_SHIFT_SIZE, DEFAULT_WINDOW_DAYS, PRECISION_DELTA_THRESHOLD, type PrecisionPair, type CalibrationDecision, type ComputePhase3WeightsInput, type AutoCalibrateDeps, type AutoCalibrateResult, type DimensionDiff, } from './sa-scoring/auto-calibrate.js';
|
|
38
42
|
export { detectSoulDrift, computeWindowStats, computeTrend, describeDriftSource, DEFAULT_MEAN_THRESHOLD, DEFAULT_STDDEV_THRESHOLD, DEFAULT_CONSECUTIVE_WINDOWS, DEFAULT_RECOVERY_MS, type SoulDriftDetectedEvent, type DriftTrend, type WindowStats, type DriftDetectorDeps, } from './sa-scoring/drift-monitor.js';
|
|
43
|
+
export { classifyDrift, deriveApprovalPath, computeConfidence, evaluateRevisionProposal, triggerConditionMet, isFieldLocked, isProposalExpired, archiveExpiredProposals, recordRejection, computeRejectionPrecedentFactor, DEFAULT_DISMISS_THRESHOLD, DEFAULT_DEMAND_MISALIGNMENT_THRESHOLD, DEFAULT_DRIFT_EVENTS_THRESHOLD, DEFAULT_TRIGGER_WINDOW_DAYS, DEFAULT_PROPOSAL_EXPIRY_DAYS, HEALTHY_ICP_MATCH_MIN, UNHEALTHY_ICP_MATCH_MAX, type DriftClassification, type IdentityClass, type ApprovalPath, type ProposalStatus, type ProposalConfidence, type ClassificationEvidence, type TriggerEvidence, type TriggerConditions, type TriggerConfig, type CalibrationLockConfig, type DIDRevisionProposalEvent, type SoulHealthDiagnosticEvent, type DIDRevisionProposalExpiredEvent, type ProposalRejectionRecord, type EvaluateRevisionProposalInput, type EvaluateRevisionProposalResult, } from './sa-scoring/revision-proposal.js';
|
|
39
44
|
export { handleCoreIdentityChanged, type CoreIdentityChangedEvent, type BacklogReshuffledEvent, type SoulGraphStaleFlag, type RescoreDeps, type HandleResult, } from './sa-scoring/rescore-orchestrator.js';
|
|
40
45
|
export { scoreSoulAlignment, resolveSoulAlignmentOverride, type ScoreSoulAlignmentInput, type ScoreSoulAlignmentDeps, type SoulAlignmentScoringResult, } from './sa-scoring/index.js';
|
|
41
46
|
export type { SaDimension, FeedbackSignal } from './state/types.js';
|
|
@@ -47,6 +52,10 @@ export { createPipelineAdapterRegistry, createPipelineWebhookBridge, resolveAdap
|
|
|
47
52
|
export { createPipelineReconciler, createGateReconciler, createAutonomyReconciler, hasResourceChanged, fingerprintResource, } from './reconcilers.js';
|
|
48
53
|
export { createFileAuditLog, verifyAuditIntegrity, loadAuditEntries, rotateAuditLog, computeAuditHash, } from './audit-extended.js';
|
|
49
54
|
export { checkFrameworkCompliance, getControlCatalog, getFrameworkMappings, listSupportedFrameworks, } from './compliance-extended.js';
|
|
55
|
+
export { HARD_REGULATORY_REGIME_PREFIXES, isHardRegulatoryRegime, validateComplianceRegimes, computeComplianceClearance, type ValidateComplianceRegimesResult, type ComplianceViolation, type ComplianceViolationEntry, type SoulComplianceRegimes, type ComplianceClearanceContext, type ComplianceClearanceResult, } from './compliance-clearance.js';
|
|
56
|
+
export { loadCompliancePosture, DEFAULT_COMPLIANCE_MANIFEST_PATH, type LoadCompliancePostureOptions, } from './compliance/loader.js';
|
|
57
|
+
export { MissingComplianceAttestation, MissingDerivedGateOverrideNotes, UnknownRegime, CompliancePostureValidationError, } from './compliance/errors.js';
|
|
58
|
+
export { BASELINE_DERIVED_GATES, BASELINE_POSTURE, type CompliancePosture, type Regime, type DerivedGates, type PartialDerivedGatesOverrides, type AuditExportSpec, } from './compliance/types.js';
|
|
50
59
|
export { createSilentLogger, withPipelineSpanSync, getPipelineTracer, validateResourceSchema, } from './telemetry-extended.js';
|
|
51
60
|
export { ClaudeCodeRunner, ClaudeCodeRunner as GitHubActionsRunner, GenericLLMRunner, CopilotRunner, CursorRunner, CodexRunner, RunnerRegistry, createRunnerRegistry, SecurityTriageRunner, ReviewAgentRunner, REVIEW_PROMPTS, type AgentRunner, type AgentContext, type AgentResult, type AgentProgressEvent, type GenericLLMConfig, type RegisteredRunner, type SecurityTriageConfig, type TriageVerdict, type ReviewAgentConfig, type ReviewType, type ReviewFinding, type ReviewVerdict, } from './runners/index.js';
|
|
52
61
|
export type { TokenUsage } from './runners/index.js';
|
|
@@ -98,6 +107,9 @@ export { WorktreePoolManager, WorktreePoolError, WorktreeOwnershipError, determi
|
|
|
98
107
|
export { HarnessRegistry, UnknownHarnessError, ClaudeCodeAdapter, CodexAdapter, createDefaultHarnessRegistry, probeVersion, matchesRange, enforceIndependence, validateIndependenceGraph, CyclicIndependenceConstraintError, type HarnessAdapter, type HarnessAvailability, type HarnessCapabilities, type HarnessEvent, type HarnessInput, type HarnessName, type HarnessRequires, type HarnessResult, type HarnessResultStatus, type ClaudeCodeAdapterDeps, type CodexAdapterDeps, type IndependenceResult, type UpstreamRun, type ToolDefinition, } from './harness/index.js';
|
|
99
108
|
export { SubscriptionLedger, validateTenantShares, evaluateSchedule, CalibrationStore, COLD_START_DEFAULT, buildBurnDownReport, analyzeTier, PLAN_COSTS_USD, isOffPeakAt, nextOffPeakStart, ageInDays, freshnessLevel, DEFAULT_TENANT, COLD_START_DEFAULT_INPUT, COLD_START_DEFAULT_OUTPUT, ESTIMATE_VARIANCE_THRESHOLD, ROLLING_WINDOW_SIZE, type SubscriptionPlan, type Schedule, type TokenEstimate, type LedgerKey, type WindowState, type AdmissionDecision, type BurnDownReport, type LedgerEvent, type BillingMode, type QuotaSource, type OffPeakSchedule, type BurnDownInput, type CalibrationStoreDeps, type LedgerDeps, type ScheduleDecision, type ScheduleEvaluationContext, type Confidence, type ContentionEvent, type TierAnalysisInput, type TierAnalysisResult, type FreshnessLevel, } from './scheduling/index.js';
|
|
100
109
|
export { DatabaseAdapterRegistry, UnknownDatabaseAdapterError, SqliteCopyAdapter, NeonAdapter, PgSnapshotRestoreAdapter, ExternalAdapter, createDefaultDatabaseAdapterRegistry, buildInjectionOverrides, parsePostgresUrl, maskConnectionString, enforceTopologyGuard, buildMigrationDivergedEvent, DatabaseBranchAdapterError, BranchTopologyForbiddenError, type DatabaseBranchAdapter, type DatabaseBranchCapabilities, type DatabaseBranchHandle, type DatabaseAdapterName, type ResolvedDatabaseBranchPool, type DatabaseAccess, type SqliteCopyAdapterDeps, type NeonAdapterDeps, type PgSnapshotRestoreAdapterDeps, type ExternalAdapterDeps, type InjectedEnvOverrides, type KnownInFlightBranches, type MigrationDivergedEvent, } from './database/index.js';
|
|
110
|
+
export { AdapterCredentialInvalid, CommunityThreadSignalSourceAdapter, ManualSignalIncomplete, ManualSignalSourceAdapter, SignalSourceRegistry, SignalSourceUnavailable, SupportTicketSignalSourceAdapter, UnknownSignalSource, createDefaultSignalSourceRegistry, fetchSignalsFromAvailableAdapters, getSignalSourceAdapter, type AdapterCredentialInvalidDecision, type CommunityThreadAdapterOptions, type CustomerTier, type ManualSignalIncompleteDecision, type ManualSignalInput, type RawSignal, type SignalFetchResult, type SignalSourceAdapter, type SignalSourceName, type SignalTier, type SupportTicketAdapterOptions, } from './signal-ingestion/index.js';
|
|
111
|
+
export { classifySignals, computeRecencyDecay, computeSignalWeight, resolveCustomerTier, resolveIcpResonance, tokenize as tokenizeSignalPayload, DEFAULT_SIGNAL_INGESTION_CONFIG, DEFAULT_SIGNAL_INGESTION_CONFIG_PATH, SignalIngestionConfigError, loadSignalIngestionConfig, type ClassificationResult, type ClassifiedSignal, type ClassifySignalsOptions, type ClusteringConfig, type CustomerTierRegistry, type ICPResonance, type IcpResonanceWeights, type LoadSignalIngestionConfigOptions, type SaResonanceThresholds, type SignalIngestionConfig, type SignalLanguageUnsupportedDecision, type Tier2SignificanceThreshold, type TierMultipliers, } from './signal-ingestion/index.js';
|
|
112
|
+
export { aggregateD1FromClusters, composeD1Inputs, computeClusterD1, enrichDemandSignalFromClusters, type AggregatedD1Result, type ClusterD1Score, type ClusterMatcher, type ComposeD1InputsArgs, type ComposedD1Result, type D1CompositionWeights, type EnrichDemandSignalArgs, type EnrichDemandSignalResult, } from './signal-ingestion/index.js';
|
|
101
113
|
export { StateWriter, appendEvent, readEvents, atomicWriteJson, listActiveStates, HEARTBEAT_INTERVAL_MS, HEARTBEAT_STALE_MS, type RuntimeState, type ArtifactEvent, type StageStatus, } from './artifacts/index.js';
|
|
102
114
|
export { runWorkerPool, withMergeGate, forceReleaseMergeGate, isBranchUpToDate, MergeGateLockTimeoutError, decideRequeue, appendTriageHistory, type WorkItem, type WorkerPoolDeps, type WorkerPoolEvent, type WorkerPoolResult, type FailureEvent, type RequeueTrigger, type RequeueDecision, type RequeueDecisionInput, type TriageHistoryEntry, type FailureClassification, type MergeGateDeps, } from './dispatch/index.js';
|
|
103
115
|
export { ModelRegistry, ModelRemovedError, UnknownAliasError, DEFAULT_REGISTRY, decideFromRawOutput, decideFromInvocationFailure, validateClassifierOutput, defaultRulesetDecision, appendCalibrationEntry, ALL_REVIEWERS, type ModelEntry, type ResolutionContext, type ResolutionResult, type ResolutionEvent, type ReviewerName, type ClassifierOutput, type ClassifierDecision, type FellOpenReason, type CalibrationLogEntry, type DiffSummary, } from './models/index.js';
|
package/dist/index.js
CHANGED
|
@@ -35,8 +35,12 @@ export { checkAction, enforceAction, DEFAULT_BLOCKED_ACTIONS, } from './action-e
|
|
|
35
35
|
// Issue admission scoring
|
|
36
36
|
export { scoreIssueForAdmission, mapIssueToPriorityInput, } from './admission-score.js';
|
|
37
37
|
export { enrichAdmissionInput, computeDesignSystemReadiness, computeReadinessFromDesignSystemContext, computeDefectRiskFactor, computeAutonomyFactor, computeDesignAuthorityWeight, complexityToAutonomyLevel, } from './admission-enrichment.js';
|
|
38
|
-
export { computeAdmissionComposite } from './admission-composite.js';
|
|
39
|
-
export {
|
|
38
|
+
export { computeAdmissionComposite, } from './admission-composite.js';
|
|
39
|
+
export { resolveAffectedSouls, applyCrossSoulRule, computeTessellatedScores, } from './tessellation-admission.js';
|
|
40
|
+
export { detectTessellationDrift, DEFAULT_DIVERGENCE_THRESHOLD, } from './tessellation-drift.js';
|
|
41
|
+
export { parseTargetedVariantRef, resolveTargetedVariants, applyCrossVariantRule, computeVariantScopedScores, defaultCrossSoulVariantRule, } from './variant-admission.js';
|
|
42
|
+
export { combineVariantSaForSoulAlignment } from './admission-composite.js';
|
|
43
|
+
export { parseBacklogTask, loadBacklogTaskFromRoot, mapBacklogTaskToAdmissionInput, loadSoulTracks, loadMaintainers, extractCodeAreaFromReferences, parseBodyReferences, } from './backlog-adapter.js';
|
|
40
44
|
export { computePillarBreakdown, detectTensions, pillarSignalScore, } from './pillar-breakdown.js';
|
|
41
45
|
// RFC-0008 Addendum B — SA scoring (Layer 1/2/3 + composite)
|
|
42
46
|
export { compileDid, validatePhase2bReadiness, hashDidSpec, canonicalJson, tokenize, serializeForStore, deserializeFromStore, } from './sa-scoring/did-compiler.js';
|
|
@@ -50,6 +54,7 @@ export { SAFeedbackStore, SA_FEEDBACK_LABELS, classifyLabel, recordOverrideFeedb
|
|
|
50
54
|
export { computeCalibrationCoefficient, buildCategoryCoefficients, } from './calibration.js';
|
|
51
55
|
export { autoCalibratePhaseWeights, computePhase3Weights, decideCalibrationDirection, renderCalibrationDiff, WEIGHT_FLOOR, WEIGHT_CEILING, DEFAULT_SHIFT_SIZE, DEFAULT_WINDOW_DAYS, PRECISION_DELTA_THRESHOLD, } from './sa-scoring/auto-calibrate.js';
|
|
52
56
|
export { detectSoulDrift, computeWindowStats, computeTrend, describeDriftSource, DEFAULT_MEAN_THRESHOLD, DEFAULT_STDDEV_THRESHOLD, DEFAULT_CONSECUTIVE_WINDOWS, DEFAULT_RECOVERY_MS, } from './sa-scoring/drift-monitor.js';
|
|
57
|
+
export { classifyDrift, deriveApprovalPath, computeConfidence, evaluateRevisionProposal, triggerConditionMet, isFieldLocked, isProposalExpired, archiveExpiredProposals, recordRejection, computeRejectionPrecedentFactor, DEFAULT_DISMISS_THRESHOLD, DEFAULT_DEMAND_MISALIGNMENT_THRESHOLD, DEFAULT_DRIFT_EVENTS_THRESHOLD, DEFAULT_TRIGGER_WINDOW_DAYS, DEFAULT_PROPOSAL_EXPIRY_DAYS, HEALTHY_ICP_MATCH_MIN, UNHEALTHY_ICP_MATCH_MAX, } from './sa-scoring/revision-proposal.js';
|
|
53
58
|
export { handleCoreIdentityChanged, } from './sa-scoring/rescore-orchestrator.js';
|
|
54
59
|
export { scoreSoulAlignment, resolveSoulAlignmentOverride, } from './sa-scoring/index.js';
|
|
55
60
|
// PR review orchestration
|
|
@@ -67,6 +72,12 @@ export { createPipelineReconciler, createGateReconciler, createAutonomyReconcile
|
|
|
67
72
|
export { createFileAuditLog, verifyAuditIntegrity, loadAuditEntries, rotateAuditLog, computeAuditHash, } from './audit-extended.js';
|
|
68
73
|
// Extended compliance
|
|
69
74
|
export { checkFrameworkCompliance, getControlCatalog, getFrameworkMappings, listSupportedFrameworks, } from './compliance-extended.js';
|
|
75
|
+
// RFC-0009 Phase 4.1 — Eρ₅ Compliance Clearance
|
|
76
|
+
export { HARD_REGULATORY_REGIME_PREFIXES, isHardRegulatoryRegime, validateComplianceRegimes, computeComplianceClearance, } from './compliance-clearance.js';
|
|
77
|
+
// RFC-0022 Phase 1 — CompliancePosture schema + loader
|
|
78
|
+
export { loadCompliancePosture, DEFAULT_COMPLIANCE_MANIFEST_PATH, } from './compliance/loader.js';
|
|
79
|
+
export { MissingComplianceAttestation, MissingDerivedGateOverrideNotes, UnknownRegime, CompliancePostureValidationError, } from './compliance/errors.js';
|
|
80
|
+
export { BASELINE_DERIVED_GATES, BASELINE_POSTURE, } from './compliance/types.js';
|
|
70
81
|
// Extended telemetry
|
|
71
82
|
export { createSilentLogger, withPipelineSpanSync, getPipelineTracer, validateResourceSchema, } from './telemetry-extended.js';
|
|
72
83
|
// Runners
|
|
@@ -124,6 +135,12 @@ export { HarnessRegistry, UnknownHarnessError, ClaudeCodeAdapter, CodexAdapter,
|
|
|
124
135
|
export { SubscriptionLedger, validateTenantShares, evaluateSchedule, CalibrationStore, COLD_START_DEFAULT, buildBurnDownReport, analyzeTier, PLAN_COSTS_USD, isOffPeakAt, nextOffPeakStart, ageInDays, freshnessLevel, DEFAULT_TENANT, COLD_START_DEFAULT_INPUT, COLD_START_DEFAULT_OUTPUT, ESTIMATE_VARIANCE_THRESHOLD, ROLLING_WINDOW_SIZE, } from './scheduling/index.js';
|
|
125
136
|
// RFC-0010 database branching (DatabaseBranchAdapter framework + 4 adapters)
|
|
126
137
|
export { DatabaseAdapterRegistry, UnknownDatabaseAdapterError, SqliteCopyAdapter, NeonAdapter, PgSnapshotRestoreAdapter, ExternalAdapter, createDefaultDatabaseAdapterRegistry, buildInjectionOverrides, parsePostgresUrl, maskConnectionString, enforceTopologyGuard, buildMigrationDivergedEvent, DatabaseBranchAdapterError, BranchTopologyForbiddenError, } from './database/index.js';
|
|
138
|
+
// RFC-0030 Phase 1 — signal ingestion source adapters
|
|
139
|
+
export { AdapterCredentialInvalid, CommunityThreadSignalSourceAdapter, ManualSignalIncomplete, ManualSignalSourceAdapter, SignalSourceRegistry, SignalSourceUnavailable, SupportTicketSignalSourceAdapter, UnknownSignalSource, createDefaultSignalSourceRegistry, fetchSignalsFromAvailableAdapters, getSignalSourceAdapter, } from './signal-ingestion/index.js';
|
|
140
|
+
// RFC-0030 Phase 2 — classification (tier + ICP resonance + recency + language gate)
|
|
141
|
+
export { classifySignals, computeRecencyDecay, computeSignalWeight, resolveCustomerTier, resolveIcpResonance, tokenize as tokenizeSignalPayload, DEFAULT_SIGNAL_INGESTION_CONFIG, DEFAULT_SIGNAL_INGESTION_CONFIG_PATH, SignalIngestionConfigError, loadSignalIngestionConfig, } from './signal-ingestion/index.js';
|
|
142
|
+
// RFC-0030 Phase 5 — D1 formula reformulation + RFC-0008 PPA integration
|
|
143
|
+
export { aggregateD1FromClusters, composeD1Inputs, computeClusterD1, enrichDemandSignalFromClusters, } from './signal-ingestion/index.js';
|
|
127
144
|
// RFC-0010 artifacts (heartbeat + event stream + atomic JSON + state listing)
|
|
128
145
|
export { StateWriter, appendEvent, readEvents, atomicWriteJson, listActiveStates, HEARTBEAT_INTERVAL_MS, HEARTBEAT_STALE_MS, } from './artifacts/index.js';
|
|
129
146
|
// RFC-0010 dispatch (worker pool + merge gate + requeue)
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC-0018 Phase 1 — Journey Inheritance Validator.
|
|
3
|
+
*
|
|
4
|
+
* Implements RFC-0018 §5.3 bounded-inheritance enforcement for journey
|
|
5
|
+
* declarations on Soul DIDs and Variants. When a violation is detected the
|
|
6
|
+
* validator emits a `JourneyInheritanceViolation` event (RFC-0008 §C5).
|
|
7
|
+
*
|
|
8
|
+
* Covers the following AC items (AISDLC-465):
|
|
9
|
+
* AC #5: JourneyInheritanceViolation event emitted for all 5 violation classes.
|
|
10
|
+
* AC #7: Journey count thresholds emit Decisions (journey-count-soft-warning at >=10;
|
|
11
|
+
* journey-count-hard-limit-exceeded at >=50).
|
|
12
|
+
* AC #8: State count thresholds emit Decisions (journey-state-count-soft-warning at >=12
|
|
13
|
+
* with v1-workaround message; journey-state-count-hard-limit-exceeded at >=100).
|
|
14
|
+
* AC #9: Nested journeys[] rejected at schema validation (schema-enforced flat, OQ-3).
|
|
15
|
+
* AC #10: Decision: journey-sub-flow-activation-request Stage A counter wired.
|
|
16
|
+
*
|
|
17
|
+
* ### Bounded inheritance (§5.3)
|
|
18
|
+
*
|
|
19
|
+
* Journeys MUST NOT attempt to override the following fields inherited from
|
|
20
|
+
* the parent Soul DID (or Variant when scope=variant):
|
|
21
|
+
*
|
|
22
|
+
* 1. `complianceRegimes` — per-soul (locked at soul/variant level)
|
|
23
|
+
* 2. `targetAudience` — inherits from soul or variant
|
|
24
|
+
* 3. `substrateInvariants` — locked at soul level
|
|
25
|
+
* 4. `complianceFloor` — when scope=variant, MUST be 'inherit' (never a custom value)
|
|
26
|
+
* 5. `wcagLevel` lowering — journeys MAY raise WCAG above parent but NEVER lower it
|
|
27
|
+
*
|
|
28
|
+
* ### Count + state limits (OQ-1, OQ-2)
|
|
29
|
+
*
|
|
30
|
+
* Per-org configurable via `.ai-sdlc/journey-config.yaml`:
|
|
31
|
+
* journey.limits.softWarnAt (default 10) / journey.limits.hardLimit (default 50)
|
|
32
|
+
* journey.stateLimits.softWarnAt (default 12) / journey.stateLimits.hardLimit (default 100)
|
|
33
|
+
*
|
|
34
|
+
* ### Nested-journey rejection (OQ-3)
|
|
35
|
+
*
|
|
36
|
+
* Schema-enforced flat: a journey declaration MUST NOT contain a `journeys[]`
|
|
37
|
+
* field. Emits `NestedJourneyRejected` (blocking).
|
|
38
|
+
*
|
|
39
|
+
* ### Sub-flow activation counter (OQ-3)
|
|
40
|
+
*
|
|
41
|
+
* Tracks distinct adopter requests for journey-sub-flow activation. When a
|
|
42
|
+
* journey declaration contains a nested `journeys[]` field, the validator:
|
|
43
|
+
* 1. Emits `NestedJourneyRejected` (blocking).
|
|
44
|
+
* 2. Records the request in the sub-flow activation counter.
|
|
45
|
+
* 3. When distinctAdopterCount >= threshold (default 2), marks
|
|
46
|
+
* `promotedToOperatorReview: true` in the counter result, signalling
|
|
47
|
+
* that a follow-on RFC discussion should be surfaced.
|
|
48
|
+
*
|
|
49
|
+
* @see spec/rfcs/RFC-0018-in-soul-journey-pattern.md §5.3 + §10.1
|
|
50
|
+
* @see orchestrator/src/variant/inheritance-validator.ts — parallel RFC-0017 validator
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Field names that are INHERITED from the parent Soul DID and cannot be
|
|
54
|
+
* overridden by any journey declaration. Attempting to declare these on a
|
|
55
|
+
* journey triggers a `JourneyInheritanceViolation`.
|
|
56
|
+
*
|
|
57
|
+
* Note: `complianceFloor` is validated separately (it must be 'inherit' when
|
|
58
|
+
* scope=variant, not merely absent) — see `validateComplianceFloor`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const JOURNEY_INHERITED_LOCKED_FIELDS: readonly ["complianceRegimes", "targetAudience", "substrateInvariants"];
|
|
61
|
+
export type JourneyInheritedLockedField = (typeof JOURNEY_INHERITED_LOCKED_FIELDS)[number];
|
|
62
|
+
/**
|
|
63
|
+
* Numeric ordering for WCAG levels. Higher = stricter.
|
|
64
|
+
* Used to detect lowering of WCAG level below parent.
|
|
65
|
+
*/
|
|
66
|
+
export declare const WCAG_LEVEL_ORDER: Record<string, number>;
|
|
67
|
+
/**
|
|
68
|
+
* Discriminated event kind for journey-level events emitted to events.jsonl.
|
|
69
|
+
*/
|
|
70
|
+
export type JourneyEventKind = 'JourneyInheritanceViolation' | 'JourneyCountSoftWarning' | 'JourneyCountHardLimitExceeded' | 'JourneyStateCountSoftWarning' | 'JourneyStateCountHardLimitExceeded' | 'NestedJourneyRejected';
|
|
71
|
+
/**
|
|
72
|
+
* The 5 violation classes per RFC-0018 §5.3 bounded inheritance.
|
|
73
|
+
*
|
|
74
|
+
* Each violation class corresponds to a field (or semantic constraint)
|
|
75
|
+
* that a journey may NOT override from its parent Soul DID or Variant.
|
|
76
|
+
*/
|
|
77
|
+
export type JourneyViolationClass = 'complianceRegimes' | 'targetAudience' | 'substrateInvariants' | 'complianceFloor' | 'wcagLevel-lowered-below-parent';
|
|
78
|
+
/**
|
|
79
|
+
* Emitted when a journey attempts to override an inherited locked field per
|
|
80
|
+
* RFC-0018 §5.3. This is an Engineering vertex error (RFC-0008 §C5).
|
|
81
|
+
*
|
|
82
|
+
* The result is `blocking: true` — the declaring Soul DID is invalid until
|
|
83
|
+
* the offending override is removed.
|
|
84
|
+
*/
|
|
85
|
+
export interface JourneyInheritanceViolation {
|
|
86
|
+
readonly kind: 'JourneyInheritanceViolation';
|
|
87
|
+
/** Identifier of the Soul DID that contains the offending journey. */
|
|
88
|
+
readonly soulId: string;
|
|
89
|
+
/** The journey's `id` field value. */
|
|
90
|
+
readonly journeyId: string;
|
|
91
|
+
/** The violation class (which inheritance constraint was broken). */
|
|
92
|
+
readonly violationClass: JourneyViolationClass;
|
|
93
|
+
/** Human-readable description of the violation. */
|
|
94
|
+
readonly message: string;
|
|
95
|
+
/** Always true — inheritance violations are blocking errors. */
|
|
96
|
+
readonly blocking: true;
|
|
97
|
+
readonly timestamp: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Non-blocking warning emitted when a Soul DID's journey count reaches the
|
|
101
|
+
* soft-warn threshold (default 10 per OQ-1). Routes through Decision Catalog
|
|
102
|
+
* as `Decision: journey-count-soft-warning` for operator batch review.
|
|
103
|
+
*/
|
|
104
|
+
export interface JourneyCountSoftWarning {
|
|
105
|
+
readonly kind: 'JourneyCountSoftWarning';
|
|
106
|
+
readonly soulId: string;
|
|
107
|
+
readonly journeyCount: number;
|
|
108
|
+
readonly threshold: number;
|
|
109
|
+
readonly message: string;
|
|
110
|
+
readonly blocking: false;
|
|
111
|
+
readonly timestamp: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Hard-blocking rejection emitted when a Soul DID's journey count reaches the
|
|
115
|
+
* hard limit (default 50 per OQ-1). The Soul DID declaration is rejected.
|
|
116
|
+
* Routes through Decision Catalog as `Decision: journey-count-hard-limit-exceeded`
|
|
117
|
+
* plus a clarification task.
|
|
118
|
+
*/
|
|
119
|
+
export interface JourneyCountHardLimitExceeded {
|
|
120
|
+
readonly kind: 'JourneyCountHardLimitExceeded';
|
|
121
|
+
readonly soulId: string;
|
|
122
|
+
readonly journeyCount: number;
|
|
123
|
+
readonly limit: number;
|
|
124
|
+
readonly message: string;
|
|
125
|
+
readonly blocking: true;
|
|
126
|
+
readonly timestamp: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Non-blocking warning emitted when a journey's state count reaches the
|
|
130
|
+
* soft-warn threshold (default 12 per OQ-2). Includes concrete v1 workaround
|
|
131
|
+
* message pointing at the split-journeys pattern.
|
|
132
|
+
*/
|
|
133
|
+
export interface JourneyStateCountSoftWarning {
|
|
134
|
+
readonly kind: 'JourneyStateCountSoftWarning';
|
|
135
|
+
readonly soulId: string;
|
|
136
|
+
readonly journeyId: string;
|
|
137
|
+
readonly stateCount: number;
|
|
138
|
+
readonly threshold: number;
|
|
139
|
+
readonly message: string;
|
|
140
|
+
readonly v1WorkaroundMessage: string;
|
|
141
|
+
readonly blocking: false;
|
|
142
|
+
readonly timestamp: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Hard-blocking rejection emitted when a journey's state count reaches the
|
|
146
|
+
* hard limit (default 100 per OQ-2). This is a sanity guard (typo /
|
|
147
|
+
* runaway-loop), NOT an architectural constraint.
|
|
148
|
+
*/
|
|
149
|
+
export interface JourneyStateCountHardLimitExceeded {
|
|
150
|
+
readonly kind: 'JourneyStateCountHardLimitExceeded';
|
|
151
|
+
readonly soulId: string;
|
|
152
|
+
readonly journeyId: string;
|
|
153
|
+
readonly stateCount: number;
|
|
154
|
+
readonly limit: number;
|
|
155
|
+
readonly message: string;
|
|
156
|
+
readonly blocking: true;
|
|
157
|
+
readonly timestamp: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Emitted when a nested `journeys[]` field is detected inside a journey
|
|
161
|
+
* declaration. Schema-enforced flat per RFC-0018 OQ-3. Blocking.
|
|
162
|
+
*/
|
|
163
|
+
export interface NestedJourneyRejected {
|
|
164
|
+
readonly kind: 'NestedJourneyRejected';
|
|
165
|
+
readonly soulId: string;
|
|
166
|
+
readonly journeyId: string;
|
|
167
|
+
readonly message: string;
|
|
168
|
+
readonly blocking: true;
|
|
169
|
+
readonly timestamp: string;
|
|
170
|
+
}
|
|
171
|
+
export type JourneyEvent = JourneyInheritanceViolation | JourneyCountSoftWarning | JourneyCountHardLimitExceeded | JourneyStateCountSoftWarning | JourneyStateCountHardLimitExceeded | NestedJourneyRejected;
|
|
172
|
+
/**
|
|
173
|
+
* Result of the sub-flow activation counter check (OQ-3).
|
|
174
|
+
*
|
|
175
|
+
* Tracks distinct adopter requests for journey-sub-flow activation.
|
|
176
|
+
* When `distinctAdopterCount >= threshold`, `promotedToOperatorReview` is
|
|
177
|
+
* set to `true` — a signal to surface the topic for follow-on RFC discussion.
|
|
178
|
+
*/
|
|
179
|
+
export interface SubFlowActivationCounterResult {
|
|
180
|
+
readonly decision: 'journey-sub-flow-activation-request';
|
|
181
|
+
readonly distinctAdopterCount: number;
|
|
182
|
+
readonly threshold: number;
|
|
183
|
+
readonly promotedToOperatorReview: boolean;
|
|
184
|
+
readonly adopters: readonly string[];
|
|
185
|
+
readonly recommendation: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Minimal representation of one state declaration as loaded from a journey.
|
|
189
|
+
*/
|
|
190
|
+
export interface JourneyStateInput {
|
|
191
|
+
/** State identifier (kebab-case). */
|
|
192
|
+
id: string;
|
|
193
|
+
/** Whether this state is a terminal state. */
|
|
194
|
+
terminal?: boolean;
|
|
195
|
+
/** Whether this terminal state is a success state. */
|
|
196
|
+
successState?: boolean;
|
|
197
|
+
[key: string]: unknown;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Minimal accessibility block as loaded from a journey.
|
|
201
|
+
*/
|
|
202
|
+
export interface JourneyAccessibilityInput {
|
|
203
|
+
/** WCAG level declared on this journey. */
|
|
204
|
+
wcagLevel?: string;
|
|
205
|
+
[key: string]: unknown;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Minimal representation of one journey declaration as loaded from a Soul DID
|
|
209
|
+
* or Variant. Mirrors the JSON Schema shape at
|
|
210
|
+
* `spec/schemas/journey.v1.schema.json`.
|
|
211
|
+
*/
|
|
212
|
+
export interface JourneyDeclarationInput {
|
|
213
|
+
/** Kebab-case journey id. */
|
|
214
|
+
id: string;
|
|
215
|
+
/** Scope — 'soul' or 'variant:<id>'. */
|
|
216
|
+
scope?: string;
|
|
217
|
+
/** State declarations. */
|
|
218
|
+
states?: JourneyStateInput[];
|
|
219
|
+
/** Accessibility block (for WCAG-level inheritance check). */
|
|
220
|
+
accessibility?: JourneyAccessibilityInput;
|
|
221
|
+
/**
|
|
222
|
+
* Any additional fields present in the raw declaration — used to detect
|
|
223
|
+
* attempts to override locked inherited fields and nested journeys.
|
|
224
|
+
*/
|
|
225
|
+
[key: string]: unknown;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Per-org journey count configuration. Loaded from
|
|
229
|
+
* `.ai-sdlc/journey-config.yaml` (`journey.limits`) with the defaults below.
|
|
230
|
+
*/
|
|
231
|
+
export interface JourneyLimitsConfig {
|
|
232
|
+
/** Non-blocking soft warn threshold for journey count. Default: 10. */
|
|
233
|
+
softWarnAt?: number;
|
|
234
|
+
/** Hard-blocking rejection limit for journey count. Default: 50. */
|
|
235
|
+
hardLimit?: number;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Per-org journey state count configuration. Loaded from
|
|
239
|
+
* `.ai-sdlc/journey-config.yaml` (`journey.stateLimits`) with the defaults below.
|
|
240
|
+
*/
|
|
241
|
+
export interface JourneyStateLimitsConfig {
|
|
242
|
+
/** Non-blocking soft warn threshold for state count per journey. Default: 12. */
|
|
243
|
+
softWarnAt?: number;
|
|
244
|
+
/** Hard-blocking rejection limit for state count per journey. Default: 100. */
|
|
245
|
+
hardLimit?: number;
|
|
246
|
+
/** Optional operator-actionable message shown with soft-warn Decision. */
|
|
247
|
+
softWarnMessage?: string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Per-org sub-flow activation counter configuration.
|
|
251
|
+
* Loaded from `.ai-sdlc/journey-config.yaml` (`journey.subJourneys`).
|
|
252
|
+
*/
|
|
253
|
+
export interface SubFlowActivationConfig {
|
|
254
|
+
/** Auto-promote threshold. Default: 2 distinct adopter requests. */
|
|
255
|
+
distinctAdopterRequestsThreshold?: number;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Options for `validateJourneyDeclarations`.
|
|
259
|
+
*/
|
|
260
|
+
export interface ValidateJourneyDeclarationsOptions {
|
|
261
|
+
/** Identifier of the Soul DID being validated (for event attribution). */
|
|
262
|
+
soulId: string;
|
|
263
|
+
/** Raw journey declarations from the Soul DID's or Variant's `spec.journeys[]`. */
|
|
264
|
+
journeys: JourneyDeclarationInput[];
|
|
265
|
+
/** Per-org or per-Soul limit overrides for journey count. */
|
|
266
|
+
limits?: JourneyLimitsConfig;
|
|
267
|
+
/** Per-org or per-Soul limit overrides for state count per journey. */
|
|
268
|
+
stateLimits?: JourneyStateLimitsConfig;
|
|
269
|
+
/**
|
|
270
|
+
* Parent WCAG level. When set, journeys with wcagLevel BELOW this are in violation.
|
|
271
|
+
* Journeys may RAISE the WCAG level above parent but NEVER LOWER it (§5.3).
|
|
272
|
+
*/
|
|
273
|
+
parentWcagLevel?: string;
|
|
274
|
+
/** ISO 8601 timestamp to stamp on emitted events. Defaults to now. */
|
|
275
|
+
now?: string;
|
|
276
|
+
}
|
|
277
|
+
/** OQ-1 default: soft warn at 10 journeys (Miller 7±2 + industry advisory). */
|
|
278
|
+
export declare const DEFAULT_JOURNEY_SOFT_WARN_AT = 10;
|
|
279
|
+
/** OQ-1 default: hard limit at 50 journeys (Salesforce-style enterprise ceiling). */
|
|
280
|
+
export declare const DEFAULT_JOURNEY_HARD_LIMIT = 50;
|
|
281
|
+
/** OQ-2 default: soft warn at 12 states (Miller 7±2 + XState advisory + IEEE readability). */
|
|
282
|
+
export declare const DEFAULT_STATE_SOFT_WARN_AT = 12;
|
|
283
|
+
/**
|
|
284
|
+
* OQ-2 default: hard limit at 100 states (sanity guard, NOT architectural constraint).
|
|
285
|
+
* Regulatory-submission journeys with 25-40 states are legitimate.
|
|
286
|
+
*/
|
|
287
|
+
export declare const DEFAULT_STATE_HARD_LIMIT = 100;
|
|
288
|
+
/**
|
|
289
|
+
* OQ-2 default v1 workaround message: operator-actionable guidance when
|
|
290
|
+
* a journey's state count reaches the soft-warn threshold.
|
|
291
|
+
*/
|
|
292
|
+
export declare const DEFAULT_STATE_SOFT_WARN_MESSAGE: string;
|
|
293
|
+
/** OQ-3 default: auto-promote sub-flow activation at 2 distinct adopter requests. */
|
|
294
|
+
export declare const DEFAULT_SUB_FLOW_ACTIVATION_THRESHOLD = 2;
|
|
295
|
+
/**
|
|
296
|
+
* Validate a Soul DID's (or Variant's) `journeys[]` declarations against
|
|
297
|
+
* RFC-0018 §5.3 rules.
|
|
298
|
+
*
|
|
299
|
+
* Returns all emitted events. Callers check `event.blocking` to determine
|
|
300
|
+
* whether the Soul DID should be rejected. Caller's responsibility to write
|
|
301
|
+
* events to events.jsonl via the artifact layer.
|
|
302
|
+
*
|
|
303
|
+
* Validation rules (in order):
|
|
304
|
+
*
|
|
305
|
+
* 1. **Hard-limit check (OQ-1)** — if `journeys.length >= hardLimit`, emit
|
|
306
|
+
* `JourneyCountHardLimitExceeded` (blocking). Continue to check individual
|
|
307
|
+
* journeys for completeness of the error report.
|
|
308
|
+
*
|
|
309
|
+
* 2. **Soft-warn check (OQ-1)** — if `journeys.length >= softWarnAt` AND
|
|
310
|
+
* below hard limit, emit `JourneyCountSoftWarning` (non-blocking).
|
|
311
|
+
*
|
|
312
|
+
* 3. **Per-journey checks** — for each journey:
|
|
313
|
+
* a. Nested-journey rejection (OQ-3) — if journey has `journeys` key,
|
|
314
|
+
* emit `NestedJourneyRejected` (blocking).
|
|
315
|
+
* b. Inheritance violation check (§5.3) — for each locked field
|
|
316
|
+
* (`complianceRegimes`, `targetAudience`, `substrateInvariants`), if
|
|
317
|
+
* present on the journey emit `JourneyInheritanceViolation` (blocking).
|
|
318
|
+
* c. `complianceFloor` check — if scope=variant and complianceFloor is
|
|
319
|
+
* present but not 'inherit', emit `JourneyInheritanceViolation` (blocking).
|
|
320
|
+
* d. WCAG-level lowering check — if parentWcagLevel provided and journey's
|
|
321
|
+
* wcagLevel is LOWER than parent, emit `JourneyInheritanceViolation`
|
|
322
|
+
* (blocking).
|
|
323
|
+
* e. State count checks (OQ-2) — per-journey state count against
|
|
324
|
+
* stateLimits.hardLimit / stateLimits.softWarnAt.
|
|
325
|
+
*/
|
|
326
|
+
export declare function validateJourneyDeclarations(options: ValidateJourneyDeclarationsOptions): JourneyEvent[];
|
|
327
|
+
/**
|
|
328
|
+
* Convenience predicate: returns true when any event in the list is blocking.
|
|
329
|
+
* Use to decide whether to reject the Soul DID declaration.
|
|
330
|
+
*/
|
|
331
|
+
export declare function hasBlockingJourneyViolations(events: JourneyEvent[]): boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Represents a single adopter request for journey sub-flow (nested journey)
|
|
334
|
+
* activation. Used by `trackSubFlowActivationRequest` to accumulate distinct
|
|
335
|
+
* adopter signals.
|
|
336
|
+
*/
|
|
337
|
+
export interface SubFlowActivationRequest {
|
|
338
|
+
/** Adopter identifier (e.g. org slug, soul id, adopter name). Used for deduplication. */
|
|
339
|
+
requestedBy: string;
|
|
340
|
+
/** Journey the request pertains to (for context; not used in deduplication). */
|
|
341
|
+
journeyId?: string;
|
|
342
|
+
/** Soul the request pertains to (for context; not used in deduplication). */
|
|
343
|
+
soulId?: string;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Track a stage-A counter of distinct adopter requests for journey sub-flow
|
|
347
|
+
* activation (RFC-0018 OQ-3 resolution, AISDLC-465 AC #10).
|
|
348
|
+
*
|
|
349
|
+
* v1 does NOT activate sub-flows — this is a pure counter. Its purpose is to
|
|
350
|
+
* accumulate demand signal until `threshold` distinct adopters have requested
|
|
351
|
+
* the capability, at which point `promotedToOperatorReview: true` signals that
|
|
352
|
+
* a follow-on RFC discussion should be opened.
|
|
353
|
+
*
|
|
354
|
+
* Adopter deduplication is based on `request.requestedBy`. Multiple requests
|
|
355
|
+
* from the same adopter count as one distinct request.
|
|
356
|
+
*
|
|
357
|
+
* All requests route through RFC-0035 G0 (non-blocking pipeline contract).
|
|
358
|
+
*
|
|
359
|
+
* ### Usage
|
|
360
|
+
*
|
|
361
|
+
* ```ts
|
|
362
|
+
* const result = trackSubFlowActivationRequests([
|
|
363
|
+
* { requestedBy: 'adopter-acme', journeyId: 'onboarding', soulId: 'spry-engage' },
|
|
364
|
+
* { requestedBy: 'adopter-beta' },
|
|
365
|
+
* ], { distinctAdopterRequestsThreshold: 2 });
|
|
366
|
+
*
|
|
367
|
+
* // result.distinctAdopterCount === 2
|
|
368
|
+
* // result.promotedToOperatorReview === true (threshold reached)
|
|
369
|
+
* ```
|
|
370
|
+
*
|
|
371
|
+
* @param requests Accumulated adopter activation requests (may include duplicates).
|
|
372
|
+
* @param config Per-org counter configuration (threshold defaults to 2).
|
|
373
|
+
*/
|
|
374
|
+
export declare function trackSubFlowActivationRequests(requests: SubFlowActivationRequest[], config?: SubFlowActivationConfig): SubFlowActivationCounterResult;
|
|
375
|
+
/**
|
|
376
|
+
* Parse a `targetedJourneys` URI entry per RFC-0018 §6.1.
|
|
377
|
+
*
|
|
378
|
+
* Two forms:
|
|
379
|
+
* - Soul-scoped: `<soul-id>/<journey-id>`
|
|
380
|
+
* - Variant-scoped: `<soul-id>/<variant-id>/<journey-id>`
|
|
381
|
+
*
|
|
382
|
+
* Returns `null` when the URI does not match either form.
|
|
383
|
+
*/
|
|
384
|
+
export interface ParsedTargetedJourneyRef {
|
|
385
|
+
readonly soulId: string;
|
|
386
|
+
readonly variantId?: string;
|
|
387
|
+
readonly journeyId: string;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Parse a `targetedJourneys` URI entry into its component parts.
|
|
391
|
+
*
|
|
392
|
+
* @param raw Raw URI string from the work item's `targetedJourneys[]` field.
|
|
393
|
+
* @returns Parsed components or null if the URI is malformed.
|
|
394
|
+
*/
|
|
395
|
+
export declare function parseTargetedJourneyRef(raw: string): ParsedTargetedJourneyRef | null;
|
|
396
|
+
//# sourceMappingURL=inheritance-validator.d.ts.map
|