retire-compact-n

Retire .compact-N AND .archive-N cycle scaffolding entirely

Metadata

Statusdone
Assignedagent-94
Agent identityf51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e
Created2026-04-26T16:42:38.675130551+00:00
Started2026-04-26T19:43:08.977959541+00:00
Completed2026-04-26T20:39:20.707117118+00:00
Tagseval-scheduled
Eval score0.18
└ blocking impact0.10
└ completeness0.10
└ coordination overhead0.20
└ correctness0.12
└ downstream usability0.05
└ efficiency0.20
└ intent fidelity0.39
└ style adherence0.08

Description

Description

User decision: the compaction cycle is dead. Both .compact-N and .archive-N system task types should be eliminated, not retired-with-replacement. The chat-agent's own memory management (separate task, future) will cover what compaction was doing for context recovery; archive functionality, if needed, will move to a daemon-level (dispatcher-level) sweep — NOT a per-chat task.

What to remove

.compact-N (per project memory: 'compaction as visible cycle' pattern):

  • Auto-creation of .compact-N tasks when a chat (.coordinator-N / .chat-N) is created
  • The cycle scaffolding that wires .coordinator-N.compact-N as a back-edge cycle
  • Compaction-trigger logic in the dispatcher that fires when compactor_interval / compactor_ops_threshold / compaction_token_threshold thresholds are met (search for these config keys)
  • Any code that assembles 'compacted context' from prior chat history (the 'wire-compacted-context' commit referenced in project memory)
  • The CompactorState type and related modules in src/service/compactor/
  • All config keys: compactor_interval, compactor_ops_threshold, compaction_token_threshold, compaction_threshold_ratio — remove from default config and accept-with-deprecation-warning for one release

.archive-N:

  • Auto-creation of .archive-N tasks when a chat is created
  • The archive-loop tag and associated cycle code
  • The companion-task linkage in handle_create_coordinator (src/commands/service/ipc.rs:1358-1382) that creates .archive-N alongside the chat task
  • Don't lose archive FUNCTIONALITY — if archiving completed/abandoned tasks to archive.jsonl is still desired, move it to dispatcher-level logic (a sweep that runs periodically, not a per-chat task). If nobody currently uses archive output, just delete it.

Migration for existing graphs

  • On dispatcher boot, scan for legacy .compact-N and .archive-N tasks. Mark them Abandoned in-place with a one-time log message. Do NOT crash if found.
  • Provide wg migrate retire-compact-archive command that explicitly abandons all such legacy tasks in the current graph (opt-in cleanup).
  • Document the removal prominently — anyone with stale graphs should run the migration.

What is NOT in scope

  • Building the chat memory subsystem (separate task — was previously informally proposed; spec it as its own thing if/when needed).
  • Retiring .coordinator-N itself — that's the rename-dispatcher-daemon task, separate.
  • Touching agency pipeline tasks (.assign-*, .evaluate-*, .flip-*) — those stay.

Files likely to touch

  • src/commands/service/ipc.rshandle_create_coordinator companion-task creation
  • src/service/compactor/ — entire module probably deletable
  • src/commands/service/coordinator.rs or src/commands/service/mod.rs — compaction-trigger logic in main loop
  • src/config.rs — drop compaction config keys (with deprecation aliases)
  • src/commands/service/coordinator_agent.rs — any compaction integration in chat-agent loop
  • Tests in tests/ — any test referencing .compact- or .archive- cycles

Validation

  • Failing tests first:
    • test_create_chat_does_not_create_compact_companion (creating a new chat agent does NOT auto-create a .compact-N task)
    • test_create_chat_does_not_create_archive_companion (same for .archive-N)
    • test_legacy_compact_archive_tasks_loaded_then_abandoned (boot finds legacy tasks, abandons them with a single warning)
    • test_compactor_state_module_removed (compile-time check: crate::service::compactor does not exist OR returns an empty stub)
    • test_legacy_compaction_config_keys_warn_on_load
  • Implementation makes all tests pass
  • cargo build + cargo test pass with no regressions
  • Manual smoke:
    • In a scratch dir: wg init -x claudewg service start → use TUI to create a new chat → assert wg list shows ONLY the chat task, NO companion .compact-/.archive- tasks
    • In a scratch dir with a legacy graph (copy one in): start daemon → assert legacy .compact-N/.archive-N tasks are visible as Abandoned with a 'retired' log message; daemon does not crash

Depends on

Required by

Log