From 985029944800c74cafc2e87d27960465ba1c65c7 Mon Sep 17 00:00:00 2001 From: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com> Date: Sun, 15 Nov 2026 23:44:23 +0800 Subject: [PATCH 1/2] Prepare v0.26.2 and gate publication on installed path and approval replays --- .github/workflows/release.yml | 16 +++++++++++ CHANGELOG.md | 2 ++ CITATION.cff | 4 +-- README.md | 8 +++--- README.simplified.md | 12 ++++---- README.traditional.md | 12 ++++---- benchmarks/path-check-v2/README.md | 6 ++-- docs/README.md | 2 +- docs/feedback-to-delivery.md | 2 +- docs/path-case-study.md | 7 +++-- docs/releases/v0.26.2.md | 43 ++++++++++++++++++++++++++++ docs/simplified/limitations.md | 2 +- docs/traditional/limitations.md | 2 +- pyproject.toml | 2 +- scripts/run_path_regression_check.py | 2 +- src/agent_config_score/__init__.py | 2 +- tests/test_release_workflow.py | 2 ++ 17 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 docs/releases/v0.26.2.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a0e8b2..8be92bc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -164,6 +164,22 @@ jobs: --python "$wheel_python" --expected-version "$VERSION" python "$GITHUB_WORKSPACE/scripts/run_cursor_coverage_demo.py" \ --python "$wheel_python" --output "$RUNNER_TEMP/cursor-coverage-demo.json" + python "$GITHUB_WORKSPACE/scripts/run_approval_demo.py" \ + --python "$wheel_python" --output-dir "$RUNNER_TEMP/release-approval-demo" + if [[ "$RUNNER_OS" == "Linux" ]]; then + python "$GITHUB_WORKSPACE/scripts/run_path_regression_check.py" --python "$wheel_python" \ + --output "$RUNNER_TEMP/release-path-replay.json" --markdown "$RUNNER_TEMP/release-path-replay.md" + fi + - name: Retain release path evidence + if: runner.os == 'Linux' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: release-path-replay + path: | + ${{ runner.temp }}/release-path-replay.json + ${{ runner.temp }}/release-path-replay.md + if-no-files-found: error + retention-days: 14 - name: Retain release coverage evidence uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c93907..67f7023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +## v0.26.2 + - Avoid missing-path warnings for narrowly declared generated outputs while retaining checks on generator paths, Markdown links, commands and credentials. - Check single-backtick directory references with `./` or `../` and a trailing `/` against concrete diff --git a/CITATION.cff b/CITATION.cff index 14c7e8a..c307c30 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: "If you use AgentConfigScore in research, please cite this software." title: "AgentConfigScore: deterministic lint and regression checks for AI coding-agent instructions" type: software -version: 0.26.1 -date-released: 2026-11-11 +version: 0.26.2 +date-released: 2026-11-15 authors: - family-names: Lin given-names: Zhibo diff --git a/README.md b/README.md index e0e9f2d..2602f94 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ instruction usefulness, semantic correctness or safety. [Read a public-source case study](https://github.com/LE0-Lin/AgentConfigScore/blob/main/docs/path-case-study.md): a generated-file false positive, explicit directory checks, and a failing development replay that caught a new warning before merge. The new path -behavior is currently unreleased source, with retained before/after evidence. +behavior is included in v0.26.2, with retained before/after evidence. The [feedback-to-delivery map](https://github.com/LE0-Lin/AgentConfigScore/blob/main/docs/feedback-to-delivery.md) connects a public maintainer request to implemented features and their limits. @@ -94,10 +94,10 @@ covers setup, exits and troubleshooting. ## Release status -v0.26.1 Beta includes local lint, baseline-governed regression checks, auditable +v0.26.2 Beta includes local lint, baseline-governed regression checks, auditable exceptions, reports, safeguard review and opt-in Cursor attachment/coverage analysis. The Cursor profile is a bounded static prediction with explicit -unknowns. See the [release and upgrade notes](https://github.com/LE0-Lin/AgentConfigScore/blob/main/docs/releases/v0.26.1.md). +unknowns. See the [release and upgrade notes](https://github.com/LE0-Lin/AgentConfigScore/blob/main/docs/releases/v0.26.2.md). ## Cursor attachment changes @@ -115,7 +115,7 @@ For a declared API-only task: From a repository checkout, install the package and run the synthetic example: ```bash -python -m pip install --upgrade "agent-config-score==0.26.1" +python -m pip install --upgrade "agent-config-score==0.26.2" agent-config-score scope compare \ examples/cursor-scope-impact/base examples/cursor-scope-impact/narrowed \ --target src/api/service.py --fail-on-lost-directives --fail-on-unknown diff --git a/README.simplified.md b/README.simplified.md index a6433f9..9d56170 100644 --- a/README.simplified.md +++ b/README.simplified.md @@ -1,6 +1,6 @@ # AgentConfigScore -[真实文档案例](docs/path-case-study.md):生成文件误报的修复、目录检查的新增覆盖,以及真实文档复跑如何拦住一次新误报。新路径逻辑目前在未发布源码中,报告保留修复前后的证据。 +[真实文档案例](docs/path-case-study.md):生成文件误报的修复、目录检查的新增覆盖,以及真实文档复跑如何拦住一次新误报。新路径逻辑已纳入 v0.26.2,报告保留修复前后的证据。 [English](README.md) | 简体中文 | [繁體中文](README.traditional.md) @@ -54,7 +54,7 @@ agent-config-score diff ## 发布版本 -v0.26.1 Beta 包含本地检查、基线回归门禁、可审计豁免、报告、删除保护审核,以及可选的 Cursor 加载与逐文件覆盖分析。Cursor 功能是有明确未知状态的静态预测。[发布与升级说明(英文)](docs/releases/v0.26.1.md)。 +v0.26.2 Beta 包含本地检查、基线回归门禁、可审计豁免、报告、删除保护审核,以及可选的 Cursor 加载与逐文件覆盖分析。Cursor 功能是有明确未知状态的静态预测。[发布与升级说明(英文)](docs/releases/v0.26.2.md)。 ## Cursor 加载变化审核 @@ -65,7 +65,7 @@ v0.26.1 Beta 包含本地检查、基线回归门禁、可审计豁免、报告 在源码仓库目录中运行合成示例: ```bash -python -m pip install --upgrade "agent-config-score==0.26.1" +python -m pip install --upgrade "agent-config-score==0.26.2" agent-config-score scope compare \ examples/cursor-scope-impact/base examples/cursor-scope-impact/narrowed \ --target src/api/service.py --fail-on-lost-directives --fail-on-unknown @@ -144,10 +144,10 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 - - uses: LE0-Lin/AgentConfigScore@v0.26.1 + - uses: LE0-Lin/AgentConfigScore@v0.26.2 ``` -固定 `@v0.26.1` 有利于复现;`@v0` 是会随后续版本更新的滚动引用。PR 评论属于[可选集成(英文)](docs/pr-comments.md),扫描器默认不替你发评论。 +固定 `@v0.26.2` 有利于复现;`@v0` 是会随后续版本更新的滚动引用。PR 评论属于[可选集成(英文)](docs/pr-comments.md),扫描器默认不替你发评论。 ## 支持的指令文件 @@ -171,4 +171,4 @@ jobs: 图中的三次评分由 `agent-config-score history` 读取。[历史工作流(英文)](docs/score-history.md) -项目采用 [MIT 协议](LICENSE)。[发布与升级说明](docs/releases/v0.26.1.md)目前为英文。 +项目采用 [MIT 协议](LICENSE)。[发布与升级说明](docs/releases/v0.26.2.md)目前为英文。 diff --git a/README.traditional.md b/README.traditional.md index c9db31e..6246805 100644 --- a/README.traditional.md +++ b/README.traditional.md @@ -1,6 +1,6 @@ # AgentConfigScore -[真實文件案例](docs/path-case-study.md):產生檔案誤報的修復、目錄檢查的新增涵蓋,以及真實文件重跑如何攔下一次新誤報。新路徑邏輯目前在未發佈原始碼中,報告保留修復前後的證據。 +[真實文件案例](docs/path-case-study.md):產生檔案誤報的修復、目錄檢查的新增涵蓋,以及真實文件重跑如何攔下一次新誤報。新路徑邏輯已納入 v0.26.2,報告保留修復前後的證據。 [English](README.md) | [简体中文](README.simplified.md) | 繁體中文 @@ -54,7 +54,7 @@ agent-config-score diff ## 發布版本 -v0.26.1 Beta 包含本機檢查、基準回歸檢查、可稽核例外、報告、刪除保護審閱,以及選用的 Cursor 載入與逐檔覆蓋分析。Cursor 功能是具有明確未知狀態的靜態預測。[發布與升級說明(英文)](docs/releases/v0.26.1.md)。 +v0.26.2 Beta 包含本機檢查、基準回歸檢查、可稽核例外、報告、刪除保護審閱,以及選用的 Cursor 載入與逐檔覆蓋分析。Cursor 功能是具有明確未知狀態的靜態預測。[發布與升級說明(英文)](docs/releases/v0.26.2.md)。 ## Cursor 載入變化審閱 @@ -65,7 +65,7 @@ v0.26.1 Beta 包含本機檢查、基準回歸檢查、可稽核例外、報告 在原始碼儲存庫目錄中執行合成範例: ```bash -python -m pip install --upgrade "agent-config-score==0.26.1" +python -m pip install --upgrade "agent-config-score==0.26.2" agent-config-score scope compare \ examples/cursor-scope-impact/base examples/cursor-scope-impact/narrowed \ --target src/api/service.py --fail-on-lost-directives --fail-on-unknown @@ -144,10 +144,10 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 - - uses: LE0-Lin/AgentConfigScore@v0.26.1 + - uses: LE0-Lin/AgentConfigScore@v0.26.2 ``` -固定使用 `@v0.26.1` 較容易重現;`@v0` 是會隨後續版本更新的滾動參照。PR 留言是[選用整合(英文)](docs/pr-comments.md),檢查工具預設不會替你留言。 +固定使用 `@v0.26.2` 較容易重現;`@v0` 是會隨後續版本更新的滾動參照。PR 留言是[選用整合(英文)](docs/pr-comments.md),檢查工具預設不會替你留言。 ## 支援的指令檔 @@ -171,4 +171,4 @@ jobs: 圖中的三次評分由 `agent-config-score history` 讀取。[歷史工作流程(英文)](docs/score-history.md) -專案採用 [MIT 授權](LICENSE)。[發布與升級說明](docs/releases/v0.26.1.md)目前為英文。 +專案採用 [MIT 授權](LICENSE)。[發布與升級說明](docs/releases/v0.26.2.md)目前為英文。 diff --git a/benchmarks/path-check-v2/README.md b/benchmarks/path-check-v2/README.md index cd91909..45dfff0 100644 --- a/benchmarks/path-check-v2/README.md +++ b/benchmarks/path-check-v2/README.md @@ -1,8 +1,10 @@ # Path checks: bounded fixes and reproducible evidence This is **development evidence**, separate from external user feedback or -independent accuracy. The changed runtime is an unreleased source build. The -published v0.26.1 reports and its 474-case benchmark remain unchanged. +independent accuracy. The path changes now ship in v0.26.2. The retained +replay identifies the pre-release source build used at collection time; its +version string and fingerprints are preserved. The published v0.26.1 reports +and its 474-case benchmark remain unchanged. ## Actual problems addressed diff --git a/docs/README.md b/docs/README.md index 4c49bc9..b5d5a15 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,7 +29,7 @@ read the result, and troubleshoot a failing gate. ## Understanding findings - [Score contract and limitations](limitations.md) -- [Case study: generated-output warnings and explicit directory checks](path-case-study.md) (unreleased source) +- [Case study: generated-output warnings and explicit directory checks](path-case-study.md) (v0.26.2+) - [Regression input consistency and file-removal checks](regression-coverage.md) - [Runnable design lab: scores, baseline gates and caller overrides](../examples/regression-lab/README.md) (synthetic development example) - [Path-reference grammar and limits](limitations.md#plain-prose-path-references) diff --git a/docs/feedback-to-delivery.md b/docs/feedback-to-delivery.md index beed5b3..e575029 100644 --- a/docs/feedback-to-delivery.md +++ b/docs/feedback-to-delivery.md @@ -8,7 +8,7 @@ and maintainer-confirmed effectiveness remain unverified. | Requested capability, paraphrased | Delivered surface | Verification and boundary | |---|---|---| -| Check whether instruction-file references remain valid | `dead-path`, Markdown link resolution, repository/scope path checks | Released checks have deterministic tests. The [new path case study](path-case-study.md) adds a generated-output correction and explicit relative-directory handling in unreleased source. Generated and package-relative ambiguity remain bounded. | +| Check whether instruction-file references remain valid | `dead-path`, Markdown link resolution, repository/scope path checks | Released checks have deterministic tests. The [new path case study](path-case-study.md) adds a generated-output correction and explicit relative-directory handling in v0.26.2. Generated and package-relative ambiguity remain bounded. | | Give practical instruction-file guidance | [Advisory checklist](best-practices.md), [maintainer workflow](maintainer-workflow.md), opt-in [safeguard review](guardrail-suggestions.md) | Documentation and narrowly recognized review suggestions are available. They do not constitute a general semantic reviewer or a scored best-practice certification. | | Surface prompt-injection concerns | The released `prompt-injection-override` warning and its conservative context handling | The rule targets explicit prior-instruction override phrases. It does not detect arbitrary injection attacks or enforce agent behavior. | | Make review results visible on PRs | [Opt-in single-comment workflow](pr-comments.md), including generated setup via `init --pr-comment` | The repository's CI and integration tests validate the maintained recipe. A caller explicitly grants comment permission. Adoption by the requester's repository is not established. | diff --git a/docs/path-case-study.md b/docs/path-case-study.md index 9a09cc0..674da4d 100644 --- a/docs/path-case-study.md +++ b/docs/path-case-study.md @@ -59,9 +59,10 @@ some retained repository trees require a case-sensitive filesystem. ## Apply the result -The implementation is currently **unreleased source**, separate from the -published v0.26.1 wheel. From a reviewed checkout, install with -`python -m pip install .` and run ordinary ACS scans/comparisons. A passing +These path checks ship in **v0.26.2**. Install with +`python -m pip install --upgrade agent-config-score==0.26.2` and run ordinary +ACS scans/comparisons. The retained report identifies the pre-release source +build used for the original replay; publishing is not a new accuracy evaluation. A passing result means the selected deterministic checks passed; the generated-output declaration is not authenticated and no upstream build is executed. diff --git a/docs/releases/v0.26.2.md b/docs/releases/v0.26.2.md new file mode 100644 index 0000000..a6ea37e --- /dev/null +++ b/docs/releases/v0.26.2.md @@ -0,0 +1,43 @@ +# AgentConfigScore v0.26.2 + +This **Beta** patch delivers the bounded path-reference maintenance changes +previously available only in the source checkout. + +```bash +python -m pip install --upgrade agent-config-score==0.26.2 +agent-config-score --version +``` + +Expected version: `AgentConfigScore 0.26.2`. GitHub Action users can pin +`LE0-Lin/AgentConfigScore@v0.26.2`; the rolling `v0` branch follows the verified +release commit. + +## Path behavior + +- A complete, immediate generated-output declaration exempts only that output + prose reference from an existence warning. Generator paths, actual Markdown + links, commands and credentials remain checked. The declaration is not + authenticated and no build is run. +- Single-backtick directory references require both an explicit `./` or `../` + prefix and a trailing `/`. A regular file cannot satisfy them; directory + matching does not use an ambiguous suffix fallback. Unprefixed directory + prose remains unresolved, including package/install/build outputs. +- Existing ordinary file-reference behavior, baseline-owned policies and + explicit unknowns remain in place. See the [full path contract](../limitations.md#plain-prose-path-references). + +## Validation and upgrade impact + +The release replays the actual built wheel before publication. Source tests, +installed acceptance on Linux/Windows/macOS, Cursor Action acceptance, deletion +approval demo and Linux path-development replay gate the release. Version and +source fingerprints identify the installed implementation. + +Directory warnings can change when instruction files explicitly opt into the +supported relative spelling. Review affected CI findings after upgrading; a +clean result is not semantic correctness or agent-safety certification. + +The [public-source case](../path-case-study.md) and [retained observations](../../benchmarks/path-check-v2/README.md) +document the generated-output fix, intermediate regressions, final conservative +scope and separate explicit-directory controls. Historical artifacts keep their +original version/source identities. A release is not a new independent accuracy +study, external adoption result or runtime agent-enforcement capability. diff --git a/docs/simplified/limitations.md b/docs/simplified/limitations.md index 4b15e40..109ffa2 100644 --- a/docs/simplified/limitations.md +++ b/docs/simplified/limitations.md @@ -82,7 +82,7 @@ v0.25.0+还检查简单的 `[指南][setup]`、`[setup][]` 引用式链接及图 目录引用须同时具有明确的 `./` 或 `../` 前缀和末尾 `/`,如 `./packages/`、`../src/`,才检查适用仓库/指令作用域内的真实目录;普通文件不能满足目录引用,目录也不使用模糊后缀匹配。无前缀的 `packages/`、`dist/`、`.husky/_/` 及没有末尾斜杠的 `test/unit` 不推断,因为它们可能指包内位置或安装/构建产物。真正的 Markdown 目录链接仍按文档相对位置检查。 -未发布源码增加两项有界处理:同一行紧邻路径、完整且闭合的 `` `docs/out.json` is generated by `make docs` ``(也支持 `generated from`、`regenerated`、`rewritten`)仅把产物视为可在构建后出现;生产者须为单反引号代码,末尾可带简短括号说明。生成器自身的文件路径、真正的 Markdown 链接、危险命令与凭据仍检查。不验证生成声明是否真实,不执行构建;否定、条件、未闭合或继续扩展的子句不豁免。 +v0.26.2+ 增加两项有界处理:同一行紧邻路径、完整且闭合的 `` `docs/out.json` is generated by `make docs` ``(也支持 `generated from`、`regenerated`、`rewritten`)仅把产物视为可在构建后出现;生产者须为单反引号代码,末尾可带简短括号说明。生成器自身的文件路径、真正的 Markdown 链接、危险命令与凭据仍检查。不验证生成声明是否真实,不执行构建;否定、条件、未闭合或继续扩展的子句不豁免。 未加反引号的目录散文、分支、URL、示例占位符及越界路径继续排除。PyPI v0.26.1 的既有报告不因这些源码变更而重写。 diff --git a/docs/traditional/limitations.md b/docs/traditional/limitations.md index fcb27b0..b534e6d 100644 --- a/docs/traditional/limitations.md +++ b/docs/traditional/limitations.md @@ -82,7 +82,7 @@ v0.25.0+也檢查簡單的 `[指南][setup]`、`[setup][]` 參照式連結及圖 目錄引用須同時具有明確的 `./` 或 `../` 前綴與末尾 `/`,如 `./packages/`、`../src/`,才檢查適用儲存庫/指令作用域內的真實目錄;一般檔案不能滿足目錄引用,目錄也不使用模糊後綴匹配。無前綴的 `packages/`、`dist/`、`.husky/_/` 及沒有末尾斜杠的 `test/unit` 不推論,因為它們可能指套件內位置或安裝/建置產物。實際的 Markdown 目錄連結仍按文件相對位置檢查。 -未發佈原始碼增加兩項有界處理:同一行緊鄰路徑、完整且閉合的 `` `docs/out.json` is generated by `make docs` ``(也支援 `generated from`、`regenerated`、`rewritten`)僅將產物視為可在建置後出現;產生者須為單反引號程式碼,末尾可帶簡短括號說明。產生器自身的檔案路徑、實際的 Markdown 連結、危險命令與認證資訊仍檢查。不驗證產生宣告是否真實,不執行建置;否定、條件、未閉合或繼續擴展的子句不豁免。 +v0.26.2+ 增加兩項有界處理:同一行緊鄰路徑、完整且閉合的 `` `docs/out.json` is generated by `make docs` ``(也支援 `generated from`、`regenerated`、`rewritten`)僅將產物視為可在建置後出現;產生者須為單反引號程式碼,末尾可帶簡短括號說明。產生器自身的檔案路徑、實際的 Markdown 連結、危險命令與認證資訊仍檢查。不驗證產生宣告是否真實,不執行建置;否定、條件、未閉合或繼續擴展的子句不豁免。 未加反引號的目錄敘述、分支、URL、範例佔位符及越界路徑繼續排除。PyPI v0.26.1 的既有報告不因這些原始碼變更而重寫。 diff --git a/pyproject.toml b/pyproject.toml index 11a1da4..771d8ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "agent-config-score" -version = "0.26.1" +version = "0.26.2" description = "Deterministic lint and regression gate for AGENTS.md, Claude, Cursor, Copilot, and Gemini instructions." readme = "README.md" requires-python = ">=3.10" diff --git a/scripts/run_path_regression_check.py b/scripts/run_path_regression_check.py index b195193..252168a 100644 --- a/scripts/run_path_regression_check.py +++ b/scripts/run_path_regression_check.py @@ -205,7 +205,7 @@ def markdown(data): "The collected document's raw scanner observations remain in JSON, without human reference labels.", "", "## Reproduction identity", "", f"Current source: `{data['tool']['source_fingerprint']['sha256']}`.", f"Frozen published source: `{data['frozen_tool']['source_fingerprint']['sha256']}`.", - "The changed implementation is an unreleased source build even when its package version string still says 0.26.1.", ""] + f"Replay package version: {data['tool']['version']}. Historical source-build observations remain separate from this run.", ""] lines += [f"Parser matches the pre-collection freeze: {data['fresh_parser_matches_collection_freeze']}.", "A later parser may replay these inputs as development data; a mismatch does not preserve first-use freshness.", f"Known development acceptance passed: {data['acceptance']['passed']}.", ""] diff --git a/src/agent_config_score/__init__.py b/src/agent_config_score/__init__.py index 025f4c5..40ab52f 100644 --- a/src/agent_config_score/__init__.py +++ b/src/agent_config_score/__init__.py @@ -1 +1 @@ -__version__ = "0.26.1" +__version__ = "0.26.2" diff --git a/tests/test_release_workflow.py b/tests/test_release_workflow.py index c7b84b3..8d0a5c0 100644 --- a/tests/test_release_workflow.py +++ b/tests/test_release_workflow.py @@ -50,6 +50,8 @@ def test_publish_waits_for_source_tests_and_cross_platform_acceptance(self): self.assertIn("os: [ubuntu-latest, windows-latest, macos-latest]", workflow) self.assertIn("scripts/verify_installed_package.py", workflow) self.assertIn("scripts/run_cursor_coverage_demo.py", workflow) + self.assertIn("scripts/run_path_regression_check.py", workflow) + self.assertIn("scripts/run_approval_demo.py", workflow) self.assertIn("release-cursor-coverage-${{ matrix.os }}", workflow) self.assertIn("needs: [build, acceptance, action-acceptance]", workflow) self.assertIn("needs: [build, acceptance, action-acceptance, github-release]", workflow) From a588569b8e7ad244dd3a4292bfdfd2b62c65d272 Mon Sep 17 00:00:00 2001 From: Zhibo Lin <147509942+LE0-Lin@users.noreply.github.com> Date: Sun, 15 Nov 2026 23:47:56 +0800 Subject: [PATCH 2/2] Read smoke completion through the same buffered stream before process cleanup --- tests/test_assistant_smoke.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_assistant_smoke.py b/tests/test_assistant_smoke.py index 5382e22..2493b20 100644 --- a/tests/test_assistant_smoke.py +++ b/tests/test_assistant_smoke.py @@ -49,9 +49,14 @@ def send(path, token=None): self.assertTrue(send("obsolete.txt", token)["result"]["executed"]) self.assertEqual(json.loads(process.stdout.readline())["event"], "fixture_reset") self.assertEqual(send("obsolete.txt", token)["result"]["reason"], "approval_already_used") + # Keep reading through the same TextIOWrapper: readline() + # can prefetch the completion line, while communicate() + # may drain the underlying fd without that buffered text. + completed = json.loads(process.stdout.readline()) + self.assertEqual(completed["status"], "completed") remaining, error = process.communicate(timeout=10) self.assertEqual(process.returncode, 0, error) - self.assertEqual(json.loads(remaining)["status"], "completed") + self.assertEqual(remaining.strip(), "") finally: if process.poll() is None: process.kill()