Skip to content

Add network session collection#2

Merged
saphid merged 4 commits into
mainfrom
codex/add-network-session-collection
Jul 4, 2026
Merged

Add network session collection#2
saphid merged 4 commits into
mainfrom
codex/add-network-session-collection

Conversation

@saphid

@saphid saphid commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a portable, standard-library session collector CLI (codex-usage-collector) that scans configurable tool globs (Codex, Claude, Pi, Cursor, droid, OpenCode, and more), stages changed files with host/tool metadata sidecars and incremental state, and pushes to a local or SSH central collection directory.
  • Adds JSONL/syslog event logging (syslog_util.py) plus ops packaging: systemd units/timers, a launchd plist, report-refresh script, Grafana Loki datasource, and a rootless high-port LAN proxy.
  • Archives the completed add-network-session-collection OpenSpec change (spec delta merged into openspec/specs/) and fixes two test-determinism issues found while landing.

Implementation notes

  • The collector is dependency-free stdlib Python so it can run on any host without a venv.
  • Dashboard/analysis/attribution modules gained support for collected source_path metadata, sidecar identifiers, and topology-snapshot-based attribution.
  • E2E flake fix: the dashboard re-renders the spend flow behind a 60ms resize debounce, and the test's fixed 100ms post-resize sleeps raced it under host load. The test now waits for node geometry to hold stable longer than the debounce window before asserting.
  • Timezone fix: the dashboard's hour/day filters intentionally use local time, and the data-function test's expectations were authored under UTC+10, so it failed on UTC CI runners. The test now pins TZ for its Node subprocess.
  • Each fix is a separate commit from the feature landing.

Verification

  • PYTHONPATH=src python3 -m unittest discover -q — 21 tests OK.
  • pytest -q — 21 passed under TZ=UTC, TZ=America/New_York, and local Australia/Sydney.
  • npm run test:e2e — 5 consecutive passes after the settle fix (previously flaky under load).
  • openspec validate --all — 3 items pass, including the new network-session-collection spec.
  • Reproducibility CI gate green on bcf6b61.

Risk and rollback

  • The collector and ops assets are additive; the default profiler path stays read-only and local-first.
  • Revert cleanly by reverting the merge; running collector deployments keep working from installed copies but should be reinstalled from a prior tag if rolled back.

🤖 Generated with Claude Code

Alex Southwell and others added 4 commits July 4, 2026 12:26
Portable session collector CLI with default tool globs, metadata
sidecars, incremental state, and local or SSH push; JSONL and syslog
event logging; ops packaging for systemd, launchd, report refresh,
Grafana Loki, and a rootless LAN proxy; dashboard and analysis
revisions for collected sessions and attribution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All tasks complete and strictly validated; spec delta merged into
openspec/specs/network-session-collection.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The app re-renders the spend flow behind a 60ms resize debounce, so the
fixed 100ms sleeps raced the render under host load and measured stale
geometry. Replace them with a wait for node geometry to hold stable
longer than the debounce window. Five consecutive local runs pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The dashboard's hour and day filters intentionally use local time, and
the test's expectations were authored under UTC+10, so the embedded
Node script failed on UTC CI runners. Pin TZ for the subprocess so the
test is deterministic on any host. Verified under UTC, US Eastern, and
Australia/Sydney.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@saphid saphid merged commit bd516d5 into main Jul 4, 2026
1 check passed
@saphid saphid deleted the codex/add-network-session-collection branch July 4, 2026 02:31
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