Skip to content

[refactor] Apply same detection cascade to documents_dir as output_dir (sister concern from #49) #50

Description

@kiki830621

Problem

Source: surfaced during /idd-plan #49 tangential sweep (Step 2.5)

plugins/che-apple-mail-mcp/commands/archive-mail.md line ~274 hardcodes documents_dir: correspondence/attachments as the default attachment routing destination. This is a parallel convention question to output_dir (the issue addressed in #49):

attachment_routing:
  ...
  data_dir: data/raw
  documents_dir: correspondence/attachments  # ← hardcoded default

After #49 lands, output_dir will use detection cascade (communications/email/correspondence/emails/ → default). But documents_dir will still assume correspondence/attachments/ — creating a layout inconsistency where emails go to communications/email/ but their attachments still flow to correspondence/attachments/.

Type

refactor / feature (parallel feature to #49)

Expected

documents_dir (and possibly data_dir) should benefit from the same detection-first treatment as output_dir:

  • If cwd has communications/<channel>/ layout → documents_dir defaults to communications/email/attachments/ or communications/attachments/
  • If cwd has correspondence/ layout → keep correspondence/attachments/ (legacy)
  • If neither → current default

Actual

Hardcoded default. No detection. Inconsistent with #49's output_dir resolution after that lands.

Impact

Priority

P3 — schedule. Becomes user-visible after #49 lands; before that, only theoretical.

Strategy sketch

Mirror #49's Tier B' detection cascade for documents_dir. Same probe-order policy (newest convention wins), same "explicit config wins" precedence. Likely a small follow-up PR (~50 LOC delta) once #49's detection helper is in place — can reuse the helper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions