Store stack config as a _config@1 record#41
Merged
Conversation
Removes getConfig/setConfig from StackAdapter. Stack-level configuration
(ownerEntityId, timezone) is now stored as a singleton _config@1 record
in the records table and exposed as typed readonly properties on the adapter.
- StackAdapter gains ownerEntityId and timezone as required properties
- ConfigContent type and SYSTEM_TYPES.CONFIG added to core
- Stack.create() reads directly from adapter properties
- seedSystemTypes() seeds the _config@1 type definition
- SQLiteAdapter stores config as a _config@1 record; runMigrations()
handles existing databases with a stack_config table
- buildWhereClause excludes the singleton _config record from all queries
- APIAdapter reads ownerEntityId/timezone from the discovery response
- MemoryAdapter constructor takes { ownerEntityId?, timezone? } options
- All tests updated accordingly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FiDqP6DsUEgtxTaAUj62iE
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FiDqP6DsUEgtxTaAUj62iE
No reason to store them twice — the adapter is the source of truth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FiDqP6DsUEgtxTaAUj62iE
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
getConfig/setConfigfromStackAdapter— config is no longer a stringly-typed key/value bag on the adapter interfaceownerEntityId,timezone) is now stored as a singleton_config@1record in the records table and exposed as typedreadonlyproperties directly on the adapterstack_configtable, API adapter's internalMap) now populate the properties from their natural source (record query / discovery endpoint)What changed
@haverstack/coreStackAdaptergainsreadonly ownerEntityId: stringandreadonly timezone: string;getConfig/setConfigremovedConfigContenttype andSYSTEM_TYPES.CONFIG('_config') exportedStack.create()reads directly fromadapter.ownerEntityId/adapter.timezoneseedSystemTypes()now seeds the_config@1type definitionMemoryAdapterconstructor changes fromRecord<string, string>to{ ownerEntityId?, timezone? }@haverstack/adapter-sqlite_config@1record withid='_config'in the records table;stack_configtable removed from schemarunMigrations()handles existing databases by readingstack_config, writing the record, and dropping the tablebuildWhereClausealways excludes the'_config'singleton from app-visible queries@haverstack/adapter-apiownerEntityIdandtimezonepopulated from the discovery response and exposed as public properties;getConfig/setConfigremovedTest plan
pnpm -r testpasses (182 core + 75 SQLite + 48 API = 305 tests)stack_configtables are migrated cleanly on nextopen()_configrecord does not appear inqueryRecordsresultsGenerated by Claude Code