Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Architecture]: two modules both claim to own "private-looking text"

未关闭
#5,136 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, typescript
领域
backend, security

调研方向

Read loopx/public_safe_text.py, loopx/control_plane/runtime/public_safety.py, and the caller in control_plane/goals/artifact_lifecycle.py; compare their rules with tests/fixtures/public_safe_text_corpus.json and the TypeScript mirror. First resolve which policy should own the differing verdicts and thresholds. Done means one named owner, no caller OR-ing two owners, and corpus coverage for both sides of the table and the path cases.

由索引模型根据 Issue 内容生成。

描述

Problem / 问题

Two modules each document themselves as the canonical answer to "is this text private?", and
neither dominates the other.

  1. loopx/public_safe_text.py opens with "Canonical private-looking-text rules for public-safe
    control-plane fields"
    , explains that its rule set "used to be copied into each owner, and the
    copies drifted", and names tests/fixtures/public_safe_text_corpus.json as the corpus pinning
    the Python and TypeScript owners to one contract. Consumers: feedback, authority,
    boundary_authority, control_plane/goals/artifact_lifecycle.
  2. loopx/control_plane/runtime/public_safety.py carries an independent
    SECRET_LIKE_SURFACE_PATTERN + LOCAL_PATH_SURFACE_PATTERN, used by
    validate_public_safe_value — the guard on the busiest public-output path (12 production
    modules call it). It never consults public_safe_text.

Measured on b15413ffc, calling both owners' matchers directly. A HIT means the text is treated
as private; no row is a HIT in both columns:

value public_safe_text public_safety
ghp_… (36 filler chars) — HIT
eyJ….….… (JWT shape) — HIT
access_key=… — HIT
C:\Users\bob\x — HIT
the bare word Bearer / password / secret HIT —
the Bearer token expired HIT —
token=x (short value) HIT —
larkoffice…, docs.internal… HIT —
Authorization: Basic <base64> HIT —
see file:///Users/alice/goal.md HIT —
path:/Users/alice/goal.md HIT —

The consequence is visible in the code that sits between them: on main,
control_plane/goals/artifact_lifecycle.py writes
if find_private_text_match(value) or _TOKEN_SHAPES.search(value), where _TOKEN_SHAPES is a
private list of provider prefixes carrying this comment: "Provider token shapes the shared
private-text rules do not cover … a leaked token there must never reach a public projection just
because the shared corpus did not list its prefix."
That caller knows it needs two owners and
patched the gap locally. #5135 folds _TOKEN_SHAPES and five sibling copies into the
public_safety owner, which removes six copies but still leaves that caller OR-ing
public_safe_text with public_safety, because the prefixes are not the only thing the two corpora
disagree about.

Why this needs an owner decision rather than a merge

The two corpora encode different philosophies, and neither is obviously wrong for all surfaces.
public_safe_text rejects ordinary English words (Bearer, password, secret) — its docstring
records that it deliberately moved one rule away from the bare word because governance prose says
"owner authorization" constantly, while other rules stayed word-shaped. public_safety instead
requires an assignment shape with a length floor so that "the token budget is 1200" survives.
Picking either winner changes what the other set of surfaces is allowed to publish, and it will move
expectations in tests/fixtures/public_safe_text_corpus.json and the TypeScript mirror. There is
also a prefix-blindness dimension to settle: public_safety's path rule excludes a preceding : or
/, which is why file:///Users/alice/goal.md and path:/Users/alice/goal.md pass it while
public_safe_text catches them.

Desired outcome / 期望

One module owns "private-looking text". The other is deleted, or becomes a policy layer that only
adds per-surface thresholds and words on top of the shared shapes. No caller should have to consult
two owners for one value.

Acceptance / 验收

  • A single named owner for private-text detection, whose docstring states which rules are
    word-shaped and which are shape-with-threshold, and why.
  • artifact_lifecycle no longer ORs two owners for one value.
  • The shared corpus fixture pins both directions of the table above, so a future consolidation
    cannot silently drop a rule that only one side had.
  • file:///Users/… and path:/Users/… are either rejected by the surviving owner or recorded as
    accepted, with the reason.
  • feedback / authority / boundary_authority and validate_public_safe_value are shown to
    reach the same verdicts on a named subset, or each surface's deliberate difference is written
    down next to the owner.
主要语言
Python
星标
6.2k
派生
596
平均合并
7 小时 47 分钟
30 天内合并 PR
904

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

loopx-project/loopx 的其他 Issue

查看 loopx-project/loopx 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。