Skip to content

console.log direct writes remain in src/domain/search/ outside prepare.ts (generator.ts, semantic.ts, cli-formatter.ts) #1754

Description

@carlos-alm

Context

While fixing Titan gauntlet finding for src/domain/search/search/prepare.ts (rule 15, pillar IV — raw console.log in a domain-layer function, should route through src/infrastructure/logger.ts per CLAUDE.md layering conventions), I found the same pattern is unaddressed in sibling files that were not covered by any Titan gauntlet entry:

  • src/domain/search/generator.ts:245,278,292console.log progress/status messages
  • src/domain/search/search/semantic.ts:75,78console.log dimension-mismatch warning messages
  • src/domain/search/search/cli-formatter.ts (many lines) — console.log result-rendering output

Why filed instead of fixed inline

cli-formatter.ts is plausibly an intentional exception — its name and content (rendering search results for terminal display) suggest it's a presentation-layer file that happens to live under src/domain/search/search/ rather than src/presentation/, similar to how other presentation formatters in the codebase call console.log directly. That's a separate architectural question (should it move to src/presentation/?) from generator.ts and semantic.ts, which are genuine domain/business-logic files emitting console output on production code paths (embedding generation progress, dimension-mismatch warnings) — the same category of finding as prepare.ts.

None of these three files have a corresponding entry in .codegraph/titan/gauntlet.ndjson (verified via grep), so this was never audited or scheduled by the Titan pipeline. Filing per CLAUDE.md's scope-discipline rule rather than expanding the current phase (which targets only prepare.ts).

Suggested fix

  • generator.ts, semantic.ts: route through src/infrastructure/logger.ts (e.g. logger.info/logger.warn), consistent with the prepare.ts fix.
  • cli-formatter.ts: evaluate whether it should move to src/presentation/ to match the codebase's layering convention (domain → presentation), or if leaving direct console output here is an accepted exception because it's explicitly a CLI-output formatter, not general domain logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions