PRD + inventor design: submission generator v2 — sectioned composition, swappable base templates, in-app editing, building blocks #141
Open
opened 2026-05-26 16:27:02 +00:00 by mAi
·
6 comments
No Branch/Tag Specified
main
mai/planck/coder-b5-b6-train-share
mai/archimedes/fixer-port-engine
mai/maxwell/coder-b4-akte-mode
mai/lorenz/coder-b3-event-triggered
mai/euler/fixer-builder-add
mai/brunel/fixer-prod-500s-after-b1
mai/galileo/coder-b1-b2-mvp-train
mai/pasteur/fixer-pkg-litigationplann
mai/newton/coder-b0-scenario-db
mai/edison/inventor-prd-columnar
mai/knuth/coder-workflow-tracker
mai/atlas/inventor-extend-tools
mai/cronus/inventor-unified
mai/atlas/inventor-deadline-system
mai/atlas/inventor-followup-rules
mai/athena/consultant-deadline
mai/brunel/fixer-dark-mode-support
mai/knuth/coder-cronus-fristenrechn
mai/ritchie/coder-mig-153-proceeding
mai/atlas/inventor-proceeding
mai/cronus/inventor-fristenrechner
mai/curie/coder-mig152-clone-dedupe
mai/darwin/researcher-lexy-draft
mai/knuth/coder-dedupe-null
mai/cronus/coder-composer-slice-f
mai/cronus/coder-composer-slice-e
mai/cronus/coder-composer-slice-d
mai/curie/coder-slice-b6-url-rename
mai/curie/coder-slice-b5-go-rename
mai/cronus/coder-composer-slice-c
mai/curie/coder-slice-b4-destructive-drop
mai/cronus/coder-composer-slice-b
mai/cronus/coder-composer-slice-a
mai/cronus/inventor-prd-for
mai/knuth/coder-verfahrensablauf
mai/ritchie/coder-make-backup
mai/diesel/fixer-dark-mode-css
mai/curie/coder-slice-b3-read-cutover
mai/diesel/fixer-verfahrensablauf
mai/curie/coder-slice-b2-dual-write
mai/cronus/coder-slice-d-scenarios
mai/knuth/coder-backfill-applies
mai/hermes/gitster-verfahrensablauf
mai/cronus/coder-berufung-labels-refactor
mai/diesel/hotfix-2-mig-134-missing
mai/curie/coder-slice-b1-procedural-events
mai/cronus/coder-slice-c-upc-snapshot
mai/brunel/hotfix-rename-upc-apl
mai/cronus/coder-slice-b3-primary-party
mai/cronus/coder-slice-b2-catalog-query
mai/cronus/inventor-litigation-slice-b
mai/curie/researcher-slice-b-zero
mai/cronus/inventor-litigation
mai/artemis/gitster-remove-admin
mai/ritchie/coder-sort-post-trigger
mai/knuth/coder-conditional-label
mai/hermes/coder-verfahrensablauf
mai/brunel/rebase-121-conditional
mai/knuth/coder-conditional-rule
mai/hermes/gitster-dark-mode-fix
mai/ritchie/coder-submission-form
mai/artemis/gitster-re-surface
mai/brunel/fixer-views-any-filters
mai/cronus/coder-cicd-slice-a
mai/knuth/coder-wave-1-tier-1-rule
mai/ritchie/coder-upc-damages-add
mai/cronus/inventor-ci-cd-pre
mai/brunel/rebase-108-language
mai/hermes/gitster-admin-rules-list
mai/artemis/gitster-submission
mai/icarus/gitster-verfahrensablauf
mai/orpheus/gitster-search-input
mai/atlas/coder-event-card-choices-slice-ab
mai/hermes/gitster-date-range
mai/demeter/gitster-submission
mai/knuth/coder-hl-patents-style
mai/hermes/gitster-draft-editor
mai/atlas/inventor-per-event-card
mai/knuth/coder-deadline-rule-tier
mai/cronus/coder-procedural-events-slice-a
mai/hermes/gitster-deadline-form
mai/artemis/gitster-add-missing-i18n
mai/demeter/gitster-paliadin-chat
mai/brunel/wave0-tier0-deadline-fixes
mai/artemis/coder-docker-compose-yml
mai/icarus/coder-inbox-overhaul-slice-a
mai/atlas/coder-date-range-picker-slice-a
mai/brunel/fixer-de-inf-lg-cfi
mai/cronus/inventor-procedural
mai/hermes/gitster-event-type-modal
mai/cronus/coder-backup-mode
mai/curie/researcher-bulletproof
mai/hermes/gitster-draft-editor-focus-jump
mai/cronus/inventor-backup-mode
mai/hermes/gitster-submissions
mai/artemis/gitster-deadline-form
mai/brunel/fixer-submission-preview
mai/brunel/fixer-test-data-reset
mai/artemis/gitster-approval-withdraw
mai/demeter/gitster-events
mai/hermes/gitster-sidebar-loses
mai/hermes/gitster-browse-a
mai/brunel/fixer-submissions-demo
mai/icarus/inventor-inbox-overhaul
mai/atlas/inventor-symmetric-date
mai/artemis/gitster-demote-daten
mai/hermes/gitster-team-view-mailto
mai/knuth/coder-global-schriftsatze
mai/knuth/coder-schriftsatze
mai/ritchie/coder-author-demo-docx
mai/knuth/coder-add-schriftsatze
mai/knuth/coder-add-checklist
mai/knuth/coder-anchor-lookup-must
mai/tesla/dashboard-resize-clamp
mai/knuth/coder-demote-projekt
mai/knuth/coder-paliadin-chat
mai/knuth/coder-print-views
mai/knuth/coder-add-proceeding
mai/knuth/coder-submission
mai/ritchie/coder-extend-team-email
mai/knuth/coder-changelog-catch-up
mai/tesla/dashboard-overlap
mai/pasteur/fixercoder-dashboard
mai/newton/inventor-configurable
mai/dirac/inventorcoder-user
mai/gauss/inventorcoder-team-admin
mai/kepler/inventorcoder-project
mai/darwin/roadmap-ccr-en
mai/euler/coder-small-ux-polish
mai/darwin/fristenrechner-cleanup
mai/darwin/fixercoder-priority-bug
mai/leibniz/inventor-caldav-multi
mai/hertz/inventor-unified-modal
mai/archimedes/inventor-excel-data
mai/boltzmann/inventor-gap-tolerant
mai/copernicus/submission-slice-1
mai/fermi/interactive-session
mai/hertz/inventor-suggest-changes
mai/copernicus/inventor-submission
mai/mendel/test-strategy-slice-1
mai/mendel/inventor-test-strategy
mai/ampere/custom-views-improvements
mai/joule/mig-097-apply-huygens-s
mai/ohm/workstream-b-rename
mai/huygens/workstream-a-backfill
mai/kelvin/t-204-phase-2-proceeding
mai/bohr/ingest-t-paliad-203-rule
mai/curie/fristenrechner-gap
mai/maxwell/inbox-grey-out
mai/rutherford/slice-9-follow-up-b-re
mai/dirac/slice-9-follow-up-a
mai/bose/determinator-cascade-slice-3
mai/bose/determinator-cascade-slice-2
mai/bose/determinator-row-cascade
mai/lorenz/fristen-phase-3-slice-9
mai/curie/fristen-phase-3-slice-12
mai/planck/aichat-phase-b-paliad
mai/young/fristen-phase-3-slice-11b
mai/lorenz/fristen-phase-3-slice-11a
mai/lorenz/fristen-phase-3-slice-10
mai/lorenz/fristen-phase-3-slice-8
mai/lorenz/fristen-phase-3-slice-7
mai/lorenz/fristen-phase-3-slice-6
mai/lorenz/fristen-phase-3-slice-5
mai/lorenz/fristen-phase-3-slice-4
mai/lorenz/fristen-phase-3-slice-3
mai/lorenz/fristen-phase-3-slice-2
mai/lorenz/fristen-phase-3-slice-1
mai/pauli/fristen-phase2-design
mai/tesla/project-timeline-chart
mai/pauli/fristen-logic-audit
mai/pauli/determinator-b1-row-by
mai/noether/tools-cleanup-slice-1
mai/kelvin/inventor-tools-surface
mai/planck/paliadin-per-user-rls
mai/maxwell/bug-bundle-filterbar
mai/faraday/project-timeline-chart
mai/schroedinger/smarttimeline-slice-4
mai/bohr/smarttimeline-slice-3
mai/gauss/smarttimeline-slice-2
mai/riemann/filterbar-phase-2-slice
mai/lagrange/smarttimeline-design-the
mai/curie/researcher-determinator
mai/noether/collapse-regel-typ-on
mai/riemann/inventor-universal
mai/minkowski/project-level-our-side
mai/dirac/inventor-inline-paliadin
mai/feynman/fristenrechner
mai/minkowski/navbar-dashboard-reorg
mai/shannon/approval-rework
mai/einstein/consultant-deadline-data
mai/curie/researcher-upc-rop-audit
mai/noether/paliadin-real-claude
mai/noether/inventor-paliadin
mai/hilbert/inventor-approval-policy
mai/shannon/bug-frist-due-date
mai/fritz/bug-fristen-termine
mai/godel/inventor-projects-page
mai/fritz/bug-paliadin-chat
mai/kepler/inventor-profession-vs
mai/noether/inventor-paliadin-in-app
mai/fritz/bulk-team-email-send-to
mai/noether/inventor-local-chat-for
mai/noether/inventor-data-display
mai/fritz/bug-derived-team-members
mai/fritz/bug-sidebar-visibly
mai/noether/inventor-project
mai/shannon/bug-project-team-add
mai/cronus/inventor-dual-control
mai/fritz/bug-edit-mode-on
mai/cronus/inventor-holidays-per
mai/ritchie/phase-h-ai-deadline
No results found.
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: m/paliad#141
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
m (2026-05-26 18:26): "We still dont have user choice for our submission generator? Bro... we should do our own prd for the submission generator with an inventor. I want to have different sections, selectable 'base templates', editability of content, building blocks etc."
Current state is too thin:
submission_vars.go.What m wants — a v2 spec authored by an inventor before any code work starts:
Headline requirements (m's words mapped to design surface)
paliad.submission_drafts) and feed back into the rendered .docx.Open design surface for the inventor to resolve
submission_drafts.sections[](jsonb)? A separatesubmission_sectionstable? How do building blocks relate to sections (FK / copy-on-insert / live-reference)?mWorkRepoper-base directories? asubmission_basestable?)? How is the base swapped after content is authored — do edits survive a base change?{{party.*}}/{{court.*}}/{{lawyers.*}}(latter from #139) — do they stay placeholder-based or get bound at compose time per section?submission_drafts(7 live rows on prod) — how do they transition? Per-code default sections to seed v2 drafts?submission_drafts.updated_at.Inventor deliverables
docs/design-submission-generator-v2-2026-05-26.mdwith the full PRD: scope, data model, slice plan (A → ... → Z), risk assessment, migration path.Hard rules
mai instruct headfor real ambiguity. Open design questions go into the doc as 'recommended default + alternatives' for m to pick.{{rule.X}}placeholder alias contract (never break Word templates already in mWorkRepo).Acceptance for this issue
Slice A shipped on
mai/cronus/coder-composer-slice-a@e2969fcSubmission generator v2 (Composer) Slice A per the design at
docs/design-submission-generator-v2-2026-05-26.md§12.What landed:
submission_basescatalog +submission_drafts.base_id+composer_metacolumns +submission_sectionsper-draft rows. Seed rows forhlc-letterheadandneutralbases with 10-section defaults each.GET /api/submission-basescatalog endpoint; PATCH endpoints acceptbase_id.submissionDraftViewgainsbase_id,composer_meta,sections.TestFamilyOfCode,TestBaseSectionSpec_*) + live integration (TestComposerSeedFlow, TEST_DATABASE_URL-gated) covering the seed flow end-to-end.Hard constraints honoured:
base_id IS NULL OR no sections rows).{{rule.X}}aliases preserved (unchanged from v1).Build hygiene: go build/vet/test -short clean; bun run build clean (2900 i18n keys, data-i18n scan clean).
Migration slot coordination: Live DB at v106; main has migs through 145. Claimed 146/147/148. Dry-run dependent-failure for 146-148 matches the existing 130/131 pattern (those also depend on 119's
submission_draftswhich the live DB hasn't applied yet). Cumulative apply at Dokploy boot resolves it.Status: SLICE A COMPLETE — ready for merge. Inventor parked, head dispatches Slice B.
Slice B shipped on
mai/cronus/coder-composer-slice-b@f963b0dThe "Composer actually works" milestone — editable prose sections + anchor-spliced render + MD→OOXML walker for paragraphs.
Backend (~1200 LoC + tests):
submission_md.go— Markdown → OOXML walker (paragraphs + B/I + nested formatting + CRLF + XML escape). 12 unit tests.submission_compose.go— anchor-spliced render pipeline. ConvertDotmToDocx pre-pass → extract document.xml → render each section's content_md → splice via{{#section:KEY}}/{{/section:KEY}}anchors → strip excluded → append unanchored before sectPr → repack → v1 placeholder pass. 6 unit tests covering anchor mode, append mode, excluded drop, placeholder resolution, lang column pick, order_index ASC.submission_section_service.go—SectionPatch+Updatemethod, 6 optional fields (content_md_de/en,included,label_de/en,order_index).submission_sections.go—PATCH /api/submission-drafts/{draft_id}/sections/{section_id}. Owner-scoped via SubmissionDraftService.Get; section-belongs-to-draft cross-check.submission_drafts.go—exportSubmissionDraftbranches on draft.BaseID. Composer pipeline when set + base + bytes + sections all resolve; else v1 fallback. Audit metadata gainscomposer: true+base_id.files.go—fetchComposerBaseBytes+composerBaseSlugMapreuse the existing Gitea proxy cache.Frontend (~400 LoC + ~80 LoC CSS):
domToMarkdownwalks the contentEditable's DOM tree back to Markdown source-of-truth.state.view.sectionsin-place; full repaint only on structural changes.Templates regenerated on Gitea (mAi-uploaded):
_skeleton.docx— anchor-only body. New blob:ac0cdeaf…_firm-skeleton.docx— anchor-only body, sectPr preserved (firm header/footer rIds intact). New blob:f1e9a9fb…gen-skeleton-submission-templategains-anchorsflag (default true) for future regens.Build hygiene: go build/vet/test -short ./internal/... ./cmd/... all clean; bun run build clean (2900 i18n keys).
Hard rules honoured:
{{rule.X}}aliases preserved (v1 renderer pass unchanged inside composer).Status: SLICE B COMPLETE — ready for merge. Head dispatches Slice C (building blocks).
Slice C shipped on
mai/cronus/coder-composer-slice-c@ee98db9Building blocks library + section picker per design §8 / §4.4 and Q2/Q9 ratifications.
Schema (mig 149):
submission_building_blocks— library catalog (slug, firm, section_key, proceeding_family, title/desc/content_md per lang, author, visibility, is_published, soft-delete). RLS coarse-grained SELECT; tier predicate applied in Go.submission_building_block_admin_versions— append-only history (retention=20); admin-side only, NOT referenced from sections per Q2.Backend:
BuildingBlockService(~510 LoC) —ListVisible(tier predicate),ListAllForAdmin,Create/Update/SoftDelete/RestoreVersion(all transactional w/ retention-20 GC),InsertIntoSection(Q2's plain-text paste — no lineage stamped).GET /api/submission-building-blocks,POST .../insert-into/{section_id}) + admin editor under/api/admin/submission-building-blocks/*and/admin/submission-building-blockspage.Frontend:
/admin/submission-building-blocksadmin shell + ~370 LoC client (3-pane: list / form / version log).+ Bausteinbutton on the Composer editor toolbar opens a modal with 200ms-debounced search; click a hit → POST insert-into → section content updated in place.Tests: 3 pure-unit tests covering visibility constants + paste-content append behaviour.
Build hygiene: go build/vet/test -short clean; bun run build clean (2906 i18n keys).
Hard rules honoured:
{{rule.X}}aliases preserved (block content flows through v1 placeholder pass on export).Status: SLICE C COMPLETE — ready for merge. Head dispatches Slice D (rich-prose extensions to MD→OOXML walker).
Slice D shipped on
mai/cronus/coder-composer-slice-d@6778497Rich-prose features: headings 1-3, bullet + numbered lists, blockquote, inline hyperlinks. No new migrations.
MD walker (+320 LoC):
RenderMarkdownToOOXMLWithStylesentry point;RenderMarkdownToOOXMLis back-compat wrapper.splitMarkdownBlocksclassifies lines (heading/list/quote/paragraph); 3-space indent tolerance; "N. " and "N) " numbered markers.[label](url)routes through optionalHyperlinkAllocator; emits<w:hyperlink r:id="…">with "Hyperlink" char style on label runs.Composer (+130 LoC):
composerLinkAllocatordedupes URLs to rIds outside the base's namespace (rIdComposer1..N).patchDocumentXMLRelsappends matching<Relationship Type="…/hyperlink" Target="URL" TargetMode="External"/>rows toword/_rels/document.xml.rels. Idempotent on existing rIds. Returns the patched parts slice (caller overwrites — append may grow the backing array).Frontend:
domToMarkdownserializes<h1-3>,<ul>/<ol>with ordinal counter for numbered,<blockquote>line-prefix,<a href>→[label](url).Tests:
Build hygiene: go build/vet/test + bun run build all clean.
Trade-offs documented:
<w:numPr>markup. Honours stylemap entry without needing numbering.xml mutations; lawyer can apply real Word list style post-export.textContent = mdso toolbar-applied formatting reverts to literal MD after autosave. Acceptable Slice D trade; MD→DOM paint is a future polish.Hard rules honoured:
{{rule.X}}aliases preserved (walker passes placeholders verbatim).Status: SLICE D COMPLETE — ready for merge. Head dispatches Slice E (specialist bases) next.
Slice E shipped on
mai/cronus/coder-composer-slice-e@94310baSpecialist base templates + base-swap content survival + generic generator.
Mig 150 seeds two new firm-agnostic
submission_basesrows:lg-duesseldorf(proceeding_familyde.inf.lg) — Times New Roman 11pt, plain headingsupc-formal(proceeding_familyupc.inf.cfi) — Calibri 11pt, UPC-blue (#1F3864) headings, Cambria italic blockquoteBoth share the same 10-section spec.defaults shape; stylemaps target LG-Body / UPC-Body and family-prefixed Heading1-3 / ListBullet / ListNumber / Quote styles.
scripts/gen-submission-base/main.go(NEW, ~240 LoC) — generic generator with-presetflag (lg-duesseldorf | upc-formal). Each preset hard-codes typography; output is byte-reproducible. Emits minimal Composer-mode .docx (Content_Types + rels + styles.xml + anchor-only document.xml + empty rels envelope for Slice D hyperlink rels patch to splice into).Gitea uploads (via mAi):
6 - material/Templates/Word/Paliad/Composer/lg-duesseldorf.docx→ 82f57b3c6 - material/Templates/Word/Paliad/Composer/upc-formal.docx→ 41b9a388Backend wiring: two new
fileRegistryslugs +composerBaseSlugMaprows sofetchComposerBaseBytesroutes the new catalog rows to the new Gitea objects.Test:
TestComposer_BaseSwapPreservesContentpins Q10's contract — same draft composed against HLC vs LG stylemap → content survives both ways, stylemap diff visible in OOXML, no cross-leakage.Build hygiene: go build/vet/test + bun run build all clean.
Hard rules honoured:
Status: SLICE E COMPLETE — ready for merge. Head dispatches Slice F (reorder / hide / add-custom-section) next + final.
Slice F — FINAL — shipped on
mai/cronus/coder-composer-slice-f@bd7896eReorder / delete / add custom section. Closes Composer A→F.
Backend:
SectionService.Create(slug + labels + kind validation; auto-assigns order_index when 0; UNIQUE collision → ErrInvalidInput)SectionService.DeleteSectionService.Reorder(transactional; rewrites order_index to (1..N)×10)Frontend:
⋮⋮per-section handle (scoped so contentEditable selections inside the editor still work). Drop-target highlight + cleanup on dragend/drop/cancel.Tests: TEST_DATABASE_URL-gated live integration test exercising Create (with collision check) + Delete (with second-delete-returns-not-found) + Reorder (reverses 10 seeded sections + checks ascending order_index).
Build hygiene: go build/vet/test + bun run build all clean.
Hard rules honoured:
{{rule.X}}aliases preserved.Composer A→F complete
The full feature set ratified by m on 2026-05-26 is in place:
lg-duesseldorf+upc-formal(mig 150)All 5 migrations cumulative-apply at Dokploy boot. All four
.docxfiles (_skeleton.docx,_firm-skeleton.docx,lg-duesseldorf.docx,upc-formal.docx) are in Gitea Composer-mode (anchor-only bodies). 4 ratification-deviations from the original design held throughout: Q2 plain-text BB paste (no lineage), Q6 auto-upgrade rule (NOT in this slice train — explicitly deferred by head), Q10 fully-editable seeded sections, Q12 dissolved by Q2.Status: SLICE F COMPLETE — Composer A→F ready for merge.