Chain Validated

Chain-validated ritual for Marcus (PM) -- merges dev -> main once the V0.X chain is whole-green IRL. Aggregates per-sprint valida…

mcornelison updated 22d ago
Claude CodeGeneric
View source ↗
---
name: chain-validated
description: "Chain-validated ritual for Marcus (PM) -- merges dev -> main once the V0.X chain is whole-green IRL. Aggregates per-sprint validation evidence, merges dev to main as new fully validated stable, tags V0.X.N, fast-forwards dev to match main for the next chain. Per spec 2026-05-28 (dev/main workflow): main = fully validated stable; dev = integration branch carrying the active V0.X.Y chain. Companion to /sprint-deploy-pm + /sprint-validated. Run when CIO confirms the WHOLE chain is validated green."
---

# Chain Validated (PM-driven, dev/main workflow per spec 2026-05-28)

End-of-chain ritual for Marcus (PM). The third workflow command in the
deploy/validate/merge family:

| Command | What it does | When |
|---|---|---|
| `/sprint-deploy-pm` | Closes sprint, archives artifacts, pushes branch, deploys Pi + server FROM SPRINT BRANCH | After Ralph finishes a sprint |
| `/sprint-validated` | Marks one sprint validated; bumps manifest for that sprint's `validatesFeatures` | After drill validates that sprint's bigDoD clauses |
| `/chain-validated` | Merges the WHOLE chain (V0.X.2 + V0.X.3 + ... stacked sprint branches) to main + bumps manifest chain-wide + tags new stable | After every sprint in the chain has `/sprint-validated` run + CIO confirms whole chain green |

**WHEN to run**: every sprint in a V0.X chain has `validation.validatedAt`
populated on `dev` (each had its own `/sprint-validated`) AND CIO explicitly
confirms the chain is "fully functional working" + ready to merge to main.

**WHEN NOT to run**:
- Any sprint in the chain still has `validatedAt: null` (chain INCOMPLETE)
- Hardware blocker pending (e.g. B-063 fuse-box gating Drive 11+)
- Working tree dirty / `dev` not pushed to origin
- Not on `dev` branch (this command runs from `dev`)

**Output**: `main` receives the dev → main merge (`--no-ff`); new V0.X.N tag
pushed; `dev` fast-forwards to match `main` so the next V0.(X+1).0 chain starts
from a clean dev = main state. Regression manifest already carries per-sprint
bumps (done by `/sprint-validated` runs on dev); chain-wide bump runs as a
safety net for any HELD bumps released at chain time. Intermediate sprint
branches preserved on origin (or archived per CIO call).

---

## Phase 0 -- Pre-flight gates

```bash
# Working tree clean (chain merge touches git history; no surprises)
git status --short

# MUST be on dev
git branch --show-current

# dev pushed to origin (no local-only commits)
git log --oneline @{u}..HEAD

Stop conditions:

  • Not on dev
  • Working tree dirty
  • Unpushed commits on dev (chain merge against origin only -- git push origin dev first)
# Confirm the chain-end-merge rule is the right ritual for this state
python offices/pm/scripts/pm_regression_status.py --stale

If many features still STALE / NEVER -- chain probably isn't ready; investigate before continuing.


Phase 1 -- Aggregate chain status

Enumerate the chain (auto-discover: archived sprint.json + current sprint.json filtered by validation.currentVersion prefix). Print sprints in chain + per-sprint validation state + aggregated validatesFeatures + chain-wide bigDoD checklist.

# Replace V0.27 with the chain epoch being merged
python offices/pm/scripts/chain_validate_aggregate.py --chain V0.27

Stop conditions:

  • Sprints in chain = 0 -> wrong --chain prefix; abort
  • chainStatus = INCOMPLETE -> at least one sprint lacks validatedAt; run /sprint-validated on that sprint first

Phase 2 -- Confirm chain-tip "fully functional working"

CIO confirms each aggregated bigDoD clause was observed (Mike's 2026-05-08 rule: evidence is helpful but not required; Mike looks for proof himself).

If running in a Claude session: take CIO's prior "merge chain to main" message as the green light. If running interactively: prompt for confirmation.

# Strict gate -- exit 1 if any sprint lacks validatedAt
python offices/pm/scripts/chain_validate_aggregate.py --chain V0.27 --strict

Stop conditions: strict exit 1 -> abort; sprint(s) still need /sprint-validated.

Optional verification (kick off full fast suite on chain tip):

pytest tests/ -m "not slow" -q

Phase 3 -- Update regression manifest chain-wide

For the aggregated validatesFeatures union, bump lastValidated to today + stamp validatedBy with the chain-merge label.

# Capture aggregated feature IDs from Phase 1's JSON output
python offices/pm/scripts/chain_validate_aggregate.py --chain V0.27 --json \
    > /tmp/chain-agg.json
python -c "import json; print(' '.join(json.load(open('/tmp/chain-agg.json'))['aggregateValidatesFeatures']))"
# Example output: F-005 F-007

# Bump those features chain-wide
python offices/pm/scripts/chain_validate_manifest_bump.py \
    --features F-005 F-007 \
    --label "by chain merge V0.27.5" \
    --date $(date -u +%Y-%m-%d)

Verify the manifest now shows all chain-touched features OK:

python offices/pm/scripts/pm_regression_status.py

Phase 4 -- Merge dev to main

# Pull main; confirm base hasn't moved unexpectedly
git checkout main
git pull origin main
git log --oneline -5 main

# Merge dev to main (--no-ff preserves the chain-merge commit shape)
git merge --no-ff dev \
    -m "Merge V0.X chain to main: V0.X.N -- new fully validated stable"
git push origin main
git log --oneline -3 main

Stop condition: git pull brings unexpected commits onto main -> CIO ran a SEV-1 hotfix on main (per spec §8.2); investigate before completing the merge (dev may also need to absorb the hotfix before this merge).


Phase 5 -- Tag the new stable

git tag -a V0.X.N -m "V0.X chain validated stable -- whole chain green"
git push origin V0.X.N

The tag is a rollback anchor + release-notes reference. V0.X.N = the chain-tip patch version (last patch sprint validated on dev).


Phase 6 -- Update PM artifacts on main

6a -- MEMORY.md

Update Cur ```

Maintain Chain Validated?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Chain Validated on getagentictools](https://getagentictools.com/loops/mcornelison-chain-validated-pm-driven-dev-main-workflow-per-spec-2026-05-28?ref=badge)