Skip to content

feat(workspace): add DEVKIT_WORKFLOW knob (gitflow default / trunk opt-in) - #1212

Merged
c-vigo merged 8 commits into
devfrom
feature/1205-workflow-model
Jul 20, 2026
Merged

c-vigo merged 8 commits into
devfrom
feature/1205-workflow-model

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Implements epic #1205 — a per-consumer DEVKIT_WORKFLOW knob selecting the branching/release model. gitflow stays the unchanged default; trunk is opt-in.

What it does

  • DEVKIT_WORKFLOW=gitflow|trunk, empty ⇒ gitflow (existing consumers' .vig-os stays byte-identical).
  • gitflow (default): unchanged — dev integration branch, cut release/X.Y.Z from dev, RC train, finalize→main+tag, sync-main-to-dev back-merge.
  • trunk: feature|bugfix|chore straight to main; releases STILL happen but cut release/X.Y.Z from main, RC on it, merge back into main + tag. Only the dev branch and sync-main-to-dev.yml disappear; the whole downstream tag/build/publish/promote chain is unchanged (already release/* → main).

How (design)

Realized entirely at scaffold time (mirrors DEVKIT_MODE) — an anchored dev→main render of the scaffolded workflows/skill/pre-commit plus a sync-main-to-dev.yml copy-exclude; NO resolve-toolchain runtime wiring, NO workflow twin. Enabled by the verified fact that every dev reference in prepare-release.yml is a plain branch literal (incl. the #617 read-after-write guard). ADR: docs/rfcs/ADR-workflow-model.md.

Sub-issues delivered (spike #1206 + #1207–#1211)

Verification

  • Full hook suite green.
  • 1094 pytest passed incl. the new test_workflow_model.py and the trunk-extended suites; the gitflow scaffold is byte-identical to today (default-path regression guard). bats: install 99 ok, init-workspace 229 ok (CI + release workflows hard-coupled to the container image regardless of DEVKIT_MODE #991 template invariants intact).
  • 2 failures remain (vig-utils TestFindRepoRoot) — pre-existing + environmental, in a package this PR does not touch.

Notes

Refs: #1205, #1206, #1207, #1208, #1209, #1210, #1211

c-vigo added 8 commits July 17, 2026 22:43
De-risk the DEVKIT_WORKFLOW knob (gitflow | trunk) for epic #1205: a
local git simulation proves the trunk release topology (cut release/X.Y.Z
from main, merge back, tag; no dev branch) with the #617 advance guard and
#590 Unreleased preservation intact; a render_workflow_model() prototype
performs the anchored dev->main rewrite + sync-main-to-dev copy-exclude and
is verified actionlint-clean with zero residual heads/dev and the #991
invariants preserved. No production wiring (that is #1207/#1208).

Refs: #1206
Skeleton mirroring test_ci_runner.py's executed-bash style: 9 green tests
drive the spike render_workflow_model() prototype against a copied scaffold
tree and assert the full trunk shape (no sync-main-to-dev.yml; prepare-release
forks from main with zero residual heads/dev; ci/codeql PR filters exclude dev;
sync-issues default main; SKILL base main; pre-commit drops (?!dev$)) plus a
gitflow byte-identical guard. Two xfail(strict) tests name the production seams
so they auto-flip when wired: #1207 (DEVKIT_WORKFLOW manifest key) and #1208
(render wiring in init-workspace.sh).

Refs: #1206
Add the `--workflow gitflow|trunk` flag to both install.sh and
init-workspace.sh (parse, enum validation, and forwarding from install.sh
to init-workspace via CMD), and gate the gitflow `dev` branch on it: the
new-repo `git branch dev`, the missing-dev warning, and the push hint drop
`dev` in trunk. `git init -b main` is unchanged. Resolution/render wiring
lands in the follow-up commits.

Refs: #1209
Ship the opt-in `DEVKIT_WORKFLOW=` key in the scaffold `.vig-os` (empty =>
gitflow default) and resolve it in init-workspace.sh and install.sh:
flag > persisted manifest > gitflow. Mirror the DEVKIT_MODE guards — a loud
enum guard on a corrupt persisted value and a contradiction guard that
refuses an explicit --workflow differing from the persisted model outside
--preview/--smoke-test. The resolved value is written back only for trunk,
so a gitflow consumer's .vig-os stays byte-identical (no new non-empty line).

Refs: #1207
Port render_workflow_model() into init-workspace.sh as a sibling of
render_codeql_matrix() and invoke it after the rsync copy: in trunk it
retargets the copied release workflows dev -> main (prepare-release, ci,
codeql, sync-issues), the branch-naming skill and the pre-commit branch
guard via anchored sed, and scrubs the inert dev step-names/comments in
prepare-release so a trunk repo carries no dev cruft (/dev/null and the
dev_sha/DEV_SHA variable names are preserved). sync-main-to-dev.yml is
copy-excluded and pruned on a gitflow->trunk upgrade, and the --force
preview mirrors both. gitflow is a byte-for-byte no-op. The now-redundant
spike prototype scripts are removed (SSoT); FINDINGS.md is kept as the record.

Refs: #1208
…W knob

Rewrite test_workflow_model.py to scaffold real gitflow/trunk workspaces via
init-workspace.sh (executed-bash style, mirroring test_ci_runner.py) instead
of the removed spike prototype, flipping the two xfail seams (#1207 manifest
key, #1208 render wiring) to real passing tests. Cover the full trunk shape
with zero residual heads/dev, the gitflow default-path byte-identical guard,
the enum and contradiction guards, the conditional writeback, and the
sync-main-to-dev exclude + gitflow->trunk prune. Record the feature in the
changelog Unreleased section.

Refs: #1205
…w model

Parametrize the suites that assumed the gitflow (long-lived dev) shape so they
also cover DEVKIT_WORKFLOW=trunk, without weakening the gitflow assertions:

- extract the init-workspace scaffold invocation into a shared
  tests/workflow_scaffold.py (SSoT reused by test_workflow_model.py and the
  trunk-parametrized suites below)
- test_install_script.py: add a trunk integration fixture + case asserting a
  trunk install creates main only (no dev); gitflow still creates both
- tests/bats/install.bats: assert the dev-branch creation + push hint are gated
  on the workflow model, and --workflow is forwarded (dry-run)
- test_workflow_sync_checkout.py: scope to gitflow and positively assert a trunk
  scaffold omits sync-main-to-dev.yml
- test_scaffold_lint.py: scope the sync-main-to-dev ref: dev fixture to gitflow
- test_workflow_prepare_extension.py: assert the release base is main under
  trunk (dev under gitflow) and the hook DAG survives the render
- tests/bats/init-workspace.bats: new trunk coverage (omits sync-main-to-dev,
  #991 invariants on the rendered prepare-release, gitflow->trunk DELETIONS
  preview, contradiction guard both directions); #991 TEMPLATE_DIR assertions
  left untouched

release-core is dev-free and untouched by the trunk render, so
test_release_core_sync_dispatch.py needs no change.

Refs: #1210
@c-vigo
c-vigo merged commit d083388 into dev Jul 20, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/1205-workflow-model branch July 20, 2026 07:54
c-vigo added a commit that referenced this pull request Jul 20, 2026
…el (#1215)

## Summary

Unfreezes release/1.4.0 by merging `dev` into it, deliberately pulling
epic #1205 (per-consumer `DEVKIT_WORKFLOW` gitflow/trunk model, merged
to dev via #1212) and the renovate `github-backup` 0.64.0→0.64.2 bump
(#1213) into the 1.4.0 release. **This deviates from the epic's
documented 1.5.0 target** — accepted trade-off: an rc5 was required
anyway (the branch is five fixes past rc4), and gitflow consumers get a
provable byte-for-byte no-op.

## Gates cleared before this merge

- **Dev composite tree proven green**: the merged dev head `4ac2ca90`
(feature + renovate bump as one tree) passed a full dispatched `ci.yml`
run
([29726877354](https://github.com/vig-os/devkit/actions/runs/29726877354))
— the pre-merge PR checks had only tested stale bases.
- **Epic completeness audited**: every acceptance criterion of
#1206–#1211 mapped to merged code; gitflow no-op pinned by
`test_gitflow_scaffold_matches_default_path` and
`test_gitflow_render_files_are_byte_identical_to_template`. Sub-issues
remain open only as bookkeeping (dev-PR `Refs:` doesn't auto-close).

## Merge composition

Two real conflicts, composed to preserve both sides:

- `assets/init-workspace.sh`: kept #1196's `MODE_CONFIG_EXCLUDES` array
(supersedes dev's older explicit exclude blocks) **and** appended
#1205's trunk-only `sync-main-to-dev.yml` exclude + preview skip-guard;
`render_workflow_model()` and its invocation intact.
- `tests/bats/init-workspace.bats`: additive union of #1195's
chmod-scope test and #1205's six trunk tests.

CHANGELOG surgery: dev's two Unreleased entries moved into the `[1.4.0]`
section (Added/Changed), `## Unreleased` restored to the empty skeleton
(#590 invariant); `assets/workspace/.devcontainer/CHANGELOG.md`
re-synced byte-identical (sync-manifest hook green). All seven
release-branch hardening fixes (#1190 #1193 #1199 #1200 #1201 #1202
#1204) survive.

## Verification

- Targeted suites: 66 passed (`test_workflow_model`,
`test_install_script`, `test_workflow_prepare_extension`,
`test_workflow_sync_checkout`)
- Full pytest: 1098 passed, 28 skipped; 3 failures all
environmental/pre-existing (2× `vig-utils` `TestFindRepoRoot` env, 1×
`test_manifest_files` stale local image — CI rebuilds)
- bats: 331 ok, 0 not ok (`init-workspace.bats`, `install.bats`)
- `pre-commit run --all-files`: fully green
- Containment: `git log HEAD..origin/dev` empty; diff vs dev = release
fixes + changelog structure only

## After merge

Cut **rc5** (required regardless of this PR) and extend rc validation
with the trunk-render suites + a gitflow-consumer scaffold byte-identity
check.

Refs: #1205
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