Commit f0942ab
feat(sync): add machine-labeled session sources (#1170)
Add filesystem-only `[[session_sources]]` entries with `agent`, `dir`,
and
optional `machine`. Structured sources are additive to existing
per-agent
directory arrays, defaults, and environment variables; when roots
overlap, the
structured entry supplies the machine label. Configured paths keep the
spelling
the user wrote them in, and a separate cleaned comparison key collapses
equivalent roots, so Windows-style entries survive a config round-trip.
A session's machine is resolved from the configured root that produced
it and
is assigned once, when the session is first ingested. After that the
label is
immutable: ordinary periodic, watcher-driven, incremental,
provider-backed, and
single-session syncs all retain the stored value rather than adopting a
newly
configured one. `agentsview sync --full` preserves stored labels while
rebuilding the archive; it is not a relabel operation. Changing a
configured
label therefore affects only sessions discovered afterward, which makes
editing
configuration safe rather than destructive. Filesystem labels do not
namespace
native session IDs.
Because relabeling is no longer part of sync, this removes the
machine-only
update for trashed sessions, the all-machines baseline scan, and the
ownership
baseline index keyed without machine. Watch reconciliation still uses
the
baseline for the machine that originally admitted a session, so
per-event work
stays bounded by the changed batch.
An earlier revision of this branch chased reattribution through each new
writer,
trash path, snapshot path, and reconciliation edge. That approach kept
widening
the persistent-archive surface and reintroducing consistency bugs, so it
was
replaced with the ingestion-time contract above. A one-shot relabel
command is
deliberately deferred: it needs its own invariants and recovery tests,
and it is
not required to ship labeled ingestion.
The filesystem sync guide documents Git, rsync/file copy, and
NFS/shared-mount
topologies, including atomic publication, archive ownership, freshness,
native-ID deduplication, label-change behavior, and when PostgreSQL is a
better
fit.
`session_sources` intentionally rejects `s3://` roots. Existing Claude
and Codex
S3 configuration and behavior remain unchanged through their existing
per-agent
settings.
Reviewers should start at `internal/sync/engine.go`, where machine
resolution
and the preserve-on-upsert rule live, then `internal/config/config.go`
for
parsing and path handling. `docs/superpowers/specs/` carries the design
rationale.
This branch contains no DuckDB changes. Mirror source-machine
attribution
already landed in #1302, and this PR neither duplicates nor modifies it.
---------
Co-authored-by: Matthew Jacobs <mjacobs@apache.org>1 parent e51f68b commit f0942ab
47 files changed
Lines changed: 3972 additions & 186 deletions
File tree
- cmd/agentsview
- docs
- superpowers
- plans
- specs
- internal
- artifact
- config
- db
- parser
- pathutil
- remotesync
- server
- sync
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
483 | 506 | | |
484 | 507 | | |
485 | 508 | | |
| |||
633 | 656 | | |
634 | 657 | | |
635 | 658 | | |
| 659 | + | |
636 | 660 | | |
637 | 661 | | |
638 | 662 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
936 | 936 | | |
937 | 937 | | |
938 | 938 | | |
| 939 | + | |
939 | 940 | | |
940 | 941 | | |
941 | 942 | | |
| |||
1053 | 1054 | | |
1054 | 1055 | | |
1055 | 1056 | | |
| 1057 | + | |
1056 | 1058 | | |
1057 | 1059 | | |
1058 | 1060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
| 936 | + | |
936 | 937 | | |
937 | 938 | | |
938 | 939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
102 | 124 | | |
103 | 125 | | |
104 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| 340 | + | |
339 | 341 | | |
340 | 342 | | |
341 | 343 | | |
| |||
0 commit comments