Skip to content

Commit c259b0b

Browse files
committed
merge: align Slack Access with base modes and independent options
Signed-off-by: Tiberiu Socaci <tsocaci@makeitfuture.com>
2 parents 561981b + 00632ab commit c259b0b

29 files changed

Lines changed: 399 additions & 500 deletions

‎AGENTS.md‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ChannelGate — AGENTS.md
22

3-
Canonical instruction file. `CLAUDE.md`, `GEMINI.md`, `HERMES.md` are symlinks to this file —
4-
edit here only.
3+
Canonical instruction file for Codex and contributors. `CLAUDE.md` symlinks to this file
4+
for Claude Code — edit here only.
55

66
## What this is
77

@@ -81,10 +81,11 @@ post/edit Slack message in the thread
8181
(gateway control MCP + dual Composio identities; Skills/Toolbox use channel→user→org). Slack
8282
beyond the gateway's own bot tools is the **Composio** Slack toolkit — there is no separate hosted
8383
Slack MCP.
84-
- `src/gateway/modes.js` — the read/bash/auto/admin mode → tool-permission mapping (read = read-only
85-
tools, bash = shell + file writes, auto = permission prompts auto-approved, admin =
86-
`--dangerously-skip-permissions` for an admin author). A mode is a TOOL preset; none of them
87-
changes what the channel's container mounts.
84+
- `src/gateway/modes.js` — three base modes: Read-only, Worker (shell + file writes), and Admin
85+
(Worker for members; `--dangerously-skip-permissions` only for trusted admin authors). Auto and
86+
Lean are independent options. Auto approves tool requests for both roles; Lean removes optional
87+
skills/connectors, but admins in Admin mode retain full context. A mode is a TOOL preset; runtime
88+
mount policy remains separately defined by the container backend.
8889
- `src/runtimes/` — WHERE an engine process runs: the `RuntimeBackend` contract (`contract.js`),
8990
`resolve.js` (the one place that builds the RuntimeTarget a turn, a background job and the memory
9091
reviewer all receive — each resolves at its OWN spawn), and `container/` — the rootless Podman

‎CHANGELOG.md‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@ product overview.
1818
1919
## Unreleased
2020

21-
- Add a manager/admin-only Access page to Slack channel settings for mode, Full access, Lean,
21+
- Add a manager/admin-only Access page to Slack channel settings for base mode (including Admin), Auto, Lean,
2222
network, use/manage policy, and named guest/manager lists. Recheck live membership and current
2323
roles on save; immediately acknowledge submissions while validation runs. Admin-author-only
2424
engine bypass and existing ordinary-tab access remain unchanged.
2525

26+
- Channels: use Read-only, Worker, and Admin as the three base modes, with independent Auto and
27+
Lean side toggles in channel, DM, and template editors. Slack Settings can now select Admin
28+
for authorized admins. Admin gives other members Worker plus their selected options; Auto
29+
approves tools for both roles, while Lean applies only to non-admins in an Admin channel.
30+
Existing Full access records now get the promised Worker fallback.
31+
32+
- Repository cleanup: remove unused Gemini/Hermes instruction aliases and the superseded working
33+
audit. Keep canonical agent instructions, project records and active release acceptance gates.
34+
2635
- Settings: replace the Testing with AI checkbox list with a compact searchable user selector,
2736
removable selection chips, keyboard navigation and a bounded results list that fits narrow screens.
2837

‎FEATURES.md‎

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ A categorized catalog of what's shipped. Cross-linked to `TEST-PLAN.md` checks.
5858
never has to carry a per-author sentence, and a channel with no Composio gets no line at all.
5959
→ TEST-PLAN: Composio identity and connection discovery.
6060

61-
- **Focused conversation settings:** Access presents Read-only, Worker, and Autonomous as the
62-
primary modes, with Full access and Lean as clearly separated special-mode boxes; Custom is no
61+
- **Focused conversation settings:** Access presents Read-only, Worker, and Admin as the
62+
base modes, with Auto and Lean as independent options; Custom is no
6363
longer offered. MCP Connections, Cloud MCP, Environment tokens, and Skills are separate first-class
6464
channel pages rather than nested beneath Tools; enabled skills sort first and the channel-level
6565
Grant Tier switch is gone.
@@ -79,7 +79,7 @@ A categorized catalog of what's shipped. Cross-linked to `TEST-PLAN.md` checks.
7979
status. Secrets can be edited in every channel mode, including through `/secrets`; file-edit
8080
permissions and the separate `/model` command policy are unchanged.
8181
**Access** is a fifth tab, visible only to current admins/channel managers. They can edit the
82-
base mode, Full access, Lean, network, use/manage policy and named guest/manager lists. Selecting
82+
base mode (including Admin/full access), Auto, Lean, network, use/manage policy and named guest/manager lists. Selecting
8383
Full access does not grant anyone an administrator role; bypass still requires an admin author.
8484
Saves acknowledge immediately with a progress view, validate named users against live human
8585
channel membership, re-check management and roles at the write boundary, and audit policy changes.
@@ -1235,7 +1235,7 @@ A categorized catalog of what's shipped. Cross-linked to `TEST-PLAN.md` checks.
12351235
work folder, clean workspace and artifact dir mounted), while memory-off and the MCP allowlist are
12361236
unchanged. Per-conversation gated folder: filesystem sandbox confined to the folder, persistent memory
12371237
off, MCP allowlist. → TEST-PLAN: Security (confinement, allowlist, memory).
1238-
- **2026-07 full-codebase review remediation** (from `IMPROVEMENTS.md`): engine children run with a
1238+
- **2026-07 full-codebase review remediation**: engine children run with a
12391239
minimal allowlisted env (`src/engines/child-env.js` — Slack tokens / approval secret never reach
12401240
sandboxed processes; daemon-IPC creds ride a 0600 `internal-auth.json`); MCP tokens off argv
12411241
(0600 temp file written only at spawn); admin UI binds loopback by default with a no-password
@@ -1352,40 +1352,31 @@ A categorized catalog of what's shipped. Cross-linked to `TEST-PLAN.md` checks.
13521352
Customized/restored via the **`get_gateway_guide`** (anyone) / **`update_gateway_guide`** /
13531353
**`reset_gateway_guide`** (admins) gateway MCP tools — per-file or whole-guide restore-to-default.
13541354
→ TEST-PLAN: Gateway-usage skill.
1355-
- **Retired 2026-09-03 (Linux + containers only):** the OS-sandbox half of this bullet — the four modes stay as TOOL-permission presets (read =
1356-
read-only tools, bash = shell + file writes, auto = prompts auto-approved, admin =
1357-
`--dangerously-skip-permissions` for an admin author), and none of them changes what the channel's
1358-
container can see. Four channel **modes** (set with `/mode`): `read` (Read/Glob/Grep only, every
1359-
other tool asks for approval — the shell is named in the lockdown's `permissions.ask`, not merely
1360-
left out of `permissions.allow`: Claude Code answers a simple command whose argv head is on its
1361-
own built-in read-only list (`id`, `cat`, `head`, `strings`, …) BEFORE consulting
1362-
`--permission-prompt-tool`, so omission alone let a read-mode turn run `id -un` with no approval
1363-
card; an `ask` rule outranks that layer and routes every command — simple or compound — to the
1364-
approval card), `bash` (Bash + file writes, sandboxed to the folder), `auto`
1365-
(autonomous — permission prompts auto-approve, still fully sandboxed), and `admin` (full tools,
1366-
sandbox off — requires an **admin author** as well). `admin` is org-admin-only to select; the safe
1367-
modes honor the channel's "who can manage" policy. The **admin-run settings variant** — the file
1368-
handed only to an admin author's escalated turn in an admin-mode channel — grants the shell tools
1369-
outright and carries no `ask` rule at all: that turn spawns with
1370-
`--dangerously-skip-permissions`, so the rule widens nothing, and inheriting read mode's
1371-
`ask: ["Bash"]` instead made Claude Code deny a bare `pwd` and demote the whole turn to read-only
1372-
(the `full` profile sets `adminMode` alone, never `allowBash`). The SHARED file of the same
1373-
channel is unchanged — a non-admin author there still routes every command to the approval card.
1374-
→ TEST-PLAN: Modes & approvals.
1355+
- **Three base modes with independent options:** Read-only, Worker, and Admin. Read-only
1356+
routes edits and commands to approval; Worker grants commands and file writes inside the channel
1357+
container. Admin grants Worker to non-admin members and the permission bypass only to trusted
1358+
admin authors. The shared settings file always disables bypass, even when it grants Worker tools.
1359+
**Auto** and **Lean** are independent side toggles: Auto approves tool requests for every admitted
1360+
member; Lean removes optional skills and connectors. In Admin mode, Lean applies to non-admins,
1361+
while admins retain their configured tools and context. Changing Worker ↔ Admin preserves both
1362+
toggles. Choosing Read-only clears Auto; enabling Auto on Read-only selects Worker. Existing Full
1363+
access records gain the documented Worker fallback; existing Auto and Lean flags are preserved.
1364+
Network remains a separate setting. → TEST-PLAN: Base modes and independent options.
13751365
- Read mode's filesystem contract is engine-neutral: ordinary runs get bounded gateway MCP tools
13761366
to list, read, and literal-search the effective channel workdir. They realpath-check every target,
13771367
refuse traversal and escaping symlinks, cap file/search output, and expose no write or shell
13781368
operation. Claude may keep using its native Read/Glob/Grep; Codex uses these tools when its
13791369
read-only permission profile intentionally withholds command execution. → TEST-PLAN: Engines.
1380-
- **Capability profiles** (admin UI, one dropdown instead of a grid of toggles): **Read-only** /
1381-
**Worker** / **Autonomous** / **Full access** / **Lean** — each with example help text — expand to
1382-
the underlying `adminMode`/`allowBash`/`autoMode`/`cleanMode` flags; **Custom…** unlocks the flags
1383-
for hand-editing. Legacy channels derive their profile from existing flags (no DB migration). The
1384-
network toggle + the rarely-touched knobs (memory, nudges, refuse-org-tokens, work-dir, engine/
1385-
model/effort) live under an **Advanced** disclosure. → TEST-PLAN: channel access model.
1370+
- The web channel editor, custom DMs, and default templates share the three-mode picker and
1371+
side toggles. The Slack reply's **Settings** button exposes Read-only/Worker/Admin plus Auto/Lean
1372+
on its manager/admin-only Access tab for channels. DMs retain Runtime mode controls with
1373+
Admin selection restricted to admins. Every click rechecks user
1374+
authorization and channel membership, and every change is audited. `/mode read|worker|admin` changes the
1375+
base while preserving applicable options (`bash` remains a compatibility alias). Legacy run-API
1376+
presets remain accepted with their existing capability-reduction boundary.
13861377
- **Two-axis access model** (per channel, both editable in the admin UI): **Who can use** (`meta.access`:
13871378
Approved members / Admins only / Locked) and **Who can manage** (`meta.manageAccess`: Org admins only /
1388-
Channel members / Custom + `meta.managers[]`). The Slack Access page delegates channel mode, Full access, Lean, network and use/manage policy to
1379+
Channel members / Custom + `meta.managers[]`). The Slack Access page delegates channel mode (including Admin), Auto, Lean, network and use/manage policy to
13891380
current managers. Work-dir stays org-admin-only. The gateway control MCP (`requireManage` vs
13901381
`requireAdmin`) and in-thread `/mode` command retain their narrower admin checks; default `admins` means relaxing it is strictly opt-in. Settings →
13911382
**Reset all channels' access to default** (confirm-gated, audit-logged) restores use/manage to defaults

‎GEMINI.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎HERMES.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ white-label — are described at
178178
| [SECURITY.md](./SECURITY.md) | Reporting a vulnerability, and the dependency-advisory policy |
179179

180180
> Agent/contributor instructions live in **[AGENTS.md](./AGENTS.md)** (the canonical context
181-
> file; `CLAUDE.md` / `GEMINI.md` / `HERMES.md` symlink to it). Shipped features are in
181+
> file for Codex and contributors; `CLAUDE.md` symlinks to it for Claude Code). Shipped features are in
182182
> **[FEATURES.md](./FEATURES.md)**, the build roadmap is maintained privately, and the
183183
> regression in **[TEST-PLAN.md](./TEST-PLAN.md)**.
184184

‎TEST-PLAN.md‎

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
Cumulative functional + security regression. Extended per slice. Run top-to-bottom for a full
44
pass. Many checks are manual (require a real Slack workspace + an authenticated `claude` CLI).
55

6+
## Base modes and independent options (2026-09-08)
7+
8+
- Automated: `modes`, `channel-settings-modal`, `mode-command-audit`, `folders-settings`,
9+
`folders-generator-paths`, `run-grant-isolation`, `runtime-integration-surfaces`, and `run-api`
10+
cover legacy flag interpretation, three base selections, toggle persistence, admin-only selection,
11+
untrusted-author boundaries, per-run settings, and engine-independent settings rendering.
12+
- UI acceptance (engine-independent): in the web channel editor and DM/template editor, select
13+
Worker, check Auto and Lean, then select Admin. Exactly three base choices appear, with both
14+
options still checked. Save/reopen and verify all flags. Select Read-only: Auto clears, Lean
15+
stays. Enable Auto: Worker is selected. At wide widths options sit beside the base choices;
16+
narrow screens stack without overflow.
17+
- Slack Settings acceptance (engine-independent): as an admin fixture actor open a recent reply's
18+
Settings → Access button, choose Admin, and toggle Auto/Lean independently. Reopen and verify persistence
19+
and the `slack-settings` audit event. A member-manager sees all three modes and both options; ordinary members do not see Access.
20+
Forged legacy Runtime mode actions and revoked authorization/membership grants are rejected.
21+
DMs keep Runtime mode controls with Admin restricted to admin authors.
22+
- Runtime acceptance (Claude AND Codex): in an isolated fixture set Admin + Auto + Lean. As the
23+
approved non-admin fixture actor ask "Create mode-check.txt containing MODE_OK, read it back,
24+
and reply with its contents." Pass only with matching saved bytes, no approval click/card,
25+
`autoMode=true`, `clean=true`, and `dangerouslySkip=false`. Repeat as an admin fixture actor:
26+
matching file, no approval click/card, `clean=false`, `dangerouslySkip=true`. Check run-private
27+
MCP/skill artifacts to distinguish Lean from a model merely claiming it ran bare. Restore the
28+
fixture configuration. A direct harness run establishes runtime behavior, not Slack delivery.
29+
- Legacy acceptance: start with `profile=full`, `adminMode=true`, `allowBash=false`, Auto off.
30+
An ordinary member can edit and run shell commands as Worker; their bypass remains disabled.
31+
Existing `profile=auto` and `profile=lean` records retain their respective modifiers on reopen.
32+
633
## Release readiness remediation (2026-09-07)
734

835
The source changes address audit findings 1–4, 6, 7 and 9–17. Findings 5 and 8 (retiring the
@@ -144,7 +171,7 @@ Automated: `test/channel-memory.test.js`, `test/memory-search.test.js`,
144171
in every channel mode regardless of manager policy.
145172
- [x] Automated Access: ordinary authorized users cannot see/forge the fifth tab; admins,
146173
approved members under Members policy and named managers under Custom policy can edit it.
147-
DMs keep four tabs. Independent base-mode/Full-access/Lean/network flags round-trip; preset
174+
DMs keep four tabs. Independent base-mode/Auto/Lean/network flags round-trip; preset
148175
flags and stored profile agree. Unknown fields cannot change workDir, credentials or roles.
149176
Real store saves preserve unrelated settings and audit only policy. Departed actors,
150177
outsiders/bots in named lists, revoked channel grants and global role revocation during the
@@ -153,20 +180,20 @@ Automated: `test/channel-memory.test.js`, `test/memory-search.test.js`,
153180
`access-settings-qa`, join an admin actor, an approved member, a named external guest, and
154181
the bot. Start with Worker, network/Full access/Lean off, Approved use, Admins manage, and
155182
no explicit grants. From a fresh reply open Settings as each actor. Only admin sees Access.
156-
Change manage to Members; approved actor now sees Access, guest does not. Save Autonomous,
157-
Full access, Lean, network, named guest, and Custom management with the approved actor
183+
Change manage to Members; approved actor now sees Access, guest does not. Save Admin mode,
184+
Auto, Lean, network, named guest, and Custom management with the approved actor
158185
named. Reopen Slack and web settings: all values agree; unrelated model/tokens are unchanged;
159186
audit identifies actor/channel and contains no secrets. Clear special flags/lists and save:
160187
all clear. Try a bot and a user outside the channel: save fails without changing metadata.
161188
Revoke management or remove the actor with the editor open: old submit fails. Delay Slack
162189
membership responses beyond three seconds: immediate progress view, then one final result;
163190
no Slack timeout or double save. Restore/delete fixture. Pending live execution.
164191
- [ ] Live Access Claude and Codex (one run each in disposable channel `access-settings-qa`):
165-
select engine explicitly, Worker base, Full access on, Lean/network off, Members management.
192+
select engine explicitly, Admin mode, Auto/Lean/network off, Members management.
166193
As approved non-admin, prompt “Create access-proof.txt containing access proof and report
167194
whether permission bypass is active.” As admin, repeat with a different filename. Pass when
168195
per-run launch evidence has bypass only for the admin author and both runs stay in their
169-
declared container mounts. Enable Lean and start a fresh thread: “List the connectors and
196+
declared container mounts. As the non-admin actor, enable Lean and start a fresh thread: “List the connectors and
170197
skills available in this run.” Pass when runtime evidence shows the lean tool/skill policy.
171198
Toggle network and ask “Is network use allowed here?”; compare the answer and launch policy
172199
to the stored setting (advisory network is not an egress isolation claim). Restore fixture
@@ -3556,7 +3583,7 @@ are the v0.8 production deployment gate and are executed in the QA loop that fol
35563583
`curl https://api.github.com/` returns HTTP 200 while an unlisted domain stays blocked
35573584
(QA case DRV-04; before the codex-userns block both reset with curl exit 56).
35583585

3559-
## Review remediation (2026-07, IMPROVEMENTS.md)
3586+
## Review remediation (2026-07)
35603587
Unit layer first: `npm test` (node:test over `test/`) must pass — it pins the pure helpers
35613588
(escaping, chunking, queue, TTL set, child-env, containment, backoff, slugify, cron catch-up).
35623589
Manual checks for the daemon-level behavior:

0 commit comments

Comments
 (0)