Skip to content

refactor: extract atomic auto-capture helpers#241

Closed
Victor-dw wants to merge 1 commit intoCortexReach:masterfrom
Victor-dw:codex/atomic-autocapture-pr-a
Closed

refactor: extract atomic auto-capture helpers#241
Victor-dw wants to merge 1 commit intoCortexReach:masterfrom
Victor-dw:codex/atomic-autocapture-pr-a

Conversation

@Victor-dw
Copy link

Summary

This PR extracts the atomic auto-capture path into focused helpers without changing the existing CLI surface.

Included

  • add src/atomic-memory.ts for a versioned atomic metadata envelope
  • add src/auto-capture.ts to isolate auto-capture trigger detection, candidate extraction, and fallback persistence
  • wire index.ts auto-capture fallback through the new helpers
  • preserve existing memory-pro CLI commands, including memory upgrade and reindex-fts
  • add focused tests for atomic metadata merging/parsing and auto-capture candidate persistence

Not included

  • no normalizer pipeline
  • no governance / audit CLI
  • no personalized tagging rules
  • no multilingual CLI output changes

Why this split

The previous PR mixed three separate themes:

  1. atomic metadata schema
  2. auto-capture refactor
  3. normalizer/governance features

This PR only keeps the first two pieces so review and rollback stay simple.

Validation

  • npm test
  • node --test test/atomic-memory.test.mjs
  • node test/auto-capture.test.mjs

@Victor-dw Victor-dw force-pushed the codex/atomic-autocapture-pr-a branch from 53879d1 to 6908c73 Compare March 16, 2026 14:16
@AliceLJY
Copy link
Collaborator

Thanks for taking the time to contribute this! Really appreciate it. 🙏

There are merge conflicts with main at the moment. Would you mind rebasing your branch? Once the conflicts are resolved, we'll get this reviewed.

Let us know if you run into any issues!

@Victor-dw Victor-dw force-pushed the codex/atomic-autocapture-pr-a branch from 6908c73 to 87d2acc Compare March 22, 2026 04:13
@Victor-dw
Copy link
Author

Rebased onto the latest master and resolved the merge conflicts.

Current head: 87d2acc

Validation completed locally:

  • npm test
  • node --test test/atomic-memory.test.mjs
  • node test/auto-capture.test.mjs

Happy to rework anything else if needed. Thanks for the review.

@rwmjhb
Copy link
Collaborator

rwmjhb commented Mar 22, 2026

Closing — the extraction idea has merit (index.ts is 2500+ lines), but this conflicts with other PRs touching the same auto-capture area (#229, #293) which propose different decompositions. Merging this would force rebases on those PRs with potentially incompatible module boundaries. If a capture-layer refactor lands later, the ideas here can be revisited. Thanks for the effort!

@rwmjhb rwmjhb closed this Mar 22, 2026
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.

3 participants