Repository navigation
feat(admin): runtime settings, versioned rules and knowledge, per-scope spend - #25
Merged
Merged
Conversation
…pe spend - Config: ConfigOverridesInterface over AgentConfig through RuntimeAgentConfig; AgentLoop, BudgetPolicy, MemoryRuntime and StaticPromptBuilder read the provider. - Providers: RoutedProvider picks the turn's and memory's platform per call; ApiKeyResolverInterface with KeyedPlatform and KeyedPlatformPass for a key per platform. - Budget: SpendEntry::$scope and scopeDailyBudgetUsd, a day cap per scope. - Content: VersionStoreInterface (memory and Doctrine) with drafts, publications and back to the default; VersionedRuleSource and VersionedKnowledgeSource override by id. - StaticPromptBuilder keeps its text per settings, fragments, rules and guides. - CurrentSession for settings outside a request; MemoryRetentionInterface for agent:prune.
- ScopedCapabilityInterface and ScopeArea: a capability names an area of what
the assistant does; the "Stay within …" line lists the registered ones by
priority, as the reference builds it ("a and b", "a, b, and c").
- Without any area the line keeps the neutral default (DEFAULT_SCOPE).
- identity.scope and AgentConfig::$scope are removed (breaking).
- ScopedCapabilityInterface and ScopeArea: a capability names an area of what
the assistant does; the "Stay within …" line lists the registered ones by
priority ("a and b", "a, b, and c").
- Without any area the line keeps the neutral default (DEFAULT_SCOPE).
- identity.scope and AgentConfig::$scope are removed (breaking).
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.
What
The core pieces a host needs to configure and teach the agent from an admin, without a deploy.
Config\ConfigOverridesInterfacelays the host's saved settings over theconfiguration per request (
RuntimeAgentConfig). A rejected value falls back to theconfiguration and is logged.
RoutedProviderpicks the turn's and the memory's platformon each call;
ApiKeyResolverInterfacegives a key per platform, used throughKeyedPlatform(
KeyedPlatformPassrebuilds the configured platform with it).SpendEntry::$scope), andscopeDailyBudgetUsdcaps it per day. The configured day cap still applies to the total.Content\VersionStoreInterface(in memory and Doctrine, optionalorm.classes.content_version) with drafts, publications and "back to the default". Theversioned sources override the configured rules and documents by id;
RuleBook,GuideIndexand the cached prompt rebuild when the revision changes.
StaticPromptBuilderkeeps one text per combination of settings, fragments,rules and guides, so it stays byte-identical across turns until one of them changes.
MemoryRetentionInterfacelets the host decide the retentionagent:pruneuses.Session\CurrentSessionfor settings read outside a request (a memory worker).Breaking
SpendLedgerInterface: newscopeSpend()and a$scopeargument onrecord().SpendEntrygains thescopecolumn and its index: the host needs a migration.sources wrap them.