Repository navigation
Closed
Labels
cc:taskCodeCrew: a task issue, attached to its milestone as a sub-issue (SPEC §4)
Description
Goal
init commits the scaffold it wrote, so the scaffold is the last commit before the protocol starts instead of a change the operator must gather, commit and — where the default branch requires pull requests — merge by hand with no task behind it (#164 findings 51 and 68; #172, adopted by the operator on 2026-08-30 on the assessed shape). Only the files init wrote go into the commit; the operator's staged and unstaged work is untouched; nothing is pushed.
Requirements
None directly (a cycle-4 fold-back; it serves M7-R9's "a clean repo at the close").
Plan
- The commit (
internal/cli/init.go): after the scaffold, when the directory is a git repository and at least one file was written,initrunsgit add -- <written>andgit commit --only -m "chore: scaffold codecrew" -- <written>— a pathspec commit, which takes exactly those paths and leaves everything else in the index and the working tree as it was (no stash, no-A). A rerun that wrote nothing commits nothing. The operator's own git identity signs it; a commit that fails (no identity configured, hooks) is a note with the command to run by hand, never an error that hides the scaffold. Spoke mode commits its pointer the same way. - Which branch: the current branch, unless the repository's default branch requires pull requests — asked through
gh(repo viewfor the default branch,GET /repos/{o}/{r}/rules/branches/{default}for apull_requestrule) — in which caseinitcreatescodecrew-bootstrapfrom HEAD, commits there, and prints the PR instruction: that PR is the one merge the operator does by hand, recorded as the pre-milestone gate on it (M7-R1), and the branch is cleaned by delete-on-merge, whichstatusalready nags about. A repository with no remote (a freshgit init) or an unborn HEAD commits on the current branch — the root commit. When the question cannot be asked (noghauth, offline) the branch is assumed: a commit stranded on a protectedmainis the worse outcome, and the note says why. - Never: push;
git init(the note for a non-repository stays as it is — a stray repository around the wrong directory is worse than a note); stash. - Tests, same PR (temp repositories,
giton the runner): a fresh repository gets a root commit containing exactly the scaffold files; a repository with a modified tracked file and a staged unrelated file keeps both exactly as they were afterinit; a rerun commits nothing; the protected case (the rule query injected) commits oncodecrew-bootstrapwith the original branch untouched; a non-repository writes files and commits nothing; a failing commit is a note and the files remain. - Docs: SPEC §6's
initrow; the quickstart (docs/first-milestone.md) — the "Commit and push" step becomes "push" and the protected-branch paragraph names the branchinitmade; README's four-line start comment; the introduction'sinitline if it enumerates;init's own output.CHANGELOG.md[Unreleased]. Backlog capture: the scaffold PR lands outside the protocol — init as a protocol act, or task finish --bootstrap #172 closes with this task. - Not here: repository creation (
gh repo createstays the operator's — the crew Apps lack Administration and the visibility is a decision); atask finish --bootstrappath (rejected on Backlog capture: the scaffold PR lands outside the protocol — init as a protocol act, or task finish --bootstrap #172). go test ./...green; subjects ≤ 100 characters, lowercase after the type, gated before committing; PR as the implementer withCloses #183andCloses #172; the reviewer seat by dispatch underharness: codex;task finish 183is the merge.
Ask-the-human points
None — the shape was decided by the operator on #172 (2026-08-30); the plan applies it.
Metadata
Metadata
Assignees
Labels
cc:taskCodeCrew: a task issue, attached to its milestone as a sub-issue (SPEC §4)
Activity
radiusred-cody commentedon Aug 30, 2026
Started by @radiusred-cody[bot].
feat(init): commit exactly the scaffold; codecrew-bootstrap when the …
docs: the scaffold is a commit — SPEC, the quickstart, the README lin…
fix(init): refuse subdirectories, skip a detached HEAD, cut the boots…
radiusred-cody commentedon Aug 30, 2026
Deviation: the plan said
codecrew-bootstrapis cut from HEAD; as merged it is cut from the default branch —refs/remotes/origin/<default>, else the local branch, HEAD only when neither exists (with a note). Why: the reviewer found that from a feature branch the scaffold PR would have carried the feature commits (PR #184, round 1, finding 3); the scaffold PR must be scaffold-only for the one hand merge it needs to be safe. Second deviation, same source: the quickstart pushesHEAD, notmain—initcommits on whatever branch the operator is on, and prints the exact command.docs(init): the quickstart pushes HEAD, not main; a test for a branch…
feat(init): commit exactly the scaffold; codecrew-bootstrap when the …
docs: the scaffold is a commit — SPEC, the quickstart, the README lin…
fix(init): refuse subdirectories, skip a detached HEAD, cut the boots…
docs(init): the quickstart pushes HEAD, not main; a test for a branch…
docs: the scaffold gap narrows — init commits it; the hand merge behi…
docs: the scaffold gap narrows — init commits it; the hand merge behi…