Knowledge Portal · engineering documentation

Skip to content

ZAIXOS Engineering Platform — Runtime Materialization

Document type: Technical Specification
Version: 1.0 · Phase: 12-3
Status: Permanent technical authority
Related: EXTENSION_ARCHITECTURE.md · INSTALLATION_ARCHITECTURE.md
Governance: ADR-004


Purpose

Define the materialization engine — how platform core, adapter templates, and product extensions become the effective IDE workspace — including mount strategies, checksums, and idempotent re-runs.


Materialization inputs

InputSourceRequired
Platform pinplatform.lockYes
Adapter IDplatform.yml + lockYes
Adapter templateadapters/{id}/workspace/ in packageYes
Adapter metadataadapters/{id}/manifest.jsonYes
Extension manifest.zaixos/extensions/manifest.ymlYes (may be empty)
Extension filesPaths in manifestPer entry
Mount configplatform.yml platform.adapter.mountYes

Materialization outputs

OutputPathPurpose
Canonical workspace.zaixos/adapters/{id}/workspace/Source of truth for adapter files
IDE mount.cursor/ (cursor-adapter-v1)IDE-native read path
Lock updateplatform.lock.checksum, materializedAtIntegrity + audit
ReportMaterializationResult (future CLI)Human + CI log

Materialization flow (detailed)

START

  ├─► Load ResolvedPlatformPin from lock + yaml

  ├─► Verify package version == lock.platform.version

  ├─► Extract adapter template to staging/

  ├─► Apply extension merge (EXTENSION_ARCHITECTURE algorithm)

  ├─► Write staging/ → .zaixos/adapters/{id}/workspace/

  ├─► Apply mount strategy:
  │     symlink: .cursor → .zaixos/adapters/cursor-adapter-v1/workspace
  │     copy:    recursive copy to .cursor/

  ├─► Compute SHA-256 of canonical workspace (sorted file list, normalized line endings)

  ├─► Compare to lock.checksum (if re-run) — warn on unexpected drift

  ├─► Update platform.lock materializedAt + checksum

END → MaterializationResult { success, checksum, fileCount, mountStrategy }

Mount strategies

StrategyValueWhenIDE behavior
symlinkDefault on Unix/macOSDeveloper local.cursor/ → canonical
copyWindows without symlink rights; CIImmutable CI checkout.cursor/ is copy
directForbidden for cursor-adapter-v1Use canonical under .zaixos/ only

Lock records installMode and effective mountStrategy.


Idempotency

Re-running materialization with unchanged pin and extensions produces:

  • Identical checksum (byte-stable template + deterministic merge order)
  • Overwrite of workspace and remount
  • No platform version change

Re-run required after:

  • Platform PATCH/MINOR upgrade
  • Extension manifest change
  • Adapter version bump
  • Mount strategy change

Materialization vs Runtime Contracts

Materialization implements contract inventory requirements:

ContractMaterialization obligation
RuntimeConstraintContractAll platform rules present in workspace
RuntimeProcedureContractDefault 10 + registered extensions
RuntimeWorkflowContractDefault 10 + registered extensions
RuntimeDelegationContractDefault 10 + registered extensions
RuntimeEnforcementContract4 handlers present
RuntimeContextProviderContract3 immediate-tier providers
RuntimeExecutionContractcli.json, environment.json present
RuntimeAdapterContractmanifest.json parity

Materialization does not change contract text.


Drift detection

Drift typeDetectionResponse
Manual edit to .cursor/ without rematerializeChecksum ≠ lockValidation fail; rematerialize
Edit to canonical workspaceChecksum ≠ lockValidation fail
Vendor package update without lock bumpcomposer/lock mismatchValidation fail
Extension file missingManifestParityTestValidation fail

KPI-7: Zero undocumented drifts (SUCCESS_METRICS.md).


Multi-adapter future (v2+)

.zaixos/adapters/cursor-adapter-v1/workspace/  → .cursor/
.zaixos/adapters/claude-adapter-v1/workspace/  → .claude/  (future)

Only one primary adapter active per product pin in v1.


Materialization engine components (logical)

ComponentResponsibility
PinResolverlock + yaml → ResolvedPlatformPin
TemplateLoaderRead adapter workspace from package
ExtensionMergerRegistry merge algorithm
WorkspaceWriterAtomic write to canonical path
MountManagerSymlink or copy IDE mount
ChecksumComputerSHA-256 workspace hash
LockUpdaterPersist checksum + timestamp

Implementation deferred to Phase 12-5+ scaffold.


Failure modes

ErrorPropagationRecovery
Missing template fileFail closedReinstall package
Extension schema invalidFail closedFix manifest
Mount permission deniedFail with copy fallbackRetry copy strategy
Disk fullFail closedFree space; rematerialize
Partial writeFail closedDelete workspace; rematerialize

Runtime Materialization v1.0 — Phase 12-3.

ZAIXOS Knowledge Portal — public engineering docs at /docs · Staff operations at /admin