refactor/types: restructure API/store, split agent modes, consolidate web stores, harden security #5
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ersyne/ersa-agent!5
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Large pre-1.0 structural pass across the Go server, branch tooling, and the web
client. Mostly moving code and deleting duplication, with a set of security
fixes folded in. 25 commits, 214 files, +12.5k/−8.4k.
Go server
internal/store.Querierand replace the per-domain dep structs(
AccountDeps,KeyDeps,OverviewDeps,AdminDeps,ModeDeps) with oneshared interface, decoupling
internal/apifrominternal/server/db.internal/server/agents/{modes,auto,notice}into their own subpackages;delete the
internal/server/api_admin.goadapter in favor ofinternal/api/admin.go.messagedomain (api/message.go, 470lines of new tests) and drop the leftover handlers from
session.go.ModelOptions→model.Options,AdditionalOptionswidened to
map[string]any;ServiceTiernow lives inside it andAutoReasoningLevelis gone.sessions.initiator(system/user/agent) so initiator is gated in coderather than inferred, and
DeleteSubagentSessionnow relies on FK cascade.Security / robustness
web_fetchrefuses loopback, link-local, private-range and multicastdestinations at both URL and dial time (DNS rebinding), and vets every redirect.
shellclampstimeout_secondsbefore the multiplication and sweeps theprocess group after cancellation, so a SIGTERM-ignoring grandchild can't outlive the call.
sandboxbounds host-binary probes with a 5s timeout, fixes nested read-onlybind ordering, and keeps rw precedence when a path is in both ro_paths and rw_paths.
params members, tighten key scope grammar, make
key/createcookie-only,compare hosts port-stripped in CSRF, refuse unverified OIDC emails, and purge
user sessions past the 72h max lifetime in the janitor.
Web
useBranchStorecentralizes the connected-branch list plus itsload/error/loaded state and invalidator;
BranchMenuandMentionPalettestop calling
branch/listindependently.BusyBadge,PrimaryButton,QuietButton),callAllPagesandparseJSONhelpers, and awithStoretest helper.ApiError(0)instead of abare
TypeError; notification handler rejections are logged; the SharedWorkerport is closed on non-persisted
pagehide.Tests
pkg/toolschemaextraction tests,branch/fs,sandbox,web_fetch,sameorigin,querier,auth/user, sessions/messages DB,graph.ts,branch.ts.internal/testutilto fix cross-test interferenceand the branch hub test race.
Breaking changes
session/*message verbs →message/*.modelOptionscolumn →model_options,service_tierandauto_reasoning_levelremoved,initiatoradded. Existing dev DBs need a reset.subagentspawn tool no longer takeswait.