From f6d74bd255ee78ec5387d57e259b0e8f7ce94aff Mon Sep 17 00:00:00 2001 From: EMRG Evolution Date: Mon, 17 Aug 2026 14:28:41 +0800 Subject: [PATCH] emrg: open-source rant project match uses single config.project value (rant 2026-08-17T14:17:03) --- emrg/server/open_source_prompt.md | 8 +++----- tests/test_scheduler.py | 8 +++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/emrg/server/open_source_prompt.md b/emrg/server/open_source_prompt.md index db2ec553..730ab7d1 100644 --- a/emrg/server/open_source_prompt.md +++ b/emrg/server/open_source_prompt.md @@ -141,14 +141,12 @@ cat ~/.emrg/rants.jsonl 2>/dev/null || echo "[no rants.jsonl — skip rant scan] Filter rules (aligned with evolution_prompt.md): -- Match the rant's `project` field against **either** of these two values — equal to either counts as a match: - - this task's `config.project` (tasks.yml): **`{{ task.project }}`** - - owner/repo form: **`{{ owner }}/{{ repo }}`** -- Example: if `config.project` is `aitokenpool` and the repo is `argszero/aitokenpool`, then a rant with `project: aitokenpool` **or** `project: argszero/aitokenpool` both match. +- Match the rant's `project` field against **exactly one value** — this task's `config.project` (tasks.yml): **`{{ task.project }}`** — equal counts as a match; anything else does **not** match +- Example: if `config.project` is `aitokenpool`, then a rant with `project: aitokenpool` matches; a rant with `project: argszero/aitokenpool` does **NOT** match (hosts should write the `config.project` value in the rant's project field) - **Ignore rants without a `project` field entirely** - Only consider rants with status `pending` or `in_progress` -**⚠️ Unmatched-rant hint**: after the scan, if there exist rants with status `pending`/`in_progress` whose `project` starts with `{{ task.project }}` or `{{ owner }}/{{ repo }}` but did NOT match the filter above, record the count in the state file / reflection (e.g. "存在 N 条 project 疑似本项目但未匹配的 rant" / "N rants with a project resembling this repo were not matched") — never silently skip them. +**⚠️ Unmatched-rant hint**: after the scan, if there exist rants with status `pending`/`in_progress` whose `project` starts with `{{ task.project }}` or `{{ owner }}/{{ repo }}` but did NOT match the filter above, record the count in the state file / reflection (e.g. "存在 N 条 project 疑似本项目但未匹配的 rant" / "N rants with a project resembling this repo were not matched") — never silently skip them; the host can then fix the rant's `project` field to the `config.project` value. **Dedup check — before treating any candidate rant as actionable** (run for each candidate): diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index e4a93787..9c80ccf4 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -601,10 +601,12 @@ def test_open_source_template_renders_with_context(): assert "0.5 Rant scan" in out, "rant-scan 0.5 节应渲染" assert "rants.jsonl" in out, "rant 扫描命令应渲染" assert "config.project" in out, "project 匹配过滤应渲染" - # Rant 2026-08-17T12:09:57: dual-compatible project matching (config.project - # OR owner/repo) must be rendered with the actual values. + # Rant 2026-08-17T14:17:03: rant project matching is the SINGLE value + # config.project — owner/repo dual-compat removed (host decision). assert "aitokenpool" in out, "task.project 值应渲染进 0.5 节" - assert "x/y" in out, "owner/repo 形式应渲染进 0.5 节" + assert "does **NOT** match" in out, "owner/repo 形式明确不匹配" + # the unmatched-rant hint may still mention the owner/repo form for + # detecting rants the host should fix — that is a hint, not a match rule assert "Unmatched-rant hint" in out, "未匹配疑似 rant 提示应渲染" assert "B.1b Rant-driven mode" in out, "rant 驱动模式应渲染" assert "ROLE LOCK" in out, "既有 ROLE LOCK 应保留"