Repository navigation
Init new profile (spec 38) - #71
Merged
Merged
Conversation
…0` re-ask before spec 38 Written first, as spec 38 §10 asks: --new-profile and the `0)` entry must leave both as they are.
…ForProfile (spec 38)
…ecipes and targets only, P9–P11 (spec 38)
… the template's, else claude-code
…two messages (spec 38)
…ng forges/ (spec 38 P5)
…lds it, no recipes or targets in craftar.yaml (spec 38)
… one; --targets stays out of the workspace layer A missing ingredient is a warning for every profile; the test now uses a recipe extending one the Forge does not have, which the resolver refuses. --targets shapes the new profile only (spec 38 §4.1).
… its questions, an empty Forge directory, the confirmation (spec 38)
…jected seams (spec 38 §5.3)
…rectory, then start the workspace on it — nothing committed (spec 38)
… copy of the check and its message (spec 38 §4.2)
…rt, the roadmap (spec 38)
… is a late failure with the undo (review) The merged ref held a craftar.local.yaml ref: a path Forge then refused it after the profile was written, with no recover lines — and a local-only ref would have reached craftar.yaml.
…res after the profile print the undo (review) The second plan has no recipe flag or template, so its notes were always empty; spec 22's notes and the integrations note were lost. N1's text now has one spelling, and EEXIST/mkdir after the profile write print N1 then the late-failure lines. The --add/--remove-recipe help reads as the spec words it.
… Forge it cannot write, asks replace, refuses an unknown --like up front (review) The draft goes through ProfileSchema (a schema 3 Forge no longer throws a raw TypeError); P10 is found with ownedBy and worded once (ownedRecipeRefusal). test/init-flow.test.ts case 9 now expects the re-ask spec 38 §4.3 asks for.
…README status line names --new-profile (review)
…firmation too (review)
…mes YAML would misread are quoted (review)
…d says spec 22's notes; a refused URL is not offered again (review)
…ead back as the name (review)
…t the question; a local recipes or targets is said, not asked (review)
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.
Summary
craftar@0.34.0to npm after approval in thenpmenvironment.craftar init --new-profile <name> [--like <profile>]creates the profile first — one new file,profiles/<name>/profile.yaml, in the Forge's working tree, holdingname,recipesandtargetsonly — then starts the workspace on it. Nothing is committed, no branch is made and nothing is pushed (Ruling 1). With--new-profile,--add-recipe,--remove-recipe,--replaceand--targetsshape the profile, andcraftar.yamlgets norecipesand notargets.--likecopies the template's writtenrecipesandtargetsonly (Ruling 2). In a Forge at schema 3 or above, recipes that only the template'sintegrationsblock selects are left behind with onenote(Ruling 3). A recipe named for another profile is refused (P10, Ruling 4).initbecomes a gated Forge writer of one path. The gate (P5–P8) refuses a cache tree, a directory that is not a git repository with a commit, a name orprofiles/<name>that exists, a path git ignores, and a symbolic link on the way. The profile directory is journalled, created with a non-recursivemkdir, and the file is writtenwx. The Forge is then read back from disk and must plan the same bytes beforecraftar.yamlis written. A late failure printsgit -C <forge> clean -fd -- profiles/<name>.0) a new profile, and a Forge directory with no profile goes straight to the new profile's questions (Ruling 5).--jsonshape changes. No Upgrading block.Built as spec 38 recommends, not yet ruled (§13)
node-cli.mdand its reviewer agent gain that sentence after this PR, together withinitas a gated writer.Departures from spec 38's text (recorded at the spec refresh)
src/core/new-profile-write.ts) with injected seams (WriteHooks), so the race and the second proof are tested in-process. There is no environment back door.forges/.123,null,true) are quoted in the file, and the file is read back throughProfileSchemabefore any write.recipesortargetsis said, not asked, and stays a workspace layer.craftar.local.yamlsetsrecipes: that ends on P10, as the flags mode does.Test plan
npm run typecheck— exit 0 (0f7e031, after the bump and a rebase onto 6eeaeae — the 25 commits identical by range-diff)npm run build— exit 0;craftar --versionprints 0.34.0npm test(vitest--maxWorkers=6, withouttest/ci.test.ts) on 0f7e031 — 136 files passed, 1 skipped; 3366 tests passed, 10 skipped. Oracle skipped (no fixture); no emitter, plan or status byte path changed.test/init-new-profile-pins.test.ts):init's both-flags stdout byte for byte, and today's re-ask on the answer0.src/.skipIf(win32)).craftar.yamllosing itswxrace to N1 after the profile was written. There is no seam between the two writes.0)entry, the questions, the re-asks, the confirmation.