fix(config): standardize runtime secret injection#85
Draft
ULookup wants to merge 2 commits into
Draft
Conversation
This was referenced Jul 22, 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.
关联 Issue
Closes #62
Refs #22
目标版本:
3.0-dev变更摘要
_FILE二选一解析。getenvfallback。.github/workflows/ci.yml;CI 注入、执行效率与完整栈门禁归入 Make the clean-slate Compose stack and CI runtime gates executable #78 的独立 PR。根因
运行时凭据散落在源码默认值、JSON、local/docker 配置和 Compose 中,各服务又存在不同的读取路径与 fallback。仓库缺少一个可执行的注入契约和防回归门禁,导致可用凭据可能被提交、复制或在启动时静默回退。
行为与兼容性
_FILE冲突、空值、超限、NUL、symlink、非普通文件、不允许的 owner/mode 均启动失败关闭。RED / GREEN 证据
RED(生产代码前):
cd tests && go test ./pkg/agentpolicy -run '^TestRepositoryRejectsTrackedRuntimeSecrets$' -v -count=1该命令先报告 38 个契约违规:26 个受跟踪赋值、统一 resolver 缺失、9 个消费者未接线与 2 个直接环境读取。MinIO helper 的独立 RED 证明空凭据仍会回退弱默认值。
GREEN / 回归:
go test ./pkg/agentpolicy -run '^TestRepositoryRejectsTrackedRuntimeSecrets$' -v -count=1go test ./pkg/agentpolicy ./cmd/agent-policy -count=1go vet ./pkg/agentpolicy ./cmd/agent-policygo test ./pkg/verify -count=1go vet ./pkg/verifygo test ./pkg/contracts -count=1go test ./pkg/client -run '^$' -count=1git diff --check通过。尚未宣称通过的验证
std::thread/std::thread*类型错误阻断;本 PR 未夹带该修复。make proto使用环境内旧版 protoc 时需额外 optional flag;为契约测试只生成了所需 Push Go protobuf,测试后已清理。安全与运维
_FILE使用O_NOFOLLOW | O_CLOEXEC、opened-FDfstat、regular-file、owner/mode、大小与 NUL 校验。docs/operations/runtime-secrets.md与docs/operations/jwt-key-rotation.md。架构与 Skills 同步
已同步 Configuration/Secret Provider 启动边界、消费者所有权、可靠性测试现状和生产审批边界;未引入商业 Secret Manager、动态热加载或新的业务协议。
审核状态
保持 Draft。待本 PR 自身 CI 结果、#82 与后续独立 #78 的验证证据齐备后,再由人工决定是否进入 review-ready;本代理不会合并。