Skip to content

fix(workspace): ship nested scaffold docs + fix imageless DEVKIT_ORG default (#953, #954) - #956

Merged
c-vigo merged 4 commits into
devfrom
bugfix/953-init-workspace-copy-and-org-fixes
Jul 9, 2026
Merged

c-vigo merged 4 commits into
devfrom
bugfix/953-init-workspace-copy-and-org-fixes

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Two related assets/init-workspace.sh bug fixes, TDD, one PR into dev.

#953 — scaffold copy drops nested README.md/CHANGELOG.md

Problem: PRESERVE_FILES lists bare names (README.md, CHANGELOG.md) to protect the consumer's ROOT docs. The copy built --exclude=$preserved (no leading slash), so rsync matched by basename at every depth and silently dropped devkit-authored NESTED docs (.devcontainer/README.md, .devcontainer/CHANGELOG.md, .claude/skills/*/README.md) on --force upgrades — files the --preview report (exact-path is_preserved_file) still promised under ADDED.

Fix: root-anchor each exclude (--exclude=/$preserved), matching is_preserved_file's exact-path semantics. Root docs stay preserved; nested docs now ship.

RED→GREEN: new bats test seeds a consumer root README.md/CHANGELOG.md, runs a --force upgrade, then asserts the root docs are preserved AND .devcontainer/README.md, .devcontainer/CHANGELOG.md, .claude/skills/inception_explore/README.md were copied. Failed on the nested-doc assertion before the fix; green after.

#954 — imageless --no-prompts defaults org to literal vigOS/devc

Problem: under --no-prompts with no ORG_NAME env and no manifest DEVKIT_ORG, the org defaulted to the hardcoded vigOS/devc — a bogus /-bearing org that sed-substitutes into {{ORG_NAME}} in generated files (e.g. the LICENSE copyright line). GITHUB_REPOSITORY (owner/repo) is already available on this path (DEVKIT_REPO uses it) but ORG ignored it.

Fix: default the org to the GITHUB_REPOSITORY owner segment (${GITHUB_REPOSITORY%%/*}), falling back to the sane literal vigOS only when no usable owner/repo is present (empty or OWNER/REPO).

RED→GREEN: new bats test runs --no-prompts with GITHUB_REPOSITORY=some-org/repo and no ORG_NAME/manifest org, then asserts .vig-os persists DEVKIT_ORG=some-org (not vigOS/devc) and the LICENSE org substitution is slash-free. Persisted vigOS/devc before the fix; green after. The existing #885 write-back test's assertion was updated from DEVKIT_ORG=vigOS/devc to DEVKIT_ORG=test to reflect the corrected owner-derived default.

Verification

Closes #953
Closes #954

c-vigo added 4 commits July 9, 2026 13:46
…d upgrade

An upgrade where the consumer already carries root README.md/CHANGELOG.md
must still copy the devkit-authored nested docs (.devcontainer/README.md,
.devcontainer/CHANGELOG.md, .claude/skills/*/README.md). The unanchored
preserve excludes drop them by basename at every depth, so this fails RED.

Refs: #953
… ship

PRESERVE_FILES lists bare names (README.md/CHANGELOG.md) to protect the
consumer's ROOT docs. The copy built `--exclude=$preserved` (no leading
slash), so rsync matched by basename at every depth and silently dropped
devkit-authored NESTED docs (.devcontainer/README.md, .claude/skills/*/
README.md) while the preview promised them under ADDED. Anchor each exclude
to the transfer root (`--exclude=/$preserved`), matching is_preserved_file's
exact-path semantics: root docs still preserved, nested docs now copied.

Refs: #953
Under --no-prompts with no ORG_NAME env and no manifest DEVKIT_ORG, the org
must come from the owner segment of GITHUB_REPOSITORY, not the hardcoded
"vigOS/devc" literal that a '/'-bearing org substitutes into generated files
(LICENSE copyright). Fails RED: current code persists vigOS/devc.

Refs: #954
On --no-prompts with no ORG_NAME env and no manifest DEVKIT_ORG, ORG_NAME
defaulted to the hardcoded literal "vigOS/devc" — a bogus org whose '/' gets
sed-substituted into {{ORG_NAME}} in generated files (e.g. the LICENSE
copyright line). GITHUB_REPOSITORY (owner/repo) is already available on this
path (DEVKIT_REPO uses it), so default the org to its owner segment, falling
back to the sane literal "vigOS" only when no usable owner/repo is present.

Also records the #953 and #954 fixes in the CHANGELOG (both delivered in this
PR share one Unreleased entry, mirrored into the scaffold changelog).

Refs: #954
@c-vigo
c-vigo enabled auto-merge July 9, 2026 11:56
@c-vigo

c-vigo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed: both fixes match the filed root causes and are minimal — #953 root-anchors the preserve excludes (--exclude=/$preserved) so devkit nested docs ship and the preview matches the apply; #954 derives the imageless --no-prompts org from GITHUB_REPOSITORY's owner (fallback vigOS), dropping the bogus vigOS/devc literal. Two new TDD tests reproduce red→green (123 passed); the updated existing assertions are legitimate (the old DEVKIT_ORG=vigOS/devc assertion was codifying the bug). Changelog under Unreleased. LGTM — auto-merge into dev stands.

@c-vigo
c-vigo merged commit 4d86228 into dev Jul 9, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/953-init-workspace-copy-and-org-fixes branch July 9, 2026 12:10
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