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
2 changes: 1 addition & 1 deletion Agent.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -93,7 +93,7 @@ Community needs voiced in HN agent-UI discussions map directly to EMRG's design:
pkill -f "emrg.server"; rm -f ~/.emrg/emrgd.port; python -m emrg
```

Python: `uv run pytest tests/ -v` (590) — import check: `uv run python -c "from emrg.client.app import run_client"`
Python: `uv run pytest tests/ -v` (591) — import check: `uv run python -c "from emrg.client.app import run_client"`
GUI: `cd emrg/gui && npm test` (93: 22 daemon_client + 22 app-commands + 24 renderer smoke + 15 i18n + 7 integration + 3 commands) — syntax: `node --check main.js preload.js daemon_client.js renderer/js/*.js`
CI: `uv run pytest` + GUI tests + **actionlint workflow lint** (`rhysd/actionlint@v1.7.12` gate, #444 — workflow 解析错误在 PR CI 即失败,如 `if:` secrets 上下文)
Re-trigger: `scripts/re-trigger-ci.sh [branch]` (workflow_dispatch, #527 — 替代空 commit 重触发:Actions outage 会整段丢弃 push 事件,dispatch 走 API 路径不受影响)
Expand Down
2 changes: 1 addition & 1 deletion README.cn.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -274,7 +274,7 @@ EMRG 不只是追赶——它自己追上来。
git clone https://github.com/argszero/emrg.git
cd emrg
uv sync # 安装依赖
uv run pytest tests/ -v # 跑测试(当前 589 项)
uv run pytest tests/ -v # 跑测试(当前 591 项)
uv run python -m emrg # 启动 TUI
# CI 含 actionlint workflow 门禁(#444):workflow 解析错误在 PR 即失败

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -273,7 +273,7 @@ EMRG doesn't just keep up — it catches up on its own.
git clone https://github.com/argszero/emrg.git
cd emrg
uv sync # install deps
uv run pytest tests/ -v # run tests (currently 590 items)
uv run pytest tests/ -v # run tests (currently 591 items)
uv run python -m emrg # launch TUI
# CI includes actionlint workflow gate (#444): workflow parse errors fail PR CI

Expand Down
8 changes: 6 additions & 2 deletions emrg/server/evolution_prompt.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -145,7 +145,7 @@ cd {{ source_dir }} && gh pr list -R {{ owner }}/{{ repo }} --limit 20
and `gh api repos/{{ owner }}/{{ repo }}/pulls/<N>/reviews --jq '.[] | "\(.user.login) [\(.state)]: \(.body)"'`
- If there are already 2 ✅, this cycle is the 3rd → approve then merge
- If satisfied → `gh pr merge <N> -R {{ owner }}/{{ repo }} --squash`
- On merge conflict → `gh pr checkout <N> && git fetch origin master && git merge origin/master`, resolve conflicts, push, then merge
- On merge conflict → `gh pr checkout <N> && git fetch origin master && git merge FETCH_HEAD`, resolve conflicts, push, then merge
- Not satisfied → keep waiting

**Issue management**:
Expand DownExpand Up@@ -355,10 +355,14 @@ When reading rants, follow these rules:
#### 2.2 Latest GitHub code changes

```bash
cd {{ source_dir }} && git fetch origin master && git log origin/master --oneline -10
cd {{ source_dir }} && git fetch origin master && git log FETCH_HEAD --oneline -10
```

Fetch and understand the newest commits on master (possibly from other Committers) — analyze what changed, why, and whether follow-up is needed.
> ⚡ Use `FETCH_HEAD`, not `origin/master`: `git fetch origin master` always
> writes FETCH_HEAD even when the repo has no remote-tracking refs (e.g.
> after a workspace repair that stripped `remote.origin.fetch`), where
> `git log origin/master` fails with "unknown revision".

#### 2.3 EMRG memory and conversations across projects

Expand Down
22 changes: 22 additions & 0 deletions tests/test_daemon.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -73,6 +73,28 @@ def test_build_prompt_all_variables_substituted():
assert not braces, f"Unsubstituted placeholders: {braces}"


def test_build_prompt_step22_uses_fetch_head():
"""Step 2.2 must log FETCH_HEAD, not origin/master.

`git fetch origin master` always writes FETCH_HEAD even when the repo
has no remote-tracking refs (e.g. after a workspace repair that
stripped `remote.origin.fetch`), where `git log origin/master` fails
with "unknown revision" (observed 2026-08-08, cycles 09:15 & 09:30).
"""
handler = EvolutionHandler(
name="emrg", config={"path": "/tmp/emrg"}, interval=1800,
identity=InstanceIdentity(instance_id="test-id", host_name="testhost"),
)
prompt = handler._build_evolution_prompt()
# The actual Step 2.2 command block must log FETCH_HEAD, not origin/master.
step22 = prompt.split("#### 2.2 Latest GitHub code changes", 1)[1].split("#### 2.3", 1)[0]
assert "git fetch origin master && git log FETCH_HEAD --oneline -10" in step22
assert "git fetch origin master && git log origin/master" not in step22
# Merge-conflict guidance must also merge FETCH_HEAD (line 148).
assert "git merge FETCH_HEAD" in prompt
assert "git merge origin/master" not in prompt


# ── TaskScheduler._load_tasks ────────────────────────────────────


Expand Down
Loading