[auto] fix: bootstrap --yes vs --force separation + backup + orphan detection#67
Merged
stackbilt-admin merged 1 commit intomainfrom Mar 27, 2026
Merged
[auto] fix: bootstrap --yes vs --force separation + backup + orphan detection#67stackbilt-admin merged 1 commit intomainfrom
stackbilt-admin merged 1 commit intomainfrom
Conversation
#65) --yes now means non-interactive (accept defaults, refuse to overwrite custom content). --force explicitly allows overwriting. Also: - Backup filenames include ISO timestamps (.ai/.backup/<file>.<timestamp>) - Overwrite warnings include byte counts for visibility - Orphaned ADF modules are auto-registered in --yes mode - Package.json detection checks worker/, src/, app/ nested dirs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Autonomous Task
Task ID:
80a25dcb-7073-4f9e-ba21-01c0dbc8a22bAuthority: auto_safe
Exit code: 0
Task Prompt
Fix Charter bootstrap UX when running on existing repos with pre-existing .ai/ content. This is the top adoption blocker — bootstrap currently nukes existing ADF modules.
GitHub Issue: #65
Changes needed (in priority order):
1. Separate --yes from --force
Currently
const force = options.yes;— these should be independent flags.--yes: non-interactive, accept defaults, but REFUSE to overwrite existing non-scaffold ADF files--force: explicitly allow overwriting existing content--yeswithout--forceshould skip overwriting files that already exist and contain non-scaffold content (check if content differs from the scaffold template)2. Backup before overwrite
Before overwriting any existing .ai/ files:
.ai/.backup/<filename>.<timestamp>--forceis used, still backup but proceed without prompting3. Register orphaned modules
After bootstrap scaffold generation, scan
.ai/for.adffiles not referenced inmanifest.adf:4. Fix package.json detection for worker preset
When preset is
worker, also check common nested locations:web/package.jsonworker/package.jsonsrc/package.jsonapp/package.jsonUse the first one found if root
package.jsondoesn't exist.How to find the code
src/commands/bootstrap.tsor similar)force = options.yesline is the starting pointVerification
npm run typecheckmust passnpm testmust passResult Summary
All changes committed. Here's a summary of what was done:
Changes made
1. Separated
--yesfrom--force(priority 1)adf.ts:adfInitandadfCreateno longer treat--yesas--force.--yes= non-interactive;--force= allow overwrite.setup.ts:setupCommandsame separation applied.bootstrap.ts: Already correctly separated (confirmed).2. Backup before overwrite (priority 2)
bootstrap.ts: Backup filenames now include ISO timestamps:.ai/.backup/<file>.<timestamp>(e.g.,core.adf.2026-03-26T12-00-00-000Z)".ai/core.adf has custom content (142 bytes); skipping scaffold overwrite")--forceis used3. Register orphaned modules (priority 3)
bootstrap.ts: In--yesmode, orphaned.adfmodules are now auto-registered asON_DEMANDin the manifest (previously only prompted interactively)4. Package.json detection for worker preset (priority 4)
setup.ts:loadPackageContextsnow also checksworker/,src/, andapp/directories forpackage.jsonValidation
TASK_COMPLETE
Generated by AEGIS task runner. Review before merging.