Skip to content

refactor: P2 code cleanup — validation, search, constants, parallel I/O#20

Merged
tlconde merged 1 commit into
mainfrom
refactor/p2-code-cleanup
Mar 17, 2026
Merged

refactor: P2 code cleanup — validation, search, constants, parallel I/O#20
tlconde merged 1 commit into
mainfrom
refactor/p2-code-cleanup

Conversation

@tlconde
Copy link
Copy Markdown
Owner

@tlconde tlconde commented Mar 17, 2026

Summary

  • Shared validateRequiredFrontmatter() (formatter + governance consolidated)
  • searchWithFallback() helper (search_memory + get_memory deduped)
  • VALID_OUTCOMES constant in schema-constants.ts
  • Parallel tail reads in memory://tails (4 sequential reads to Promise.all)
  • Skipped P2-7 (mergeMcpConfig - different targets) and P2-10 (tool paths - adds coupling)

Net: -13 lines, zero behavior change.

Test plan

  • npx tsc passes
  • All replaced patterns produce identical behavior

…ts, parallel I/O

- Consolidate frontmatter validation into validateRequiredFrontmatter()
  in schema-constants.ts (formatter + governance now share one function)
- Extract searchWithFallback() in memory.ts (search_memory + get_memory
  deduped from 30 lines each to 1 line each)
- Add VALID_OUTCOMES to schema-constants.ts, use in collaboration.ts
  and tools/index.ts schema
- Parallelize 4 tail reads in resources.ts memory://tails endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tlconde tlconde merged commit 36d2a11 into main Mar 17, 2026
2 checks passed
@tlconde tlconde deleted the refactor/p2-code-cleanup branch March 17, 2026 11:14
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