From 4797830a5d9f71bd89571466ff1f659332de14dd Mon Sep 17 00:00:00 2001 From: Thanakorn Date: Fri, 11 Sep 2026 16:47:46 +0700 Subject: [PATCH] Add Word rendering of the SDLC delivery package --- scripts/sdlc-delivery/convert-to-docx.py | 57 +++++++ scripts/sdlc-delivery/requirements.txt | 1 + scripts/sdlc-delivery/verify-content.mjs | 140 ++++++++++++------ ...0 Statement of Work 25690105 V1.0 ApS.docx | Bin 0 -> 120346 bytes ...t Repository Backup 25690824 V1.0 ThS.docx | Bin 0 -> 110198 bytes ...01-00 Work Schedule 25690213 V1.0 ApS.docx | Bin 0 -> 122851 bytes ...ftware Project Plan 25690213 V1.0 ApS.docx | Bin 0 -> 145359 bytes ...stomer Requirements 25690206 V1.0 NoC.docx | Bin 0 -> 129387 bytes ...gress Status Record 25690109 V1.0 ApS.docx | Bin 0 -> 108389 bytes ...gress Status Record 25690123 V1.0 ApS.docx | Bin 0 -> 109037 bytes ...gress Status Record 25690206 V1.0 ApS.docx | Bin 0 -> 108443 bytes ...gress Status Record 25690218 V1.0 ApS.docx | Bin 0 -> 108445 bytes ...gress Status Record 25690225 V1.0 ApS.docx | Bin 0 -> 108482 bytes ...gress Status Record 25690317 V1.0 ApS.docx | Bin 0 -> 108724 bytes ...gress Status Record 25690429 V1.0 ApS.docx | Bin 0 -> 108771 bytes ...gress Status Record 25690508 V1.0 ApS.docx | Bin 0 -> 109892 bytes ...gress Status Record 25690513 V1.0 ApS.docx | Bin 0 -> 110015 bytes ...gress Status Record 25690523 V1.0 ApS.docx | Bin 0 -> 110870 bytes ...gress Status Record 25690529 V1.0 ApS.docx | Bin 0 -> 114257 bytes ...gress Status Record 25690803 V1.0 ApS.docx | Bin 0 -> 108978 bytes ...gress Status Record 25690814 V1.0 ApS.docx | Bin 0 -> 109021 bytes ...gress Status Record 25690817 V1.0 ApS.docx | Bin 0 -> 109441 bytes ...gress Status Record 25690824 V1.0 ApS.docx | Bin 0 -> 109001 bytes ...Correction Register 25690817 V1.0 YaB.docx | Bin 0 -> 124201 bytes ...0 Acceptance Report 25690817 V1.0 ApS.docx | Bin 0 -> 111993 bytes ...01-00 Change Report 25690521 V1.0 NoC.docx | Bin 0 -> 115295 bytes ...01-00 Change Report 25690808 V1.0 ApS.docx | Bin 0 -> 114974 bytes ...01-00 Change Report 25690810 V1.0 SeV.docx | Bin 0 -> 115143 bytes ... Minutes Of Meeting 25690105 V1.0 YaB.docx | Bin 0 -> 112863 bytes ... Minutes Of Meeting 25690123 V1.0 YaB.docx | Bin 0 -> 112138 bytes ... Minutes Of Meeting 25690218 V1.0 YaB.docx | Bin 0 -> 112197 bytes ... Minutes Of Meeting 25690317 V1.0 YaB.docx | Bin 0 -> 111736 bytes ... Minutes Of Meeting 25690429 V1.0 YaB.docx | Bin 0 -> 111989 bytes ... Minutes Of Meeting 25690513 V1.0 YaB.docx | Bin 0 -> 111918 bytes ... Minutes Of Meeting 25690523 V1.0 YaB.docx | Bin 0 -> 112786 bytes ... Minutes Of Meeting 25690529 V1.0 YaB.docx | Bin 0 -> 112689 bytes ... Minutes Of Meeting 25690803 V1.0 YaB.docx | Bin 0 -> 112399 bytes ... Minutes Of Meeting 25690814 V1.0 YaB.docx | Bin 0 -> 112820 bytes ... Minutes Of Meeting 25690817 V1.0 YaB.docx | Bin 0 -> 113353 bytes ... Minutes Of Meeting 25690824 V1.0 YaB.docx | Bin 0 -> 113119 bytes ...tware Configuration 25690817 V1.0 ThS.docx | Bin 0 -> 111644 bytes ... Project Repository 25690817 V1.0 ThS.docx | Bin 0 -> 110745 bytes ...ftware Requirements 25690225 V1.0 NoC.docx | Bin 0 -> 125094 bytes ...-00 Software Design 25690306 V1.0 NoC.docx | Bin 0 -> 133078 bytes ...Traceability Record 25690306 V1.0 NoC.docx | Bin 0 -> 185187 bytes ...Software Components 25690817 V1.0 ThS.docx | Bin 0 -> 116706 bytes ...nd Test Procedures 25690731 V1.0 PaNg.docx | Bin 0 -> 137011 bytes ...001-00 Test Report 25690814 V1.0 PaNg.docx | Bin 0 -> 142827 bytes ...-26-001-00 Software 25690817 V1.0 ThS.docx | Bin 0 -> 111349 bytes ...tware User Document 25690814 V1.0 ThS.docx | Bin 0 -> 117494 bytes ...uct Operation Guide 25690817 V1.0 ThS.docx | Bin 0 -> 117587 bytes ...aintenance Document 25690817 V1.0 ThS.docx | Bin 0 -> 113757 bytes ...rification Results 25690317 V0.1 PaNg.docx | Bin 0 -> 113367 bytes ...rification Results 25690529 V0.2 PaNg.docx | Bin 0 -> 115302 bytes ...rification Results 25690731 V0.3 PaNg.docx | Bin 0 -> 111445 bytes ...rification Results 25690817 V1.0 PaNg.docx | Bin 0 -> 128041 bytes ...Validation Results 25690814 V1.0 PaNg.docx | Bin 0 -> 113191 bytes ...00 List of Evidence 25690824 V1.0 YaB.docx | Bin 0 -> 116609 bytes ...ject Charter Report 25690123 V1.0 YaB.docx | Bin 0 -> 115213 bytes ...takeholder Register 25690116 V1.0 YaB.docx | Bin 0 -> 110583 bytes ...TRACEABILITY-RECORD 25690817 V1.0 NoC.docx | Bin 0 -> 132255 bytes ...-00 Training Report 25690822 V1.0 YaB.docx | Bin 0 -> 111448 bytes 62 files changed, 151 insertions(+), 47 deletions(-) create mode 100644 scripts/sdlc-delivery/convert-to-docx.py create mode 100644 scripts/sdlc-delivery/requirements.txt create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/1.Statement of Work/200-WMS-26-001-00 Statement of Work 25690105 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/10.Project Repository (Backup)/200-WMS-26-001-00 Project Repository Backup 25690824 V1.0 ThS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/2.Project Plan/1-Work Schedule/200-WMS-26-001-00 Work Schedule 25690213 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/2.Project Plan/2-Software Project Plan/200-WMS-26-001-00 Software Project Plan 25690213 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/2.Project Plan/3-Customer Requirement/200-WMS-26-001-00 Customer Requirements 25690206 V1.0 NoC.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690109 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690123 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690206 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690218 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690225 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690317 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690429 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690508 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690513 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690523 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690529 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690803 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690814 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690817 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/3.Progress Status Record/200-WMS-26-001-00 Progress Status Record 25690824 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/4.Correction Register/200-WMS-26-001-00 Correction Register 25690817 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/5.Acceptance Report/200-WMS-26-001-00 Acceptance Report 25690817 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/6.Change Report/200-WMS-26-001-00 Change Report 25690521 V1.0 NoC.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/6.Change Report/200-WMS-26-001-00 Change Report 25690808 V1.0 ApS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/6.Change Report/200-WMS-26-001-00 Change Report 25690810 V1.0 SeV.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690105 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690123 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690218 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690317 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690429 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690513 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690523 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690529 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690803 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690814 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690817 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/7.Meeting Record/200-WMS-26-001-00 Minutes Of Meeting 25690824 V1.0 YaB.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/8.Software Configuration/200-WMS-26-001-00 Software Configuration 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/1-PM Process (10 Work Product)/9.Project Repository/200-WMS-26-001-00 Project Repository 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/11.Software Requirements specification (SRS)/200-WMS-26-001-00 Software Requirements 25690225 V1.0 NoC.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/12.Software design/200-WMS-26-001-00 Software Design 25690306 V1.0 NoC.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/13.Traceability record/200-WMS-26-001-00 Traceability Record 25690306 V1.0 NoC.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/14.Software Components/200-WMS-26-001-00 Software Components 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/15.Test Cases and Test Procedures/200-WMS-26-001-00 Test Case and Test Procedures 25690731 V1.0 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/16.Test Report/200-WMS-26-001-00 Test Report 25690814 V1.0 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/17.Software/200-WMS-26-001-00 Software 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/18.Software User Documentation/200-WMS-26-001-00 Software User Document 25690814 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/19.Product Operation Guide/200-WMS-26-001-00 Product Operation Guide 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/20.Maintenance Documentation/200-WMS-26-001-00 Maintenance Document 25690817 V1.0 ThS.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/21.Verification Result/200-WMS-26-001-00 Verification Results 25690317 V0.1 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/21.Verification Result/200-WMS-26-001-00 Verification Results 25690529 V0.2 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/21.Verification Result/200-WMS-26-001-00 Verification Results 25690731 V0.3 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/21.Verification Result/200-WMS-26-001-00 Verification Results 25690817 V1.0 PaNg.docx create mode 100644 sdlc-delivery/2-SI Process (12 Work Product)/22.Validation Result/200-WMS-26-001-00 Validation Results 25690814 V1.0 PaNg.docx create mode 100644 sdlc-delivery/3-Other Document/200-WMS-26-001-00 List of Evidence 25690824 V1.0 YaB.docx create mode 100644 sdlc-delivery/3-Other Document/200-WMS-26-001-00 Project Charter Report 25690123 V1.0 YaB.docx create mode 100644 sdlc-delivery/3-Other Document/200-WMS-26-001-00 Stakeholder Register 25690116 V1.0 YaB.docx create mode 100644 sdlc-delivery/3-Other Document/200-WMS-26-001-00 TRACEABILITY-RECORD 25690817 V1.0 NoC.docx create mode 100644 sdlc-delivery/3-Other Document/200-WMS-26-001-00 Training Report 25690822 V1.0 YaB.docx diff --git a/scripts/sdlc-delivery/convert-to-docx.py b/scripts/sdlc-delivery/convert-to-docx.py new file mode 100644 index 0000000..ae08957 --- /dev/null +++ b/scripts/sdlc-delivery/convert-to-docx.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +"""Convert the rendered delivery package from PDF to Word. + +The work products are authored in Markdown and rendered to PDF by +render-sdlc.mjs; the .docx beside each .pdf is a layout reconstruction of that +PDF, so the Word file keeps the page the reviewer signed off rather than being +laid out a second time from the source. + +Requires pdf2docx: pip install -r requirements.txt + +Usage: + convert-to-docx.py DELIVERY_DIRECTORY [PDF…] +""" +import sys +import os +from pathlib import Path + +from pdf2docx import Converter + + +def convert(pdf: Path) -> Path: + docx = pdf.with_suffix('.docx') + converter = Converter(str(pdf)) + try: + converter.convert(str(docx)) + finally: + converter.close() + return docx + + +def main(argv): + if not argv: + raise SystemExit(__doc__) + + root = Path(argv[0]) + pdfs = [Path(p) for p in argv[1:]] or sorted(root.rglob('*.pdf')) + if not pdfs: + raise SystemExit(f'No PDFs found under {root}') + + failures = [] + for index, pdf in enumerate(pdfs, start=1): + try: + docx = convert(pdf) + print(f'[{index}/{len(pdfs)}] {docx.relative_to(root)}') + except Exception as error: # noqa: BLE001 - reported, not swallowed + failures.append((pdf, error)) + print(f'[{index}/{len(pdfs)}] FAILED {pdf.relative_to(root)}: {error}', file=sys.stderr) + + print(f'{len(pdfs) - len(failures)}/{len(pdfs)} documents converted') + if failures: + raise SystemExit(1) + + +if __name__ == '__main__': + # pdf2docx is chatty; the per-document progress above is enough. + os.environ.setdefault('PDF2DOCX_QUIET', '1') + main(sys.argv[1:]) diff --git a/scripts/sdlc-delivery/requirements.txt b/scripts/sdlc-delivery/requirements.txt new file mode 100644 index 0000000..028fc32 --- /dev/null +++ b/scripts/sdlc-delivery/requirements.txt @@ -0,0 +1 @@ +pdf2docx>=0.5.8 diff --git a/scripts/sdlc-delivery/verify-content.mjs b/scripts/sdlc-delivery/verify-content.mjs index 03c6049..1881217 100644 --- a/scripts/sdlc-delivery/verify-content.mjs +++ b/scripts/sdlc-delivery/verify-content.mjs @@ -2,34 +2,24 @@ import { execFile } from 'node:child_process'; import fs from 'node:fs/promises'; import path from 'node:path'; import { promisify } from 'node:util'; +import { inflateRawSync } from 'node:zlib'; const execFileAsync = promisify(execFile); -function isTableLine(line) { - return /^\|.*\|\s*$/.test(line.trim()); -} - -function tableCells(line) { - return line.trim().slice(1, -1).split('|').map((cell) => cell.trim()); -} - -function isSeparator(cells) { - return cells.every((cell) => /^:?-{3,}:?$/.test(cell)); -} - function extractDocumentContent(markdown) { const titleMatch = markdown.match(/^#\s+.+\n+/m); const body = markdown .slice((titleMatch?.index ?? 0) + (titleMatch?.[0].length ?? 0)) .replace(/^\s*$/m, '') - .replace(//gi, ' '); // markup, not document text + .replace(//gi, ' ') // markup, not document text + // List markers are drawn by the renderer, not stored as text: the browser + // paints them from
    /