fix(lineage): hint column-level needs existing table; pin jsp node-key tags (#154) - #163
Conversation
…ble note (#154) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
| graph::lineage::TableLookup::Missing => { | ||
| eprintln!( | ||
| "note: no table '{}' found — interpreting '{}' as a table reference", | ||
| "note: no table '{}' found — interpreting '{}' as a table reference (for column-level lineage, the table must exist)", |
There was a problem hiding this comment.
[suggestion] The new parenthetical (for column-level lineage, the table must exist) is appended on every TableLookup::Missing fallback, not only when the table is actually missing. That branch is also the successful schema.table recovery: codeweb lineage "bigfund.mid_yjqs_detail" first looks up table bigfund (a schema, so Missing), prints this note, then resolves the whole target as a table and succeeds. Users who typed a valid schema-qualified table now see a note implying column-level lineage failed because the table does not exist, even though stdout is a correct table-level result. should_fall_back_to_table_level_for_bare_schema_qualified_target still passes because it only checks for interpreting plus the original target. The new test covers only the dead-end missing_table.some_col case.
Suggestion: Keep the original Missing note for the schema.table recovery. Add the column-level prerequisite only when the subsequent table-level resolve also fails (the No table found matching path), or thread a “fell back from a column spec” flag and emit the extra sentence there. Extend the existing schema.table fallback test to assert the column-level parenthetical is absent on success.
| ]; | ||
| for key in &jsp_cases { | ||
| assert!( | ||
| split_type_prefix(key).is_some(), |
There was a problem hiding this comment.
[suggestion] The new JSP cases only assert split_type_prefix(key).is_some(). That does not pin the tags jsp / jspsql. JspSql Display (jspsql:file:line:hash) is one character away from JavaSql (javasql:file:line); if the JspSql arm were copy-pasted onto the javasql format, split_type_prefix would still succeed because javasql is already in TYPE_TAG_PREFIXES, and jspsql:… CLI keys would again last-dot-split. That is the drift this follow-up is meant to lock.
Suggestion: Assert the detected tag, e.g. assert_eq!(split_type_prefix(&jsp_page).map(|(tag, _)| tag), Some("jsp")) and Some("jspsql") for JspSql, rather than is_some().
Follow-up to #156 (merged as c88156c) — 落实对 PR #156 的两轮 review 中最后两项 low 级遗留(review 5130018719 后续复审发现)。
Closes #154 (补充)
变更
1. Missing 回退 note 补充列级前提(fix)
codeweb lineage "orders.customer_id"(orders不存在)时,原输出为两段:用户看到的最终错误是拼接后的怪异表名,缺少修复指引。现 note 补充前提:
新增测试
should_hint_column_level_requires_table_when_target_missing锁定(TDD Red→Green)。2. roundtrip 测试钉住 jsp/jspsql 标签(test)
TYPE_TAG_PREFIXES无条件包含"jsp"/"jspsql",但其NodeKey变体为cfg(feature = "jsp"),should_detect_every_display_tag_roundtrip从未覆盖它们(即使--features jsp)。若 Display 格式变更,split_type_prefix会静默失配且只表现为table.column误parse。修法:测试内
#[cfg(feature = "jsp")]块构造真实JspPage/JspSql变体并断言可检测;--features full门禁下即被执行。常量文档同步说明。此为 characterization pin(当前行为已正确,无 Red)。测试与门禁
regress_issue_154_lineage_targets:8 passed(新增 1 个)should_detect_every_display_tag_roundtrip:默认 +--features jsp双组合通过cargo fmt --all -- --check✅ /cargo clippy --features full -- -D warnings✅ /cargo test --features full -- --skip test_path_mapping_applied --skip test_serve_✅(基于最新 main,含 feat(serve): 调用链路面板展开/折叠 + has_more 截断标记 (#152) #155/fix(analyze): store 版本校验缺失导致升级二进制后 stale 缓存死循环 #157 合入后验证)