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 packages/daemon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ework-daemon",
"version": "0.4.207",
"version": "0.4.209",
"description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
"module": "src/index.ts",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/daemon/src/opencode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4137,7 +4137,7 @@ Check states: read the mirror cache (see AGENTS.md), do not poll gh for check st
...this.authorityLines(auth),
`The working directory below is your own clone of the repo. Only claim actions you actually performed — verify with tools (git status/log) before asserting any push, merge, or change.`,
`HARD RULE — no new issues for decisions or follow-ups (owner policy 2026-11-01): when you reach a point where a human must decide, or want to park a systemic question / follow-up found mid-task, NEVER open a new issue — and never bypass the platform by calling the GitHub API directly for it: post ONE comment ON THIS THREAD whose first line is "🔶 需要决策" (背景一句话 / 待决问题 / 选项各带代价 / 你的推荐 + 不决定的默认行为), then apply the needs-decision label via tools/add-label.sh <owner> <repo> <号> (workdir-root tools/ dir; see AGENTS.md §需要人工决策时). A brand-new issue is reserved for genuinely independent, self-contained work that the owner explicitly asked to be tracked separately — cite the source thread in its body. EXCEPTION (owner policy 2026-11-11, root-cause aggregation flow): aggregation issues created by the classification pipeline — title prefix [根因] plus label root-cause-batch, body citing the aggregated source issues — are authorized independent work and need no per-issue owner approval; the decision/follow-up restriction above still applies to everything else. Deliverables stay code: commit + PR per AGENTS.md 交付规范. Status freshness (owner policy 2026-11-07): whenever your reply claims the CURRENT state of this thread / PR / CI (red vs green, merged, labeled, whose turn it is) — including explaining why something waits — verify it LIVE first using the recent thread comments plus the mirror/API sources available to you; earlier comments, from other bots AND from your own older runs, may describe a state that has since changed, and answering from that memory is exactly how threads get contradictory replies across sessions; if you could not verify it live, say so instead of asserting it. Only claim actions YOU actually performed. ${this.replyLanguageRule}`,
`HARD RULE — one fix PR per thread; GitHub numbers outside the mirror (owner policy 2026-11-05, per e-work#44 plan): before opening any fix branch/PR for this thread, list open [PR] rows (curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_URL/api/v1/issues?owner=<owner>&repo=<repo>&state=open" | jq -r '.issues[] | select(.title|startswith("[PR]")) | (.number|tostring) + " " + .title'); if one already targets this same thread/topic, ADD your commits to that existing branch/PR instead of opening a parallel second one — two open PRs fixing one thread is how merges start stepping on each other. In everything that leaves the mirror (commit messages, PR title/body, branch names, cross-references) use ONLY GitHub numbers: for this task that number is stated in the identity note at the top of this prompt; for any OTHER number you want to cite, first run gh api repos/<owner>/<repo>/issues/<N> --jq .title and confirm its GitHub title actually matches your topic before using it. Never write an internal mirror number into commit/PR/branch artifacts. HARD RULE — every PR you open gets its labels BY YOU before delivery, judged on the PR's OWN diff (owner policy 2026-11-07): run gh pr edit <N> --add-label <labels> and pick from the repo's own label set (fetch once: gh api repos/<owner>/<repo>/labels --paginate). Minimum bar: one category label (bug / enhancement / documentation / …) AND the priority label per the repo AGENTS.md triage scale (p1/p2/p3) — decide it from what THIS PR changes, never inherit or copy the source issue's labels as a substitute, and never open an agent PR unlabeled ('the mirror thread has no labels' / 'the flaw lives upstream' are not reasons): an agent PR without independent labels is incomplete delivery.`,
`HARD RULE — one fix PR per thread; GitHub numbers outside the mirror (owner policy 2026-11-05, per e-work#44 plan): before opening any fix branch/PR for this thread, list open [PR] rows (curl -s -H "Authorization: token $GITEA_TOKEN" "$GITEA_URL/api/v1/issues?owner=<owner>&repo=<repo>&state=open" | jq -r '.issues[] | select(.title|startswith("[PR]")) | (.number|tostring) + " " + .title'); if one already targets this same thread/topic, ADD your commits to that existing branch/PR instead of opening a parallel second one — two open PRs fixing one thread is how merges start stepping on each other. In everything that leaves the mirror (commit messages, PR title/body, branch names, cross-references) use ONLY GitHub numbers: for this task that number is stated in the identity note at the top of this prompt; for any OTHER number you want to cite, first run gh api repos/<owner>/<repo>/issues/<N> --jq .title and confirm its GitHub title actually matches your topic before using it. Never write an internal mirror number into commit/PR/branch artifacts. HARD RULE — every PR you open gets its labels BY YOU before delivery, judged on the PR's OWN diff (owner policy 2026-11-07): run gh pr edit <N> --add-label <labels> and pick from the repo's own label set (fetch once: gh api repos/<owner>/<repo>/labels --paginate). Minimum bar: one category label (bug / enhancement / documentation / …) AND the priority label per the repo AGENTS.md triage scale (p1/p2/p3) — decide it from what THIS PR changes, never inherit or copy the source issue's labels as a substitute, and never open an agent PR unlabeled ('the mirror thread has no labels' / 'the flaw lives upstream' are not reasons): an agent PR without independent labels is incomplete delivery. HARD RULE — no source-issue rename or relabel (owner policy 2026-11-12; incident 2026-11-12: a worker bilingualized a maintenance-managed aggregation issue's title, the maintenance script matched issues by title and created 20 duplicates in 3 hours): NEVER rename, relabel, close, edit, or otherwise mutate the SOURCE issue/PR this task points at — not to translate or bilingualize its title, not to fix its labels, not to tidy it. Its title, labels and state are owned by its author and by automation that may match on them; your deliverables are your OWN reply comment, your commits, and your OWN new PRs only. Wanting to improve the source issue's wording is a suggestion for a comment, never a direct edit.`,
``,
`A new issue needs your attention:`,
`- Issue: "${title}" (${instructions.issueRef})`,
Expand Down
11 changes: 11 additions & 0 deletions packages/daemon/tests/identity-pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,15 @@ describe("global no-decision-issue rule in base prompts", () => {
expect(prompt).toContain("(.number|tostring)");
expect(prompt).not.toContain("/api/<owner>/<repo>/issues");
});

test("buildInitialPrompt embeds the no-source-issue-rename rule", () => {
const { Engine } = require("../src/opencode");
const self = engineSelf();
const prompt = Engine.prototype.buildInitialPrompt.call(
self, "ework-daemon", "t", "b", "ranxianglei", "/wd",
{ clone: "git clone x .", issueRef: "acme/widgets#42" }, null,
);
expect(prompt).toContain("no source-issue rename");
expect(prompt).toContain("NEVER rename, relabel, close, edit");
});
});
Binary file not shown.
Loading