Skip to content

refactor(repl): extract haiku title extraction to helper (audit §1.1.1 slice #26) - #196

Merged
dahai80 merged 1 commit into
mainfrom
audit/repl-split-slice26-haiku-title
Aug 29, 2026
Merged

dahai80 merged 1 commit into
mainfrom
audit/repl-split-slice26-haiku-title

Conversation

@dahai80

@dahai80 dahai80 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

PURE-ROUTING SUB-BLOCK extraction (same class as slice #25 apiMetricsCapture).

What

Body at REPL.tsx:3101-3138 (37 LOC, 5 closure deps) → maybeExtractHaikuTitle() in src/utils/haikuTitleExtraction.ts.

Why

Audit §1.1.1 god-module split (task #170). Slice #26 of ongoing REPL.tsx decomposition. Lowest-risk candidate per investigator survey (LOW risk, pure compute + fire-and-forget + one setter, no JSX/await).

Behavior

Byte-identical. Guard moved into helper; ctx carries titleDisabled/sessionTitle/agentTitle/haikuTitleAttemptedRef/setHaikuTitle. One-shot ref gates Haiku call (first real user message only, skips synthetic breadcrumbs via tag-prefix checks). fire-and-forget void generateSessionTitle.

Import cleanup

5 sole-user symbols removed from REPL: 3 tags (BASH_INPUT_TAG/COMMAND_MESSAGE_TAG/COMMAND_NAME_TAG) + 2 fns (extractFallbackTitle/generateSessionTitle). LOCAL_COMMAND_STDOUT_TAG + getContentText kept (other users).

Gates

  • typecheck: 0 errors
  • tests: 914 pass
  • biome: new file clean (REPL pre-existing warnings unchanged)
  • build:dev: ok

REPL 6172→6128 (-44). Cumulative -924→-968.

…1 slice #26)

PURE-ROUTING SUB-BLOCK extraction (same class as slice #25 apiMetricsCapture).
Body at REPL.tsx:3101-3138 (37 LOC, 5 closure deps) → maybeExtractHaikuTitle()
in src/utils/haikuTitleExtraction.ts.

Behavior byte-identical: guard moved into helper; ctx carries
titleDisabled/sessionTitle/agentTitle/haikuTitleAttemptedRef/setHaikuTitle.
One-shot ref gates Haiku call (first real user message only, skips synthetic
breadcrumbs via tag-prefix checks). fire-and-forget void generateSessionTitle.

REPL import cleanup: 3 sole-user tags (BASH_INPUT_TAG/COMMAND_MESSAGE_TAG/
COMMAND_NAME_TAG) + 2 sole-user fns (extractFallbackTitle/generateSessionTitle)
removed; LOCAL_COMMAND_STDOUT_TAG + getContentText kept (other users).

REPL 6172→6128 (-44). Cumulative -924→-968.
Gates: typecheck 0 / 914 tests pass / biome new-file clean / build:dev ok.

Co-Authored-By: Claude Fable 5 <[email protected]>
@dahai80
dahai80 merged commit df8b068 into main Aug 29, 2026
1 check passed
@dahai80
dahai80 deleted the audit/repl-split-slice26-haiku-title branch August 29, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant