feat: enhance review process and role management

- Refactor reviewPass function to identify states with review checks instead of specific review types.
- Introduce review policies (HUMAN, AGENT, AUTO) to control PR review processes based on developer levels.
- Update projectTick to handle review policies and step routing labels for reviewers and testers.
- Add detailed reviewer instructions to templates for clarity on review responsibilities.
- Implement role:level label management, allowing dynamic creation of labels based on project configuration.
- Enhance task_update tool to support state and level updates, ensuring at least one parameter is provided.
- Update work_finish tool to include reviewer actions (approve, reject) in task completion.
- Modify work_start tool to utilize role-level detection for better level assignment.
- Add tests for new functionalities, including review routing and level detection from labels.
This commit is contained in:
Lauren ten Hoor
2026-02-16 18:09:53 +08:00
parent 1464fa82d2
commit d87b9f68a2
25 changed files with 1134 additions and 294 deletions

View File

@@ -122,16 +122,16 @@ describe("E2E bootstrap — hook injection", () => {
// Default developer instructions are scaffolded by ensureDefaultFiles
assert.strictEqual(files.length, 1);
assert.ok(files[0].content!.includes("DEVELOPER"), "Should contain DEVELOPER heading");
assert.ok(files[0].content!.includes("work_finish"), "Should reference work_finish");
assert.ok(files[0].content!.includes("worktree"), "Should reference git worktree workflow");
});
it("should NOT inject anything for unknown custom roles", async () => {
h = await createTestHarness({ projectName: "custom-app" });
// Simulate a session key for a custom role that has no prompt file
// This key won't parse because "reviewer" isn't in the role registry
// This key won't parse because "investigator" isn't in the role registry
const files = await h.simulateBootstrap(
"agent:main:subagent:custom-app-reviewer-medior",
"agent:main:subagent:custom-app-investigator-medior",
);
assert.strictEqual(files.length, 0, "Should not inject files for unknown roles");