Skip to content

[backplane][foundation] 抽取 _as_non_empty_str 通用字符串校验 helper #10

Description

@beachspainc

现状与证据

_as_non_empty_strappssrc/cobnet 中出现重复,语义相同:

  • apps/client/sdk/docs/docspec.py:106
  • apps/client/sdk/docs/tools.py:44
  • src/cobnet/net/analysis/view/governance.py:27

定义返回逻辑均为:isinstance(value, str) and value.strip();返回该值或 None。

建议

将通用实现统一到 src/cobnet/backplane 的轻量类型辅助层(或更合适的共享层),避免文档工具和 net 分析模块重复维护。

验收

  • 统一抽取为单点 helper 并替换以上 3 处。
  • 增加边界测试:空字符串、空白、None、非字符串。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions