-
Notifications
You must be signed in to change notification settings - Fork 54
feature(api): cache proposal data model + service + MCP propose tools #134
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
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
508af11
feature(api): add cache proposal data model
jamby77 79e978c
fix(api): apply bugbot findings on cache proposal data model
jamby77 131bb42
fix(api): apply round-2 bugbot findings on cache proposal data model
jamby77 3f21579
feature(api): add cache proposal service and 3 MCP propose tools
jamby77 ed05f42
fix(api): apply bugbot findings on cache proposal service
jamby77 d8c0351
fix(api): apply round-2 bugbot findings on cache proposal service
jamby77 646bb88
fix(api): rate limiter reserve() returns post-record remaining
jamby77 f3a24dc
fix(api): release rate-limit slot when storage write fails
jamby77 5bade0c
fix(api): apply round-3 bugbot findings on combined cache proposals PR
jamby77 ccb4f97
chore(api): consolidate discovery-marker key constants in shared
jamby77 542e92b
refactor(api): introduce SEMANTIC_CACHE / AGENT_CACHE constants
jamby77 a4c1d1e
fix(api): apply round-4 bugbot findings on cache proposal service
jamby77 2b74f2e
chore(api): disable explicit return type rule in ESLint config
jamby77 c499e64
fix(api): make pending unique indexes treat NULL category/tool_name a…
jamby77 1c00b6c
fix(api): align proposal_payload validation order with expected_statu…
jamby77 e1e8096
fix(api): rename pending unique indexes to _v2 + keep rate-limit slot…
jamby77 9a8b19e
feature(api): add 6 read-only cache MCP tools
jamby77 073407f
refactor(api): use shared discovery-protocol keys + extract readonly …
jamby77 e4accd0
refactor(api): extract readHashInt helper and simplify CacheReadonlyS…
jamby77 725fb0d
refactor(api): use SEMANTIC_CACHE / AGENT_CACHE in CacheReadonlyService
jamby77 41751b3
refactor(api): pull recommendation strings + reasonings into named co…
jamby77 23f5f1a
refactor(api): rename valkey-fields → record-fields
jamby77 df4049b
fix(api): listCaches reads __stats from prefix, not name
jamby77 af032f6
fix(api): drop redundant avgNearMissDelta guard in loosen-threshold b…
jamby77 8e7044d
feature(api): add cache proposal approve/reject/edit + apply dispatcher
jamby77 16844a4
fix(api): address bugbot findings on apply dispatcher PR
jamby77 ea47b86
fix(api): scope agent_cache key_prefix invalidate to cache namespace
jamby77 af5cf8b
fix(api): plumb proposalId into all apply-dispatcher errors + escapeG…
jamby77 ba932ec
feature(web): cache proposals UI with pending/history views
jamby77 68b1dcd
fix(web): share cache-proposals unread state across hook instances
jamby77 88beada
fix(web): correct cache-proposals source column and unread count
jamby77 1bef37b
fix(web): enforce monotonic lastSeenAt to prevent unread badge regres…
jamby77 6901271
feature(web): cache proposals UI (#138)
jamby77 1f6442e
Cache proposal approve/reject/edit + apply dispatcher (#137)
jamby77 bbedf2d
feature(api): read-only cache MCP tools (#136)
jamby77 80d9951
fix(api): apply dispatcher uses cache.prefix, not cache.name, for Val…
jamby77 71db792
fix(api): semantic invalidate FT.SEARCH index uses cache.prefix
jamby77 9a6017f
fix(api): wrap history endpoint in mapCacheProposalErrorToHttp
jamby77 fd24114
fix(api): reject unsupported cache_type/proposal_type combos in dispatch
jamby77 3680fd7
fix(api): approve idempotency on failed proposal returns prior result
jamby77 ab114e4
fix(api): address bugbot findings on cache-proposals
jamby77 31afa1f
fix(api): memory adapter dup check matches SQL partial-index sub-key
jamby77 8923d4a
fix(api): read live current threshold/TTL from Valkey when proposing
jamby77 7dff00f
fix(api): cache-proposals storage tests use distinct categories
jamby77 b1a1e77
fix(api): simplify dead-code branch in readCurrentThreshold
jamby77 8d4d4ff
fix(api): read dispatcher-written threshold override before SDK baseline
jamby77 913ee95
fix(api): deep-clone expired proposal in memory adapter
jamby77 6279323
fix(api): editAndApprove fails fast on unsupported proposal_type
jamby77 8e10355
fix(api): unify expiry boundary to <= across service and storage
jamby77 7edd19b
Merge remote-tracking branch 'origin/master' into feature/cache-propo…
jamby77 3016e7f
feature(semantic-cache): runtime threshold overrides via {prefix}:__c…
jamby77 ce24103
feature(mcp): wire 5 cache-proposal approval tools
jamby77 b92dbe8
docs(mcp): document cache intelligence tools + sync server.json version
jamby77 5e5d971
refactor(cache-proposals): move entire feature to proprietary as Pro …
jamby77 7783576
test(web): cover HistoryTable, DetailPanel, useCacheProposalsUnread +…
jamby77 54d899a
feat(cache-proposals): runtime config refresh for agent-cache and sem…
KIvanow 39d5660
refactor(semantic-cache): drop redundant B3 read-time threshold layer…
jamby77 9249a97
fix(cache-proposals): use @app alias for ConnectionRegistry import in…
jamby77 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| export function readIntField(record: Record<string, string>, field: string): number { | ||
| const value = record[field]; | ||
| if (value === undefined || value === '') { | ||
| return 0; | ||
| } | ||
| const parsed = parseInt(value, 10); | ||
| return Number.isNaN(parsed) ? 0 : parsed; | ||
| } |
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,41 @@ | ||
| import { BadRequestException, Injectable, PipeTransform } from '@nestjs/common'; | ||
|
|
||
| export const INSTANCE_ID_RE = /^[a-zA-Z0-9_-]+$/; | ||
| export const MAX_LIMIT = 10000; | ||
|
|
||
| @Injectable() | ||
| export class ValidateInstanceIdPipe implements PipeTransform<string, string> { | ||
| transform(value: string): string { | ||
| if (!INSTANCE_ID_RE.test(value)) { | ||
| throw new BadRequestException('Invalid instance ID'); | ||
| } | ||
| return value; | ||
| } | ||
| } | ||
|
|
||
| export function safeParseInt(value: string | undefined, defaultValue: number): number; | ||
| export function safeParseInt(value: string | undefined, defaultValue?: undefined): number | undefined; | ||
| export function safeParseInt(value: string | undefined, defaultValue?: number): number | undefined { | ||
| if (value === undefined) { | ||
| return defaultValue; | ||
| } | ||
| const parsed = parseInt(value, 10); | ||
| if (isNaN(parsed)) { | ||
| return defaultValue; | ||
| } | ||
| return parsed; | ||
| } | ||
|
|
||
| /** Parse and cap a limit/count query param */ | ||
| export function safeLimit(value: string | undefined, defaultValue: number): number { | ||
| return Math.max(1, Math.min(safeParseInt(value, defaultValue), MAX_LIMIT)); | ||
| } | ||
|
|
||
| /** Convert ms timestamp query param to seconds. */ | ||
| export function msToSeconds(value: string | undefined): number | undefined { | ||
| const ms = safeParseInt(value); | ||
| if (ms === undefined || ms < 0) { | ||
| return undefined; | ||
| } | ||
| return Math.floor(ms / 1000); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.