Skip to content

refactor: package code organization wave 14 - #2391

Merged
gsxdsm merged 11 commits into
mainfrom
feature/code-organization-wave14
Jul 22, 2026
Merged

refactor: package code organization wave 14#2391
gsxdsm merged 11 commits into
mainfrom
feature/code-organization-wave14

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wave 14 of package code organization (stacks on #2367 / wave 13).

Peels

New module Parent
types/task-review.ts task review + PR review surface types
types/documents-artifacts.ts documents, artifacts, review-artifact helpers, goal citations
task-store/workflow-task-create-ops.ts rename of remaining-ops-4
task-store/task-mutation-ops.ts rename of remaining-ops-2

Public paths stay stable via types.ts / store.ts re-exports.

LOC

  • types.ts ~6264 → ~5871

Shims

  • types.ts → peels above (delete-when: consumers import domain modules)
  • remaining-ops-4workflow-task-create-ops (rename complete)
  • remaining-ops-2task-mutation-ops (rename complete)

Only remaining-ops-1.ts remains of the numbered ops series.

Test plan

  • @fusion/core typecheck
  • review-artifacts unit tests
  • pnpm check:line-count (baseline updated)
  • CI merge gate

Summary by CodeRabbit

  • Refactor
    • Split task review, document, artifact, and goal-citation type definitions into dedicated shared modules.
    • Updated task-operation wiring to use the newer task-create/mutation operation surfaces (no API changes intended).
  • Documentation
    • Corrected inline references and refreshed module headers to match the current task-operation structure and domain naming.
  • Tests
    • Updated a test import to point to the current duplicate-auto-archive backend implementation source.
  • Chores
    • Refreshed line-count baseline values to reflect the latest code layout.

gsxdsm added 10 commits July 20, 2026 00:34
…, task-id-integrity

Behavior-preserving package organization after wave 11:
- app/api: git, workspace-files, provider-status, github/gitlab-import,
  run-audit, task-diff, agent-import-generation (legacy re-exports kept)
- types/run-audit.ts + types/planner-intervention.ts peels from types.ts
- rename remaining-ops-5 → task-store/task-id-integrity.ts
- Ratchet legacy.ts line-count ceiling (~5665 → ~3339)
Prefer ApiRequestError.status === 404 over case-sensitive message matching
when agent children are missing, with a case-insensitive not-found fallback.
…acts-ops

Behavior-preserving package organization after wave 12:
- app/api: planning, dev-server, mission-interview, models-usage,
  task-steer, ai-summarize (legacy re-exports kept)
- rename remaining-ops-7 → task-store/task-artifacts-ops.ts
- legacy.ts shrinks below the 2000-line cap (~3342 → ~1408)
Behavior-preserving package organization after wave 13:
- types/task-review.ts — review/PR-review surface types
- types/documents-artifacts.ts — documents, artifacts, goal citations
- rename remaining-ops-4 → task-store/workflow-task-create-ops.ts
- rename remaining-ops-2 → task-store/task-mutation-ops.ts
- Ratchet types.ts line-count ceiling (~6264 → ~5871)
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a2072c0d-f266-4222-9a13-803269c700e5

📥 Commits

Reviewing files that changed from the base of the PR and between 04acb6f and e15a1ff.

📒 Files selected for processing (2)
  • packages/core/src/types.ts
  • scripts/line-count-baseline.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/line-count-baseline.json
  • packages/core/src/types.ts

📝 Walkthrough

Walkthrough

Changes

The PR extracts task-review and documents-artifacts contracts from the core types barrel into dedicated modules while preserving re-exports. It also rewires task-store imports to renamed operation modules, updates related comments and tests, and regenerates line-count baselines.

Core contracts and module wiring

Layer / File(s) Summary
Domain contract modules
packages/core/src/types/task-review.ts, packages/core/src/types/documents-artifacts.ts
Task-review, document, artifact, native-structure, goal-citation, policy, and document-key contracts and helpers are defined in dedicated modules.
Types barrel re-exports
packages/core/src/types.ts
The barrel re-exports the extracted type and runtime surfaces.
Task-store module wiring
packages/core/src/store.ts, packages/core/src/task-store/*, packages/core/src/__tests__/same-agent-duplicate-intake.test.ts
Store and test imports reference the renamed task-store modules, with corresponding documentation updates.
Line-count baseline regeneration
scripts/line-count-baseline.json
Baseline counts are updated for affected CLI, core, dashboard, and engine files and tests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • Runfusion/Fusion#2139: Refactors the core types barrel to re-export domain types from dedicated modules.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main refactor theme and correctly reflects a package organization wave update.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/code-organization-wave14

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reorganizes core types and task-store operations into clearer domain modules. The main changes are:

  • Moves task-review types into types/task-review.ts.
  • Moves document, artifact, and goal-citation types and helpers into types/documents-artifacts.ts.
  • Renames two task-store operation modules and updates their imports.
  • Keeps existing public imports stable through re-exports.
  • Updates the line-count baseline for the reorganized source tree.

Confidence Score: 5/5

This looks safe to merge.

  • The renamed module paths resolve to the corresponding files.
  • The moved types and helpers remain available through the existing public exports.
  • No additional blocking issue qualifies for this follow-up review.

Important Files Changed

Filename Overview
packages/core/src/types.ts Replaces inline definitions with imports and re-exports from the new domain modules.
packages/core/src/types/documents-artifacts.ts Contains the moved document, artifact, native-structure, and goal-citation contracts and helpers.
packages/core/src/types/task-review.ts Contains the moved task-review types without changing their public shapes.
packages/core/src/store.ts Updates imports to use the renamed task-store operation modules.
scripts/line-count-baseline.json Refreshes recorded line counts across the reorganized source tree.

Reviews (2): Last reviewed commit: "merge: origin/main into wave14; resolve ..." | Re-trigger Greptile

Comment thread scripts/line-count-baseline.json Outdated
"packages/engine/src/executor.ts": 20352,
"packages/engine/src/merger-ai.ts": 2445,
"packages/engine/src/merger.ts": 11244,
"packages/engine/src/pi.ts": 2847,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unrelated Growth Enters Baseline

This raises executor.ts from 20,076 to 20,352 even though that file is unchanged in this PR. Future audits now accept those 276 unrelated lines, so later changes can exceed the previously recorded limit without being reported; several other untouched files are raised in the same update.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Base automatically changed from feature/code-organization-wave13 to feature/code-organization-wave12 July 22, 2026 04:21
Base automatically changed from feature/code-organization-wave12 to main July 22, 2026 06:10
Keep workflow-task-create-ops import after remaining-ops-4 rename.
Regenerate line-count baseline against the merged tree.
@gsxdsm
gsxdsm merged commit ceaf0cc into main Jul 22, 2026
7 checks passed
@gsxdsm
gsxdsm deleted the feature/code-organization-wave14 branch July 22, 2026 06:33
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