Files
ARCADIA-Studio/harness/experiments/state-bends-b868541-20260923/native/README.md
T

5.9 KiB

State bends native recipe preparation

PREPARATION ONLY. These scripts have not been executed, parsed by a runtime, or used to stage or launch any application. Review them against the final gate format and source before use. No final pin/artifacts exist in this preparation. The source-native plan is a draft and must be accepted before staging; the generated catalog supplies its numerical A,k before launch.

Copy these recipes into a fresh final native directory before use. capture.js derives that directory from its own module URL. The helper only serializes a fresh caller-supplied Sky observation; it cannot prove screenshot freshness or window/process identity. Root must check the actual window and call captureStateBends(name, note, freshState) with globalThis.stateBendsRunRoot set to the bound current run. Do not import the helper from this preparation path for another native root.

Required admission JSON schema (all file records have path, bytes, sha256):

  • approved_for_staging: true, only after parent review.
  • source_commit: final 40-character Git pin; repo: clean matching source worktree.
  • gate_summary: record of the final successful frozen gate summary. Required summary fields: source_commit, passed=true, inputs_unchanged=true, outputs=[file records]. Adapt this explicit format before freezing if the gate runner uses another format; never invent a pass field or rewrite original receipts.
  • gate_receipts: nonempty list of raw gate source-before/after inventories, results, logs, commands/toolchain/environment records and commit readback where applicable. Parent supplies complete relevant inventory; the stage verifies and copies each raw file without rewriting embedded paths.
  • artifacts: map arcadia-studio.exe, attachment_snapshot.exe, state_bend_routing_snapshot.exe, libunwind.dll to preserved artifact records. The three executables must match final summary outputs from the same source pin. No artifact input may reside beneath a target directory. Runtime is the admitted LLVM-mingw SHA aa282fa47bb2c4e210cea5e470cdbdca58568f0be0bc73e404d86ab9cd95ef6a.
  • baseline: record of original #33 immutable attachments.arcadia, SHA a05c43d13e9e65872f625456b45f30f8296069159de43c695793194beac7008d. No previous edited working file.

Deliberately no permissive default admission file is supplied. Intended invocation after final review:

python FINAL_NATIVE_ROOT/stage.py --admission FINAL_ADMISSION.json

This is an executable staging operation, not performed during preparation. It copies preserved artifacts/receipts and computes an exact raw tracked-source inventory plus Git blob mapping; invokes the candidate-built evaluator and routing probe in isolated child environments; verifies their complete baseline Projects agree; computes Add bend's midpoint/insertion index without desktop planner/command helpers; validates every expected Project and rejects route diagnostics; then freezes receipts, inputs, expected catalog and recipes. Ambiguous near-equal pin fractions fail rather than guessing f32 boundary behavior. Raw JSON integer values are retained through Python int; no whole-project JavaScript JSON transformation occurs.

The captured source inventory is explicitly raw bytes plus Git blob mapping: a clean CRLF checkout can differ from canonical blob bytes. This is local source binding, not yet a portable archive. Later publication can reuse the raw-override/source-map approach. Provenance copies retain old target paths as historical text only; no immutable live target file is bound.

Review generated expected/catalog.json, including numerical A and k and M=(520,370), before GUI launch. If anything requires repair, preserve the failed stage and use a fresh root; never revise expected states after observing native results. Then invoke pwsh -File FINAL_NATIVE_ROOT/launch.ps1 -Run 1; root opens working/attachments.arcadia through native UI. launch.ps1 binds process PID/start, child-only profile/PATH, current recipes/manifest, mutable source before/after and normal-exit receipts. For repeats, it requires the preceding successful bound close. A zero exit does not itself prove why the window closed.

After each saved checkpoint:

python FINAL_NATIVE_ROOT/check.py --expected N1 --output-prefix FINAL_NATIVE_ROOT/runs/run-01/checkpoints/01-add

Allowed expected names are B,N1,N2,N3. Comparison operates on a fresh immutable source copy, exact complete typed Project, and before/after input hashes; all failures are retained. No-motion/outside-release history checks and held-preview limitations remain as the plan specifies. Final stage/GUI execution is parent-owned; no gates or builds are run by these recipes.

Preparation correction: direct attachment_snapshot baseline JSON uses offset0.6, so the sentinel remains exact. The first routing-probe proposal embedded Project through serde_json::Value, which would expand some f32 numbers; parent corrected the probe to parse its directly serialized typed Project before embedding it. Strict canonical Project comparisons remain unchanged. The recipe also refuses midpoint coordinates not exactly representable as f32, rather than rounding an expected value after observing UI. These checks are prepared, not executed.

Static preparation review repairs (before any native staging): stage now compares raw current source inventory with the final gate's bound source_manifest, checks each step's before/after inventory against that same baseline, and requires all six final step results/logs/contexts/patches plus summary environment/relocation records in gate_receipts. Include run.py itself in that receipt list because results bind its bytes. Copies are checked against the originally admitted record, preventing a changed source copy from silently replacing an admitted artifact/baseline. Arithmetic refuses nonorthogonal trial spans or cumulative lengths not exactly representable in f32; near-equal pin fractions still refuse. These are conservative preparation failures requiring review, not altered expected UI outcomes.