Skip to content

refactor: rename posture to source mode (workspace | owned) - #331

Merged
chubes4 merged 1 commit into
mainfrom
source-mode-rename
Aug 5, 2026
Merged

refactor: rename posture to source mode (workspace | owned)#331
chubes4 merged 1 commit into
mainfrom
source-mode-rename

Conversation

@chubes4

@chubes4 chubes4 commented Aug 5, 2026

Copy link
Copy Markdown
Member

Closes #324 (naming). Does not add the third unchained shape — see below.

The problem

--posture engineering|managed reads as a level. It is not one, and it is backwards: engineering is strictly more restricted on live source, since the installed tree is read-only reference there. What it buys is git and review, not latitude.

The new names say where a change lands, which is the actual difference:

workspace (default) owned
installed source read-only reference declared components editable in place
how work is recorded git + pull requests operator's out-of-band capture
Data Machine Code installed not installed

Neither implies rank. That's the point.

What this deliberately does not do

No third unchained mode. That decision already went the other way: capability correlates with the mode, the dev-toolchain/server-admin line isn't enforceable in a shell (npm, composer, and git hooks all execute arbitrary code), and nobody wants the combination it carves out. The rename doesn't depend on it.

No default change. workspace is exactly today's engineering, so no install changes behaviour. #324 also proposes making the owned mode the default — that's a product decision about what a fresh install should get, it's separable, and bundling it would make both harder to review and to revert. Flagging it as still open.

Existing installs carry across untouched

  • --posture stays an accepted alias; engineering/managed are translated wherever a mode is read — including in the Python reconciler, which is reachable directly and has to agree with the shell.
  • The three recorded wp_options are renamed, and reads fall back to the pre-rename keys. Deliberately a fallback rather than a one-shot migration: a newer upgrade.sh can meet an older install's options at any time, and wp option get returning empty is indistinguishable from "recorded as empty".
  • record_mode compares against the new key only. Comparing through the legacy-aware reader would see a pre-rename install as already correct — the canonical value of engineering is workspace — and leave it on the old key forever, so the migration would never actually run.

Evidence the rename changed nothing

The only property that matters for a rename. Both the reconciler's output and a fully rendered opencode.json are byte-identical to origin/main across all four combinations:

old 'engineering' vs new 'workspace'   BYTE-IDENTICAL
old 'managed'     vs new 'owned'       BYTE-IDENTICAL
new code fed legacy 'engineering'      BYTE-IDENTICAL
new code fed legacy 'managed'          BYTE-IDENTICAL

Also checked against the live install: it records engineering under the old key and resolves to workspace. Read-only, no writes.

New coverage in tests/source-mode.sh (renamed from posture.sh) pins the alias translation, legacy-key resolution on upgrade, that the migration actually writes the new key, and that it doesn't rewrite an already-migrated install.

Full suite green apart from the 3 pre-existing environmental failures that also fail on origin/main.

`--posture engineering|managed` reads as a level, as though engineering
were the unrestricted one and managed the safe one. It is not a level, and
it is backwards: engineering is strictly MORE restricted on live source,
where the installed tree is read-only reference. What it buys is git and
review, not latitude.

The new names say where a change LANDS, which is the actual difference:

  workspace  installed source is read-only reference; changes go through a
             Data Machine Code workspace, git, and GitHub. Recorded by review.
  owned      the agent edits the site's declared components in place; no
             workspace, no git, no GitHub. Recorded by the operator's
             out-of-band capture.

Neither implies rank, which is the whole point.

#324 also asks for a third `unchained` shape. Not added: that decision
already went the other way — capability correlates with the mode, the
dev-toolchain/server-admin line is not enforceable in a shell (npm,
composer, and git hooks all execute arbitrary code), and nobody wants the
combination it would carve out. Renaming does not depend on it.

The default is deliberately unchanged. `workspace` is exactly today's
`engineering`, so no install changes behaviour. #324 additionally proposes
making the owned mode the default; that is a product decision about what a
fresh install should get, it is separable from the rename, and bundling
them would make both harder to review and to revert.

Existing installs carry across without the operator touching anything:

- `--posture` remains an accepted alias, and engineering/managed are
  translated wherever a mode is read, including in the Python reconciler,
  which is reachable directly and has to agree with the shell.
- The three recorded wp_options are renamed, and reads fall back to the
  pre-rename keys. Deliberately a fallback rather than a one-shot upgrade
  migration: a newer upgrade.sh can meet an older install's options at any
  time, and `wp option get` returning empty is indistinguishable from
  "recorded as empty".
- record_mode compares against the NEW key only. Comparing through the
  legacy-aware reader would see a pre-rename install as already correct —
  the canonical value of `engineering` IS `workspace` — and leave it on the
  old key forever, so the migration would never actually run.

Verified the rename changes no behaviour, which is the only property that
matters here: the reconciler's output and a fully rendered opencode.json
are both byte-identical to origin/main across all four combinations
(old engineering vs new workspace, old managed vs new owned, and new code
fed the legacy names). Checked against the live install too — it records
`engineering` under the old key and resolves to `workspace`, read-only.
@chubes4
chubes4 merged commit 7c84e4e into main Aug 5, 2026
20 checks passed
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.

posture naming implies a scale; the model is three shapes and is missing the unchained one

1 participant