Repository navigation
Closed
Labels
auto-readyCan be resolved via automated workflowplannedImplementation plan approvedready-for-reviewReady for code review
Description
Summary
The scope assessment feature (merged in #247) has a type mismatch between the settings schema and the config used by the scope module. This prevents users from configuring custom thresholds via .sequant/settings.json.
Problem
Type Mismatch
ScopeAssessmentSettings (in src/lib/settings.ts) is missing fields that ScopeAssessmentConfig (in src/lib/scope/types.ts) requires:
| Field | Settings | Config |
|---|---|---|
trivialThresholds.maxACItems |
❌ Missing | ✅ Has |
trivialThresholds.maxDirectories |
❌ Missing | ✅ Has |
thresholds.directorySpread |
❌ Missing | ✅ Has |
No Integration
performScopeAssessment() accepts a config parameter but:
- No code reads
getSettings().scopeAssessment - No converter function exists to transform settings → config
- SKILL.md just uses
DEFAULT_SCOPE_CONFIG
Proposed Solution
Option A: Align Settings Schema (Recommended)
Add missing fields to ScopeAssessmentSettings:
export interface ScopeAssessmentSettings {
enabled: boolean;
skipIfSimple: boolean;
trivialThresholds: { // ADD
maxACItems: number; // ADD (default: 3)
maxDirectories: number; // ADD (default: 1)
};
thresholds: {
featureCount: ScopeThreshold;
acItems: ScopeThreshold;
fileEstimate: ScopeThreshold;
directorySpread: ScopeThreshold; // ADD
};
}Option B: Create Converter Function
Add convertSettingsToConfig() that:
- Takes
ScopeAssessmentSettings - Merges with defaults for missing fields
- Returns
ScopeAssessmentConfig
Acceptance Criteria
- AC-1:
ScopeAssessmentSettingsincludes all fields fromScopeAssessmentConfig - AC-2: Custom thresholds in
.sequant/settings.jsonare used by scope assessment - AC-3: SKILL.md updated to read settings before calling
performScopeAssessment - AC-4: Unit tests verify settings → config flow
- AC-5: Default values documented
Impact
- Current: Feature works with defaults only
- After: Users can customize scope thresholds per project
Related
- feat: Add Scope Assessment to /spec with Non-Goals Requirement #239 - Original scope assessment implementation
- feat(spec): Add Scope Assessment with Non-Goals requirement #247 - Merged PR
Follow-up from QA review of #239
Metadata
Metadata
Assignees
Labels
auto-readyCan be resolved via automated workflowplannedImplementation plan approvedready-for-reviewReady for code review
Activity
admarble commentedon Feb 20, 2026
Spec Review: #249 - Align ScopeAssessmentSettings with ScopeAssessmentConfig
AC Quality Check
✅ All 5 acceptance criteria are clear and testable.
Scope Assessment
Non-Goals (Required)
Suggested Non-Goals:
Scope Metrics
Scope Verdict
Acceptance Criteria with Verification
AC-1: ScopeAssessmentSettings includes all fields from ScopeAssessmentConfig
Verification Method: Unit Test
Test Scenario:
ScopeAssessmentSettingsinterface insrc/lib/settings.tsScopeAssessmentConfiginsrc/lib/scope/types.tsScopeAssessmentConfigexist inScopeAssessmentSettings(or defaults are merged)Implementation:
trivialThresholds: { maxACItems: number; maxDirectories: number }toScopeAssessmentSettingsdirectorySpread: ScopeThresholdtothresholdsDEFAULT_SCOPE_ASSESSMENT_SETTINGSwith default valuesAC-2: Custom thresholds in .sequant/settings.json are used by scope assessment
Verification Method: Integration Test
Test Scenario:
.sequant/settings.jsonfile with custom thresholds (e.g.,acItems.yellow: 4)performScopeAssessment()Implementation:
convertSettingsToConfig()function that merges settings with defaultssrc/lib/scope/index.tsAC-3: SKILL.md updated to read settings before calling performScopeAssessment
Verification Method: Manual Test
Test Scenario:
getSettings().scopeAssessmentand passes toperformScopeAssessment()Implementation:
.claude/skills/spec/SKILL.mdscope assessment sectiongetSettings()call and pass settings to converter functionAC-4: Unit tests verify settings → config flow
Verification Method: Unit Test
Test Scenario:
convertSettingsToConfig()function existstrivialThresholds)ScopeAssessmentConfigImplementation:
src/lib/scope/settings-converter.test.tsAC-5: Default values documented
Verification Method: Manual Test
Test Scenario:
Implementation:
DEFAULT_SCOPE_ASSESSMENT_SETTINGSImplementation Plan
Phase 1: Align Type Schema
Update
ScopeAssessmentSettingsinterface insrc/lib/settings.ts:113-127trivialThresholds: { maxACItems: number; maxDirectories: number }directorySpread: ScopeThresholdto thresholdsUpdate
DEFAULT_SCOPE_ASSESSMENT_SETTINGSinsrc/lib/settings.ts:163-171DEFAULT_SCOPE_CONFIGUpdate nested merge logic in
getSettings()atsrc/lib/settings.ts:220-227trivialThresholdsis deeply mergedPhase 2: Create Converter Function
Create
convertSettingsToConfig()in new filesrc/lib/scope/settings-converter.tsScopeAssessmentSettings, returnsScopeAssessmentConfigDEFAULT_SCOPE_CONFIGfor any missing fieldssrc/lib/scope/index.tsAdd unit tests in
src/lib/scope/settings-converter.test.tsPhase 3: Integration
Update SKILL.md in
.claude/skills/spec/SKILL.md:199-213getSettingsfrom settings moduleconvertSettingsToConfigfrom scope moduleperformScopeAssessmentAdd documentation to default values with JSDoc comments
Feature Quality Planning
Completeness Check
Error Handling
Code Quality
any)Test Coverage Plan
Best Practices
Open Questions
Type Alignment Approach
Backward Compatibility
.sequant/settings.jsonfiles without new fields?Recommended Workflow
Phases: spec → exec → qa
Quality Loop: enabled (auto-enabled due to scope concerns - missing Non-Goals)
Reasoning: This is a focused refactoring issue with clear AC. Quality loop enabled due to missing non-goals section in original issue.
Label Review
Current: auto-ready
Recommended: auto-ready, refactor
Reason: Implementation involves restructuring type definitions across modules
Quality Loop: Will auto-enable due to
refactorlabel→
gh issue edit 249 --add-label refactorfix(#249): Align ScopeAssessmentSettings with ScopeAssessmentConfig
admarble commentedon Feb 20, 2026
Exec Phase Complete
AC Coverage Summary
ScopeAssessmentSettingsincludes all fields fromScopeAssessmentConfigsrc/lib/settings.ts:113-146.sequant/settings.jsonare used by scope assessmentconvertSettingsToConfig()+ SKILL.md updateperformScopeAssessment.claude/skills/spec/SKILL.md:203-218settings-converter.test.ts(9 tests)Files Changed
src/lib/settings.ts- AddedTrivialThresholdsinterface, updatedScopeAssessmentSettings, addedDEFAULT_TRIVIAL_THRESHOLDSsrc/lib/scope/settings-converter.ts- New converter function with default mergingsrc/lib/scope/settings-converter.test.ts- 9 unit tests covering conversion scenariossrc/lib/scope/index.ts- Export the converter function.claude/skills/spec/SKILL.md- Updated scope assessment code block to use settingsQuality Results
PR Status
✅ Created: #302
Quality Plan Alignment
any, follows existing patternsadmarble commentedon Feb 20, 2026
QA Review for Issue #249
AC Coverage
ScopeAssessmentSettingsincludes all fields fromScopeAssessmentConfigtrivialThresholds.maxACItems,trivialThresholds.maxDirectories, andthresholds.directorySpread(src/lib/settings.ts:103-156).sequant/settings.jsonare used by scope assessmentconvertSettingsToConfig()merges user settings with defaults;getSettings()deeply merges partial settings (settings.ts:275-286)performScopeAssessmentconvertSettingsToConfigandgetSettings, calls them beforeperformScopeAssessmentsettings-converter.test.tshas 9 comprehensive tests covering undefined handling, full conversion, partial merging, edge values, and type safetyDEFAULT_TRIVIAL_THRESHOLDSandDEFAULT_SCOPE_ASSESSMENT_SETTINGSare documented with JSDoc comments (settings.ts:190-226)Coverage: 5/5 AC items fully met
CI Status
build (18.x)build (20.x)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 6 passed, 0 pending, 0 failed
Quality Metrics
any)Code Review
Strengths:
ScopeAssessmentSettingsnow mirrorsScopeAssessmentConfigexactlyconvertSettingsToConfig()handles undefined/partial inputs gracefullyIssues: None blocking
Verdict: READY_FOR_MERGE ✅
All 5 acceptance criteria are met. Implementation is clean, focused, well-tested, and CI passes.
Next Steps
admarble commentedon Feb 20, 2026
QA Review for Issue #249
AC Coverage
ScopeAssessmentSettingsincludes all fields fromScopeAssessmentConfigTrivialThresholdsinterface withmaxACItems/maxDirectories, addeddirectorySpread: ScopeThresholdto thresholds (settings.ts:113-156).sequant/settings.jsonare used by scope assessmentconvertSettingsToConfig()merges user settings withDEFAULT_SCOPE_CONFIG;getSettings()deeply mergestrivialThresholdsandthresholds(settings.ts:275-286)performScopeAssessmentconvertSettingsToConfig/getSettingsand pass config toperformScopeAssessmentsettings-converter.test.ts: undefined, empty, full, partial trivialThresholds, partial thresholds, zero values, large values, type safetyDEFAULT_TRIVIAL_THRESHOLDS,DEFAULT_SCOPE_ASSESSMENT_SETTINGS,TrivialThresholdsinterface, and all threshold fields with default valuesCoverage: 5/5 AC items fully met
Quality Plan Verification
Quality Plan found: Yes (from spec comment)
Derived ACs: None found in spec
Quality Plan Status: Complete
CI Status
build (18.x)build (20.x)build (22.x)validate-skillstypecheckvalidate-pluginCI Summary: 6 passed, 0 pending, 0 failed
Quality Metrics
any)src/lib,src/lib/scope,.claude/skills/spec)Cache Status
N/A - Caching disabled (fresh run)
Build Verification
N/A - Build passed (TypeScript compiles clean, all CI checks green)
Test Coverage Analysis
src/lib/scope/settings-converter.tssrc/lib/scope/settings-converter.test.ts(9 tests)src/lib/settings.tssrc/lib/scope/index.tssrc/lib/scope/scope.test.ts(40 tests).claude/skills/spec/SKILL.mdCoverage: 2/3 changed source files have direct tests
Critical paths without tests: None (no auth/security/admin files modified)
Test results: 49/49 passed in scope module
Code Review
Strengths:
ScopeAssessmentSettingsnow structurally mirrorsScopeAssessmentConfigfield-for-fieldconvertSettingsToConfig()handles undefined, null, partial settings with nullish coalescingTrivialThresholdsinterface in settings.ts parallels the inline type in types.tsgetSettings()properly handles nestedtrivialThresholdsandthresholdsIssues: None blocking
Suggestions:
ScopeThreshold(settings.ts) andMetricThreshold(types.ts) are structurally identical ({ yellow: number; red: number }). Could consider re-exporting one from the other to avoid duplication, but this is cosmetic and both serve different semantic contextsTest Quality Review
Anti-Pattern Detection
Dependency Audit
N/A - No dependency changes
Code Patterns
src/lib/scope/index.ts:14console.logCritical Issues: 0
Warnings: 0
Execution Evidence
N/A - No executable script/CLI changes. SKILL.md changes are template code; the converter is a library function verified by unit tests.
Skill Command Verification
Skill files changed: 1 (
.claude/skills/spec/SKILL.md).claude/skills/spec/SKILL.mdnpx tsx -eblocksCommands Verified:
./src/lib/scope/index.jsand./src/lib/settings.js→ ✅ Modules exist and export expected functionsconvertSettingsToConfig→ ✅ Exported fromsrc/lib/scope/index.ts:80getSettings→ ✅ Exported fromsrc/lib/settings.ts:255Verification Status: Passed (imports and exports verified)
Skill Change Review
settings.scopeAssessmentmatches theScopeAssessmentSettingsinterfacesrc/lib/scope/index.jsandsrc/lib/settings.js(internal modules)Self-Evaluation
npx vitest run src/lib/scope/in the feature worktree, 49/49 tests pass including 9 new converter tests. TypeScript compiles clean.{ thresholds: { acItems: { yellow: 10 } } }) —getSettings()shallow-merges at the threshold object level, soacItems.redwould be undefined at runtime. However,convertSettingsToConfig()handles this viamergeThreshold()with nullish coalescing, so the flow is safe as long as the converter is used.Verdict: READY_FOR_MERGE ✅
All 5 acceptance criteria are fully met. Implementation is clean, focused, well-tested (49/49 pass), and CI is green across all 6 checks. The converter function robustly handles partial settings, and the SKILL.md integration is complete. Quality plan dimensions are all addressed.
Documentation
Next Steps
test(#249): add integration tests for settings → config flow
admarble commentedon Feb 20, 2026
Documentation Generated
File:
docs/features/scope-assessment-settings.mdSections Included:
Next Steps:
Ready to merge!
docs(#249): add scope assessment settings documentation
docs: update what-weve-built and changelog for #249
fix(#249): Align ScopeAssessmentSettings with ScopeAssessmentConfig (#…
docs: update what-weve-built and changelog for #249
fix(#305): add pre-flight state guard and worktree lifecycle manageme…