Skip to content

Commit 50bb024

Browse files
committed
feat: link PRs to Issues via Native Edge Graph RESOLVES edges; mandate PR body Fat Ticket summaries (#9851)
1 parent 157ad63 commit 50bb024

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ You **MUST** perform these steps in order before marking a task as complete:
156156
4. **One PR per Ticket:** Enforce a strict 1-to-1 ratio between an Issue and a Pull Request. Do not bundle multiple unassociated issues into a single PR.
157157
- **Epic Exception:** An Epic may have a single overarching PR that resolves all of its associated Sub-Issues.
158158
5. **Assign:** Ensure the Pull Request and the underlying Ticket are assigned to the current user to capture credit.
159-
6. **Handoff:** Post a comment on the original issue and the PR if you deviated from the original plan. The agent's task is considered "Done" once the PR is opened and ready for human review. Do not merge it yourself.
159+
6. **Handoff:** The PR body MUST contain a "Fat Ticket Style" summary of the changes made, explicitly highlighting any deviations from the original issue's scope, and clarifying what previous closing discussions or commits accomplished. The agent's task is considered "Done" once the PR is opened and ready for human review. Do not merge it yourself.
160160

161161
## 9. Preventing Context Corruption (State Management)
162162

AGENTS_STARTUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,4 +271,4 @@ Without this context, sub-agents will hallucinate bugs where none exist (e.g., c
271271
- **The Architectural Reality:** Point out exactly *which* Neo.mjs patterns or class topologies this issue interacts with. Include specific paths to files discovered during your research.
272272
- **Avoided "Gold Standards" / Traps:** Explain *why* you decided not to use alternative paths. Specifically highlight if you avoided a generic industry or LLM "Gold Standard" (e.g., standard React patterns, generic node workflows) because it acts as a trap within Neo.mjs's unique multi-threaded architecture.
273273
7. **Handoff Realization:** On boot (`initAsync`), nodes like Mac 2 automatically synthesize the latest synced `.md` issues into their local SQLite matrix and build `sandman_handoff.md`. If your tickets are "Fat," the resulting "Golden Path" ranking will accurately bridge the distributed swarm without ever merging the raw SQLite files.
274-
8. **Pull Request Collaboration:** Once you begin actionable work, you are acting as an asynchronous contributor. All code changes MUST culminate in a Pull Request against the `dev` branch (see `AGENTS.md` Section 8). Direct commits to `main` or `dev` are forbidden, ensuring the team can review and critique the implementation before integration.
274+
8. **Pull Request Collaboration:** Once you begin actionable work, you are acting as an asynchronous contributor. All code changes MUST culminate in a Pull Request against the `dev` branch (see `AGENTS.md` Section 8). The PR body MUST contain a "Fat Ticket" style summary detailing the execution and highlighting any scope deviations, alongside the `Resolves #[Issue Number]` keyword. Direct commits to `main` or `dev` are forbidden, ensuring the team can review and critique the implementation before integration.

ai/daemons/DreamService.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,20 @@ ${topContent}
910910
logger.debug(`[DreamService] Ingested ${gapType} from ${prId}: ${gapNodeId}`);
911911
}
912912
}
913+
914+
// Lexical scanning for Resolves/Closes/Fixes issue linkages
915+
const issueMatches = [...content.matchAll(/(?:(?:Resolves|Closes|Fixes)\s+#)(\d+)/gi)];
916+
for (const issueMatch of issueMatches) {
917+
const issueNumber = issueMatch[1];
918+
const issueNodeId = `issue-${issueNumber}`;
919+
920+
// Create Hebbian edge for PR resolving Issue
921+
GraphService.linkNodes(prId, issueNodeId, 'RESOLVES', 1.0, {
922+
justification: `PR #${meta.number} explicitly resolves Issue #${issueNumber}.`
923+
});
924+
925+
logger.debug(`[DreamService] Linked PR ${prId} as resolving ${issueNodeId}`);
926+
}
913927
}
914928
} catch (e) {
915929
logger.warn(`[DreamService] Failed to process pull request feedback for ${file}`, e);

0 commit comments

Comments
 (0)