@harness-engineering/core 0.11.0 → 0.12.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/index.d.mts +14 -21
- package/dist/index.d.ts +14 -21
- package/dist/index.js +75 -30
- package/dist/index.mjs +74 -30
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1060,7 +1060,7 @@ declare function readLockfile(lockfilePath: string): Promise<Result<Lockfile | n
|
|
|
1060
1060
|
/**
|
|
1061
1061
|
* Write a lockfile to disk using atomic write.
|
|
1062
1062
|
*/
|
|
1063
|
-
declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<void
|
|
1063
|
+
declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<Result<void, Error>>;
|
|
1064
1064
|
/**
|
|
1065
1065
|
* Add or replace a package entry in the lockfile (immutable).
|
|
1066
1066
|
*
|
|
@@ -1078,6 +1078,16 @@ declare function removeProvenance(lockfile: Lockfile, packageName: string): {
|
|
|
1078
1078
|
contributions: Contributions | null;
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* Remove contributions from a config object.
|
|
1083
|
+
*
|
|
1084
|
+
* Uses the contributions record (as stored in the lockfile) to identify
|
|
1085
|
+
* exactly which rules/layers/thresholds to remove from each section.
|
|
1086
|
+
*
|
|
1087
|
+
* Returns a new config object; does not mutate the input.
|
|
1088
|
+
*/
|
|
1089
|
+
declare function removeContributions(config: Record<string, unknown>, contributions: Contributions): Record<string, unknown>;
|
|
1090
|
+
|
|
1081
1091
|
interface InternalSymbol {
|
|
1082
1092
|
name: string;
|
|
1083
1093
|
type: 'function' | 'class' | 'variable' | 'type';
|
|
@@ -4679,22 +4689,15 @@ type Confirmation = z.infer<typeof ConfirmationSchema>;
|
|
|
4679
4689
|
type Transition = z.infer<typeof TransitionSchema>;
|
|
4680
4690
|
type EmitInteractionInput = z.infer<typeof EmitInteractionInputSchema>;
|
|
4681
4691
|
|
|
4682
|
-
interface
|
|
4683
|
-
questions: {
|
|
4684
|
-
question: string;
|
|
4685
|
-
answer: string;
|
|
4686
|
-
}[];
|
|
4687
|
-
}
|
|
4688
|
-
interface Content$1 {
|
|
4692
|
+
interface Content {
|
|
4689
4693
|
codeTranslation: string;
|
|
4690
|
-
quiz: Quiz$1;
|
|
4691
4694
|
}
|
|
4692
4695
|
interface BlueprintModule {
|
|
4693
4696
|
id: string;
|
|
4694
4697
|
title: string;
|
|
4695
4698
|
description: string;
|
|
4696
4699
|
files: string[];
|
|
4697
|
-
content?: Content
|
|
4700
|
+
content?: Content;
|
|
4698
4701
|
}
|
|
4699
4702
|
interface Hotspot {
|
|
4700
4703
|
file: string;
|
|
@@ -4728,16 +4731,6 @@ declare class BlueprintGenerator {
|
|
|
4728
4731
|
generate(data: BlueprintData, options: BlueprintOptions): Promise<void>;
|
|
4729
4732
|
}
|
|
4730
4733
|
|
|
4731
|
-
interface Content {
|
|
4732
|
-
codeTranslation: string;
|
|
4733
|
-
quiz: Quiz;
|
|
4734
|
-
}
|
|
4735
|
-
interface Quiz {
|
|
4736
|
-
questions: {
|
|
4737
|
-
question: string;
|
|
4738
|
-
answer: string;
|
|
4739
|
-
}[];
|
|
4740
|
-
}
|
|
4741
4734
|
declare class ContentPipeline {
|
|
4742
4735
|
generateModuleContent(module: BlueprintModule): Promise<Content>;
|
|
4743
4736
|
}
|
|
@@ -4800,4 +4793,4 @@ declare function getUpdateNotification(currentVersion: string): string | null;
|
|
|
4800
4793
|
*/
|
|
4801
4794
|
declare const VERSION = "0.11.0";
|
|
4802
4795
|
|
|
4803
|
-
export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content
|
|
4796
|
+
export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, type EligibilityResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PriorReview, ProjectScanner, type ProviderDefaults, type Question, QuestionSchema, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, type SafetyLevel, type ScanResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SyncChange, type SyncOptions, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, analyzeDiff, appendFailure, appendLearning, applyFixes, applyHotspotDowngrade, archiveFailures, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, checkDocCoverage, checkEligibility, classifyFinding, configureFeedback, constraintRuleId, contextBudget, contextFilter, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, executeWorkflow, expressRules, extractBundle, extractMarkdownLinks, extractSections, fanOutReview, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getPhaseCategories, getStreamForBranch, getUpdateNotification, goRules, injectionRules, isSmallSuggestion, isUpdateCheckEnabled, listStreams, loadFailures, loadHandoff, loadRelevantLearnings, loadState, loadStreamIndex, logAgentAction, migrateToStreams, networkRules, nodeRules, parseDiff, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, reactRules, readCheckState, readLockfile, removeContributions, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scopeContext, secretRules, serializeRoadmap, setActiveStream, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, touchStream, trackAction, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, xssRules };
|
package/dist/index.d.ts
CHANGED
|
@@ -1060,7 +1060,7 @@ declare function readLockfile(lockfilePath: string): Promise<Result<Lockfile | n
|
|
|
1060
1060
|
/**
|
|
1061
1061
|
* Write a lockfile to disk using atomic write.
|
|
1062
1062
|
*/
|
|
1063
|
-
declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<void
|
|
1063
|
+
declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<Result<void, Error>>;
|
|
1064
1064
|
/**
|
|
1065
1065
|
* Add or replace a package entry in the lockfile (immutable).
|
|
1066
1066
|
*
|
|
@@ -1078,6 +1078,16 @@ declare function removeProvenance(lockfile: Lockfile, packageName: string): {
|
|
|
1078
1078
|
contributions: Contributions | null;
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* Remove contributions from a config object.
|
|
1083
|
+
*
|
|
1084
|
+
* Uses the contributions record (as stored in the lockfile) to identify
|
|
1085
|
+
* exactly which rules/layers/thresholds to remove from each section.
|
|
1086
|
+
*
|
|
1087
|
+
* Returns a new config object; does not mutate the input.
|
|
1088
|
+
*/
|
|
1089
|
+
declare function removeContributions(config: Record<string, unknown>, contributions: Contributions): Record<string, unknown>;
|
|
1090
|
+
|
|
1081
1091
|
interface InternalSymbol {
|
|
1082
1092
|
name: string;
|
|
1083
1093
|
type: 'function' | 'class' | 'variable' | 'type';
|
|
@@ -4679,22 +4689,15 @@ type Confirmation = z.infer<typeof ConfirmationSchema>;
|
|
|
4679
4689
|
type Transition = z.infer<typeof TransitionSchema>;
|
|
4680
4690
|
type EmitInteractionInput = z.infer<typeof EmitInteractionInputSchema>;
|
|
4681
4691
|
|
|
4682
|
-
interface
|
|
4683
|
-
questions: {
|
|
4684
|
-
question: string;
|
|
4685
|
-
answer: string;
|
|
4686
|
-
}[];
|
|
4687
|
-
}
|
|
4688
|
-
interface Content$1 {
|
|
4692
|
+
interface Content {
|
|
4689
4693
|
codeTranslation: string;
|
|
4690
|
-
quiz: Quiz$1;
|
|
4691
4694
|
}
|
|
4692
4695
|
interface BlueprintModule {
|
|
4693
4696
|
id: string;
|
|
4694
4697
|
title: string;
|
|
4695
4698
|
description: string;
|
|
4696
4699
|
files: string[];
|
|
4697
|
-
content?: Content
|
|
4700
|
+
content?: Content;
|
|
4698
4701
|
}
|
|
4699
4702
|
interface Hotspot {
|
|
4700
4703
|
file: string;
|
|
@@ -4728,16 +4731,6 @@ declare class BlueprintGenerator {
|
|
|
4728
4731
|
generate(data: BlueprintData, options: BlueprintOptions): Promise<void>;
|
|
4729
4732
|
}
|
|
4730
4733
|
|
|
4731
|
-
interface Content {
|
|
4732
|
-
codeTranslation: string;
|
|
4733
|
-
quiz: Quiz;
|
|
4734
|
-
}
|
|
4735
|
-
interface Quiz {
|
|
4736
|
-
questions: {
|
|
4737
|
-
question: string;
|
|
4738
|
-
answer: string;
|
|
4739
|
-
}[];
|
|
4740
|
-
}
|
|
4741
4734
|
declare class ContentPipeline {
|
|
4742
4735
|
generateModuleContent(module: BlueprintModule): Promise<Content>;
|
|
4743
4736
|
}
|
|
@@ -4800,4 +4793,4 @@ declare function getUpdateNotification(currentVersion: string): string | null;
|
|
|
4800
4793
|
*/
|
|
4801
4794
|
declare const VERSION = "0.11.0";
|
|
4802
4795
|
|
|
4803
|
-
export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content
|
|
4796
|
+
export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, type EligibilityResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PriorReview, ProjectScanner, type ProviderDefaults, type Question, QuestionSchema, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, type SafetyLevel, type ScanResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SyncChange, type SyncOptions, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, analyzeDiff, appendFailure, appendLearning, applyFixes, applyHotspotDowngrade, archiveFailures, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, checkDocCoverage, checkEligibility, classifyFinding, configureFeedback, constraintRuleId, contextBudget, contextFilter, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, executeWorkflow, expressRules, extractBundle, extractMarkdownLinks, extractSections, fanOutReview, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getPhaseCategories, getStreamForBranch, getUpdateNotification, goRules, injectionRules, isSmallSuggestion, isUpdateCheckEnabled, listStreams, loadFailures, loadHandoff, loadRelevantLearnings, loadState, loadStreamIndex, logAgentAction, migrateToStreams, networkRules, nodeRules, parseDiff, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, reactRules, readCheckState, readLockfile, removeContributions, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scopeContext, secretRules, serializeRoadmap, setActiveStream, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, touchStream, trackAction, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, xssRules };
|
package/dist/index.js
CHANGED
|
@@ -196,6 +196,7 @@ __export(index_exports, {
|
|
|
196
196
|
reactRules: () => reactRules,
|
|
197
197
|
readCheckState: () => readCheckState,
|
|
198
198
|
readLockfile: () => readLockfile,
|
|
199
|
+
removeContributions: () => removeContributions,
|
|
199
200
|
removeProvenance: () => removeProvenance,
|
|
200
201
|
requestMultiplePeerReviews: () => requestMultiplePeerReviews,
|
|
201
202
|
requestPeerReview: () => requestPeerReview,
|
|
@@ -1626,8 +1627,6 @@ function deepMergeConstraints(localConfig, bundleConstraints, _existingContribut
|
|
|
1626
1627
|
}
|
|
1627
1628
|
if (bundleConstraints.architecture) {
|
|
1628
1629
|
const localArch = localConfig.architecture ?? {
|
|
1629
|
-
enabled: true,
|
|
1630
|
-
baselinePath: ".harness/arch/baselines.json",
|
|
1631
1630
|
thresholds: {},
|
|
1632
1631
|
modules: {}
|
|
1633
1632
|
};
|
|
@@ -1750,7 +1749,7 @@ async function readLockfile(lockfilePath) {
|
|
|
1750
1749
|
return { ok: true, value: result.data };
|
|
1751
1750
|
}
|
|
1752
1751
|
async function writeLockfile(lockfilePath, lockfile) {
|
|
1753
|
-
|
|
1752
|
+
return writeConfig(lockfilePath, lockfile);
|
|
1754
1753
|
}
|
|
1755
1754
|
function addProvenance(lockfile, packageName, entry) {
|
|
1756
1755
|
return {
|
|
@@ -1779,6 +1778,77 @@ function isNodeError(err) {
|
|
|
1779
1778
|
return err instanceof Error && "code" in err;
|
|
1780
1779
|
}
|
|
1781
1780
|
|
|
1781
|
+
// src/constraints/sharing/remove.ts
|
|
1782
|
+
function removeContributions(config, contributions) {
|
|
1783
|
+
const result = { ...config };
|
|
1784
|
+
const layerNames = contributions.layers;
|
|
1785
|
+
if (layerNames && layerNames.length > 0 && Array.isArray(result.layers)) {
|
|
1786
|
+
const nameSet = new Set(layerNames);
|
|
1787
|
+
result.layers = result.layers.filter((l) => !nameSet.has(l.name));
|
|
1788
|
+
}
|
|
1789
|
+
const fromKeys = contributions.forbiddenImports;
|
|
1790
|
+
if (fromKeys && fromKeys.length > 0 && Array.isArray(result.forbiddenImports)) {
|
|
1791
|
+
const fromSet = new Set(fromKeys);
|
|
1792
|
+
result.forbiddenImports = result.forbiddenImports.filter(
|
|
1793
|
+
(r) => !fromSet.has(r.from)
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
const boundarySchemas = contributions.boundaries;
|
|
1797
|
+
if (boundarySchemas && boundarySchemas.length > 0 && result.boundaries) {
|
|
1798
|
+
const boundaries = result.boundaries;
|
|
1799
|
+
if (boundaries.requireSchema) {
|
|
1800
|
+
const schemaSet = new Set(boundarySchemas);
|
|
1801
|
+
result.boundaries = {
|
|
1802
|
+
...boundaries,
|
|
1803
|
+
requireSchema: boundaries.requireSchema.filter((s) => !schemaSet.has(s))
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
const thresholdKeys = contributions["architecture.thresholds"];
|
|
1808
|
+
if (thresholdKeys && thresholdKeys.length > 0 && result.architecture) {
|
|
1809
|
+
const arch = { ...result.architecture };
|
|
1810
|
+
const thresholds = { ...arch.thresholds };
|
|
1811
|
+
for (const key of thresholdKeys) {
|
|
1812
|
+
delete thresholds[key];
|
|
1813
|
+
}
|
|
1814
|
+
arch.thresholds = thresholds;
|
|
1815
|
+
result.architecture = arch;
|
|
1816
|
+
}
|
|
1817
|
+
const moduleKeys = contributions["architecture.modules"];
|
|
1818
|
+
if (moduleKeys && moduleKeys.length > 0 && result.architecture) {
|
|
1819
|
+
const arch = { ...result.architecture };
|
|
1820
|
+
const modules = { ...arch.modules };
|
|
1821
|
+
for (const key of moduleKeys) {
|
|
1822
|
+
const colonIdx = key.indexOf(":");
|
|
1823
|
+
if (colonIdx === -1) continue;
|
|
1824
|
+
const modulePath = key.substring(0, colonIdx);
|
|
1825
|
+
const category = key.substring(colonIdx + 1);
|
|
1826
|
+
if (modules[modulePath]) {
|
|
1827
|
+
const moduleCategories = { ...modules[modulePath] };
|
|
1828
|
+
delete moduleCategories[category];
|
|
1829
|
+
if (Object.keys(moduleCategories).length === 0) {
|
|
1830
|
+
delete modules[modulePath];
|
|
1831
|
+
} else {
|
|
1832
|
+
modules[modulePath] = moduleCategories;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
arch.modules = modules;
|
|
1837
|
+
result.architecture = arch;
|
|
1838
|
+
}
|
|
1839
|
+
const ruleIds = contributions["security.rules"];
|
|
1840
|
+
if (ruleIds && ruleIds.length > 0 && result.security) {
|
|
1841
|
+
const security = { ...result.security };
|
|
1842
|
+
const rules = { ...security.rules };
|
|
1843
|
+
for (const id of ruleIds) {
|
|
1844
|
+
delete rules[id];
|
|
1845
|
+
}
|
|
1846
|
+
security.rules = rules;
|
|
1847
|
+
result.security = security;
|
|
1848
|
+
}
|
|
1849
|
+
return result;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1782
1852
|
// src/shared/parsers/typescript.ts
|
|
1783
1853
|
var import_typescript_estree = require("@typescript-eslint/typescript-estree");
|
|
1784
1854
|
|
|
@@ -10327,16 +10397,6 @@ var SHELL_TEMPLATE = `
|
|
|
10327
10397
|
<div class="content">
|
|
10328
10398
|
<h3>Code Translation</h3>
|
|
10329
10399
|
<div class="translation"><%- module.content.codeTranslation %></div>
|
|
10330
|
-
<h3>Knowledge Check</h3>
|
|
10331
|
-
<div class="quiz">
|
|
10332
|
-
<% module.content.quiz.questions.forEach((q, i) => { %>
|
|
10333
|
-
<div class="question">
|
|
10334
|
-
<p><%= q.question %></p>
|
|
10335
|
-
<button onclick="reveal(this)">Reveal Answer</button>
|
|
10336
|
-
<p class="answer" style="display:none;"><%= q.answer %></p>
|
|
10337
|
-
</div>
|
|
10338
|
-
<% }) %>
|
|
10339
|
-
</div>
|
|
10340
10400
|
</div>
|
|
10341
10401
|
</article>
|
|
10342
10402
|
|
|
@@ -10355,10 +10415,6 @@ header { border-bottom: 2px solid #eee; margin-bottom: 20px; padding-bottom: 10p
|
|
|
10355
10415
|
.module h2 { margin-top: 0; color: #0066cc; }
|
|
10356
10416
|
`;
|
|
10357
10417
|
var SCRIPTS = `
|
|
10358
|
-
function reveal(btn) {
|
|
10359
|
-
btn.nextElementSibling.style.display = 'block';
|
|
10360
|
-
btn.style.display = 'none';
|
|
10361
|
-
}
|
|
10362
10418
|
console.log('Blueprint player initialized.');
|
|
10363
10419
|
`;
|
|
10364
10420
|
|
|
@@ -10377,20 +10433,8 @@ var ContentPipeline = class {
|
|
|
10377
10433
|
const translation = await llmService.generate(
|
|
10378
10434
|
`You are a technical educator. Explain the following code clearly and concisely: ${codeContext}`
|
|
10379
10435
|
);
|
|
10380
|
-
const quizJson = await llmService.generate(
|
|
10381
|
-
`Create 3 technical quiz questions for this code. Return ONLY valid JSON in this format: { "questions": [{ "question": "...", "answer": "..." }] }. Code: ${codeContext}`
|
|
10382
|
-
);
|
|
10383
|
-
let quiz;
|
|
10384
|
-
try {
|
|
10385
|
-
const cleanJson = quizJson.replace(/```json/g, "").replace(/```/g, "").trim();
|
|
10386
|
-
quiz = JSON.parse(cleanJson);
|
|
10387
|
-
} catch (e) {
|
|
10388
|
-
console.error("Failed to parse quiz JSON", e);
|
|
10389
|
-
quiz = { questions: [{ question: "Failed to generate quiz", answer: "N/A" }] };
|
|
10390
|
-
}
|
|
10391
10436
|
return {
|
|
10392
|
-
codeTranslation: translation
|
|
10393
|
-
quiz
|
|
10437
|
+
codeTranslation: translation
|
|
10394
10438
|
};
|
|
10395
10439
|
}
|
|
10396
10440
|
};
|
|
@@ -10673,6 +10717,7 @@ var VERSION = "0.11.0";
|
|
|
10673
10717
|
reactRules,
|
|
10674
10718
|
readCheckState,
|
|
10675
10719
|
readLockfile,
|
|
10720
|
+
removeContributions,
|
|
10676
10721
|
removeProvenance,
|
|
10677
10722
|
requestMultiplePeerReviews,
|
|
10678
10723
|
requestPeerReview,
|
package/dist/index.mjs
CHANGED
|
@@ -1140,8 +1140,6 @@ function deepMergeConstraints(localConfig, bundleConstraints, _existingContribut
|
|
|
1140
1140
|
}
|
|
1141
1141
|
if (bundleConstraints.architecture) {
|
|
1142
1142
|
const localArch = localConfig.architecture ?? {
|
|
1143
|
-
enabled: true,
|
|
1144
|
-
baselinePath: ".harness/arch/baselines.json",
|
|
1145
1143
|
thresholds: {},
|
|
1146
1144
|
modules: {}
|
|
1147
1145
|
};
|
|
@@ -1264,7 +1262,7 @@ async function readLockfile(lockfilePath) {
|
|
|
1264
1262
|
return { ok: true, value: result.data };
|
|
1265
1263
|
}
|
|
1266
1264
|
async function writeLockfile(lockfilePath, lockfile) {
|
|
1267
|
-
|
|
1265
|
+
return writeConfig(lockfilePath, lockfile);
|
|
1268
1266
|
}
|
|
1269
1267
|
function addProvenance(lockfile, packageName, entry) {
|
|
1270
1268
|
return {
|
|
@@ -1293,6 +1291,77 @@ function isNodeError(err) {
|
|
|
1293
1291
|
return err instanceof Error && "code" in err;
|
|
1294
1292
|
}
|
|
1295
1293
|
|
|
1294
|
+
// src/constraints/sharing/remove.ts
|
|
1295
|
+
function removeContributions(config, contributions) {
|
|
1296
|
+
const result = { ...config };
|
|
1297
|
+
const layerNames = contributions.layers;
|
|
1298
|
+
if (layerNames && layerNames.length > 0 && Array.isArray(result.layers)) {
|
|
1299
|
+
const nameSet = new Set(layerNames);
|
|
1300
|
+
result.layers = result.layers.filter((l) => !nameSet.has(l.name));
|
|
1301
|
+
}
|
|
1302
|
+
const fromKeys = contributions.forbiddenImports;
|
|
1303
|
+
if (fromKeys && fromKeys.length > 0 && Array.isArray(result.forbiddenImports)) {
|
|
1304
|
+
const fromSet = new Set(fromKeys);
|
|
1305
|
+
result.forbiddenImports = result.forbiddenImports.filter(
|
|
1306
|
+
(r) => !fromSet.has(r.from)
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
const boundarySchemas = contributions.boundaries;
|
|
1310
|
+
if (boundarySchemas && boundarySchemas.length > 0 && result.boundaries) {
|
|
1311
|
+
const boundaries = result.boundaries;
|
|
1312
|
+
if (boundaries.requireSchema) {
|
|
1313
|
+
const schemaSet = new Set(boundarySchemas);
|
|
1314
|
+
result.boundaries = {
|
|
1315
|
+
...boundaries,
|
|
1316
|
+
requireSchema: boundaries.requireSchema.filter((s) => !schemaSet.has(s))
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
const thresholdKeys = contributions["architecture.thresholds"];
|
|
1321
|
+
if (thresholdKeys && thresholdKeys.length > 0 && result.architecture) {
|
|
1322
|
+
const arch = { ...result.architecture };
|
|
1323
|
+
const thresholds = { ...arch.thresholds };
|
|
1324
|
+
for (const key of thresholdKeys) {
|
|
1325
|
+
delete thresholds[key];
|
|
1326
|
+
}
|
|
1327
|
+
arch.thresholds = thresholds;
|
|
1328
|
+
result.architecture = arch;
|
|
1329
|
+
}
|
|
1330
|
+
const moduleKeys = contributions["architecture.modules"];
|
|
1331
|
+
if (moduleKeys && moduleKeys.length > 0 && result.architecture) {
|
|
1332
|
+
const arch = { ...result.architecture };
|
|
1333
|
+
const modules = { ...arch.modules };
|
|
1334
|
+
for (const key of moduleKeys) {
|
|
1335
|
+
const colonIdx = key.indexOf(":");
|
|
1336
|
+
if (colonIdx === -1) continue;
|
|
1337
|
+
const modulePath = key.substring(0, colonIdx);
|
|
1338
|
+
const category = key.substring(colonIdx + 1);
|
|
1339
|
+
if (modules[modulePath]) {
|
|
1340
|
+
const moduleCategories = { ...modules[modulePath] };
|
|
1341
|
+
delete moduleCategories[category];
|
|
1342
|
+
if (Object.keys(moduleCategories).length === 0) {
|
|
1343
|
+
delete modules[modulePath];
|
|
1344
|
+
} else {
|
|
1345
|
+
modules[modulePath] = moduleCategories;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
arch.modules = modules;
|
|
1350
|
+
result.architecture = arch;
|
|
1351
|
+
}
|
|
1352
|
+
const ruleIds = contributions["security.rules"];
|
|
1353
|
+
if (ruleIds && ruleIds.length > 0 && result.security) {
|
|
1354
|
+
const security = { ...result.security };
|
|
1355
|
+
const rules = { ...security.rules };
|
|
1356
|
+
for (const id of ruleIds) {
|
|
1357
|
+
delete rules[id];
|
|
1358
|
+
}
|
|
1359
|
+
security.rules = rules;
|
|
1360
|
+
result.security = security;
|
|
1361
|
+
}
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1296
1365
|
// src/shared/parsers/typescript.ts
|
|
1297
1366
|
import { parse } from "@typescript-eslint/typescript-estree";
|
|
1298
1367
|
|
|
@@ -8346,16 +8415,6 @@ var SHELL_TEMPLATE = `
|
|
|
8346
8415
|
<div class="content">
|
|
8347
8416
|
<h3>Code Translation</h3>
|
|
8348
8417
|
<div class="translation"><%- module.content.codeTranslation %></div>
|
|
8349
|
-
<h3>Knowledge Check</h3>
|
|
8350
|
-
<div class="quiz">
|
|
8351
|
-
<% module.content.quiz.questions.forEach((q, i) => { %>
|
|
8352
|
-
<div class="question">
|
|
8353
|
-
<p><%= q.question %></p>
|
|
8354
|
-
<button onclick="reveal(this)">Reveal Answer</button>
|
|
8355
|
-
<p class="answer" style="display:none;"><%= q.answer %></p>
|
|
8356
|
-
</div>
|
|
8357
|
-
<% }) %>
|
|
8358
|
-
</div>
|
|
8359
8418
|
</div>
|
|
8360
8419
|
</article>
|
|
8361
8420
|
|
|
@@ -8374,10 +8433,6 @@ header { border-bottom: 2px solid #eee; margin-bottom: 20px; padding-bottom: 10p
|
|
|
8374
8433
|
.module h2 { margin-top: 0; color: #0066cc; }
|
|
8375
8434
|
`;
|
|
8376
8435
|
var SCRIPTS = `
|
|
8377
|
-
function reveal(btn) {
|
|
8378
|
-
btn.nextElementSibling.style.display = 'block';
|
|
8379
|
-
btn.style.display = 'none';
|
|
8380
|
-
}
|
|
8381
8436
|
console.log('Blueprint player initialized.');
|
|
8382
8437
|
`;
|
|
8383
8438
|
|
|
@@ -8396,20 +8451,8 @@ var ContentPipeline = class {
|
|
|
8396
8451
|
const translation = await llmService.generate(
|
|
8397
8452
|
`You are a technical educator. Explain the following code clearly and concisely: ${codeContext}`
|
|
8398
8453
|
);
|
|
8399
|
-
const quizJson = await llmService.generate(
|
|
8400
|
-
`Create 3 technical quiz questions for this code. Return ONLY valid JSON in this format: { "questions": [{ "question": "...", "answer": "..." }] }. Code: ${codeContext}`
|
|
8401
|
-
);
|
|
8402
|
-
let quiz;
|
|
8403
|
-
try {
|
|
8404
|
-
const cleanJson = quizJson.replace(/```json/g, "").replace(/```/g, "").trim();
|
|
8405
|
-
quiz = JSON.parse(cleanJson);
|
|
8406
|
-
} catch (e) {
|
|
8407
|
-
console.error("Failed to parse quiz JSON", e);
|
|
8408
|
-
quiz = { questions: [{ question: "Failed to generate quiz", answer: "N/A" }] };
|
|
8409
|
-
}
|
|
8410
8454
|
return {
|
|
8411
|
-
codeTranslation: translation
|
|
8412
|
-
quiz
|
|
8455
|
+
codeTranslation: translation
|
|
8413
8456
|
};
|
|
8414
8457
|
}
|
|
8415
8458
|
};
|
|
@@ -8691,6 +8734,7 @@ export {
|
|
|
8691
8734
|
reactRules,
|
|
8692
8735
|
readCheckState,
|
|
8693
8736
|
readLockfile,
|
|
8737
|
+
removeContributions,
|
|
8694
8738
|
removeProvenance,
|
|
8695
8739
|
requestMultiplePeerReviews,
|
|
8696
8740
|
requestPeerReview,
|