Skip to content

feat(nonconformances): investigations and impact assessments name their nonconformance - #92

Merged
gabalint merged 3 commits into
developfrom
feat/nonconformance-reference
Dec 2, 2026
Merged

gabalint merged 3 commits into
developfrom
feat/nonconformance-reference

Conversation

@gabalint

@gabalint gabalint commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

What

The first increment of the roadmap's next area, Nonconformances in OpenBGA Lab Ops: a nonconformance reference that works without Lab Ops (requirements OQ-008 and OQ-014).

  • An out-of-specification investigation and an impact assessment each carry at most one nonconformance: the quality system that holds it, its number and an optional https:// or http:// link. It sits beside the existing hand-typed references, which are unchanged.
  • It is offered at the escalation of an investigation, at the start of an assessment and at either conclusion. While the investigation or assessment is open, it can also be recorded from the record (reviewer or quality for an investigation, quality for an assessment) and corrected there with a reason. Each change is audited (nonconformance.recorded / nonconformance.corrected) and advances the record's revision, so a conclusion page opened before it goes stale.
  • A confirmed out-of-specification result, and an assessment with any record decided affected, are concluded only with a nonconformance or the reason none is needed. The signed conclusion keeps it: Investigation.nonconformance, or Assessment.evidence["nonconformance"], which is present only when there is one, so oq.impact-assessment/1 keeps its shape. A closed record shows what the conclusion kept.
  • The lot record export has a Nonconformances section. The product review data's investigation and impact-assessment tables gain three columns.
  • Nothing is sent to Lab Ops. Opening the nonconformance there is the next increment, and it waits for the Lab Ops inbound API.

Database

  • New app nonconformances:
    • 0001: the table, with check constraints for one subject, a named system and number, a web link and the correction columns.
    • 0002: the guard trigger. A reference is never deleted. It is written only while its investigation or assessment is open (read FOR SHARE). Every correction advances its revision, and what it belongs to never changes.
  • analytical.0015 adds the column (with a database default, so the old code can still insert) and extends the investigation guard.
  • impact.0003 extends the assessment guard.
  • Both guard changes keep every earlier rule.
  • Migrations were rehearsed forward, back and forward on a copy of the development database.
  • Deployment window: while the migrations run, a confirmed conclusion signed on the previous release is refused by the database. It is signed again once the new release serves. This is noted in the changelog.

Verification

  • Ruff, format, check, makemigrations --check, collectstatic and changelog --check all pass.
  • Full PostgreSQL suite on the final commit: 3704 passed, 3 skipped (build/gate/pytest-full-2.log); first gate on the feature commit 3700 passed, 3 skipped; affected browser journeys 6 passed.
  • New tests:
    • analytical/tests/test_nonconformance.py, including exact database-guard refusals, stale pages, validation of any caller's input and roles.
    • analytical/tests/test_nonconformance_views.py.
    • tests/test_assessment_nonconformance.py and tests/test_assessment_nonconformance_views.py.
    • A product review test.
    • These are traced under OQ-008 and OQ-014.
  • Browser:
    • New e2e/test_nonconformance_journey.py: a reviewer records the reference in the dialog; the confirmed conclusion keeps it; a second confirmed result is refused until the reason is given; the page fits a phone.
    • e2e/test_impact_assessment_journey.py now starts with a nonconformance.
    • The new journey found a real defect, fixed before review: the pre-filled system made a conclusion that gave only a reason fail.
  • The acceptance journey now refuses a confirmed conclusion without a nonconformance, then concludes with one.
  • An independent review (separate model, read-only) found no High findings. Its Medium and Low findings were addressed in the second commit:
    • The services check any reference they are given.
    • There is a link-scheme constraint.
    • Bidirectional, invisible and line-separator characters, and a user name in the link, are refused.
    • The guards check the shape of what is kept.
    • Closed records render from the kept copy.
    • The link is shown on the conclusion pages.
    • Stale-page, role and exact-guard tests were added.
    • Docs were corrected.
  • Not changed: if someone records a reference after a correction page opened, the first error you see asks for a reason. It is still refused as stale once one is given.

Docs

docs/product.md, docs/architecture.md, docs/regulations.md, website/roadmap.html (the Next card, and the Done cards for investigations and impact), 2 new and 8 updated page docs in docs/pages/, changelog.d/2026-12-01-nonconformance-reference.md and the regenerated CHANGELOG.md.

🤖 Generated with Claude Code

Gabriel Balint and others added 3 commits December 1, 2026 19:21
…ir nonconformance

An out-of-specification investigation and an impact assessment each carry at
most one nonconformance (the quality system, its number and a link), recorded
at the escalation, the start of an assessment or the conclusion, or from the
record while open, and corrected there with a reason. A confirmed result, and
an assessment with a record decided affected, are concluded only with a
nonconformance or the reason none is needed; the signed conclusion keeps it.
Database guards keep the reference and what the conclusion kept. The lot
record export and the product review data list it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t was kept

Address the independent review: the services check any Reference they are
given; a check constraint keeps the link an http(s) address; line separators,
bidirectional and invisible characters and a user name in the link are
refused; the guards require a kept value to be a reference with its number
or a reason; a closed record and the product review show what the conclusion
kept; the conclusion pages show the link; stale-page, role and exact guard
tests; the deployment window is documented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabalint
gabalint merged commit 56c8b57 into develop Dec 2, 2026
5 checks passed
@gabalint
gabalint deleted the feat/nonconformance-reference branch December 2, 2026 01: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.

1 participant