Skip to content

feat(archer-slack): deploy the Socket Mode collector on the laptop (#2137 S2) - #12763

Merged
dezren39 merged 2 commits into
mainfrom
felix/2137-s2-deploy
Nov 23, 2026
Merged

dezren39 merged 2 commits into
mainfrom
felix/2137-s2-deploy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

S2 of #2137: deploy the Socket Mode Slack collector on the laptop. Design record: doc/fleet/archer-slack/socket-mode-collector.md (decision 1 — hosting is the laptop via this flake; the sandbox has no systemd user bus and its 2026-10-29 run died with a recycle ~54 minutes in).

What's in it

  • Package — pkgs/fleet/archer-slack/collector/package.nix: the S1 collector with a packaged interpreter (nixpkgs websockets 17.0.1; requirements.txt's 17.3 is the pip pin) plus launcher.sh, the service entry point: fetches slack.archer-app-token by name via fleet secrets get (value only into the process environment), ensures the store directory, execs the collector. run.sh stays the checkout/manual launcher.
  • Module — nixos/services/archer-slack/default.nix: services.archer-slack-collector, a home-manager user service in the pm-stack/lab-tunnel shape. The unit sets ARCHER_SLACK_DB to the store path the review job reads (~/workspace/archer-slack/puller/state/archer-slack.db, the laptop-local copy the parallel run writes) and ARCHER_WATCH_CHANNELS=C0CBYQR65LL (#alignment only, per Drew 2026-10-28). Restart=on-failure, RestartSec=30.
  • Host wiring — amd gains the services/archer-slack profile + services.archer-slack-collector.enable = true.
  • Flake surface — lib.make-archer-slack exposes nix build .#archer-slack-collector as the package-level check (pm-git-sync: projector redeploy restarts without ensuring node_modules — catch-up pull crash-looped pm-projector on missing @libsql/client #8171 doctrine; includes the _self inherit-list fix the first build caught).
  • Registry — the unit's row in doc/fleet-schedule-registry.md Surface 2b, same change as the unit (repo rule).
  • Design record — gains the S2 deployment section (deployment form, rebuild-preservation list, reaction gap restated).

Evidence

  • Fail-before: on pristine main, nix build .#archer-slack-collector → flake does not provide attribute 'packages.x86_64-linux.archer-slack-collector'. Collector tests in this checkout: 7/7 (stdlib).
  • Pass-after (laptop, ~/tools/fleet-build-lock): package builds to /nix/store/in688y1nyp6sk9wr3yawclmwlpy9v6dn-archer-slack-collector-0.1.0; the amd host config evaluates with the module enabled and renders exactly the intended unit (ExecStart → that store path; the env above).
  • Live: the unit was installed narrowly (see below), enabled, and started 2026-11-23T01:35:09Z. Journal: token fetch OK, first WS handshake timed out (transient), in-collector reconnect → socket connected, hello received (connections=1) at 2026-11-23T01:35:46Z. Unit active, NRestarts=0. Store created at the laptop path with the collected_events table; 0 events so far — #alignment is quiet; the first event lands with the next channel message.

Deployment note (narrow install, stated plainly)

A full ./rebuild had other work pending, so the live activation used the unit file the module generates (values taken from the evaluated host config) installed directly at ~/.config/systemd/user/archer-slack-collector.service — ahead of this PR merging. A later rebuild from a main containing this change takes over that path (home-manager renames the hand file to *.backup) and must preserve: the same unit, the store file (outside home-manager's management), and the verified-live state — re-check the unit and journal after that rebuild, since a bad comeback would break the parallel-run window. Rollback: systemctl --user disable --now archer-slack-collector.service, remove the hand-installed unit file, daemon-reload (the store file stays; it is data).

The 3-day clock

The parallel run (S4's window) starts at the hello: 2026-11-23T01:35:46Z → ~2026-11-26T01:35:46Z, collector vs the untouched 15-minute puller. The unit was deliberately not restart-tested after the hello, to keep the window clean; resilience evidence is the in-process reconnect above plus enablement via default.target.wants.

Not in scope / unchanged

The review job, its cadence, and the puller's watermark contract are untouched. Reactions remain event-starved: the app manifest doesn't subscribe to reaction_added and lacks reactions:read — a workspace-owner manifest amendment + reinstall, named in the design record; S2 deploys with the subscriptions that exist. S3 (wake gate), S4 (fidelity report), S5 (cutover) remain.


Proof this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

felix added 2 commits November 23, 2026 01:27
…2137 S2)

Package the S1 collector for the flake (interpreter + websockets +
launcher.sh, which fetches slack.archer-app-token by name via the
fleet secrets route), declare it as a NixOS-managed user service
(services.archer-slack-collector, nixos/services/archer-slack),
enable it on the laptop host, expose nix build .#archer-slack-collector
as the package check, and add the unit's Surface 2b row to the fleet
schedule registry in the same change. Design record gains the S2
deployment section. Starts the 3-day parallel run the cutover waits
on; the puller and review job are untouched.
…2137 S2)

lib/default.nix's _self re-exports each make-* through an explicit
inherit list; the first S2 commit defined make-archer-slack but did
not list it, so flake.nix's merge failed with 'attribute
make-archer-slack missing' (caught by the laptop package build).
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 01:37
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 41158852-644f-4e92-bf50-dc2db291c775
Commits

Reviewing files that changed from the base of the PR and between a9496cb and 4f61670.

Files selected for processing: 8

  • doc/fleet-schedule-registry.md
  • doc/fleet/archer-slack/socket-mode-collector.md
  • flake.nix
  • lib/default.nix
  • nixos/hosts/default.nix
  • nixos/services/archer-slack/default.nix
  • pkgs/fleet/archer-slack/collector/launcher.sh
  • pkgs/fleet/archer-slack/collector/package.nix
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 837459a into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the felix/2137-s2-deploy branch November 23, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant