Добавить financial flow hints для банковских контрагентов

This commit is contained in:
2026-05-13 00:57:59 +03:00
parent 9f62d3653f
commit e997449785
12 changed files with 475 additions and 45 deletions
@@ -88,7 +88,8 @@ Fresh validation cut:
- Current live canary: `phase96_inventory_reserve_liquidation_quality_rerun` accepted `2/2`.
- Current accepted autorun: `AGENT | Phase 96 inventory reserve/liquidation quality-events` (`gen-ag05122057-c9786e`).
- Implementation breadth: `~99% (Open-World Bounded Autonomy Breadth through Slice 25)`.
- Next active slice: start the broader open-world schema/primitive discovery module and use phase91-phase96 as regression canaries.
- Active broader autonomy slice: `Open-World Schema/Primitive Discovery`, starting with `Financial Counterparty Flow Hints`: bank-document money-flow recipes now expose operation/purpose/comment fields and ranked value-flow buckets carry `financial_flow_hint` so bank-like leaders are not treated as ordinary suppliers/customers by name alone.
- Next active slice: add live semantic replay around bank-like counterparty wording, then continue broader schema/primitive discovery while using phase91-phase96 as regression canaries.
- Active module progress: `~99% (Agentic Semantic Development Loop, accepted dogfood loop + autorun hygiene; manual GUI confirmation still required)`.
## Reporting Rule
@@ -101,6 +102,7 @@ Use these labels when reporting progress:
- `Прогресс модуля: 99% (Agentic Semantic Development Loop, accepted dogfood loop + autorun hygiene; manual GUI confirmation still required)` when discussing the current development-loop operating layer.
- `Прогресс модуля: 100% (Open-World Route Candidate Promotion, declared phase90 slice accepted)` when discussing the route-candidate handoff slice itself.
- `Прогресс модуля: 100% (Route-Candidate-Driven Enablement Loop, final reviewed proof-family route accepted; use as regression gate)` when discussing the current candidate-driven enablement loop.
- `Прогресс модуля: 12% (Open-World Schema/Primitive Discovery, active slice: financial counterparty flow hints)` when discussing the current broader schema/primitive discovery module.
- `Open-World Business Overview implementation breadth: ~99%, Semantic Control Gate critical subset accepted, fat GUI pack still pending` when discussing only the already wired Slice 25 breadth.
- `Прогресс модуля: X% (Open-World Bounded Autonomy Breadth, active slice: <name>)` for later breadth work after the Semantic Control Gate is accepted.
@@ -158,18 +160,19 @@ For current planning, read:
1. `README.md`
2. this document
3. `31 - inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md`
4. `30 - vendor_procurement_quality_reviewed_route_2026-05-12.md`
5. `29 - debt_due_date_aging_reviewed_route_2026-05-10.md`
6. `28 - accounting_profit_margin_reviewed_route_2026-05-10.md`
7. `27 - proof_family_enablement_candidates_2026-05-10.md`
8. `26 - route_candidate_driven_enablement_loop_2026-05-10.md`
9. `25 - open_world_route_candidate_promotion_2026-05-10.md`
10. `24 - agentic_semantic_development_loop_and_autorun_hygiene_2026-05-10.md`
11. `23 - current_execution_spine_and_semantic_control_gate_2026-05-05.md`
12. `22 - open_world_bounded_autonomy_breadth_2026-05-01.md`
13. `20 - planner_autonomy_consolidation_2026-05-01.md`
14. `19 - inventory_stock_open_world_breadth_proof_2026-05-01.md`
15. `17 - post_f_semantic_integrity_hardening_2026-04-23.md`
16. `16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md`
4. `32 - financial_counterparty_flow_hints_2026-05-13.md`
5. `30 - vendor_procurement_quality_reviewed_route_2026-05-12.md`
6. `29 - debt_due_date_aging_reviewed_route_2026-05-10.md`
7. `28 - accounting_profit_margin_reviewed_route_2026-05-10.md`
8. `27 - proof_family_enablement_candidates_2026-05-10.md`
9. `26 - route_candidate_driven_enablement_loop_2026-05-10.md`
10. `25 - open_world_route_candidate_promotion_2026-05-10.md`
11. `24 - agentic_semantic_development_loop_and_autorun_hygiene_2026-05-10.md`
12. `23 - current_execution_spine_and_semantic_control_gate_2026-05-05.md`
13. `22 - open_world_bounded_autonomy_breadth_2026-05-01.md`
14. `20 - planner_autonomy_consolidation_2026-05-01.md`
15. `19 - inventory_stock_open_world_breadth_proof_2026-05-01.md`
16. `17 - post_f_semantic_integrity_hardening_2026-04-23.md`
17. `16 - data_need_graph_and_open_world_mcp_plan_2026-04-22.md`
Documents `01` through `15` remain valuable, but mostly as the historical architecture trail.
@@ -0,0 +1,53 @@
# 32 - Financial Counterparty Flow Hints (2026-05-13)
This note opens the next broader autonomy slice after the closed `Route-Candidate-Driven Enablement Loop`.
The problem came from real business review: bank-like counterparties such as `СБЕРБАНК, ПАО` can dominate incoming or outgoing money-flow rankings. If the assistant treats that row as an ordinary customer or supplier, the business answer becomes misleading even when the amount itself is correct.
## Scope
The first cut adds reviewed document-field hints to bank-document money-flow routes:
- `bank_operations_by_counterparty` now keeps outgoing/incoming bank-document columns aligned across `ОБЪЕДИНИТЬ ВСЕ` while exposing operation type, payment purpose where available, and comment;
- `customer_revenue_and_payments` now includes incoming bank document `ВидОперации` and `Комментарий`;
- `supplier_payouts_profile` now includes outgoing bank document `ВидОперации`, `НазначениеПлатежа`, and `Комментарий`;
- ranked value-flow buckets now carry `financial_flow_hint`;
- current hints are `loan_or_credit` (including deposits/credit-like bank instruments), `bank_fee_or_service`, `tax_or_budget`, `payroll_or_social`, `supplier_payment`, and `unclear`;
- business-overview evidence can now say that a bank-like leader is a bank fee/service, credit/loan, tax/budget, payroll/social, or ordinary supplier-payment signal instead of using name-only caution.
## Validation
Local checks:
- `npm.cmd test -- assistantMcpDiscoveryPilotExecutor.test.ts assistantMcpDiscoveryAnswerAdapter.test.ts assistantMcpDiscoveryResponseCandidate.test.ts`: `97/97` passed, `1` skipped;
- `npm.cmd run build`: passed.
Live MCP checks:
- `bank_operations_by_counterparty` for `СБЕРБАНК` returned `fetched=593`, `matched=10`, `error=null`, proving the aligned bank-doc union executes with the enriched column set;
- `supplier_payouts_profile` for `СБЕРБАНК` returned `fetched=5`, `matched=5`, `error=null`;
- the live rows include `ВидОперации=Прочее списание` and `НазначениеПлатежа=Комиссия банка`;
- `customer_revenue_and_payments` for `СБЕРБАНК` returned `fetched=5`, `matched=5`, `error=null`;
- the live rows include incoming `ВидОперации`, including `Прочее поступление` and `Возврат от поставщика`.
## Status
Current module wording:
`Open-World Schema/Primitive Discovery, active slice: financial counterparty flow hints`
Progress: `12%`.
This is not a full financial-purpose classifier yet. It is the first reviewed primitive that lets downstream business answers avoid the worst bank-as-supplier/customer overclaim.
## Next Work
1. Add a small live semantic replay for bank-like counterparty wording in business overview.
2. Extend hints where real 1C rows expose more payment-purpose families.
3. Use this as the first canary for broader schema/primitive discovery after phase96.
See also:
- [21 - current_status_canon_2026-05-01.md](./21%20-%20current_status_canon_2026-05-01.md)
- [26 - route_candidate_driven_enablement_loop_2026-05-10.md](./26%20-%20route_candidate_driven_enablement_loop_2026-05-10.md)
- [31 - inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md](./31%20-%20inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md)
@@ -49,6 +49,7 @@ This package answers the next question:
29. [29 - debt_due_date_aging_reviewed_route_2026-05-10.md](./29%20-%20debt_due_date_aging_reviewed_route_2026-05-10.md)
30. [30 - vendor_procurement_quality_reviewed_route_2026-05-12.md](./30%20-%20vendor_procurement_quality_reviewed_route_2026-05-12.md)
31. [31 - inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md](./31%20-%20inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md)
32. [32 - financial_counterparty_flow_hints_2026-05-13.md](./32%20-%20financial_counterparty_flow_hints_2026-05-13.md)
## Current Status Snapshot (2026-05-12)
@@ -117,6 +118,7 @@ Status canon for planning:
- The second reviewed proof-family route slice is [29 - debt_due_date_aging_reviewed_route_2026-05-10.md](./29%20-%20debt_due_date_aging_reviewed_route_2026-05-10.md).
- The third reviewed proof-family route slice is [30 - vendor_procurement_quality_reviewed_route_2026-05-12.md](./30%20-%20vendor_procurement_quality_reviewed_route_2026-05-12.md).
- The fourth/final reviewed proof-family route slice is [31 - inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md](./31%20-%20inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md).
- The current broader schema/primitive discovery slice is [32 - financial_counterparty_flow_hints_2026-05-13.md](./32%20-%20financial_counterparty_flow_hints_2026-05-13.md).
It now documents a turnaround that is already operational in code, already materially past the acute regression breakpoint, and already moved through bounded MCP autonomy, Post-F hardening, inventory breadth proof, and the declared Planner Autonomy slice:
@@ -187,6 +189,7 @@ Current honest status:
- Planner Autonomy Consolidation progress: `100%` for the declared module, with catalog-fabric, value-flow arbitration, lifecycle bounded inference, broad-evaluation bridge, inventory catalog templates, inventory runtime-boundary honesty, exact inventory recipe bridging, unambiguous metadata-surface lane inference, catalog chain-template scoring, structured chain-match contract exposure, runtime/debug propagation, subject-aware bidirectional comparison arbitration, structured catalog-alignment verdicts, representative alignment regression guard, catalog-alignment reason-code telemetry, explicit `alignment_status` propagation, truth-harness/acceptance-matrix surfacing, soft divergence warning, `catalog_alignment_ok` acceptance invariant, step-level expected catalog-alignment assertions, phase66 and phase32 spec alignment expectations, AGENT source-catalog surfacing, generated phase83 mixed planner-brain replay spec, checked-source user-facing error sanitation, surface-grounded catalog promotion, and guarded live phase83 acceptance validated. Broader unfamiliar 1C asks are now next-module breadth work rather than an open blocker inside this declared slice
- Open-World Route Candidate Promotion progress: `100%` for the declared phase90 slice, with structured `route_candidate` runtime contract, artifact propagation, live semantic replay accepted at `5/5`, and accepted AGENT autorun persistence; broader autonomous route enablement remains the next active slice
- Route-Candidate-Driven Enablement Loop progress: `100%`, with deterministic repair-target grouping, Lead Codex handoff surfacing, local tooling tests, live phase91 canary acceptance, phase92 proof-family candidates accepted/saved as a user-runnable AGENT autorun, `accounting_profit_margin` promoted into reviewed 90/91/99 execution by phase93 live replay, `debt_due_date_aging_quality` promoted into reviewed payment-term/open-balance execution by phase94 live replay, `vendor_risk_procurement_quality` promoted into reviewed procurement-concentration evidence by phase95 live replay, and `inventory_reserve_liquidation_quality` promoted into reviewed inventory quality-event evidence by phase96 live replay; the declared route-candidate-driven enablement loop is now closed and should be used as a regression gate for the next broader autonomy slice
- Open-World Schema/Primitive Discovery progress: `12%`, active slice `financial counterparty flow hints`; bank-document money-flow recipes now expose operation/purpose/comment fields, ranked value-flow buckets carry `financial_flow_hint`, and Sberbank-like leaders can be treated as bank fee/service, credit/loan, tax/budget, payroll/social, supplier-payment, or unclear evidence instead of name-only supplier/customer overclaim.
- graph snapshot after latest rebuild: see `graphify-out/GRAPH_REPORT.md`
- current regression-gate breakpoint:
- the validated hot paths are no longer structurally broken;
@@ -357,6 +360,7 @@ Read in this order:
30. `29 - debt_due_date_aging_reviewed_route_2026-05-10.md`
31. `30 - vendor_procurement_quality_reviewed_route_2026-05-12.md`
32. `31 - inventory_reserve_liquidation_quality_reviewed_route_2026-05-12.md`
33. `32 - financial_counterparty_flow_hints_2026-05-13.md`
## Planning Rules