feat(engine): per-tenant configuration layer - #5804
Conversation
Adds a pure, deterministic per-tenant configuration layer for the Rent-a-Loop path (JSONbored#4787, part of JSONbored#4778): a customer's own autonomy level (mirroring JSONbored#4782's graduated dial, taken as a value) and repo-specific execution preferences, scoped strictly to their rented repo. resolveTenantConfig merges a tenant's overrides onto the defaults, returning a config that shares no mutable reference with the defaults or any other resolution; setTenantConfig holds configs in an immutable store, returning a new store on every update. Isolation is guaranteed by construction, so one customer setting or mutating their config can never affect another tenant's config or the shared defaults. An unrecognized autonomy level falls back to the default rather than trusting arbitrary input. Resolves and holds config only; persistence is separate. Full coverage. Closes JSONbored#4787
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5804 +/- ##
=======================================
Coverage 95.11% 95.11%
=======================================
Files 586 587 +1
Lines 46480 46494 +14
Branches 14860 14867 +7
=======================================
+ Hits 44209 44223 +14
Misses 1515 1515
Partials 756 756
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-14 20:01:26 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #4787. Adds a pure, deterministic per-tenant configuration layer (
packages/loopover-engine/src/tenant-config.ts) — a customer's own autonomy level (mirroring #4782's graduated dial, taken as a value) and repo-specific execution preferences, scoped strictly to their rented repo.resolveTenantConfig(overrides)merges a tenant's overrides ontoDEFAULT_TENANT_CONFIG, returning a config that shares no mutable reference with the defaults or any other resolution (the action-class list is copied every call); an unrecognized autonomy level falls back to the default rather than trusting arbitrary input.setTenantConfig(store, tenantId, overrides)holds configs in an immutable store, returning a new store on every update and never mutating the input;getTenantConfigreads a tenant's effective config or the defaults.Isolation (acceptance): guaranteed by construction — two tenants hold independent configs for the same loop mechanics, and setting or mutating one can never affect another's config or the shared defaults. Verified by a test that sets two tenants, mutates one's resolved list, and asserts the other tenant and the defaults are untouched.
Resolves and holds config only — persisting it to a datastore is a separate, maintainer-owned concern. Pure engine module, no IO. 100% statements/branches/functions/lines (verified locally: vitest coverage + engine build +
tsc --noEmitclean on the changed files).