Skip to content

fix(init): preserve items directory when using --force#50

Open
jmanhype wants to merge 8 commits intomikehostetler:mainfrom
jmanhype:fix/init-force-preserve-items
Open

fix(init): preserve items directory when using --force#50
jmanhype wants to merge 8 commits intomikehostetler:mainfrom
jmanhype:fix/init-force-preserve-items

Conversation

@jmanhype
Copy link
Copy Markdown
Collaborator

Summary

  • wreckit init --force previously deleted the entire .wreckit/ directory via fs.rm(recursive: true), destroying all items
  • Now only resets config.json and prompts/ while preserving items/ and other user data (e.g., config.local.json)

Changes

  • src/commands/init.ts: Replace recursive directory delete with targeted removal of only config and prompts
  • src/__tests__/commands/init.test.ts: Updated test to verify items survive --force reinit, config resets to defaults, and prompts are refreshed

Test plan

  • bun test src/__tests__/commands/init.test.ts — 10/10 pass
  • bun test — 1577/1577 pass (0 fail)
  • bun run typecheck — clean
  • Manual CLI verification: 3 items present before init --force, 3 items still present after

🤖 Generated with Claude Code

jmanhype and others added 8 commits February 11, 2026 23:04
Local-only repos (no git remote) failed during direct merge because
`git pull --ff-only` errored. Now checks `git remote` first and skips
the pull step if empty, enabling direct merge mode on repos without
a remote origin.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Item 093: add missing `notes` fields to all stories
- Item 048: convert `description` to `acceptance_criteria`, add `notes`
- Item 092: reset orphaned `in_pr` state to `planned` (no branch exists)
- Item 001: priority clamping (auto-fixed by doctor)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- #50: Critique phase now commits metadata (state + progress.log)
- #48: Branch checkout stashes uncommitted changes before switching
- #45: ensureBranch() pulls latest base before creating new branches
- #46: Merge conflict aborts cleanly and restores feature branch
- #43: Post-merge anti-clobber restores other items' item.json from pre-merge SHA
- #51: Critique prompt now instructs agent to run tests + typecheck
- #52: Anti-gaming rules in implement + critique prompts (no stubs, no gaming tests)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ber regression

Dogfooding revealed that the "done" state written after mergeAndPushToBase()
was never committed to git. When a subsequent item's anti-clobber restored
item.json files from the pre-merge SHA, it would revert the previous item
back to "critique" state. Adding a commit after the done+progress.log write
ensures the state is persisted in git history.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
… compatibility

Bun's test runner eagerly creates rejected promises from mockRejectedValue(),
triggering unhandled rejection errors before the mock is called. Using
mockImplementation(async () => { throw ... }) defers the rejection until
the mock is actually invoked, fixing 5 pre-existing test failures.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Reset 7 stuck items (in_pr/critique/planned/researched) back to idea
- Delete stale branches (fix/real-sdk-integrations, wreckit/064, wreckit/065)
- Remove stale files (OBSERVED_ISSUES.md, backups, jido-brainstorm, rlm diagrams)
- Update README with: direct merge mode docs, critique phase, meta-agents,
  rollback command, merge safety features, correct state flow, current config

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Analysis of 208 wreckit executions across 12 projects. Key findings:
93.5% AUC predicting task success from planning-phase signals alone,
direct merge 75% vs PR 40.5% success, 83% of failures before coding.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
`wreckit init --force` previously deleted the entire `.wreckit/` directory
including all items, causing data loss. Now only resets config.json and
prompts/ while preserving items/ and other user data.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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