-
-
Notifications
You must be signed in to change notification settings - Fork 77
RE1-T105 Fixing issues with routes. #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| <!-- dgc-policy-v11 --> | ||
| # Dual-Graph Context Policy | ||
|
|
||
| This project uses a local dual-graph MCP server for efficient context retrieval. | ||
|
|
||
| ## MANDATORY: Adaptive graph_continue rule | ||
|
|
||
| **Call `graph_continue` ONLY when you do NOT already know the relevant files.** | ||
|
|
||
| ### Call `graph_continue` when: | ||
| - This is the first message of a new task / conversation | ||
| - The task shifts to a completely different area of the codebase | ||
| - You need files you haven't read yet in this session | ||
|
|
||
| ### SKIP `graph_continue` when: | ||
| - You already identified the relevant files earlier in this conversation | ||
| - You are doing follow-up work on files already read (verify, refactor, test, docs, cleanup, commit) | ||
| - The task is pure text (writing a commit message, summarising, explaining) | ||
|
|
||
| **If skipping, go directly to `graph_read` on the already-known `file::symbol`.** | ||
|
|
||
| ## When you DO call graph_continue | ||
|
|
||
| 1. **If `graph_continue` returns `needs_project=true`**: call `graph_scan` with `pwd`. Do NOT ask the user. | ||
|
|
||
| 2. **If `graph_continue` returns `skip=true`**: fewer than 5 files — read only specifically named files. | ||
|
|
||
| 3. **Read `recommended_files`** using `graph_read`. | ||
| - Always use `file::symbol` notation (e.g. `src/auth.ts::handleLogin`) — never read whole files. | ||
| - `recommended_files` entries that already contain `::` must be passed verbatim. | ||
|
|
||
| 4. **Obey confidence caps:** | ||
| - `confidence=high` → Stop. Do NOT grep or explore further. | ||
| - `confidence=medium` → `fallback_rg` at most `max_supplementary_greps` times, then `graph_read` at most `max_supplementary_files` more symbols. Stop. | ||
| - `confidence=low` → same as medium. Stop. | ||
|
|
||
| ## Session State (compact, update after every turn) | ||
|
|
||
| Maintain a short JSON block in your working memory. Update it after each turn: | ||
|
|
||
| ```json | ||
| { | ||
| "files_identified": ["path/to/file.py"], | ||
| "symbols_changed": ["module::function"], | ||
| "fix_applied": true, | ||
| "features_added": ["description"], | ||
| "open_issues": ["one-line note"] | ||
| } | ||
| ``` | ||
|
|
||
| Use this state — not prose summaries — to remember what's been done across turns. | ||
|
|
||
| ## Token Usage | ||
|
|
||
| A `token-counter` MCP is available for tracking live token usage. | ||
|
|
||
| - Before reading a large file: `count_tokens({text: "<content>"})` to check cost first. | ||
| - To show running session cost: `get_session_stats()` | ||
| - To log completed task: `log_usage({input_tokens: N, output_tokens: N, description: "task"})` | ||
|
|
||
| ## Rules | ||
|
|
||
| - Do NOT use `rg`, `grep`, or bash file exploration before calling `graph_continue` (when required). | ||
| - Do NOT do broad/recursive exploration at any confidence level. | ||
| - `max_supplementary_greps` and `max_supplementary_files` are hard caps — never exceed them. | ||
| - Do NOT call `graph_continue` more than once per turn. | ||
| - Always use `file::symbol` notation with `graph_read` — never bare filenames. | ||
| - After edits, call `graph_register_edit` with changed files using `file::symbol` notation. | ||
|
|
||
| ## Context Store | ||
|
|
||
| Whenever you make a decision, identify a task, note a next step, fact, or blocker during a conversation, append it to `.dual-graph/context-store.json`. | ||
|
|
||
| **Entry format:** | ||
| ```json | ||
| {"type": "decision|task|next|fact|blocker", "content": "one sentence max 15 words", "tags": ["topic"], "files": ["relevant/file.ts"], "date": "YYYY-MM-DD"} | ||
| ``` | ||
|
|
||
| **To append:** Read the file → add the new entry to the array → Write it back → call `graph_register_edit` on `.dual-graph/context-store.json`. | ||
|
|
||
| **Rules:** | ||
| - Only log things worth remembering across sessions (not every minor detail) | ||
| - `content` must be under 15 words | ||
| - `files` lists the files this decision/task relates to (can be empty) | ||
| - Log immediately when the item arises — not at session end | ||
|
|
||
| ## Session End | ||
|
|
||
| When the user signals they are done (e.g. "bye", "done", "wrap up", "end session"), proactively update `CONTEXT.md` in the project root with: | ||
| - **Current Task**: one sentence on what was being worked on | ||
| - **Key Decisions**: bullet list, max 3 items | ||
| - **Next Steps**: bullet list, max 3 items | ||
|
|
||
| Keep `CONTEXT.md` under 20 lines total. Do NOT summarize the full conversation — only what's needed to resume next session. | ||
|
|
||
| --- | ||
|
|
||
| # Coding Standards | ||
|
|
||
| ## General | ||
|
|
||
| Write C# code that maximises readability, maintainability, and correctness while minimising complexity and coupling. Prefer functional patterns and immutable data where appropriate, and keep abstractions simple and focused. | ||
|
|
||
| - Write clear, self-documenting code | ||
| - Keep abstractions simple and focused | ||
| - Minimise dependencies and coupling | ||
| - Use modern C# features appropriately | ||
| - Use the repository pattern with Dapper at the repository layer for SQL Server and PostgreSQL database communication | ||
|
|
||
| ## Code Organisation | ||
|
|
||
| **Use meaningful names — no unclear abbreviations:** | ||
| ```csharp | ||
| // Good | ||
| public async Task<Result<Order>> ProcessOrderAsync(OrderRequest request, CancellationToken cancellationToken) | ||
|
|
||
| // Avoid | ||
| public async Task<Result<T>> ProcAsync<T>(ReqDto r, CancellationToken ct) | ||
| ``` | ||
|
|
||
| **Separate state from behaviour:** | ||
| ```csharp | ||
| // Good | ||
| public sealed record Order(OrderId Id, List<OrderLine> Lines); | ||
|
|
||
| public static class OrderOperations | ||
| { | ||
| public static decimal CalculateTotal(Order order) => | ||
| order.Lines.Sum(line => line.Price * line.Quantity); | ||
| } | ||
| ``` | ||
|
|
||
| **Prefer pure methods — avoid hidden side effects:** | ||
| ```csharp | ||
| // Good | ||
| public static decimal CalculateTotalPrice(IEnumerable<OrderLine> lines, decimal taxRate) => | ||
| lines.Sum(line => line.Price * line.Quantity) * (1 + taxRate); | ||
|
|
||
| // Avoid | ||
| public void CalculateAndUpdateTotalPrice() | ||
| { | ||
| this.Total = this.Lines.Sum(l => l.Price * l.Quantity); | ||
| this.UpdateDatabase(); | ||
| } | ||
| ``` | ||
|
|
||
| **Use extension methods for domain-specific operations:** | ||
| ```csharp | ||
| public static class OrderExtensions | ||
| { | ||
| public static bool CanBeFulfilled(this Order order, Inventory inventory) => | ||
| order.Lines.All(line => inventory.HasStock(line.ProductId, line.Quantity)); | ||
| } | ||
| ``` | ||
|
|
||
| **Design for testability — avoid hidden dependencies:** | ||
| ```csharp | ||
| // Good: pure, easily testable | ||
| public static decimal CalculateDiscount(decimal price, int quantity, CustomerTier tier) => ... | ||
|
|
||
| // Avoid: hidden service calls make this impossible to unit test | ||
| public decimal CalculateDiscount() | ||
| { | ||
| var user = _userService.GetCurrentUser(); | ||
| var settings = _configService.GetSettings(); | ||
| ... | ||
| } | ||
| ``` | ||
|
|
||
| ## Dependency Management | ||
|
|
||
| **Minimise constructor injection — too many dependencies signal a design problem:** | ||
| ```csharp | ||
| // Good | ||
| public sealed class OrderProcessor(IOrderRepository repository) { } | ||
|
|
||
| // Avoid | ||
| public class OrderProcessor( | ||
| IOrderRepository repository, | ||
| ILogger logger, | ||
| IEmailService emailService, | ||
| IMetrics metrics, | ||
| IValidator validator) { } | ||
| ``` | ||
|
|
||
| **Prefer composition via interfaces:** | ||
| ```csharp | ||
| public sealed class EnhancedLogger(ILogger baseLogger, IMetrics metrics) : ILogger { } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use one English variant consistently in this document.
Line 94 uses “summarize” while other sections use UK spelling (“minimise”, “organisation”). Please normalize to one dialect for consistency.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~94-~94: Do not mix variants of the same word (‘summarize’ and ‘summarise’) within a single text.
Context: ...ONTEXT.md` under 20 lines total. Do NOT summarize the full conversation — only what's nee...
(EN_WORD_COHERENCY)
🤖 Prompt for AI Agents