Skip to content

fix(pdf): release export captures; record the architecture audit - #121

Merged
leoafarias merged 12 commits into
mainfrom
docs/architecture-adversarial-audit-review
Sep 23, 2026
Merged

leoafarias merged 12 commits into
mainfrom
docs/architecture-adversarial-audit-review

Conversation

@leoafarias

@leoafarias leoafarias commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Two things, relative to main:

  1. PDF export cleanup (superdeck_pdf).
    • PdfController.export() runs one export at a time, and ignores calls after dispose().
    • Captured slide images are released when an export fails, is cancelled, or the controller is disposed. They used to stay in memory.
    • The export dialog ignores a completion from a controller it has already replaced or disposed, so a stale export can't close a newer dialog.
    • The dialog accepts an optional SlideCaptureService, which the lifecycle tests use. It isn't part of the plugin's public exports.
  2. Architecture audit (docs). docs/maintainers/architecture-review/superdeck_architecture_adversarial_audit.md restores the corrected audit from docs: record corrected SuperDeck architecture audit #120, which was merged and then reverted. It now opens with a status note: refactor(playground)!: replace the saved-deck library with deck export #124 replaces the saved-deck library it examines, so its publication, saving and ownership findings no longer apply.

History on this branch, for context: a saved-deck ownership fix was added and then reverted here, because #124 removes the library that fix coordinated. That fix's MemoryDeckLoader.reload change moved to #124. The branch leaves no playground changes.

Impacted packages

superdeck_pdf (code, tests, changelog) and docs. No other package changes.

Commands run

  • fvm dart analyze --fatal-infos in packages/plugins/pdf: no issues
  • fvm flutter test in packages/plugins/pdf: 39 passing, including the new pdf_export_lifecycle_test.dart
  • After merging main: analysis clean in all 7 packages; playground tests passing
  • Links in the audit doc all resolve to files that exist

leoafarias and others added 6 commits September 21, 2026 20:36
Run the improve-codebase-architecture process against the reviewed
baseline and record the result in the audit: four candidates with
deletion-test verdicts, the size of each focused slice, findings the
first pass missed, and corrections to the first pass's own wording.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P2GhoLCcxJsj66fwofnxw9
Make the Markdown the standalone record, remove the drifting HTML
copy and the structural-check JSON, and narrow the publication,
loader, PDF, and engine conclusions to what the reviewed source
supports.
State that the publication work starts from those guarantees rather
than a class merger.

@leoafarias leoafarias left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation source review: accepted

Carrying forward the source-review outcome from #120 to this replacement PR. The head remains the exact reviewed commit, d0f7bcce7fe8b472fcba201f8d99d30a6ecc23d8. I rechecked the replacement PR's head and changed-file patch: it adds only the standalone Markdown audit. No new factual corrections are requested.

This is a review comment, not a merge action or permission to merge. Keep this PR open for the maintainer's decision.

Implementation remains separate from this documentation PR. Start with the ownership regressions in section 1: saves must not mix Markdown, artwork, and theme from different decks; a newer saved-deck selection must survive older generation completion; malformed opening and failed or abandoned result application must leave the previous deck coherent. Treat refresh() operation ownership independently. Follow with memory reload terminal completion and focused PDF entry/terminal cleanup.

A class merger, late-subscriber replay, and a new public PDF export-session module remain unproven design choices, not accepted implementation decisions. No builds, application runs, or tests were performed for this review, and these implementation scenarios remain unexecuted.

…, save, and open

Opening a saved deck now withdraws an in-flight generation's automatic publication; the retained result can still be shown or saved explicitly, and a save writes that result's Markdown, artwork, and theme together. The open saved deck is released only when a generated deck is accepted. Overlapping save, open, and refresh calls can no longer overwrite newer state, an open switches only after its Markdown decodes, and MemoryDeckLoader.reload re-emits the last terminal result.
Only one export runs at a time. Captured image bytes are released when an export fails, is cancelled, or the controller is disposed, and the dialog ignores a completion from a controller it has replaced or disposed. The dialog accepts a capture service for tests.
Resolve against #122 and #123 without restoring what they removed:
- Keep DeckLibraryController.openDeck; the ownership fix now reads it in production.
- Serialize retained generations with SlideSerializer instead of reviving DeckMarkdownCodec.encode.
- Drop the PDF dialog's disposed check rather than restoring PdfController.disposed; the dialog disposes a controller only when it replaces it or unmounts.
- Point imports and audit references at features/ai/generation, and state the renderer, assembly, and Mermaid decisions inline now that their notes are gone.
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit ff533c2):

https://superdeck-dev--pr121-docs-architecture-ad-rdit4vgv.web.app

(expires Fri, 23 Oct 2026 02:02:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9

The saved-deck library is being replaced by a one-shot export, which removes the concurrent saved and generated decks this fix coordinated. The MemoryDeckLoader.reload fix moves to that change.
@leoafarias leoafarias changed the title docs: record corrected SuperDeck architecture audit fix(pdf): release export captures; record the architecture audit Sep 23, 2026
@leoafarias
leoafarias merged commit 681dbf6 into main Sep 23, 2026
6 checks passed
@leoafarias
leoafarias deleted the docs/architecture-adversarial-audit-review branch September 23, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants