Skip to main content

Home, clean close and view switching

Unreleased 0.10.0-lifecycle.2, protocol 11, extends the document lifecycle contract. PR #39 merged green as 68cb7c321b82bf6a46add57e9ae22e7f4096f519; its separate native evidence is preserved. This follow-up adds explicit Home captures, clean-only background close, native view/sheet switching and an independent retained-outcome pipe.

Rebuilt 0.11.0 close/reopen regression — 2026-10-21​

The normal installed 0.11.0-mcp.1 candidate initially failed this SDK workflow after its first successful background close: reopening the same path returned lifecycle_unconfirmed, then context and document discovery failed. Revit's journal recorded InvalidObjectException from the Foundation DocumentClosed handler. The identity table indexed and removed disposed native document dictionary keys. The failed run, original Unconfirmed request and unchanged model files remain retained; the request was not replayed.

Runtime fix 8aae9f9c11e9df629cfbb0a033cb9154e9536ddc keeps document/ID entries in a small list. It compares native equality only for valid live wrappers and retires invalid entries by position, without native hashing. A cancelled close leaves a valid entry and its opaque ID intact; fixture retirement still follows the retired entry's ID. Cancelled-close behavior is supported by the earlier dedicated qualification; this rebuilt run does not repeat that cancellation probe.

The rebuilt signed package has immutable manifest SHA-256 bdfaa317a3b61d9b49277803d33f168b4b3fe0ecdb94ebd2f498a76976056445. In normal Revit 2027.3 PID 17752, start 639281834659115765, session 2197e3dd-826d-4fbe-80f0-c070040ebfad, the unchanged external SDK workflow passed 56 checks. It covered Home background open/close/reopen, new versus retired document IDs, exact activation, template/missing/stale view refusals, dirty-close refusal, explicit save, wrong-document/hash guards and interrupted open/close/view-switch recovery. Trusted C# was disabled; no test loader, caller callbacks, UI lifecycle fallback or replacement request was used.

Four deliberately lost responses recovered their original GUIDs as terminal native outcomes: open 4faf192b-53af-45a3-ac2f-50756dadbcf9, close f288a394-3d27-430d-b255-a4799804ffd4, view activation 51be2ece-b1cd-41e1-a80b-fc7300a31e52 and close 7624cd7b-435a-48e8-8fd0-766add1ba3e5. An additional 16 SDK checks verified that document discovery returned only the surviving exact B identity after the closes, switched to exact native 3D/sheet views, refused stale image captures and verified inline PNG bytes, hashes, dimensions and stable outcome recovery. Both PNGs were visually inspected.

The native journal contains no closed-handler exceptions. Independent CLI context/discovery confirmed one clean B document before normal process closure. Original and untouched B retained SHA-256 3ae0941f3b5043c430a8df4e3e2e902189a899b4b2ef81b85336e6fb39bfd173; explicitly saved A retained d37ab2d3dbbb4d79d40ca4b4cbb48a8c8c91c368cf8e5ed68d9433c0d4ddb7c5. Private launch, SDK, journal, image and cleanup receipts are retained under ignored artifacts/release-0.11.0. These results qualify this package and fixture, not every native lifecycle condition or a later rebuilt payload. Release gates, physical fabrication and the >512 changed-ID work remain separate.

Test seams​

Shared queue tests verify pending acceptance, replay/recovery without repeated close, pre-execution cancellation, exact readback and rejection before execution at shutdown. Home is an explicit no-active-document snapshot, with valid session/revision pins and empty document/view IDs. View tests cover captured identity, invalid arguments, verified native view readback and state drift. Native background close checks exact document/path, clean state and saved hash; active close is rejected before any command is posted. It never saves or discards unsaved work.

tests/Mcp/UiLifecycleLive.cs is a real official-SDK external client of the immutable installed executable. It starts against an owned normal Revit process at Home, trusted code disabled, with original nonworkshared copied fixtures. It exercises background open/activation from Home, exact 3D/sheet switching, wrong/template/stale targets, dirty-close refusal, explicit save, background close/reopen identity, active-close refusal with exact state preserved, last-background-document close at Home, and background-close response recovery. Private intents precede interruption; an independent MCP client observes retained acceptance while the original reply is outstanding, then only the owned first MCP process is terminated. Original response loss and retained completion/repeated recovery are required. No submitted C#, ad-hoc callbacks, test loader or UI fallback is used.

The follow-up --ui-lifecycle-images client switches the remaining disposable B document to its exact 3D view and sheet, rejects the pre-switch capture, exports each native PNG, checks inline bytes/hash/IHDR dimensions, and recovers the identical PNG through the independent outcome pipe. Native context and modified state must remain unchanged by export.

Observed qualification — 2026-10-20​

The signed installed native payload came from e0d8d2e7bb41675c4ba2a976f48018d406326030, stage 0.10.0-lifecycle.2, protocol 11. Its immutable manifest SHA-256 is a250ef22520857c66f93e9ff439752cc90278524b846fc5e48ec3fbe4dc23cf7. All eleven first-party payload signatures verified with the existing persistent development publisher. Later changes in this branch add verification records and the focused image client; they do not change the qualified native code.

  • Repository check: build with zero warnings/errors, 520 unit checks, 75 MCP checks, 13 Agent checks, six WPF behavior checks and 47 development safety checks passed. The subsequent unit run also covered retained-outcome polling while the ordinary native pipe is occupied.
  • Packaging: 41 payload-validator checks and 18 isolated installer checks passed. The deep worktree installer-test path exceeded the existing native path resolver's limit; the unchanged harness and installer sources passed from an inventoried shorter disposable root. No path-resolver change is included. Actual Windows setup exited zero and installed the hash-pinned candidate.
  • Real external MCP/native cohort: 56 checks passed in Revit 2027.3, PID 14844, with trusted code disabled and no test loader or submitted C#. Home open/close preserved no-active-document state; activation and 3D/sheet switching read back exact native IDs. Wrong document IDs, closed/reopened IDs, stale captures, template/missing views and mismatched saved hashes were refused. Dirty close preserved the unsaved native state and disk; an explicit save affected only disposable A. Active close returned close_blocked with native B unchanged.
  • Four original replies were deliberately lost after another external client observed retained acceptance: Home background open, Home background close, view activation and background A close while B was active. Only each owned MCP server process was terminated. Every original request ID recovered its verified completion; repeated recovery returned the same result without replay.
  • Focused visual cohort: 15 additional checks passed. Both exact native views produced verified PNGs; stale captures were refused and PNG recovery worked through the new outcome pipe. Visual inspection matched the fixture's two-wall 3D view and minimal two-rectangle sheet. These fixtures qualify mechanics, not complex production graphics.
  • Preservation: original fixture and B retained SHA-256 3ae0941f3b5043c430a8df4e3e2e902189a899b4b2ef81b85336e6fb39bfd173. A changed only through the explicit save, to d172ce28002c67050dc2d9e849a154e50ae729f2f1f0abe6b21b60608b6129a6. The final active B was unmodified and the exact owned Revit process closed normally. The working-model file, primary checkout and unrelated logo/add-in registrations were preserved. The earlier installed bundle remains intact; PATH changed only its owned command entry, retaining the raw registry type and all other entries.

Prior installed-startup, image-export and document open/activate/save qualification remains separate and intact. Private copied models, launch/binding inputs, installer/signature/preservation receipts, original request intents, SDK transcripts and the two PNGs remain under ignored artifacts/ui-lifecycle. No release or public deployment occurred.

Remaining limits​

No dirty-document discard, SaveAs, sync, cloud/workshared/family/linked files, automatic modal dismissal, cross-session outcome store, model promotion or >512 changed-ID expansion. Active and last-active-document close are unsupported. Review exposed an ownership race in a posted native Close prototype: unrelated native closing events do not prove consumption of our posted command. That prototype was removed before installation. Native Document.Close(false) only closes background projects; no posted command or global close-event guard is installed. Revit/modal/third-party cancellation and timing permutations require separate qualification. Physical TimberFold fabrication and public release remain outstanding. No release or promotional post is part of this work.

Next: review and land this bounded slice, then establish a request-specific ownership/completion mechanism before implementing active/last-document close. Do not substitute an uncorrelated posted Close command. Qualify modal/third-party cancellation separately before promotion; retain the >512 changed-ID work as its own scope.