Skip to content

workspace: migrations and chant workspace upgrade (phase 5) #2550

Closed

Description

@lex00
Level Design Driver
4 #2524 D9 #2525

Scope

  • A core chant workspace upgrade <scope> runs migrations in a separate worktree and merges per file.
  • Its gate binds to the digest of the resulting patch.
  • A propose-only activity so an Op can open upgrade PRs.

Acceptance criteria

Activity

  1. added
    enhancement
    area:core
    area:workspace
    level:4
    on Sep 23, 2026
  2. lex00 commented on Sep 24, 2026

    @lex00
    ContributorAuthor

    Status: part 1 merged in #2610 (8fe17eb). chant workspace upgrade <scope> works for the . scope and vendor scopes. It fetches, rebuilds the merge base offline, migrates in a separate worktree, merges per file, runs build, lint and chant workspace check, then gates on the patch digest. That PR also added migrations (.chant/migrations/*.json in the template), chant workspace check and the proposeWorkspaceUpgrade activity. Still open: member scopes, which wait on #2534 (PR #2593). Scopes made by init --template are refused, because chant can't rebuild their base offline.

  3. lex00 commented on Sep 30, 2026

    @lex00
    ContributorAuthor

    Audit 2026-09-30 against main 1c1a04a

    Part 1 is on main: #2610 (8fe17eb).

    Criterion State Evidence
    Migrations are data with an optional marked code body; a gap in the chain is refused met lineage-migrations.ts (closed list of declarative steps or a marked module; a gap in the migration chain error), lineage-migrations.test.ts, reference/template-migrations.mdx
    A customised file with any conflicting hunk becomes one manual step met lineage-merge.ts three-way merge per file; lineage-upgrade.test.ts, workspace-upgrade.e2e.test.ts
    Build, lint and workspace check run in the worktree before the gate met lineage-upgrade.ts runs them in the .chant/upgrade/ worktree, then gates on the patch digest (WORKSPACE_UPGRADE_GATE_OP)
    Governance changes are gated by the rules at HEAD met lineage-upgrade.ts GovernanceChange, described in workspace-upgrade.mdx "Governance changes" (Op files, chant.config.*, chant.workspace.json, CI workflows)
    Open manual steps fail check met chant workspace check fails on open manual steps (#2610)
    Works on the chant repo (#2557) not met the chant repo has no lineage lock and was not made from a template. Member scopes, which would cover its members, are not supported yet, although #2593 is merged
    Level 0 is unaffected, or the change is on #2525's exception list not met as written #2610 changed level-0 code outside the exception list: lifecycle/git.ts now runs git ls-tree --full-tree for ledger reads and writes, so a project in a repository subdirectory gets different (corrected) ledger behaviour, and cli/handlers/operator.ts and op/gate-name.ts gained a workspace-upgrade gate name. The text of chant approve for other Ops is unchanged. test/level0-goldens/level0-ledger.test.ts has no subdirectory case, so nothing covers the --full-tree change

    Remaining: member scopes (unblocked since #2593), scopes made by init --template (refused today because the base cannot be rebuilt offline), the chant-repo criterion, and a decision on the --full-tree change, either adding it to the exception list or adding a golden.

  4. lex00 commented on Oct 1, 2026

    @lex00
    ContributorAuthor

    Closes with #3085. Criteria against the 2026-09-30 audit:

    • Member scopes: met. chant workspace upgrade <member> runs from the workspace root, finds the member in chant.workspace.json by name or directory, and upgrades it from its own lock. The gate and proposal branch use the member's name. A patch outside the scope and its lock is refused. A member with no lock is refused with the reason. Scopes made by init --template stay refused, now with the reason (no versioned source, and no offline merge base). Decision: ws-072.
    • Works on the chant repo: the chant repo has no lineage lock and cannot have one honestly. Nothing in it was instantiated from a template (init --from or init --template) or vendored (no vendor.json, no .chant/workspace.lock.json). reference-workspace/ and the lexicons' initTemplates are template sources that live in it, not copies made from one. A lock invented for it would record a source that never existed. So the upgrade has nothing to act on there, which counts toward the epic's "chant repo runs at every shipped level" criterion as: lineage applies to the chant repo's members only when one is made from a template, and none is. The chant repo's own chant.workspace.json is unchanged. Member scopes now work for any future member that is made from a template.
    • Level 0: the audit's concern was feat(workspace): chant workspace upgrade, template migrations and the propose-only activity (#2550) #2610's --full-tree ledger change and the gate-name addition. The --full-tree change is on the level-0 exceptions page and level0-ledger.test.ts holds the subdirectory case, so the criterion is met. Upgrade on a plain project with a lock (no chant.workspace.json, project in a repository subdirectory) is covered by workspace-upgrade.e2e.test.ts and works, and the level-0 goldens pass unchanged.
    • The reference workspace gets a member-scope case in test/reference-workspace.test.ts; its README says what the design client's lock will do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:workspaceenhancementlevel:4

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions