{{ message }}
Repository navigation
fix(zfc): reject Worker generation outside scaffolded projects - #155
Merged
Merged
Conversation
合入前审查整改(PR #155 / 变更 fix-zfc-worker-project-root): - resolve_worker_dir docstring 恢复英文:它在 zoo_framework.cli.__all__ 导出面内, bbf06ae(变更 api-docstring-english)已将其英文化,本 PR 曾改回中文 - 新增的报错消息改英文:用户可见控制台输出 MUST 为英文(cross-platform-io), 中文消息在 GBK 控制台乱码,且会使该变更验证门 4.1(raise/log/print 零 CJK)失效 - 项目外用例的“零产出”断言补上目录维度:_snapshot 原先只登记文件,注入 “先建目录再报错”的违规实现时断言仍绿(已实测),修后该注入变红 - design.md 增补 Language 一节,并把 issue #131 第 4 点(--create 目标不可创建时 抛裸异常栈)显式列入 Non-goals:存量缺陷,另立变更处理 - CHANGELOG 条目改中文,补(变更 fix-zfc-worker-project-root / #131)与 BREAKING 标注 验证:pytest 1011 passed;ruff / mypy(107 files) / bandit / openspec --strict 全绿; cp936 控制台下报错输出为纯 ASCII;tasks 3.1 的套件计数按实测更正。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

变更描述 / What changed
在项目外运行
zfc --worker <name>会静默创建无法被项目入口加载的 Worker 并返回成功。现在命令会从当前目录向上查找最近的src/main.py;找不到时在写入前报错并给出下一步指引。从项目子目录调用时会将 Worker 写入最近项目并接入其入口。关联 issue / Related issue
Closes #131
变更类型 / Type of change
fix—— Bug 修复 / bug fixfeat—— 新功能 / new capabilitydocs—— 文档 / documentation onlyrefactor—— 重构,行为不变 / behaviour-preserving refactortest—— tests onlychore/perf—— build, tooling, performance测试 / Testing
python -m pytest -q: 999 passed, 1 skippedRuff check and format check passed for changed Python files.
mypy zoo_framework --show-error-codes: passed (107 source files).Bandit: no issues identified.
openspec validate --strict fix-zfc-worker-project-root: valid.git diff --check: passed.The repository-wide pre-commit command reports existing whitespace/line-ending fixes and four B905 findings in
bench/measure_boundary.py. The same failures reproduce on the cleandevbase; changed Python files pass their focused checks.All template commands above pass exactly as written locally.
New behaviour is covered by regression tests.
This is documentation-only.
Not verifiable by automated tests.
破坏性变更 / Breaking change
--workeroutside a scaffolded project now exits non-zero instead of creating an unconnectedworkers/directory. Runzfc --create <name>first, or run the command inside an existing project (or its subdirectory).文档同步 / Documentation
README.mdandREADME.zh.mdupdated.docs/*.mddeep-dive documentation changed.openspec/delta spec included.自检 / Self-review checklist
devormain.