481359ddb2
Co-authored-by: Kandev Agent <agent@kandev.dev> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2.3 KiB
2.3 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 07-two-tier-config-storage | Two-tier configuration storage and effective view | todo | 3 |
|
plan.md | ../../specs/multi-tenancy/spec.md |
Task 07: Two-Tier Configuration Storage and Effective View
Acceptance
executors,executor_profiles,environments,agents,agent_profiles,editors,custom_prompts, andnotification_providerseach gainorg_id TEXT NOT NULL DEFAULT ''andtemplate_id TEXT NOT NULL DEFAULT ''via idempotent migrations.- One shared resolver produces the effective view for an org: own rows, plus
every
org_id = ''template whoseidis not thetemplate_idof an own row. There is exactly one implementation; the eight kinds do not each get their own copy. - List responses carry
source: "instance" | "org"andeditable. - Creating an org row from a template records
template_idand shadows it immediately, with no duplicate appearing in the same response. - Deleting an org row un-shadows its template in the next response.
agent_profiles.workspace_id(used by Office) keeps working and composes with the new tier rather than being replaced by it.- With the flag off, every one of these reads returns exactly today's rows.
Verification
go test ./internal/agent/settings/... ./internal/agent/executor/... ./internal/task/repository/...go test ./internal/... -run 'TestEffectiveConfigView|TestTemplateShadowing'KANDEV_TEST_POSTGRES_DSN=... go test ./internal/agent/settings/store/...
Files Likely Touched
apps/backend/internal/agent/settings/store/sqlite.goapps/backend/internal/agent/executor/apps/backend/internal/task/repository/sqlite/base_migrations.goapps/backend/internal/notifications/,internal/prompts/,internal/editors/- New shared resolver, e.g.
apps/backend/internal/tenancy/effective.go apps/backend/internal/tenancy/registry.go
Inputs
- Spec: What (two-tier configuration), API surface (
source/editable). - Patterns: existing
deleted_atsoft-delete andworkspace_idscoping ininternal/agent/settings/store/sqlite.go.
Output Contract
Report the single resolver's call sites (must be all eight kinds), the shadow/un-shadow tests, flag-off byte-identity evidence, RED/GREEN commands, and set this task plus its plan checkbox to done.