You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ feat(import-follow): add --target-profile presets for cleanup and audit hygiene commands
- Add target-profile flag with values: all, artifacts, state, retry, health
- artifacts profile covers checkpoint plus retry targets without follow-health
- all profile enables every target class for full hygiene sweeps
- state, retry, and health profiles enable single target classes
- Add parser normalization and profile-to-boolean expansion helpers
- Add unit tests for profile parsing and end-to-end cleanup/audit runs
- Add example fixtures for target-profile-all and target-profile-retry
- Update operator docs with preset examples and usage guidance
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,10 @@ They are not MCP tools and are not the normal end-user interaction path.
80
80
Imports newline-delimited watcher or relay note events into durable imported notes plus audit records, with optional partial-success handling plus retry-oriented failure exports.
Follows one or more watcher or relay JSONL files incrementally, prefers filesystem notifications with polling fallback by default, keeps one checkpoint per input, automatically retries watcher recovery in `auto` mode, and reports command-level watch state plus poll-catchup/recovery events and warnings alongside per-input imported-note results.
Removes selected follow-imports checkpoint, retry-artifact, and stale-health artifacts. `--target-profile` can enable common cleanup target sets before you add path, age, or dry-run filters.
Reports the same hygiene targets without deleting them. `--target-profile` can enable common audit target sets before you add path, age, or fail-if-matched controls.
83
87
-`codex-mem migrate`
84
88
Opens the configured SQLite database and applies embedded migrations.
Copy file name to clipboardExpand all lines: docs/go/maintainer/development-tracker.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,27 @@ Immediate next tasks:
151
151
152
152
### 2026-03-17 Session Update
153
153
154
+
- Completed: Added a fifth follow-import hygiene target preset: `--target-profile artifacts`. It expands to checkpoint-sidecar plus retry-artifact targets without touching follow-health snapshots, which fills the gap between `all` and the narrower `state` / `retry` profiles. Parser and end-to-end CLI tests now verify that `artifacts` selects state plus retry work while leaving follow-health out of both cleanup and audit reports, and the operator docs/README now advertise the new preset.
155
+
- In progress: none.
156
+
- Blockers: none.
157
+
- Next step: decide whether the current target-profile catalog is now complete enough, or whether future operator feedback should drive any further preset additions.
158
+
159
+
### 2026-03-17 Session Update
160
+
161
+
- Completed: Added checked-in sample outputs that explicitly exercise the new follow-import hygiene target presets. The repository now includes a `cleanup-follow-imports` text fixture for `--target-profile all` plus an `audit-follow-imports` JSON fixture for `--target-profile retry`, and the example-list tests plus operator docs now advertise those preset-focused fixtures alongside the older age/pattern examples.
162
+
- In progress: none.
163
+
- Blockers: none.
164
+
- Next step: decide whether the preset catalog is complete enough now, or whether operators would benefit more from another profile such as "artifacts-only" that excludes follow-health.
165
+
166
+
### 2026-03-17 Session Update
167
+
168
+
- Completed: Added `--target-profile` presets to `cleanup-follow-imports` and `audit-follow-imports` with initial `all`, `state`, `retry`, and `health` values. The profile layer expands to the existing prune/check booleans instead of introducing a second hygiene engine, so explicit `--prune-*` and `--check-*` flags still work and can be combined with a profile. App and parser coverage now verifies target-profile parsing plus end-to-end cleanup/audit runs, and the import-ingestion/README docs now show the new shorthand for common hygiene slices.
169
+
- In progress: none.
170
+
- Blockers: none.
171
+
- Next step: decide whether the current target-profile catalog is enough, or whether follow/import operators would benefit more from checked-in sample outputs that exercise the new presets explicitly.
172
+
173
+
### 2026-03-17 Session Update
174
+
154
175
- Completed: Fixed Linux CI drift in unit tests and pinned the workflow lint toolchain to the same `golangci-lint` version used locally. The follow-import and readiness example-list tests now build expected fixture paths with `filepath.Join(...)` instead of hard-coding Windows separators, the duplicate follow-input test now uses a platform-neutral relative path, and `.github/workflows/build-release.yml` now pins `golangci-lint` to `v2.10.1` with the same `./...` target as the local command.
`cleanup-follow-imports` and `audit-follow-imports` only. Optional. Repeats or accepts comma-separated glob patterns that act as a whitelist for checkpoint and retry-artifact candidate paths. Patterns are matched against both the absolute path and the basename.
182
200
-`--exclude <glob>`
183
201
`cleanup-follow-imports` and `audit-follow-imports` only. Optional. Repeats or accepts comma-separated glob patterns that remove checkpoint and retry-artifact candidates from the matched set after includes are considered. Excludes win over includes.
`cleanup-follow-imports` and `audit-follow-imports` only. Optional. Expands to a documented default target set instead of making you spell out the target flags every time. `all` enables every target class, `artifacts` enables checkpoint plus retry-artifact targets while leaving follow-health alone, `state` enables only checkpoint sidecars, `retry` enables only failed-output plus failed-manifest artifacts, and `health` enables only follow-health inspection/pruning. Explicit `--prune-*` or `--check-*` flags still add extra targets on top.
184
204
-`--retention-profile stale|daily|reset`
185
205
`cleanup-follow-imports` and `audit-follow-imports` only. Optional. Expands to a documented default age threshold instead of making you spell out `--older-than` every time. `stale` means `1h`, `daily` means `24h`, and `reset` means `0s`. An explicit `--older-than` still overrides the profile.
186
206
@@ -266,8 +286,10 @@ Checked-in sample outputs for common cleanup flows live under [../../../internal
If a deliberate output change makes those fixtures drift, refresh the cleanup fixtures from the repository root through the test-only maintainer helper:
273
295
@@ -326,6 +348,7 @@ go test ./internal/app -run "Test(Audit|Cleanup)FollowImportsExampleOutputsStayI
326
348
- Add `--older-than <duration>` when you want cleanup or audit to ignore very recent checkpoint or retry files. This age gate applies to checkpoint sidecars plus range-suffixed retry artifacts, not to the stale-health decision, which still uses the existing follow-health staleness policy.
327
349
- Add `--include` when the cleanup or audit target should stay inside one file family, input label, or path prefix. This is especially useful for multi-input runs where you only want to inspect or clean artifacts related to one input at a time.
328
350
- Add `--exclude` for the final guardrail when a broad include or input set still catches more than you want. Exclude patterns override includes, so they are the safer place to carve out known paths or suffixes.
351
+
- Use `--target-profile all` when you want the old "turn on every target flag" behavior without spelling out each flag, `--target-profile artifacts` when the command should cover checkpoint and retry files but intentionally leave follow-health snapshots alone, `--target-profile retry` when scheduled audits should look only at range-suffixed retry exports, `--target-profile state` when checkpoint hygiene is the only concern, and `--target-profile health` when you only need the last-known follow-health snapshot.
329
352
- Use `--retention-profile stale` when you want a quick ad-hoc cleanup or audit pass that ignores artifacts newer than one hour, `--retention-profile daily` for a broader once-per-day sweep, and `--retention-profile reset` when you want the selected target set matched immediately. If one preset is close but not quite right, keep the profile for readability and add an explicit `--older-than` override.
330
353
-`cleanup-follow-imports --prune-state` derives the same default checkpoint path that `follow-imports` would use for each `--input`, so you can clean old sidecars without repeating every `.offset.json` name manually.
331
354
-`cleanup-follow-imports --prune-failed-output` and `--prune-failed-manifest` remove only batch-scoped retry artifacts whose names end in the byte-range suffix that `follow-imports` generates (for example `failed.events-a.0-42.jsonl`). The base path you pass stays untouched, which avoids deleting a placeholder or unrelated manually curated file with the unsuffixed name.
0 commit comments