Commit graph

3 commits

Author SHA1 Message Date
Gros Frumos
01c39cc45c kin: KIN-045 добавить в GUI третью кнопку Revise (🔄) рядом с Approve/Reject. Revise = вернуть задачу агенту с комментарием человека. Модалка с textarea 'что доисследовать/доработать'. Задача возвращается в in_progress, агент получает свой предыдущий output + комментарий директора и дорабатывает 2026-03-16 07:21:36 +02:00
johnfrum1234
c129cf9d95 Fix output truncation bug, add language support for agent responses
Bug 1 — Output truncation:
  _run_claude() was replacing raw stdout with parsed sub-field which
  could be a dict (not string). run_agent() then saved dict.__repr__
  to DB instead of full JSON. Fixed: _run_claude() always returns
  string output; run_agent() ensures string before DB write.
  Added tests: full_output_saved_to_db, dict_output_saved_as_json_string.

Bug 2 — Language support:
  Added projects.language column (TEXT DEFAULT 'ru').
  Auto-migration for existing DBs (ALTER TABLE ADD COLUMN).
  context_builder passes language in project context.
  format_prompt() appends "## Language\nALWAYS respond in {language}"
  at the end of every prompt.
  CLI: kin project add --language ru (default: ru).
  Tests: language in prompt for ru/en, project creation, context.

112 tests, all passing. ~/.kin/kin.db migrated (vdol: language=ru).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 14:39:33 +02:00
johnfrum1234
fabae74c19 Add context builder, agent runner, and pipeline executor
core/context_builder.py:
  build_context() — assembles role-specific context from DB.
  PM gets everything; debugger gets gotchas/workarounds; reviewer
  gets conventions only; tester gets minimal context; security
  gets security-category decisions.
  format_prompt() — injects context into role templates.

agents/runner.py:
  run_agent() — launches claude CLI as subprocess with role prompt.
  run_pipeline() — executes multi-step pipelines sequentially,
  chains output between steps, logs to agent_logs, creates/updates
  pipeline records, handles failures gracefully.

agents/specialists.yaml — 8 roles with tools, permissions, context rules.
agents/prompts/pm.md — PM prompt for task decomposition.
agents/prompts/security.md — security audit prompt (OWASP, auth, secrets).

CLI: kin run <task_id> [--dry-run]
  PM decomposes → shows pipeline → executes with confirmation.

31 new tests (15 context_builder, 11 runner, 5 JSON parsing).
92 total, all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 14:03:32 +02:00