Этап 4 / Волна 11: объектный трейс по бизнес-якорям, доменное заземление, cleanup утечки дебага

This commit is contained in:
2026-03-28 13:12:09 +03:00
parent 553a5c407a
commit 8b84f5e989
34 changed files with 5517 additions and 173 deletions
@@ -627,8 +627,14 @@ function inferLifecycleDomain(input: LifecycleResolverInput): LifecycleDomain {
.join(" ")
.toLowerCase();
const hasExplicitVatHint = includesAny(unitTokens, [/domain_hint:vat_flow/]);
const hasExplicitDeferredHint = includesAny(unitTokens, [/domain_hint:deferred_expense/]);
const hasExplicitFixedAssetHint = includesAny(unitTokens, [/domain_hint:fixed_asset/]);
const hasExplicitPeriodCloseHint = includesAny(unitTokens, [/domain_hint:period_close/]);
const hasCustomerSettlementHint = includesAny(unitTokens, [/domain_hint:customer_settlement/]);
const hasBankSettlementHint = includesAny(unitTokens, [/domain_hint:bank_settlement/]);
const hasVatMarkers = includesAny(unitTokens, [
/domain_hint:vat_flow/,
/\binvoice_to_vat\b/,
/\bvat_chain_conflict\b/,
/(^|[^a-z0-9])nds([^a-z0-9]|$)/,
@@ -637,7 +643,6 @@ function inferLifecycleDomain(input: LifecycleResolverInput): LifecycleDomain {
/\baccount[_:\s-]?(19|68)\b/
]);
const hasDeferredMarkers = includesAny(unitTokens, [
/domain_hint:deferred_expense/,
/\bdeferred(?:_expense)?\b/,
/\bdeferred_expense_to_writeoff\b/,
/\bwriteoff\b/,
@@ -646,7 +651,6 @@ function inferLifecycleDomain(input: LifecycleResolverInput): LifecycleDomain {
/\baccount[_:\s-]?97\b/
]);
const hasFixedAssetMarkers = includesAny(unitTokens, [
/domain_hint:fixed_asset/,
/\bfixed[_\s-]?asset(?:s)?\b/,
/\basset_card_to_depreciation\b/,
/\bdepreciation(?:_active)?\b/,
@@ -655,7 +659,6 @@ function inferLifecycleDomain(input: LifecycleResolverInput): LifecycleDomain {
/\baccount[_:\s-]?(01|02|08)\b/
]);
const hasPeriodCloseMarkers = includesAny(unitTokens, [
/domain_hint:period_close/,
/\bperiod[_\s-]?close\b/,
/\bperiod_close_risk\b/,
/\bclose[_\s-]?risk\b/,
@@ -665,6 +668,25 @@ function inferLifecycleDomain(input: LifecycleResolverInput): LifecycleDomain {
/\bperiod_risk\b/
]);
if (hasExplicitDeferredHint) {
return "deferred_expense";
}
if (hasExplicitFixedAssetHint) {
return "fixed_asset";
}
if (hasExplicitVatHint) {
return "vat_flow";
}
if (hasExplicitPeriodCloseHint) {
return "period_close";
}
if (hasCustomerSettlementHint) {
return "customer_settlement";
}
if (hasBankSettlementHint) {
return "bank_settlement";
}
if (hasDeferredMarkers) {
return "deferred_expense";
}