Skip to content

Параметры следует брать из одноименной задачи или операции в шаблоне#14

Merged
ideav merged 3 commits intoideav:mainfrom
konard:issue-13-bd95fa29e808
Dec 4, 2025
Merged

Параметры следует брать из одноименной задачи или операции в шаблоне#14
ideav merged 3 commits intoideav:mainfrom
konard:issue-13-bd95fa29e808

Conversation

@konard
Copy link
Copy Markdown
Contributor

@konard konard commented Dec 4, 2025

📋 Описание

Эта PR реализует решение для issue #13: параметры теперь берутся из одноименных задач или операций в шаблоне проекта, с правильной логикой fallback.

Fixes #13

🔍 Код доступа к шаблонным параметрам

В project-scheduler.js следующий код обращается к шаблонным параметрам:

  1. Строки 128-216: функция buildTemplateLookup()

    • Строит карты (Maps) с параметрами из шаблона
    • Добавляет taskParameters и operationParameters в templateMap
    • Логирует добавленные параметры для задач и операций
  2. Строки 241-305: функция getItemParameters()

    • Получает параметры с приоритетной логикой разрешения
    • Для операций:
      1. Параметры операции из шаблона (по имени операции)
      2. Параметры задачи из шаблона (fallback)
      3. Текущие параметры операции
      4. Текущие параметры задачи (fallback)
    • Для задач:
      1. Параметры задачи из шаблона (по имени задачи)
      2. Текущие параметры задачи
  3. Строка 800: функция scheduleTasks()

    • Вызывает getItemParameters() для определения параметров

✨ Изменения

1. Расширение buildTemplateLookup()

  • Добавлены карты taskParameters и operationParameters
  • Параметры из шаблона сохраняются по имени задачи/операции
  • Обновлены логи для отображения количества загруженных параметров

2. Новая функция getItemParameters()

  • Реализует приоритетную логику получения параметров
  • Сначала ищет в шаблоне, потом fallback на текущие значения
  • Детальное логирование источника параметров

3. Упрощение scheduleTasks()

  • Заменен inline код на вызов getItemParameters()
  • Код стал более читаемым и поддерживаемым

4. Обновление тестов

  • experiments/test-parameter-fallback.js полностью переписан
  • Тестирует все сценарии с template lookup
  • Все 8 тестов проходят успешно ✅

🧪 Тестирование

$ node experiments/test-parameter-fallback.js
=== Testing Parameter Fallback Logic with Template Lookup ===

Test 1: Operation with template operation parameters - ✓ PASSED
Test 2: Operation with no template operation params - ✓ PASSED
Test 3: Operation with template operation params overriding - ✓ PASSED
Test 4: Operation with no template, fallback to current - ✓ PASSED
Test 5: Operation fallback to current task params - ✓ PASSED
Test 6: Task with template parameters - ✓ PASSED
Test 7: Task with no template, use current - ✓ PASSED
Test 8: All parameters empty - ✓ PASSED

Total: 8, Passed: 8, Failed: 0
✓ All tests passed!

📝 Примеры использования

Пример 1: Операция с параметрами из шаблона

  • Шаблон: "Получение реперных точек" имеет параметры 740:%(-)
  • Проект: Операция "Получение реперных точек" без параметров
  • Результат: Используются параметры 740:%(-) из шаблона

Пример 2: Операция без параметров в шаблоне

  • Шаблон: Задача "Проверка документации" имеет параметры 115:849(-),2673:(4-)
  • Проект: Операция без собственных параметров
  • Результат: Используются параметры задачи из шаблона

🤖 Generated with Claude Code

konard and others added 2 commits December 4, 2025 07:18
Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: ideav/orbits#13
This commit implements the solution for issue #13, which requires
parameters to be taken from the template task or operation with the
same name, with proper fallback logic.

Changes:
1. Updated buildTemplateLookup() to store template parameters for both
   tasks and operations from the template project
2. Added new function getItemParameters() with priority-based parameter
   resolution:
   - For operations: template operation params → template task params →
     current operation params → current task params
   - For tasks: template task params → current task params
3. Simplified scheduleTasks() to use the new getItemParameters() function
4. Updated test-parameter-fallback.js to test all parameter resolution
   scenarios with template lookup

The code in project-scheduler.js that accesses template parameters is:
- Lines 128-216: buildTemplateLookup() builds Maps with template parameters
- Lines 241-305: getItemParameters() retrieves parameters with proper fallback
- Line 800: scheduleTasks() calls getItemParameters() to determine parameters

All 8 test cases pass successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Параметры следует брать из одноименной задачи или операции в шаблоне Параметры следует брать из одноименной задачи или операции в шаблоне Dec 4, 2025
@konard konard marked this pull request as ready for review December 4, 2025 07:23
@konard
Copy link
Copy Markdown
Contributor Author

konard commented Dec 4, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $0.473154 USD
  • Calculated by Anthropic: $1.126482 USD
  • Difference: $0.653328 (+138.08%)
    📎 Log file uploaded as GitHub Gist (808KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Параметры следует брать из одноименной задачи или операции в шаблоне

2 participants