Parent issue: #86
Task graph: o5S3jx0DjB7n57RFgw3rj
Node: step-2
Specialist role: backend
Surfaces: backend, frontend
Scope
Implement the primary behavior on the fixed contracts. Add the applyTriageRulesOnce orchestration helper in packages/agents/src/github/issue-poller.ts and export it from packages/agents/src/index.ts. Wire apps/desktop/src/main/index.ts and apps/desktop/src/main/ipc/types.ts to include triageRules queries. Add project rule list/save IPC handlers in apps/desktop/src/main/ipc/register-project-handlers.ts. Update apps/desktop/src/main/ipc/register-github-handlers.ts so each refresh reads the latest project rules from the DB, applies the first enabled matching rule only to newly inserted GitHub issues whose rulesAppliedAt is null, marks no-match/success/failure as consumed, syncs refreshed labels back into github_issue_cache, and records clamped triage failures without rejecting the refresh. In parallel after the IPC contract compiles, the renderer-owned surface can add the Triage rules settings tab by modifying apps/desktop/src/renderer/components/project-settings-modal/shared.ts and apps/desktop/src/renderer/components/ProjectSettingsModal.tsx and creating apps/desktop/src/renderer/components/project-settings-modal/TriageRulesTab.tsx.
Rationale: Once the schema and contracts are stable, backend polling/IPC and renderer composition can proceed with disjoint file ownership while preserving the requirement that settings edits take effect on the next poll because refresh reads rules from the DB every time.
Files
apps/desktop/src/main/index.ts
apps/desktop/src/main/ipc/register-github-handlers.ts
apps/desktop/src/main/ipc/register-project-handlers.ts
apps/desktop/src/main/ipc/types.ts
apps/desktop/src/renderer/components/ProjectSettingsModal.tsx
apps/desktop/src/renderer/components/project-settings-modal/TriageRulesTab.tsx
apps/desktop/src/renderer/components/project-settings-modal/shared.ts
packages/agents/src/github/issue-poller.ts
packages/agents/src/index.ts
Acceptance Criteria
Execution
ShipCode executes this task from the parent issue pipeline and checks it off in the parent task graph comment. Do not route this child issue as a separate agent job.
Parent issue: #86
Task graph:
o5S3jx0DjB7n57RFgw3rjNode:
step-2Specialist role:
backendSurfaces:
backend,frontendScope
Implement the primary behavior on the fixed contracts. Add the applyTriageRulesOnce orchestration helper in packages/agents/src/github/issue-poller.ts and export it from packages/agents/src/index.ts. Wire apps/desktop/src/main/index.ts and apps/desktop/src/main/ipc/types.ts to include triageRules queries. Add project rule list/save IPC handlers in apps/desktop/src/main/ipc/register-project-handlers.ts. Update apps/desktop/src/main/ipc/register-github-handlers.ts so each refresh reads the latest project rules from the DB, applies the first enabled matching rule only to newly inserted GitHub issues whose rulesAppliedAt is null, marks no-match/success/failure as consumed, syncs refreshed labels back into github_issue_cache, and records clamped triage failures without rejecting the refresh. In parallel after the IPC contract compiles, the renderer-owned surface can add the Triage rules settings tab by modifying apps/desktop/src/renderer/components/project-settings-modal/shared.ts and apps/desktop/src/renderer/components/ProjectSettingsModal.tsx and creating apps/desktop/src/renderer/components/project-settings-modal/TriageRulesTab.tsx.
Rationale: Once the schema and contracts are stable, backend polling/IPC and renderer composition can proceed with disjoint file ownership while preserving the requirement that settings edits take effect on the next poll because refresh reads rules from the DB every time.
Files
apps/desktop/src/main/index.tsapps/desktop/src/main/ipc/register-github-handlers.tsapps/desktop/src/main/ipc/register-project-handlers.tsapps/desktop/src/main/ipc/types.tsapps/desktop/src/renderer/components/ProjectSettingsModal.tsxapps/desktop/src/renderer/components/project-settings-modal/TriageRulesTab.tsxapps/desktop/src/renderer/components/project-settings-modal/shared.tspackages/agents/src/github/issue-poller.tspackages/agents/src/index.tsAcceptance Criteria
Execution
ShipCode executes this task from the parent issue pipeline and checks it off in the parent task graph comment. Do not route this child issue as a separate agent job.