@lumenflow/core 2.2.2 → 2.3.1
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/active-wu-detector.d.ts +1 -1
- package/dist/active-wu-detector.js +1 -1
- package/dist/arg-parser.js +51 -18
- package/dist/backlog-generator.d.ts +4 -4
- package/dist/backlog-generator.js +4 -4
- package/dist/backlog-sync-validator.js +1 -1
- package/dist/cleanup-lock.d.ts +9 -2
- package/dist/cleanup-lock.js +17 -7
- package/dist/code-path-validator.d.ts +3 -3
- package/dist/code-path-validator.js +3 -3
- package/dist/compliance-parser.d.ts +1 -1
- package/dist/compliance-parser.js +1 -1
- package/dist/constants/backlog-patterns.d.ts +1 -1
- package/dist/constants/backlog-patterns.js +1 -1
- package/dist/constants/dora-constants.d.ts +1 -1
- package/dist/constants/dora-constants.js +1 -1
- package/dist/constants/gate-constants.d.ts +1 -1
- package/dist/constants/gate-constants.js +1 -1
- package/dist/constants/linter-constants.d.ts +1 -1
- package/dist/constants/linter-constants.js +1 -1
- package/dist/constants/tokenizer-constants.d.ts +1 -1
- package/dist/constants/tokenizer-constants.js +1 -1
- package/dist/context/location-resolver.js +2 -1
- package/dist/context-validation-integration.d.ts +1 -0
- package/dist/core/scope-checker.d.ts +3 -3
- package/dist/core/scope-checker.js +3 -3
- package/dist/core/tool-runner.d.ts +5 -5
- package/dist/core/tool-runner.js +5 -5
- package/dist/core/tool.constants.d.ts +1 -1
- package/dist/core/tool.constants.js +1 -1
- package/dist/core/tool.schemas.d.ts +2 -2
- package/dist/core/tool.schemas.js +1 -1
- package/dist/core/worktree-guard.d.ts +1 -1
- package/dist/core/worktree-guard.js +1 -1
- package/dist/coverage-gate.d.ts +12 -3
- package/dist/coverage-gate.js +15 -8
- package/dist/date-utils.d.ts +4 -4
- package/dist/date-utils.js +4 -4
- package/dist/dependency-graph.d.ts +6 -0
- package/dist/dependency-graph.js +43 -2
- package/dist/dependency-guard.d.ts +2 -2
- package/dist/dependency-guard.js +3 -3
- package/dist/dependency-validator.d.ts +4 -4
- package/dist/dependency-validator.js +4 -7
- package/dist/domain/orchestration.constants.d.ts +31 -10
- package/dist/domain/orchestration.constants.js +45 -16
- package/dist/domain/orchestration.schemas.d.ts +54 -28
- package/dist/domain/orchestration.schemas.js +2 -2
- package/dist/domain/orchestration.types.d.ts +2 -2
- package/dist/domain/orchestration.types.js +2 -2
- package/dist/error-handler.d.ts +10 -10
- package/dist/error-handler.js +10 -10
- package/dist/file-classifiers.d.ts +6 -6
- package/dist/file-classifiers.js +6 -6
- package/dist/gates-config.d.ts +74 -0
- package/dist/gates-config.js +209 -2
- package/dist/git-adapter.d.ts +11 -11
- package/dist/git-adapter.js +11 -11
- package/dist/git-context-extractor.d.ts +112 -0
- package/dist/git-context-extractor.js +559 -0
- package/dist/hardcoded-strings.d.ts +1 -1
- package/dist/hardcoded-strings.js +1 -1
- package/dist/incremental-lint.d.ts +1 -1
- package/dist/incremental-lint.js +2 -2
- package/dist/incremental-test.d.ts +1 -1
- package/dist/incremental-test.js +1 -1
- package/dist/index.d.ts +13 -0
- package/dist/index.js +25 -0
- package/dist/invariants/check-automated-tests.d.ts +2 -2
- package/dist/invariants/check-automated-tests.js +3 -3
- package/dist/lane-checker.d.ts +28 -7
- package/dist/lane-checker.js +316 -159
- package/dist/lane-suggest-prompt.d.ts +108 -0
- package/dist/lane-suggest-prompt.js +359 -0
- package/dist/lane-validator.d.ts +3 -3
- package/dist/lane-validator.js +3 -3
- package/dist/logs-lib.d.ts +1 -1
- package/dist/logs-lib.js +1 -1
- package/dist/lumenflow-config-schema.d.ts +162 -0
- package/dist/lumenflow-config-schema.js +180 -0
- package/dist/manual-test-validator.d.ts +2 -2
- package/dist/manual-test-validator.js +3 -3
- package/dist/merge-lock.d.ts +8 -1
- package/dist/merge-lock.js +16 -7
- package/dist/micro-worktree.d.ts +81 -13
- package/dist/micro-worktree.js +98 -17
- package/dist/migration-deployer.d.ts +1 -1
- package/dist/migration-deployer.js +1 -1
- package/dist/orchestration-advisory-loader.d.ts +2 -2
- package/dist/orchestration-advisory-loader.js +10 -6
- package/dist/orchestration-advisory.d.ts +3 -3
- package/dist/orchestration-advisory.js +4 -4
- package/dist/orchestration-di.d.ts +4 -4
- package/dist/orchestration-di.js +4 -4
- package/dist/orchestration-rules.d.ts +4 -4
- package/dist/orchestration-rules.js +18 -10
- package/dist/orphan-detector.d.ts +3 -3
- package/dist/orphan-detector.js +3 -3
- package/dist/patrol-loop.d.ts +170 -0
- package/dist/patrol-loop.js +186 -0
- package/dist/process-detector.d.ts +5 -5
- package/dist/process-detector.js +5 -5
- package/dist/rebase-artifact-cleanup.d.ts +3 -3
- package/dist/rebase-artifact-cleanup.js +3 -3
- package/dist/resolve-policy.d.ts +195 -0
- package/dist/resolve-policy.js +203 -0
- package/dist/risk-detector.d.ts +2 -2
- package/dist/risk-detector.js +2 -2
- package/dist/rollback-utils.d.ts +1 -1
- package/dist/rollback-utils.js +1 -1
- package/dist/section-headings.d.ts +1 -1
- package/dist/section-headings.js +1 -1
- package/dist/spawn-escalation.d.ts +4 -4
- package/dist/spawn-escalation.js +3 -3
- package/dist/spawn-monitor.d.ts +4 -4
- package/dist/spawn-monitor.js +4 -4
- package/dist/spawn-recovery.d.ts +3 -3
- package/dist/spawn-recovery.js +3 -3
- package/dist/spawn-registry-schema.d.ts +2 -2
- package/dist/spawn-registry-schema.js +2 -2
- package/dist/spawn-registry-store.d.ts +2 -2
- package/dist/spawn-registry-store.js +2 -2
- package/dist/spawn-strategy.d.ts +17 -11
- package/dist/spawn-strategy.js +47 -44
- package/dist/spawn-tree.d.ts +3 -3
- package/dist/spawn-tree.js +3 -3
- package/dist/state-cleanup-core.d.ts +205 -0
- package/dist/state-cleanup-core.js +240 -0
- package/dist/state-doctor-core.d.ts +168 -0
- package/dist/state-doctor-core.js +251 -0
- package/dist/stream-error-handler.d.ts +67 -0
- package/dist/stream-error-handler.js +94 -0
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.js +1 -1
- package/dist/template-loader.d.ts +162 -0
- package/dist/template-loader.js +372 -0
- package/dist/test-baseline.d.ts +176 -0
- package/dist/test-baseline.js +282 -0
- package/dist/usecases/get-suggestions.usecase.d.ts +1 -1
- package/dist/validation/command-registry.js +37 -0
- package/dist/validators/backlog-sync.js +4 -2
- package/dist/worktree-scanner.d.ts +1 -1
- package/dist/worktree-scanner.js +1 -1
- package/dist/worktree-symlink.d.ts +3 -3
- package/dist/worktree-symlink.js +3 -3
- package/dist/wu-backlog-updater.d.ts +1 -1
- package/dist/wu-backlog-updater.js +1 -1
- package/dist/wu-claim-helpers.d.ts +1 -1
- package/dist/wu-claim-helpers.js +1 -1
- package/dist/wu-claim-resume.d.ts +1 -1
- package/dist/wu-claim-resume.js +1 -1
- package/dist/wu-consistency-checker.d.ts +1 -1
- package/dist/wu-consistency-checker.js +17 -11
- package/dist/wu-constants.d.ts +73 -21
- package/dist/wu-constants.js +65 -22
- package/dist/wu-done-branch-only.d.ts +1 -1
- package/dist/wu-done-branch-only.js +1 -1
- package/dist/wu-done-docs-generate.d.ts +1 -1
- package/dist/wu-done-docs-generate.js +1 -1
- package/dist/wu-done-messages.d.ts +2 -2
- package/dist/wu-done-messages.js +2 -2
- package/dist/wu-done-metadata.d.ts +3 -3
- package/dist/wu-done-metadata.js +3 -3
- package/dist/wu-done-pr.d.ts +1 -1
- package/dist/wu-done-pr.js +4 -2
- package/dist/wu-done-preflight.d.ts +8 -0
- package/dist/wu-done-preflight.js +18 -2
- package/dist/wu-done-ui.d.ts +3 -3
- package/dist/wu-done-ui.js +3 -3
- package/dist/wu-done-validation.d.ts +30 -0
- package/dist/wu-done-validation.js +106 -1
- package/dist/wu-done-worktree.d.ts +1 -1
- package/dist/wu-done-worktree.js +11 -1
- package/dist/wu-events-cleanup.d.ts +148 -0
- package/dist/wu-events-cleanup.js +401 -0
- package/dist/wu-helpers.d.ts +2 -2
- package/dist/wu-helpers.js +2 -2
- package/dist/wu-id-generator.d.ts +58 -0
- package/dist/wu-id-generator.js +103 -0
- package/dist/wu-lint.js +1 -1
- package/dist/wu-preflight-validators.d.ts +13 -1
- package/dist/wu-preflight-validators.js +56 -1
- package/dist/wu-recovery.d.ts +2 -2
- package/dist/wu-recovery.js +4 -4
- package/dist/wu-repair-core.d.ts +5 -5
- package/dist/wu-repair-core.js +6 -6
- package/dist/wu-schema-normalization.d.ts +1 -1
- package/dist/wu-schema-normalization.js +1 -1
- package/dist/wu-schema.d.ts +7 -7
- package/dist/wu-schema.js +8 -8
- package/dist/wu-spawn-context.d.ts +87 -0
- package/dist/wu-spawn-context.js +175 -0
- package/dist/wu-spawn-helpers.d.ts +1 -1
- package/dist/wu-spawn-helpers.js +1 -1
- package/dist/wu-spawn.d.ts +177 -4
- package/dist/wu-spawn.js +694 -72
- package/dist/wu-state-schema.d.ts +1 -1
- package/dist/wu-state-schema.js +1 -1
- package/dist/wu-state-store.d.ts +3 -3
- package/dist/wu-state-store.js +3 -3
- package/dist/wu-status-transition.d.ts +1 -1
- package/dist/wu-status-transition.js +1 -1
- package/dist/wu-status-updater.d.ts +3 -3
- package/dist/wu-status-updater.js +3 -3
- package/dist/wu-validation-constants.d.ts +2 -2
- package/dist/wu-validation-constants.js +2 -2
- package/dist/wu-validation.d.ts +3 -3
- package/dist/wu-validation.js +3 -3
- package/dist/wu-yaml-fixer.d.ts +2 -2
- package/dist/wu-yaml-fixer.js +3 -3
- package/dist/wu-yaml.d.ts +23 -0
- package/dist/wu-yaml.js +76 -2
- package/package.json +5 -2
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Single source of truth - types are inferred from these schemas.
|
|
6
6
|
*
|
|
7
7
|
* @module orchestration.schemas
|
|
8
|
-
* @see {@link ./orchestration.types.
|
|
9
|
-
* @see {@link ./orchestration.constants.
|
|
8
|
+
* @see {@link ./orchestration.types.ts} - Types inferred from these schemas
|
|
9
|
+
* @see {@link ./orchestration.constants.ts} - Constants used in validation
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { LANES, AGENT_NAMES, SEVERITY_LEVELS, AGENT_RESULT_STATUSES, TIMELINE_EVENT_TYPES, EVENT_SEVERITY_LEVELS, USER_CHOICE_OPTIONS, DOD_TOTAL, } from './orchestration.constants.js';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Single source of truth - schemas validate at runtime, types at compile time.
|
|
6
6
|
*
|
|
7
7
|
* @module orchestration.types
|
|
8
|
-
* @see {@link ./orchestration.schemas.
|
|
9
|
-
* @see {@link ./orchestration.constants.
|
|
8
|
+
* @see {@link ./orchestration.schemas.ts} - Schemas these types are inferred from
|
|
9
|
+
* @see {@link ./orchestration.constants.ts} - Constants and derived types
|
|
10
10
|
*/
|
|
11
11
|
import type { z } from 'zod';
|
|
12
12
|
import type { GlobalStatusSchema, AgentMetricSchema, WUProgressSchema, TimelineEventSchema, AlertSchema, SuggestionSchema, ExecutionPlanSchema, UserChoiceSchema, DashboardDataSchema } from './orchestration.schemas.js';
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Single source of truth - schemas validate at runtime, types at compile time.
|
|
6
6
|
*
|
|
7
7
|
* @module orchestration.types
|
|
8
|
-
* @see {@link ./orchestration.schemas.
|
|
9
|
-
* @see {@link ./orchestration.constants.
|
|
8
|
+
* @see {@link ./orchestration.schemas.ts} - Schemas these types are inferred from
|
|
9
|
+
* @see {@link ./orchestration.constants.ts} - Constants and derived types
|
|
10
10
|
*/
|
|
11
11
|
// Re-export const values as well
|
|
12
12
|
export { LANES, AGENT_NAMES, SEVERITY_LEVELS, AGENT_RESULT_STATUSES, TIMELINE_EVENT_TYPES, EVENT_SEVERITY_LEVELS, USER_CHOICE_OPTIONS, MANDATORY_AGENT_NAMES, } from './orchestration.constants.js';
|
package/dist/error-handler.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file error-handler.
|
|
2
|
+
* @file error-handler.ts
|
|
3
3
|
* @description Structured error handling with error codes
|
|
4
4
|
* WU-1082: Extract shared utilities (eliminate die() duplication)
|
|
5
5
|
* WU-1006: Library-First - use path.basename() instead of manual split
|
|
6
6
|
*
|
|
7
7
|
* Replaces die() function in:
|
|
8
|
-
* - tools/wu-claim.
|
|
9
|
-
* - tools/wu-done.
|
|
10
|
-
* - tools/wu-block.
|
|
11
|
-
* - tools/wu-unblock.
|
|
12
|
-
* - tools/wu-create.
|
|
13
|
-
* - tools/wu-cleanup.
|
|
14
|
-
* - tools/gates-pre-commit.
|
|
15
|
-
* - tools/validate.
|
|
16
|
-
* - tools/guard-worktree-commit.
|
|
8
|
+
* - tools/wu-claim.ts
|
|
9
|
+
* - tools/wu-done.ts
|
|
10
|
+
* - tools/wu-block.ts
|
|
11
|
+
* - tools/wu-unblock.ts
|
|
12
|
+
* - tools/wu-create.ts
|
|
13
|
+
* - tools/wu-cleanup.ts
|
|
14
|
+
* - tools/gates-pre-commit.ts
|
|
15
|
+
* - tools/validate.ts
|
|
16
|
+
* - tools/guard-worktree-commit.ts
|
|
17
17
|
*/
|
|
18
18
|
/**
|
|
19
19
|
* Structured error class with error codes and details
|
package/dist/error-handler.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file error-handler.
|
|
2
|
+
* @file error-handler.ts
|
|
3
3
|
* @description Structured error handling with error codes
|
|
4
4
|
* WU-1082: Extract shared utilities (eliminate die() duplication)
|
|
5
5
|
* WU-1006: Library-First - use path.basename() instead of manual split
|
|
6
6
|
*
|
|
7
7
|
* Replaces die() function in:
|
|
8
|
-
* - tools/wu-claim.
|
|
9
|
-
* - tools/wu-done.
|
|
10
|
-
* - tools/wu-block.
|
|
11
|
-
* - tools/wu-unblock.
|
|
12
|
-
* - tools/wu-create.
|
|
13
|
-
* - tools/wu-cleanup.
|
|
14
|
-
* - tools/gates-pre-commit.
|
|
15
|
-
* - tools/validate.
|
|
16
|
-
* - tools/guard-worktree-commit.
|
|
8
|
+
* - tools/wu-claim.ts
|
|
9
|
+
* - tools/wu-done.ts
|
|
10
|
+
* - tools/wu-block.ts
|
|
11
|
+
* - tools/wu-unblock.ts
|
|
12
|
+
* - tools/wu-create.ts
|
|
13
|
+
* - tools/wu-cleanup.ts
|
|
14
|
+
* - tools/gates-pre-commit.ts
|
|
15
|
+
* - tools/validate.ts
|
|
16
|
+
* - tools/guard-worktree-commit.ts
|
|
17
17
|
*/
|
|
18
18
|
import path from 'node:path';
|
|
19
19
|
/**
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* File Classifiers
|
|
4
4
|
*
|
|
5
5
|
* Shared utilities for classifying file types.
|
|
6
|
-
* Consolidates duplicated classification logic from wu-validator.
|
|
7
|
-
* and code-path-validator.
|
|
6
|
+
* Consolidates duplicated classification logic from wu-validator.ts
|
|
7
|
+
* and code-path-validator.ts.
|
|
8
8
|
*
|
|
9
9
|
* WU-1848: DRY Consolidation - Eliminate duplicated code patterns
|
|
10
10
|
*
|
|
11
|
-
* @see tools/lib/wu-validator.
|
|
12
|
-
* @see tools/lib/code-path-validator.
|
|
11
|
+
* @see tools/lib/wu-validator.ts - Original isTestFile, isMarkdownFile
|
|
12
|
+
* @see tools/lib/code-path-validator.ts - Duplicated implementations
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
15
|
* Prefixes for paths that qualify as documentation-only.
|
|
@@ -30,8 +30,8 @@ declare const TEST_FILE_PATTERNS: readonly RegExp[];
|
|
|
30
30
|
* Check if a file path is a test file
|
|
31
31
|
*
|
|
32
32
|
* Detects test files by extension and directory patterns:
|
|
33
|
-
* - *.test.ts, *.test.tsx, *.test.js, *.test.jsx, *.test.
|
|
34
|
-
* - *.spec.ts, *.spec.tsx, *.spec.js, *.spec.jsx, *.spec.
|
|
33
|
+
* - *.test.ts, *.test.tsx, *.test.js, *.test.jsx, *.test.ts
|
|
34
|
+
* - *.spec.ts, *.spec.tsx, *.spec.js, *.spec.jsx, *.spec.ts
|
|
35
35
|
* - Files in __tests__ directories
|
|
36
36
|
* - *.test-utils.* files
|
|
37
37
|
* - *.mock.* files
|
package/dist/file-classifiers.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* File Classifiers
|
|
4
4
|
*
|
|
5
5
|
* Shared utilities for classifying file types.
|
|
6
|
-
* Consolidates duplicated classification logic from wu-validator.
|
|
7
|
-
* and code-path-validator.
|
|
6
|
+
* Consolidates duplicated classification logic from wu-validator.ts
|
|
7
|
+
* and code-path-validator.ts.
|
|
8
8
|
*
|
|
9
9
|
* WU-1848: DRY Consolidation - Eliminate duplicated code patterns
|
|
10
10
|
*
|
|
11
|
-
* @see tools/lib/wu-validator.
|
|
12
|
-
* @see tools/lib/code-path-validator.
|
|
11
|
+
* @see tools/lib/wu-validator.ts - Original isTestFile, isMarkdownFile
|
|
12
|
+
* @see tools/lib/code-path-validator.ts - Duplicated implementations
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
15
|
* Prefixes for paths that qualify as documentation-only.
|
|
@@ -36,8 +36,8 @@ const TEST_FILE_PATTERNS = Object.freeze([
|
|
|
36
36
|
* Check if a file path is a test file
|
|
37
37
|
*
|
|
38
38
|
* Detects test files by extension and directory patterns:
|
|
39
|
-
* - *.test.ts, *.test.tsx, *.test.js, *.test.jsx, *.test.
|
|
40
|
-
* - *.spec.ts, *.spec.tsx, *.spec.js, *.spec.jsx, *.spec.
|
|
39
|
+
* - *.test.ts, *.test.tsx, *.test.js, *.test.jsx, *.test.ts
|
|
40
|
+
* - *.spec.ts, *.spec.tsx, *.spec.js, *.spec.jsx, *.spec.ts
|
|
41
41
|
* - Files in __tests__ directories
|
|
42
42
|
* - *.test-utils.* files
|
|
43
43
|
* - *.mock.* files
|
package/dist/gates-config.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* @module gates-config
|
|
11
11
|
*/
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
+
import { type CoverageMode } from './resolve-policy.js';
|
|
13
14
|
/**
|
|
14
15
|
* Schema for a gate command - either a string or an object with options
|
|
15
16
|
*/
|
|
@@ -130,3 +131,76 @@ export declare function resolveGatesConfig(projectRoot: string): GatesExecutionC
|
|
|
130
131
|
* @returns True if the gate should be skipped
|
|
131
132
|
*/
|
|
132
133
|
export declare function shouldSkipGate(gateName: keyof Omit<GatesExecutionConfig, 'preset' | 'coverage'>, config: GatesExecutionConfig, skipFlags: Record<string, boolean>): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* WU-1191: Lane health gate mode
|
|
136
|
+
* Controls how lane health check behaves during gates
|
|
137
|
+
*/
|
|
138
|
+
export type LaneHealthMode = 'warn' | 'error' | 'off';
|
|
139
|
+
/**
|
|
140
|
+
* WU-1191: Load lane health configuration from .lumenflow.config.yaml
|
|
141
|
+
*
|
|
142
|
+
* Configuration format:
|
|
143
|
+
* ```yaml
|
|
144
|
+
* gates:
|
|
145
|
+
* lane_health: warn|error|off
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @param projectRoot - Project root directory
|
|
149
|
+
* @returns Lane health mode ('warn', 'error', or 'off'), defaults to 'warn'
|
|
150
|
+
*/
|
|
151
|
+
export declare function loadLaneHealthConfig(projectRoot: string): LaneHealthMode;
|
|
152
|
+
/**
|
|
153
|
+
* WU-1262: Resolved coverage configuration
|
|
154
|
+
* Contains threshold and mode derived from methodology policy
|
|
155
|
+
*/
|
|
156
|
+
export interface CoverageConfig {
|
|
157
|
+
/** Coverage threshold (0-100) */
|
|
158
|
+
threshold: number;
|
|
159
|
+
/** Coverage mode (block, warn, or off) */
|
|
160
|
+
mode: CoverageMode;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* WU-1262: Resolve coverage configuration from methodology policy
|
|
164
|
+
*
|
|
165
|
+
* Uses resolvePolicy() to determine coverage defaults based on methodology.testing:
|
|
166
|
+
* - tdd: 90% threshold, block mode
|
|
167
|
+
* - test-after: 70% threshold, warn mode
|
|
168
|
+
* - none: 0% threshold, off mode
|
|
169
|
+
*
|
|
170
|
+
* Precedence (highest to lowest):
|
|
171
|
+
* 1. Explicit gates.minCoverage / gates.enableCoverage
|
|
172
|
+
* 2. methodology.overrides.coverage_threshold / coverage_mode
|
|
173
|
+
* 3. methodology.testing template defaults
|
|
174
|
+
*
|
|
175
|
+
* @param projectRoot - Project root directory
|
|
176
|
+
* @returns Resolved coverage configuration
|
|
177
|
+
*/
|
|
178
|
+
export declare function resolveCoverageConfig(projectRoot: string): CoverageConfig;
|
|
179
|
+
/**
|
|
180
|
+
* WU-1280: Resolved test policy configuration
|
|
181
|
+
* Extends CoverageConfig with tests_required from methodology policy
|
|
182
|
+
*/
|
|
183
|
+
export interface TestPolicy extends CoverageConfig {
|
|
184
|
+
/** Whether tests are required for completion (from methodology.testing) */
|
|
185
|
+
tests_required: boolean;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* WU-1280: Resolve test policy from methodology configuration
|
|
189
|
+
*
|
|
190
|
+
* Returns the full test policy including coverage config AND tests_required.
|
|
191
|
+
* This is used by gates to determine whether test failures should block or warn.
|
|
192
|
+
*
|
|
193
|
+
* Methodology mapping:
|
|
194
|
+
* - tdd: 90% threshold, block mode, tests_required=true
|
|
195
|
+
* - test-after: 70% threshold, warn mode, tests_required=true
|
|
196
|
+
* - none: 0% threshold, off mode, tests_required=false
|
|
197
|
+
*
|
|
198
|
+
* When tests_required=false:
|
|
199
|
+
* - Test failures produce WARNINGS instead of FAILURES
|
|
200
|
+
* - Gates continue but log the test failures
|
|
201
|
+
* - Coverage gate is effectively skipped (mode='off')
|
|
202
|
+
*
|
|
203
|
+
* @param projectRoot - Project root directory
|
|
204
|
+
* @returns Resolved test policy including tests_required
|
|
205
|
+
*/
|
|
206
|
+
export declare function resolveTestPolicy(projectRoot: string): TestPolicy;
|
package/dist/gates-config.js
CHANGED
|
@@ -13,6 +13,13 @@ import * as fs from 'node:fs';
|
|
|
13
13
|
import * as path from 'node:path';
|
|
14
14
|
import * as yaml from 'yaml';
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
+
// WU-1262: Import resolvePolicy for methodology-driven coverage defaults
|
|
17
|
+
// Note: resolvePolicy uses type-only import from lumenflow-config-schema, avoiding circular dependency
|
|
18
|
+
import { resolvePolicy, getDefaultPolicy, MethodologyConfigSchema, } from './resolve-policy.js';
|
|
19
|
+
/**
|
|
20
|
+
* Config file name constant to avoid duplicate string literals
|
|
21
|
+
*/
|
|
22
|
+
const CONFIG_FILE_NAME = '.lumenflow.config.yaml';
|
|
16
23
|
/**
|
|
17
24
|
* Default timeout for gate commands (2 minutes)
|
|
18
25
|
*/
|
|
@@ -160,7 +167,7 @@ export function expandPreset(preset) {
|
|
|
160
167
|
* @returns Gates execution config, or null if not configured
|
|
161
168
|
*/
|
|
162
169
|
export function loadGatesConfig(projectRoot) {
|
|
163
|
-
const configPath = path.join(projectRoot,
|
|
170
|
+
const configPath = path.join(projectRoot, CONFIG_FILE_NAME);
|
|
164
171
|
if (!fs.existsSync(configPath)) {
|
|
165
172
|
return null;
|
|
166
173
|
}
|
|
@@ -175,6 +182,7 @@ export function loadGatesConfig(projectRoot) {
|
|
|
175
182
|
// Validate the config
|
|
176
183
|
const result = GatesExecutionConfigSchema.safeParse(executionConfig);
|
|
177
184
|
if (!result.success) {
|
|
185
|
+
// eslint-disable-next-line no-console -- Intentional warning for invalid config
|
|
178
186
|
console.warn('Warning: Invalid gates.execution config:', result.error.message);
|
|
179
187
|
return null;
|
|
180
188
|
}
|
|
@@ -187,7 +195,8 @@ export function loadGatesConfig(projectRoot) {
|
|
|
187
195
|
return merged;
|
|
188
196
|
}
|
|
189
197
|
catch (error) {
|
|
190
|
-
|
|
198
|
+
// eslint-disable-next-line no-console -- Intentional warning for parse failure
|
|
199
|
+
console.warn(`Warning: Failed to parse ${CONFIG_FILE_NAME}:`, error instanceof Error ? error.message : String(error));
|
|
191
200
|
return null;
|
|
192
201
|
}
|
|
193
202
|
}
|
|
@@ -246,3 +255,201 @@ export function shouldSkipGate(gateName, config, skipFlags) {
|
|
|
246
255
|
}
|
|
247
256
|
return false;
|
|
248
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Schema for lane health mode validation
|
|
260
|
+
*/
|
|
261
|
+
const LaneHealthModeSchema = z.enum(['warn', 'error', 'off']);
|
|
262
|
+
/**
|
|
263
|
+
* Default lane health mode (advisory by default)
|
|
264
|
+
*/
|
|
265
|
+
const DEFAULT_LANE_HEALTH_MODE = 'warn';
|
|
266
|
+
/**
|
|
267
|
+
* WU-1191: Load lane health configuration from .lumenflow.config.yaml
|
|
268
|
+
*
|
|
269
|
+
* Configuration format:
|
|
270
|
+
* ```yaml
|
|
271
|
+
* gates:
|
|
272
|
+
* lane_health: warn|error|off
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* @param projectRoot - Project root directory
|
|
276
|
+
* @returns Lane health mode ('warn', 'error', or 'off'), defaults to 'warn'
|
|
277
|
+
*/
|
|
278
|
+
export function loadLaneHealthConfig(projectRoot) {
|
|
279
|
+
const configPath = path.join(projectRoot, CONFIG_FILE_NAME);
|
|
280
|
+
if (!fs.existsSync(configPath)) {
|
|
281
|
+
return DEFAULT_LANE_HEALTH_MODE;
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
285
|
+
const data = yaml.parse(content);
|
|
286
|
+
// Check if gates.lane_health is configured
|
|
287
|
+
const laneHealthConfig = data?.gates?.lane_health;
|
|
288
|
+
if (laneHealthConfig === undefined) {
|
|
289
|
+
return DEFAULT_LANE_HEALTH_MODE;
|
|
290
|
+
}
|
|
291
|
+
// Validate the config value
|
|
292
|
+
const result = LaneHealthModeSchema.safeParse(laneHealthConfig);
|
|
293
|
+
if (!result.success) {
|
|
294
|
+
// eslint-disable-next-line no-console -- Intentional warning for invalid config
|
|
295
|
+
console.warn(`Warning: Invalid gates.lane_health value '${laneHealthConfig}', expected 'warn', 'error', or 'off'. Using default 'warn'.`);
|
|
296
|
+
return DEFAULT_LANE_HEALTH_MODE;
|
|
297
|
+
}
|
|
298
|
+
return result.data;
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
// eslint-disable-next-line no-console -- Intentional warning for parse failure
|
|
302
|
+
console.warn(`Warning: Failed to parse ${CONFIG_FILE_NAME} for lane_health config:`, error instanceof Error ? error.message : String(error));
|
|
303
|
+
return DEFAULT_LANE_HEALTH_MODE;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* WU-1262: Resolve coverage configuration from methodology policy
|
|
308
|
+
*
|
|
309
|
+
* Uses resolvePolicy() to determine coverage defaults based on methodology.testing:
|
|
310
|
+
* - tdd: 90% threshold, block mode
|
|
311
|
+
* - test-after: 70% threshold, warn mode
|
|
312
|
+
* - none: 0% threshold, off mode
|
|
313
|
+
*
|
|
314
|
+
* Precedence (highest to lowest):
|
|
315
|
+
* 1. Explicit gates.minCoverage / gates.enableCoverage
|
|
316
|
+
* 2. methodology.overrides.coverage_threshold / coverage_mode
|
|
317
|
+
* 3. methodology.testing template defaults
|
|
318
|
+
*
|
|
319
|
+
* @param projectRoot - Project root directory
|
|
320
|
+
* @returns Resolved coverage configuration
|
|
321
|
+
*/
|
|
322
|
+
export function resolveCoverageConfig(projectRoot) {
|
|
323
|
+
const configPath = path.join(projectRoot, CONFIG_FILE_NAME);
|
|
324
|
+
// Load raw config to detect explicit vs default values
|
|
325
|
+
let rawConfig = {};
|
|
326
|
+
if (fs.existsSync(configPath)) {
|
|
327
|
+
try {
|
|
328
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
329
|
+
rawConfig = yaml.parse(content) ?? {};
|
|
330
|
+
}
|
|
331
|
+
catch {
|
|
332
|
+
// Fall through to use defaults
|
|
333
|
+
rawConfig = {};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
// If no config file, use default policy
|
|
337
|
+
if (Object.keys(rawConfig).length === 0) {
|
|
338
|
+
const defaultPolicy = getDefaultPolicy();
|
|
339
|
+
return {
|
|
340
|
+
threshold: defaultPolicy.coverage_threshold,
|
|
341
|
+
mode: defaultPolicy.coverage_mode,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
// Parse methodology config manually to avoid circular dependency with lumenflow-config-schema.ts
|
|
345
|
+
// (lumenflow-config-schema.ts imports GatesExecutionConfigSchema from this file)
|
|
346
|
+
const methodologyRaw = rawConfig.methodology;
|
|
347
|
+
const gatesRaw = rawConfig.gates;
|
|
348
|
+
// Build a minimal config object with only what resolvePolicy needs
|
|
349
|
+
// Parse methodology with Zod to get defaults
|
|
350
|
+
const methodology = MethodologyConfigSchema.parse(methodologyRaw ?? {});
|
|
351
|
+
// Build the config structure that resolvePolicy expects
|
|
352
|
+
const minimalConfig = {
|
|
353
|
+
methodology: methodologyRaw, // Pass raw methodology for explicit detection
|
|
354
|
+
gates: {
|
|
355
|
+
minCoverage: gatesRaw?.minCoverage,
|
|
356
|
+
enableCoverage: gatesRaw?.enableCoverage,
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
// Resolve policy using the methodology configuration
|
|
360
|
+
// Pass rawConfig to detect explicit gates.* settings vs Zod defaults
|
|
361
|
+
const policy = resolvePolicy({
|
|
362
|
+
methodology,
|
|
363
|
+
gates: {
|
|
364
|
+
// Default gates values from schema
|
|
365
|
+
maxEslintWarnings: 100,
|
|
366
|
+
enableCoverage: gatesRaw?.enableCoverage !== undefined ? Boolean(gatesRaw.enableCoverage) : true,
|
|
367
|
+
minCoverage: typeof gatesRaw?.minCoverage === 'number' ? gatesRaw.minCoverage : 90,
|
|
368
|
+
enableSafetyCriticalTests: true,
|
|
369
|
+
enableInvariants: true,
|
|
370
|
+
},
|
|
371
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Minimal type for config
|
|
372
|
+
}, {
|
|
373
|
+
rawConfig: minimalConfig,
|
|
374
|
+
});
|
|
375
|
+
return {
|
|
376
|
+
threshold: policy.coverage_threshold,
|
|
377
|
+
mode: policy.coverage_mode,
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* WU-1280: Resolve test policy from methodology configuration
|
|
382
|
+
*
|
|
383
|
+
* Returns the full test policy including coverage config AND tests_required.
|
|
384
|
+
* This is used by gates to determine whether test failures should block or warn.
|
|
385
|
+
*
|
|
386
|
+
* Methodology mapping:
|
|
387
|
+
* - tdd: 90% threshold, block mode, tests_required=true
|
|
388
|
+
* - test-after: 70% threshold, warn mode, tests_required=true
|
|
389
|
+
* - none: 0% threshold, off mode, tests_required=false
|
|
390
|
+
*
|
|
391
|
+
* When tests_required=false:
|
|
392
|
+
* - Test failures produce WARNINGS instead of FAILURES
|
|
393
|
+
* - Gates continue but log the test failures
|
|
394
|
+
* - Coverage gate is effectively skipped (mode='off')
|
|
395
|
+
*
|
|
396
|
+
* @param projectRoot - Project root directory
|
|
397
|
+
* @returns Resolved test policy including tests_required
|
|
398
|
+
*/
|
|
399
|
+
export function resolveTestPolicy(projectRoot) {
|
|
400
|
+
const configPath = path.join(projectRoot, CONFIG_FILE_NAME);
|
|
401
|
+
// Load raw config to detect explicit vs default values
|
|
402
|
+
let rawConfig = {};
|
|
403
|
+
if (fs.existsSync(configPath)) {
|
|
404
|
+
try {
|
|
405
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
406
|
+
rawConfig = yaml.parse(content) ?? {};
|
|
407
|
+
}
|
|
408
|
+
catch {
|
|
409
|
+
// Fall through to use defaults
|
|
410
|
+
rawConfig = {};
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
// If no config file, use default policy (TDD)
|
|
414
|
+
if (Object.keys(rawConfig).length === 0) {
|
|
415
|
+
const defaultPolicy = getDefaultPolicy();
|
|
416
|
+
return {
|
|
417
|
+
threshold: defaultPolicy.coverage_threshold,
|
|
418
|
+
mode: defaultPolicy.coverage_mode,
|
|
419
|
+
tests_required: defaultPolicy.tests_required,
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
// Parse methodology config manually to avoid circular dependency with lumenflow-config-schema.ts
|
|
423
|
+
const methodologyRaw = rawConfig.methodology;
|
|
424
|
+
const gatesRaw = rawConfig.gates;
|
|
425
|
+
// Parse methodology with Zod to get defaults
|
|
426
|
+
const methodology = MethodologyConfigSchema.parse(methodologyRaw ?? {});
|
|
427
|
+
// Build the config structure that resolvePolicy expects
|
|
428
|
+
const minimalConfig = {
|
|
429
|
+
methodology: methodologyRaw, // Pass raw methodology for explicit detection
|
|
430
|
+
gates: {
|
|
431
|
+
minCoverage: gatesRaw?.minCoverage,
|
|
432
|
+
enableCoverage: gatesRaw?.enableCoverage,
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
// Resolve policy using the methodology configuration
|
|
436
|
+
const policy = resolvePolicy({
|
|
437
|
+
methodology,
|
|
438
|
+
gates: {
|
|
439
|
+
// Default gates values from schema
|
|
440
|
+
maxEslintWarnings: 100,
|
|
441
|
+
enableCoverage: gatesRaw?.enableCoverage !== undefined ? Boolean(gatesRaw.enableCoverage) : true,
|
|
442
|
+
minCoverage: typeof gatesRaw?.minCoverage === 'number' ? gatesRaw.minCoverage : 90,
|
|
443
|
+
enableSafetyCriticalTests: true,
|
|
444
|
+
enableInvariants: true,
|
|
445
|
+
},
|
|
446
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Minimal type for config
|
|
447
|
+
}, {
|
|
448
|
+
rawConfig: minimalConfig,
|
|
449
|
+
});
|
|
450
|
+
return {
|
|
451
|
+
threshold: policy.coverage_threshold,
|
|
452
|
+
mode: policy.coverage_mode,
|
|
453
|
+
tests_required: policy.tests_required,
|
|
454
|
+
};
|
|
455
|
+
}
|
package/dist/git-adapter.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file git-adapter.
|
|
2
|
+
* @file git-adapter.ts
|
|
3
3
|
* @description Git operations adapter using simple-git library
|
|
4
4
|
* WU-1082: Extract shared utilities (eliminate run() duplication)
|
|
5
5
|
* WU-1213: Refactor to use simple-git library (eliminate execSync)
|
|
6
6
|
* WU-2242: Add runtime type assertions to prevent silent API misuse
|
|
7
7
|
*
|
|
8
8
|
* Replaces run() function in:
|
|
9
|
-
* - tools/wu-claim.
|
|
10
|
-
* - tools/wu-done.
|
|
11
|
-
* - tools/wu-block.
|
|
12
|
-
* - tools/wu-unblock.
|
|
13
|
-
* - tools/wu-create.
|
|
14
|
-
* - tools/wu-cleanup.
|
|
15
|
-
* - tools/gates-pre-commit.
|
|
16
|
-
* - tools/validate.
|
|
17
|
-
* - tools/guard-worktree-commit.
|
|
9
|
+
* - tools/wu-claim.ts
|
|
10
|
+
* - tools/wu-done.ts
|
|
11
|
+
* - tools/wu-block.ts
|
|
12
|
+
* - tools/wu-unblock.ts
|
|
13
|
+
* - tools/wu-create.ts
|
|
14
|
+
* - tools/wu-cleanup.ts
|
|
15
|
+
* - tools/gates-pre-commit.ts
|
|
16
|
+
* - tools/validate.ts
|
|
17
|
+
* - tools/guard-worktree-commit.ts
|
|
18
18
|
*/
|
|
19
19
|
import { type SimpleGit } from 'simple-git';
|
|
20
20
|
interface GitAdapterOptions {
|
|
@@ -242,7 +242,7 @@ export declare class GitAdapter {
|
|
|
242
242
|
* Get commit log
|
|
243
243
|
*
|
|
244
244
|
* WU-1749: Bug 4 fix - Add log() method for counting commits.
|
|
245
|
-
* Used by wu-done-retry-helpers.
|
|
245
|
+
* Used by wu-done-retry-helpers.ts to count previous completion attempts.
|
|
246
246
|
*
|
|
247
247
|
* @param {object} [options] - Log options
|
|
248
248
|
* @param {number} [options.maxCount] - Maximum number of commits to return
|
package/dist/git-adapter.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file git-adapter.
|
|
2
|
+
* @file git-adapter.ts
|
|
3
3
|
* @description Git operations adapter using simple-git library
|
|
4
4
|
* WU-1082: Extract shared utilities (eliminate run() duplication)
|
|
5
5
|
* WU-1213: Refactor to use simple-git library (eliminate execSync)
|
|
6
6
|
* WU-2242: Add runtime type assertions to prevent silent API misuse
|
|
7
7
|
*
|
|
8
8
|
* Replaces run() function in:
|
|
9
|
-
* - tools/wu-claim.
|
|
10
|
-
* - tools/wu-done.
|
|
11
|
-
* - tools/wu-block.
|
|
12
|
-
* - tools/wu-unblock.
|
|
13
|
-
* - tools/wu-create.
|
|
14
|
-
* - tools/wu-cleanup.
|
|
15
|
-
* - tools/gates-pre-commit.
|
|
16
|
-
* - tools/validate.
|
|
17
|
-
* - tools/guard-worktree-commit.
|
|
9
|
+
* - tools/wu-claim.ts
|
|
10
|
+
* - tools/wu-done.ts
|
|
11
|
+
* - tools/wu-block.ts
|
|
12
|
+
* - tools/wu-unblock.ts
|
|
13
|
+
* - tools/wu-create.ts
|
|
14
|
+
* - tools/wu-cleanup.ts
|
|
15
|
+
* - tools/gates-pre-commit.ts
|
|
16
|
+
* - tools/validate.ts
|
|
17
|
+
* - tools/guard-worktree-commit.ts
|
|
18
18
|
*/
|
|
19
19
|
import { simpleGit } from 'simple-git';
|
|
20
20
|
import { existsSync, rmSync } from 'node:fs';
|
|
@@ -385,7 +385,7 @@ export class GitAdapter {
|
|
|
385
385
|
* Get commit log
|
|
386
386
|
*
|
|
387
387
|
* WU-1749: Bug 4 fix - Add log() method for counting commits.
|
|
388
|
-
* Used by wu-done-retry-helpers.
|
|
388
|
+
* Used by wu-done-retry-helpers.ts to count previous completion attempts.
|
|
389
389
|
*
|
|
390
390
|
* @param {object} [options] - Log options
|
|
391
391
|
* @param {number} [options.maxCount] - Maximum number of commits to return
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Context Extractor Module (WU-1190)
|
|
3
|
+
*
|
|
4
|
+
* Extracts git history insights for LLM context enrichment:
|
|
5
|
+
* - Co-occurrence: files frequently changed together
|
|
6
|
+
* - Ownership: primary contributors to file/directory
|
|
7
|
+
* - Churn: change frequency metrics (hotspots)
|
|
8
|
+
*
|
|
9
|
+
* These signals help the LLM understand codebase relationships
|
|
10
|
+
* without algorithmic clustering - the LLM interprets the patterns.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A pair of files frequently changed together
|
|
14
|
+
*/
|
|
15
|
+
export interface CoOccurrence {
|
|
16
|
+
file1: string;
|
|
17
|
+
file2: string;
|
|
18
|
+
/** Number of commits where both files were changed */
|
|
19
|
+
count: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Ownership signal for a path (file or directory)
|
|
23
|
+
*/
|
|
24
|
+
export interface OwnershipSignal {
|
|
25
|
+
/** The path being analyzed */
|
|
26
|
+
path: string;
|
|
27
|
+
/** Primary contributor (most commits), null if none */
|
|
28
|
+
primaryOwner: string | null;
|
|
29
|
+
/** All contributors with their commit counts */
|
|
30
|
+
contributors: string[];
|
|
31
|
+
/** Total commits touching this path */
|
|
32
|
+
commitCount: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Churn metric for a file
|
|
36
|
+
*/
|
|
37
|
+
export interface ChurnMetric {
|
|
38
|
+
filePath: string;
|
|
39
|
+
additions: number;
|
|
40
|
+
deletions: number;
|
|
41
|
+
/** Churn score = additions + deletions */
|
|
42
|
+
churnScore: number;
|
|
43
|
+
/** Number of commits modifying this file */
|
|
44
|
+
commitCount: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Complete git context extracted from repository
|
|
48
|
+
*/
|
|
49
|
+
export interface GitContext {
|
|
50
|
+
coOccurrences: CoOccurrence[];
|
|
51
|
+
ownership: OwnershipSignal[];
|
|
52
|
+
churn: ChurnMetric[];
|
|
53
|
+
hasLimitedHistory: boolean;
|
|
54
|
+
error?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Options for git context extraction
|
|
58
|
+
*/
|
|
59
|
+
export interface GitContextOptions {
|
|
60
|
+
/** Maximum number of commits to analyze */
|
|
61
|
+
maxCommits?: number;
|
|
62
|
+
/** Limit history to commits since this date */
|
|
63
|
+
since?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options for co-occurrence extraction
|
|
67
|
+
*/
|
|
68
|
+
interface CoOccurrenceOptions {
|
|
69
|
+
maxResults?: number;
|
|
70
|
+
maxCommits?: number;
|
|
71
|
+
since?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Options for churn metrics extraction
|
|
75
|
+
*/
|
|
76
|
+
interface ChurnOptions {
|
|
77
|
+
excludePatterns?: string[];
|
|
78
|
+
maxResults?: number;
|
|
79
|
+
maxCommits?: number;
|
|
80
|
+
since?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Options for summarizing git context
|
|
84
|
+
*/
|
|
85
|
+
interface SummarizeOptions {
|
|
86
|
+
/** Approximate max tokens (chars / 4 as rough estimate) */
|
|
87
|
+
maxTokens?: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Extract complete git context from a repository
|
|
91
|
+
*/
|
|
92
|
+
export declare function extractGitContext(projectRoot: string, options?: GitContextOptions): GitContext;
|
|
93
|
+
/**
|
|
94
|
+
* Extract file co-occurrence patterns from git history
|
|
95
|
+
*/
|
|
96
|
+
export declare function getFileCoOccurrence(projectRoot: string, options?: CoOccurrenceOptions): CoOccurrence[];
|
|
97
|
+
/**
|
|
98
|
+
* Extract ownership signals for specified paths.
|
|
99
|
+
* Note: paths are validated internally and not derived from user input.
|
|
100
|
+
*/
|
|
101
|
+
export declare function getOwnershipSignals(projectRoot: string, paths: string[]): OwnershipSignal[];
|
|
102
|
+
/**
|
|
103
|
+
* Extract churn metrics for the repository
|
|
104
|
+
*/
|
|
105
|
+
export declare function getChurnMetrics(projectRoot: string, options?: ChurnOptions): ChurnMetric[];
|
|
106
|
+
/**
|
|
107
|
+
* Summarize git context for LLM prompt inclusion
|
|
108
|
+
*
|
|
109
|
+
* Produces a token-efficient summary that fits within specified limits.
|
|
110
|
+
*/
|
|
111
|
+
export declare function summarizeGitContext(context: GitContext, options?: SummarizeOptions): string;
|
|
112
|
+
export {};
|