Add resolver connection policy layer and comprehensive test suite#618
Draft
Add resolver connection policy layer and comprehensive test suite#618
Conversation
Add 63 tests across 5 test files covering custom/user-defined resolvers (GenericResolver), resolver registry, method delegation, subscriptions, error handling, auth info, and multi-resolver scenarios. Also add resetResolverRegistry() for test isolation and shared test utilities.
… breaker - Extend grammar to support @meta on resolver definitions - Add ConnectionPolicy model, parser, enforcement engine, and PolicyResolver decorator that transparently wraps resolver CRUD operations - Persist policies to a dedicated core module (agentlang.policy entity) - Timer-based refresh loads policies from DB on a configurable interval (default 300s), so DB-side policy updates take effect at runtime - Resolver factory reads policy cache dynamically on each call - Policy defaults are configurable via config.al under resolver.connectionPolicy - Export normalizeMetaValue from module.ts for reuse in loader
Resolver subscriptions previously ran @after workflows as the hardcoded admin user. This introduces a SubscriptionEnvelope that wraps subscription data with tenantId and userId, so @after workflows execute in the correct user context. The envelope is backward compatible — raw results work as before.
Read GMAIL_TENANT_ID and GMAIL_USER_ID from env and wrap subscription data in createSubscriptionEnvelope so @after workflows execute in the correct user/tenant context instead of the hardcoded admin user.
Remove unused catch variables, unused `inst` declaration in queryEmail, unused imports (vi, CircuitBreakerState, InstanceAttributes), and prefix unused parameter with underscore.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
@metaon resolver definitions in.alfiles and enforced transparently as a decorator wrapping resolver CRUD operationsconfig.alunderresolver.connectionPolicyTest plan
npm run buildcompiles without errorsnpm run test— all existing and new tests pass@metaconnection policy applies timeout/retry/circuit breaker at runtime