|
| 1 | +# Stage 5 web-channel grouping inventory — 2026-03-28 |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +Capture the current `runtime/src/channels/web/` surface so Stage 5 of the broad |
| 6 | +filesystem reorg can work from current counts instead of the older 56-file |
| 7 | +snapshot. |
| 8 | + |
| 9 | +## Current structure |
| 10 | + |
| 11 | +Measured on 2026-03-28: |
| 12 | + |
| 13 | +- `runtime/src/channels/web/` — **73 flat files** |
| 14 | +- `runtime/src/channels/web/http/` — **21 files** |
| 15 | +- `runtime/src/channels/web/handlers/` — **5 files** |
| 16 | +- `runtime/src/channels/web/workspace/` — **9 files** |
| 17 | +- `runtime/src/channels/web/terminal/` — **1 file** |
| 18 | +- `runtime/src/channels/web/vnc/` — **1 file** |
| 19 | +- `runtime/src/channels/web/remote-display/` — **1 file** |
| 20 | + |
| 21 | +This means the existing `group-web-channel-flat-files` ticket is still valid, |
| 22 | +but its older 56-file number is stale. |
| 23 | + |
| 24 | +## Stable existing grouped areas |
| 25 | + |
| 26 | +Already-grouped subtrees that should remain conceptually separate from the flat |
| 27 | +root cleanup: |
| 28 | + |
| 29 | +- `http/` |
| 30 | +- `handlers/` |
| 31 | +- `workspace/` |
| 32 | +- `terminal/` |
| 33 | +- `vnc/` |
| 34 | +- `remote-display/` |
| 35 | + |
| 36 | +Stage 5 is primarily about shrinking the remaining flat root surface. |
| 37 | + |
| 38 | +## Candidate grouping clusters from the flat root |
| 39 | + |
| 40 | +### 1. `auth/` |
| 41 | + |
| 42 | +Likely auth-focused files: |
| 43 | + |
| 44 | +- `auth-endpoints.ts` |
| 45 | +- `auth-gateway.ts` |
| 46 | +- `auth-runtime.ts` |
| 47 | +- `auth.ts` |
| 48 | +- `login-command.ts` |
| 49 | +- `totp-auth.ts` |
| 50 | +- `webauthn-auth.ts` |
| 51 | +- `webauthn-enrol-page.ts` |
| 52 | + |
| 53 | +Why this cluster is attractive: |
| 54 | + |
| 55 | +- semantically cohesive |
| 56 | +- path intent is obvious |
| 57 | +- mostly pure import-rewrite risk |
| 58 | + |
| 59 | +### 2. `sse/` |
| 60 | + |
| 61 | +Likely SSE/event-stream files: |
| 62 | + |
| 63 | +- `sse.ts` |
| 64 | +- `sse-hub.ts` |
| 65 | +- `agent-events.ts` |
| 66 | +- `session-broadcast-service.ts` |
| 67 | + |
| 68 | +Why this cluster is attractive: |
| 69 | + |
| 70 | +- clear event-stream boundary |
| 71 | +- low ambiguity relative to other root files |
| 72 | + |
| 73 | +### 3. `cards/` |
| 74 | + |
| 75 | +Likely adaptive-card / interaction files: |
| 76 | + |
| 77 | +- `adaptive-card-actions.ts` |
| 78 | +- `adaptive-card-side-prompt-service.ts` |
| 79 | +- `interaction-service.ts` |
| 80 | + |
| 81 | +Why this cluster is attractive: |
| 82 | + |
| 83 | +- already reads like a focused capability slice |
| 84 | +- aligns with the broad reorg map’s earlier `cards/` direction |
| 85 | + |
| 86 | +### 4. `media/` |
| 87 | + |
| 88 | +Likely media/preview files: |
| 89 | + |
| 90 | +- `avatar-service.ts` |
| 91 | +- `link-previews.ts` |
| 92 | +- `media-service.ts` |
| 93 | + |
| 94 | +Why this cluster is attractive: |
| 95 | + |
| 96 | +- focused capability surface |
| 97 | +- low naming ambiguity |
| 98 | + |
| 99 | +### 5. `theming/` |
| 100 | + |
| 101 | +Likely theme/UI bridge files: |
| 102 | + |
| 103 | +- `ui-bridge.ts` |
| 104 | +- `ui-theme-commands.ts` |
| 105 | +- `ui-theme-data.ts` |
| 106 | + |
| 107 | +Why this cluster is attractive: |
| 108 | + |
| 109 | +- small, coherent grouping |
| 110 | +- clearly not part of auth/messaging/workspace |
| 111 | + |
| 112 | +### 6. `messaging/` |
| 113 | + |
| 114 | +Likely message-flow files: |
| 115 | + |
| 116 | +- `agent-message-entry-service.ts` |
| 117 | +- `agent-message-service.ts` |
| 118 | +- `agent-message-store.ts` |
| 119 | +- `message-store.ts` |
| 120 | +- `message-write-flows.ts` |
| 121 | +- `message-processing-storage-service.ts` |
| 122 | +- `peer-message-service.ts` |
| 123 | + |
| 124 | +Why this cluster is attractive: |
| 125 | + |
| 126 | +- high semantic cohesion |
| 127 | +- likely to pay off quickly in navigation clarity |
| 128 | + |
| 129 | +## High-ambiguity remainder after the obvious clusters |
| 130 | + |
| 131 | +After the clusters above, the remaining flat files are more mixed and likely |
| 132 | +need a second pass or narrower child batches. These likely include: |
| 133 | + |
| 134 | +- control-plane / session orchestration |
| 135 | +- follow-up / queue / special wrapper services |
| 136 | +- channel endpoint context helpers |
| 137 | +- request routing adjuncts that are not already under `http/` |
| 138 | +- runtime lifecycle glue that still belongs at the web root |
| 139 | + |
| 140 | +Stage 5 should assume the obvious clusters can land first without requiring the |
| 141 | +entire remainder to move in one shot. |
| 142 | + |
| 143 | +## Recommended Stage 5 posture |
| 144 | + |
| 145 | +### Safe first tranche |
| 146 | + |
| 147 | +Prefer moving these first: |
| 148 | + |
| 149 | +- `auth/` |
| 150 | +- `sse/` |
| 151 | +- `cards/` |
| 152 | +- `media/` |
| 153 | +- `theming/` |
| 154 | +- `messaging/` |
| 155 | + |
| 156 | +### Deliberate second tranche |
| 157 | + |
| 158 | +Re-evaluate the remaining root files after the first tranche lands, then decide |
| 159 | +whether additional directories are justified. |
| 160 | + |
| 161 | +## Success signal for Stage 5 |
| 162 | + |
| 163 | +A good Stage 5 landing should materially reduce the flat root count and leave |
| 164 | +`runtime/src/channels/web/` easier to scan, even if the final root count is |
| 165 | +reached in more than one commit. |
| 166 | + |
| 167 | +## Related files |
| 168 | + |
| 169 | +- `docs/broad-filesystem-reorg-map-2026-03-28.md` |
| 170 | +- `workitems/10-next/group-web-channel-flat-files.md` |
| 171 | +- `workitems/20-doing/plan-broad-filesystem-reorg-from-audit.md` |
0 commit comments