mirror of
https://fastgit.cc/github.com/Yeachan-Heo/oh-my-claudecode
synced 2026-04-20 21:00:50 +08:00
Align deep-interview threshold tests with raw-skill contract
CI exercises both the rendered skill template and the raw shipped SKILL.md. The previous PR update changed the contract from an injected ambiguityThreshold sentence to a placeholder/resolved-threshold step, so the tests need to assert that contract directly. The static skill prose also needs the portable config-dir notation required by the skill config-dir guard. Constraint: Keep the static native-loader threshold fix intact Rejected: Restore the old ambiguityThreshold = ... renderer sentence | would re-couple tests to renderer-only wording Confidence: high Scope-risk: narrow Reversibility: clean Tested: npx vitest run src/__tests__/skills.test.ts -t "loads deep-interview ambiguityThreshold from settings before state init and updates the announcement copy|refreshes cached deep-interview output when the configured threshold changes without requiring manual cache clearing|replaces all hardcoded 20%/0.2 threshold references in deep-interview template \(issue #2545\)|ships a config-aware deep-interview SKILL.md for native skill-loader paths \(issue #2723\)" Tested: npx vitest run src/__tests__/auto-slash-aliases.test.ts src/__tests__/skills.test.ts src/skills/__tests__/skill-config-dir.test.ts -t "applies deep-interview threshold runtime injection in slash/materialized output|loads deep-interview ambiguityThreshold from settings before state init and updates the announcement copy|refreshes cached deep-interview output when the configured threshold changes without requiring manual cache clearing|replaces all hardcoded 20%/0.2 threshold references in deep-interview template \(issue #2545\)|ships a config-aware deep-interview SKILL.md for native skill-loader paths \(issue #2723\)|CLAUDE_CONFIG_DIR|total baseline should not increase" Not-tested: Full test suite Related: #2723
This commit is contained in:
@@ -71,7 +71,7 @@ When arguments include `--autoresearch`, Deep Interview becomes the zero-learnin
|
||||
- Otherwise: **greenfield**
|
||||
3. **For brownfield**: Run `explore` agent to map relevant codebase areas, store as `codebase_context`
|
||||
3.5. **Load runtime settings**:
|
||||
- Read `~/.claude/settings.json` and `./.claude/settings.json` (project overrides user)
|
||||
- Read `[$CLAUDE_CONFIG_DIR|~/.claude]/settings.json` and `./.claude/settings.json` (project overrides user)
|
||||
- Resolve `omc.deepInterview.ambiguityThreshold` into `<resolvedThreshold>`; if it is undefined, use `0.2`
|
||||
- Derive `<resolvedThresholdPercent>` from `<resolvedThreshold>` and substitute both placeholders throughout the remaining instructions before continuing
|
||||
4. **Initialize state** via `state_write(mode="deep-interview")`:
|
||||
|
||||
@@ -335,7 +335,7 @@ describe('Builtin Skills', () => {
|
||||
const skill = getBuiltinSkill('deep-interview');
|
||||
expect(skill).toBeDefined();
|
||||
expect(skill?.template).toContain('Load runtime settings');
|
||||
expect(skill?.template).toContain('ambiguityThreshold = 0.12');
|
||||
expect(skill?.template).toContain('Resolve `omc.deepInterview.ambiguityThreshold` into `0.12`');
|
||||
expect(skill?.template).toContain('"threshold": 0.12,');
|
||||
expect(skill?.template).toContain('drops below 12%.');
|
||||
expect(skill?.template?.indexOf('Load runtime settings')).toBeLessThan(
|
||||
@@ -356,7 +356,7 @@ describe('Builtin Skills', () => {
|
||||
);
|
||||
|
||||
const first = getBuiltinSkill('deep-interview');
|
||||
expect(first?.template).toContain('ambiguityThreshold = 0.12');
|
||||
expect(first?.template).toContain('Resolve `omc.deepInterview.ambiguityThreshold` into `0.12`');
|
||||
expect(first?.template).toContain('"threshold": 0.12,');
|
||||
|
||||
writeFileSync(
|
||||
@@ -365,9 +365,9 @@ describe('Builtin Skills', () => {
|
||||
);
|
||||
|
||||
const second = getBuiltinSkill('deep-interview');
|
||||
expect(second?.template).toContain('ambiguityThreshold = 0.33');
|
||||
expect(second?.template).toContain('Resolve `omc.deepInterview.ambiguityThreshold` into `0.33`');
|
||||
expect(second?.template).toContain('"threshold": 0.33,');
|
||||
expect(second?.template).not.toContain('ambiguityThreshold = 0.12');
|
||||
expect(second?.template).not.toContain('Resolve `omc.deepInterview.ambiguityThreshold` into `0.12`');
|
||||
expect(second?.template).not.toContain('"threshold": 0.12,');
|
||||
});
|
||||
|
||||
@@ -409,7 +409,7 @@ describe('Builtin Skills', () => {
|
||||
it('ships a config-aware deep-interview SKILL.md for native skill-loader paths (issue #2723)', () => {
|
||||
const raw = readFileSync(join(originalCwd, 'skills', 'deep-interview', 'SKILL.md'), 'utf-8');
|
||||
expect(raw).toContain('Load runtime settings');
|
||||
expect(raw).toContain('Read `~/.claude/settings.json` and `./.claude/settings.json`');
|
||||
expect(raw).toContain('Read `[$CLAUDE_CONFIG_DIR|~/.claude]/settings.json` and `./.claude/settings.json`');
|
||||
expect(raw).toContain('"threshold": <resolvedThreshold>,');
|
||||
expect(raw).toContain('ambiguity drops below <resolvedThresholdPercent>');
|
||||
expect(raw).toContain('Gate: ≤<resolvedThresholdPercent> ambiguity');
|
||||
|
||||
Reference in New Issue
Block a user