Skip to main content

Explicit active-document close

Released v0.11.0, package 0.11.0-mcp.1, protocol 13 and 32 MCP tools, includes close_document with an optional exact already-open clean document to activate before closing the captured active document. It does not close the last active document to Home. The contract distinguishes preflight refusal, verified completion and partial native lifecycle uncertainty. Earlier candidate evidence below retains its original build attribution.

Design and test boundaries​

The caller explicitly supplies both document identities, canonical paths and saved SHA-256 values. The existing queue synchronously activates the selected document, revalidates both native identities/clean state/hashes after activation and directly closes the original background document. Completion verifies absence of the closed target, unchanged saved files and the selected active document/view. No posted Close command, new scheduler, implicit open/save/discard or automatic restoration is included. Interrupted/cancelled native calls retain the original request's outcome; recovery does not repeat activation or close.

Core tests use the approved shared operation/retained-queue seam. tests/Mcp/ActiveCloseLive.cs is an official-SDK external client of the installed MCP executable. The test-only tests/LifecycleProbe add-in cancels one exact native DocumentClosing event in an explicitly scoped disposable run; it never executes lifecycle operations or changes models. Production lifecycle code has no dependency on the probe. With no run environment variable the probe is inert. Its temporary registration and signature must be inventoried and removed after qualification.

Reproduced installed-host failure — 2026-10-20​

The previously qualified installed 0.10.0-lifecycle.2 native source e0d8d2e7bb41675c4ba2a976f48018d406326030 reproduced a cancellation identity bug in actual Revit 2027.3. An external client opened copied A/B, activated A and requested background B close. The one-shot third-party cancellation was observed natively. The request returned retained lifecycle_unconfirmed and B remained open, but inspecting the already-open B returned a different host document ID. Both saved copies and their original retained SHA-256 3ae0941f3b5043c430a8df4e3e2e902189a899b4b2ef81b85336e6fb39bfd173; the exact owned process closed normally.

The repair retires identity only for invalid native document objects observed after DocumentClosed, instead of discarding it at DocumentClosing. Cancelled closes therefore preserve identity while still invalidating old captures through the revision counter. Earlier successful close/image/Home/lifecycle results remain attributed to their tested revisions; this additional failure does not redefine those tests.

Observed candidate qualification — 2026-10-20​

The qualified installed native source is a6b720c3c997cf77a268b78db0b04b112d87925d, immutable manifest SHA-256 8e5cfb42e8a0eb52927ca97fee0bc37426676b37917602074b43f856001fc902. The normal installed Revit 2027.3 process was PID 35772/start 639280950926197490/session c58434c1-5244-43c0-9f0d-322776549fcd. Trusted C# was disabled. Operations ran through the real external official-SDK client and immutable installed MCP executable, with no submitted C#, test host loader or UI lifecycle fallback. The separately registered cancellation probe only observed native open events and cancelled three explicitly armed close events.

  • 58 external MCP/native checks passed. Background cancellation preserved both exact IDs and the active view. The first activation of background-only B succeeded; the native probe recorded ActiveView:null on background opening. Wrong/same/stale/reopened IDs, dirty close and handoff documents, and mismatched saved hashes were refused without unintended activation or file changes. Reverse handoff closed only B and activated the exact reopened A. Last-active close without a handoff returned close_blocked with exact native state preserved.
  • Three real third-party native cancellations produced stable retained Unconfirmed receipts: one background close and two active closes. Active-close cancellation left the explicitly selected handoff document active and the original open under its unchanged identity; no restoration, discard or repeated close occurred.
  • One accepted active-close request lost its original response while outstanding: only its exact owned installed MCP server process was terminated. A second client polled the original ID to verified Completed with the exact handoff active. Reopening the closed original produced a new native ID; repeated recovery returned the same receipt and did not close that reopened document.
  • Source checks passed: build with zero warnings/errors; 532 unit, 75 MCP, 13 Agent, six WPF and 47 development-safety checks; 43 package-validator checks. Both review axes found no actionable issues, including the subsequent native correction. The unchanged installer harness passed from an inventoried shorter disposable root: 18 initial checks and 20 upgrade/recovery checks for the fixed package.
  • Local installation evidence is separate: the actual Windows setup for initial source 73b715d exited zero. Its first native run exposed a background-only ActiveView dereference before activation. That failed run retained unchanged source/A/B files and closed normally. The fix captures the view after successful native activation. The full signed a6b720c package then upgraded through the documented package installer with all Revit closed; all eleven first-party installed signatures verified using the existing persistent local development publisher. No new setup executable or public release is claimed for the correction.
  • Preservation: the original fixture retained SHA-256 3ae0941f3b5043c430a8df4e3e2e902189a899b4b2ef81b85336e6fb39bfd173. Only explicit disposable saves changed A to 012a20cecf85b35164ec0e029abf5ced0c8f16b6b28857d6875885b22384b502 and B to eeecdad3212a97d87530508c5bdd3cf4645b50fcddd3681832300755f93c1222; subsequent close/recovery preserved those bytes. Final active A was unmodified and the owned Revit process closed normally. The temporary probe registration was hash-checked and removed after process exit. Primary checkout, unrelated logo/registrations, working model, older installed bundles and non-owned PATH entries/type were preserved.

Private process/session bindings, original intents, null-view and cancellation observations, SDK transcripts, signed package/install receipts and cleanup records stay under ignored artifacts/active-close. Earlier Home/view/image and open/activate/save evidence remains intact and attributed separately.

Last-active-document close to Home, wider modal/native I/O failures, other machines and bounded model promotion remained separate gaps. No release, website deployment or promotional posts occurred during that candidate qualification.

Installed v0.11.0 qualification — 2026-10-21​

After v0.11.0 publication, the unchanged external SDK client repeated all 58 checks against the exact installed release runtime source 8aae9f9c11e9df629cfbb0a033cb9154e9536ddc, manifest SHA-256 bdfaa317a3b61d9b49277803d33f168b4b3fe0ecdb94ebd2f498a76976056445. Revit 2027.3 was PID 2200/start 639281859062853176/session 38b5eeaf-000f-4b50-bf6b-7301e975e563. Trusted C# was disabled. The copied, signed test probe only cancelled explicitly armed native close events; lifecycle operations used the installed MCP executable and existing production queue.

Three native cancellations preserved both live document identities and returned identical retained Unconfirmed receipts on recovery. Background cancellation preserved the active view. Active cancellation left the explicitly selected handoff active and the original open under its unchanged identity. Wrong, stale and retired IDs, dirty target/handoff documents and mismatched saved hashes were refused. Completed close/reopen produced fresh identities. This qualification covers the document-identity storage fix that followed the earlier candidate run.

Accepted active-close request cabab703-ffd5-4bab-aede-66b275383c25 lost its original response after only its owned MCP server was terminated. A separate external client recovered the original Completed receipt and exact handoff. Reopening the closed target and recovering again neither replayed close nor affected the reopened document. Reverse handoff and last-active-close refusal passed.

The original fixture retained SHA-256 3ae0941f3b5043c430a8df4e3e2e902189a899b4b2ef81b85336e6fb39bfd173. Explicit disposable saves produced A 2478c30e61ccab1bf450648efbb6e160f97caacb5e125bc8f47e1de991b2bbf9 and B 92f6ef0445638da352414f4d49a9f079661c60fe39bb42c73110074484e7aff4; close/recovery and normal process shutdown preserved those bytes. The final native A was unmodified. The temporary probe registration was hash-checked and removed after process exit; original registrations remained unchanged. The run journal contains no invalid-document or closed-handler exception.

Private intents, cancellation observations, native binding, SDK transcript, saved copies, journal identity and cleanup receipts remain under ignored artifacts/active-close/1bc97019-66a8-4688-9433-e6650806d35a. This is additional evidence for the published runtime; no binary rebuild or replacement asset is involved. Last-active close to Home and generic unattended warning handling remain unsupported. Keep >512 changed-ID work separate. Physical TimberFold calibration, cutting and assembly remain outstanding; ManufacturingReady=false. Website deployment and promotional posts remain separate.