Skip to content

fix(workspace): preserve .typos.toml and harden init-workspace upgrades - #922

Merged
c-vigo merged 14 commits into
release/0.4.1from
bugfix/913-preserve-typos-init-hardening
Jul 7, 2026
Merged

c-vigo merged 14 commits into
release/0.4.1from
bugfix/913-preserve-typos-init-hardening

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Addresses #913 (fully) and four items of the #916 hardening bundle, all found during 0.4.1-rc1 consumer-upgrade testing. All changes are in assets/init-workspace.sh with BATS coverage (TDD, test-then-fix per item).

Changes

Not included

Verification

  • bats tests/bats/init-workspace.bats → 84/84 (+9 new); tests/bats/init.bats → 29/29.
  • Full prek run --all-files green locally (shellcheck, typos, agent-identity, sync-manifest).

Closes #913. Refs #916, #921.

c-vigo added 14 commits July 7, 2026 17:42
The image ships git but no diff(1)/cmp(1), so the #878 preview printed
'diff: command not found' and an empty box in-container. Route the
preview and its gate through git diff --no-index (long-flag --quiet
gates; --no-index exits 1 on divergence, which is expected). Factor the
preview into a shared helper for reuse by other preserved files.

Refs: #916
Add .typos.toml to PRESERVE_FILES so a consumer's curated spell-check
exceptions survive a --force upgrade, and print the template diff like
the #878 handling. Since the typos tool also reads the legacy
_typos.toml, skip shipping the template .typos.toml when a consumer
carries _typos.toml and no .typos.toml, so two active configs never
collide.

Refs: #913
Extend the #881 reference scan to preserved .github/workflows/*.yml so a
consumer CI workflow that still invokes the retired pre-commit binary is
flagged with file:line. Filter YAML name: step descriptions so a
'Run pre-commit hooks' step name is not a false positive.

Refs: #916
Move the GITHUB_REPOSITORY resolution/validation ahead of the rsync copy
so a --no-prompts run with no derivable origin aborts while the
workspace is still pristine, instead of leaving a half-scaffolded tree.
The resolved value still feeds the later placeholder substitution.

Refs: #916
…record

The image exposes no independent runtime record of its own built tag: the
only in-image version is the baked template .vig-os (repo-root pin at
build), which the scaffold already copies, so stamping from it is a no-op
and stays stale for RC images. Document that pinning the true built tag
for RCs (when VIG_OS_VERSION is unset) requires baking an authoritative
version record at build time.

Refs: #916
…reserve-typos-init-hardening

# Conflicts:
#	CHANGELOG.md
#	assets/workspace/.devcontainer/CHANGELOG.md
The #916 reorder moved resolve_github_repository ahead of the rsync so a
--no-prompts run aborts before mutating the workspace. But the function also
prompts interactively when no origin is derivable, so the move pushed that
prompt ahead of the 'Copying files from' output, hanging the interactive
integration flow. Guard the early call to --no-prompts only and restore the
interactive resolution to its original post-copy call site.

Refs: #916
…reserve-typos-init-hardening

# Conflicts:
#	CHANGELOG.md
#	assets/workspace/.devcontainer/CHANGELOG.md
@c-vigo
c-vigo enabled auto-merge July 7, 2026 19:38
@c-vigo
c-vigo merged commit b731506 into release/0.4.1 Jul 7, 2026
12 of 13 checks passed
@c-vigo
c-vigo deleted the bugfix/913-preserve-typos-init-hardening branch July 7, 2026 19:50
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