| feat(always-on): implement Gateway-native Always-On module
- Add src/always-on with protocol, config, contracts, runtime, workspace,
storage, and tool subpackages per docs/always-on/02 design.
- Wire alwaysOn into PolitConfig + loadPolitConfig; politdeck server boots
AlwaysOnRuntime, injects extra tools and per-session cwd/permissionMode
overrides through createLocalGateway.
- Single isolated workspace per project: state.currentWorkspace tracks the
handle; ensureAlwaysOnWorkspace reuses it across fires; runtime never
auto-disposes (user manually rm to reset).
- Discovery and execution turns both run inside the workspace cwd; execution
turn is pinned to bypassPermissions with assertWorkspaceCwdSafe.
- Discovery prompt now embeds workspace cwd, strategy, and the project's
PolitDeck chat transcript directory.
- Lease is reverse-only: no_fresh_lease and workspace_capacity gates
removed; agent_busy / recent_user_msg only fire when a lease exists.
- Workspace config trimmed: maxConcurrentEnvs / retainSuccessfulEnvs /
retainFailedEnvs flagged as ALWAYS_ON_FIELD_REMOVED diagnostics.
- Add tests/always-on covering config, gates, contracts, state store,
ensureAlwaysOnWorkspace, channel leases, and config loader integration.
Co-authored-by: Cursor <cursoragent@cursor.com>
| 24 天前 |