Warning, /swf-monitor/docs/TEAMCOMMS.md is written in an unsupported language. File is not indexed.
0001 # TeamComms integration
0002
0003 TeamComms provides Entries, Dialog, session discovery and durable messaging through
0004 the existing devcloud accounts and API tokens. Its Django applications use
0005 the monitor's PostgreSQL database. The ASGI worker serves its HTTP, MCP and
0006 finite event streams beside the monitor MCP service.
0007
0008 ## Request path
0009
0010 The public prefix is https://epic-devcloud.org/prod/teamcomms/. swf-remote
0011 forwards it through the existing SSH tunnel to /swf-monitor/teamcomms/.
0012 Apache proxies that path to the existing worker at 127.0.0.1:8001.
0013 The embedded adapter restores the public host, HTTPS scheme and prefix
0014 before TC routing so redirects retain the external URL.
0015
0016 TC's lifespan runs with the monitor MCP lifespan. Streams reconnect within
0017 25 seconds, preserve Last-Event-ID and revalidate authentication before
0018 database reads and after an idle interval of at most five seconds. Apache
0019 disables caching and compression for this route; swf-remote relays chunks
0020 without buffering.
0021
0022 ## Browser interface
0023
0024 When TC is enabled, the monitor's System menu links to its public browser
0025 interface at `https://epic-devcloud.org/prod/teamcomms/`. Individual components
0026 remain in TeamComms navigation rather than separate System-menu entries. The link uses
0027 `SWF_TEAMCOMMS_PUBLIC_HOST`, including on the BNL face, so browser access uses
0028 the existing devcloud account session. The UI provides the shared overview,
0029 Entries list at `/entries` and editor at `/entries/<UUID>` beneath that prefix.
0030
0031 The application is constructed with
0032 `browser_csrf_url="/prod/teamcomms/browser-csrf"`. Devcloud serves this
0033 authenticated browser-only GET locally and returns a masked Django CSRF token
0034 and its header name. The browser obtains the token from that endpoint and sends
0035 it with same-origin cookie requests to the existing mutation APIs. The monitor
0036 continues to verify devcloud's request-bound CSRF attestation; it does not issue
0037 the browser's CSRF token. Tokens are not placed in URLs or rendered HTML.
0038
0039 UI links and asset URLs derive from the ASGI mount prefix. Packaged assets under
0040 `/assets` travel through the same authenticated TC route; they need no Apache
0041 static alias or Django `collectstatic` integration. The TC wheel contains the
0042 licensed editor and rendering assets. The host installs the pinned package and
0043 its Markdown, nh3 and pymdown-extensions dependencies before full deployment.
0044 Devcloud preserves the UI response security headers through its relay.
0045
0046 `POST /api/entries/render` supplies sanitized preview through the same
0047 authentication and CSRF guard. Existing entry operations retain their revision
0048 preconditions. The shared package owns editor behavior, draft recovery and
0049 conflict handling; the SWF integration supplies the mount, navigation, account
0050 session and deployment. Host acceptance uses the authenticated public URL to
0051 verify navigation, asset responses, browser CSRF and entry operations.
0052
0053 ## SWF Pouch
0054
0055 TeamComms's internal **Pouch** link opens
0056 `https://epic-devcloud.org/prod/teamcomms/pouch`, using the configured public
0057 host and existing devcloud login. The same TC mount serves the Pouch page and
0058 its authenticated APIs; no additional proxy route or credentials are required.
0059
0060 The Pouch is one canonical Entry bound to the installation's Team. Package
0061 migrations create its schema in the monitor database. The host enables
0062 `teamcomms.pouch.apps.PouchConfig` and applies Entries migrations
0063 `0003_editplan` and `0004_editplan_integrity`, followed by Pouch migrations
0064 `0001_initial` and `0002_binding_integrity`. Pouch's integrity migration depends
0065 on Entries `0004`; the normal Django migration graph orders them.
0066
0067 An explicit authenticated `POST /api/pouch/initialize` with `{}` initializes
0068 the empty document once under a team lock. Opening the page
0069 or deploying the schema does not create content. Initialization imports no
0070 TJAI material; existing `entries:read` and `entries:write` scopes govern access.
0071 Database guards prohibit deleting or rebinding the canonical association or
0072 changing its Entry's team or kind. Normal edits and restoration retain it.
0073
0074 All paths below are relative to `/prod/teamcomms`. `GET /api/pouch` reads the
0075 canonical document, `/api/pouch/changes` supplies its revision change feed, and
0076 `/api/pouch/export?revision=N` exports an attributed saved version. The browser
0077 URL `/pouch?revision=N` opens a fixed revision read-only. These operations do not
0078 broadcast Comms messages automatically.
0079
0080 The shared package owns exact-target, atomic and bulk editing, revision checks,
0081 attributed diffs and durable retry receipts. Monitor deployment installs the
0082 reviewed package and applies its migrations before activating the ASGI worker.
0083 Bulk plans freeze at most 20 explicitly selected Entries and their expected
0084 revisions; applying the durable operation UUID is atomic and preserves the exact
0085 outcome for retries.
0086 The designated commissioning session initializes the Pouch once after rollout;
0087 SWF host acceptance checks its public route and canonical document without
0088 creating another document or modifying the operator's content.
0089
0090 ## Authentication contract
0091
0092 swf-remote validates the browser session or existing API token and checks
0093 Django CSRF protection on unsafe browser requests. It creates a 60-second
0094 opaque reference bound to the request and the underlying authentication.
0095 The caller's token remains in swf-remote. Caller-supplied proxy assertions
0096 are discarded.
0097
0098 The designated loopback hop supplies X-TeamComms-Auth-Ref,
0099 X-Forwarded-Host and X-Forwarded-Proto. Monitor accepts the configured public
0100 host and HTTPS scheme only. For admission and every stream revalidation it
0101 POSTs `{ "reference": "..." }` to the configured HTTPS introspection endpoint,
0102 authenticated by a dedicated shared service credential. Redirects are refused
0103 and authority failures deny access.
0104
0105 The response contains:
0106
0107 | Field | Meaning |
0108 |---|---|
0109 | subject | Immutable remote account ID for humans; ai:, program: or connector: followed by that ID for other kinds |
0110 | username, name | Verified account lookup key and participant display name |
0111 | kind | human, ai, program or connector |
0112 | account_subject | For program or connector identities, the immutable remote account ID |
0113 | operator | For AI, the human subject, username and name |
0114 | auth_method | session or token |
0115 | csrf_verified | Boolean result of the proxy's browser CSRF check |
0116 | expires_at | Reference expiry as an ISO timestamp with timezone |
0117 | method, path | Exact method and path suffix within TC, such as /api/whoami or /mcp/ |
0118 | query_string | Exact raw query string |
0119 | body_sha256 | SHA-256 of the bounded request body |
0120
0121 Devcloud checks the current session, token and account for each introspection.
0122 Monitor verifies expiry and request binding, including the body for both
0123 authentication methods. Invalid or revoked authentication returns 401,
0124 denied access returns 403 and an unavailable authority returns 503. Active
0125 streams end with the corresponding error event. An operation already admitted
0126 may finish.
0127
0128 ## Identity and permissions
0129
0130 The identity provider is swf-remote. Human subjects use the remote account's
0131 immutable primary key. The existing token issuance page can explicitly bind
0132 a token to an AI participant with subject ai:account-ID and a human operator.
0133 Client headers and token display labels cannot select the actor. Human tokens
0134 retain human attribution. TC membership and participant IDs persist across
0135 token renewal and display-name changes.
0136
0137 Program and connector tokens use the existing devcloud issuance page's stored
0138 `teamcomms_service_kind` selection, mutually exclusive with AI attribution.
0139 Introspection supplies `kind`, `account_subject` and the exact subject
0140 `program:account-ID` or `connector:account-ID`. Monitor accepts these identities
0141 only with token authentication, a matching canonical decimal account ID and no
0142 operator identity. Account activation and collaboration permissions follow the
0143 verified username. Token renewal retains the participant; display labels do not
0144 select identity. Connector-reported external provenance remains separate from
0145 the authenticated author and cannot confer operator approval.
0146
0147 Authenticated accounts receive directory:read, entries:read, entries:write,
0148 sessions:write, comms:read, comms:write, dialog:read and dialog:write.
0149 Team participation is independent
0150 of production-action rights. Monitor checks the verified username on each
0151 request and revalidation: an explicitly inactive local account is denied,
0152 and the operations role maps to TC admin membership. AI permissions use
0153 the verified operator account. This mapping grants only TC permissions;
0154 production-operation permissions remain governed by the monitor.
0155
0156 Migration monitor_app.0014 provisions the single ePIC Workflow Management
0157 team, after the TC schema and integrity migrations. The normal privileged
0158 migration helper applies these migrations; application processes keep the
0159 existing swf_runtime role and its default grants. Embedded operation disables
0160 TC credential provisioning.
0161
0162 ## Dialog and fresh-session context
0163
0164 The Dialog application uses the same database, authentication and ASGI mount.
0165 Its `0001_initial` and `0002_immutable` migrations run through the normal
0166 privileged deployment helper. Capture
0167 and bootstrap are explicit connector options; granting Dialog scopes does not
0168 enable capture or inject history into existing sessions.
0169
0170 | Interface under the TC prefix | Operation |
0171 |---|---|
0172 | POST /api/dialog/events | record_dialog: capture an event for the caller's registered session |
0173 | GET /api/dialog | get_dialog: retrieve bounded history by host, participant, session, topic or time |
0174 | POST /api/dialog/bootstrap | session_bootstrap: assemble bounded history and explicitly selected guidance entries |
0175
0176 Captured events retain source identity, sequence and time, role, phase and
0177 content. Stable source identifiers make recorder replay idempotent. A human
0178 transcript role records the source's reported authorship; it does not confer
0179 operator approval. Canonical peer-message links must refer to messages delivered
0180 to the recording session, and retrieval retains their Comms access restrictions.
0181 Historical instructions remain context subject to the current session's policy.
0182
0183 The initial SWF bootstrap policy is opt-in for a selected connector configuration:
0184
0185 | Setting | Initial SWF selection |
0186 |---|---|
0187 | Service | https://epic-devcloud.org/prod/teamcomms |
0188 | Host filter | swf-testbed |
0189 | History window | Previous 24 hours |
0190 | Record limit | 40 events |
0191 | Content budget | 16,000 characters shared by history and guidance |
0192 | Guidance | Explicit SWF team Entry IDs; record the revisions returned |
0193 | Local state | Private state directory retained across recorder and receiver restarts |
0194 | Automatic greeting | Disabled during bounded acceptance |
0195
0196 Add these fields to the selected private connector configuration to enable
0197 capture and bootstrap. Both are disabled by default (`dialog_capture=false`,
0198 `bootstrap=null`):
0199
0200 ```json
0201 {
0202 "dialog_capture": true,
0203 "bootstrap": {
0204 "host": "swf-testbed",
0205 "hours": 24,
0206 "limit": 40,
0207 "max_chars": 16000,
0208 "guidance_entry_ids": []
0209 }
0210 }
0211 ```
0212
0213 Select up to ten guidance Entry IDs before the guidance acceptance check.
0214 The bootstrap response includes `context`, `chars`, `truncated`,
0215 `next_before_id`, `selected_event_ids`, `coverage` and `guidance_revisions`.
0216 Dialog retrieval supports `host`, `participant_id`, `session_id`, `topic`,
0217 `since`, `before`, `before_id` and `event_id` filters. Its record limit is
0218 1–100 and content budget is 1,000–30,000 characters; bootstrap additionally
0219 accepts a history window of 1–720 hours.
0220
0221 Returned context retains timestamps, source references, coverage gaps
0222 and continuation information. Relevant local project guidance remains available
0223 through the checkout's documentation. Guidance Entries are selected explicitly;
0224 personal TJAI history and guidance are not imported automatically.
0225
0226 The recorder captures visible human messages, assistant progress updates and final
0227 answers, and peer provenance. Reasoning and tool payloads are outside this SWF
0228 capture selection. Bootstrap injections must not become new human Dialog events
0229 when the native transcript is captured. The dedicated recorder can attach to an
0230 existing supported session, retaining its JSONL cursor and retries without a
0231 native client restart.
0232
0233 For an existing Codex session, run the recorder with its registered TC session,
0234 native session ID and transcript path:
0235
0236 ```sh
0237 teamcomms-connect --config CONFIG record \
0238 --session-id TC_UUID --native-id NATIVE_UUID \
0239 --client codex --transcript PATH
0240 ```
0241
0242 The first attachment starts at the transcript's end and records a coverage gap.
0243 Restart with the same configuration and state directory to resume the saved
0244 cursor. `--from-start` explicitly requests historical transcript capture; it is
0245 not part of the initial SWF setup. `teamcomms-connect --config CONFIG reload`
0246 prints fresh context. Its `--native-id`, `--client`, `--socket` and `--pid`
0247 options select an existing native runtime for explicit context injection.
0248
0249 Acceptance uses one selected fresh SWF session to recover recent captured work
0250 and selected guidance within the configured budget. Verify source attribution,
0251 visible coverage limits and continuation, then recorder restart recovery without
0252 duplicate records. Enablement and package installation are coordinated separately
0253 from the already completed Comms acceptance.
0254
0255 ## Configuration and deployment
0256
0257 ### One observed watcher event
0258
0259 The initial event source is the existing buffered notice stream. Its active
0260 `capcom` subscription selects `workflow_execution_completed` with `notice=true`,
0261 including the nightly testbed heartbeat. The adapter observes that result; it
0262 does not launch a workflow or alter the notice router, publisher or subscription.
0263
0264 Prepare exactly one existing AppLog event through its buffered notice:
0265
0266 ```sh
0267 python src/manage.py prepare_teamcomms_notice \
0268 --event-id 3456168 --subscriber capcom \
0269 --audience '{"topics":["swf-observed-events"]}' --topic swf-observed-events \
0270 --output /path/to/private/observed-event.json
0271 ```
0272
0273 The command requires one exact `event:<AppLog-ID>:<subscriber>` match and creates
0274 a mode-0600 file without overwriting an existing payload. The JSON supplies
0275 `source`, `event_id`, `content`, `audience`, `observed_at` and `topic` for the TC
0276 event publisher. The destination must be explicit and pass TC audience
0277 validation. The installation
0278 namespace defaults to `swf-monitor:epic-devcloud.org/prod`; its value and the
0279 `applog:<ID>` event identifier remain stable across retries. `observed_at` is the
0280 original AppLog timestamp, not the preparation time. The notice's buffer
0281 timestamp is labeled separately.
0282
0283 Publication uses the package's event publisher and durable outbox after an
0284 explicit destination is configured. Preserve the prepared payload and reuse its
0285 source and event identifier on retry. The first acceptance sends only the selected
0286 observed event. Replies must retain the resulting canonical TC message reference.
0287
0288 ```sh
0289 teamcomms-connect --config /path/to/private/program-config.json \
0290 publish-event /path/to/private/observed-event.json
0291 ```
0292
0293 The package derives the canonical message UUID from `source` and `event_id`,
0294 persists the exact body before publication, and rejects a changed body on retry.
0295
0296 Existing Mattermost configuration is in
0297 `/opt/swf-monitor/config/env/production.env`: `MATTERMOST_URL`,
0298 `MATTERMOST_TEAM`, `MATTERMOST_CHANNEL` and the private `MATTERMOST_TOKEN`.
0299 The separate `mattermost-live` notice plugin prefers `EPICPROD_LIVE_TOKEN`
0300 and reads its channel from SysConfig `epicprod_live_channel`. These settings
0301 describe existing publishers; the TC connector's destination is selected
0302 explicitly. Its account-bound program/connector token authenticates to the
0303 existing public TC endpoint. The introspection service credential is not a
0304 publication credential.
0305
0306 The commissioned live-feed destination is `epicprod-live` on
0307 `chat.epic-eic.org`, team `main` (`cxdw3uij5irc8xhk95pk9mnq3h`), channel
0308 `578q7d98h7gnprya6qt8we9fta`. The existing live-feed bot is `epicprod`.
0309 Keep its credential on the owning SWF host; configure the TC bridge with the
0310 explicit channel ID. Resolving this destination does not post or join a channel.
0311
0312 The bridge's private files live in
0313 `/data/wenauseic/.config/teamcomms/swf-events/`. `program.json` and
0314 `connector.json` use the public TC URL, host `swf-testbed`, separate private
0315 state directories and `greeting=false`. Their `token_file` values name
0316 `program-token` and `connector-token`, respectively, issued by devcloud with
0317 the corresponding service kind. `live-bot-token` is a local private copy of
0318 `EPICPROD_LIVE_TOKEN`; no Mattermost token is transferred to another host.
0319
0320 `mattermost.json` selects the live-feed route:
0321
0322 ```json
0323 {
0324 "url": "https://chat.epic-eic.org",
0325 "token_file": "/data/wenauseic/.config/teamcomms/swf-events/live-bot-token",
0326 "routes": [{
0327 "channel_id": "578q7d98h7gnprya6qt8we9fta",
0328 "name": "epicprod-live",
0329 "topics": ["swf-observed-events"],
0330 "inbound_audience": {"topics": ["swf-observed-events"]}
0331 }]
0332 }
0333 ```
0334
0335 Selected AI sessions subscribe explicitly to `swf-observed-events`. The bridge
0336 registers one TC session for its channel and suppresses its own bot posts and
0337 source-channel reflections. Ordinary feed posts do not publish to AI inboxes;
0338 only explicit **Notify LLM** posts enter the configured inbound audience.
0339 Mattermost provenance is connector-reported and
0340 does not replace the authenticated TC connector author.
0341
0342 `swf-teamcomms-mattermost.service` runs the bridge as `wenauseic`, using the
0343 deployed release's Python and the private connector configuration. Install and
0344 start the unit after the package and devcloud service tokens are ready. Retain
0345 its state directory through restart for replay and publication recovery. The
0346 existing SWF notice publisher and bot remain separately managed.
0347
0348 ### Backend environment
0349
0350 Set these values in the production environment:
0351
0352 ```
0353 SWF_TEAMCOMMS_ENABLED=True
0354 SWF_TEAMCOMMS_PUBLIC_HOST=epic-devcloud.org
0355 SWF_TEAMCOMMS_INTROSPECTION_URL=https://epic-devcloud.org/prod/teamcomms-auth/introspect/
0356 SWF_TEAMCOMMS_SERVICE_TOKEN_FILE=/path/to/private/service-token
0357 ```
0358
0359 The credential is transferred through SSH and stored outside Git. User
0360 credentials are managed on the existing devcloud account page. Missing
0361 configuration denies TC access. The route defaults to disabled.
0362
0363 The dependency is pinned to a reviewed teamcomms-ai Git revision and installed
0364 non-editable in the shared development virtualenv. A full monitor deployment
0365 copies that environment, applies migrations and installs the Apache route.
0366 Requirements changes must be installed in the shared environment before
0367 deployment. Coordinate the environment update and full deployment with other
0368 SWF sessions because the environment is shared. The existing deployment script
0369 also freezes local sibling package trees.
0370
0371 Verification of the SWF installation covers the public cookie/token paths,
0372 CSRF and request binding, authentication revocation during streams, reconnect
0373 replay, and selected live Claude/Codex sessions. TC's package-level suite has
0374 separate approval requirements in teamcomms-ai/AGENTS.md. Package fixture results
0375 do not establish live connector acceptance.
0376
0377 ## SWF Inflight
0378
0379 The System menu contains one **TeamComms** link. Its internal **Inflight** link opens
0380 `https://epic-devcloud.org/prod/teamcomms/inflight`, using the configured public
0381 host and existing devcloud login. The complete subtree is already proxied; no
0382 new Apache path, authentication reference format or browser credential is needed.
0383
0384 Enable `teamcomms.inflight.apps.InflightConfig`. The pinned package's
0385 `0001_initial` and `0002_guards` migrations create work, dependency and immutable
0386 retry-receipt records in the monitor database, ordered after Entries integrity,
0387 Comms and service identity migrations. Deployment creates schema only.
0388
0389 Authenticated collaboration members receive `inflight:read` and `inflight:write`
0390 alongside the existing component scopes. These permissions remain independent
0391 of production-action rights. The package additionally checks owner/executor or
0392 administrator authority for each mutation. A work item retains a stable
0393 participant owner across session disconnection. A named successor must accept
0394 an ownership handoff; executor assignment is separate. Revisions and ownership
0395 generations reject stale updates. Completion requires an outcome and evidence;
0396 closed work needs explicit reopening. Referenced resources are associations,
0397 not enforced reservations or permission to mutate production systems.
0398
0399 Under the existing public TC prefix, `/api/inflight` creates and lists work,
0400 `/api/inflight/read` reads current or fixed revisions, `/api/inflight/mutate`
0401 handles explicit state/ownership changes, and `/api/inflight/changes` supplies
0402 bounded attributed history. The corresponding connector tools are `create_work`,
0403 `list_work`, `get_work`, `mutate_work` and `get_work_changes`. Mutations carry a
0404 stable operation UUID; retries keep the exact request and return its original
0405 outcome. Work uses the shared editor, source rendering and local draft recovery.
0406 Pouch's **Create work from this revision** preserves its saved source reference.
0407
0408 Full deployment installs the pinned package, applies both Inflight migrations
0409 and activates the existing ASGI worker. Bounded acceptance checks the rendered
0410 System links, one explicitly created commissioning work item, source revision,
0411 completion evidence and saved history. No automatic TJAI task import, work
0412 execution, connector restart or additional native commissioning is required.
0413
0414 ## Claims, custody and guarded deployment
0415
0416 Inflight migrations `0003`–`0005` add explicit offers, atomic multi-resource
0417 claims, retained custodians, immutable retry receipts and guarded-run records.
0418 The existing application and `inflight:read/write` scopes cover these APIs.
0419 No new authority, credential issuer, Apache route or automatic execution is added.
0420
0421 An eligible authenticated participant claims offered work and its complete
0422 resource set. The accountable owner is retained. Renewal and completion check
0423 ownership generations; completion requires evidence and releases the set.
0424 Expiry shows lost contact and keeps resources held. A holder must stop and
0425 release its work, or the owner must record stopped-work evidence, before a new
0426 claim can acquire those resources. Custody stays assigned while idle and can
0427 change only through an accepted transfer. Work descriptions may associate
0428 resources without reserving them; explicit claims establish reservations.
0429
0430 `scripts/teamcomms-guarded-deploy.py` is an optional protected entrypoint:
0431
0432 ```sh
0433 sudo /opt/swf-monitor/current/.venv/bin/python \
0434 /usr/local/libexec/swf-teamcomms-guarded-deploy.py \
0435 --claim-id UUID --generation N --check
0436 # For an authorized deployment, replace --check with branch infra/baseline-v43.
0437 ```
0438
0439 It runs the TC guard as root, takes all configured canonical resource locks,
0440 validates and renews the caller's existing claim, and invokes the committed
0441 release's normal deployment script. It records a durable command admission and
0442 confirmed stop; the caller then records completion or stopped/released work.
0443 `--check` uses the same admission path for one read-only checkout revision read.
0444 An unconfirmed prior run or failed renewal denies/stops protected work.
0445 A TC service outage therefore interrupts guarded work; recovery must inspect
0446 that work before recording stopped-work evidence and claiming again.
0447
0448 Explicit host setup uses `provision_work_resource` to register the monitor
0449 project, verified checkout aliases and deployment service, with a named active
0450 custodian and `local_flock` protection on `swf-testbed`. Schema migration alone
0451 does not provision resources. The host command requires trusted database
0452 administration access and records the selected custodian as the audit identity;
0453 it does not grant that participant remote administration privileges.
0454
0455 Install the reviewed committed wrapper after deployment with `sudo install -o
0456 root -g root -m 0755 scripts/teamcomms-guarded-deploy.py
0457 /usr/local/libexec/swf-teamcomms-guarded-deploy.py`. This explicit host setup keeps
0458 the privileged entrypoint outside release ownership changes.
0459
0460 Root-private files live in `/etc/swf-teamcomms` (0700):
0461 `connector.json`, `guard.json` and `program-token` (0600). The token is a local
0462 copy of the existing account-bound SWF program token, issued by devcloud. Keep
0463 both copies synchronized on rotation. It is never a service-introspection key.
0464 Connector fields are `url`, `token_file`, `host=swf-testbed`, `state_dir` and
0465 `greeting=false`. Guard fields are `host=swf-testbed`,
0466 `lock_dir=/var/lib/swf-teamcomms/guards` and the explicit
0467 `resource_ids` allowlist, covering the checkout and deployment service.
0468 Every cooperating invocation uses the same root-owned lock directory and IDs.
0469 These paths are outside the release tree, whose ownership the normal deployment
0470 script resets to the application account.
0471
0472 Coverage is exclusion between cooperating foreground invocations of this
0473 entrypoint on this host. Direct deploy scripts, raw shell commands, escaped
0474 children and unrelated entrypoints remain outside it. Reservations do not confer
0475 production rights, and the wrapper does not replace commit/push, host coordination
0476 or the standard frozen-tree checks. Do not run privileged children beneath an
0477 unprivileged guard: it could not stop their process group on authority loss.
0478
0479 ## Topical Capcom
0480
0481 TeamComms navigation opens `/prod/teamcomms/capcom` within the existing authenticated
0482 subtree. Add `teamcomms.capcom.apps.CapcomConfig` and grant ordinary members
0483 `capcom:read` and `capcom:write`, independently of production rights. The package's
0484 Capcom `0001_initial`, `0002_integrity` and `0003_conversationread` migrations
0485 create topics, notices,
0486 explicit decisions, personal read/follow state, immutable mutation receipts and
0487 per-session presentation policies. Existing Inflight and component apps remain
0488 installed; migration creates schema only.
0489
0490 Topics reference current Inflight work, fixed document versions, selected Dialog
0491 records and existing exact-topic Comms conversations. Private message access stays
0492 with its original audience. Events and sampled state carry distinct labels and
0493 observation times; old blockers cannot replace current task state. Reading, marking
0494 a topic read, native receipt, model consideration and decision resolution are
0495 separate operations. There is no automatic source import, watcher subscription,
0496 Mattermost post or production action.
0497
0498 Receiver attention controls require explicit `attention_controls=true` in the
0499 selected connector configuration and a receiver advertising `attention-v1`.
0500 Session-owned policies choose immediate, recorded-only or batched machine routine
0501 notifications, with optional quiet deadlines. Deferred and coalesced dispositions
0502 remain visible beside independent transport receipts. Alarms, human instructions,
0503 conversations and offers bypass routine filtering. Existing connectors keep their
0504 current delivery behavior until explicitly enabled; runtime/TJAI settings and the
0505 live-feed bridge are preserved.
0506
0507 Package installation, mandatory host checks and full deployment precede bounded
0508 public navigation/topic/reference checks. A commissioning pull session may exercise
0509 publication and attention bookkeeping without a model or native client launch.
0510
0511 ## Explicit wrangle-ai execution
0512
0513 The pinned wrangle-ai dependency supplies the shared worker loop; TeamComms
0514 supplies the central offer/claim Bullpen and authenticated offer stream Bell.
0515 Inflight migrations 0006_executionrun and 0007_execution_integrity retain admitted
0516 runs and immutable stopped results. Existing Inflight scopes apply. No worker is
0517 started by migration or deployment.
0518
0519 A private worker profile names an absolute workspace, trusted foreground command,
0520 permissions, timeout and model/spending policy. Headless fallback requires an
0521 explicit offer execution profile and a reached headless_after timestamp. It races
0522 interactive claims through the same atomic authority. Notifications, alarms and
0523 Comms receipts do not enqueue work. The worker renews its claim and publishes
0524 results against its original generation; an uncertain launch is held for explicit
0525 stopped-work reconciliation. Saved results can retry without repeating execution.
0526
0527 Use the existing program connector credential with a separate worker state
0528 location. The first SWF commissioning profile reads installed package provenance,
0529 uses no model and mutates no production resource. It runs one explicit offer and
0530 marks its dedicated worker session offline on completion. Existing agents, native
0531 sessions, TJAI, recorders and Mattermost routes retain their launch/configuration.
0532 The Inflight page shows execution profile, state and result alongside ownership.
0533
0534 ## Notify LLM
0535
0536 **Notify LLM** is the explicit, sparse category for requesting model attention.
0537 Severity does not select it: routine notices, completion events and alarms remain
0538 available in their existing feeds without waking subscribed AI sessions.
0539
0540 Scripts use `teamcomms.connectors.watcher.notify_llm` with the existing devcloud
0541 program configuration and private outgoing store. Required fields are source,
0542 event_id, reason, content, explicit audience and original observed_at; topic is
0543 optional. The helper freezes a source-derived UUID and exact body before sending.
0544 Retries reuse that body, while changed content conflicts. The package documents
0545 the callable and runnable example in docs/notify-llm.md and examples/notify-llm.py.
0546
0547 ```sh
0548 teamcomms-connect --config /path/to/private/program.json \
0549 notify-llm /path/to/private/notification.json
0550 ```
0551
0552 The prepared SWF event JSON can supply source/event/time/content/audience/topic;
0553 add a deliberate reason and use notify-llm only when model consideration is
0554 intended. Ordinary publish-event excludes AI destinations while retaining the
0555 bridge destination. No new subscription, continuous watcher or source import is
0556 enabled. Existing exact publication retries retain their original deliveries.
0557
0558 Capcom's notice composer has an initially unchecked **Notify LLM** control with
0559 explicit recipients and reason. The corresponding API fields are notify_llm and
0560 notify_llm_reason; notice identity supplies the stable source. The existing
0561 comms:write and capcom:write scopes apply independently of production rights.
0562
0563 On epicprod-live, a new post selects the category with leading text `Notify LLM:`
0564 or boolean post property notify_llm=true. The bridge uses its configured inbound
0565 audience and verified post/user provenance; it advances past ordinary posts
0566 without TC publication. Own bot posts and reflections remain excluded. Scripts
0567 using the same epicprod bot call the helper directly, including the bridge in
0568 the explicit audience if a visible feed post is desired. No other live-feed
0569 publisher or DISpatcher route changes.
0570
0571 A package upgrade requires restarting only swf-teamcomms-mattermost.service after
0572 full deployment to activate inbound selection, preserving private state. No new
0573 migrations, credentials or native client restarts are required. The package also
0574 applies the saved browser theme before deferred UI scripts to prevent a light
0575 flash during dark-mode navigation.