Files
FreeCADWasmDev/docs/current/PART_SECTION_CUT_PROGRESS.md

169 lines
10 KiB
Markdown

# Section Cut continuation checkpoint
Current continuation entry: `part-section-cut-recovery-checkpoint.md`.
Its 2026-09-17 13:08 UTC implementation/evidence supersedes the historical
stack-overflow, source-deletion and missing-fragments notes in this file.
Read that checkpoint first. Preserve this file as historical requirements,
not as the current first error.
## Current continuation, 2026-09-17 09:44 UTC
Batch `fe60ca67e100f30913333f7f`, selected `Part:desktop:Part_SectionCut`.
This section supersedes stale implementation/registration statements below;
older notes remain for their original requirements and history.
- Existing cases ARE registered in `tools/part-business-cases.mjs`. Prior
result `part-section-cut-business/2026-09-17T09-37-00-052Z/result.json`
completed native, FCStd and browser assertions, including desktop/mobile
canvas checks. Its status remains `not_implemented`, with no coverage tags.
- Added a native `refresh` operation to `PartSectionCutDocument.h`. It uses
persisted planes, retains linked original sources, appends newly visible
shapes, excludes the session itself and its owned helpers/results, persists Sources, and
rebuilds in the existing owner transaction. Existing OCCT/Part geometry is
reused. Parent/child filtering and transformed-link equivalence remain open.
- Admitted refresh in `part-desktop-adapter.ts` and mounted a `Refresh cut
sources` button in `part-section-cut-task.tsx`. Existing snapshot refresh
remains available for reloading committed settings after invalid edits.
- Added native assertions for plane/source preservation, helper exclusion,
volume, object count, and exact undo/redo snapshots; browser assertions
exercise the mounted refresh action and restored plane controls/table.
Newly introduced visible sources and deletion still need explicit cases.
- TypeScript check passed. Geometry-boundary check FAILED on existing
`web/src/partdesign-face-color-task.tsx` lines 2 and 3 (`three_outside_display`).
No verifier or allowlist was modified to suppress those findings.
- Focused `FreeCADWebDocumentProbe` rebuild was started through
`tools/web_build_lock.py`; its final result, sync and acceptance follow below.
- Existing local server: `http://127.0.0.1:5180/workbench.html` (HTTP 200,
COOP/COEP present). No server, deployment or external message was created.
The source reader reached its 16-window/48000-byte limit. Exact supplemental
requests for `SectionCutting.cpp:2384` (desktop refresh handler) and
`DocumentProbe.cpp:1321` (fixture payload) were rejected at that limit.
This is a source-budget boundary, not absent source. Do not repeat broad
exploration or replay unchanged acceptance. Next read those two anchors and
the desktop collectObjects implementation at `SectionCutting.cpp:344`.
Retained completion requirements: intersecting-object BooleanFragments mode;
automatic/manual cut-face and fragment colors; cut/fragment transparency;
desktop refresh/filtering/visibility rules; source deletion and transformed
links; singleton/document lifecycle; OPFS persistence and remaining proof areas.
IFC semantic export contract and all original/supplemental requirements remain
unchanged. No contract, verifier, proof requirement, acceptance machinery,
manual passing status or coverage-tag changes were made.
### Current first error and repair
The first focused rebuild passed and JS/WASM/worker artifacts were synced.
Acceptance evidence `business-evidence/f1d7d44e1f891399048bb542-20260917T094412332275.json`
reported a native stack overflow. Added durable per-request timestamps in the
case script (no verifier changes). Diagnostic acceptance evidence
`business-evidence/f1d7d44e1f891399048bb542-20260917T094500763555.json`
isolated it to request 11, `sectionCut/refresh`; source edit request 10 completed,
native load took about 0.4 seconds, and browser execution was not entered.
The source scan excluded owned children but omitted the session group itself,
allowing the group to become its own source. The exclusion now includes the
session name. A second focused rebuild is running to verify this repair.
Keep both failure records; no success is inferred from the diagnosis.
## Earlier checkpoint
Updated 2026-09-17 for batch `fe60ca67e100f30913333f7f`.
Selected requirement: `Part:desktop:Part_SectionCut`.
This is an implementation checkpoint, not acceptance evidence. The command is
still incomplete and unaccepted. Preserve every original and supplemental
requirement, including the unchanged IFC semantic export contract.
## Changes in this continuation
- Added `PartSectionCutDocument.h` and a `sectionCut` action in the existing
`DocumentProbe.cpp` owner. The helper uses the existing embedded FreeCAD/Part
Python bindings, App links, Part Compound, Part Box and Part Cut. Geometry
remains in the supplied FreeCAD/OCCT WASM. It creates a persistent group with
source links and plane settings, supports sequential X/Y/Z cuts, rebuilds
owned objects on Apply, and restores sources on Close unless Keep only cut
is requested. The existing document owner holds the transaction.
- Added module adapter validation and routing for Part_SectionCut, admitted the
document action in the facade, and mounted `PartSectionCutTask` in the shell.
The panel supplies axis enable/position/flip controls, Apply, Close, refresh,
undo/redo, a native object table and the existing geometry renderer. The
panel remains mounted when another command is selected until closed.
- Added exported assertion functions in
`tools/part-section-cut-business-cases.mjs`. Native assertions cover a box cut,
links, volume, history, failed-operation rollback, source edits, document
isolation, disabling axes and closing. Browser assertions exercise mounted
controls and request desktop/mobile canvas proof. These functions are NOT
registered in the existing Part entrypoint and have NOT executed. Their
fixture adapters, payload schema and browser locator assumptions still need
confirmation against the existing acceptance case infrastructure. No covers
tags or passing statuses were added.
## Checks and artifact state
- `cmake --build freecad-source/build-web/configure --target FreeCADWebDocumentProbe -j2`
completed successfully, including compilation and linking. Existing warnings
concerned pthread/memory growth, a copied range variable in WebMacroRecording,
and the long string in WebViewCommands.
- Copied only the resulting DocumentProbe JS/WASM/worker files from the build
tree's `bin` directory into `web/public/kernel` after the successful build.
- `npm --prefix web exec -- tsc --noEmit -p web/tsconfig.json` passed after fixing
the renderer props. The later change adds sectionCut to the action type union
and removes its temporary cast; it has not had a separate TypeScript rerun.
- `npm --prefix web run check:geometry-boundary` passed with no static findings.
This does not establish runtime geometry correctness.
- `node --check tools/part-section-cut-business-cases.mjs` passed syntax checking.
- Existing server `http://127.0.0.1:5180/workbench.html` returned HTTP 200. No new
server was started. No browser behavior or screenshots were verified.
## First attributable acceptance result
`python3 tools/run_business_acceptance.py --module Part --ids Part:desktop:Part_SectionCut --reuse`
returned `acceptance_incomplete`, passed 0, executedCount 1, and
`business route not implemented`. Evidence:
`docs/current/business-evidence/f1d7d44e1f891399048bb542-20260917T031444589559.json`.
This run occurred before the new assertion module and artifact sync. Do not
repeat that unchanged missing-case attempt; wire actual cases first.
## Next work and retained boundaries
1. Read the existing Part case entrypoint and one document/browser case using
the bounded reader. Register a run function that uses the existing native
owner, fixtures, report writer and browser setup. Confirm request schema,
setBox payload fields and renderer locator against those existing APIs.
Do not edit acceptance contracts, machinery, proof requirements or statuses.
2. Inspect native visibility serialization before running the case. The helper
currently writes WebVisibility and the object's native Visibility property;
mapping to snapshot `displayVisibility` is not established. Correct this
against the existing owner instead of weakening visibility assertions.
3. Confirm the desktop plane direction, boundary handling and source filtering
against SectionCutting.cpp. Current boxes cut the positive side by default,
and use the opposite side when flipped. Current source collection includes
visible objects exposing Shape; parent/child filtering and transformed links
still require desktop-equivalent behavior and executable proof.
4. Implement native session state serialization and restore panel values on
reopen/undo/document switch/FCStd reopen. React currently initializes plane
controls to zero. Reopening the same command after closing needs an explicit
activation event; the shell effect currently responds to command changes.
5. Preserve full dock semantics: intersecting-object BooleanFragments mode,
automatic/manual colors and transparency, custom plane support if required
by the source, refresh rules, delete/close/keep-only-cut behavior, singleton
lifecycle across documents and source/document deletion. The current core
is an incomplete axis-cut implementation, not the finished desktop workflow.
6. Add FCStd/OPFS persistence cases, invalid requests, transformed/multiple
sources and the remaining proof areas. Execute through the acceptance
runner, fix its first native/browser failure, then inspect desktop/mobile
screenshots and canvas checks. No acceptance claims precede those results.
Source recovery anchors: Command.cpp:2490 opens the singleton dock;
SectionCutting.cpp:1277 chains axis cuts; :1335 creates source links and chooses
Compound/BooleanFragments; :1455 creates the dock; destructor :1472 restores
source visibility unless keep-only-cut. Other available anchors are
createLinks around :1019, startObjectCutting :1115, createBooleanFragments :2555
and createCompound :2588. SectionCut.cpp does not exist; use SectionCutting.cpp.
The reader rejected further windows at its 16-window/48000-byte supplemental
budget, including an exact payload-anchor request. This is a source-budget
boundary, not missing source. Do not bypass the reader or alter its limits.
No full-parity/API gates, deployment, pushes, external messages, IFC reruns,
contract/verifier changes or manual acceptance status changes were performed.
All build/typecheck sessions started in this continuation have completed.