v0.1.2 — Handoff Prompt Enrichment
v0.1.2 — Handoff Prompt Enrichment
RU
В этом релизе улучшен UserPromptSubmit hook для handoff-режима Codex.
Что добавлено
handoff-intake-classifier.pyтеперь формирует не только intent/flags, но и более профессиональныйnormalized_task_briefдля implementation-запросов.- Для архитектурных запросов hook добавляет engineering vocabulary: root-cause analysis, architecture boundaries, typed contracts, canonical source of truth, call graph impact, migration/removal of obsolete paths, scoped verification.
- Добавлен deterministic repo profile из текущей рабочей директории:
- root и nearest-workspace
package.json; - runtime engines и
packageManager; - npm workspaces / monorepo layout;
- allowlist архитектурно значимых dependency versions: frameworks, backend, TypeScript, build tools, test/e2e, ORM/database, cache/queue, contracts/API, UI, quality, observability/logging;
AGENTS.mdправила, включая GitNexus impact analysis и detect_changes, если они есть в проекте.
- root и nearest-workspace
- Короткие follow-up prompts вроде
доработай,продолжай,ещё,тогда,сделай тактеперь могут использовать предыдущий локальный hook context перед вызовом LLM. - Добавлено приватное локальное state-хранилище для предыдущего prompt/context:
- сначала
~/.codex/private/handoff-classifier-state.json; - fallback
~/.codex/memories/handoff-classifier-state.json, если private path read-only; - override через
HANDOFF_CLASSIFIER_STATE_PATH; - state ограничен по размеру и пишется с правами
0600.
- сначала
- Добавлен redaction распространённых secrets перед повторным использованием контекста:
sk-*,OPENAI_API_KEY=...,TOKEN=...,Authorization: Bearer .... - Увеличен default LLM timeout до
4.0, чтобы расширенный prompt enrichment не откатывался в deterministic слишком часто. - README и README-RU обновлены под новый workflow.
Практический эффект
Фраза вроде доработай пожалуйста после предыдущей задачи больше не выглядит для classifier как пустой запрос. Hook подтягивает предыдущий локальный context и помогает модели понять, что именно нужно продолжать, сохраняя scope текущей сессии/репозитория.
Для проектов вроде Node/Nuxt hook теперь подставляет конкретный стек, например Nuxt/Vue/TypeScript/Vitest/Tailwind/Zod/Turbo версии, если они реально есть в package.json.
Проверка
python3 -m py_compile hooks/handoff-intake-classifier.py scripts/validate-pack.pypython3 scripts/validate-pack.pygit diff --check- ручной двухшаговый тест follow-up prompt: полный prompt ->
доработай пожалуйста - ручной тест repo profile для
selfystudio/apps/adminиselfystudio/packages/ai-prompts
EN
This release improves the Codex handoff UserPromptSubmit hook.
Added
handoff-intake-classifier.pynow emits not only intent/flags, but also a professionalnormalized_task_brieffor implementation prompts.- Architecture-grade prompts now receive engineering vocabulary: root-cause analysis, architecture boundaries, typed contracts, canonical source of truth, call graph impact, migration/removal of obsolete paths, and scoped verification.
- Added deterministic repo profile extraction from the current working directory:
- root and nearest-workspace
package.json; - runtime engines and
packageManager; - npm workspaces / monorepo layout;
- allowlisted architecture-significant dependency versions: frameworks, backend, TypeScript, build tools, test/e2e, ORM/database, cache/queue, contracts/API, UI, quality, observability/logging;
AGENTS.mdproject rules, including GitNexus impact analysis and detect_changes when present.
- root and nearest-workspace
- Short follow-up prompts like
доработай,продолжай,ещё,тогда, andсделай такcan now use the previous local hook context before calling the LLM. - Added private local state for the previous prompt/context:
- primary path:
~/.codex/private/handoff-classifier-state.json; - fallback path:
~/.codex/memories/handoff-classifier-state.jsonwhen the private path is read-only; - override via
HANDOFF_CLASSIFIER_STATE_PATH; - state is capped and written with
0600permissions.
- primary path:
- Added redaction for common secrets before context reuse:
sk-*,OPENAI_API_KEY=...,TOKEN=...,Authorization: Bearer .... - Raised the default LLM timeout to
4.0so richer prompt enrichment is less likely to fall back to deterministic mode. - Updated README and README-RU for the new workflow.
Practical impact
A phrase like доработай пожалуйста after a previous task no longer looks empty to the classifier. The hook uses previous local context to help the model understand what to continue while keeping scope anchored to the current session/repo.
For Node/Nuxt projects, the hook now injects the actual relevant stack, such as Nuxt/Vue/TypeScript/Vitest/Tailwind/Zod/Turbo versions, when those packages are present in package.json.
Verification
python3 -m py_compile hooks/handoff-intake-classifier.py scripts/validate-pack.pypython3 scripts/validate-pack.pygit diff --check- manual two-step follow-up prompt test: full prompt ->
доработай пожалуйста - manual repo profile tests for
selfystudio/apps/adminandselfystudio/packages/ai-prompts