Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions emrg/server/open_source_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down
8 changes: 5 additions & 3 deletions tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 应保留"
Expand Down
Loading