Skip to content

Commit f0344e8

Browse files
authored
feat(tech-graph): 闸口 C′ graph_v2 查询轨 impact F1 物化增强 (#36)
feat(tech-graph): 闸口 C′ graph_v2 查询轨 impact F1 物化增强
2 parents 11071a5 + 24c69d0 commit f0344e8

44 files changed

Lines changed: 1894 additions & 25 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_DUAL_MD/T001_embedding_dim_default.dual_track.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
schema: gate_ctx_c_dual_md_main_v1
33
arm: CTX_DUAL_MD
44
task_id: T001_embedding_dim_default
5-
freeze_id: TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0
5+
freeze_id: TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0
66
---
77

88
<!-- gate_ctx_c dual_track role=ai path=docs/_tech_graph/10_flow_rag.ai.md -->

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_DUAL_MD/T002_unified_sse_chain_contract.dual_track.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
schema: gate_ctx_c_dual_md_main_v1
33
arm: CTX_DUAL_MD
44
task_id: T002_unified_sse_chain_contract
5-
freeze_id: TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0
5+
freeze_id: TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0
66
---
77

88
<!-- gate_ctx_c dual_track role=ai path=docs/_tech_graph/15_e2e_boundary.ai.md -->

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_DUAL_MD/T003_ingest_admin_rpc.dual_track.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
schema: gate_ctx_c_dual_md_main_v1
33
arm: CTX_DUAL_MD
44
task_id: T003_ingest_admin_rpc
5-
freeze_id: TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0
5+
freeze_id: TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0
66
---
77

88
<!-- gate_ctx_c dual_track role=ai path=docs/_tech_graph/13_flow_supabase_rpc.ai.md -->

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_V2_QUERY/T001_embedding_dim_default.subgraph.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schema": "gate_ctx_c_v2_query_main_v1",
33
"arm": "CTX_V2_QUERY",
44
"task_id": "T001_embedding_dim_default",
5-
"freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
5+
"freeze_id": "TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0",
66
"query": {
77
"op": "downstream",
88
"node_id": "ENV",

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_V2_QUERY/T002_unified_sse_chain_contract.subgraph.json

Lines changed: 176 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schema": "gate_ctx_c_v2_query_main_v1",
33
"arm": "CTX_V2_QUERY",
44
"task_id": "T002_unified_sse_chain_contract",
5-
"freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
5+
"freeze_id": "TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0",
66
"query": {
77
"op": "union",
88
"parts": [
@@ -460,12 +460,29 @@
460460
},
461461
"note": "graph_v2 子图;ref 边不参与 BFS",
462462
"contract_slice": {
463-
"schema": "gate_ctx_c_sse_contract_slice_v1",
463+
"schema": "gate_ctx_c_sse_contract_slice_v2",
464464
"source": "docs/_tech_graph/_contract_manifest.json",
465+
"envelope_keys": [
466+
"event",
467+
"data"
468+
],
465469
"allowed_events": [
466470
"chain",
467471
"done"
468472
],
473+
"chain_data_keys": [
474+
"type",
475+
"ts",
476+
"step_id",
477+
"payload"
478+
],
479+
"done_data_keys": [
480+
"ok",
481+
"mode",
482+
"run_id",
483+
"session_id",
484+
"request_id"
485+
],
469486
"chain_type_values": [
470487
"meta",
471488
"router.decision",
@@ -493,6 +510,18 @@
493510
"text2sql.phase.start",
494511
"text2sql.phase.end"
495512
],
513+
"impact_chain_type_values": [
514+
"agent.llm.delta",
515+
"agent.llm.end",
516+
"agent.llm.start",
517+
"agent.llm.truncated",
518+
"error",
519+
"rag.query_expand",
520+
"rag.sources",
521+
"sql.result",
522+
"text2sql.phase.end",
523+
"text2sql.phase.start"
524+
],
496525
"payload_min_keys_by_type": {
497526
"_note": "每个 type 的 payload 最小必需键集合:后端必须至少提供这些键;前端不得读取 manifest 未承诺的键。",
498527
"meta": [
@@ -647,6 +676,150 @@
647676
"phase_id",
648677
"latency_ms"
649678
]
650-
}
679+
},
680+
"impact_payload_min_keys_by_type": {
681+
"agent.llm.delta": [
682+
"text",
683+
"part_index"
684+
],
685+
"agent.llm.end": [
686+
"ok",
687+
"phase",
688+
"step_id"
689+
],
690+
"agent.llm.start": [
691+
"phase",
692+
"step_id"
693+
],
694+
"agent.llm.truncated": [
695+
"dropped_chars",
696+
"reason"
697+
],
698+
"error": [
699+
"stage",
700+
"message"
701+
],
702+
"rag.query_expand": [
703+
"raw",
704+
"rewrite"
705+
],
706+
"rag.sources": {
707+
"_note": "rag.sources 的 payload 为 sources+retrieval;source_item_keys 为 sources[] 每一项的最小键名集合。",
708+
"payload_keys": [
709+
"sources",
710+
"retrieval"
711+
],
712+
"source_item_keys": [
713+
"id",
714+
"content",
715+
"filename",
716+
"score",
717+
"path",
718+
"url"
719+
],
720+
"retrieval_keys": [
721+
"top_k",
722+
"rrf_k"
723+
]
724+
},
725+
"sql.result": [
726+
"sql",
727+
"columns",
728+
"rows",
729+
"truncated"
730+
],
731+
"text2sql.phase.end": [
732+
"subphase_id",
733+
"phase_id",
734+
"latency_ms"
735+
],
736+
"text2sql.phase.start": [
737+
"subphase_id",
738+
"phase_id",
739+
"phase_kind"
740+
]
741+
},
742+
"contract_check_tool": "tools/tech_graph_contract_check.py"
743+
},
744+
"manifest_slice": {
745+
"schema": "gate_ctx_c_manifest_slice_v1",
746+
"source": "docs/_tech_graph/_manifest.json",
747+
"endpoints": [
748+
{
749+
"method": "POST",
750+
"path": "/api/py/unified/chat",
751+
"handler": "unified_chat_route",
752+
"anchor": {
753+
"path": "api/index.py",
754+
"symbol": "unified_chat_route"
755+
}
756+
},
757+
{
758+
"method": "POST",
759+
"path": "/api/py/unified/chat/stream",
760+
"handler": "unified_chat_stream_route",
761+
"anchor": {
762+
"path": "api/index.py",
763+
"symbol": "unified_chat_stream_route"
764+
}
765+
},
766+
{
767+
"method": "GET",
768+
"path": "/api/py/chatbi/access/verify",
769+
"handler": "chatbi_access_verify",
770+
"anchor": {
771+
"path": "api/index.py",
772+
"symbol": "chatbi_access_verify"
773+
}
774+
}
775+
],
776+
"anchors": [
777+
{
778+
"path": "api/chatbi_principal.py",
779+
"symbol": "resolve_chatbi_from_plain_token"
780+
}
781+
],
782+
"note": "gold impact:_manifest.json / chatbi_access_verify(CV)"
783+
},
784+
"impact_surface": {
785+
"schema": "gate_ctx_c_impact_surface_v1",
786+
"source": "docs/diary/jsonPKmermaid/fixtures/gate_ctx_ab_v1/tasks.json",
787+
"candidates": [
788+
{
789+
"path": "docs/_tech_graph/_contract_manifest.json",
790+
"kind": "contract",
791+
"graph_id": "EV_TYPES",
792+
"note": "allowed_events、type_values、payload_min_keys_by_type 真值"
793+
},
794+
{
795+
"path": "tools/tech_graph_contract_check.py",
796+
"kind": "ci",
797+
"note": "删改 chain typ/键名须过静态契约扫描(workflow tech-graph-contract)"
798+
},
799+
{
800+
"path": "api/unified_chat.py",
801+
"kind": "control",
802+
"graph_id": "RAG",
803+
"note": "SSE 内 RAG 分支 yield chain(rewrite/embed/retrieve/generate)"
804+
},
805+
{
806+
"path": "api/unified_chat.py",
807+
"kind": "control",
808+
"graph_id": "T2S",
809+
"note": "SSE 内 Text2SQL 分支(retrieve/generate_sql/execute_sql)"
810+
},
811+
{
812+
"path": "api/agent.py",
813+
"kind": "control",
814+
"note": "emit agent.llm.start|delta|end|truncated;与 unified_chat 增量队列合并契约扫描"
815+
},
816+
{
817+
"path": "docs/_tech_graph/_manifest.json",
818+
"kind": "contract",
819+
"graph_id": "CV",
820+
"note": "含 chatbi_access_verify;鉴权链变更时 BFF 探活敏感"
821+
}
822+
],
823+
"note": "产出 JSON 时 impacts 须含 path + kind;evidence 可附 graph_id"
651824
}
652825
}

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_V2_QUERY/T003_ingest_admin_rpc.subgraph.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schema": "gate_ctx_c_v2_query_main_v1",
33
"arm": "CTX_V2_QUERY",
44
"task_id": "T003_ingest_admin_rpc",
5-
"freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
5+
"freeze_id": "TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0",
66
"query": {
77
"op": "downstream",
88
"node_id": "A2",

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/materialize_report.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"schema": "gate_ctx_c_payload_materialize_v1",
3-
"generated_at": "2026-05-18T07:08:44Z",
4-
"freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
3+
"generated_at": "2026-05-18T09:15:19Z",
4+
"freeze_id": "TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0",
55
"graph_v2_path": "docs/_tech_graph/graph.json",
66
"graph_v2_freeze_id": "TECH_GRAPH_S2_FREEZE_20260519_V2_3",
77
"arms_static": {
@@ -15,7 +15,7 @@
1515
"depth": 2
1616
},
1717
"nodes": 2,
18-
"bytes_utf8": 1684,
18+
"bytes_utf8": 1685,
1919
"heuristic_tokens": 417
2020
},
2121
"T002_unified_sse_chain_contract": {
@@ -40,8 +40,8 @@
4040
]
4141
},
4242
"nodes": 17,
43-
"bytes_utf8": 14138,
44-
"heuristic_tokens": 3494
43+
"bytes_utf8": 18537,
44+
"heuristic_tokens": 4555
4545
},
4646
"T003_ingest_admin_rpc": {
4747
"path": "docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/payloads/CTX_V2_QUERY/T003_ingest_admin_rpc.subgraph.json",
@@ -51,7 +51,7 @@
5151
"depth": 2
5252
},
5353
"nodes": 4,
54-
"bytes_utf8": 1949,
54+
"bytes_utf8": 1950,
5555
"heuristic_tokens": 481
5656
}
5757
},

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/protocol_version.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ created_at: "2026-05-18"
55

66
repo: ai-ink-brain-api-python
77
freeze_id: TECH_GRAPH_GATE_C_FREEZE_20260518_V1_0
8+
gate_c_prime_freeze_id: TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0
89
graph_v2_freeze_id: TECH_GRAPH_S2_FREEZE_20260519_V2_3
910
graph_v2_path: docs/_tech_graph/graph.json
1011

docs/diary/jsonPKmermaid/fixtures/gate_ctx_c_v1/query_seeds.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"schema_version": "gate_ctx_c_query_seeds_v1",
3-
"freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
3+
"freeze_id": "TECH_GRAPH_GATE_C_PRIME_F1_FREEZE_20260520_V1_0",
4+
"parent_freeze_id": "TECH_GRAPH_QUERY_COVERAGE_FREEZE_20260519_V1_0",
45
"graph_v2_freeze_id": "TECH_GRAPH_S2_FREEZE_20260519_V2_3",
56
"default_op": "downstream",
67
"default_depth": 2,

0 commit comments

Comments
 (0)