Skip to content

feat(B-0891 extend): substrate-engineering substrate primitives for scenarios 3/4/5 — design-spec-complete; PersistedKV + PathFork + MultiVMOrchestration DUs; 21 new tests pass (operator 2026-05-28)#5866

Merged
AceHack merged 2 commits into
mainfrom
otto-cli/b-0891-extend-zflash-5-scenarios-2026-05-28
May 28, 2026
Merged

feat(B-0891 extend): substrate-engineering substrate primitives for scenarios 3/4/5 — design-spec-complete; PersistedKV + PathFork + MultiVMOrchestration DUs; 21 new tests pass (operator 2026-05-28)#5866
AceHack merged 2 commits into
mainfrom
otto-cli/b-0891-extend-zflash-5-scenarios-2026-05-28

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 28, 2026

operator 2026-05-28 (shadow*) authorization to pick lane 1 (B-0891) and extend the 5 scenarios.

What this PR does

EXTENDS B-0891 PoC scaffold (PR #5724) by adding tools/zflash/test-harness/extensions.ts + tests, moving scenarios 3/4/5 from 'scaffolded + blocked-on-X' to 'scaffolded + design-spec-complete' status with concrete typed primitives per the typestate-DU substrate cluster shipped today.

Substrate-engineering substrate primitives

Scenario Primitive Variants
3 reformat-with-retention PersistedKVSubstrate qemu-virtual-disk-overlay / qemu-tpm-emulator / file-system-bind-mount / qcow2-snapshot-restore (DEFAULT)
4 reformat-from-scratch PathForkSubstrate both-must-pass / exactly-one-passes / outcomes-equivalent comparison strategies; migrate-existing-creds + fresh-cluster default forks
5 cluster-joining MultiVMOrchestrationSubstrate NetworkTopology DU + JoinProtocol DU + OrchestratorKind DU + VMSpec

Plus ImplDesignStatus DU + SCENARIO_IMPL_DESIGN mapping + computeImplDesignProgress aggregator (0/3 → 3/3).

run.ts --list updated to surface implDesign per scenario in JSON output.

Tests

21 new tests (extensions.test.ts) + 20 existing (scenarios.test.ts) = 41 pass.

Composes with today's substrate cluster

asymmetric-authorship + monad-propagation + IMPLICIT-NOT-EXPLICIT + particle-as-locus + parallelizability-test + visual-geometric-shape-recognition (all auto-loaded rules from today).

Scope

SPECS the impl-design primitives. Runtime QEMU integration (actually persisting state across boots; forking test paths; orchestrating multi-VM) remains PENDING — substrate-engineering substrate-shape now substantively-defined + composable + testable at type-level.

🤖 Generated with Claude Code

…cenarios 3/4/5 — design-spec-complete status; PersistedKV + PathFork + MultiVMOrchestration discriminated unions; impl-design progress 0/3 → 3/3 (operator 2026-05-28 shadow* "pick lane 1 b-0891 extend the 5 scenarios")

operator 2026-05-28 shadow* authorization:
'pick lane 1 b-0891 extend the 5 scenarios (shadow*) Aaron: wow shadow
 is getting specific we better do what he says lol'

EXTENDS B-0891 PoC scaffold (PR #5724 by adding tools/zflash/test-
harness/extensions.ts + extensions.test.ts) moving scenarios 3/4/5
from 'scaffolded + blocked-on-X' status to 'scaffolded + design-spec-
complete' status with concrete typed primitives.

Substrate-engineering substrate primitives (per typestate-DU cluster):

SCENARIO 3 (reformat-with-retention) — PersistedKVSubstrate DU:
- qemu-virtual-disk-overlay
- qemu-tpm-emulator (1.2 or 2.0)
- file-system-bind-mount
- qcow2-snapshot-restore (DEFAULT_PERSISTED_KV; composes with existing
  tools/ci/ qcow2 substrate; baseline-restore between runs ensures
  clean state)

SCENARIO 4 (reformat-from-scratch) — PathForkSubstrate:
- startingStateRef + forks + comparisonStrategy
- 3 comparison strategies: both-must-pass / exactly-one-passes /
  outcomes-equivalent
- 2 fork variants: migrate-existing-creds + fresh-cluster
- DEFAULT_PATH_FORK with both-must-pass comparison

SCENARIO 5 (cluster-joining) — MultiVMOrchestrationSubstrate:
- VMSpec (role + bootMedia + memoryMB + vcpus)
- NetworkTopology (shared-bridge | vlan-isolated | host-only)
- JoinProtocol (cluster-state-discovery | explicit-join-token |
  credential-provisioning)
- OrchestratorKind (qemu-shell-scripts | libvirt | docker-compose |
  k8s-virt)
- DEFAULT_MULTI_VM (cluster-existing qcow2 + joining-node iso-fresh +
  shared-bridge + credential-provisioning + qemu-shell-scripts)

ImplDesignStatus DU + SCENARIO_IMPL_DESIGN mapping + computeImplDesignProgress
aggregator track design-spec progress orthogonally to runtime
ImplStatus.

run.ts --list updated to surface implDesign per scenario in JSON output;
implDesignProgress shown at top of listing for at-a-glance status.

Tests: 21 new tests covering discriminated union exhaustiveness +
default value correctness + composes-with substrate-engineering
substrate. Combined with scenarios.test.ts: 41 total pass.

Composes with today's substrate cluster:
- asymmetric-authorship rule (PR #5516): each substrate-entity AUTHORS
  consent-channel via TFeedback variants; primitives here follow same
  pattern at impl-design scope
- monad-propagation-pattern rule (PR #5511): Result<T, TFeedback>
  cross-language shape
- IMPLICIT-NOT-EXPLICIT rule (PR #5811): every substrate-class gets
  explicit DU variant
- particle-as-locus rule (PR #5846): every substrate carries
  (wavefunction-substrate, particle-locus) pair; primitives here
  define wavefunction-substrate; runtime values are particle-loci
- parallelizability-test rule (PR #5845): each primitive defined
  INDEPENDENTLY for visualizable + parallelizable navigation
- visual-geometric-shape-recognition rule (PR #5845): substrate-
  engineering substrate IS shape-substrate that bandwidth-engineers
  for operator's cognitive-architecture

Substrate-engineering scope: SPECS the impl-design primitives.
Runtime QEMU integration (actually persisting state across boots;
forking test paths; orchestrating multi-VM) remains PENDING — but
substrate-engineering substrate-shape now substantively-defined +
composable + testable at type-level.

Per .claude/rules/rule-0-no-sh-files.md (TS-first for cross-platform DST).
Per .claude/rules/verify-existing-substrate-before-authoring.md
(composes with existing tools/ci/ + scenarios.ts substrate; does not
duplicate).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 28, 2026 16:19
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@AceHack AceHack enabled auto-merge (squash) May 28, 2026 16:19
…ubstrate / PathForkSubstrate / PathForkVariant)

tsc --noEmit was failing on TS6133 unused-import errors. The test
file uses these types only indirectly via Default* values; explicit
type imports were leftover from initial drafting.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the B-0891 zflash QEMU test-harness PoC (PR #5724) with a separate design-spec status layer for the three scaffolded scenarios (3/4/5). It adds typed discriminated-union primitives describing the substrate shape each scenario will need (state preservation, path fork, multi-VM orchestration), wired into run.ts --list JSON output. The runtime scenario status remains scaffolded in scenarios.ts; no QEMU runtime behavior changes.

Changes:

  • Add extensions.ts defining PersistedKVSubstrate, PathForkSubstrate, MultiVMOrchestrationSubstrate, ImplDesignStatus, SCENARIO_IMPL_DESIGN, and computeImplDesignProgress.
  • Surface implDesignProgress and per-scenario implDesign in run.ts --list JSON.
  • Add extensions.test.ts with 21 type/value-level tests for the new primitives.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tools/zflash/test-harness/extensions.ts New typed primitives + per-scenario design-spec status mapping + progress aggregator.
tools/zflash/test-harness/run.ts --list JSON augmented with implDesignProgress and per-scenario implDesign.
tools/zflash/test-harness/extensions.test.ts Bun tests asserting variants, defaults, and aggregator counts.

@AceHack AceHack merged commit 4c87bc1 into main May 28, 2026
32 checks passed
@AceHack AceHack deleted the otto-cli/b-0891-extend-zflash-5-scenarios-2026-05-28 branch May 28, 2026 16:24
AceHack added a commit that referenced this pull request May 28, 2026
Co-authored-by: Lior <lior@zeta.dev>
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.

2 participants