mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +05:00
feat(ipuaro): add impact score to initial context
Add High Impact Files section to initial context showing which files are most critical based on percentage of codebase that depends on them. Changes: - Add impactScore field to FileMeta (0-100) - Add calculateImpactScore() helper function - Update MetaAnalyzer to compute impact scores - Add formatHighImpactFiles() to prompts.ts - Add includeHighImpactFiles config option (default: true) - 28 new tests (1826 total)
This commit is contained in:
@@ -18,6 +18,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -32,6 +33,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -171,6 +173,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -187,6 +190,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -204,6 +208,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -218,6 +223,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: false,
|
||||
includeDepsGraph: false,
|
||||
includeCircularDeps: false,
|
||||
includeHighImpactFiles: false,
|
||||
}
|
||||
|
||||
const result = ContextConfigSchema.parse(config)
|
||||
@@ -233,6 +239,7 @@ describe("ContextConfigSchema", () => {
|
||||
includeSignatures: true,
|
||||
includeDepsGraph: true,
|
||||
includeCircularDeps: true,
|
||||
includeHighImpactFiles: true,
|
||||
}
|
||||
|
||||
const result = ContextConfigSchema.parse(config)
|
||||
@@ -314,4 +321,29 @@ describe("ContextConfigSchema", () => {
|
||||
expect(() => ContextConfigSchema.parse({ includeCircularDeps: 1 })).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
describe("includeHighImpactFiles", () => {
|
||||
it("should accept true", () => {
|
||||
const result = ContextConfigSchema.parse({ includeHighImpactFiles: true })
|
||||
expect(result.includeHighImpactFiles).toBe(true)
|
||||
})
|
||||
|
||||
it("should accept false", () => {
|
||||
const result = ContextConfigSchema.parse({ includeHighImpactFiles: false })
|
||||
expect(result.includeHighImpactFiles).toBe(false)
|
||||
})
|
||||
|
||||
it("should default to true", () => {
|
||||
const result = ContextConfigSchema.parse({})
|
||||
expect(result.includeHighImpactFiles).toBe(true)
|
||||
})
|
||||
|
||||
it("should reject non-boolean", () => {
|
||||
expect(() => ContextConfigSchema.parse({ includeHighImpactFiles: "true" })).toThrow()
|
||||
})
|
||||
|
||||
it("should reject number", () => {
|
||||
expect(() => ContextConfigSchema.parse({ includeHighImpactFiles: 1 })).toThrow()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user