Files
FreeCADWasmDev/docs/current/web-commanddoc-52d993b1-checkpoint.md

193 lines
12 KiB
Markdown

# Web CommandDoc batch checkpoint
Batch: `52d993b1d7b5b6f34864ee56`, 2026-09-16.
Selected IDs: `Web:desktop:Recompute`, `Web:desktop:Std_Alignment`,
`Web:desktop:Std_Copy`, `Web:desktop:Std_Cut`.
## Continuation update, 2026-09-16 08:14 UTC
No implementation change or newly accepted ID in this continuation. Read this
section first next turn; reuse the source decisions below instead of spending
the renewed source budget on already-read adapters and task controls.
- The authorized runner was invoked with all four selected IDs and `--reuse`.
It executed four cases (`reused: false`), took 3.919 seconds, and reported
zero passed. Recompute still fails `Dimension edit leaves geometry pending
recompute`; Alignment, Copy and Cut still report `business route not
implemented`. Attributable evidence:
`docs/current/business-evidence/2b3179eb653c20fce21bb04b-20260916T081404558096.json`.
Do not replay these unchanged failures next turn before a relevant repair.
- The FIRST source read next turn must be:
`python3 tools/read_implementation_source.py freecad-source/src/WebAssembly/FreeCADCoreProbe/WebViewCommands.h --start 1835 --lines 60 --reason 'Missing shape acquisition patch anchor for premature Recompute geometry update'`.
This turn's normal and explicitly supplemental requests were rejected with
`Supplemental source budget reached (16 windows / 48000 bytes)`.
The native source exists; the early-recompute root cause is still unproven.
- The actual delegated executable case file remains
`tools/web-business-cases.mjs:102`. The bounded reader rejects this exact
file as outside the packet. `tools/web-acceptance-cases.mjs:16` delegates
unmapped IDs to it. Include that case extension point in the next packet
before inspecting or extending the selected native/browser cases. Do not
modify the acceptance wrapper or verifier to evade this boundary.
- Retained UI detail: `WebCommandDocTask` has direct Recompute/Copy/Cut buttons;
Alignment still falls through to the generic Review Selection/apply UI.
Real point selection, native alignment solve, apply and cancel are missing.
Desktop Alignment fixes the first GeoFeature, moves the second, requires at
least one correspondence, and clears selection when starting its task.
- Retained adapter detail: early guards validate document, PartBox ownership
and selected identities; Alignment checks two distinct identities and active
task state. Its final `DOCUMENT_COMMANDS` branch calls `execute("PartBox")`
for Alignment/Copy/Cut. Native rejection must remain explicit until the
actual clipboard and manual-alignment implementations exist.
No build was needed because implementation files were not changed. No tests
were added, no coverage tags or statuses were edited, and no contract,
verifier, proof requirements or acceptance machinery was changed. Preserve
all original and supplemental requirements, including the IFC semantic export
contract, dependency-preserving clipboard/paste/cut/undo behavior and actual
native/browser assertions. No parity/API gates, deployment, pushes or external
messages were performed. The runner session completed before this checkpoint.
## Continuation update, 2026-09-16 08:01 UTC
The earlier sections below remain historical context. No selected ID is accepted.
- Updated `web/src/web-desktop-adapter.ts` inside the `DOCUMENT_COMMANDS`
branch (around line 980): Alignment, Copy, and Cut now call the existing
`execute("PartBox")` document-view owner. This prevents the generic
`part.pythonFamilyBatch` fallback from returning command metadata as success.
Existing validation, native failure translation, and selection handling are
reused. This correction is not an implementation of clipboard or alignment.
- Confirmed `PartBoxProbe.cpp:4370` is a metadata-only fallback. The operation,
native flag, and recomputed flag there do not establish document mutations.
- Confirmed the actual owner chain: `part.viewCommand` ->
`NativeDocumentView.h:241` -> `executeDocumentCommand` in
`WebViewCommands.h`. That header has the existing commanddoc/recompute logic.
Its lines 1886-1891 explicitly reject Copy/Cut without a clipboard handler
preserving native data and Alignment without manual alignment/placement.
- Recompute's native implementation is `core_recompute_command` at
`WebViewCommands.h:375`; the commanddoc branch invokes it at 944-949.
It calls `doc.recompute(None, True, not proceed)` and handles transactions,
dependency errors and failed recomputes. Recompute itself was not changed.
- Console submission refreshes `Std_SceneInspector` in
`web-desktop-adapter.ts:389-407` (also a lower command wrapper near 950).
Native scene shapes are collected at `WebViewCommands.h:1854` and tessellated
at 2036-2048. The read-only inspector returns at 2049-2053 before the view
transaction. Shape acquisition before tessellation is still unread and is
the next anchor for investigating the early source-only geometry update.
Checks completed: project TypeScript check, static geometry-boundary check,
and normal Vite build with incremental public-asset synchronization all passed.
Existing WASM was reused; native files and shared dispatcher were not edited.
The build still reports the existing dynamic-import/chunk-size warnings.
Attributable runner command:
`python3 tools/run_business_acceptance.py --module Web --ids Web:desktop:Std_Alignment Web:desktop:Std_Copy Web:desktop:Std_Cut --reuse`
Result: 0 passed, 3 remaining, `business route not implemented`, 1.013 seconds.
Evidence: `docs/current/business-evidence/2d502bc51d07e0ba9dbe3bf1-20260916T080135399133.json`.
These cases do not reach the corrected route, so this is not browser proof of
the correction. The unchanged Recompute failure was not replayed.
Next continuation:
1. First read `WebViewCommands.h:1835` for 60 lines to inspect shape acquisition.
Both the normal and explicitly supplemental request were rejected by the
bounded reader with `Supplemental source budget reached (16 windows /
48000 bytes)`. Do not reinterpret this as missing native source or bypass
the source limit.
2. The executable Recompute case is `tools/web-business-cases.mjs:102`, as
retained previously. This turn's reader rejected that exact file because
it is not in the current packet, despite it being the delegated case file
named by `tools/web-acceptance-cases.mjs:16`. The next packet needs this
actual case extension point to implement/inspect browser cases within scope.
3. After identifying and fixing the premature recompute cause, run the isolated
Recompute acceptance ID. Preserve the existing pending-geometry assertion.
4. Implement real clipboard snapshot/dependency/paste/cut/undo behavior and
manual point alignment/apply/cancel in the native owner and mounted UI;
add executable native/browser assertions before declaring coverage.
No contract, verifier, acceptance machinery, coverage tag, or passing status
was manually edited. IFC requirements and all original/supplemental scope
remain intact. No full parity/API gate, deployment, push, or external message.
## Changes completed this turn
- `web/src/web-desktop-adapter.ts`: Alignment, Copy, and Cut now reject empty
or mismatched document IDs, a runtime owner other than PartBox, empty selection,
and malformed document/object identities before dispatch. Alignment also requires
two distinct selected identities and rejects an active task.
- `web/src/web-commanddoc-task.tsx`: added mounted Copy and Cut execution buttons
using the existing execute callback and selection flow; added human-readable
Copy, Cut, and Alignment titles. Alignment interaction is still incomplete.
- The shared dispatcher, native sources, acceptance machinery, contracts,
coverage declarations, and passing statuses were not edited.
- Existing WASM was reused. Frontend output was rebuilt with the normal Vite
configuration and incremental asset synchronization.
## Verification and exact first failure
Ran the authorized acceptance runner before edits:
`python3 tools/run_business_acceptance.py --module Web --ids Web:desktop:Recompute Web:desktop:Std_Alignment Web:desktop:Std_Copy Web:desktop:Std_Cut --reuse`
It executed four IDs in 3.918 seconds: zero passed. Evidence:
`docs/current/business-evidence/2b3179eb653c20fce21bb04b-20260916T074309092482.json`.
Recompute failed at `Dimension edit leaves geometry pending recompute`, before
the mounted Recompute button could establish its behavior. The recorded input
was document `RecomputeBusiness`, length `5`; actual values were objects
`[Source, Dependent]`, source volume `60`, dependent volume
`47.99999999999999`, length `5`, and other-document volume `60`.
The assertion requires length 5 and source volume different from `5 * 12`.
The source is already recomputed while its dependent remains at the previous
volume. This is an observation, not an established root cause. Inspect console
execution, shape access, and display refresh for an early partial recompute.
Preserve this assertion until desktop/native semantics establish the correct fix.
Alignment, Copy, and Cut were `not_implemented` in the executable business case
router, with no cases. This does not establish that native implementations are
absent. No new acceptance coverage is claimed for the UI/guard changes.
After edits, these checks passed:
- `npm --prefix web run check:geometry-boundary` (static ownership only).
- `node web/node_modules/typescript/bin/tsc --noEmit -p web/tsconfig.json`.
- `node web/node_modules/vite/bin/vite.js build web` (existing chunk size and
mixed static/dynamic import warnings).
- `git diff --check -- web/src/web-desktop-adapter.ts web/src/web-commanddoc-task.tsx`
(these paths were untracked already, so this is not a full patch validation).
The unchanged failing browser workflow was not replayed after edits that do not
address its failure. The new guards/buttons still need executable browser proof.
## Continuation anchors and boundaries
1. Read the missing selected native implementation at
`freecad-source/src/WebAssembly/FreeCADCoreProbe/PartBoxProbe.cpp:4340`
(handlers begin around 4371). Read adapter fallback around
`web/src/web-desktop-adapter.ts:938` in the original packet; the added guard
shifts that anchor by 21 lines. Preserve dependency and clipboard semantics.
2. The existing Recompute browser case is
`tools/web-business-cases.mjs:102`, failing at line 135. The case is reached
through `tools/web-acceptance-cases.mjs` for unmapped IDs. Recompute routes
through PartBox document view; the other three currently reach the generic
commanddoc family. Trace native ownership before changing routing.
3. Desktop semantics read from `freecad-source/src/Gui/CommandDoc.cpp`:
Cut delegates to the active view; Copy uses the focused view or selection
MIME data; Alignment requires exactly two GeoFeatures, fixes the first and
moves the second, starts manual alignment with at least one point, and clears
selection. Do not substitute placement-copying for point alignment.
4. Complete native clipboard snapshot/dependency/paste/cut/undo semantics and
point alignment apply/cancel behavior as necessary after reading those owners.
Add actual native/browser assertions for all selected commands using existing
acceptance case extension points; do not modify the runner/verifier to pass.
5. This turn's bounded reader reached its source budget and rejected both the
adapter window at 938 and the native window at 4340, including an explicitly
requested supplemental window: `Supplemental source budget reached
(16 windows / 48000 bytes)`. The files and native anchors exist. Resume with
those windows when the scheduler replenishes the budget; do not bypass it.
6. Keep the IFC semantic export contract and every original/supplemental
requirement intact. No IFC work, parity/API gates, deployment, pushes, or
external messages were performed. The four selected records remain pending.