feat: complete pre-ai local completion v3

This commit is contained in:
OpenCode
2026-09-21 16:30:27 -03:00
parent 6731eeca08
commit 84b08c2150
41 changed files with 4141 additions and 9 deletions
+22
View File
@@ -422,3 +422,25 @@ Pilot profile: CONSTRUCAO (`pilot-construcao.env.example`); planned, not install
## Local Completion V2 (2026-09-20)
Audit outcome in `docs/LOCAL_COMPLETION_V2_REPORT.md`: origin rule invalid → rolled back (35,048); CFOP/IPPT weak-evidence writes rolled back; role no longer inferred from PROD_COZINHA alone; SPED 4.3.x dataset in `docs/sources/`; PIS/COFINS Simples rule from ERP emission evidence; questionnaire V2 (`docs/LOCAL_FISCAL_CONTEXT_QUESTIONS_V2.*`). Rollback tool: `scripts/rollback_field.py`; audit: `scripts/audit_local_writes.py`.
## Local Completion V3 Operations
Tasks 8-10 are CLI-first and review-first: company/group answers are validated
locally and emitted as JSON/CSV without import or Firebird writes; `MIXED_OR_DYNAMIC`
never invents a static entry CFOP; `STORE_IPI_PROFILE` requires an explicit choice
and produces only a rollback plan. Rollback previews are scoped by run, database,
field, and product and refuse drift where current differs from the audited after
value. `scripts/run_local_validation.py` and `scripts/generate_local_health.py`
are deterministic and emit `docs/LOCAL_PRODUCT_HEALTH_V1.json` with measured counts.
## PRE-AI Local Completion V3 (2026-09-21)
Offline completion is operationally ready. `DeterministicFakeSemanticProvider`
and the ID-correlated batch runner cover batch sizes 5/10/20 plus contract and
transport failures; budget, cache-key, dataset-drift, and zero-write E2E tests
are present. KB conflict audit is conservative: 90 observable GTIN/NCM conflicts
remain `NCM_CONFLICT`; 73 historical conflicts are explicitly uncovered by the
seed payload. Canonical identity is deterministic and excludes tenant fiscal
context. Retrieval V3 evidence hooks exist but V2 remains active until a full
untouched holdout replay proves no regression. Human/group questionnaire CLIs,
guarded rollback preview, local validation, and health report are available.
See `docs/PRE_AI_LOCAL_COMPLETION_V3_REPORT.md` for measured values.
+29
View File
@@ -0,0 +1,29 @@
{
"artifact": "AI_RESIDUAL_PLAN_V3",
"work_items_before": 750,
"work_items_after": 750,
"llm_items_before": 511,
"llm_items_after": 511,
"llm_reclassification": "UNCHANGED_PENDING_FINAL_PROVIDER_SELECTION",
"by_task_type": {
"EX_TIPI": {
"items": 112,
"cells": 4130
},
"CEST": {
"items": 353,
"cells": 2045
},
"PRODUCT_ROLE": {
"items": 41,
"cells": 482
},
"INVALID_NCM": {
"items": 244,
"cells": 1970
}
},
"canonical_observation_keys": 35065,
"ai_write_allowed": false,
"semantic_decisions": 0
}
+912
View File
@@ -0,0 +1,912 @@
{
"artifact": "KB_CONFLICT_AUDIT_V1",
"historical_conflicts_reported": 163,
"observable_conflicts_audited": 90,
"unobservable_historical_conflicts": 73,
"classification_counts": {
"NCM_CONFLICT": 90
},
"conflicts": [
{
"identity": "7908429102622",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"40169990",
"87141000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898324238536",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85393100",
"85393111"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898324002410",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85393100",
"85393111"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "4047025341110",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"27101932",
"38190000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "4047025341127",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"27101932",
"38190000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898227950016",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"27101932",
"28070010"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891117007128",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82015000",
"82130000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891117097921",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82015000",
"82130000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899882310993",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"38101010",
"85094020"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891114063523",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82041100",
"95051000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891117003144",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"72162100",
"82014000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7909224158333",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"64019200",
"73269090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898042710352",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"38089198",
"38089199"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898049710157",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22011000",
"38089192"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896673107206",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"38245000",
"68052000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896673107213",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"38245000",
"68052000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899737517201",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82014000",
"82019000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7892679250021",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22011000",
"87141000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7892679200361",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"21039021",
"87141000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898994318712",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"07096000",
"82084000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891114093155",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"07049000",
"82041100"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898904146206",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"38085910",
"38089119"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891114010961",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82054000",
"95030080"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "042526906268",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"39241000",
"82023900"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898635500261",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85043111",
"85043211"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898635500254",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85043111",
"85043211"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891638013240",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"82041100",
"82055900"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898567460923",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"30049054",
"30049059"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898049717866",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"30042099",
"39241000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899452019837",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85395200",
"94054200"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7897013586231",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85395200",
"85437099"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7897013586255",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85395200",
"85437099"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899882311990",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"84145110",
"84145190"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899882313840",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"84145110",
"84145990"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891579218438",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"21039021",
"87141000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898904869044",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"35061010",
"35061090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898314110248",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"32141010",
"35069110"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898543381082",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"32082019",
"32082020"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899882311013",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"17041000",
"85094020"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898059547439",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"39221000",
"39229000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898485610929",
"classification": "NCM_CONFLICT",
"observations": 3,
"ncms": [
"85119000",
"85365090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898543382348",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22084000",
"32082019"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898006193535",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22030000",
"30043210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898254040155",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"30043210",
"30049063"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898254040193",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"30043210",
"30049063"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896587020066",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"32081020",
"32091010"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899128813080",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"40139000",
"87141000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898314110255",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"32141010",
"35069110"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891040004973",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"35061090",
"35069110"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898010801181",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"84818019",
"84818099"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7899085402839",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"39222000",
"39229000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "8711500879080",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85392110",
"85392910"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "8727900351859",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85392110",
"85392910"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891114063608",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"04089900",
"82041100"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896411418915",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"54041990",
"56075011"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896210501108",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"23099090",
"30044990"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7897801308205",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"39222000",
"39229000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898485616921",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85443000",
"85444200"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898485615306",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"85443000",
"85444200"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891000462300",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891000118580",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7895800304228",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"17041000",
"21069050"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "78910041",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"17049020",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "78938847",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"17041000",
"17049020"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898994097952",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"20079990",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896423420180",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896423419276",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18069000",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7894900010015",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891991000833",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891991000826",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891991000727",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7892840800079",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7894900700015",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7892840812423",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891991002561",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7892840800406",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7894900701715",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22021000",
"22030000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896423497984",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "78940734",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18069000",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7622300991500",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7622300988470",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"19053200",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891000251133",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18063110",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "78940741",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"18069000",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7622300988517",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"19053200",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896052601516",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"20099000",
"22021000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891149105564",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"22030000",
"22089000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7898024397915",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"19053200",
"21069090"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7891008124583",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"17049010",
"18063210"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896085863486",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"33051000",
"33059000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
},
{
"identity": "7896103461908",
"classification": "NCM_CONFLICT",
"observations": 2,
"ncms": [
"39241000",
"39249000"
],
"auto_resolution": "KEEP_KNOWLEDGE_CONFLICT"
}
],
"policy": "only structurally equivalent identities may share a canonical product; tenant fiscal context is never global knowledge"
}
+49
View File
@@ -0,0 +1,49 @@
{
"AI_BLOCKED": 511,
"AI_READY": 511,
"COMPANY_DECISION_PENDING": 9720,
"DATABASES": 5,
"DETERMINISTIC_RESOLVED": 0,
"DUPLICATE_BLOCKED": 0,
"FAILED": 0,
"FISCAL_CELLS": 55756,
"GROUP_DECISION_PENDING": 738,
"PRODUCTS": 35066,
"PRODUCT_DECISION_PENDING": 46036,
"artifact": "LOCAL_PRODUCT_HEALTH_V1",
"blockers": [
"external Z.ai balance/credential is unavailable",
"human questionnaire answers remain required where no deterministic evidence exists"
],
"measured": {
"external_api_calls": 0,
"firebird_writes": 0,
"question_cells": 55756,
"question_count": 1000,
"required_artifacts": {
"AI_RESIDUAL_PLAN_V3.json": {
"bytes": 628,
"exists": true
},
"LOCAL_FISCAL_CONTEXT_QUESTIONS_V2.json": {
"bytes": 643438,
"exists": true
},
"LOCAL_FULL_FISCAL_DRY_RUN_V1.json": {
"bytes": 37168,
"exists": true
},
"LOCAL_FULL_FISCAL_WRITE_AUDIT_V1.json": {
"bytes": 4868,
"exists": true
}
},
"semantic_writes": 0
},
"safety": {
"ai_write_allowed": false,
"deterministic_gate_closed": true,
"offline_only": true
},
"status": "PASS"
}
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"artifact": "NCM_RETRIEVAL_EVALUATION_V3",
"baseline_artifact": "NCM_RETRIEVAL_EVALUATION_V2",
"activation": "NOT_ACTIVATED_PENDING_FULL_HOLDOUT_REPLAY",
"gold_recall_at_1_before": 0.7846,
"gold_recall_at_20_before": 0.9538,
"gold_mrr_before": 0.8392,
"gold_recall_at_1_after": 0.7846,
"gold_recall_at_20_after": 0.9538,
"gold_mrr_after": 0.8392,
"local_embeddings_used": false,
"local_embeddings_improvement": null,
"evidence_features": [
"BM25-compatible lexical baseline",
"word/character evidence hooks",
"token rarity",
"hierarchy",
"KB neighbors",
"GTIN",
"product group"
],
"policy": "retain V2 until a complete untouched holdout replay proves recall_at_20 >= 0.954 and no regression"
}
+94
View File
@@ -0,0 +1,94 @@
# PRE-AI LOCAL COMPLETION V3
STATUS=COMPLETE_OFFLINE_WITH_EXTERNAL_BLOCKERS
## Measured Product State
DATABASES=5
PRODUCTS=35066
FISCAL_CELLS=55756
DETERMINISTIC_GATE_CLOSED=true
FIREBIRD_AI_WRITES=0
AI_WRITE_ALLOWED=false
EXTERNAL_API_CALLS=0
KB_PRODUCTS_BEFORE=30801
KB_PRODUCTS_AFTER=30801
CANONICAL_PRODUCTS=35065 observation identities
KB_CONFLICTS_BEFORE=163
KB_CONFLICTS_AFTER=90 observable audited; 73 historical conflicts lack detail in the seed payload
WORK_ITEMS_BEFORE=750
WORK_ITEMS_AFTER=750
LLM_ITEMS_BEFORE=511
LLM_ITEMS_AFTER=511
## Retrieval
GOLD_RECALL_AT_1_BEFORE=0.7846
GOLD_RECALL_AT_1_AFTER=0.7846
GOLD_RECALL_AT_20_BEFORE=0.9538
GOLD_RECALL_AT_20_AFTER=0.9538
GOLD_MRR_BEFORE=0.8392
GOLD_MRR_AFTER=0.8392
RETRIEVAL_V3=NOT_ACTIVATED_PENDING_FULL_HOLDOUT_REPLAY
LOCAL_EMBEDDINGS_USED=false
LOCAL_EMBEDDINGS_IMPROVEMENT=NOT_TESTED; no model download/GPU introduced
The V3 evidence layer is available but preserves V2 ordering unless a complete
untouched holdout proves improvement. The V3 artifact records the existing V2
metrics rather than claiming an unperformed replay.
## Pipeline Verification
FAKE_PROVIDER_COMPLETE=true
BATCHING_TESTED=5,10,20
RETRY_TESTED=TIMEOUT,429,500
CACHE_TESTED=true; all key dimensions and zero-call hit policy
BUDGET_GUARD_TESTED=true; pre-call and actual usage guard
E2E_SIMULATION=GOLD -> gate -> SILVER -> NOISY -> residual plan
FINAL_E2E_AFTER_PHASE_2=PASS_PLUMBING
FAKE_RESULTS_AUTHORITATIVE=false
Artifacts:
- `docs/KB_CONFLICT_AUDIT_V1.json`
- `docs/NCM_RETRIEVAL_EVALUATION_V3.json`
- `docs/AI_RESIDUAL_PLAN_V3.json`
- `docs/runs/offline_ai/final/OFFLINE_AI_SIMULATION_V1.json`
- `docs/LOCAL_PRODUCT_HEALTH_V1.json`
- `docs/LOCAL_VALIDATION_V1.json`
## Human Operations
COMPANY_QUESTION_CLI=true
GROUP_QUESTION_CLI=true
ENTRY_SCOPE=INTRA|INTER|MIXED_OR_DYNAMIC; MIXED_OR_DYNAMIC does not invent static CFOP_ENTRADA
STORE_IPI_PROFILE=POPULATE_REFERENCE_RATE|LEAVE_NOT_APPLICABLE; rollback is preview-only until operator confirmation
ROLLBACK_TOOL_READY=true; current == expected_after guard emits CONFLICT
FULL_LOCAL_VALIDATION_COMMAND=`python scripts/run_local_validation.py`
HEALTH_REPORT=`docs/LOCAL_PRODUCT_HEALTH_V1.json`
NCM_AI_READY=244 deduplicated work items
CEST_AI_READY=353 work items
EX_TIPI_AI_READY=112 work items
PRODUCT_ROLE_AI_READY=41 work items
AI_PAYLOAD_TOKENS_BEFORE=NOT_MEASURED_FOR_511_ITEMS; final per-item prompt payloads are not present in the local artifact set
AI_PAYLOAD_TOKENS_AFTER=NOT_MEASURED_FOR_511_ITEMS
AI_PAYLOAD_REDUCTION=NOT_MEASURED
## Verification
FULL_TESTS=518 passed, 1 skipped, 1 existing openpyxl warning
SECRET_SCAN=NO_TRACKED_SECRET_PATTERNS
DIFF_CHECK=PASS
## Remaining External Blockers
- Z.ai `chat/completions` is unavailable because the account returned HTTP 429 code 1113 (`Insufficient balance or no resource package`).
- The full live retrieval V3 holdout replay requires the local Hub/Postgres dataset in the isolated worktree context; V2 remains the active retrieval baseline.
- 73 historical KB conflicts need their original evidence rows if they are to be classified beyond the 90 observable GTIN/NCM conflicts.
- Human company/group decisions remain intentionally unresolved.
VERDICT=LOCAL_PIPELINE_OPERATIONALLY_READY; REAL_LLM_EXECUTION_AND_SEMANTIC_WRITES_REMAIN_BLOCKED_BY_POLICY_OR_EXTERNAL_QUOTA
@@ -0,0 +1,104 @@
{
"status": "PASS_PLUMBING",
"scenario": "CORRECT",
"gold": {
"count": 65,
"selection_accuracy": 1.0,
"gate_opened": true
},
"phases": [
{
"items": 65,
"batch_sizes": {
"5": {
"provider_calls": 13,
"retries": 0,
"answered": 65,
"errors": 0
},
"10": {
"provider_calls": 7,
"retries": 0,
"answered": 65,
"errors": 0
},
"20": {
"provider_calls": 4,
"retries": 0,
"answered": 65,
"errors": 0
}
},
"provider_calls": 24,
"retries": 0,
"answered": 65,
"errors": 0,
"phase": "GOLD"
},
{
"items": 118,
"batch_sizes": {
"5": {
"provider_calls": 24,
"retries": 0,
"answered": 118,
"errors": 0
},
"10": {
"provider_calls": 12,
"retries": 0,
"answered": 118,
"errors": 0
},
"20": {
"provider_calls": 6,
"retries": 0,
"answered": 118,
"errors": 0
}
},
"provider_calls": 42,
"retries": 0,
"answered": 118,
"errors": 0,
"phase": "SILVER"
},
{
"items": 17,
"batch_sizes": {
"5": {
"provider_calls": 4,
"retries": 0,
"answered": 17,
"errors": 0
},
"10": {
"provider_calls": 2,
"retries": 0,
"answered": 17,
"errors": 0
},
"20": {
"provider_calls": 1,
"retries": 0,
"answered": 17,
"errors": 0
}
},
"provider_calls": 7,
"retries": 0,
"answered": 17,
"errors": 0,
"phase": "NOISY"
}
],
"residual_plan": {
"executed": true,
"semantic_results_accepted": false,
"llm_selection_required": 511
},
"external_calls": 0,
"firebird_ai_writes": 0,
"ai_write_allowed": false,
"fake_results_are_authoritative": false
}
@@ -0,0 +1,116 @@
{
"status": "PASS_PLUMBING",
"scenario": "CORRECT",
"gold": {
"count": 65,
"selection_accuracy": 1.0,
"gate_opened": true
},
"phases": [
{
"items": 65,
"batch_sizes": {
"5": {
"provider_calls": 13,
"retries": 0,
"answered": 65,
"errors": 0
},
"10": {
"provider_calls": 7,
"retries": 0,
"answered": 65,
"errors": 0
},
"20": {
"provider_calls": 4,
"retries": 0,
"answered": 65,
"errors": 0
}
},
"provider_calls": 24,
"retries": 0,
"answered": 65,
"errors": 0,
"phase": "GOLD"
},
{
"items": 118,
"batch_sizes": {
"5": {
"provider_calls": 24,
"retries": 0,
"answered": 118,
"errors": 0
},
"10": {
"provider_calls": 12,
"retries": 0,
"answered": 118,
"errors": 0
},
"20": {
"provider_calls": 6,
"retries": 0,
"answered": 118,
"errors": 0
}
},
"provider_calls": 42,
"retries": 0,
"answered": 118,
"errors": 0,
"phase": "SILVER"
},
{
"items": 17,
"batch_sizes": {
"5": {
"provider_calls": 4,
"retries": 0,
"answered": 17,
"errors": 0
},
"10": {
"provider_calls": 2,
"retries": 0,
"answered": 17,
"errors": 0
},
"20": {
"provider_calls": 1,
"retries": 0,
"answered": 17,
"errors": 0
}
},
"provider_calls": 7,
"retries": 0,
"answered": 17,
"errors": 0,
"phase": "NOISY"
}
],
"residual_plan": {
"executed": true,
"semantic_results_accepted": false,
"llm_selection_required": 511
},
"external_calls": 0,
"firebird_ai_writes": 0,
"ai_write_allowed": false,
"fake_results_are_authoritative": false,
"final_inputs": {
"work_items": {
"path": "docs\\AI_RESIDUAL_PLAN_V3.json",
"bytes": 628,
"loaded": true
},
"candidates": {
"path": "docs\\NCM_RETRIEVAL_EVALUATION_V3.json",
"bytes": 775,
"loaded": true
}
}
}