Pipeline Architecture

Product and cybersecurity architecture understanding package generated from Markdown-derived requirements.

Last updated: 2026-06-25 12:57
RTRFQX Review TeamWorkspace

Pipeline Architecture

Product and cybersecurity architecture understanding package generated from Markdown-derived requirements.

Markdown-firstYesPDFs source-only
OCROffconfig.yaml
Downstream PDF analysisNoMarkdown-derived
AI/LLM API usedNorule/heuristic + human review

RFQX Pipeline Architecture

What each script does, what is deterministic vs heuristic vs AI-assisted, what needs human review, and what happens when new customer documents are added.

Architecture & Script Responsibilities

RFQX Pipeline Architecture

How the RFQX repository works, what each script does, what is deterministic vs heuristic vs AI-assisted, and what happens when input documents change.

1. What RFQX Does

RFQX turns a customer RFQ document set into a supplier-side working environment: customer requirement review, supplier proposals, open points, estimation impact, an initial cybersecurity concept, an initial system/security design, and derived supplier system requirements — all with traceability back to Markdown-derived sources.

2. Input Folders

FolderPurpose
configured customer input folderSource customer PDFs (source-only; never analysed downstream).
configured customer input folderManually corrected Markdown.
configured customer input folderCustomer feedback CSV/JSON exports (feedback loop).
converted/markdown*/Markdown produced from the PDFs.
converted/assets/Conversion-stage image assets and image_manifest.json sidecar.

3. Markdown-First Rule

All analysis runs on Markdown, never on the PDFs directly. PDFs are converted to Markdown first; every requirement keeps its Source document, section path and page reference. This keeps extraction auditable and stable.

4. OCR Policy

OCR is disabled (ocr_enabled: false in config.yaml). Pages with no extractable text are flagged for manual review rather than OCR'd. The built-in converter never performs OCR.

5. Main Scripts and Their Responsibility

See section 10 for the full table.

6. Generated Outputs

Requirements register, supplier proposals, open points, estimation impact, supplier system requirements + coverage, initial cybersecurity concept, system/security design, Jira requirement import payloads, workflow state, the HTML site, and the evidence package.

converted/assets/image_manifest.json is generated during conversion when image extraction is enabled. document_artifacts/ is generated from Markdown-derived tables, figures, diagrams, image references, and that converter sidecar. These artifacts are linked to nearby requirements and feed proposal, SSR, Jira, and per-document site context.

The generated HTML site uses a shared premium dashboard shell from scripts/generate_html_site.py: dark sidebar, topbar, page header, card system, modern filters, modern table wrappers, and user-facing source labels. Detail pages keep full text and traceability while avoiding raw internal Markdown path leakage in visible customer-facing HTML.

7. What Happens When New Documents Are Added

See section 13 (re-run behaviour). In short: convert → quality-check → extract → regenerate register, proposals, open points, SSRs, concept → regenerate site → validate. Customer decisions and feedback are never invented.

Static Feedback Authoring

The deployed static site can author feedback locally in the browser and export it as CSV/JSON. It does not write directly to the repository or server unless a backend is added later. Exported files are placed in configured customer input folder and ingested by scripts/ingest_customer_feedback.py.

Per-PDF Document Intelligence Re-run Behavior

When a new PDF is added and the pipeline is re-run:

  • a new document intelligence record is created
  • a new per-PDF page is created
  • requirements from that PDF are grouped under that page
  • SSRs derived from that PDF are linked
  • open points caused by that PDF are linked
  • design/concept/estimation impacts are recalculated
  • overall dashboards are also updated

Per-PDF Content / Section Filtering

  • Section filters are generated from converted Markdown, extracted requirement
  • metadata, section references, and page references.

  • Parent section filters include child requirements because each requirement row
  • stores the selected section plus all parent section IDs.

  • New PDFs automatically get section filters when numbered headings or
  • table-of-contents-like entries are detected.

  • If headings are not reliable, the document page falls back to page-based
  • filtering.

  • PDFs are not analyzed directly downstream; they remain source evidence only.

Table / Diagram Artifact Stage

  • scripts/convert_pdf_to_markdown.py is the only stage that may open PDFs for
  • image extraction; OCR remains false.

  • Extracted images are written under converted/assets/by_pdf/<slug>/ and
  • described in converted/assets/image_manifest.json.

  • scripts/extract_document_artifacts.py reads converted Markdown only.
  • It may read the converter image sidecar, but it does not open PDFs.
  • Table and diagram artifacts are written to document_artifacts/.
  • High/medium-confidence artifact links can enrich requirement review, supplier
  • proposal, SSR derivation, Jira description/rationale/verification criteria, and effort estimates.

  • Missing image assets are reported as converter coverage gaps; RFQX does not
  • pretend a visual diagram exists when only text/caption context was extracted.

8. What Is Deterministic / Rule-Based

  • PDF→Markdown conversion and page/section tagging.
  • Requirement extraction structure and IDs.
  • Requirement review register field assembly.
  • Supplier system requirement clustering and coverage maths.
  • Disposition assignment, traceability matrices, counts, coverage %.
  • Site generation and validation.

These produce identical output for identical input.

9. What Is Heuristic

  • Supplier position defaults (Accept / Accept-with-Assumption / Partial / …) from
  • keyword + mapping rules.

  • Security-relevance inference and capability/feature/interface mapping.
  • SSR category classification and clustering granularity.
  • Open-point topic matching and estimation impact levels.

Heuristics are conservative and explainable, but they approximate engineering judgment and should be reviewed.

10. What Requires AI/LLM Judgment

Currently no script calls an AI/LLM API (see analysis/source document). The outputs that would most benefit from AI assistance — nuanced requirement interpretation, bespoke supplier proposals, sharp clarification questions, and concept conclusions — are today produced by rules/heuristics or human review. An optional, controlled AI stage is designed in docs/source document.

11. What Requires Human Review

  • Low-confidence / human-review-flagged requirements.
  • Every supplier position before it is sent to the customer.
  • Responsibility (CIA/RASIC) decisions and open-point answers.
  • SSR statements before customer alignment.
  • The cybersecurity concept review with the Cybersecurity Manager and leads.

12. Known Limitations

  • Heuristic defaults are not a substitute for engineering review.
  • No AI stage is implemented; conclusions are only as good as the rules/heuristics.
  • Duplicate customer requirement IDs in the source are flagged Duplicate/Merged.
  • Screenshots require Playwright (not installed); export records the blocker.
  • Git remote is not configured; commits are local only.

13. How to Re-run the Pipeline

python scripts/run_full_analysis.py                       # convert + extract (when new PDFs)
python scripts/convert_pdf_to_markdown.py                 # rerun conversion and image sidecar when converter settings change
python scripts/extract_document_artifacts.py              # preserve Markdown tables/diagrams and link context
python scripts/generate_requirement_review_register.py    # register, proposals, open points, concept, SSRs
python scripts/generate_supplier_system_requirements.py   # SSR derivation + coverage + matrix
python scripts/generate_document_intelligence.py          # per-PDF records, traceability and impact data
python scripts/ingest_customer_feedback.py                # apply any customer feedback
python scripts/generate_expert_synthesis.py               # features/interfaces/capabilities/diagrams
python scripts/generate_jira_requirement_import.py --dry-run # Jira Requirement dry-run CSV/XLSX/payloads
python scripts/check_jira_import_payload.py               # validate Jira import payloads
python scripts/generate_html_site.py                      # build the site
python scripts/check_html_site.py                         # validate
python scripts/export_site_evidence.py                    # evidence package
python scripts/check_git_status.py                        # git status report

14. How to Validate the Result

python scripts/check_html_site.py must print "HTML site validation passed." It fails on missing pages/artifacts, OCR enabled, downstream PDF analysis, weak labels, insufficient SSR coverage, or unmapped active requirements without a disposition. Warnings (heuristic proposals, no AI stage, blocked SSRs, feedback not ingested) are expected and listed.

15. AI Assistance Gap Report

The current pipeline uses AI/LLM API: no. See analysis/source document for the scan result, the current rule/heuristic outputs, and the outputs that would benefit from controlled AI assistance.

16. Optional AI Stage Design

The optional AI stage is design-only. See docs/source document, prompts/, and schemas/. It reads Markdown-derived requirements only, never PDFs directly, returns schema-validated JSON, separates evidence from inference, marks confidence, and stays opt-in.

Script Responsibility Table

ScriptInputOutputDeterministic / Heuristic / AI-AssistedHuman Review Needed
convert_pdf_to_markdown.pycustomer PDFsMarkdownDeterministic (no OCR)Yes (partial pages)
check_converter_availability.pyenvironmentconverter reportDeterministicNo
check_markdown_quality.pyMarkdownquality reportDeterministic + heuristic thresholdsYes (low quality)
ingest_markdown.pyMarkdownchunksDeterministicNo
extract_requirements.pyMarkdownextracted_requirements.jsonHeuristic (pattern-based)Yes
extract_document_artifacts.pyconverted Markdown + review registerdocument_artifacts JSON/Markdown, table/diagram audits and linksDeterministic + heuristic linkingYes (low-confidence links)
generate_requirement_review_register.pyextracted reqs + mappingsreview register, proposals, open points, estimation, concept, design, workflow stateHeuristic defaults + deterministic assemblyYes (positions/proposals)
generate_supplier_system_requirements.pyreview register + models + open pointsSSRs, customer→supplier matrix, coverageHeuristic classification + deterministic clustering/mathsYes (SSR statements)
generate_document_intelligence.pymanifest + review register + SSRs + open points + estimationper-PDF document intelligence records, traceability matrix, diagrams, and page dataDeterministic + heuristic classification/scoringYes (document conclusions)
ingest_customer_feedback.pyfeedback CSV/JSON filesstatus deltas, source-aware decisions, open point closure candidates, updated registerDeterministicYes (decisions are source-classified)
generate_expert_synthesis.pyMarkdown-derived datafeatures/interfaces/capabilities/diagramsHeuristicYes
generate_jira_requirement_import.pyreview register + customer proposal package + document intelligence + SSR matrix + open points + Jira templateJira Requirement dry-run JSON, CSV, XLSX, validation, summary, and link planDeterministic + heuristic enrichmentYes before Jira import
check_jira_import_payload.pyJira dry-run payload + link plan + Jira templateJira import validation reportDeterministicNo
import_jira_requirements.pyvalidated Jira dry-run payload + .env or environment variablesJira Requirement issues, key map, link creation reportDeterministic REST clientYes, approval required before --create
generate_html_site.pyall generated dataHTML siteDeterministicNo
check_html_site.pysite + datavalidation resultDeterministicNo
export_site_evidence.pysitescreenshots + zipDeterministic (Playwright optional)No
check_git_status.pygit repogit status reportDeterministicNo

None of the above currently call an AI/LLM API.

Conversion-Stage Diagram Images

scripts/extract_pdf_images.py opens PDFs only in the conversion/asset stage. It extracts embedded images, renders diagram-candidate pages for vector figures, creates deterministic thumbnails, and writes converted/assets/image_manifest.json. extract_document_artifacts.py and all later stages consume Markdown and this sidecar only. OCR remains false.

The site generator copies only linked images and thumbnails into site/assets/document_artifacts/ and supplies the shared zoom/pan viewer. See docs/source document.

RFQX-36 — Numeric customer requirement ID extraction

Numeric, section-style customer IDs (6.15, 6.19.1, 4.2.3, 10.5.1) are detected only inside a requirement-table / structured-list context, in scripts/requirement_identity.py and scripts/pipeline_lib.py:

  • extract_numeric_customer_id(raw_text, context) + numeric_customer_id_confidence(...) grade a
  • candidate high / medium / low. Only high/medium replace the RFQX fallback customer ID.

  • numeric_requirement_rows(text) parses a chunk into per-row (customer_id, title, statement)
  • tuples, handling both inline (6.15 System Temperature) and stacked (ID alone on its line) layouts. Page-header noise (P / 1 / Page) and table headers (Req. ID Description) are stripped; one row never bleeds into the next.

Guards against over-detection:

  • A title ending in "requirements" with no normative body is treated as a section heading (low).
  • Rows are kept only when the block forms a sequence and/or carries shall/must/required.
  • A numeric token that wraps a prefixed customer ID (section 5.5.1.2.2 above REQ_UDS 0242) is
  • skipped so the prefixed ID is preserved.

  • Statements must start with a capital/digit (filters wrapped mid-sentence fragments and references
  • such as (Ref 14.14) / 4.16)).

The requirement title is preserved separately (requirement_title) and flows through the register, documents/by_pdf/*.json, the customer delivery package, the Jira import (Summary = numeric customer ID), and the site. RFQX REQ-AUTO-* IDs remain internal traceability IDs only.

Validation: check_jira_import_payload.py, check_html_site.py, and check_site_text_completeness.py fail on RFQX-as-customer-ID, title-merged-into-ID, or Req. ID Requirement text pollution, and warn on duplicate / low-confidence numeric IDs.

AI Assistance Gap

Show AI assistance gap report

AI / LLM Assistance Gap Report

Current pipeline uses AI/LLM API: No

A full scan of scripts/ finds no call to any AI/LLM API (no Anthropic/OpenAI SDK, no requests/HTTP call to a model endpoint, no local model invocation). All analysis is produced by deterministic code and conservative heuristics.

Which outputs are rule-based / heuristic today

OutputMethod
Requirement extractionHeuristic (pattern/keyword)
Supplier position defaultsHeuristic rules
Engineering expectation / supplier proposal textTemplated heuristics
Security relevance + capability/feature/interface mappingHeuristic keyword rules
Open pointsCurated topic matching
Estimation impact levelsHeuristic rules
Supplier system requirement derivationHeuristic classification + deterministic clustering
Cybersecurity concept conclusionsTemplated from aggregated data

Which outputs should be AI-assisted for better quality

  • Requirement interpretation (intent, ambiguity, implicit obligations).
  • Supplier proposal generation (bespoke, requirement-specific wording).
  • Customer clarification question generation (sharper, context-aware).
  • Supplier system requirement derivation (better clustering + statements).
  • Cybersecurity concept conclusion generation (assumptions, risks, gaps).

What structured prompts / schema are needed

Defined in docs/source document, with prompts in prompts/ and JSON schemas in schemas/. The AI stage must return structured JSON validated against those schemas — never free text.

Recommendation

AI/LLM-assisted analysis should be added as an optional, controlled stage for: requirement interpretation, supplier proposal generation, customer clarification generation, system requirement derivation, and cybersecurity concept conclusions. It must read Markdown-derived requirements only, never analyse PDFs directly, return schema-validated JSON, separate explicit evidence from inference, and mark confidence. Until implemented, conclusions are only as good as the current rules/heuristics plus human review.

Optional AI Stage Design

Show optional AI stage design

Optional AI Analysis Stage — Design

Design only. No API calls are implemented. This defines an optional, controlled AI/LLM stage that augments the rule/heuristic pipeline without replacing its deterministic, auditable core.

Position in the Pipeline

Markdown-derived requirements
        │
        ▼
  (optional) AI Analysis Stage  ──►  structured JSON (schema-validated)
        │                               │
        ▼                               ▼
  merge into review register / SSRs / concept  ──►  site + validation

The AI stage runs after requirement extraction and before site generation. Its JSON output is merged as a suggestion layer; deterministic assembly, traceability and validation are unchanged. If the AI stage is disabled, the rule/heuristic defaults are used (current behaviour).

Hard Rules

  • Read Markdown-derived requirements only; never analyze PDFs directly.
  • Return structured JSON validated against the schemas in schemas/; never free text.
  • Separate explicit evidence from inference (every field tags evidence vs inferred).
  • Mark confidence (high / medium / low) on every judgment.
  • Preserve source traceability (source_markdown, page_reference) on every item.
  • Output is a suggestion: a human reviews before it becomes a committed position.

Agents and Outputs

AgentPromptSchemaProduces
Requirement Reviewprompts/source documentschemas/requirement_review.schema.jsonsupplier proposal + position + open points per requirement
System Requirement Derivationprompts/source documentschemas/system_requirement_derivation.schema.jsonSSR candidates with many-to-many traceability
SSR Engineering Analysisprompts/source documentschemas/ssr_engineering_analysis.schema.jsongrouped duplicate/weak SSR findings, recommended rewrites, and open engineering questions
Cybersecurity Conceptprompts/source documentschemas/cybersecurity_concept.schema.jsonconcept conclusions, assumptions, risks, gaps

Controls

  • Batching: process requirements in capped batches; deterministic IDs.
  • Determinism: temperature 0; cache by input hash so re-runs are stable.
  • Validation: reject any non-conforming JSON; fall back to heuristic defaults.
  • Cost/scope guard: AI stage is opt-in via config flag (default off).
  • No silent overwrite: AI output lands in a *_ai_suggested field; merge is explicit.
  • Supplier system requirement control: generate supplier system requirement
  • candidates only from Markdown-derived customer requirements, with explicit evidence, inference, confidence, and open points.

  • Analysis-quality guardrails: group duplicate/near-duplicate SSRs, merge
  • repeated findings, remove vague filler wording, and flag missing affected IDs or missing recommendations before rendering HTML.

Inputs / Outputs Summary

  • Input: generated RFQX evidence (or extracted requirements), relevant Markdown excerpts.
  • Output: JSON files under an ai_suggestions/ folder, schema-validated, then merged on human approval.

Implemented Deterministic Guardrail

scripts/ssr_engineering_analysis.py now runs after SSR derivation and writes:

  • generated RFQX evidence
  • system_requirements/source document

This implemented step uses the same structured object expected from the optional SSR Engineering Analysis agent. It does not call an API. It detects duplicate or near-duplicate SSR statements, groups affected SSR IDs into one finding, normalizes vague recommendations, removes repeated findings, and feeds the compact results into supplier-system-requirements.html.