Развить агентную semantic loop систему
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"pack_id": "agentic_semantic_development_loop_stage_pack",
|
||||
"domain": "agentic_semantic_development_loop_control",
|
||||
"title": "Agentic semantic development loop control pack",
|
||||
"description": "Compact stage pack for dogfooding the agentic development loop against business-overview, VAT, stale-scope, and legacy-canary questions.",
|
||||
"description": "Stage pack for dogfooding the agentic development loop against business overview, VAT, stale scope, counterparty pivots, legacy route canaries, and answer-shape quality.",
|
||||
"analysis_context": {
|
||||
"as_of_date": "2026-05-09",
|
||||
"source": "agentic_semantic_development_loop_stage_pack"
|
||||
@@ -15,15 +15,17 @@
|
||||
},
|
||||
"scenarios": [
|
||||
{
|
||||
"scenario_id": "agentic_loop_business_overview_control",
|
||||
"scenario_id": "biz_scope",
|
||||
"title": "Business overview and stale-scope control",
|
||||
"description": "Checks direct business-answer shape, period carryover, all-time reset, VAT boundary, and organization scope hygiene.",
|
||||
"steps": [
|
||||
{
|
||||
"step_id": "step_01_business_overview",
|
||||
"step_id": "s01_biz",
|
||||
"title": "Business overview for explicit period",
|
||||
"node_role": "root",
|
||||
"question": "Дай взрослый бизнес-обзор {{bindings.main_organization}} за {{bindings.control_year}} год по данным 1С: обороты, входящие и исходящие деньги, нетто, НДС, долги, склад, клиенты, поставщики и что пока нельзя утверждать.",
|
||||
"expected_intents": ["business_overview"],
|
||||
"semantic_tags": ["business_overview", "money", "vat", "debt", "inventory", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first",
|
||||
"forbidden_answer_patterns": [
|
||||
"(?i)capability_id",
|
||||
@@ -33,45 +35,51 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"step_id": "step_02_money_followup",
|
||||
"step_id": "s02_money",
|
||||
"title": "Money follow-up",
|
||||
"question": "Раскрой деньги подробнее: сколько получили, сколько заплатили, какой чистый денежный поток, кто главный клиент и главный поставщик в {{bindings.control_year}}.",
|
||||
"depends_on": ["step_01_business_overview"],
|
||||
"depends_on": ["s01_biz"],
|
||||
"semantic_tags": ["money", "counterparty"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "step_03_best_year_all_time",
|
||||
"step_id": "s03_best_year",
|
||||
"title": "All-time best operating-flow year",
|
||||
"question": "А если смотреть за все доступное время, какой самый доходный год по подтвержденным оборотам и почему? Не называй это бухгалтерской прибылью, если чистой прибыли нет.",
|
||||
"depends_on": ["step_02_money_followup"],
|
||||
"depends_on": ["s02_money"],
|
||||
"semantic_tags": ["money", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "step_04_vat_explicit_period",
|
||||
"step_id": "s04_vat",
|
||||
"title": "VAT explicit period",
|
||||
"question": "Что с НДС за {{bindings.control_year}} год по {{bindings.main_organization}}: какая позиция видна, на чем она основана и чего не хватает для налогового вывода?",
|
||||
"depends_on": ["step_03_best_year_all_time"],
|
||||
"depends_on": ["s03_best_year"],
|
||||
"semantic_tags": ["vat", "documents", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "step_05_all_time_no_vat_carryover",
|
||||
"step_id": "s05_all_time",
|
||||
"title": "All-time reset without stale VAT carryover",
|
||||
"question": "Теперь за все доступное время дай обзор компании в целом, но не тащи НДС за {{bindings.control_year}} как подтвержденную общую налоговую позицию.",
|
||||
"depends_on": ["step_04_vat_explicit_period"],
|
||||
"depends_on": ["s04_vat"],
|
||||
"semantic_tags": ["business_overview", "vat", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scenario_id": "agentic_loop_counterparty_pivot_control",
|
||||
"scenario_id": "svk_pivot",
|
||||
"title": "Counterparty pivot and legacy canaries",
|
||||
"description": "Checks explicit counterparty arbitration after organization context and keeps technical/debug details out of the final answer.",
|
||||
"steps": [
|
||||
{
|
||||
"step_id": "step_01_svk_money",
|
||||
"step_id": "s01_svk_money",
|
||||
"title": "Explicit counterparty money flow",
|
||||
"question": "Теперь отдельно по контрагенту {{bindings.svk_counterparty}}: сколько денег прошло, что входящее, что исходящее и есть ли документы или движения, на которых это основано?",
|
||||
"node_role": "root",
|
||||
"question": "Отдельно по контрагенту {{bindings.svk_counterparty}}, без опоры на прошлый диалог: сколько денег прошло, что входящее, что исходящее и есть ли документы или движения, на которых это основано?",
|
||||
"expected_intents": ["value_flow"],
|
||||
"semantic_tags": ["counterparty", "money", "documents", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first",
|
||||
"forbidden_answer_patterns": [
|
||||
"(?i)capability_id",
|
||||
@@ -81,17 +89,66 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"step_id": "step_02_svk_documents",
|
||||
"step_id": "s02_svk_docs",
|
||||
"title": "Counterparty documents follow-up",
|
||||
"question": "Покажи документы по этой цепочке и не смешивай {{bindings.svk_counterparty}} с организацией {{bindings.main_organization}}.",
|
||||
"depends_on": ["step_01_svk_money"],
|
||||
"depends_on": ["s01_svk_money"],
|
||||
"semantic_tags": ["counterparty", "documents", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "step_03_final_summary",
|
||||
"step_id": "s03_summary",
|
||||
"title": "Final executive summary",
|
||||
"question": "Собери короткий итог: что мы подтвердили по компании, что отдельно по {{bindings.svk_counterparty}}, какие выводы можно делать и какие нельзя.",
|
||||
"depends_on": ["step_01_svk_money", "step_02_svk_documents"],
|
||||
"depends_on": ["s01_svk_money", "s02_svk_docs"],
|
||||
"semantic_tags": ["business_overview", "counterparty", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first",
|
||||
"required_answer_patterns_all": [
|
||||
"СВК",
|
||||
"компан"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"scenario_id": "legacy_canaries",
|
||||
"title": "Legacy route canaries and context interruptions",
|
||||
"description": "Keeps old deterministic routes and conversational interruptions in the stage pack so new agentic loop wiring does not hide regressions.",
|
||||
"steps": [
|
||||
{
|
||||
"step_id": "s01_memory",
|
||||
"title": "Memory checkpoint after prior business context",
|
||||
"node_role": "root",
|
||||
"question": "Сделай короткий стартовый чек контекста: есть ли уже выбранная компания или контрагент в текущем диалоге; если нет, скажи честно и не выдумывай память про {{bindings.svk_counterparty}}.",
|
||||
"semantic_tags": ["memory", "business_overview", "counterparty", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first",
|
||||
"forbidden_answer_patterns": [
|
||||
"(?i)capability_id",
|
||||
"(?i)runtime_"
|
||||
]
|
||||
},
|
||||
{
|
||||
"step_id": "s02_acc60",
|
||||
"title": "Account 60 tail legacy canary",
|
||||
"question": "Покажи хвосты по счету 60 на август {{bindings.control_year}} по {{bindings.main_organization}}; если точных данных нет, скажи это прямо и не подменяй ответ общим обзором.",
|
||||
"depends_on": ["s01_memory"],
|
||||
"semantic_tags": ["debt", "documents", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "s03_stock",
|
||||
"title": "Inventory route canary",
|
||||
"question": "Что было на складе на март 2021 по доступным данным? Дай прямой ответ и не уводи его в контрагента {{bindings.svk_counterparty}}.",
|
||||
"depends_on": ["s02_acc60"],
|
||||
"semantic_tags": ["inventory", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
},
|
||||
{
|
||||
"step_id": "s04_all_money",
|
||||
"title": "All-money answer without counterparty leakage",
|
||||
"question": "Вернись к {{bindings.main_organization}}: сколько всего денег получили и заплатили по всем подтвержденным данным, но не смешивай это с отдельной цепочкой {{bindings.svk_counterparty}} и не называй оборот чистой прибылью.",
|
||||
"depends_on": ["s03_stock"],
|
||||
"semantic_tags": ["money", "business_overview", "counterparty", "scope_guard"],
|
||||
"required_answer_shape": "direct_answer_first"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -6,7 +6,7 @@ This repository now supports two outer-loop capture modes:
|
||||
- `run-case` for one concrete domain question;
|
||||
- `run-scenario` for a linked multi-step domain chain that should reuse one assistant session.
|
||||
- `run-pack` for a whole domain question pool grouped into several scenarios.
|
||||
- `run-pack-loop` for an autonomous analyst/coder loop over a whole domain pack.
|
||||
- `run-pack-loop` for a strong analyst review loop over a whole domain pack, with Lead Codex repair handoff by default.
|
||||
|
||||
`run-scenario` is the preferred capture mode for domains where the user's next question depends on the previous result set.
|
||||
`run-pack` is the preferred capture mode when the user brings a full domain pool that should be kept in one aggregate backlog.
|
||||
@@ -80,7 +80,7 @@ That path is explicitly marked as unvalidated and must not be treated as semanti
|
||||
|
||||
1. take the current global/local stage manifest;
|
||||
2. run `scripts/domain_case_loop.py run-pack-loop` for that stage pack;
|
||||
3. let the loop iterate through pack replay, business-first analyst verdict, coder patch, and rerun until the objective gate is accepted, blocked, or a real user decision is required;
|
||||
3. let the loop run pack replay and a business-first analyst verdict; if the gate is not accepted, write `business_audit.md` and `lead_coder_handoff.md` instead of launching a weak coder by default;
|
||||
4. if accepted, persist the validated AGENT pack into GUI autoruns through `scripts/save_agent_semantic_run.py --validated-run-dir`;
|
||||
5. write `stage_loop_summary.json` and `stage_loop_handoff.md` for the final human visual confirmation.
|
||||
|
||||
@@ -92,6 +92,7 @@ Canonical commands:
|
||||
```powershell
|
||||
python scripts/stage_agent_loop.py plan --manifest docs/orchestration/<stage_loop>.json
|
||||
python scripts/stage_agent_loop.py run --manifest docs/orchestration/<stage_loop>.json
|
||||
python scripts/stage_agent_loop.py review-questions --manifest docs/orchestration/<stage_loop>.json
|
||||
python scripts/stage_agent_loop.py ingest-gui-run --manifest docs/orchestration/<stage_loop>.json --run-id assistant-stage1-<id>
|
||||
python scripts/stage_agent_loop.py prepare-repair --manifest docs/orchestration/<stage_loop>.json
|
||||
python scripts/stage_agent_loop.py run-repair --manifest docs/orchestration/<stage_loop>.json --dry-run
|
||||
@@ -100,7 +101,28 @@ python scripts/stage_agent_loop.py continue --manifest docs/orchestration/<stage
|
||||
python scripts/stage_agent_loop.py summarize --manifest docs/orchestration/<stage_loop>.json
|
||||
```
|
||||
|
||||
This is the intended path for “implement the stage, generate/check stage questions, analyze business answers, patch code, rerun, then ask the user for final visual confirmation”.
|
||||
This is the intended path for "implement the stage, generate/check stage questions, analyze business answers, patch code, rerun, then ask the user for final visual confirmation".
|
||||
|
||||
The default repair mode is `lead-handoff`. In this mode the expensive replay still runs live and the independent analyst still produces the strict business verdict, but code repair stays with the main Lead Codex context. The loop stops with `next_action = lead_coder_repair_required`, plus:
|
||||
|
||||
- `business_audit.md` for the user-facing semantic/business verdict;
|
||||
- `lead_coder_handoff.md/json` for the concrete repair target, candidate files, and validation path;
|
||||
- `stage_context_capsule.md/json` for the current stage contract, question quality, loop status, and operating model.
|
||||
|
||||
`auto-coder` remains available only as an explicit opt-in experiment:
|
||||
|
||||
```powershell
|
||||
python scripts/stage_agent_loop.py run --manifest docs/orchestration/<stage_loop>.json --repair-mode auto-coder
|
||||
```
|
||||
|
||||
That path must not be treated as the normal high-trust repair mode for this project.
|
||||
|
||||
Before launching an expensive live replay, run `review-questions`. It reads the stage pack, resolves `{{bindings.*}}` placeholders, checks scenario/follow-up density, direct-answer shape declarations, domain coverage, stale-scope canaries, dependency order, duplicates, mojibake in generated Russian questions, and estimated Windows artifact path length. It writes:
|
||||
|
||||
- `question_generation_review.json`;
|
||||
- `question_generation_review.md`.
|
||||
|
||||
A strong question review is not semantic proof that the assistant answers correctly. It is the pre-flight gate that says the generated questions are worth spending a live replay on.
|
||||
|
||||
## GUI run review bridge
|
||||
|
||||
@@ -128,7 +150,7 @@ This bridge is intentionally business-first:
|
||||
- noisy direct answers, missing first-line answers, technical garbage, and over-broad business answers become findings;
|
||||
- generated question packs get a deterministic quality review for follow-up density, direct questions, report-style analysis, domain diversity, duplicates, and weak business anchors.
|
||||
|
||||
Use this bridge when the operator would otherwise say “чекни прогон `assistant-stage1-...`”. The expected next step is no longer manual eyeballing first; it is: review by id, inspect `run_review.md`, map `repair_targets.json` into the current stage loop, patch, and rerun.
|
||||
Use this bridge when the operator would otherwise say "чекни прогон `assistant-stage1-...`". The expected next step is no longer manual eyeballing first; it is: review by id, inspect `run_review.md`, map `repair_targets.json` into the current stage loop, patch, and rerun.
|
||||
|
||||
For stage work, prefer the integrated command:
|
||||
|
||||
@@ -149,6 +171,8 @@ Use `python scripts/stage_agent_loop.py continue --manifest docs/orchestration/<
|
||||
|
||||
It also writes `stage_repair_handoff.md/json` next to the stage summary. That handoff is the preferred input for the next coder pass: it lists primary repair targets and sample user-facing failures without forcing the coder to reread the entire GUI conversation first.
|
||||
|
||||
For live stage-pack failures, prefer `lead_coder_handoff.md` over immediately preparing a coder pass. The intent is: strong business audit first, Lead Codex code repair second, same replay/GUI validation third.
|
||||
|
||||
To prepare the next repair iteration from that handoff, run:
|
||||
|
||||
```powershell
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"module_name": "Agentic Semantic Development Loop",
|
||||
"title": "Agentic semantic development loop dogfood gate",
|
||||
"architecture_phase": "turnaround_11_agentic_semantic_development_loop",
|
||||
"agent_focus": "Automate stage implementation, semantic replay review, repair handoff, coder pass, rerun validation, and final human confirmation.",
|
||||
"agent_focus": "Automate stage question review, live semantic replay, strong business audit, Lead Codex repair handoff, rerun validation, and final human confirmation.",
|
||||
"current_stage_status": "active_dogfood",
|
||||
"global_plan_refs": [
|
||||
"docs/orchestration/domain_scenario_loop_repo_adapter.md",
|
||||
@@ -12,12 +12,16 @@
|
||||
"AGENTS.md codex_domain_loop and agent_semantic_runs"
|
||||
],
|
||||
"pack_manifest": "docs/orchestration/agentic_semantic_development_loop_stage_pack.json",
|
||||
"loop_id": "agentic_semantic_development_loop",
|
||||
"loop_id": "asl",
|
||||
"artifact_path_warning_limit": 240,
|
||||
"target_score": 88,
|
||||
"max_iterations": 6,
|
||||
"repair_mode": "lead-handoff",
|
||||
"acceptance_invariants": [
|
||||
"status command exposes next_action, repair state, validation state, and closing gate",
|
||||
"run-pack-loop defaults to Lead Codex handoff instead of weak autonomous coding",
|
||||
"continue command never runs the real coder pass without --execute-repair",
|
||||
"business_audit.md and lead_coder_handoff.md are produced before code repair when semantic replay is not accepted",
|
||||
"patched repair cannot close the stage without successful rerun/ingest validation",
|
||||
"business answers remain direct, context-aware, and free of internal route/debug ids",
|
||||
"manual GUI confirmation remains required after accepted semantic replay"
|
||||
|
||||
Reference in New Issue
Block a user