BReg: the facility example's address correction writes the untrimmed postal code
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 products/breg/examples/facility/plans/correct-address.rhai,特别是第 20 行附近的输入清理和效果赋值。然后检查 crates/registry-bregctl/tests/refactor_cli_contract.rs,了解它如何构建 facility 示例并运行 action-test。添加一个邮政编码前后带空格且预期为 "1234" 的用例;当该用例通过且效果存储去除空格后的值时,就算完成。
由索引模型根据 Issue 内容生成。
描述
The facility example's address correction Action trims the postal code, checks it, and then
writes the original input. products/breg/examples/facility/plans/correct-address.rhai reads
the input on line 2, calls postal_code.trim() on line 3 (Rhai's trim changes the string in
place and returns nothing), refuses an empty value on line 4, and then on line 20 sets the field
from ctx.inputs["postal-code"] instead of postal_code. A padded value passes the check and is
stored with its spaces. Readers copy this example as the pattern for input cleanup, so it
teaches the bug.
Minimal repro, with a copy of products/breg/examples/facility in facility/:
cat > in.json <<'E'
{"facility":"00000000-0000-4000-8000-000000000001","address-line":"2 Market Street","city":"Example city","postal-code":" 1234 "}
E
cat > trimmed.json <<'E'
{"effects":[{"id":"facility-address","set":{"address-line":"2 Market Street","city":"Example city","postal-code":"1234"}}]}
E
bregctl --format json project action-test --action correct-address --input in.json --expect trimmed.json facility
The run fails with action-test.expect.mismatch at expect/effects/0/set/postal-code. The same
run passes when the expectation's postal-code is " 1234 ".
Expected: the effect sets postal-code to "1234".
Likely fix: on line 20 of correct-address.rhai, write "postal-code": postal_code. The docs
page docs/site/src/content/docs/configure/breg-actions.mdx excerpts only lines 1 to 11 of this
script (its test-excerpt), so the excerpt gate is unaffected.
Tests: the example has no action-test case today. crates/registry-bregctl/tests/refactor_cli_contract.rs
already builds a project from products/breg/examples/facility; an action-test run there with
a padded postal code and an --expect of "1234" would pin the behavior. The example's own
examples/inputs/correction.json uses an unpadded postal code, so it does not catch this.
- 主要语言
- Rust
- 星标
- 2
- 派生
- 0
- 平均合并
- 9 小时 19 分钟
- 30 天内合并 PR
- 275
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
registrystack/registry-stack 的其他 Issue
-
area:breg bug
难度 2/5 1-3 小时 新手友好度 74/100
registrystack/registry-stack#2307 ·
维护者通常 1 天内回复
-
area:breg area:docs documentation
难度 2/5 1-3 小时 新手友好度 82/100
registrystack/registry-stack#2302 ·
维护者通常 1 天内回复
-
area:docs documentation
难度 2/5 1-3 小时 新手友好度 76/100
registrystack/registry-stack#2253 ·
维护者通常 1 天内回复
-
area:coordinator bug
难度 2/5 1-3 小时 新手友好度 82/100
registrystack/registry-stack#2252 ·
维护者通常 1 天内回复
-
area:release bug
难度 2/5 1-3 小时 新手友好度 74/100
registrystack/registry-stack#2248 ·
维护者通常 1 天内回复
查看 registrystack/registry-stack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
pedrovgs/UseCaseCoverage#23 ·
-
priority: low
难度 2/5 1-3 小时 新手友好度 64/100
storytold/photocraft#8687 · 1 条评论 ·
维护者通常 2 天内回复
-
area:kernel bug kernel-paused needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
bherbruck/solvecraft#5055 · 2 条评论 ·
-
bug cli p3
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 3 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复