Files
ARCADIA-Studio/harness/fixtures/scenario-authoring/README.md
T

13 KiB
Raw Blame History

Scenario authoring native contract

Prepared by Codex-956atf /root/release_audit on 2026-09-10. Source candidate only: compilation, self-check, generation and native execution have not run. This fixture/oracle is preparation for B2 clicked-slot authoring and B3 caller return, not acceptance evidence.

harness/scenario-authoring-contract.rs generates deterministic OA and SA versions of the same small scenario tree. Each has Activity/Function choices, a Ready state, explicit lifelines, two nested ALT fragments, and fixed root/operand insertion anchors. A caller contains two distinct uses of B verification; B uses C detail. Each use explicitly maps both referenced lifelines to distinct local lifelines representing the same work. No native action/state/reuse/fragment role exists in the baseline.

Only this new Rust source and this README belong to the preparation slice. Generate fixture files after root grants the direct-rustc lease and the checker self-check passes.

Compile and generate

Use the current matching oa_core and serde_json rlibs from root's accepted Cargo output. Do not build another Cargo tree or select an arbitrary stale rlib. With root's configured Rust environment and clang linker, substitute the exact recorded paths below:

. .local/toolchain/env.ps1
$scenarioCore = 'ABSOLUTE_PATH_TO_CURRENT_liboa_core-HASH.rlib'
$scenarioJson = 'ABSOLUTE_PATH_TO_MATCHING_libserde_json-HASH.rlib'
$scenarioDeps = Split-Path -LiteralPath $scenarioCore -Parent
$scenarioLinker = 'ABSOLUTE_PATH_TO_TOOLCHAIN_clang.exe'
New-Item -ItemType Directory -Force -Path .local/native-qa | Out-Null
rustc --edition 2024 -D warnings harness/scenario-authoring-contract.rs --extern "oa_core=$scenarioCore" --extern "serde_json=$scenarioJson" -L "dependency=$scenarioDeps" -C "linker=$scenarioLinker" -o .local/native-qa/scenario-authoring-contract.exe
.local/native-qa/scenario-authoring-contract.exe self-check
.local/native-qa/scenario-authoring-contract.exe generate harness/fixtures/scenario-authoring/base
.local/native-qa/scenario-authoring-contract.exe check baseline harness/fixtures/scenario-authoring/base/project.arcadia

The compiler target must match those rlibs; include root's explicit --target if its toolchain setup requires one. Record the exact command, compiler/rlib identities, checker hash and result. Generation refuses any existing output directory. It writes project.arcadia, an included Unicode/CRLF rationale.arcadia, and expected-baseline.json. The JSON is a reference artifact, not an additional source document.

Copy the whole generated base into separate fresh OA and SA native working directories. Preserve the base. Each layer's four checkpoints start from that same baseline; sa-action does not include the OA creations. Preserve the whole working directory after each declared Save/Undo/Redo checkpoint. Do not modify fixture sources or adjust expected fields to match observed output.

Fixed locations and choices

The UUID namespace is 5ceaa100-0000-4000-8000-000000000000 plus a deterministic integer. Stable aliases make the intended records easy to confirm in the inspector/source. All labels below have OA or SA prepended.

Role OA alias / UUID suffix SA alias / UUID suffix
A caller scenario_oa_30 / 000000000082 scenario_sa_30 / 0000000000e6
B verification scenario_oa_31 / 000000000083 scenario_sa_31 / 0000000000e7
C detail scenario_oa_32 / 000000000084 scenario_sa_32 / 0000000000e8
Inner chosen operand scenario_oa_55 / 00000000009b scenario_sa_55 / 0000000000ff
Inner anchor scenario_oa_57 / 00000000009d scenario_sa_57 / 000000000101
Root entry / Root exit scenario_oa_50 / scenario_oa_62 scenario_sa_50 / scenario_sa_62
First use of B / Second use of B scenario_oa_60 / scenario_oa_61 scenario_sa_60 / scenario_sa_61
B use of C scenario_oa_64 scenario_sa_64

The target operand is Outer ALT → Outer chosen operand → Inner ALT → Inner chosen operand. The other inner operand and outer fallback are deliberate nearby decoys. Every sibling's records and order must remain unchanged.

B3 navigation before editing

Open project.arcadia, select OA A caller, and open Behavior. At normal size and at 1100 × 700, record the actual diagram visibility, selected occurrence, selected tool, canvas scroll and outer page scroll. Native screenshots and observations must establish these UI properties; the source checker cannot observe them.

  1. Select OA Second use of B, then Open definition. In OA B verification, select OA B use of C and open its definition. Back to caller must return first to the exact B use, then to the exact Second use of B in A, retaining the caller's tool and canvas/page offsets subject to viewport clamping. The first use is a distinct occurrence, not an interchangeable return address.
  2. Repeat through OA First use of B. Also exercise the detailed-list Open OA B verification → action for one of those uses; it must retain that initiating occurrence. After Back, ordinary scrolling must continue naturally rather than snapping repeatedly to the restored offset.
  3. Save without edits and run check baseline ENTRY. There must be no new model Undo entry from navigation. Repeat the two-use return once in SA A caller. No new model or source checkpoint is needed: both layers still equal baseline.

For one blocked navigation case, arm Add action, click a valid slot and type unfinished native action without creating it. Attempt Open/Back only if those controls are reachable in that pending state. The draft must remain visible/recoverable or the navigation control must be unavailable. Cancel, Save, and check baseline. Record the actual control availability; do not count an unperformed attempt as a pass.

B2 four creations per layer

Run the same four steps on the separate OA and SA copies. Replace XX below with the literal OA or SA, and lowercase xx in checker modes. Select XX A caller → Behavior. The compact selector's currently authored labels are Add action, Observe state, Reuse scenario, and Add fragment. Choose the tool and click the prescribed visible insertion slot; do not substitute a Tools append action or repair the destination afterward through the inspector.

Before pressing Create, record the form's destination/before-slot label and selected lifeline. This observation proves which native gesture was performed. Full model/source equality then checks the resulting semantics independently.

Step / checkpoint Prescribed click and literal form values Expected insertion
1. xx-action Add action; click on XX A inspector at the root slot before XX Root entry. Name XX native action; work XX Inspect ticket; observed lifeline XX A inspector. Create. New Action is the first A root step, before the original root entry.
2. xx-state Observe state; click in Inner chosen operand before XX Inner anchor, on XX A inspector. Name XX native state; state XX Ready; observed lifeline XX A inspector. Create. The inner chosen operand becomes [native state, Inner anchor]. Both enclosing ALT structures retain their original identities/guards.
3. xx-reuse Reuse scenario; click in that same inner operand before XX Inner anchor. Name XX native reuse; definition XX B verification. Explicitly bind XX B inspector → XX A inspector and XX B recorder → XX A recorder. Create. Inner operand becomes [native state, native reuse, Inner anchor]. No scenario/lifeline definition is cloned.
4. xx-fragment Add fragment; click the root slot before XX Root exit. Name XX native alternative; operator ALT · alternatives; first guard ticket.priority > 2; second guard ticket.priority <= 2. Create. One new root Fragment followed by the original Root exit. Its two new operands are empty and named XX native alternative · operand 1 and XX native alternative · operand 2. Existing occurrences are not wrapped or moved into them.

Before each Create, retain the previously verified stage's whole-directory snapshot (the generated baseline for step 1). After Create: Save, preserve a new whole-directory snapshot and check the declared checkpoint. Undo once, Save and preserve another copy: check the preceding checkpoint and require same PREVIOUS_VERIFIED_ENTRY UNDO_ENTRY. Redo once, Save and preserve another copy: check the current checkpoint and require same CURRENT_VERIFIED_ENTRY REDO_ENTRY. The same mode compares every Project identity/field and every SourceBundle byte; rerunning a semantic checkpoint alone permits a new set of fresh UUIDs and cannot prove exact history restoration. Never replace the preserved verified snapshots with their restored copies.

In particular, a fragment's creation and both operands must disappear/reappear in one Undo/Redo step with their original IDs. Reopen the final saved entry, Save and preserve the reopened copy, check xx-fragment, and require same FINAL_VERIFIED_ENTRY REOPENED_ENTRY. Use the normal Save operation in the working directory; save copies by preserving the whole directory so the included source stays attached.

Example checks for an OA run:

.local/native-qa/scenario-authoring-contract.exe check oa-action PATH_TO_SAVED_project.arcadia
.local/native-qa/scenario-authoring-contract.exe check baseline PATH_TO_ACTION_UNDO_project.arcadia
.local/native-qa/scenario-authoring-contract.exe same PATH_TO_VERIFIED_BASELINE_project.arcadia PATH_TO_ACTION_UNDO_project.arcadia
.local/native-qa/scenario-authoring-contract.exe check oa-action PATH_TO_ACTION_REDO_project.arcadia
.local/native-qa/scenario-authoring-contract.exe same PATH_TO_VERIFIED_ACTION_project.arcadia PATH_TO_ACTION_REDO_project.arcadia
.local/native-qa/scenario-authoring-contract.exe check oa-state PATH_TO_SAVED_project.arcadia
.local/native-qa/scenario-authoring-contract.exe check oa-reuse PATH_TO_SAVED_project.arcadia
.local/native-qa/scenario-authoring-contract.exe check oa-fragment PATH_TO_REOPENED_project.arcadia
.local/native-qa/scenario-authoring-contract.exe same PATH_TO_VERIFIED_FRAGMENT_project.arcadia PATH_TO_REOPENED_project.arcadia

One cancellation can be inserted before step 1: arm Observe state and click away from a lifeline. The form must require an explicit observed lifeline; it must not silently choose an unrelated lane. Enter an incomplete name, use the form's Cancel control, Save, and check baseline. Exercise Escape separately: current behavior cancels the gesture while preserving the pending scenario form/raw draft; it is not form cancellation. Focus, pending-marker visibility, stable canvas origin, Escape delivery, minimum-size reachability and clicked-slot geometry require separate native observations. Do not infer those from a passing file check.

Independence and limits

The checker uses only unique Kind::Occurrence + layer + predetermined literal name roles to discover fresh UUIDv4 IDs. IDs must be distinct and absent from the deterministic baseline. It independently constructs every other field: body, parent, reference targets, binding order and identities, guards, empty operands, pre/postconditions, description, alias and insertion order. It does not read observed fields into the prediction. Any unclaimed object, sibling edit, wrong destination, binding, name/value or source byte causes full equality to fail.

Expected transactions use core typed commands and source writeback, independently of the desktop planners, then compare the whole Project and the complete reachable two-file SourceBundle. The source oracle deliberately shares the core language engine; this fixture validates native GUI-to-model/source parity rather than supplying an independent language implementation. Semantic checkpoint checks plus required exact saved/restored snapshot comparisons prove state and identity restoration only for the captured Undo/Redo/reopen sequence, not arbitrary history internals.

The self-check covers deterministic seeds, all eight OA/SA checkpoint fixed points, carriers with deliberately false parent/body/alias/description, rejected unrelated edits, wrong insertion order/parent/bindings, and a model-neutral change to the retained note. It also constructs two equivalent valid checkpoints with different fresh action IDs: each passes semantic prediction, while exact same snapshot comparison rejects their identity difference. It is not a native UI test. Current compile, self-check, generation, native action/return/scroll/recovery, screenshot and release evidence remain pending until recorded by root.