Skip to content

feat(generator): render the submittal register as a DOCX deliverable #452

Description

@thewrz

Why

The submittal register endpoint compiles products × required submittal types × datasheet
associations into structured JSON with findings — but the register's real-world destination is a
document deliverable issued alongside a package. Today every client that needs that document must
rebuild document rendering on its own, while SpecR's generator already owns DOCX output and CSI
styling. Rendering the register server-side keeps "one source of truth, many renders" true for
reports, not just specs.

What

  • Generator module: SubmittalRegister → DOCX — a titled table document (grouped by section:
    product, required submittal types, datasheet references), with an optional findings appendix.
  • Surface: format=docx content negotiation on the existing register route, or a sibling
    /submittal-register/generate — follow whichever pattern /specs/{id}/generate established;
    decide in review.
  • Reuse generator infrastructure (dolanmiu/docx, existing style plumbing); no new styling system.
  • Markdown render of the register via the shared renderer contract if cheap — keeps parity with
    how other artifacts render.
  • MCP: follow the existing generate_docx tool pattern (or MCP_UNEXPOSED with rationale if
    binary payload doesn't fit the tool surface); contract-map.ts entry either way.

Tasks

  • src/generator/: register→DOCX module (table layout, findings appendix)
  • src/api/: route/param + openapi.yaml same PR
  • src/mcp/: tool or explicit MCP_UNEXPOSED entry
  • Tests: golden structural assertions (headings, row counts, grouping) — structure, not pixels
  • Integration test: end-to-end from seeded project → non-empty DOCX

Acceptance criteria

  • One call produces a well-formed DOCX register for a project (optionally scoped to a package),
    grouped by section, consistent with the JSON endpoint's rows.
  • JSON and DOCX renders never disagree on content (same query underneath).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions